diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 105 |
1 files changed, 100 insertions, 5 deletions
@@ -340,16 +340,52 @@ RESOLV_TESTCODE=' int main() { + + res_query( NULL, 0, 0, NULL, 0); + dn_expand( NULL, NULL, NULL, NULL, 0); + dn_skipname( NULL, NULL); +} +' +RESOLV_NS_TESTCODE=' +#include <sys/types.h> +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <resolv.h> + +int main() +{ ns_initparse( NULL, 0, NULL ); ns_parserr( NULL, ns_s_an, 0, NULL ); } ' +RESOLV_NS_TYPES_TESTCODE=' +#include <sys/types.h> +#include <netinet/in.h> +#include <arpa/nameser.h> + +int main() +{ + ns_msg nsh; + ns_rr rr; + + /* Not all platforms we want to work on have + ns_* routines, so use this to make sure + the compiler uses it.*/ + return (int)(sizeof(nsh) + sizeof(rr)); +} +' detect_resolv_dynamic() { case "$arch" in + OpenBSD ) + # In FreeBSD res_*/dn_* routines are present in libc.so + LIBRESOLV=;; FreeBSD ) - # In FreeBSD res_* routines are present in libc.so + # In FreeBSD res_*/dn_* routines are present in libc.so + LIBRESOLV=;; + CYGWIN* ) + # In Cygwin res_*/dn_* routines are present in libc.so LIBRESOLV=;; * ) LIBRESOLV=-lresolv;; @@ -384,6 +420,58 @@ detect_resolv_static() return $ret } +detect_resolv_ns_dynamic() +{ + case "$arch" in + FreeBSD ) + # In FreeBSD ns_ routines are present in libc.so + LIBRESOLV=;; + * ) + LIBRESOLV=-lresolv;; + esac + TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) + ret=1 + echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null + if [ "$?" = "0" ]; then + ret=0 + fi + + rm -f $TMPFILE + return $ret +} + +detect_resolv_ns_static() +{ + TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) + ret=1 + for i in $systemlibdirs; do + if [ -f $i/libresolv.a ]; then + echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null + if [ "$?" = "0" ]; then + ret=0 + fi + fi + done + + rm -f $TMPFILE + return $ret +} + +detect_nameser_has_ns_types() +{ + TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) + ret=1 + # since we aren't actually linking with ns_* routines + # we can just compile the test code + echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o $TMPFILE -x c - >/dev/null 2>/dev/null + if [ "$?" = "0" ]; then + ret=0 + fi + + rm -f $TMPFILE + return $ret +} + if [ "$ssl" = "auto" ]; then detect_gnutls if [ "$ret" = "0" ]; then @@ -395,8 +483,6 @@ 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' @@ -439,10 +525,19 @@ fi; echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings +if detect_nameser_has_ns_types; then + echo '#define NAMESER_HAS_NS_TYPES' >> config.h +fi if detect_resolv_dynamic || detect_resolv_static; then echo '#define HAVE_RESOLV_A' >> config.h + if detect_resolv_ns_dynamic || detect_resolv_ns_static; then + echo '#define HAVE_RESOLV_A_WITH_NS' >> config.h + fi +else + echo 'Insufficient resolv routines. Jabber server must be set explicitly' fi + STORAGES="xml" for i in $STORAGES; do @@ -510,7 +605,7 @@ fi if [ "$otr" = 1 ]; then # BI == built-in echo '#define OTR_BI' >> config.h - echo "EFLAGS+=-L${otrprefix}/lib -lotr" >> Makefile.settings + echo "EFLAGS+=-L${otrprefix}/lib -lotr -lgcrypt" >> Makefile.settings echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings echo 'OTR_BI=otr.o' >> Makefile.settings elif [ "$otr" = "plugin" ]; then @@ -708,9 +803,9 @@ AIX ) echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings ;; CYGWIN* ) - echo 'Cygwin is not officially supported.' ;; Windows ) + echo 'Native windows compilation is not supported anymore, use cygwin instead.' ;; * ) echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' |