source: configure @ 0153ba9

Last change on this file since 0153ba9 was 0153ba9, checked in by Wilmer van der Gaast <wilmer@…>, at 2012-06-04T11:01:50Z

Drop the LDAP stuff that was never even close to finished.

There was actually a branch where LDAP support was more or less in a usable
state, but there were still some unsolved problems including the fact that
every setting has its own LDAP schema entry, which would mean lots of
maintenance overhead for pretty much every BitlBee release. :-(

Instead, we'll just stick to the XML format everywhere and just store it
in different ways.

  • 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/'
[57da960]11bindir='$prefix/bin/'
12sbindir='$prefix/sbin/'
[b7d3cc34]13etcdir='$prefix/etc/bitlbee/'
14mandir='$prefix/share/man/'
15datadir='$prefix/share/bitlbee/'
16config='/var/lib/bitlbee/'
[85cf37f]17plugindir='$prefix/lib/bitlbee/'
18includedir='$prefix/include/bitlbee/'
[417002e]19systemdsystemunitdir=''
[85cf37f]20libevent='/usr/'
[34b17d9]21pidfile='/var/run/bitlbee.pid'
[4c225f0]22ipcsocket=''
[e506d6c]23pcdir='$prefix/lib/pkgconfig'
[25b80e9c]24systemlibdirs="/lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib"
[b7d3cc34]25
26msn=1
27jabber=1
28oscar=1
29yahoo=1
[1b221e0]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
[b7d3cc34]41ssl=auto
42
43arch=`uname -s`
44cpu=`uname -m`
45
[74c5718]46GLIB_MIN_VERSION=2.14
[670204f]47
[b7d3cc34]48echo BitlBee configure
49
50while [ -n "$1" ]; do
51        e="`expr "X$1" : 'X--\(.*=.*\)'`"
52        if [ -z "$e" ]; then
53                cat<<EOF
54
55Usage: $0 [OPTIONS]
56
57Option          Description                             Default
58
59--prefix=...    Directories to put files in             $prefix
60--bindir=...                                            $bindir
[57da960]61--sbindir=...                                           $sbindir
[b7d3cc34]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'`
[57da960]102sbindir=`eval echo "$sbindir/" | sed 's/\/\{1,\}/\//g'`
[b7d3cc34]103etcdir=`eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g'`
104mandir=`eval echo "$mandir/" | sed 's/\/\{1,\}/\//g'`
105datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'`
106config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
[7b23afd]107plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
[85cf37f]108includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'`
109libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'`
110
[6dff9d4]111pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
112ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
[e506d6c]113pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
[b7d3cc34]114
[17f6079]115protocols_mods=""
116
[b7d3cc34]117cat<<EOF>Makefile.settings
118## BitlBee settings, generated by configure
119PREFIX=$prefix
120BINDIR=$bindir
[57da960]121SBINDIR=$sbindir
[b7d3cc34]122ETCDIR=$etcdir
123MANDIR=$mandir
124DATADIR=$datadir
[7b23afd]125PLUGINDIR=$plugindir
[b7d3cc34]126CONFIG=$config
[e506d6c]127INCLUDEDIR=$includedir
128PCDIR=$pcdir
[b7d3cc34]129
[1bf9492]130TARGET=$target
[b7d3cc34]131ARCH=$arch
132CPU=$cpu
133
[25b80e9c]134INSTALL=install -p
135
[b7d3cc34]136DESTDIR=
137LFLAGS=
138EFLAGS=
139EOF
140
[1074806]141srcdir=$(cd $(dirname $0);pwd)
142currdir=$(pwd)
143if [ "$srcdir" != "$currdir" ]; then 
[f60079b]144        echo
145        echo "configure script run from a different directory. Will create some symlinks..."
146        if [ ! -e Makefile -o -L Makefile ]; then
[04dc563]147                COPYDIRS="doc lib protocols tests utils"
148                mkdir -p $(cd "$srcdir"; find $COPYDIRS -type d)
[f60079b]149                find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null
150                dst="$PWD"
151                cd "$srcdir"
[04dc563]152                for i in $(find . -name Makefile -type f); do
[f60079b]153                        ln -s "$PWD${i#.}" "$dst/$i";
154                done
155                cd "$dst"
156                rm -rf .bzr
157        fi
158       
[7fa5c19]159        echo "_SRCDIR_=$srcdir/" >> Makefile.settings
[f60079b]160        CFLAGS="$CFLAGS -I${dst}"
161else
162        srcdir=$PWD
163fi
164
[b7d3cc34]165cat<<EOF>config.h
166/* BitlBee settings, generated by configure
167   
168   Do *NOT* use any of these defines in your code without thinking twice, most
169   of them can/will be overridden at run-time */
170
171#define CONFIG "$config"
172#define ETCDIR "$etcdir"
173#define VARDIR "$datadir"
[7b23afd]174#define PLUGINDIR "$plugindir"
[34b17d9]175#define PIDFILE "$pidfile"
[6dff9d4]176#define IPCSOCKET "$ipcsocket"
[b7d3cc34]177#define ARCH "$arch"
178#define CPU "$cpu"
179EOF
180
[1bf9492]181
182
[f1e7407]183if [ -n "$target" ]; then
[1bf9492]184        PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
185        export PKG_CONFIG_LIBDIR
[f1e7407]186        PATH=/usr/$target/bin:$PATH
187        CC=$target-cc
188        LD=$target-ld
[1bf9492]189        systemlibdirs="/usr/$target/lib"
[f1e7407]190fi
191
[1bf9492]192
[b7d3cc34]193if [ "$debug" = "1" ]; then
[285b55d]194        [ -z "$CFLAGS" ] && CFLAGS=-g
[b7d3cc34]195        echo 'DEBUG=1' >> Makefile.settings
[911cc4f]196        CFLAGS="$CFLAGS -DDEBUG"
[b7d3cc34]197else
[56f260a]198        [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing"
[b7d3cc34]199fi
200
[daae10f]201echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings
[f60079b]202echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings
[b7d3cc34]203
[f712188]204echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
205
[b7d3cc34]206if [ -n "$CC" ]; then
[5973412]207        CC=$CC
[b7d3cc34]208elif type gcc > /dev/null 2> /dev/null; then
[5973412]209        CC=gcc
[b7d3cc34]210elif type cc > /dev/null 2> /dev/null; then
[5973412]211        CC=cc
[b7d3cc34]212else
213        echo 'Cannot find a C compiler, aborting.'
214        exit 1;
215fi
216
[5973412]217echo "CC=$CC" >> Makefile.settings;
[daae10f]218if echo $CC | grep -qw gcc; then
219        # Apparently -Wall is gcc-specific?
220        echo CFLAGS+=-Wall >> Makefile.settings
221fi
[5973412]222
[f1e7407]223if [ -z "$LD" ]; then
224        if type ld > /dev/null 2> /dev/null; then
225                LD=ld
226        else
227                echo 'Cannot find ld, aborting.'
228                exit 1;
229        fi
[b7d3cc34]230fi
231
[f1e7407]232echo "LD=$LD" >> Makefile.settings
233
[32c632f]234if [ -z "$PKG_CONFIG" ]; then
235        PKG_CONFIG=pkg-config
236fi
237
238if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then
[670204f]239        if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then
240                cat<<EOF>>Makefile.settings
[32c632f]241EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0`
242CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
[b7d3cc34]243EOF
[670204f]244        else
245                echo
246                echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.'
247                exit 1
248        fi
[b7d3cc34]249else
[670204f]250        echo
[574af7e]251        echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)'
[670204f]252        exit 1
[b7d3cc34]253fi
254
[85cf37f]255if [ "$events" = "libevent" ]; then
[003553b]256        if ! [ -f "${libevent}include/event.h" ]; then
[85cf37f]257                echo
258                echo 'Warning: Could not find event.h, you might have to install it and/or specify'
259                echo 'its location using the --libevent= argument. (Example: If event.h is in'
260                echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)'
261        fi
262       
263        echo '#define EVENTS_LIBEVENT' >> config.h
264        cat <<EOF>>Makefile.settings
265EFLAGS+=-levent -L${libevent}lib
266CFLAGS+=-I${libevent}include
267EOF
268elif [ "$events" = "glib" ]; then
269        ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...):
270        echo '#define EVENTS_GLIB' >> config.h
[b7d3cc34]271else
272        echo
[85cf37f]273        echo 'ERROR: Unknown event handler specified.'
274        exit 1
[b7d3cc34]275fi
[85cf37f]276echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
[b7d3cc34]277
278detect_gnutls()
279{
[4af7b4f]280        if $PKG_CONFIG --exists gnutls; then
281                cat <<EOF>>Makefile.settings
[83e47ec]282EFLAGS+=`$PKG_CONFIG --libs gnutls` `libgcrypt-config --libs`
283CFLAGS+=`$PKG_CONFIG --cflags gnutls` `libgcrypt-config --cflags`
[4af7b4f]284EOF
285                ssl=gnutls
[5513f3e]286                if ! pkg-config gnutls --atleast-version=2.8; then
287                        echo
288                        echo 'Warning: With GnuTLS versions <2.8, certificate expire dates are not verified.'
289                fi
[4af7b4f]290                ret=1
291        elif libgnutls-config --version > /dev/null 2> /dev/null; then
[b7d3cc34]292                cat <<EOF>>Makefile.settings
[83e47ec]293EFLAGS+=`libgnutls-config --libs` `libgcrypt-config --libs`
294CFLAGS+=`libgnutls-config --cflags` `libgcrypt-config --cflags`
[b7d3cc34]295EOF
296               
297                ssl=gnutls
298                ret=1;
299        else
300                ret=0;
301        fi;
302}
303
304detect_nss()
305{
[ef043d3]306        if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG nss; then
[b7d3cc34]307                cat<<EOF>>Makefile.settings
[ef043d3]308EFLAGS+=`$PKG_CONFIG --libs nss`
309CFLAGS+=`$PKG_CONFIG --cflags nss`
[b7d3cc34]310EOF
311               
312                ssl=nss
313                ret=1;
314        else
315                ret=0;
316        fi;
317}
318
[36cf9fd]319RESOLV_TESTCODE='
[aee8c19]320#include <sys/types.h>
321#include <netinet/in.h>
[36cf9fd]322#include <arpa/nameser.h>
323#include <resolv.h>
324
325int main()
326{
327        ns_initparse( NULL, 0, NULL );
328        ns_parserr( NULL, ns_s_an, 0, NULL );
329}
330'
331
332detect_resolv_dynamic()
333{
[aee8c19]334        case "$arch" in
335        FreeBSD )
336                # In FreeBSD res_* routines are present in libc.so
337                LIBRESOLV=;;
338        * )
339                LIBRESOLV=-lresolv;;
340        esac
[4fca1db]341        TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
[8462239]342        ret=1
[aee8c19]343        echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null
[36cf9fd]344        if [ "$?" = "0" ]; then
[aee8c19]345                echo "EFLAGS+=$LIBRESOLV" >> 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
454for i in $STORAGES; do
455        STORAGE_OBJS="$STORAGE_OBJS storage_$i.o"
456done
457echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings
458
[b7d3cc34]459if [ "$strip" = 0 ]; then
460        echo "STRIP=\# skip strip" >> Makefile.settings;
461else
462        if [ "$debug" = 1 ]; then
463                echo
464                echo 'Stripping binaries does not make sense when debugging. Stripping disabled.'
465                echo 'STRIP=\# skip strip' >> Makefile.settings
466                strip=0;
467        elif [ -n "$STRIP" ]; then
468                echo "STRIP=$STRIP" >> Makefile.settings;
469        elif type strip > /dev/null 2> /dev/null; then
470                echo "STRIP=strip" >> Makefile.settings;
471        else
472                echo
473                echo 'No strip utility found, cannot remove unnecessary parts from executable.'
474                echo 'STRIP=\# skip strip' >> Makefile.settings
475                strip=0;
476        fi;
477fi
478
[417002e]479if [ -z "$systemdsystemunitdir" ]; then
480        if $PKG_CONFIG --exists systemd; then
481                systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
482        fi
483fi
484if [ -n "$systemdsystemunitdir" ]; then
485        if [ "$systemdsystemunitdir" != "no" ]; then
486                echo "SYSTEMDSYSTEMUNITDIR=$systemdsystemunitdir" >> Makefile.settings
487        fi
488fi
489
[66b9e86e]490if [ "$gcov" = "1" ]; then
[31fc3970]491        echo "CFLAGS+=--coverage" >> Makefile.settings
492        echo "EFLAGS+=--coverage" >> Makefile.settings
[66b9e86e]493fi
494
[2abfbc5]495if [ "$plugins" = 0 ]; then
496        echo '#undef WITH_PLUGINS' >> config.h
497else
498        echo '#define WITH_PLUGINS' >> config.h
499fi
500
[6738a67]501otrprefix=""
502for i in / /usr /usr/local; do
503        if [ -f ${i}/lib/libotr.a ]; then
504                otrprefix=${i}
505                break
506        fi
507done
[764c7d1]508if [ "$otr" = "auto" ]; then
[6738a67]509        if [ -n "$otrprefix" ]; then
510                otr=1
511        else
512                otr=0
513        fi
[764c7d1]514fi
[6738a67]515if [ "$otr" = 1 ]; then
[858ea01]516        # BI == built-in
517        echo '#define OTR_BI' >> config.h
[6738a67]518        echo "EFLAGS+=-L${otrprefix}/lib -lotr" >> Makefile.settings
519        echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
[858ea01]520        echo 'OTR_BI=otr.o' >> Makefile.settings
521elif [ "$otr" = "plugin" ]; then
522        echo '#define OTR_PI' >> config.h
523        echo "OTRFLAGS=-L${otrprefix}/lib -lotr" >> Makefile.settings
524        echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
525        echo 'OTR_PI=otr.so' >> Makefile.settings
[764c7d1]526fi
527
[17f6079]528if [ "$skype" = "1" -o "$skype" = "plugin" ]; then
[370899f]529        echo 'SKYPE_PI=skype.so' >> Makefile.settings
[17f6079]530        protocols_mods="$protocol_mods skype(plugin)"
[370899f]531fi
532
[ceebeb1]533if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then
534        echo
535        echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.'
536        echo 'Install xmlto if you want online help to work.'
537fi
538
[ffea9b9]539echo
[a014331]540if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then
541        nick=`bzr nick`
542        if [ -n "$nick" -a "$nick" != "bitlbee" ]; then
543                nick="-$nick"
544        else
545                nick=""
546        fi
[ffea9b9]547        rev=`bzr revno`
548        echo 'Using bzr revision #'$rev' as version number'
[a014331]549        BITLBEE_VERSION=\"bzr$nick-$rev\"
[b7d3cc34]550fi
551
552if [ -n "$BITLBEE_VERSION" ]; then
553        echo 'Spoofing version number: '$BITLBEE_VERSION
554        echo '#undef BITLBEE_VERSION' >> config.h
[ffea9b9]555        echo '#define BITLBEE_VERSION '$BITLBEE_VERSION >> config.h
556        echo
[b7d3cc34]557fi
558
[4fca1db]559if ! make helloworld > /dev/null 2>&1; then
560        echo "WARNING: Your version of make (BSD make?) does not support BitlBee's makefiles."
561        echo "BitlBee needs GNU make to build properly. On most systems GNU make is available"
562        echo "under the name 'gmake'."
563        echo
564        if gmake helloworld > /dev/null 2>&1; then
565                echo "gmake seems to be available on your machine, great."
566                echo
567        else
568                echo "gmake is not installed (or not working). Please try to install it."
569                echo
570        fi
571fi
572
[e506d6c]573cat <<EOF>bitlbee.pc
574prefix=$prefix
575includedir=$includedir
576
577Name: bitlbee
578Description: IRC to IM gateway
579Requires: glib-2.0
580Version: $BITLBEE_VERSION
581Libs:
582Cflags: -I\${includedir}
583
584EOF
585
[b7d3cc34]586protocols=''
587protoobjs=''
588
[e248c7f]589if [ "$purple" = 0 ]; then
590        echo '#undef WITH_PURPLE' >> config.h
591else
[e08e53c]592        if ! $PKG_CONFIG purple; then
593                echo
594                echo 'Cannot find libpurple development libraries, aborting. (Install libpurple-dev?)'
595                exit 1
596        fi
[e248c7f]597        echo '#define WITH_PURPLE' >> config.h
[e08e53c]598        cat<<EOF>>Makefile.settings
599EFLAGS += $($PKG_CONFIG purple --libs)
600PURPLE_CFLAGS += $($PKG_CONFIG purple --cflags)
601EOF
[e248c7f]602        protocols=$protocols'purple '
603        protoobjs=$protoobjs'purple_mod.o '
604
605        # Having both libpurple and native IM modules in one binary may
606        # do strange things. Let's not do that.
607        msn=0
608        jabber=0
609        oscar=0
610        yahoo=0
[18e1f3b]611
612        echo '#undef PACKAGE' >> config.h
613        echo '#define PACKAGE "BitlBee-LIBPURPLE"' >> config.h
[bda2975]614       
615        if [ "$events" = "libevent" ]; then
616                echo 'Warning: Some libpurple modules (including msn-pecan) do their event handling'
617                echo 'outside libpurple, talking to GLib directly. At least for now the combination'
618                echo 'libpurple + libevent is *not* recommended!'
[c775a58]619                echo
[bda2975]620        fi
[e248c7f]621fi
622
[b0a89cc]623case "$CC" in
624*gcc* )
[e371011]625        echo CFLAGS+=-MMD -MF .depend/\$@.d >> Makefile.settings
[b0a89cc]626        for i in . lib protocols protocols/*/; do
627                mkdir -p $i/.depend
628        done
629esac
630
[b7d3cc34]631if [ "$msn" = 0 ]; then
632        echo '#undef WITH_MSN' >> config.h
633else
634        echo '#define WITH_MSN' >> config.h
635        protocols=$protocols'msn '
[b5a22e3]636        protoobjs=$protoobjs'msn_mod.o '
[b7d3cc34]637fi
638
639if [ "$jabber" = 0 ]; then
640        echo '#undef WITH_JABBER' >> config.h
641else
642        echo '#define WITH_JABBER' >> config.h
643        protocols=$protocols'jabber '
[b5a22e3]644        protoobjs=$protoobjs'jabber_mod.o '
[b7d3cc34]645fi
646
647if [ "$oscar" = 0 ]; then
648        echo '#undef WITH_OSCAR' >> config.h
649else
650        echo '#define WITH_OSCAR' >> config.h
651        protocols=$protocols'oscar '
[b5a22e3]652        protoobjs=$protoobjs'oscar_mod.o '
[b7d3cc34]653fi
654
655if [ "$yahoo" = 0 ]; then
656        echo '#undef WITH_YAHOO' >> config.h
657else
658        echo '#define WITH_YAHOO' >> config.h
659        protocols=$protocols'yahoo '
[b5a22e3]660        protoobjs=$protoobjs'yahoo_mod.o '
[b7d3cc34]661fi
662
[1b221e0]663if [ "$twitter" = 0 ]; then
664        echo '#undef WITH_TWITTER' >> config.h
665else
666        echo '#define WITH_TWITTER' >> config.h
667        protocols=$protocols'twitter '
668        protoobjs=$protoobjs'twitter_mod.o '
669fi
670
[b7d3cc34]671if [ "$protocols" = "PROTOCOLS = " ]; then
[43462708]672        echo "Warning: You haven't selected any communication protocol to compile!"
[b3c467b]673        echo "         BitlBee will run, but you will be unable to connect to IM servers!"
[b7d3cc34]674fi
675
676echo "PROTOCOLS = $protocols" >> Makefile.settings
677echo "PROTOOBJS = $protoobjs" >> Makefile.settings
678
679echo Architecture: $arch
680case "$arch" in
681Linux )
682;;
683GNU/* )
684;;
685*BSD )
686;;
687Darwin )
[caceb06]688        echo 'STRIP=\# skip strip' >> Makefile.settings
[b7d3cc34]689;;
690IRIX )
691;;
692SunOS )
693        echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings
694        echo 'STRIP=\# skip strip' >> Makefile.settings
[70d7795]695        echo '#define NO_FD_PASSING' >> config.h
[b7d3cc34]696;;
[8de63c3]697AIX )
698        echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings
[b7d3cc34]699;;
700CYGWIN* )
701        echo 'Cygwin is not officially supported.'
702;;
[aec56b0]703Windows )
704;;
[b7d3cc34]705* )
[8d6c4b1]706        echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.'
707        echo 'Please report any problems at http://bugs.bitlbee.org/.'
[b7d3cc34]708;;
709esac
710
[f1e7407]711if [ -n "$target" ]; then
712        echo "Cross-compiling for: $target"
713fi
714
[b7d3cc34]715echo
716echo 'Configuration done:'
717
718if [ "$debug" = "1" ]; then
[b3c467b]719        echo '  Debugging enabled.'
[b7d3cc34]720else
[b3c467b]721        echo '  Debugging disabled.'
[b7d3cc34]722fi
723
724if [ "$strip" = "1" ]; then
[b3c467b]725        echo '  Binary stripping enabled.'
[b7d3cc34]726else
[b3c467b]727        echo '  Binary stripping disabled.'
[b7d3cc34]728fi
729
[764c7d1]730if [ "$otr" = "1" ]; then
731        echo '  Off-the-Record (OTR) Messaging enabled.'
[858ea01]732elif [ "$otr" = "plugin" ]; then
733        echo '  Off-the-Record (OTR) Messaging enabled (as a plugin).'
[764c7d1]734else
735        echo '  Off-the-Record (OTR) Messaging disabled.'
736fi
737
[417002e]738if [ -n "$systemdsystemunitdir" ]; then
739        echo '  systemd enabled.'
740else
741        echo '  systemd disabled.'
742fi
743
[b3c467b]744echo '  Using event handler: '$events
745echo '  Using SSL library: '$ssl
[4e3df8a]746#echo '  Building with these storage backends: '$STORAGES
[b7d3cc34]747
748if [ -n "$protocols" ]; then
[17f6079]749        echo '  Building with these protocols:' $protocols$protocols_mods
[4e3df8a]750        case "$protocols" in
751        *purple*)
752                echo "    Note that BitlBee-libpurple is supported on a best-effort basis. It's"
753                echo "    not *fully* compatible with normal BitlBee. Don't use it unless you"
754                echo "    absolutely need it (i.e. support for a certain protocol or feature)."
755        esac
[b7d3cc34]756else
[b3c467b]757        echo '  Building without IM-protocol support. We wish you a lot of fun...'
[b7d3cc34]758fi
Note: See TracBrowser for help on using the repository browser.