source: configure @ aee8c19

Last change on this file since aee8c19 was aee8c19, checked in by Wilmer van der Gaast <wilmer@…>, at 2011-12-07T21:37:27Z

Fix libresolv detection on FreeBSD. Based on a patch by ashish@….

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