From 5973412f44269f6cb796c9d6d38c151290c7367a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 3 Jun 2006 22:52:40 +0200 Subject: Try to detect -lldap --- configure | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 97df1e27..c8a4c49f 100755 --- a/configure +++ b/configure @@ -142,16 +142,18 @@ echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings if [ -n "$CC" ]; then - echo "CC=$CC" >> Makefile.settings; + CC=$CC elif type gcc > /dev/null 2> /dev/null; then - echo "CC=gcc" >> Makefile.settings; + CC=gcc elif type cc > /dev/null 2> /dev/null; then - echo "CC=cc" >> Makefile.settings; + CC=cc else echo 'Cannot find a C compiler, aborting.' exit 1; fi +echo "CC=$CC" >> Makefile.settings; + if [ -n "$LD" ]; then echo "LD=$LD" >> Makefile.settings; elif type ld > /dev/null 2> /dev/null; then @@ -207,14 +209,17 @@ EOF detect_ldap() { - if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG ldb; then + TMPFILE=`mktemp` + if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then cat<>Makefile.settings -EFLAGS+=`$PKG_CONFIG --libs ldb` -CFLAGS+=`$PKG_CONFIG --cflags ldb` +EFLAGS+=-lldap +CFLAGS+= EOF ldap=1 + rm -f $TMPFILE ret=1 else + ldap=0 ret=0 fi } @@ -285,9 +290,9 @@ fi if [ "$ldap" = 0 ]; then echo "LDAP_OBJ=\# no ldap" >> Makefile.settings - echo "#undef LDAP" >> config.h + echo "#undef WITH_LDAP" >> config.h elif [ "$ldap" = 1 ]; then - echo "#define LDAP 1" >> config.h + echo "#define WITH_LDAP 1" >> config.h echo "LDAP_OBJ=storage_ldap.o" >> Makefile.settings fi -- cgit v1.2.3