Changeset 85d7b85 for configure


Ignore:
Timestamp:
2008-04-02T14:22:57Z (17 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
f9dbc99
Parents:
875ad42 (diff), dd34575 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r875ad42 r85d7b85  
    1414datadir='$prefix/share/bitlbee/'
    1515config='/var/lib/bitlbee/'
     16plugindir='$prefix/lib/bitlbee/'
     17includedir='$prefix/include/bitlbee/'
     18libevent='/usr/'
    1619pidfile='/var/run/bitlbee.pid'
    17 ipcsocket='/var/run/bitlbee'
    18 plugindir='$prefix/lib/bitlbee'
     20ipcsocket='/var/run/bitlbee.sock'
    1921pcdir='$prefix/lib/pkgconfig'
    20 includedir='$prefix/include/bitlbee'
    2122
    2223msn=1
     
    2728debug=0
    2829strip=1
    29 ipv6=1
     30gcov=0
     31plugins=1
     32
     33events=glib
     34ldap=0
    3035ssl=auto
    3136
    3237arch=`uname -s`
    3338cpu=`uname -m`
     39
     40GLIB_MIN_VERSION=2.4
    3441
    3542echo BitlBee configure
     
    6168--debug=0/1     Disable/enable debugging                $debug
    6269--strip=0/1     Disable/enable binary stripping         $strip
    63 
    64 --ipv6=0/1      IPv6 socket support                     $ipv6
    65 
    66 --ssl=...       SSL library to use (gnutls, nss, openssl, sspi, bogus, auto)
     70--gcov=0/1      Disable/enable test coverage reporting  $gcov
     71--plugins=0/1   Disable/enable plugins support          $plugins
     72
     73--events=...    Event handler (glib, libevent)          $events
     74--ssl=...       SSL library to use (gnutls, nss, openssl, bogus, auto)
    6775                                                        $ssl
    6876--arch=...  Override target architecture $arch
     
    8290config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
    8391plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
     92includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'`
     93libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'`
     94
    8495pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
    8596ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
    86 includedir=`eval echo "$includedir" | sed 's/\/\{1,\}/\//g'`
    8797pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
    8898
     
    96106PLUGINDIR=$plugindir
    97107CONFIG=$config
    98 IPCSOCKET=$ipcsocket
    99108INCLUDEDIR=$includedir
    100109PCDIR=$pcdir
     
    125134EOF
    126135
    127 if [ "$ipv6" = "1" ]; then
    128         echo '#define IPV6' >> config.h
    129 fi
    130 
    131136if [ "$debug" = "1" ]; then
    132         echo 'CFLAGS=-g' >> Makefile.settings
     137        [ -z "$CFLAGS" ] && CFLAGS=-g
    133138        echo 'DEBUG=1' >> Makefile.settings
    134         echo '#define DEBUG' >> config.h
    135 else
    136         echo 'CFLAGS=-O3' >> Makefile.settings
    137 fi
    138 
    139 echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings
     139        CFLAGS="$CFLAGS -DDEBUG"
     140else
     141        [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing"
     142fi
     143
     144echo CFLAGS=$CFLAGS >> Makefile.settings
     145echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings
    140146
    141147echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
    142148
    143149if [ -n "$CC" ]; then
    144         echo "CC=$CC" >> Makefile.settings;
     150        CC=$CC
    145151elif type gcc > /dev/null 2> /dev/null; then
    146         echo "CC=gcc" >> Makefile.settings;
     152        CC=gcc
    147153elif type cc > /dev/null 2> /dev/null; then
    148         echo "CC=cc" >> Makefile.settings;
     154        CC=cc
    149155else
    150156        echo 'Cannot find a C compiler, aborting.'
    151157        exit 1;
    152158fi
     159
     160echo "CC=$CC" >> Makefile.settings;
    153161
    154162if [ -n "$LD" ]; then
     
    165173fi
    166174
    167 GLIB=0
    168 
    169175if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then
    170         cat<<EOF>>Makefile.settings
     176        if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then
     177                cat<<EOF>>Makefile.settings
    171178EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0`
    172179CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
    173180EOF
    174         echo '#define GLIB2' >> config.h
    175         GLIB=2
    176 elif type glib-config > /dev/null 2> /dev/null; then
    177         cat<<EOF>>Makefile.settings
    178 EFLAGS+=`glib-config --libs`
    179 CFLAGS+=`glib-config --cflags`
    180 EOF
    181         echo '#define GLIB1' >> config.h
    182         GLIB=1
    183 else
    184         echo 'Cannot find glib development libraries, aborting. (Install libglib-dev?)'
    185         exit 1;
    186 fi
    187 
    188 if [ GLIB = 1 -o -r /usr/include/iconv.h ]; then
    189         :;
    190 elif [ -r /usr/local/include/iconv.h ]; then
    191         echo CFLAGS+=-I/usr/local/include >> Makefile.settings;
    192 else
    193         echo
    194         echo 'Warning: Could not find iconv.h, you might have to install it and/or modify'
    195         echo 'Makefile.settings to tell where this file is.';
    196 fi
    197 
     181        else
     182                echo
     183                echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.'
     184                exit 1
     185        fi
     186else
     187        echo
     188        echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)'
     189        exit 1
     190fi
     191
     192if [ "$events" = "libevent" ]; then
     193        if ! [ -f "${libevent}include/event.h" ]; then
     194                echo
     195                echo 'Warning: Could not find event.h, you might have to install it and/or specify'
     196                echo 'its location using the --libevent= argument. (Example: If event.h is in'
     197                echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)'
     198        fi
     199       
     200        echo '#define EVENTS_LIBEVENT' >> config.h
     201        cat <<EOF>>Makefile.settings
     202EFLAGS+=-levent -L${libevent}lib
     203CFLAGS+=-I${libevent}include
     204EOF
     205elif [ "$events" = "glib" ]; then
     206        ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...):
     207        echo '#define EVENTS_GLIB' >> config.h
     208else
     209        echo
     210        echo 'ERROR: Unknown event handler specified.'
     211        exit 1
     212fi
     213echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
    198214
    199215detect_gnutls()
     
    227243}
    228244
    229 if [ "$msn" = 1 -o "$jabber" = 1 ]; then
    230         if [ "$ssl" = "auto" ]; then
    231                 detect_gnutls
    232                 if [ "$ret" = "0" ]; then
    233                         detect_nss
    234                 fi;
    235         elif [ "$ssl" = "gnutls" ]; then
    236                 detect_gnutls;
    237         elif [ "$ssl" = "nss" ]; then
    238                 detect_nss;
    239         elif [ "$ssl" = "sspi" ]; then
     245detect_ldap()
     246{
     247        TMPFILE=`mktemp`
     248        if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
     249                cat<<EOF>>Makefile.settings
     250EFLAGS+=-lldap
     251CFLAGS+=
     252EOF
     253                ldap=1
     254                rm -f $TMPFILE
     255                ret=1
     256        else
     257                ldap=0
     258                ret=0
     259        fi
     260}
     261
     262if [ "$ssl" = "auto" ]; then
     263        detect_gnutls
     264        if [ "$ret" = "0" ]; then
     265                detect_nss
     266        fi
     267elif [ "$ssl" = "gnutls" ]; then
     268        detect_gnutls
     269elif [ "$ssl" = "nss" ]; then
     270        detect_nss
     271elif [ "$ssl" = "sspi" ]; then
     272        echo
     273elif [ "$ssl" = "openssl" ]; then
     274        echo
     275        echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
     276        echo 'install of OpenSSL (including devel/header files) before reporting'
     277        echo 'compilation problems.'
     278        echo
     279        echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
     280        echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
     281        echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
     282        echo 'part of the operating system, which makes it GPL-compatible.'
     283        echo
     284        echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
     285        echo '                    http://www.gnome.org/~markmc/openssl-and-the-gpl.html'
     286        echo
     287        echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
     288        echo 'probably illegal. If you want to create and distribute a binary BitlBee'
     289        echo 'package, you really should use GnuTLS or NSS instead.'
     290        echo
     291        echo 'Also, the OpenSSL license requires us to say this:'
     292        echo ' *    "This product includes software developed by the OpenSSL Project'
     293        echo ' *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"'
     294       
     295        echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings
     296       
     297        ret=1
     298elif [ "$ssl" = "bogus" ]; then
     299        echo
     300        echo 'Using bogus SSL code. This means some features will not work properly.'
     301       
     302        ## Yes, you, at the console! How can you authenticate if you don't have any SSL!?
     303        if [ "$msn" = "1" ]; then
    240304                echo
    241         elif [ "$ssl" = "openssl" ]; then
    242                 echo
    243                 echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
    244                 echo 'install of OpenSSL (including devel/header files) before reporting'
    245                 echo 'compilation problems.'
    246                 echo
    247                 echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
    248                 echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
    249                 echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
    250                 echo 'part of the operating system, which makes it GPL-compatible.'
    251                 echo
    252                 echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
    253                 echo '                    http://www.gnome.org/~markmc/openssl-and-the-gpl.html'
    254                 echo
    255                 echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
    256                 echo 'probably illegal. If you want to create and distribute a binary BitlBee'
    257                 echo 'package, you really should use GnuTLS or NSS instead.'
    258                 echo
    259                 echo 'Also, the OpenSSL license requires us to say this:'
    260                 echo ' *    "This product includes software developed by the OpenSSL Project'
    261                 echo ' *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"'
    262                
    263                 echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings
    264                
    265                 ret=1;
    266         elif [ "$ssl" = "bogus" ]; then
    267                 echo
    268                 echo 'Using bogus SSL code. This will not make the MSN module work, but it will'
    269                 echo 'allow you to use the Jabber module - although without working SSL support.'
    270                
    271                 ret=1;
    272         else
    273                 echo
    274                 echo 'ERROR: Unknown SSL library specified.'
    275                 exit 1;
    276         fi
    277        
    278         if [ "$ret" = "0" ]; then
    279                 echo
    280                 echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
    281                 echo '       This is necessary for MSN and full Jabber support. To continue,'
    282                 echo '       install a suitable SSL library or disable MSN support (--msn=0).'
    283                 echo '       If you want Jabber without SSL support you can try --ssl=bogus.'
    284                
    285                 exit 1;
    286         fi;
    287        
    288         echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
    289 fi
     305                echo 'Real SSL support is necessary for MSN authentication, will build without'
     306                echo 'MSN protocol support.'
     307                msn=0
     308        fi
     309       
     310        ret=1
     311else
     312        echo
     313        echo 'ERROR: Unknown SSL library specified.'
     314        exit 1
     315fi
     316
     317if [ "$ret" = "0" ]; then
     318        echo
     319        echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
     320        echo '       Please note that this script doesn'\''t have detection code for OpenSSL,'
     321        echo '       so if you want to use that, you have to select it by hand. If you don'\''t'
     322        echo '       need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)'
     323       
     324        exit 1
     325fi;
     326
     327echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
     328
     329for i in /lib /usr/lib /usr/local/lib; do
     330        if [ -f $i/libresolv.a ]; then
     331                echo '#define HAVE_RESOLV_A' >> config.h
     332                echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings
     333                break
     334        fi
     335done
     336
     337STORAGES="text xml"
     338
     339if [ "$ldap" = "auto" ]; then
     340        detect_ldap
     341fi
     342
     343if [ "$ldap" = 0 ]; then
     344        echo "#undef WITH_LDAP" >> config.h
     345elif [ "$ldap" = 1 ]; then
     346        echo
     347        echo 'LDAP support is a work in progress and does NOT work AT ALL right now.'
     348        echo
     349        exit 1
     350       
     351        echo "#define WITH_LDAP 1" >> config.h
     352        STORAGES="$STORAGES ldap"
     353fi
     354
     355for i in $STORAGES; do
     356        STORAGE_OBJS="$STORAGE_OBJS storage_$i.o"
     357done
     358echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings
    290359
    291360if [ "$strip" = 0 ]; then
     
    301370        elif type strip > /dev/null 2> /dev/null; then
    302371                echo "STRIP=strip" >> Makefile.settings;
    303         elif /bin/test -x /usr/ccs/bin/strip; then
    304                 echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
    305372        else
    306373                echo
     
    309376                strip=0;
    310377        fi;
     378fi
     379
     380if [ "$gcov" = "1" ]; then
     381        echo "CFLAGS+=--coverage" >> Makefile.settings
     382        echo "EFLAGS+=--coverage" >> Makefile.settings
     383fi
     384
     385if [ "$plugins" = 0 ]; then
     386        echo '#undef WITH_PLUGINS' >> config.h
     387else
     388        echo '#define WITH_PLUGINS' >> config.h
    311389fi
    312390
     
    380458
    381459if [ "$protocols" = "PROTOCOLS = " ]; then
    382         echo "WARNING: You haven't selected any communication protocol to compile!"
    383         echo "         Bitlbee will run, but you will be unable to connect to IM servers!"
     460        echo "Warning: You haven't selected any communication protocol to compile!"
     461        echo "         BitlBee will run, but you will be unable to connect to IM servers!"
    384462fi
    385463
     
    394472;;
    395473*BSD )
    396         echo 'EFLAGS+=-liconv' >> Makefile.settings;
     474;;
     475Darwin )
     476;;
     477IRIX )
    397478;;
    398479SunOS )
    399480        echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings
    400481        echo 'STRIP=\# skip strip' >> Makefile.settings
    401         echo 'EFLAGS+=-liconv' >> Makefile.settings;
    402 ;;
    403 Darwin )
    404         echo 'EFLAGS+=-liconv' >> Makefile.settings;
    405 ;;
    406 IRIX )
     482;;
     483AIX )
     484        echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings
    407485;;
    408486CYGWIN* )
     
    424502
    425503if [ "$debug" = "1" ]; then
    426         echo '  Debugging enabled.';
    427 else
    428         echo '  Debugging disabled.';
     504        echo '  Debugging enabled.'
     505else
     506        echo '  Debugging disabled.'
    429507fi
    430508
    431509if [ "$strip" = "1" ]; then
    432         echo '  Binary stripping enabled.';
    433 else
    434         echo '  Binary stripping disabled.';
    435 fi
    436 
    437 if [ "$msn" = "1" ]; then
    438         echo '  Using SSL library: '$ssl;
    439 fi
    440 
    441 #if [ "$flood" = "0" ]; then
    442 #       echo '  Flood protection disabled.';
    443 #else
    444 #       echo '  Flood protection enabled.';
    445 #fi
     510        echo '  Binary stripping enabled.'
     511else
     512        echo '  Binary stripping disabled.'
     513fi
     514
     515echo '  Using event handler: '$events
     516echo '  Using SSL library: '$ssl
     517echo '  Building with these storage backends: '$STORAGES
    446518
    447519if [ -n "$protocols" ]; then
    448         echo '  Building with these protocols:' $protocols;
    449 else
    450         echo '  Building without IM-protocol support. We wish you a lot of fun...';
    451 fi
     520        echo '  Building with these protocols:' $protocols
     521else
     522        echo '  Building without IM-protocol support. We wish you a lot of fun...'
     523fi
Note: See TracChangeset for help on using the changeset viewer.