Also set the -R search path so that crypto lib is found in dynamic linking.
pcat config.h.in is in svn? Well, here is a newer one...
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
LIBOBJS = @LIBOBJS@
-PROG_LIBS = @PROG_LIBS@
+RUNTIME_PATH = @RUNTIME_PATH@
DATE = $(shell date +%Y%m%d)
LIBTOOL = $(libtool) --tag=CC
all: copy-headers lib linktest
linktest:
- gcc $(srcdir)/linktest.c $(CPPFLAGS) $(CFLAGS) .libs/libldns.a $(LDFLAGS) $(PROG_LIBS) -o linktest
+ gcc $(srcdir)/linktest.c $(CPPFLAGS) $(CFLAGS) -L.libs -lldns -o linktest
rm linktest
lib: $(LIBDNS_OBJECTS)
- $(LINK_LIB) -o libldns.la $(LIBDNS_LOBJECTS) -rpath $(libdir)/lib
+ $(LINK_LIB) -o libldns.la $(LIBDNS_LOBJECTS) -rpath $(libdir) $(RUNTIME_PATH)
if [ ! -d lib ] ; then ln -s .libs lib ; fi ;
copy-headers:
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
AC_MSG_RESULT(found in $ssldir)
HAVE_SSL=yes
LDFLAGS="$LDFLAGS -L$ssldir/lib -lcrypto";
+ RUNTIME_PATH="$RUNTIME_PATH -R$ssldir/lib"
AC_CHECK_LIB(crypto, HMAC_CTX_init,, [
AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required])
])
fi
AC_SUBST(HAVE_SSL)
+ AC_SUBST(RUNTIME_PATH)
fi
# Use libtool
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
+/* Define to 1 if you have the <ctype.h> header file. */
+#undef HAVE_CTYPE_H
+
/* Define to 1 if you have the `getdelim' function. */
#undef HAVE_GETDELIM
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
-/* Define to 1 if you have the <netinet/in.hctype.h> header file. */
-#undef HAVE_NETINET_IN_HCTYPE_H
+/* Define to 1 if you have the <netinet/in_systm.h> header file. */
+#undef HAVE_NETINET_IN_SYSTM_H
/* Define to 1 if you have the <netinet/ip.h> header file. */
#undef HAVE_NETINET_IP_H
/* Define to 1 if you have the <netinet/udp.h> header file. */
#undef HAVE_NETINET_UDP_H
+/* Define to 1 if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
+
/* Define to 1 if you have the <pcap.h> header file. */
#undef HAVE_PCAP_H
#include <pcap.h>
#endif
-#include <netinet/in_systm.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
#ifdef HAVE_NETINET_IF_ETHER_H
#include <netinet/if_ether.h>
#endif