Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    rd203495 re252d8c  
    341341int main()
    342342{
     343
     344        res_query( NULL, 0, 0, NULL, 0);
     345        dn_expand( NULL, NULL, NULL, NULL, 0);
     346        dn_skipname( NULL, NULL);
     347}
     348'
     349RESOLV_NS_TESTCODE='
     350#include <sys/types.h>
     351#include <netinet/in.h>
     352#include <arpa/nameser.h>
     353#include <resolv.h>
     354
     355int main()
     356{
    343357        ns_initparse( NULL, 0, NULL );
    344358        ns_parserr( NULL, ns_s_an, 0, NULL );
    345359}
    346360'
     361RESOLV_NS_TYPES_TESTCODE='
     362#include <sys/types.h>
     363#include <netinet/in.h>
     364#include <arpa/nameser.h>
     365
     366int main()
     367{
     368        ns_msg nsh;
     369        ns_rr rr;
     370
     371        /* Not all platforms we want to work on have
     372         ns_* routines, so use this to make sure
     373         the compiler uses it.*/
     374        return (int)(sizeof(nsh) + sizeof(rr));
     375}
     376'
    347377
    348378detect_resolv_dynamic()
    349379{
    350380        case "$arch" in
     381        OpenBSD )
     382                # In FreeBSD res_*/dn_* routines are present in libc.so
     383                LIBRESOLV=;;
    351384        FreeBSD )
    352                 # In FreeBSD res_* routines are present in libc.so
     385                # In FreeBSD res_*/dn_* routines are present in libc.so
     386                LIBRESOLV=;;
     387        CYGWIN* )
     388                # In Cygwin res_*/dn_* routines are present in libc.so
    353389                LIBRESOLV=;;
    354390        * )
     
    385421}
    386422
     423detect_resolv_ns_dynamic()
     424{
     425        case "$arch" in
     426        FreeBSD )
     427                # In FreeBSD ns_ routines are present in libc.so
     428                LIBRESOLV=;;
     429        * )
     430                LIBRESOLV=-lresolv;;
     431        esac
     432        TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
     433        ret=1
     434        echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null
     435        if [ "$?" = "0" ]; then
     436                ret=0
     437        fi
     438
     439        rm -f $TMPFILE
     440        return $ret
     441}
     442
     443detect_resolv_ns_static()
     444{
     445        TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
     446        ret=1
     447        for i in $systemlibdirs; do
     448                if [ -f $i/libresolv.a ]; then
     449                        echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null
     450                        if [ "$?" = "0" ]; then
     451                                ret=0
     452                        fi
     453                fi
     454        done
     455
     456        rm -f $TMPFILE
     457        return $ret
     458}
     459
     460detect_nameser_has_ns_types()
     461{
     462    TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX)
     463    ret=1
     464    # since we aren't actually linking with ns_* routines
     465    # we can just compile the test code
     466    echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o $TMPFILE -x c -  >/dev/null 2>/dev/null
     467    if [ "$?" = "0" ]; then
     468        ret=0
     469    fi
     470
     471    rm -f $TMPFILE
     472    return $ret
     473}
     474
    387475if [ "$ssl" = "auto" ]; then
    388476        detect_gnutls
     
    396484elif [ "$ssl" = "nss" ]; then
    397485        detect_nss
    398 elif [ "$ssl" = "sspi" ]; then
    399         echo
    400486elif [ "$ssl" = "openssl" ]; then
    401487        echo
     
    440526echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
    441527
     528if detect_nameser_has_ns_types; then
     529        echo '#define NAMESER_HAS_NS_TYPES' >> config.h
     530fi
    442531if detect_resolv_dynamic || detect_resolv_static; then
    443532        echo '#define HAVE_RESOLV_A' >> config.h
    444 fi
     533    if detect_resolv_ns_dynamic || detect_resolv_ns_static; then
     534            echo '#define HAVE_RESOLV_A_WITH_NS' >> config.h
     535    fi
     536else
     537    echo 'Insufficient resolv routines. Jabber server must be set explicitly'
     538fi
     539
    445540
    446541STORAGES="xml"
     
    511606        # BI == built-in
    512607        echo '#define OTR_BI' >> config.h
    513         echo "EFLAGS+=-L${otrprefix}/lib -lotr" >> Makefile.settings
     608        echo "EFLAGS+=-L${otrprefix}/lib -lotr -lgcrypt" >> Makefile.settings
    514609        echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
    515610        echo 'OTR_BI=otr.o' >> Makefile.settings
     
    709804;;
    710805CYGWIN* )
    711         echo 'Cygwin is not officially supported.'
    712806;;
    713807Windows )
     808        echo 'Native windows compilation is not supported anymore, use cygwin instead.'
    714809;;
    715810* )
Note: See TracChangeset for help on using the changeset viewer.