From 610dc28a6c858748c6a22ce4478eeaef66477514 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 16 Jan 2016 09:33:39 -0500 Subject: Tweaking discovery of Pthreads C flags --- m4/m4_ax_pthread.m4 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'm4') diff --git a/m4/m4_ax_pthread.m4 b/m4/m4_ax_pthread.m4 index d383ad5c..f0717ada 100644 --- a/m4/m4_ax_pthread.m4 +++ b/m4/m4_ax_pthread.m4 @@ -204,11 +204,22 @@ for flag in $ax_pthread_flags; do ;; esac + save_LDFLAGS="$LDFLAGS" save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags" + # This check added by Adam Chlipala on January 16, 2016. + # The documentation at the top of this file said that PTHREAD_CFLAGS needs to + # be used at link-time, too, but this test didn't seem to do so. + # For now, I'm patching just for the common case of '-pthread'. + case $flag in + -pthread) + LDFLAGS="$LDFLAGS -pthread" + ;; + esac + # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) @@ -230,6 +241,7 @@ for flag in $ax_pthread_flags; do [ax_pthread_ok=yes], []) + LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" -- cgit v1.2.3