[patch #8186] ax_pthread adds -pthread when it should not on OSX when compiling with clang

Brian Aker <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.archive-maintainers
Message-ID <[email protected]>
Follow-up Comment #6, patch #8186 (project autoconf-archive):

Hi!

Sorry about not logging in when I left the original bug report, I was in a
hurry working over someone's shoulder and just copy and pasted what I had done
:)

This patch works if you call clang via "clang" but if you call it via CC it
will fail. I took what you all did in trunk and applied the following:


diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index 4537934..ebea7fb 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -123,7 +123,7 @@ fi
 # which indicates that we try without any flags at all, and "pthread-config"
 # which is a program returning the flags for the Pth emulation library.
 
-ax_pthread_flags="none pthreads -Kthread -kthread lthread -pthread -pthreads
-mthreads pthread --thread-safe -mt pthread-config"
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads
-mthreads pthread --thread-safe -mt pthread-config"
 
 # The ordering *is* (sometimes) important.  Some notes on the
 # individual items follow:
@@ -160,7 +160,7 @@ case ${host_os} in
         ;;
 
         darwin*)
-        ax_pthread_flags="-pthread $ax_pthread_flags"
+        ax_pthread_flags="none -pthread $ax_pthread_flags"
         ;;
 esac
 
Cheers,
    -Brian

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8186>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.