diff options
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 86 | 
1 files changed, 77 insertions, 9 deletions
| @@ -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,9 @@ yahoo=1  debug=0  strip=1  ipv6=1 + +events=glib +ldap=auto  ssl=auto  arch=`uname -s` @@ -63,6 +67,9 @@ 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  EOF @@ -79,9 +86,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 @@ -139,16 +148,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 @@ -172,6 +183,29 @@ else  	exit 1;  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 @@ -202,6 +236,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 @@ -262,6 +313,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=\# no ldap" >> 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 @@ -400,9 +463,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.'; @@ -415,3 +477,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 | 
