summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-06-21 03:41:35 +0200
committerBruno Haible <bruno@clisp.org>2019-06-21 03:41:35 +0200
commitb6293339816d7df16bb4d31d2ec1c1e5a79f976e (patch)
treea3bebe69fcdf7639119632d2b861e1d22e5a5142
parent9e6e4c0336c9d03b109bcdb11f287eddcf376a87 (diff)
downloadgnulib-b6293339816d7df16bb4d31d2ec1c1e5a79f976e.tar.gz
gnulib-b6293339816d7df16bb4d31d2ec1c1e5a79f976e.tar.bz2
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.
-rw-r--r--ChangeLog11
-rw-r--r--m4/threads.m414
-rw-r--r--modules/cnd2
-rw-r--r--modules/mtx2
-rw-r--r--modules/thrd2
-rw-r--r--modules/threads2
-rw-r--r--modules/tss2
7 files changed, 23 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index c3180432bc..7701108b77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
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.
* m4/threads.m4 (gl_THREADS_H): When linking with -lstdthreads, link
also with -lpthread.
diff --git a/m4/threads.m4 b/m4/threads.m4
index 3a921c0e33..87e97f3a0b 100644
--- a/m4/threads.m4
+++ b/m4/threads.m4
@@ -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. */
diff --git a/modules/cnd b/modules/cnd
index 635a422487..6870479613 100644
--- a/modules/cnd
+++ b/modules/cnd
@@ -22,7 +22,7 @@ Include:
<threads.h>
Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
License:
LGPLv2+
diff --git a/modules/mtx b/modules/mtx
index a1d2a8ad4c..ade00b25eb 100644
--- a/modules/mtx
+++ b/modules/mtx
@@ -25,7 +25,7 @@ Include:
<threads.h>
Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
License:
LGPLv2+
diff --git a/modules/thrd b/modules/thrd
index 3fd606305d..388e0ea33b 100644
--- a/modules/thrd
+++ b/modules/thrd
@@ -24,7 +24,7 @@ Include:
<threads.h>
Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
License:
LGPLv2+
diff --git a/modules/threads b/modules/threads
index 2693bd5d30..18391c1c2d 100644
--- a/modules/threads
+++ b/modules/threads
@@ -18,7 +18,7 @@ Include:
<threads.h>
Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
License:
LGPLv2+
diff --git a/modules/tss b/modules/tss
index 4a28200d52..d751724842 100644
--- a/modules/tss
+++ b/modules/tss
@@ -21,7 +21,7 @@ Include:
<threads.h>
Link:
-$(LTLIBSTDTHREAD) when linking with libtool, $(LIBSTDTHREAD) otherwise
+$(LIBSTDTHREAD)
License:
LGPLv2+

Return to:

Send suggestions and report system problems to the System administrator.