source: configure @ 1783ab6

Last change on this file since 1783ab6 was d203495, checked in by Jelmer Vernooij <jelmer@…>, at 2014-07-19T23:55:24Z

Allow LDFLAGS to be provided in the environment and consistently use $(LDFLAGS)
when linking (not partially linking).

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