Detect static libjemalloc

libjemalloc as static library requires -pthread flag to link.  Without
that, the check in configure.ac fails with unresolved symbols.
This commit is contained in:
Tatsuhiro Tsujikawa 2014-08-05 21:49:50 +09:00
parent 04e94824a0
commit 8736f61fbd
1 changed files with 4 additions and 2 deletions

View File

@ -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