aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure51
1 files changed, 42 insertions, 9 deletions
diff --git a/configure b/configure
index a602fe3a..96bac6eb 100755
--- a/configure
+++ b/configure
@@ -13,11 +13,12 @@ etcdir='$prefix/etc/bitlbee/'
mandir='$prefix/share/man/'
datadir='$prefix/share/bitlbee/'
config='/var/lib/bitlbee/'
+plugindir='$prefix/lib/bitlbee/'
+includedir='$prefix/include/bitlbee/'
+libevent='/usr/'
pidfile='/var/run/bitlbee.pid'
ipcsocket='/var/run/bitlbee'
-plugindir='$prefix/lib/bitlbee'
pcdir='$prefix/lib/pkgconfig'
-includedir='$prefix/include/bitlbee'
msn=1
jabber=1
@@ -27,6 +28,8 @@ yahoo=1
debug=0
strip=1
ipv6=1
+
+events=glib
ssl=auto
arch=`uname -s`
@@ -63,6 +66,7 @@ Option Description Default
--ipv6=0/1 IPv6 socket support $ipv6
+--events=... Event handler (glib, libevent) $events
--ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto)
$ssl
EOF
@@ -79,9 +83,11 @@ mandir=`eval echo "$mandir/" | sed 's/\/\{1,\}/\//g'`
datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'`
config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
+includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'`
+libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'`
+
pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
-includedir=`eval echo "$includedir" | sed 's/\/\{1,\}/\//g'`
pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
cat<<EOF>Makefile.settings
@@ -162,34 +168,62 @@ if [ -z "$PKG_CONFIG" ]; then
PKG_CONFIG=pkg-config
fi
+GLIB=0
+
if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then
cat<<EOF>>Makefile.settings
EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0`
CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
EOF
echo '#define GLIB2' >> config.h
+ GLIB=2
elif type glib-config > /dev/null 2> /dev/null; then
cat<<EOF>>Makefile.settings
EFLAGS+=`glib-config --libs`
CFLAGS+=`glib-config --cflags`
EOF
echo '#define GLIB1' >> config.h
+ GLIB=1
else
echo 'Cannot find glib development libraries, aborting. (Install libglib-dev?)'
exit 1;
fi
-if [ -r /usr/include/iconv.h ]; then
+if [ GLIB = 1 -o -r /usr/include/iconv.h ]; then
:;
elif [ -r /usr/local/include/iconv.h ]; then
- echo CFLAGS+=-I/usr/local/include >> Makefile.settings;
+ echo CFLAGS+=-I/usr/local/include >> Makefile.settings
else
echo
echo 'Warning: Could not find iconv.h, you might have to install it and/or modify'
- echo 'Makefile.settings to tell where this file is.';
+ echo 'Makefile.settings to tell where this file is.'
fi
+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
@@ -421,9 +455,8 @@ else
echo ' Binary stripping disabled.';
fi
-if [ "$msn" = "1" ]; then
- echo ' Using SSL library: '$ssl;
-fi
+echo ' Using event handler: '$events;
+echo ' Using SSL library: '$ssl;
#if [ "$flood" = "0" ]; then
# echo ' Flood protection disabled.';