Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r4d8fbe8 r6a72a57  
    2020ipcsocket='/var/run/bitlbee.sock'
    2121pcdir='$prefix/lib/pkgconfig'
     22systemlibdirs="/lib /usr/lib /usr/local/lib"
    2223
    2324msn=1
     
    3031gcov=0
    3132plugins=1
    32 otr=auto
    3333
    3434events=glib
     
    7171--gcov=0/1      Disable/enable test coverage reporting  $gcov
    7272--plugins=0/1   Disable/enable plugins support          $plugins
    73 --otr=0/1/auto  Disable/enable OTR encryption support   $otr
    7473
    7574--events=...    Event handler (glib, libevent)          $events
    7675--ssl=...       SSL library to use (gnutls, nss, openssl, bogus, auto)
    7776                                                        $ssl
     77
     78--target=...    Cross compilation target                same as host
    7879EOF
    7980                exit;
     
    109110PCDIR=$pcdir
    110111
     112TARGET=$target
    111113ARCH=$arch
    112114CPU=$cpu
    113 OUTFILE=bitlbee
    114115
    115116DESTDIR=
     
    134135EOF
    135136
     137
     138
     139if [ -n "$target" ]; then
     140        PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
     141        export PKG_CONFIG_LIBDIR
     142        PATH=/usr/$target/bin:$PATH
     143        CC=$target-cc
     144        LD=$target-ld
     145        systemlibdirs="/usr/$target/lib"
     146fi
     147
     148
    136149if [ "$debug" = "1" ]; then
    137150        [ -z "$CFLAGS" ] && CFLAGS=-g
     
    160173echo "CC=$CC" >> Makefile.settings;
    161174
    162 if [ -n "$LD" ]; then
    163         echo "LD=$LD" >> Makefile.settings;
    164 elif type ld > /dev/null 2> /dev/null; then
    165         echo "LD=ld" >> Makefile.settings;
    166 else
    167         echo 'Cannot find ld, aborting.'
    168         exit 1;
    169 fi
     175if [ -z "$LD" ]; then
     176        if type ld > /dev/null 2> /dev/null; then
     177                LD=ld
     178        else
     179                echo 'Cannot find ld, aborting.'
     180                exit 1;
     181        fi
     182fi
     183
     184echo "LD=$LD" >> Makefile.settings
    170185
    171186if [ -z "$PKG_CONFIG" ]; then
     
    215230detect_gnutls()
    216231{
    217         if libgnutls-config --version > /dev/null 2> /dev/null; then
     232        if $PKG_CONFIG --exists gnutls; then
     233                cat <<EOF>>Makefile.settings
     234EFLAGS+=`$PKG_CONFIG --libs gnutls`
     235CFLAGS+=`$PKG_CONFIG --cflags gnutls`
     236EOF
     237                ssl=gnutls
     238                ret=1
     239        elif libgnutls-config --version > /dev/null 2> /dev/null; then
    218240                cat <<EOF>>Makefile.settings
    219241EFLAGS+=`libgnutls-config --libs`
     
    269291elif [ "$ssl" = "nss" ]; then
    270292        detect_nss
     293elif [ "$ssl" = "sspi" ]; then
     294        echo
    271295elif [ "$ssl" = "openssl" ]; then
    272296        echo
     
    325349echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
    326350
    327 for i in /lib /usr/lib /usr/local/lib; do
     351for i in $systemlibdirs; do
    328352        if [ -f $i/libresolv.a ]; then
    329353                echo '#define HAVE_RESOLV_A' >> config.h
     
    377401
    378402if [ "$gcov" = "1" ]; then
    379         echo "CFLAGS+=-ftest-coverage -fprofile-arcs" >> Makefile.settings
    380         echo "EFLAGS+=-lgcov" >> Makefile.settings
     403        echo "CFLAGS+=--coverage" >> Makefile.settings
     404        echo "EFLAGS+=--coverage" >> Makefile.settings
    381405fi
    382406
     
    385409else
    386410        echo '#define WITH_PLUGINS' >> config.h
    387 fi
    388 
    389 if [ "$otr" = "auto" ]; then
    390         for i in /lib /usr/lib /usr/local/lib; do
    391                 if [ -f $i/libotr.a ]; then
    392                         otr=1
    393                         break
    394                 fi
    395         done
    396 fi
    397 if [ "$otr" = 0 ]; then
    398         echo '#undef WITH_OTR' >> config.h
    399 else
    400         echo '#define WITH_OTR' >> config.h
    401         echo "EFLAGS+=-lotr" >> Makefile.settings
    402411fi
    403412
     
    500509        echo 'Cygwin is not officially supported.'
    501510;;
     511Windows )
     512;;
    502513* )
    503514        echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.'
     
    506517esac
    507518
     519if [ -n "$target" ]; then
     520        echo "Cross-compiling for: $target"
     521fi
     522
    508523echo
    509524echo 'Configuration done:'
     
    519534else
    520535        echo '  Binary stripping disabled.'
    521 fi
    522 
    523 if [ "$otr" = "1" ]; then
    524         echo '  Off-the-Record (OTR) Messaging enabled.'
    525 else
    526         echo '  Off-the-Record (OTR) Messaging disabled.'
    527536fi
    528537
Note: See TracChangeset for help on using the changeset viewer.