X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=m4%2Fax_pthread.m4;h=e0d54ad935627dc258cd2d93a9bf79c7e72722e8;hb=303f0aafd224cdb5d27c717661c34eaf1eaf4cae;hp=a6bf596c321312d598e125f0a701d758bc4d4d3a;hpb=94f5464bff8ac8f66b603ccccc0d4cb59ecddd01;p=m6w6%2Flibmemcached diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 index a6bf596c..e0d54ad9 100644 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -82,7 +82,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 16 +#serial 18 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ @@ -145,8 +145,8 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case "${host_cpu}-${host_os}" in - *solaris*) +case ${host_os} in + solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based @@ -159,7 +159,11 @@ case "${host_cpu}-${host_os}" in ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; - *-darwin*) + darwin12*) + ax_pthread_flags="$ax_pthread_flags" + ;; + + darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac @@ -254,9 +258,16 @@ if test "x$ax_pthread_ok" = xyes; then AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then