Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r574af7e rb3c467b  
    1414datadir='$prefix/share/bitlbee/'
    1515config='/var/lib/bitlbee/'
     16plugindir='$prefix/lib/bitlbee/'
     17includedir='$prefix/include/bitlbee/'
     18libevent='/usr/'
    1619pidfile='/var/run/bitlbee.pid'
    1720ipcsocket='/var/run/bitlbee'
    18 plugindir='$prefix/lib/bitlbee'
    1921pcdir='$prefix/lib/pkgconfig'
    20 includedir='$prefix/include/bitlbee'
    2122
    2223msn=1
     
    2829strip=1
    2930ipv6=1
     31
     32events=glib
     33ldap=auto
    3034ssl=auto
    3135
     
    6468--ipv6=0/1      IPv6 socket support                     $ipv6
    6569
     70--ldap=0/1/auto LDAP support                            $ldap
     71
     72--events=...    Event handler (glib, libevent)          $events
    6673--ssl=...       SSL library to use (gnutls, nss, openssl, bogus, auto)
    6774                                                        $ssl
     
    8087config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
    8188plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
     89includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'`
     90libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'`
     91
    8292pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
    8393ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
    84 includedir=`eval echo "$includedir" | sed 's/\/\{1,\}/\//g'`
    8594pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
    8695
     
    135144fi
    136145
    137 echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings
     146echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings
    138147
    139148echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
    140149
    141150if [ -n "$CC" ]; then
    142         echo "CC=$CC" >> Makefile.settings;
     151        CC=$CC
    143152elif type gcc > /dev/null 2> /dev/null; then
    144         echo "CC=gcc" >> Makefile.settings;
     153        CC=gcc
    145154elif type cc > /dev/null 2> /dev/null; then
    146         echo "CC=cc" >> Makefile.settings;
     155        CC=cc
    147156else
    148157        echo 'Cannot find a C compiler, aborting.'
    149158        exit 1;
    150159fi
     160
     161echo "CC=$CC" >> Makefile.settings;
    151162
    152163if [ -n "$LD" ]; then
     
    172183        exit 1;
    173184fi
     185
     186if [ "$events" = "libevent" ]; then
     187        if ! [ -e "${libevent}include/event.h" ]; then
     188                echo
     189                echo 'Warning: Could not find event.h, you might have to install it and/or specify'
     190                echo 'its location using the --libevent= argument. (Example: If event.h is in'
     191                echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)'
     192        fi
     193       
     194        echo '#define EVENTS_LIBEVENT' >> config.h
     195        cat <<EOF>>Makefile.settings
     196EFLAGS+=-levent -L${libevent}lib
     197CFLAGS+=-I${libevent}include
     198EOF
     199elif [ "$events" = "glib" ]; then
     200        ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...):
     201        echo '#define EVENTS_GLIB' >> config.h
     202else
     203        echo
     204        echo 'ERROR: Unknown event handler specified.'
     205        exit 1
     206fi
     207echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
    174208
    175209detect_gnutls()
     
    203237}
    204238
    205 if [ "$msn" = 1 -o "$jabber" = 1 ]; then
    206         if [ "$ssl" = "auto" ]; then
    207                 detect_gnutls
    208                 if [ "$ret" = "0" ]; then
    209                         detect_nss
    210                 fi;
    211         elif [ "$ssl" = "gnutls" ]; then
    212                 detect_gnutls;
    213         elif [ "$ssl" = "nss" ]; then
    214                 detect_nss;
    215         elif [ "$ssl" = "openssl" ]; then
     239detect_ldap()
     240{
     241        TMPFILE=`mktemp`
     242        if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
     243                cat<<EOF>>Makefile.settings
     244EFLAGS+=-lldap
     245CFLAGS+=
     246EOF
     247                ldap=1
     248                rm -f $TMPFILE
     249                ret=1
     250        else
     251                ldap=0
     252                ret=0
     253        fi
     254}
     255
     256if [ "$ssl" = "auto" ]; then
     257        detect_gnutls
     258        if [ "$ret" = "0" ]; then
     259                detect_nss
     260        fi
     261elif [ "$ssl" = "gnutls" ]; then
     262        detect_gnutls
     263elif [ "$ssl" = "nss" ]; then
     264        detect_nss
     265elif [ "$ssl" = "openssl" ]; then
     266        echo
     267        echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
     268        echo 'install of OpenSSL (including devel/header files) before reporting'
     269        echo 'compilation problems.'
     270        echo
     271        echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
     272        echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
     273        echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
     274        echo 'part of the operating system, which makes it GPL-compatible.'
     275        echo
     276        echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
     277        echo '                    http://www.gnome.org/~markmc/openssl-and-the-gpl.html'
     278        echo
     279        echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
     280        echo 'probably illegal. If you want to create and distribute a binary BitlBee'
     281        echo 'package, you really should use GnuTLS or NSS instead.'
     282        echo
     283        echo 'Also, the OpenSSL license requires us to say this:'
     284        echo ' *    "This product includes software developed by the OpenSSL Project'
     285        echo ' *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"'
     286       
     287        echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings
     288       
     289        ret=1
     290elif [ "$ssl" = "bogus" ]; then
     291        echo
     292        echo 'Using bogus SSL code. This means some features have to be disabled.'
     293       
     294        ## Yes, you, at the console! How can you authenticate if you don't have any SSL!?
     295        if [ "$msn" = "1" ]; then
    216296                echo
    217                 echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
    218                 echo 'install of OpenSSL (including devel/header files) before reporting'
    219                 echo 'compilation problems.'
    220                 echo
    221                 echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
    222                 echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
    223                 echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
    224                 echo 'part of the operating system, which makes it GPL-compatible.'
    225                 echo
    226                 echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
    227                 echo '                    http://www.gnome.org/~markmc/openssl-and-the-gpl.html'
    228                 echo
    229                 echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
    230                 echo 'probably illegal. If you want to create and distribute a binary BitlBee'
    231                 echo 'package, you really should use GnuTLS or NSS instead.'
    232                 echo
    233                 echo 'Also, the OpenSSL license requires us to say this:'
    234                 echo ' *    "This product includes software developed by the OpenSSL Project'
    235                 echo ' *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"'
    236                
    237                 echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings
    238                
    239                 ret=1;
    240         elif [ "$ssl" = "bogus" ]; then
    241                 echo
    242                 echo 'Using bogus SSL code. This will not make the MSN module work, but it will'
    243                 echo 'allow you to use the Jabber module - although without working SSL support.'
    244                
    245                 ret=1;
    246         else
    247                 echo
    248                 echo 'ERROR: Unknown SSL library specified.'
    249                 exit 1;
    250         fi
    251        
    252         if [ "$ret" = "0" ]; then
    253                 echo
    254                 echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
    255                 echo '       This is necessary for MSN and full Jabber support. To continue,'
    256                 echo '       install a suitable SSL library or disable MSN support (--msn=0).'
    257                 echo '       If you want Jabber without SSL support you can try --ssl=bogus.'
    258                
    259                 exit 1;
    260         fi;
    261        
    262         echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
    263 fi
     297                echo 'Real SSL support is necessary for MSN authentication, will build without'
     298                echo 'MSN protocol support.'
     299                msn=0
     300        fi
     301       
     302        ret=1
     303else
     304        echo
     305        echo 'ERROR: Unknown SSL library specified.'
     306        exit 1
     307fi
     308
     309if [ "$ret" = "0" ]; then
     310        echo
     311        echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
     312        echo '       Please note that this script doesn'\''t have detection code for OpenSSL,'
     313        echo '       so if you want to use that, you have to select it by hand. If you don'\''t'
     314        echo '       need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)'
     315       
     316        exit 1
     317fi;
     318
     319echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
     320
     321STORAGES="text xml"
     322
     323if [ "$ldap" = "auto" ]; then
     324        detect_ldap
     325fi
     326
     327if [ "$ldap" = 0 ]; then
     328        echo "#undef WITH_LDAP" >> config.h
     329elif [ "$ldap" = 1 ]; then
     330        echo "#define WITH_LDAP 1" >> config.h
     331        STORAGES="$STORAGES ldap"
     332fi
     333
     334for i in $STORAGES; do
     335        STORAGE_OBJS="$STORAGE_OBJS storage_$i.o"
     336done
     337echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings
    264338
    265339if [ "$strip" = 0 ]; then
     
    275349        elif type strip > /dev/null 2> /dev/null; then
    276350                echo "STRIP=strip" >> Makefile.settings;
    277         elif /bin/test -x /usr/ccs/bin/strip; then
    278                 echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
    279351        else
    280352                echo
     
    355427if [ "$protocols" = "PROTOCOLS = " ]; then
    356428        echo "WARNING: You haven't selected any communication protocol to compile!"
    357         echo "         Bitlbee will run, but you will be unable to connect to IM servers!"
     429        echo "         BitlBee will run, but you will be unable to connect to IM servers!"
    358430fi
    359431
     
    390462
    391463if [ "$debug" = "1" ]; then
    392         echo '  Debugging enabled.';
    393 else
    394         echo '  Debugging disabled.';
     464        echo '  Debugging enabled.'
     465else
     466        echo '  Debugging disabled.'
    395467fi
    396468
    397469if [ "$strip" = "1" ]; then
    398         echo '  Binary stripping enabled.';
    399 else
    400         echo '  Binary stripping disabled.';
    401 fi
    402 
    403 if [ "$msn" = "1" ]; then
    404         echo '  Using SSL library: '$ssl;
    405 fi
    406 
    407 #if [ "$flood" = "0" ]; then
    408 #       echo '  Flood protection disabled.';
    409 #else
    410 #       echo '  Flood protection enabled.';
    411 #fi
     470        echo '  Binary stripping enabled.'
     471else
     472        echo '  Binary stripping disabled.'
     473fi
     474
     475echo '  Using event handler: '$events
     476echo '  Using SSL library: '$ssl
     477echo '  Building with these storage backends: '$STORAGES
    412478
    413479if [ -n "$protocols" ]; then
    414         echo '  Building with these protocols:' $protocols;
    415 else
    416         echo '  Building without IM-protocol support. We wish you a lot of fun...';
    417 fi
     480        echo '  Building with these protocols:' $protocols
     481else
     482        echo '  Building without IM-protocol support. We wish you a lot of fun...'
     483fi
Note: See TracChangeset for help on using the changeset viewer.