source: configure @ dff732d

Last change on this file since dff732d was 4c225f0, checked in by Wilmer van der Gaast <wilmer@…>, at 2011-10-20T03:18:23Z

Drop the on-disk IPC socket by default. Nothing uses it. If one really wants
it, it can be restored using the --ipcsocket= configure option.

  • Property mode set to 100755
File size: 18.8 KB
RevLine 
[b7d3cc34]1#!/bin/sh
2
3##############################
4##  Configurer for BitlBee  ##
5##                          ##
6##  Copyright 2004 Lintux   ##
7##  Copyright 2002 Lucumo   ##
8##############################
9
10prefix='/usr/local/'
11bindir='$prefix/sbin/'
12etcdir='$prefix/etc/bitlbee/'
13mandir='$prefix/share/man/'
14datadir='$prefix/share/bitlbee/'
15config='/var/lib/bitlbee/'
[85cf37f]16plugindir='$prefix/lib/bitlbee/'
17includedir='$prefix/include/bitlbee/'
[417002e]18systemdsystemunitdir=''
[85cf37f]19libevent='/usr/'
[34b17d9]20pidfile='/var/run/bitlbee.pid'
[4c225f0]21ipcsocket=''
[e506d6c]22pcdir='$prefix/lib/pkgconfig'
[8462239]23systemlibdirs="/lib /lib64 /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64"
[b7d3cc34]24
25msn=1
26jabber=1
27oscar=1
28yahoo=1
[1b221e0]29twitter=1
[4aa0f6b]30twitter=1
[04dc563]31purple=0
[b7d3cc34]32
33debug=0
34strip=1
[66b9e86e]35gcov=0
[2abfbc5]36plugins=1
[04f0c10]37otr=0
[370899f]38skype=0
[85cf37f]39
40events=glib
[670204f]41ldap=0
[b7d3cc34]42ssl=auto
43
44arch=`uname -s`
45cpu=`uname -m`
46
[670204f]47GLIB_MIN_VERSION=2.4
48
[b7d3cc34]49echo BitlBee configure
50
51while [ -n "$1" ]; do
52        e="`expr "X$1" : 'X--\(.*=.*\)'`"
53        if [ -z "$e" ]; then
54                cat<<EOF
55
56Usage: $0 [OPTIONS]
57
58Option          Description                             Default
59
60--prefix=...    Directories to put files in             $prefix
61--bindir=...                                            $bindir
62--etcdir=...                                            $etcdir
63--mandir=...                                            $mandir
64--datadir=...                                           $datadir
[7b23afd]65--plugindir=...                                         $plugindir
[417002e]66--systemdsystemunitdir=...                              $systemdsystemunitdir
[34b17d9]67--pidfile=...                                           $pidfile
[b7d3cc34]68--config=...                                            $config
69
70--msn=0/1       Disable/enable MSN part                 $msn
71--jabber=0/1    Disable/enable Jabber part              $jabber
72--oscar=0/1     Disable/enable Oscar part (ICQ, AIM)    $oscar
73--yahoo=0/1     Disable/enable Yahoo part               $yahoo
[4aa0f6b]74--twitter=0/1   Disable/enable Twitter part             $twitter
[b7d3cc34]75
[796da03]76--purple=0/1    Disable/enable libpurple support        $purple
[04f0c10]77                (automatically disables other protocol modules)
[b7d3cc34]78
79--debug=0/1     Disable/enable debugging                $debug
80--strip=0/1     Disable/enable binary stripping         $strip
[66b9e86e]81--gcov=0/1      Disable/enable test coverage reporting  $gcov
[2abfbc5]82--plugins=0/1   Disable/enable plugins support          $plugins
[04f0c10]83--otr=0/1/auto/plugin
84                Disable/enable OTR encryption support   $otr
[17f6079]85--skype=0/1/plugin
[370899f]86                Disable/enable Skype support            $skype
[b7d3cc34]87
[85cf37f]88--events=...    Event handler (glib, libevent)          $events
[b7d3cc34]89--ssl=...       SSL library to use (gnutls, nss, openssl, bogus, auto)
90                                                        $ssl
[aec56b0]91
[f1e7407]92--target=...    Cross compilation target                same as host
[b7d3cc34]93EOF
94                exit;
95        fi
96        eval "$e"
97        shift;
98done
99
100# Expand $prefix and get rid of double slashes
101bindir=`eval echo "$bindir/" | sed 's/\/\{1,\}/\//g'`
102etcdir=`eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g'`
103mandir=`eval echo "$mandir/" | sed 's/\/\{1,\}/\//g'`
104datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'`
105config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
[7b23afd]106plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
[85cf37f]107includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'`
108libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'`
109
[6dff9d4]110pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
111ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
[e506d6c]112pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
[b7d3cc34]113
[17f6079]114protocols_mods=""
115
[b7d3cc34]116cat<<EOF>Makefile.settings
117## BitlBee settings, generated by configure
118PREFIX=$prefix
119BINDIR=$bindir
120ETCDIR=$etcdir
121MANDIR=$mandir
122DATADIR=$datadir
[7b23afd]123PLUGINDIR=$plugindir
[b7d3cc34]124CONFIG=$config
[e506d6c]125INCLUDEDIR=$includedir
126PCDIR=$pcdir
[b7d3cc34]127
[1bf9492]128TARGET=$target
[b7d3cc34]129ARCH=$arch
130CPU=$cpu
131
132DESTDIR=
133LFLAGS=
134EFLAGS=
135EOF
136
[1074806]137srcdir=$(cd $(dirname $0);pwd)
138currdir=$(pwd)
139if [ "$srcdir" != "$currdir" ]; then 
[f60079b]140        echo
141        echo "configure script run from a different directory. Will create some symlinks..."
142        if [ ! -e Makefile -o -L Makefile ]; then
[04dc563]143                COPYDIRS="doc lib protocols tests utils"
144                mkdir -p $(cd "$srcdir"; find $COPYDIRS -type d)
[f60079b]145                find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null
146                dst="$PWD"
147                cd "$srcdir"
[04dc563]148                for i in $(find . -name Makefile -type f); do
[f60079b]149                        ln -s "$PWD${i#.}" "$dst/$i";
150                done
151                cd "$dst"
152                rm -rf .bzr
153        fi
154       
155        echo "SRCDIR=$srcdir/" >> Makefile.settings
156        CFLAGS="$CFLAGS -I${dst}"
157else
158        srcdir=$PWD
159fi
160
[b7d3cc34]161cat<<EOF>config.h
162/* BitlBee settings, generated by configure
163   
164   Do *NOT* use any of these defines in your code without thinking twice, most
165   of them can/will be overridden at run-time */
166
167#define CONFIG "$config"
168#define ETCDIR "$etcdir"
169#define VARDIR "$datadir"
[7b23afd]170#define PLUGINDIR "$plugindir"
[34b17d9]171#define PIDFILE "$pidfile"
[6dff9d4]172#define IPCSOCKET "$ipcsocket"
[b7d3cc34]173#define ARCH "$arch"
174#define CPU "$cpu"
175EOF
176
[1bf9492]177
178
[f1e7407]179if [ -n "$target" ]; then
[1bf9492]180        PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
181        export PKG_CONFIG_LIBDIR
[f1e7407]182        PATH=/usr/$target/bin:$PATH
183        CC=$target-cc
184        LD=$target-ld
[1bf9492]185        systemlibdirs="/usr/$target/lib"
[f1e7407]186fi
187
[1bf9492]188
[b7d3cc34]189if [ "$debug" = "1" ]; then
[285b55d]190        [ -z "$CFLAGS" ] && CFLAGS=-g
[b7d3cc34]191        echo 'DEBUG=1' >> Makefile.settings
[911cc4f]192        CFLAGS="$CFLAGS -DDEBUG"
[b7d3cc34]193else
[56f260a]194        [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing"
[b7d3cc34]195fi
196
[daae10f]197echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings
[f60079b]198echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings
[b7d3cc34]199
[f712188]200echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
201
[b7d3cc34]202if [ -n "$CC" ]; then
[5973412]203        CC=$CC
[b7d3cc34]204elif type gcc > /dev/null 2> /dev/null; then
[5973412]205        CC=gcc
[b7d3cc34]206elif type cc > /dev/null 2> /dev/null; then
[5973412]207        CC=cc
[b7d3cc34]208else
209        echo 'Cannot find a C compiler, aborting.'
210        exit 1;
211fi
212
[5973412]213echo "CC=$CC" >> Makefile.settings;
[daae10f]214if echo $CC | grep -qw gcc; then
215        # Apparently -Wall is gcc-specific?
216        echo CFLAGS+=-Wall >> Makefile.settings
217fi
[5973412]218
[f1e7407]219if [ -z "$LD" ]; then
220        if type ld > /dev/null 2> /dev/null; then
221                LD=ld
222        else
223                echo 'Cannot find ld, aborting.'
224                exit 1;
225        fi
[b7d3cc34]226fi
227
[f1e7407]228echo "LD=$LD" >> Makefile.settings
229
[32c632f]230if [ -z "$PKG_CONFIG" ]; then
231        PKG_CONFIG=pkg-config
232fi
233
234if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then
[670204f]235        if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then
236                cat<<EOF>>Makefile.settings
[32c632f]237EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0`
238CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
[b7d3cc34]239EOF
[670204f]240        else
241                echo
242                echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.'
243                exit 1
244        fi
[b7d3cc34]245else
[670204f]246        echo
[574af7e]247        echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)'
[670204f]248        exit 1
[b7d3cc34]249fi
250
[85cf37f]251if [ "$events" = "libevent" ]; then
[003553b]252        if ! [ -f "${libevent}include/event.h" ]; then
[85cf37f]253                echo
254                echo 'Warning: Could not find event.h, you might have to install it and/or specify'
255                echo 'its location using the --libevent= argument. (Example: If event.h is in'
256                echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)'
257        fi
258       
259        echo '#define EVENTS_LIBEVENT' >> config.h
260        cat <<EOF>>Makefile.settings
261EFLAGS+=-levent -L${libevent}lib
262CFLAGS+=-I${libevent}include
263EOF
264elif [ "$events" = "glib" ]; then
265        ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...):
266        echo '#define EVENTS_GLIB' >> config.h
[b7d3cc34]267else
268        echo
[85cf37f]269        echo 'ERROR: Unknown event handler specified.'
270        exit 1
[b7d3cc34]271fi
[85cf37f]272echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
[b7d3cc34]273
274detect_gnutls()
275{
[4af7b4f]276        if $PKG_CONFIG --exists gnutls; then
277                cat <<EOF>>Makefile.settings
[83e47ec]278EFLAGS+=`$PKG_CONFIG --libs gnutls` `libgcrypt-config --libs`
279CFLAGS+=`$PKG_CONFIG --cflags gnutls` `libgcrypt-config --cflags`
[4af7b4f]280EOF
281                ssl=gnutls
282                ret=1
283        elif libgnutls-config --version > /dev/null 2> /dev/null; then
[b7d3cc34]284                cat <<EOF>>Makefile.settings
[83e47ec]285EFLAGS+=`libgnutls-config --libs` `libgcrypt-config --libs`
286CFLAGS+=`libgnutls-config --cflags` `libgcrypt-config --cflags`
[b7d3cc34]287EOF
288               
289                ssl=gnutls
290                ret=1;
291        else
292                ret=0;
293        fi;
294}
295
296detect_nss()
297{
[ef043d3]298        if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG nss; then
[b7d3cc34]299                cat<<EOF>>Makefile.settings
[ef043d3]300EFLAGS+=`$PKG_CONFIG --libs nss`
301CFLAGS+=`$PKG_CONFIG --cflags nss`
[b7d3cc34]302EOF
303               
304                ssl=nss
305                ret=1;
306        else
307                ret=0;
308        fi;
309}
310
[f32d557]311detect_ldap()
[f665dab]312{
[4fca1db]313        TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
[5973412]314        if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
[f665dab]315                cat<<EOF>>Makefile.settings
[5973412]316EFLAGS+=-lldap
317CFLAGS+=
[f665dab]318EOF
[f32d557]319                ldap=1
[5973412]320                rm -f $TMPFILE
[f665dab]321                ret=1
[b7d3cc34]322        else
[5973412]323                ldap=0
[f665dab]324                ret=0
[b7d3cc34]325        fi
[f665dab]326}
327
[36cf9fd]328RESOLV_TESTCODE='
329#include <arpa/nameser.h>
330#include <resolv.h>
331
332int main()
333{
334        ns_initparse( NULL, 0, NULL );
335        ns_parserr( NULL, ns_s_an, 0, NULL );
336}
337'
338
339detect_resolv_dynamic()
340{
[4fca1db]341        TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
[8462239]342        ret=1
343        echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -lresolv >/dev/null 2>/dev/null
[36cf9fd]344        if [ "$?" = "0" ]; then
345                echo 'EFLAGS+=-lresolv' >> Makefile.settings
[8462239]346                ret=0
[36cf9fd]347        fi
348
[8462239]349        rm -f $TMPFILE
350        return $ret
[36cf9fd]351}
352
353detect_resolv_static()
354{
[4fca1db]355        TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
[8462239]356        ret=1
[36cf9fd]357        for i in $systemlibdirs; do
358                if [ -f $i/libresolv.a ]; then
[8462239]359                        echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null
[36cf9fd]360                        if [ "$?" = "0" ]; then
361                                echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings
[8462239]362                                ret=0
[36cf9fd]363                        fi
364                fi
365        done
366
[8462239]367        rm -f $TMPFILE
368        return $ret
[36cf9fd]369}
370
[b3c467b]371if [ "$ssl" = "auto" ]; then
372        detect_gnutls
[b7d3cc34]373        if [ "$ret" = "0" ]; then
[c5920df]374                # Disable NSS for now as it's known to not work very well ATM.
375                #detect_nss
[191cfb1]376                :
[b7d3cc34]377        fi
[b3c467b]378elif [ "$ssl" = "gnutls" ]; then
379        detect_gnutls
380elif [ "$ssl" = "nss" ]; then
381        detect_nss
[85d7b85]382elif [ "$ssl" = "sspi" ]; then
383        echo
[b3c467b]384elif [ "$ssl" = "openssl" ]; then
385        echo
386        echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
387        echo 'install of OpenSSL (including devel/header files) before reporting'
388        echo 'compilation problems.'
389        echo
390        echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
391        echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
392        echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
393        echo 'part of the operating system, which makes it GPL-compatible.'
394        echo
395        echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
396        echo '                    http://www.gnome.org/~markmc/openssl-and-the-gpl.html'
397        echo
398        echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
399        echo 'probably illegal. If you want to create and distribute a binary BitlBee'
400        echo 'package, you really should use GnuTLS or NSS instead.'
401        echo
402        echo 'Also, the OpenSSL license requires us to say this:'
403        echo ' *    "This product includes software developed by the OpenSSL Project'
404        echo ' *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"'
[b7d3cc34]405       
[b3c467b]406        echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings
407       
408        ret=1
409elif [ "$ssl" = "bogus" ]; then
410        echo
[670204f]411        echo 'Using bogus SSL code. This means some features will not work properly.'
[b3c467b]412       
413        ## Yes, you, at the console! How can you authenticate if you don't have any SSL!?
[1c2eaa3]414        if [ "$msn" = "1" -o "$yahoo" = "1" ]; then
[b7d3cc34]415                echo
[1c2eaa3]416                echo 'WARNING: The MSN and Yahoo! modules will not work without SSL. Disabling.'
[b3c467b]417                msn=0
[1c2eaa3]418                yahoo=0
[b3c467b]419        fi
[b7d3cc34]420       
[b3c467b]421        ret=1
422else
423        echo
424        echo 'ERROR: Unknown SSL library specified.'
425        exit 1
[b7d3cc34]426fi
427
[b3c467b]428if [ "$ret" = "0" ]; then
429        echo
430        echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
431        echo '       Please note that this script doesn'\''t have detection code for OpenSSL,'
432        echo '       so if you want to use that, you have to select it by hand. If you don'\''t'
433        echo '       need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)'
[b7d3cc34]434       
[b3c467b]435        exit 1
436fi;
437
[83e47ec]438if [ "$msn" = "1" -a "$ssl" != "openssl" -a "$ssl" != "gnutls" ]; then
[a366cca]439        # Needed for MSN only. OpenSSL exports nice cipher functions already,
[83e47ec]440        # in case of GnuTLS we should be able to use gcrypt. Otherwise, use
441        # built-in stuff. (Since right now those are the only two supported
442        # SSL modules anyway, this is mostly unnecessary.)
[a366cca]443        echo 'DES=des.o' >> Makefile.settings
444fi
445
[b3c467b]446echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
447
[36cf9fd]448if detect_resolv_dynamic || detect_resolv_static; then
449        echo '#define HAVE_RESOLV_A' >> config.h
450fi
[36e9f62]451
[ba7d16f]452STORAGES="xml"
[b3c467b]453
[f32d557]454if [ "$ldap" = "auto" ]; then
455        detect_ldap
[b7d3cc34]456fi
457
[f32d557]458if [ "$ldap" = 0 ]; then
[5973412]459        echo "#undef WITH_LDAP" >> config.h
[f32d557]460elif [ "$ldap" = 1 ]; then
[5c5a586]461        echo
462        echo 'LDAP support is a work in progress and does NOT work AT ALL right now.'
463        echo
464        exit 1
465       
[5973412]466        echo "#define WITH_LDAP 1" >> config.h
[b3c467b]467        STORAGES="$STORAGES ldap"
[b7d3cc34]468fi
469
[b3c467b]470for i in $STORAGES; do
471        STORAGE_OBJS="$STORAGE_OBJS storage_$i.o"
472done
473echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings
474
[b7d3cc34]475if [ "$strip" = 0 ]; then
476        echo "STRIP=\# skip strip" >> Makefile.settings;
477else
478        if [ "$debug" = 1 ]; then
479                echo
480                echo 'Stripping binaries does not make sense when debugging. Stripping disabled.'
481                echo 'STRIP=\# skip strip' >> Makefile.settings
482                strip=0;
483        elif [ -n "$STRIP" ]; then
484                echo "STRIP=$STRIP" >> Makefile.settings;
485        elif type strip > /dev/null 2> /dev/null; then
486                echo "STRIP=strip" >> Makefile.settings;
487        else
488                echo
489                echo 'No strip utility found, cannot remove unnecessary parts from executable.'
490                echo 'STRIP=\# skip strip' >> Makefile.settings
491                strip=0;
492        fi;
493fi
494
[417002e]495if [ -z "$systemdsystemunitdir" ]; then
496        if $PKG_CONFIG --exists systemd; then
497                systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
498        fi
499fi
500if [ -n "$systemdsystemunitdir" ]; then
501        if [ "$systemdsystemunitdir" != "no" ]; then
502                echo "SYSTEMDSYSTEMUNITDIR=$systemdsystemunitdir" >> Makefile.settings
503        fi
504fi
505
[66b9e86e]506if [ "$gcov" = "1" ]; then
[31fc3970]507        echo "CFLAGS+=--coverage" >> Makefile.settings
508        echo "EFLAGS+=--coverage" >> Makefile.settings
[66b9e86e]509fi
510
[2abfbc5]511if [ "$plugins" = 0 ]; then
512        echo '#undef WITH_PLUGINS' >> config.h
513else
514        echo '#define WITH_PLUGINS' >> config.h
515fi
516
[6738a67]517otrprefix=""
518for i in / /usr /usr/local; do
519        if [ -f ${i}/lib/libotr.a ]; then
520                otrprefix=${i}
521                break
522        fi
523done
[764c7d1]524if [ "$otr" = "auto" ]; then
[6738a67]525        if [ -n "$otrprefix" ]; then
526                otr=1
527        else
528                otr=0
529        fi
[764c7d1]530fi
[6738a67]531if [ "$otr" = 1 ]; then
[858ea01]532        # BI == built-in
533        echo '#define OTR_BI' >> config.h
[6738a67]534        echo "EFLAGS+=-L${otrprefix}/lib -lotr" >> Makefile.settings
535        echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
[858ea01]536        echo 'OTR_BI=otr.o' >> Makefile.settings
537elif [ "$otr" = "plugin" ]; then
538        echo '#define OTR_PI' >> config.h
539        echo "OTRFLAGS=-L${otrprefix}/lib -lotr" >> Makefile.settings
540        echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
541        echo 'OTR_PI=otr.so' >> Makefile.settings
[764c7d1]542fi
543
[17f6079]544if [ "$skype" = "1" -o "$skype" = "plugin" ]; then
[370899f]545        echo 'SKYPE_PI=skype.so' >> Makefile.settings
[17f6079]546        protocols_mods="$protocol_mods skype(plugin)"
[370899f]547fi
548
[ceebeb1]549if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then
550        echo
551        echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.'
552        echo 'Install xmlto if you want online help to work.'
553fi
554
[ffea9b9]555echo
[a014331]556if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then
557        nick=`bzr nick`
558        if [ -n "$nick" -a "$nick" != "bitlbee" ]; then
559                nick="-$nick"
560        else
561                nick=""
562        fi
[ffea9b9]563        rev=`bzr revno`
564        echo 'Using bzr revision #'$rev' as version number'
[a014331]565        BITLBEE_VERSION=\"bzr$nick-$rev\"
[b7d3cc34]566fi
567
568if [ -n "$BITLBEE_VERSION" ]; then
569        echo 'Spoofing version number: '$BITLBEE_VERSION
570        echo '#undef BITLBEE_VERSION' >> config.h
[ffea9b9]571        echo '#define BITLBEE_VERSION '$BITLBEE_VERSION >> config.h
572        echo
[b7d3cc34]573fi
574
[4fca1db]575if ! make helloworld > /dev/null 2>&1; then
576        echo "WARNING: Your version of make (BSD make?) does not support BitlBee's makefiles."
577        echo "BitlBee needs GNU make to build properly. On most systems GNU make is available"
578        echo "under the name 'gmake'."
579        echo
580        if gmake helloworld > /dev/null 2>&1; then
581                echo "gmake seems to be available on your machine, great."
582                echo
583        else
584                echo "gmake is not installed (or not working). Please try to install it."
585                echo
586        fi
587fi
588
[e506d6c]589cat <<EOF>bitlbee.pc
590prefix=$prefix
591includedir=$includedir
592
593Name: bitlbee
594Description: IRC to IM gateway
595Requires: glib-2.0
596Version: $BITLBEE_VERSION
597Libs:
598Cflags: -I\${includedir}
599
600EOF
601
[b7d3cc34]602protocols=''
603protoobjs=''
604
[e248c7f]605if [ "$purple" = 0 ]; then
606        echo '#undef WITH_PURPLE' >> config.h
607else
[e08e53c]608        if ! $PKG_CONFIG purple; then
609                echo
610                echo 'Cannot find libpurple development libraries, aborting. (Install libpurple-dev?)'
611                exit 1
612        fi
[e248c7f]613        echo '#define WITH_PURPLE' >> config.h
[e08e53c]614        cat<<EOF>>Makefile.settings
615EFLAGS += $($PKG_CONFIG purple --libs)
616PURPLE_CFLAGS += $($PKG_CONFIG purple --cflags)
617EOF
[e248c7f]618        protocols=$protocols'purple '
619        protoobjs=$protoobjs'purple_mod.o '
620
621        # Having both libpurple and native IM modules in one binary may
622        # do strange things. Let's not do that.
623        msn=0
624        jabber=0
625        oscar=0
626        yahoo=0
[bda2975]627       
628        if [ "$events" = "libevent" ]; then
629                echo 'Warning: Some libpurple modules (including msn-pecan) do their event handling'
630                echo 'outside libpurple, talking to GLib directly. At least for now the combination'
631                echo 'libpurple + libevent is *not* recommended!'
[c775a58]632                echo
[bda2975]633        fi
[e248c7f]634fi
635
[b0a89cc]636case "$CC" in
637*gcc* )
638        echo CFLAGS+=-MD -MF .depend/\$@.d >> Makefile.settings
639        for i in . lib protocols protocols/*/; do
640                mkdir -p $i/.depend
641        done
642esac
643
[b7d3cc34]644if [ "$msn" = 0 ]; then
645        echo '#undef WITH_MSN' >> config.h
646else
647        echo '#define WITH_MSN' >> config.h
648        protocols=$protocols'msn '
[b5a22e3]649        protoobjs=$protoobjs'msn_mod.o '
[b7d3cc34]650fi
651
652if [ "$jabber" = 0 ]; then
653        echo '#undef WITH_JABBER' >> config.h
654else
655        echo '#define WITH_JABBER' >> config.h
656        protocols=$protocols'jabber '
[b5a22e3]657        protoobjs=$protoobjs'jabber_mod.o '
[b7d3cc34]658fi
659
660if [ "$oscar" = 0 ]; then
661        echo '#undef WITH_OSCAR' >> config.h
662else
663        echo '#define WITH_OSCAR' >> config.h
664        protocols=$protocols'oscar '
[b5a22e3]665        protoobjs=$protoobjs'oscar_mod.o '
[b7d3cc34]666fi
667
668if [ "$yahoo" = 0 ]; then
669        echo '#undef WITH_YAHOO' >> config.h
670else
671        echo '#define WITH_YAHOO' >> config.h
672        protocols=$protocols'yahoo '
[b5a22e3]673        protoobjs=$protoobjs'yahoo_mod.o '
[b7d3cc34]674fi
675
[1b221e0]676if [ "$twitter" = 0 ]; then
677        echo '#undef WITH_TWITTER' >> config.h
678else
679        echo '#define WITH_TWITTER' >> config.h
680        protocols=$protocols'twitter '
681        protoobjs=$protoobjs'twitter_mod.o '
682fi
683
[b7d3cc34]684if [ "$protocols" = "PROTOCOLS = " ]; then
[43462708]685        echo "Warning: You haven't selected any communication protocol to compile!"
[b3c467b]686        echo "         BitlBee will run, but you will be unable to connect to IM servers!"
[b7d3cc34]687fi
688
689echo "PROTOCOLS = $protocols" >> Makefile.settings
690echo "PROTOOBJS = $protoobjs" >> Makefile.settings
691
692echo Architecture: $arch
693case "$arch" in
694Linux )
695;;
696GNU/* )
697;;
698*BSD )
699;;
700Darwin )
[caceb06]701        echo 'STRIP=\# skip strip' >> Makefile.settings
[b7d3cc34]702;;
703IRIX )
704;;
705SunOS )
706        echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings
707        echo 'STRIP=\# skip strip' >> Makefile.settings
[70d7795]708        echo '#define NO_FD_PASSING' >> config.h
[b7d3cc34]709;;
[8de63c3]710AIX )
711        echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings
[b7d3cc34]712;;
713CYGWIN* )
714        echo 'Cygwin is not officially supported.'
715;;
[aec56b0]716Windows )
717;;
[b7d3cc34]718* )
[8d6c4b1]719        echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.'
720        echo 'Please report any problems at http://bugs.bitlbee.org/.'
[b7d3cc34]721;;
722esac
723
[f1e7407]724if [ -n "$target" ]; then
725        echo "Cross-compiling for: $target"
726fi
727
[b7d3cc34]728echo
729echo 'Configuration done:'
730
731if [ "$debug" = "1" ]; then
[b3c467b]732        echo '  Debugging enabled.'
[b7d3cc34]733else
[b3c467b]734        echo '  Debugging disabled.'
[b7d3cc34]735fi
736
737if [ "$strip" = "1" ]; then
[b3c467b]738        echo '  Binary stripping enabled.'
[b7d3cc34]739else
[b3c467b]740        echo '  Binary stripping disabled.'
[b7d3cc34]741fi
742
[764c7d1]743if [ "$otr" = "1" ]; then
744        echo '  Off-the-Record (OTR) Messaging enabled.'
[858ea01]745elif [ "$otr" = "plugin" ]; then
746        echo '  Off-the-Record (OTR) Messaging enabled (as a plugin).'
[764c7d1]747else
748        echo '  Off-the-Record (OTR) Messaging disabled.'
749fi
750
[417002e]751if [ -n "$systemdsystemunitdir" ]; then
752        echo '  systemd enabled.'
753else
754        echo '  systemd disabled.'
755fi
756
[b3c467b]757echo '  Using event handler: '$events
758echo '  Using SSL library: '$ssl
[4e3df8a]759#echo '  Building with these storage backends: '$STORAGES
[b7d3cc34]760
761if [ -n "$protocols" ]; then
[17f6079]762        echo '  Building with these protocols:' $protocols$protocols_mods
[4e3df8a]763        case "$protocols" in
764        *purple*)
765                echo "    Note that BitlBee-libpurple is supported on a best-effort basis. It's"
766                echo "    not *fully* compatible with normal BitlBee. Don't use it unless you"
767                echo "    absolutely need it (i.e. support for a certain protocol or feature)."
768        esac
[b7d3cc34]769else
[b3c467b]770        echo '  Building without IM-protocol support. We wish you a lot of fun...'
[b7d3cc34]771fi
Note: See TracBrowser for help on using the repository browser.