[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ISO C 11 threads implementation
From: |
Bruno Haible |
Subject: |
Re: [PATCH] ISO C 11 threads implementation |
Date: |
Fri, 21 Jun 2019 11:22:19 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-145-generic; KDE/5.18.0; x86_64; ; ) |
A small simplification.
2019-06-20 Bruno Haible <address@hidden>
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.
diff --git a/m4/threads.m4 b/m4/threads.m4
index 3a921c0..87e97f3 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 635a4224..6870479 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 a1d2a8a..ade00b2 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 3fd6063..388e0ea 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 2693bd5..18391c1 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 4a28200..d751724 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+