New upstream version 1.9
[debian/gzip] / m4 / threadlib.m4
index b43534ea278493cb78eb75d716fc44ff5a206834..1f7b1341c1e3fc2360171bdb4a1cf4fb433299a7 100644 (file)
@@ -1,5 +1,5 @@
-# threadlib.m4 serial 11 (gettext-0.18.2)
-dnl Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# threadlib.m4 serial 13
+dnl Copyright (C) 2005-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -66,7 +66,7 @@ changequote(,)dnl
          dnl child process gets an endless segmentation fault inside execvp().
          dnl Disable multithreading by default on Cygwin 1.5.x, because it has
          dnl bugs that lead to endless loops or crashes. See
-         dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
+         dnl <https://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
          osf*) gl_use_threads=no ;;
          cygwin*)
                case `uname -r` in
@@ -148,6 +148,10 @@ int main ()
               [gl_cv_have_weak="guessing no"])
            ])
        fi
+       dnl But when linking statically, weak symbols don't work.
+       case " $LDFLAGS " in
+         *" -static "*) gl_cv_have_weak=no ;;
+       esac
       ])
     if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
       # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
@@ -165,7 +169,7 @@ int main ()
         #
         # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
         # needs -pthread for some reason.  See:
-        # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
+        # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
         save_LIBS=$LIBS
         for gl_pthread in '' '-pthread'; do
           LIBS="$LIBS $gl_pthread"
@@ -195,8 +199,10 @@ int main ()
              # Therefore pthread_in_use() needs to actually try to create a
              # thread: pthread_create from libc will fail, whereas
              # pthread_create will actually create a thread.
+             # On Solaris 10 or newer, this test is no longer needed, because
+             # libc contains the fully functional pthread functions.
              case "$host_os" in
-               solaris* | hpux*)
+               solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
                  AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
                    [Define if the pthread_in_use() detection is hard.])
              esac