Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r31fc3970 raec56b0  
    1414datadir='$prefix/share/bitlbee/'
    1515config='/var/lib/bitlbee/'
    16 plugindir='$prefix/lib/bitlbee/'
    17 includedir='$prefix/include/bitlbee/'
    18 libevent='/usr/'
    1916pidfile='/var/run/bitlbee.pid'
    20 ipcsocket='/var/run/bitlbee.sock'
     17ipcsocket='/var/run/bitlbee'
     18plugindir='$prefix/lib/bitlbee'
    2119pcdir='$prefix/lib/pkgconfig'
     20includedir='$prefix/include/bitlbee'
    2221
    2322msn=1
     
    2827debug=0
    2928strip=1
    30 gcov=0
    31 plugins=1
    32 
    33 events=glib
    34 ldap=0
     29ipv6=1
    3530ssl=auto
    3631
    3732arch=`uname -s`
    3833cpu=`uname -m`
    39 
    40 GLIB_MIN_VERSION=2.4
    4134
    4235echo BitlBee configure
     
    6861--debug=0/1     Disable/enable debugging                $debug
    6962--strip=0/1     Disable/enable binary stripping         $strip
    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)
     63
     64--ipv6=0/1      IPv6 socket support                     $ipv6
     65
     66--ssl=...       SSL library to use (gnutls, nss, openssl, sspi, bogus, auto)
    7567                                                        $ssl
     68--arch=...  Override target architecture $arch
     69
    7670EOF
    7771                exit;
     
    8882config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
    8983plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
    90 includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'`
    91 libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'`
    92 
    9384pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
    9485ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
     86includedir=`eval echo "$includedir" | sed 's/\/\{1,\}/\//g'`
    9587pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
    9688
     
    10496PLUGINDIR=$plugindir
    10597CONFIG=$config
     98IPCSOCKET=$ipcsocket
    10699INCLUDEDIR=$includedir
    107100PCDIR=$pcdir
     
    132125EOF
    133126
     127if [ "$ipv6" = "1" ]; then
     128        echo '#define IPV6' >> config.h
     129fi
     130
    134131if [ "$debug" = "1" ]; then
    135         [ -z "$CFLAGS" ] && CFLAGS=-g
     132        echo 'CFLAGS=-g' >> Makefile.settings
    136133        echo 'DEBUG=1' >> Makefile.settings
    137         CFLAGS="$CFLAGS -DDEBUG"
    138 else
    139         [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing"
    140 fi
    141 
    142 echo CFLAGS=$CFLAGS >> Makefile.settings
    143 echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings
     134        echo '#define DEBUG' >> config.h
     135else
     136        echo 'CFLAGS=-O3' >> Makefile.settings
     137fi
     138
     139echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings
    144140
    145141echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
    146142
    147143if [ -n "$CC" ]; then
    148         CC=$CC
     144        echo "CC=$CC" >> Makefile.settings;
    149145elif type gcc > /dev/null 2> /dev/null; then
    150         CC=gcc
     146        echo "CC=gcc" >> Makefile.settings;
    151147elif type cc > /dev/null 2> /dev/null; then
    152         CC=cc
     148        echo "CC=cc" >> Makefile.settings;
    153149else
    154150        echo 'Cannot find a C compiler, aborting.'
    155151        exit 1;
    156152fi
    157 
    158 echo "CC=$CC" >> Makefile.settings;
    159153
    160154if [ -n "$LD" ]; then
     
    171165fi
    172166
     167GLIB=0
     168
    173169if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then
    174         if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then
    175                 cat<<EOF>>Makefile.settings
     170        cat<<EOF>>Makefile.settings
    176171EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0`
    177172CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
    178173EOF
    179         else
    180                 echo
    181                 echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.'
    182                 exit 1
    183         fi
     174        echo '#define GLIB2' >> config.h
     175        GLIB=2
     176elif type glib-config > /dev/null 2> /dev/null; then
     177        cat<<EOF>>Makefile.settings
     178EFLAGS+=`glib-config --libs`
     179CFLAGS+=`glib-config --cflags`
     180EOF
     181        echo '#define GLIB1' >> config.h
     182        GLIB=1
     183else
     184        echo 'Cannot find glib development libraries, aborting. (Install libglib-dev?)'
     185        exit 1;
     186fi
     187
     188if [ GLIB = 1 -o -r /usr/include/iconv.h ]; then
     189        :;
     190elif [ -r /usr/local/include/iconv.h ]; then
     191        echo CFLAGS+=-I/usr/local/include >> Makefile.settings;
    184192else
    185193        echo
    186         echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)'
    187         exit 1
    188 fi
    189 
    190 if [ "$events" = "libevent" ]; then
    191         if ! [ -f "${libevent}include/event.h" ]; then
    192                 echo
    193                 echo 'Warning: Could not find event.h, you might have to install it and/or specify'
    194                 echo 'its location using the --libevent= argument. (Example: If event.h is in'
    195                 echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)'
    196         fi
    197        
    198         echo '#define EVENTS_LIBEVENT' >> config.h
    199         cat <<EOF>>Makefile.settings
    200 EFLAGS+=-levent -L${libevent}lib
    201 CFLAGS+=-I${libevent}include
    202 EOF
    203 elif [ "$events" = "glib" ]; then
    204         ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...):
    205         echo '#define EVENTS_GLIB' >> config.h
    206 else
    207         echo
    208         echo 'ERROR: Unknown event handler specified.'
    209         exit 1
    210 fi
    211 echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
     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.';
     196fi
     197
    212198
    213199detect_gnutls()
     
    241227}
    242228
    243 detect_ldap()
    244 {
    245         TMPFILE=`mktemp`
    246         if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
    247                 cat<<EOF>>Makefile.settings
    248 EFLAGS+=-lldap
    249 CFLAGS+=
    250 EOF
    251                 ldap=1
    252                 rm -f $TMPFILE
    253                 ret=1
     229if [ "$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
     240                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;
    254272        else
    255                 ldap=0
    256                 ret=0
    257         fi
    258 }
    259 
    260 if [ "$ssl" = "auto" ]; then
    261         detect_gnutls
    262         if [ "$ret" = "0" ]; then
    263                 detect_nss
    264         fi
    265 elif [ "$ssl" = "gnutls" ]; then
    266         detect_gnutls
    267 elif [ "$ssl" = "nss" ]; then
    268         detect_nss
    269 elif [ "$ssl" = "openssl" ]; then
    270         echo
    271         echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
    272         echo 'install of OpenSSL (including devel/header files) before reporting'
    273         echo 'compilation problems.'
    274         echo
    275         echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
    276         echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
    277         echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
    278         echo 'part of the operating system, which makes it GPL-compatible.'
    279         echo
    280         echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
    281         echo '                    http://www.gnome.org/~markmc/openssl-and-the-gpl.html'
    282         echo
    283         echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
    284         echo 'probably illegal. If you want to create and distribute a binary BitlBee'
    285         echo 'package, you really should use GnuTLS or NSS instead.'
    286         echo
    287         echo 'Also, the OpenSSL license requires us to say this:'
    288         echo ' *    "This product includes software developed by the OpenSSL Project'
    289         echo ' *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"'
    290        
    291         echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings
    292        
    293         ret=1
    294 elif [ "$ssl" = "bogus" ]; then
    295         echo
    296         echo 'Using bogus SSL code. This means some features will not work properly.'
    297        
    298         ## Yes, you, at the console! How can you authenticate if you don't have any SSL!?
    299         if [ "$msn" = "1" ]; then
    300                 echo
    301                 echo 'Real SSL support is necessary for MSN authentication, will build without'
    302                 echo 'MSN protocol support.'
    303                 msn=0
     273                echo
     274                echo 'ERROR: Unknown SSL library specified.'
     275                exit 1;
    304276        fi
    305277       
    306         ret=1
    307 else
    308         echo
    309         echo 'ERROR: Unknown SSL library specified.'
    310         exit 1
    311 fi
    312 
    313 if [ "$ret" = "0" ]; then
    314         echo
    315         echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
    316         echo '       Please note that this script doesn'\''t have detection code for OpenSSL,'
    317         echo '       so if you want to use that, you have to select it by hand. If you don'\''t'
    318         echo '       need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)'
     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;
    319287       
    320         exit 1
    321 fi;
    322 
    323 echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
    324 
    325 for i in /lib /usr/lib /usr/local/lib; do
    326         if [ -f $i/libresolv.a ]; then
    327                 echo '#define HAVE_RESOLV_A' >> config.h
    328                 echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings
    329                 break
    330         fi
    331 done
    332 
    333 STORAGES="text xml"
    334 
    335 if [ "$ldap" = "auto" ]; then
    336         detect_ldap
    337 fi
    338 
    339 if [ "$ldap" = 0 ]; then
    340         echo "#undef WITH_LDAP" >> config.h
    341 elif [ "$ldap" = 1 ]; then
    342         echo
    343         echo 'LDAP support is a work in progress and does NOT work AT ALL right now.'
    344         echo
    345         exit 1
    346        
    347         echo "#define WITH_LDAP 1" >> config.h
    348         STORAGES="$STORAGES ldap"
    349 fi
    350 
    351 for i in $STORAGES; do
    352         STORAGE_OBJS="$STORAGE_OBJS storage_$i.o"
    353 done
    354 echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings
     288        echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
     289fi
    355290
    356291if [ "$strip" = 0 ]; then
     
    366301        elif type strip > /dev/null 2> /dev/null; then
    367302                echo "STRIP=strip" >> Makefile.settings;
     303        elif /bin/test -x /usr/ccs/bin/strip; then
     304                echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
    368305        else
    369306                echo
     
    372309                strip=0;
    373310        fi;
    374 fi
    375 
    376 if [ "$gcov" = "1" ]; then
    377         echo "CFLAGS+=--coverage" >> Makefile.settings
    378         echo "EFLAGS+=--coverage" >> Makefile.settings
    379 fi
    380 
    381 if [ "$plugins" = 0 ]; then
    382         echo '#undef WITH_PLUGINS' >> config.h
    383 else
    384         echo '#define WITH_PLUGINS' >> config.h
    385311fi
    386312
     
    454380
    455381if [ "$protocols" = "PROTOCOLS = " ]; then
    456         echo "Warning: You haven't selected any communication protocol to compile!"
    457         echo "         BitlBee will run, but you will be unable to connect to IM servers!"
     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!"
    458384fi
    459385
     
    468394;;
    469395*BSD )
    470 ;;
    471 Darwin )
    472 ;;
    473 IRIX )
     396        echo 'EFLAGS+=-liconv' >> Makefile.settings;
    474397;;
    475398SunOS )
    476399        echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings
    477400        echo 'STRIP=\# skip strip' >> Makefile.settings
    478 ;;
    479 AIX )
    480         echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings
     401        echo 'EFLAGS+=-liconv' >> Makefile.settings;
     402;;
     403Darwin )
     404        echo 'EFLAGS+=-liconv' >> Makefile.settings;
     405;;
     406IRIX )
    481407;;
    482408CYGWIN* )
    483409        echo 'Cygwin is not officially supported.'
     410;;
     411Windows )
     412        echo OUTFILE=bitlbee.exe >> Makefile.settings
     413        echo LFLAGS+=-lwsock32 >> Makefile.settings
     414        echo EFLAGS+=-lsecur32 >> Makefile.settings
    484415;;
    485416* )
     
    493424
    494425if [ "$debug" = "1" ]; then
    495         echo '  Debugging enabled.'
    496 else
    497         echo '  Debugging disabled.'
     426        echo '  Debugging enabled.';
     427else
     428        echo '  Debugging disabled.';
    498429fi
    499430
    500431if [ "$strip" = "1" ]; then
    501         echo '  Binary stripping enabled.'
    502 else
    503         echo '  Binary stripping disabled.'
    504 fi
    505 
    506 echo '  Using event handler: '$events
    507 echo '  Using SSL library: '$ssl
    508 echo '  Building with these storage backends: '$STORAGES
     432        echo '  Binary stripping enabled.';
     433else
     434        echo '  Binary stripping disabled.';
     435fi
     436
     437if [ "$msn" = "1" ]; then
     438        echo '  Using SSL library: '$ssl;
     439fi
     440
     441#if [ "$flood" = "0" ]; then
     442#       echo '  Flood protection disabled.';
     443#else
     444#       echo '  Flood protection enabled.';
     445#fi
    509446
    510447if [ -n "$protocols" ]; then
    511         echo '  Building with these protocols:' $protocols
    512 else
    513         echo '  Building without IM-protocol support. We wish you a lot of fun...'
    514 fi
     448        echo '  Building with these protocols:' $protocols;
     449else
     450        echo '  Building without IM-protocol support. We wish you a lot of fun...';
     451fi
Note: See TracChangeset for help on using the changeset viewer.