From 8736f61fbd9510ad74cb7e3363a1a593aee3be8d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 5 Aug 2014 21:49:50 +0900 Subject: [PATCH] Detect static libjemalloc libjemalloc as static library requires -pthread flag to link. Without that, the check in configure.ac fails with unresolved symbols. --- configure.ac | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b7db783c..74b660bf 100644 --- a/configure.ac +++ b/configure.ac @@ -205,7 +205,8 @@ case "$host" in SRC_LIBS="$SRC_LIBS -lstdc++ -lsupc++" ;; *) - SRC_LIBS="$SRC_LIBS -pthread" + PTHREAD_LDFLAGS="-pthread" + SRC_LIBS="$SRC_LIBS $PTHREAD_LDFLAGS" ;; esac @@ -293,7 +294,8 @@ AM_CONDITIONAL([HAVE_LIBXML2], [ test "x${have_libxml2}" = "xyes" ]) have_jemalloc=no if test "x${request_jemalloc}" != "xno"; then LIBS_OLD=$LIBS - AC_SEARCH_LIBS([malloc_stats_print], [jemalloc], [have_jemalloc=yes]) + AC_SEARCH_LIBS([malloc_stats_print], [jemalloc], [have_jemalloc=yes], [], + [$PTHREAD_LDFLAGS]) LIBS=$LIBS_OLD if test "x${have_jemalloc}" = "xyes" && test "x${ac_cv_search_malloc_stats_print}" != "xnone required"; then