SHA256
1
0
forked from pool/nghttp2
nghttp2/nghttp2-1.4.0-fix-tests.patch

32 lines
934 B
Diff
Raw Normal View History

--- a/configure.ac
+++ b/configure.ac
@@ -695,6 +695,9 @@ if test "x$threads" != "xyes" ||
AC_DEFINE([NOTHREADS], [1], [Define to 1 if you want to disable threads.])
fi
+# propagate $enable_static to tests/Makefile.am
+AM_CONDITIONAL([ENABLE_STATIC], [test "x$enable_static" = "xyes"])
+
AC_SUBST([TESTLDADD])
AC_SUBST([APPLDFLAGS])
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -49,7 +49,15 @@ HFILES = nghttp2_pq_test.h nghttp2_map_t
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
if ENABLE_FAILMALLOC