Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    rb3c467b r574af7e  
    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'
    2017ipcsocket='/var/run/bitlbee'
     18plugindir='$prefix/lib/bitlbee'
    2119pcdir='$prefix/lib/pkgconfig'
     20includedir='$prefix/include/bitlbee'
    2221
    2322msn=1
     
    2928strip=1
    3029ipv6=1
    31 
    32 events=glib
    33 ldap=auto
    3430ssl=auto
    3531
     
    6864--ipv6=0/1      IPv6 socket support                     $ipv6
    6965
    70 --ldap=0/1/auto LDAP support                            $ldap
    71 
    72 --events=...    Event handler (glib, libevent)          $events
    7366--ssl=...       SSL library to use (gnutls, nss, openssl, bogus, auto)
    7467                                                        $ssl
     
    8780config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
    8881plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
    89 includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'`
    90 libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'`
    91 
    9282pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
    9383ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
     84includedir=`eval echo "$includedir" | sed 's/\/\{1,\}/\//g'`
    9485pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
    9586
     
    144135fi
    145136
    146 echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings
     137echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings
    147138
    148139echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
    149140
    150141if [ -n "$CC" ]; then
    151         CC=$CC
     142        echo "CC=$CC" >> Makefile.settings;
    152143elif type gcc > /dev/null 2> /dev/null; then
    153         CC=gcc
     144        echo "CC=gcc" >> Makefile.settings;
    154145elif type cc > /dev/null 2> /dev/null; then
    155         CC=cc
     146        echo "CC=cc" >> Makefile.settings;
    156147else
    157148        echo 'Cannot find a C compiler, aborting.'
    158149        exit 1;
    159150fi
    160 
    161 echo "CC=$CC" >> Makefile.settings;
    162151
    163152if [ -n "$LD" ]; then
     
    183172        exit 1;
    184173fi
    185 
    186 if [ "$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
    196 EFLAGS+=-levent -L${libevent}lib
    197 CFLAGS+=-I${libevent}include
    198 EOF
    199 elif [ "$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
    202 else
    203         echo
    204         echo 'ERROR: Unknown event handler specified.'
    205         exit 1
    206 fi
    207 echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
    208174
    209175detect_gnutls()
     
    237203}
    238204
    239 detect_ldap()
    240 {
    241         TMPFILE=`mktemp`
    242         if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
    243                 cat<<EOF>>Makefile.settings
    244 EFLAGS+=-lldap
    245 CFLAGS+=
    246 EOF
    247                 ldap=1
    248                 rm -f $TMPFILE
    249                 ret=1
     205if [ "$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
     216                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;
    250246        else
    251                 ldap=0
    252                 ret=0
    253         fi
    254 }
    255 
    256 if [ "$ssl" = "auto" ]; then
    257         detect_gnutls
    258         if [ "$ret" = "0" ]; then
    259                 detect_nss
    260         fi
    261 elif [ "$ssl" = "gnutls" ]; then
    262         detect_gnutls
    263 elif [ "$ssl" = "nss" ]; then
    264         detect_nss
    265 elif [ "$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
    290 elif [ "$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
    296                 echo
    297                 echo 'Real SSL support is necessary for MSN authentication, will build without'
    298                 echo 'MSN protocol support.'
    299                 msn=0
     247                echo
     248                echo 'ERROR: Unknown SSL library specified.'
     249                exit 1;
    300250        fi
    301251       
    302         ret=1
    303 else
    304         echo
    305         echo 'ERROR: Unknown SSL library specified.'
    306         exit 1
    307 fi
    308 
    309 if [ "$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)'
     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;
    315261       
    316         exit 1
    317 fi;
    318 
    319 echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
    320 
    321 STORAGES="text xml"
    322 
    323 if [ "$ldap" = "auto" ]; then
    324         detect_ldap
    325 fi
    326 
    327 if [ "$ldap" = 0 ]; then
    328         echo "#undef WITH_LDAP" >> config.h
    329 elif [ "$ldap" = 1 ]; then
    330         echo "#define WITH_LDAP 1" >> config.h
    331         STORAGES="$STORAGES ldap"
    332 fi
    333 
    334 for i in $STORAGES; do
    335         STORAGE_OBJS="$STORAGE_OBJS storage_$i.o"
    336 done
    337 echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings
     262        echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
     263fi
    338264
    339265if [ "$strip" = 0 ]; then
     
    349275        elif type strip > /dev/null 2> /dev/null; then
    350276                echo "STRIP=strip" >> Makefile.settings;
     277        elif /bin/test -x /usr/ccs/bin/strip; then
     278                echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
    351279        else
    352280                echo
     
    427355if [ "$protocols" = "PROTOCOLS = " ]; then
    428356        echo "WARNING: You haven't selected any communication protocol to compile!"
    429         echo "         BitlBee will run, but you will be unable to connect to IM servers!"
     357        echo "         Bitlbee will run, but you will be unable to connect to IM servers!"
    430358fi
    431359
     
    462390
    463391if [ "$debug" = "1" ]; then
    464         echo '  Debugging enabled.'
    465 else
    466         echo '  Debugging disabled.'
     392        echo '  Debugging enabled.';
     393else
     394        echo '  Debugging disabled.';
    467395fi
    468396
    469397if [ "$strip" = "1" ]; then
    470         echo '  Binary stripping enabled.'
    471 else
    472         echo '  Binary stripping disabled.'
    473 fi
    474 
    475 echo '  Using event handler: '$events
    476 echo '  Using SSL library: '$ssl
    477 echo '  Building with these storage backends: '$STORAGES
     398        echo '  Binary stripping enabled.';
     399else
     400        echo '  Binary stripping disabled.';
     401fi
     402
     403if [ "$msn" = "1" ]; then
     404        echo '  Using SSL library: '$ssl;
     405fi
     406
     407#if [ "$flood" = "0" ]; then
     408#       echo '  Flood protection disabled.';
     409#else
     410#       echo '  Flood protection enabled.';
     411#fi
    478412
    479413if [ -n "$protocols" ]; then
    480         echo '  Building with these protocols:' $protocols
    481 else
    482         echo '  Building without IM-protocol support. We wish you a lot of fun...'
    483 fi
     414        echo '  Building with these protocols:' $protocols;
     415else
     416        echo '  Building without IM-protocol support. We wish you a lot of fun...';
     417fi
Note: See TracChangeset for help on using the changeset viewer.