diff options
author | Adam Chlipala <adam@chlipala.net> | 2016-01-16 09:33:39 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2016-01-16 09:33:39 -0500 |
commit | 610dc28a6c858748c6a22ce4478eeaef66477514 (patch) | |
tree | 58470b0e06f254a547e58896dd07bf272e0c312a /m4 | |
parent | d47ffbc86c1cafb041588ab0ea7540c538196cb9 (diff) |
Tweaking discovery of Pthreads C flags
Diffstat (limited to 'm4')
-rw-r--r-- | m4/m4_ax_pthread.m4 | 12 |
1 files changed, 12 insertions, 0 deletions
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" |