Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r0153ba9 rb2b7f52  
    3939
    4040events=glib
     41ldap=0
    4142ssl=auto
     43
     44pie=1
    4245
    4346arch=`uname -s`
     
    7982--debug=0/1     Disable/enable debugging                $debug
    8083--strip=0/1     Disable/enable binary stripping         $strip
     84--pie=0/1       Build position independent executable   $pie
    8185--gcov=0/1      Disable/enable test coverage reporting  $gcov
    8286--plugins=0/1   Disable/enable plugins support          $plugins
     
    8791
    8892--events=...    Event handler (glib, libevent)          $events
    89 --ssl=...       SSL library to use (gnutls, nss, openssl, bogus, auto)
     93--ssl=...       SSL library to use (gnutls, nss, openssl, auto)
    9094                                                        $ssl
     95
    9196
    9297--target=...    Cross compilation target                same as host
     
    199204fi
    200205
     206if [ "$pie" = "1" ]; then
     207        echo 'CFLAGS_BITLBEE=-fPIE' >> Makefile.settings
     208        echo 'LDFLAGS_BITLBEE=-pie' >> Makefile.settings
     209fi
     210
    201211echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings
    202212echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings
     
    315325                ret=0;
    316326        fi;
     327}
     328
     329detect_ldap()
     330{
     331        TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
     332        if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then
     333                cat<<EOF>>Makefile.settings
     334EFLAGS+=-lldap
     335CFLAGS+=
     336EOF
     337                ldap=1
     338                rm -f $TMPFILE
     339                ret=1
     340        else
     341                ldap=0
     342                ret=0
     343        fi
    317344}
    318345
     
    385412        echo
    386413        echo 'No detection code exists for OpenSSL. Make sure that you have a complete'
    387         echo 'install of OpenSSL (including devel/header files) before reporting'
     414        echo 'installation of OpenSSL (including devel/header files) before reporting'
    388415        echo 'compilation problems.'
    389416        echo
    390417        echo 'Also, keep in mind that the OpenSSL is, according to some people, not'
    391         echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better'
    392         echo 'supported by us. However, on many BSD machines, OpenSSL can be considered'
    393         echo 'part of the operating system, which makes it GPL-compatible.'
     418        echo 'completely GPL-compatible. Using GnuTLS is recommended and better supported'
     419        echo 'by us. However, on many BSD machines, OpenSSL can be considered part of the'
     420        echo 'operating system, which makes it GPL-compatible.'
    394421        echo
    395422        echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2'
     
    398425        echo 'Please note that distributing a BitlBee binary which links to OpenSSL is'
    399426        echo 'probably illegal. If you want to create and distribute a binary BitlBee'
    400         echo 'package, you really should use GnuTLS or NSS instead.'
     427        echo 'package, you really should use GnuTLS instead.'
    401428        echo
    402429        echo 'Also, the OpenSSL license requires us to say this:'
     
    407434       
    408435        ret=1
    409 elif [ "$ssl" = "bogus" ]; then
    410         echo
    411         echo 'Using bogus SSL code. This means some features will not work properly.'
    412        
    413         ## Yes, you, at the console! How can you authenticate if you don't have any SSL!?
    414         if [ "$msn" = "1" -o "$yahoo" = "1" ]; then
    415                 echo
    416                 echo 'WARNING: The MSN and Yahoo! modules will not work without SSL. Disabling.'
    417                 msn=0
    418                 yahoo=0
    419         fi
    420        
    421         ret=1
    422436else
    423437        echo
     
    430444        echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).'
    431445        echo '       Please note that this script doesn'\''t have detection code for OpenSSL,'
    432         echo '       so if you want to use that, you have to select it by hand. If you don'\''t'
    433         echo '       need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)'
     446        echo '       so if you want to use that, you have to select it by hand.'
    434447       
    435448        exit 1
    436449fi;
    437450
    438 if [ "$msn" = "1" -a "$ssl" != "openssl" -a "$ssl" != "gnutls" ]; then
    439         # Needed for MSN only. OpenSSL exports nice cipher functions already,
    440         # in case of GnuTLS we should be able to use gcrypt. Otherwise, use
    441         # built-in stuff. (Since right now those are the only two supported
    442         # SSL modules anyway, this is mostly unnecessary.)
    443         echo 'DES=des.o' >> Makefile.settings
    444 fi
    445 
    446451echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
    447452
     
    451456
    452457STORAGES="xml"
     458
     459if [ "$ldap" = "auto" ]; then
     460        detect_ldap
     461fi
     462
     463if [ "$ldap" = 0 ]; then
     464        echo "#undef WITH_LDAP" >> config.h
     465elif [ "$ldap" = 1 ]; then
     466        echo
     467        echo 'LDAP support is a work in progress and does NOT work AT ALL right now.'
     468        echo
     469        exit 1
     470       
     471        echo "#define WITH_LDAP 1" >> config.h
     472        STORAGES="$STORAGES ldap"
     473fi
    453474
    454475for i in $STORAGES; do
     
    527548
    528549if [ "$skype" = "1" -o "$skype" = "plugin" ]; then
     550        if [ "$arch" = "Darwin" ]; then
     551                echo "SKYPEFLAGS=-dynamiclib -undefined dynamic_lookup" >> Makefile.settings
     552        else
     553                echo "SKYPEFLAGS=-fPIC -shared" >> Makefile.settings
     554        fi
    529555        echo 'SKYPE_PI=skype.so' >> Makefile.settings
    530556        protocols_mods="$protocol_mods skype(plugin)"
     
    624650*gcc* )
    625651        echo CFLAGS+=-MMD -MF .depend/\$@.d >> Makefile.settings
    626         for i in . lib protocols protocols/*/; do
     652        for i in . lib tests protocols protocols/*/; do
    627653                mkdir -p $i/.depend
    628654        done
     
    720746else
    721747        echo '  Debugging disabled.'
     748fi
     749
     750if [ "$pie" = "1" ]; then
     751        echo '  Building PIE executable'
     752else
     753        echo '  Building non-PIE executable'
    722754fi
    723755
Note: See TracChangeset for help on using the changeset viewer.