diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 99 |
1 files changed, 93 insertions, 6 deletions
@@ -25,6 +25,9 @@ msn=1 jabber=1 oscar=1 yahoo=1 +twitter=1 +twitter=1 +purple=0 debug=0 strip=1 @@ -65,6 +68,9 @@ Option Description Default --jabber=0/1 Disable/enable Jabber part $jabber --oscar=0/1 Disable/enable Oscar part (ICQ, AIM) $oscar --yahoo=0/1 Disable/enable Yahoo part $yahoo +--twitter=0/1 Disable/enable Twitter part $twitter + +--purple=0/1 Disable/enable libpurple support $purple --debug=0/1 Disable/enable debugging $debug --strip=0/1 Disable/enable binary stripping $strip @@ -118,6 +124,29 @@ LFLAGS= EFLAGS= EOF +srcdir="$(dirname $0)" +if [ "$srcdir" != "." ]; then + echo + echo "configure script run from a different directory. Will create some symlinks..." + if [ ! -e Makefile -o -L Makefile ]; then + COPYDIRS="doc lib protocols tests utils" + mkdir -p $(cd "$srcdir"; find $COPYDIRS -type d) + find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null + dst="$PWD" + cd "$srcdir" + for i in $(find . -name Makefile -type f); do + ln -s "$PWD${i#.}" "$dst/$i"; + done + cd "$dst" + rm -rf .bzr + fi + + echo "SRCDIR=$srcdir/" >> Makefile.settings + CFLAGS="$CFLAGS -I${dst}" +else + srcdir=$PWD +fi + cat<<EOF>config.h /* BitlBee settings, generated by configure @@ -154,8 +183,8 @@ else [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing" fi -echo CFLAGS=$CFLAGS >> Makefile.settings -echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings +echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings +echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings @@ -171,6 +200,10 @@ else fi echo "CC=$CC" >> Makefile.settings; +if echo $CC | grep -qw gcc; then + # Apparently -Wall is gcc-specific? + echo CFLAGS+=-Wall >> Makefile.settings +fi if [ -z "$LD" ]; then if type ld > /dev/null 2> /dev/null; then @@ -266,7 +299,7 @@ EOF detect_ldap() { - TMPFILE=$(mktemp) + TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then cat<<EOF>>Makefile.settings EFLAGS+=-lldap @@ -294,7 +327,7 @@ int main() detect_resolv_dynamic() { - TMPFILE=$(mktemp) + TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) ret=1 echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -lresolv >/dev/null 2>/dev/null if [ "$?" = "0" ]; then @@ -308,7 +341,7 @@ detect_resolv_dynamic() detect_resolv_static() { - TMPFILE=$(mktemp) + TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) ret=1 for i in $systemlibdirs; do if [ -f $i/libresolv.a ]; then @@ -395,7 +428,7 @@ if detect_resolv_dynamic || detect_resolv_static; then echo '#define HAVE_RESOLV_A' >> config.h fi -STORAGES="text xml" +STORAGES="xml" if [ "$ldap" = "auto" ]; then detect_ldap @@ -475,6 +508,20 @@ if [ -n "$BITLBEE_VERSION" ]; then echo fi +if ! make helloworld > /dev/null 2>&1; then + echo "WARNING: Your version of make (BSD make?) does not support BitlBee's makefiles." + echo "BitlBee needs GNU make to build properly. On most systems GNU make is available" + echo "under the name 'gmake'." + echo + if gmake helloworld > /dev/null 2>&1; then + echo "gmake seems to be available on your machine, great." + echo + else + echo "gmake is not installed (or not working). Please try to install it." + echo + fi +fi + cat <<EOF>bitlbee.pc prefix=$prefix includedir=$includedir @@ -491,6 +538,38 @@ EOF protocols='' protoobjs='' +if [ "$purple" = 0 ]; then + echo '#undef WITH_PURPLE' >> config.h +else + if ! $PKG_CONFIG purple; then + echo + echo 'Cannot find libpurple development libraries, aborting. (Install libpurple-dev?)' + exit 1 + fi + echo '#define WITH_PURPLE' >> config.h + cat<<EOF>>Makefile.settings +EFLAGS += $($PKG_CONFIG purple --libs) +PURPLE_CFLAGS += $($PKG_CONFIG purple --cflags) +EOF + protocols=$protocols'purple ' + protoobjs=$protoobjs'purple_mod.o ' + + # Having both libpurple and native IM modules in one binary may + # do strange things. Let's not do that. + msn=0 + jabber=0 + oscar=0 + yahoo=0 + twitter=0 + + if [ "$events" = "libevent" ]; then + echo + echo 'Warning: Some libpurple modules (including msn-pecan) do their event handling' + echo 'outside libpurple, talking to GLib directly. At least for now the combination' + echo 'libpurple + libevent is *not* recommended!' + fi +fi + if [ "$msn" = 0 ]; then echo '#undef WITH_MSN' >> config.h else @@ -523,6 +602,14 @@ else protoobjs=$protoobjs'yahoo_mod.o ' fi +if [ "$twitter" = 0 ]; then + echo '#undef WITH_TWITTER' >> config.h +else + echo '#define WITH_TWITTER' >> config.h + protocols=$protocols'twitter ' + protoobjs=$protoobjs'twitter_mod.o ' +fi + if [ "$protocols" = "PROTOCOLS = " ]; then echo "Warning: You haven't selected any communication protocol to compile!" echo " BitlBee will run, but you will be unable to connect to IM servers!" |