Link -ldl with tests only

This commit is contained in:
Tatsuhiro Tsujikawa 2013-01-27 16:46:58 +09:00
parent 09154c61f6
commit c235800a1a
2 changed files with 9 additions and 1 deletions

View File

@ -69,9 +69,15 @@ AM_CONDITIONAL([HAVE_STDCXX_11],
# Checks for libraries. # 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, # Search for dlsym function, which is used in tests. Linux needs -ldl,
# but netbsd does not need it. # but netbsd does not need it.
AC_SEARCH_LIBS([dlsym], [dl]) AC_SEARCH_LIBS([dlsym], [dl])
TESTS_LIBS=$LIBS $TESTS_LIBS
LIBS=$LIBS_OLD
# zlib # zlib
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3]) PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3])
@ -235,6 +241,8 @@ if test "x$maintainer_mode" != "xno"; then
CFLAGS="$CFLAGS -Wno-unused-parameter" CFLAGS="$CFLAGS -Wno-unused-parameter"
fi fi
AC_SUBST([TESTS_LIBS])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
lib/Makefile lib/Makefile

View File

@ -41,7 +41,7 @@ HFILES = spdylay_pq_test.h spdylay_map_test.h spdylay_queue_test.h \
main_SOURCES = $(HFILES) $(OBJECTS) main_SOURCES = $(HFILES) $(OBJECTS)
main_LDADD = ${top_builddir}/lib/libspdylay.la 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 \ failmalloc_SOURCES = failmalloc.c failmalloc_test.c failmalloc_test.h \
malloc_wrapper.c malloc_wrapper.h \ malloc_wrapper.c malloc_wrapper.h \