diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 56 |
1 files changed, 44 insertions, 12 deletions
@@ -19,6 +19,7 @@ libevent='/usr/' pidfile='/var/run/bitlbee.pid' ipcsocket='/var/run/bitlbee.sock' pcdir='$prefix/lib/pkgconfig' +systemlibdirs="/lib /usr/lib /usr/local/lib" msn=1 jabber=1 @@ -73,6 +74,8 @@ Option Description Default --events=... Event handler (glib, libevent) $events --ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto) $ssl + +--target=... Cross compilation target same as host EOF exit; fi @@ -106,9 +109,9 @@ CONFIG=$config INCLUDEDIR=$includedir PCDIR=$pcdir +TARGET=$target ARCH=$arch CPU=$cpu -OUTFILE=bitlbee DESTDIR= LFLAGS= @@ -131,6 +134,18 @@ cat<<EOF>config.h #define CPU "$cpu" EOF + + +if [ -n "$target" ]; then + PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig + export PKG_CONFIG_LIBDIR + PATH=/usr/$target/bin:$PATH + CC=$target-cc + LD=$target-ld + systemlibdirs="/usr/$target/lib" +fi + + if [ "$debug" = "1" ]; then [ -z "$CFLAGS" ] && CFLAGS=-g echo 'DEBUG=1' >> Makefile.settings @@ -157,15 +172,17 @@ fi echo "CC=$CC" >> Makefile.settings; -if [ -n "$LD" ]; then - echo "LD=$LD" >> Makefile.settings; -elif type ld > /dev/null 2> /dev/null; then - echo "LD=ld" >> Makefile.settings; -else - echo 'Cannot find ld, aborting.' - exit 1; +if [ -z "$LD" ]; then + if type ld > /dev/null 2> /dev/null; then + LD=ld + else + echo 'Cannot find ld, aborting.' + exit 1; + fi fi +echo "LD=$LD" >> Makefile.settings + if [ -z "$PKG_CONFIG" ]; then PKG_CONFIG=pkg-config fi @@ -212,7 +229,14 @@ echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings detect_gnutls() { - if libgnutls-config --version > /dev/null 2> /dev/null; then + if $PKG_CONFIG --exists gnutls; then + cat <<EOF>>Makefile.settings +EFLAGS+=`$PKG_CONFIG --libs gnutls` +CFLAGS+=`$PKG_CONFIG --cflags gnutls` +EOF + ssl=gnutls + ret=1 + elif libgnutls-config --version > /dev/null 2> /dev/null; then cat <<EOF>>Makefile.settings EFLAGS+=`libgnutls-config --libs` CFLAGS+=`libgnutls-config --cflags` @@ -266,6 +290,8 @@ elif [ "$ssl" = "gnutls" ]; then detect_gnutls elif [ "$ssl" = "nss" ]; then detect_nss +elif [ "$ssl" = "sspi" ]; then + echo elif [ "$ssl" = "openssl" ]; then echo echo 'No detection code exists for OpenSSL. Make sure that you have a complete' @@ -322,7 +348,7 @@ fi; echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings -for i in /lib /usr/lib /usr/local/lib; do +for i in $systemlibdirs; do if [ -f $i/libresolv.a ]; then echo '#define HAVE_RESOLV_A' >> config.h echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings @@ -374,8 +400,8 @@ else fi if [ "$gcov" = "1" ]; then - echo "CFLAGS+=-ftest-coverage -fprofile-arcs" >> Makefile.settings - echo "EFLAGS+=-lgcov" >> Makefile.settings + echo "CFLAGS+=--coverage" >> Makefile.settings + echo "EFLAGS+=--coverage" >> Makefile.settings fi if [ "$plugins" = 0 ]; then @@ -482,12 +508,18 @@ AIX ) CYGWIN* ) echo 'Cygwin is not officially supported.' ;; +Windows ) +;; * ) echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' echo 'Please report any problems at http://bugs.bitlbee.org/.' ;; esac +if [ -n "$target" ]; then + echo "Cross-compiling for: $target" +fi + echo echo 'Configuration done:' |