From: Wouter Wijngaards Date: Wed, 5 Jul 2006 07:26:37 +0000 (+0000) Subject: Detects the libraries that a program using ldns must link with (i.e. X-Git-Tag: release-1.1.0~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eabb047ea49f04565468194031948ba459cebe8a;p=thirdparty%2Fldns.git Detects the libraries that a program using ldns must link with (i.e. -lsocket -lnsl on Solaris), for the linktest. linktest uses cflags and cppflags that have been set so carefully. --- diff --git a/Makefile.in b/Makefile.in index 2a2e0fc6..67c58018 100644 --- a/Makefile.in +++ b/Makefile.in @@ -23,6 +23,7 @@ CFLAGS = @CFLAGS@ -I. -I$(srcdir) LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ LIBOBJS = @LIBOBJS@ +PROG_LIBS = @PROG_LIBS@ DATE = $(shell date +%Y%m%d) LIBTOOL = $(libtool) --tag=CC @@ -77,7 +78,7 @@ LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -release $(VERSION) all: copy-headers lib linktest linktest: - gcc $(srcdir)/linktest.c -Iinclude -I$(srcdir) .libs/libldns.a $(LDFLAGS) -o linktest + gcc $(srcdir)/linktest.c $(CPPFLAGS) $(CFLAGS) .libs/libldns.a $(LDFLAGS) $(PROG_LIBS) -o linktest rm linktest lib: $(LIBDNS_OBJECTS) b64_pton$U.o b64_ntop$U.o diff --git a/configure.ac b/configure.ac index 1726bf5a..15eb9af9 100644 --- a/configure.ac +++ b/configure.ac @@ -78,6 +78,10 @@ fi AC_CHECK_PROG(doxygen, doxygen, doxygen) # Checks for libraries. +AC_CHECK_LIB(socket, socket, [PROG_LIBS="-lsocket $PROG_LIBS"], []) +AC_CHECK_LIB(nsl, inet_pton, [PROG_LIBS="-lnsl $PROG_LIBS"], []) +AC_SUBST(PROG_LIBS) + # Check for SSL, original taken from # http://www.gnu.org/software/ac-archive/htmldoc/check_ssl.html and # modified for NSD and