tests: fix broken linkage with --disable-static

This commit is contained in:
Kamil Dudka 2015-10-26 20:30:13 +01:00
parent 01c4916aa6
commit 4825009e42
2 changed files with 12 additions and 1 deletions

View File

@ -695,6 +695,9 @@ if test "x$threads" != "xyes" ||
AC_DEFINE([NOTHREADS], [1], [Define to 1 if you want to disable threads.]) AC_DEFINE([NOTHREADS], [1], [Define to 1 if you want to disable threads.])
fi fi
# propagate $enable_static to tests/Makefile.am
AM_CONDITIONAL([ENABLE_STATIC], [test "x$enable_static" = "xyes"])
AC_SUBST([TESTLDADD]) AC_SUBST([TESTLDADD])
AC_SUBST([APPLDFLAGS]) AC_SUBST([APPLDFLAGS])

View File

@ -49,7 +49,15 @@ HFILES = nghttp2_pq_test.h nghttp2_map_test.h nghttp2_queue_test.h \
main_SOURCES = $(HFILES) $(OBJECTS) main_SOURCES = $(HFILES) $(OBJECTS)
main_LDADD = ${top_builddir}/lib/libnghttp2.la @CUNIT_LIBS@ @TESTLDADD@ if ENABLE_STATIC
main_LDADD = ${top_builddir}/lib/libnghttp2.la
else
# With static lib disabled and symbol hiding enabled, we have to link object
# files directly because the tests use symbols not included in public API.
main_LDADD = ${top_builddir}/lib/.libs/*.o
endif
main_LDADD += @CUNIT_LIBS@ @TESTLDADD@
main_LDFLAGS = -static main_LDFLAGS = -static
if ENABLE_FAILMALLOC if ENABLE_FAILMALLOC