]> Savannah Git Hosting - gnulib.git/commitdiff
threads-h: Simplify link dependencies.
authorBruno Haible <bruno@clisp.org>
Fri, 21 Jun 2019 01:41:35 +0000 (03:41 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 21 Jun 2019 01:41:35 +0000 (03:41 +0200)
* m4/threads.m4 (gl_THREADS_H): Bail out if Pth threading is requested.
Don't set LTLIBSTDTHREAD.
* modules/thrd (Link): Simplify accordingly.
* modules/mtx (Link): Likewise.
* modules/cnd (Link): Likewise.
* modules/tss (Link): Likewise.
* modules/threads (Link): Likewise.

ChangeLog
m4/threads.m4
modules/cnd
modules/mtx
modules/thrd
modules/threads
modules/tss

index c3180432bc4a8b763f13926d6da8234d02aa71ea..7701108b77658e21b4b38f84b7166e99c4e4cab5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-06-20  Bruno Haible  <bruno@clisp.org>
+
+       threads-h: Simplify link dependencies.
+       * m4/threads.m4 (gl_THREADS_H): Bail out if Pth threading is requested.
+       Don't set LTLIBSTDTHREAD.
+       * modules/thrd (Link): Simplify accordingly.
+       * modules/mtx (Link): Likewise.
+       * modules/cnd (Link): Likewise.
+       * modules/tss (Link): Likewise.
+       * modules/threads (Link): Likewise.
+
 2019-06-20  Bruno Haible  <bruno@clisp.org>
 
        threads-h: Fix link error on FreeBSD 11.
index 3a921c0e33df3ab9de7917758eaf45a4f6c5f654..87e97f3a0b19fc9f74a2a898d076338aba054b80 100644 (file)
@@ -1,4 +1,4 @@
-# threads.m4 serial 2
+# threads.m4 serial 3
 dnl Copyright (C) 2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,6 +11,12 @@ AC_DEFUN([gl_THREADS_H],
   AC_REQUIRE([gl_THREADLIB_BODY])
   AC_REQUIRE([gl_YIELD])
 
+  if test "$gl_use_threads" = pth; then
+    AC_MSG_ERROR([You cannot use --enable-threads=pth with the gnulib module 'threads-h'.])
+  fi
+  dnl Now, since $gl_use_threads is not 'pth', $LTLIBMULTITHREAD and
+  dnl $LIBMULTITHREAD have the same value. Only system libraries are needed.
+
   gl_CHECK_NEXT_HEADERS([threads.h])
   if test $ac_cv_header_threads_h = yes; then
     HAVE_THREADS_H=1
@@ -47,7 +53,6 @@ AC_DEFUN([gl_THREADS_H],
   case "$host_os" in
     mingw*)
       LIBSTDTHREAD=
-      LTLIBSTDTHREAD=
       ;;
     *)
       if test $ac_cv_header_threads_h = yes; then
@@ -58,26 +63,21 @@ AC_DEFUN([gl_THREADS_H],
         AC_CHECK_FUNCS([thrd_create])
         if test $ac_cv_func_thrd_create = yes; then
           LIBSTDTHREAD=
-          LTLIBSTDTHREAD=
         else
           AC_CHECK_LIB([stdthreads], [thrd_create], [
             LIBSTDTHREAD='-lstdthreads -lpthread'
-            LTLIBSTDTHREAD='-lstdthreads -lpthread'
           ], [
             dnl Guess that thrd_create is in libpthread.
             LIBSTDTHREAD="$LIBMULTITHREAD"
-            LTLIBSTDTHREAD="$LTLIBMULTITHREAD"
           ])
         fi
       else
         dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
         LIBSTDTHREAD="$LIBMULTITHREAD $YIELD_LIB"
-        LTLIBSTDTHREAD="$LTLIBMULTITHREAD $YIELD_LIB"
       fi
       ;;
   esac
   AC_SUBST([LIBSTDTHREAD])
-  AC_SUBST([LTLIBSTDTHREAD])
 
   AH_VERBATIM([thread_local],
 [/* The _Thread_local keyword of C11.  */
index 635a422487e4dfad9044739fe064805f1044f49c..6870479613f050fbc1d57844b280d1bde231e701 100644 (file)
@@ -22,7 +22,7 @@ Include:
 <threads.h>
 
 Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
 
 License:
 LGPLv2+
index a1d2a8ad4cc75d5eddff3a16320c5c2f0a7b9919..ade00b25eb740d921b42589c27ce639942fdb1eb 100644 (file)
@@ -25,7 +25,7 @@ Include:
 <threads.h>
 
 Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
 
 License:
 LGPLv2+
index 3fd606305dce5f1065539cb154dec621d077fd8e..388e0ea33b8f00e5a86d72788360bbb91cb78fd5 100644 (file)
@@ -24,7 +24,7 @@ Include:
 <threads.h>
 
 Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
 
 License:
 LGPLv2+
index 2693bd5d300700ca35744362c3fa41fd9c495248..18391c1c2dddd1552e965559e2b312bddf61a21c 100644 (file)
@@ -18,7 +18,7 @@ Include:
 <threads.h>
 
 Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
 
 License:
 LGPLv2+
index 4a28200d524b101b504d6d055ab32414a6a29838..d751724842cf495e0db5a9fb56e1ce8df239e544 100644 (file)
@@ -21,7 +21,7 @@ Include:
 <threads.h>
 
 Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
 
 License:
 LGPLv2+