Applied parallel make and asyncns patches from the mailing list.
authorKirk Haines <khaines@engineyard.com>
Wed, 15 Apr 2009 10:50:05 -0600
changeset 597 1609c73adacc
parent 590 bcbd229a80cb
child 598 fcb6e3dfa892
Applied parallel make and asyncns patches from the mailing list.
configure.ac
loudmouth/Makefile.am
--- a/configure.ac	Tue Feb 24 17:09:42 2009 -0800
+++ b/configure.ac	Wed Apr 15 10:50:05 2009 -0600
@@ -225,19 +225,31 @@
 dnl +-------------------------------------------------------------------+
 dnl | Checking for libasyncns                                           |
 dnl +-------------------------------------------------------------------+
-AC_ARG_WITH(asyncns, [  --with-asyncns=yes/no  define whether to use libasyncns, default=no],
-            ac_asyncns=$withval,
-            ac_asyncns=no
-            )
+AC_ARG_WITH(asyncns,
+	AS_HELP_STRING([--with-asyncns],
+		[define whether to use libasyncns, @<:@default=no@:>@ (internal/system/no)]),
+	ac_asyncns=$withval,
+	ac_asyncns=no)
 
 enable_asyncns=no
+have_asyncns_system=no
 if test x$ac_asyncns != xno; then
 	enable_asyncns=yes
 	AC_DEFINE(HAVE_ASYNCNS, 1, [Whether to use libasyncns])
+
+	if test x$ac_asyncns = xsystem; then
+		PKG_CHECK_MODULES(ASYNCNS, [libasyncns >= 0.3],
+			[have_asyncns_system=yes],
+			[have_asyncns_system=no])
+	fi
 else
 	echo "Not using asynchronous dns lookups"
 fi
 
+AC_SUBST(ASYNCNS_CFLAGS)
+AC_SUBST(ASYNCNS_LIBS)
+AM_CONDITIONAL(USE_SYSTEM_ASYNCNS, test x$have_asyncns_system = xyes)
+
 dnl +-------------------------------------------------------------------+
 dnl | Checking for Linux TCP/IP stack                                   |
 dnl +-------------------------------------------------------------------+
--- a/loudmouth/Makefile.am	Tue Feb 24 17:09:42 2009 -0800
+++ b/loudmouth/Makefile.am	Wed Apr 15 10:50:05 2009 -0600
@@ -10,6 +10,7 @@
 	-I$(top_srcdir)                     \
 	$(LOUDMOUTH_CFLAGS)                 \
 	$(LIBIDN_CFLAGS)                    \
+	$(ASYNCNS_CFLAGS)                   \
 	-DLM_COMPILATION                    \
 	-DRUNTIME_ENDIAN                    \
 	$(NULL)
@@ -18,7 +19,7 @@
 
 test_dns_SOURCES = test-dns.c
 
-test_dns_LDADD = $(LOUDMOUTH_LIBS) $(top_builddir)/loudmouth/libloudmouth-1.la
+test_dns_LDADD = $(LOUDMOUTHTEST_LIBS) libloudmouth-1.la
 
 lib_LTLIBRARIES = libloudmouth-1.la
 
@@ -32,6 +33,13 @@
 	lm-ssl-openssl.c
 endif
 
+if ! USE_SYSTEM_ASYNCNS
+asyncns_sources = \
+	asyncns.c     \
+	asyncns.h
+endif
+
+
 libloudmouth_1_la_SOURCES =             \
 	lm-connection.c                     \
 	lm-debug.c                          \
@@ -55,8 +63,7 @@
 	lm-parser.c                         \
 	lm-parser.h                         \
 										\
-	asyncns.c                           \
-	asyncns.h                           \
+	$(asyncns_sources)                  \
 	lm-resolver.c                       \
 	lm-resolver.h                       \
 	lm-asyncns-resolver.c               \
@@ -110,6 +117,7 @@
 libloudmouth_1_la_LIBADD =              \
 	$(LOUDMOUTH_LIBS)                   \
 	$(LIBIDN_LIBS)                      \
+	$(ASYNCNS_LIBS)                     \
 	-lresolv
 
 libloudmouth_1_la_LDFLAGS =                                 \