From c235800a1ab05f2ee7ce047396ae191309cae8da Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 27 Jan 2013 16:46:58 +0900 Subject: [PATCH] Link -ldl with tests only --- configure.ac | 8 ++++++++ tests/Makefile.am | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 664208bf..a844669e 100644 --- a/configure.ac +++ b/configure.ac @@ -69,9 +69,15 @@ AM_CONDITIONAL([HAVE_STDCXX_11], # Checks for libraries. +# Additional libraries required for tests. +TESTS_LIBS= + +LIBS_OLD=$LIBS # Search for dlsym function, which is used in tests. Linux needs -ldl, # but netbsd does not need it. AC_SEARCH_LIBS([dlsym], [dl]) +TESTS_LIBS=$LIBS $TESTS_LIBS +LIBS=$LIBS_OLD # zlib PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3]) @@ -235,6 +241,8 @@ if test "x$maintainer_mode" != "xno"; then CFLAGS="$CFLAGS -Wno-unused-parameter" fi +AC_SUBST([TESTS_LIBS]) + AC_CONFIG_FILES([ Makefile lib/Makefile diff --git a/tests/Makefile.am b/tests/Makefile.am index 21223d38..3544b811 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -41,7 +41,7 @@ HFILES = spdylay_pq_test.h spdylay_map_test.h spdylay_queue_test.h \ main_SOURCES = $(HFILES) $(OBJECTS) main_LDADD = ${top_builddir}/lib/libspdylay.la -main_LDFLAGS = -static @CUNIT_LIBS@ +main_LDFLAGS = -static @CUNIT_LIBS@ @TESTS_LIBS@ failmalloc_SOURCES = failmalloc.c failmalloc_test.c failmalloc_test.h \ malloc_wrapper.c malloc_wrapper.h \