From 6cec69051e32286cd33e28d5d01970aef2f8713d Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" Date: Mon, 25 Aug 2014 20:17:16 +0200 Subject: [PATCH] fix pthread shared linking check for MingW32 --- m4/acx_pthread.m4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/m4/acx_pthread.m4 b/m4/acx_pthread.m4 index dcf6332..1cada4d 100644 --- a/m4/acx_pthread.m4 +++ b/m4/acx_pthread.m4 @@ -256,11 +256,16 @@ if test "x$acx_pthread_ok" = xyes; then # # -Wl,-z,defs forces link-time symbol resolution, so that the # linking checks with -shared actually have any value + # The Mingw32 equivalent to -z defs seems to be --error-unresolved-symbols. # # FIXME: -fPIC is required for -shared on many architectures, # so we specify it here, but the right way would probably be to # properly detect whether it is actually required. - CFLAGS="-shared -fPIC -Wl,-z,defs $CFLAGS $PTHREAD_CFLAGS" + zdefs="-z,defs" + case "${host_os}" in + *mingw32*) zdefs="--unresolved-symbols=report-all,--error-unresolved-symbols" + esac + CFLAGS="-shared -fPIC -Wl,$zdefs $CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CC="$PTHREAD_CC" -- 2.39.2