aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-06-03 22:52:40 +0200
committerJelmer Vernooij <jelmer@samba.org>2006-06-03 22:52:40 +0200
commit5973412f44269f6cb796c9d6d38c151290c7367a (patch)
tree90e402010c4c6f06ade9f55079a99c0ddd150095
parent9779c186bd6d396a6fde61cc215f2438d453ee97 (diff)
Try to detect -lldap
-rwxr-xr-xconfigure21
1 files changed, 13 insertions, 8 deletions
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<<EOF>>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