aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure71
1 files changed, 67 insertions, 4 deletions
diff --git a/configure b/configure
index a3c16e75..fc9caffe 100755
--- a/configure
+++ b/configure
@@ -30,6 +30,7 @@ strip=1
ipv6=1
events=glib
+ldap=auto
ssl=auto
arch=`uname -s`
@@ -66,6 +67,8 @@ Option Description Default
--ipv6=0/1 IPv6 socket support $ipv6
+--ldap=0/1/auto LDAP support $ldap
+
--events=... Event handler (glib, libevent) $events
--ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto)
$ssl
@@ -140,21 +143,23 @@ else
echo 'CFLAGS=-O3' >> Makefile.settings
fi
-echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings
+echo CFLAGS+=-I`pwd` -I`pwd`/lib -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
@@ -201,6 +206,29 @@ else
fi
echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
+if [ "$events" = "libevent" ]; then
+ if ! [ -e "${libevent}include/event.h" ]; then
+ echo
+ echo 'Warning: Could not find event.h, you might have to install it and/or specify'
+ echo 'its location using the --libevent= argument. (Example: If event.h is in'
+ echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)'
+ fi
+
+ echo '#define EVENTS_LIBEVENT' >> config.h
+ cat <<EOF>>Makefile.settings
+EFLAGS+=-levent -L${libevent}lib
+CFLAGS+=-I${libevent}include
+EOF
+elif [ "$events" = "glib" ]; then
+ ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...):
+ echo '#define EVENTS_GLIB' >> config.h
+else
+ echo
+ echo 'ERROR: Unknown event handler specified.'
+ exit 1
+fi
+echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
+
detect_gnutls()
{
if libgnutls-config --version > /dev/null 2> /dev/null; then
@@ -231,6 +259,23 @@ EOF
fi;
}
+detect_ldap()
+{
+ TMPFILE=`mktemp`
+ if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
+ cat<<EOF>>Makefile.settings
+EFLAGS+=-lldap
+CFLAGS+=
+EOF
+ ldap=1
+ rm -f $TMPFILE
+ ret=1
+ else
+ ldap=0
+ ret=0
+ fi
+}
+
if [ "$msn" = 1 -o "$jabber" = 1 ]; then
if [ "$ssl" = "auto" ]; then
detect_gnutls
@@ -291,6 +336,18 @@ if [ "$msn" = 1 -o "$jabber" = 1 ]; then
echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
fi
+if [ "$ldap" = "auto" ]; then
+ detect_ldap
+fi
+
+if [ "$ldap" = 0 ]; then
+ echo "LDAP_OBJ=" >> Makefile.settings
+ echo "#undef WITH_LDAP" >> config.h
+elif [ "$ldap" = 1 ]; then
+ echo "#define WITH_LDAP 1" >> config.h
+ echo "LDAP_OBJ=storage_ldap.o" >> Makefile.settings
+fi
+
if [ "$strip" = 0 ]; then
echo "STRIP=\# skip strip" >> Makefile.settings;
else
@@ -443,3 +500,9 @@ if [ -n "$protocols" ]; then
else
echo ' Building without IM-protocol support. We wish you a lot of fun...';
fi
+
+if [ "$ldap" = "0" ]; then
+ echo " LDAP storage backend disabled."
+else
+ echo " LDAP storage backend enabled."
+fi