Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r66b9e86e r670204f  
    2828debug=0
    2929strip=1
    30 gcov=0
    3130ipv6=1
    3231
    3332events=glib
     33ldap=0
    3434ssl=auto
    3535
    3636arch=`uname -s`
    3737cpu=`uname -m`
     38
     39GLIB_MIN_VERSION=2.4
    3840
    3941echo BitlBee configure
     
    6567--debug=0/1     Disable/enable debugging                $debug
    6668--strip=0/1     Disable/enable binary stripping         $strip
    67 --gcov=0/1      Disable/enable test coverage reporting  $gcov
    6869
    6970--ipv6=0/1      IPv6 socket support                     $ipv6
     71
     72--ldap=0/1/auto LDAP support                            $ldap
    7073
    7174--events=...    Event handler (glib, libevent)          $events
     
    143146fi
    144147
    145 echo CFLAGS+=-I`pwd` -I`pwd`/protocols -I. >> Makefile.settings
     148echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings
    146149
    147150echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings
    148151
    149152if [ -n "$CC" ]; then
    150         echo "CC=$CC" >> Makefile.settings;
     153        CC=$CC
    151154elif type gcc > /dev/null 2> /dev/null; then
    152         echo "CC=gcc" >> Makefile.settings;
     155        CC=gcc
    153156elif type cc > /dev/null 2> /dev/null; then
    154         echo "CC=cc" >> Makefile.settings;
     157        CC=cc
    155158else
    156159        echo 'Cannot find a C compiler, aborting.'
    157160        exit 1;
    158161fi
     162
     163echo "CC=$CC" >> Makefile.settings;
    159164
    160165if [ -n "$LD" ]; then
     
    172177
    173178if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then
    174         cat<<EOF>>Makefile.settings
     179        if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then
     180                cat<<EOF>>Makefile.settings
    175181EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0`
    176182CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
    177183EOF
    178 else
     184        else
     185                echo
     186                echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.'
     187                exit 1
     188        fi
     189else
     190        echo
    179191        echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)'
    180         exit 1;
     192        exit 1
    181193fi
    182194
     
    234246}
    235247
    236 if [ "$msn" = 1 -o "$jabber" = 1 ]; then
    237         if [ "$ssl" = "auto" ]; then
    238                 detect_gnutls
    239                 if [ "$ret" = "0" ]; then
    240                         detect_nss
    241                 fi;
    242         elif [ "$ssl" = "gnutls" ]; then
    243                 detect_gnutls;
    244         elif [ "$ssl" = "nss" ]; then
    245                 detect_nss;
    246         elif [ "$ssl" = "openssl" ]; then
     248detect_ldap()
     249{
     250        TMPFILE=`mktemp`
     251        if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
     252                cat<<EOF>>Makefile.settings
     253EFLAGS+=-lldap
     254CFLAGS+=
     255EOF
     256                ldap=1
     257                rm -f $TMPFILE
     258                ret=1
     259        else
     260                ldap=0
     261                ret=0
     262        fi
     263}
     264
     265if [ "$ssl" = "auto" ]; then
     266        detect_gnutls
     267        if [ "$ret" = "0" ]; then
     268                detect_nss
     269        fi
     270elif [ "$ssl" = "gnutls" ]; then
     271        detect_gnutls
     272elif [ "$ssl" = "nss" ]; then
     273        detect_nss
     274elif [ "$ssl" = "openssl" ]; then
     275        echo
     276        echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
     277        echo 'install of OpenSSL (including devel/header files) before reporting'
     278        echo 'compilation problems.'
     279        echo
     280        echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
     281        echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
     282        echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
     283        echo 'part of the operating system, which makes it GPL-compatible.'
     284        echo
     285        echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
     286        echo '                    http://www.gnome.org/~markmc/openssl-and-the-gpl.html'
     287        echo
     288        echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
     289        echo 'probably illegal. If you want to create and distribute a binary BitlBee'
     290        echo 'package, you really should use GnuTLS or NSS instead.'
     291        echo
     292        echo 'Also, the OpenSSL license requires us to say this:'
     293        echo ' *    "This product includes software developed by the OpenSSL Project'
     294        echo ' *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"'
     295       
     296        echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings
     297       
     298        ret=1
     299elif [ "$ssl" = "bogus" ]; then
     300        echo
     301        echo 'Using bogus SSL code. This means some features will not work properly.'
     302       
     303        ## Yes, you, at the console! How can you authenticate if you don't have any SSL!?
     304        if [ "$msn" = "1" ]; then
    247305                echo
    248                 echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
    249                 echo 'install of OpenSSL (including devel/header files) before reporting'
    250                 echo 'compilation problems.'
    251                 echo
    252                 echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
    253                 echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
    254                 echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
    255                 echo 'part of the operating system, which makes it GPL-compatible.'
    256                 echo
    257                 echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
    258                 echo '                    http://www.gnome.org/~markmc/openssl-and-the-gpl.html'
    259                 echo
    260                 echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
    261                 echo 'probably illegal. If you want to create and distribute a binary BitlBee'
    262                 echo 'package, you really should use GnuTLS or NSS instead.'
    263                 echo
    264                 echo 'Also, the OpenSSL license requires us to say this:'
    265                 echo ' *    "This product includes software developed by the OpenSSL Project'
    266                 echo ' *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"'
    267                
    268                 echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings
    269                
    270                 ret=1;
    271         elif [ "$ssl" = "bogus" ]; then
    272                 echo
    273                 echo 'Using bogus SSL code. This will not make the MSN module work, but it will'
    274                 echo 'allow you to use the Jabber module - although without working SSL support.'
    275                
    276                 ret=1;
    277         else
    278                 echo
    279                 echo 'ERROR: Unknown SSL library specified.'
    280                 exit 1;
    281         fi
    282        
    283         if [ "$ret" = "0" ]; then
    284                 echo
    285                 echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
    286                 echo '       This is necessary for MSN and full Jabber support. To continue,'
    287                 echo '       install a suitable SSL library or disable MSN support (--msn=0).'
    288                 echo '       If you want Jabber without SSL support you can try --ssl=bogus.'
    289                
    290                 exit 1;
    291         fi;
    292        
    293         echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
    294 fi
     306                echo 'Real SSL support is necessary for MSN authentication, will build without'
     307                echo 'MSN protocol support.'
     308                msn=0
     309        fi
     310       
     311        ret=1
     312else
     313        echo
     314        echo 'ERROR: Unknown SSL library specified.'
     315        exit 1
     316fi
     317
     318if [ "$ret" = "0" ]; then
     319        echo
     320        echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
     321        echo '       Please note that this script doesn'\''t have detection code for OpenSSL,'
     322        echo '       so if you want to use that, you have to select it by hand. If you don'\''t'
     323        echo '       need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)'
     324       
     325        exit 1
     326fi;
     327
     328echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
     329
     330STORAGES="text xml"
     331
     332if [ "$ldap" = "auto" ]; then
     333        detect_ldap
     334fi
     335
     336if [ "$ldap" = 0 ]; then
     337        echo "#undef WITH_LDAP" >> config.h
     338elif [ "$ldap" = 1 ]; then
     339        echo "#define WITH_LDAP 1" >> config.h
     340        STORAGES="$STORAGES ldap"
     341fi
     342
     343for i in $STORAGES; do
     344        STORAGE_OBJS="$STORAGE_OBJS storage_$i.o"
     345done
     346echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings
    295347
    296348if [ "$strip" = 0 ]; then
     
    306358        elif type strip > /dev/null 2> /dev/null; then
    307359                echo "STRIP=strip" >> Makefile.settings;
    308         elif /bin/test -x /usr/ccs/bin/strip; then
    309                 echo "STRIP=/usr/ccs/bin/strip" >> Makefile.settings;
    310360        else
    311361                echo
     
    314364                strip=0;
    315365        fi;
    316 fi
    317 
    318 if [ "$gcov" = "1" ]; then
    319         echo "CFLAGS+=-ftest-coverage -fprofile-arcs" >> Makefile.settings
    320         echo "EFLAGS+=-lgcov" >> Makefile.settings
    321366fi
    322367
     
    391436if [ "$protocols" = "PROTOCOLS = " ]; then
    392437        echo "WARNING: You haven't selected any communication protocol to compile!"
    393         echo "         Bitlbee will run, but you will be unable to connect to IM servers!"
     438        echo "         BitlBee will run, but you will be unable to connect to IM servers!"
    394439fi
    395440
     
    426471
    427472if [ "$debug" = "1" ]; then
    428         echo '  Debugging enabled.';
    429 else
    430         echo '  Debugging disabled.';
     473        echo '  Debugging enabled.'
     474else
     475        echo '  Debugging disabled.'
    431476fi
    432477
    433478if [ "$strip" = "1" ]; then
    434         echo '  Binary stripping enabled.';
    435 else
    436         echo '  Binary stripping disabled.';
    437 fi
    438 
    439 echo '  Using event handler: '$events;
    440 echo '  Using SSL library: '$ssl;
    441 
    442 #if [ "$flood" = "0" ]; then
    443 #       echo '  Flood protection disabled.';
    444 #else
    445 #       echo '  Flood protection enabled.';
    446 #fi
     479        echo '  Binary stripping enabled.'
     480else
     481        echo '  Binary stripping disabled.'
     482fi
     483
     484echo '  Using event handler: '$events
     485echo '  Using SSL library: '$ssl
     486echo '  Building with these storage backends: '$STORAGES
    447487
    448488if [ -n "$protocols" ]; then
    449         echo '  Building with these protocols:' $protocols;
    450 else
    451         echo '  Building without IM-protocol support. We wish you a lot of fun...';
    452 fi
     489        echo '  Building with these protocols:' $protocols
     490else
     491        echo '  Building without IM-protocol support. We wish you a lot of fun...'
     492fi
Note: See TracChangeset for help on using the changeset viewer.