summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-12-02 02:39:38 +0100
committerBruno Haible <bruno@clisp.org>2019-12-02 02:59:26 +0100
commit6a44771a9975f5de3a2f505118fe8f5e901ca96c (patch)
treeb3cabb7bae7061f22a09aa02bbd5fe91b606e50a /modules
parentbcd6630c7334085fc36f311b2019a8d4d8ca295e (diff)
downloadgnulib-6a44771a9975f5de3a2f505118fe8f5e901ca96c.tar.gz
pthread-h: Fix link errors with --enable-threads=isoc on AIX.
* m4/threadlib.m4 (gl_ANYTHREADLIB_EARLY): New macro, extracted from gl_THREADLIB_EARLY_BODY. (gl_THREADLIB_EARLY_BODY): Invoke it. (gl_PTHREADLIB_BODY): New macro, extracted from gl_THREADLIB_BODY. (gl_THREADLIB_BODY): Invoke it. (gl_PTHREADLIB): New macro. * m4/pthread_h.m4 (gl_PTHREAD_H): Require gl_PTHREADLIB. Require gl_THREADLIB and test $gl_threads_api only if module 'threadlib' is present. Define LIB_PTHREAD using LIBPMULTITHREAD, not LIBMULTITHREAD. * modules/pthread-h (Files): Add threadlib.m4. (Depends-on): Remove threadlib. (configure.ac-early): Invoke gl_ANYTHREADLIB_EARLY. Don't set _REENTRANT and _THREAD_SAFE here. (Link): Use LIBPTHREAD, not LIBTHREAD. * modules/pthread-thread (Link): Use LIBPMULTITHREAD, not LIBMULTITHREAD. * modules/pthread-once (Link): Likewise. * modules/pthread-mutex (Link): Likewise. * modules/pthread-rwlock (Link): Likewise. * modules/pthread-cond (Link): Likewise. * modules/pthread-tss (Link): Likewise. * modules/pthread-spin (Link): Likewise. * modules/pthread (Link): Likewise. * modules/pthread-h-c++-tests (test_pthread_c___LDADD): Likewise. * modules/pthread-thread-tests (test_pthread_thread_LDADD): Likewise. * modules/pthread-once-tests (test_pthread_once1_LDADD, test_pthread_once2_LDADD): Likewise. * modules/pthread-mutex-tests (test_pthread_mutex_LDADD): Likewise. * modules/pthread-rwlock-tests (test_pthread_rwlock_LDADD): Likewise. * modules/pthread-cond-tests (test_pthread_cond_LDADD): Likewise. * modules/pthread-tss-tests (test_pthread_tss_LDADD): Likewise.
Diffstat (limited to 'modules')
-rw-r--r--modules/pthread2
-rw-r--r--modules/pthread-cond2
-rw-r--r--modules/pthread-cond-tests2
-rw-r--r--modules/pthread-h7
-rw-r--r--modules/pthread-h-c++-tests2
-rw-r--r--modules/pthread-mutex2
-rw-r--r--modules/pthread-mutex-tests2
-rw-r--r--modules/pthread-once2
-rw-r--r--modules/pthread-once-tests4
-rw-r--r--modules/pthread-rwlock2
-rw-r--r--modules/pthread-rwlock-tests2
-rw-r--r--modules/pthread-spin2
-rw-r--r--modules/pthread-thread2
-rw-r--r--modules/pthread-thread-tests2
-rw-r--r--modules/pthread-tss2
-rw-r--r--modules/pthread-tss-tests2
16 files changed, 19 insertions, 20 deletions
diff --git a/modules/pthread b/modules/pthread
index c9c5614b21..455b73e33b 100644
--- a/modules/pthread
+++ b/modules/pthread
@@ -21,7 +21,7 @@ Include:
<pthread.h>
Link:
-$(LIBMULTITHREAD)
+$(LIBPMULTITHREAD)
License:
LGPLv2+
diff --git a/modules/pthread-cond b/modules/pthread-cond
index c07aa6316b..e5c62fe188 100644
--- a/modules/pthread-cond
+++ b/modules/pthread-cond
@@ -23,7 +23,7 @@ Include:
<pthread.h>
Link:
-$(LIBMULTITHREAD)
+$(LIBPMULTITHREAD)
License:
LGPLv2+
diff --git a/modules/pthread-cond-tests b/modules/pthread-cond-tests
index 8334b3b7cf..041047ee2d 100644
--- a/modules/pthread-cond-tests
+++ b/modules/pthread-cond-tests
@@ -13,4 +13,4 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-cond
check_PROGRAMS += test-pthread-cond
-test_pthread_cond_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@
+test_pthread_cond_LDADD = $(LDADD) @LIBPMULTITHREAD@ @YIELD_LIB@
diff --git a/modules/pthread-h b/modules/pthread-h
index 3a9c1501c3..3fe5527658 100644
--- a/modules/pthread-h
+++ b/modules/pthread-h
@@ -4,21 +4,20 @@ A POSIX-like <pthread.h>.
Files:
lib/pthread.in.h
m4/pthread_h.m4
+m4/threadlib.m4
Depends-on:
extensions
extern-inline
sched
time
-threadlib
snippet/c++defs
snippet/_Noreturn
snippet/arg-nonnull
snippet/warn-on-use
configure.ac-early:
-AC_DEFINE([_REENTRANT], 1, [For thread-safety on OSF/1, Solaris.])
-AC_DEFINE([_THREAD_SAFE], 1, [For thread-safety on AIX, FreeBSD.])
+gl_ANYTHREADLIB_EARLY
configure.ac:
gl_PTHREAD_H
@@ -166,7 +165,7 @@ Include:
<pthread.h>
Link:
-$(LIBTHREAD)
+$(LIBPTHREAD)
License:
LGPLv2+
diff --git a/modules/pthread-h-c++-tests b/modules/pthread-h-c++-tests
index 225c7f8834..f69f4e170d 100644
--- a/modules/pthread-h-c++-tests
+++ b/modules/pthread-h-c++-tests
@@ -15,5 +15,5 @@ if ANSICXX
TESTS += test-pthread-c++
check_PROGRAMS += test-pthread-c++
test_pthread_c___SOURCES = test-pthread-c++.cc
-test_pthread_c___LDADD = $(LDADD) $(LIBMULTITHREAD)
+test_pthread_c___LDADD = $(LDADD) $(LIBPMULTITHREAD)
endif
diff --git a/modules/pthread-mutex b/modules/pthread-mutex
index 71496b7f9c..556ffa8f23 100644
--- a/modules/pthread-mutex
+++ b/modules/pthread-mutex
@@ -25,7 +25,7 @@ Include:
<pthread.h>
Link:
-$(LIBTHREAD) or $(LIBMULTITHREAD)
+$(LIBPTHREAD) or $(LIBPMULTITHREAD)
License:
LGPLv2+
diff --git a/modules/pthread-mutex-tests b/modules/pthread-mutex-tests
index 050d506b0e..9d9861f09f 100644
--- a/modules/pthread-mutex-tests
+++ b/modules/pthread-mutex-tests
@@ -11,4 +11,4 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-mutex
check_PROGRAMS += test-pthread-mutex
-test_pthread_mutex_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@
+test_pthread_mutex_LDADD = $(LDADD) @LIBPMULTITHREAD@ @YIELD_LIB@
diff --git a/modules/pthread-once b/modules/pthread-once
index 3e25c76d3e..c7f28d1aff 100644
--- a/modules/pthread-once
+++ b/modules/pthread-once
@@ -22,7 +22,7 @@ Include:
<pthread.h>
Link:
-$(LIBMULTITHREAD)
+$(LIBPMULTITHREAD)
License:
LGPLv2+
diff --git a/modules/pthread-once-tests b/modules/pthread-once-tests
index 2765c30fd8..17b25b6d33 100644
--- a/modules/pthread-once-tests
+++ b/modules/pthread-once-tests
@@ -13,5 +13,5 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-once1 test-pthread-once2
check_PROGRAMS += test-pthread-once1 test-pthread-once2
-test_pthread_once1_LDADD = $(LDADD) @LIBMULTITHREAD@
-test_pthread_once2_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@
+test_pthread_once1_LDADD = $(LDADD) @LIBPMULTITHREAD@
+test_pthread_once2_LDADD = $(LDADD) @LIBPMULTITHREAD@ @YIELD_LIB@
diff --git a/modules/pthread-rwlock b/modules/pthread-rwlock
index cb30e44d26..e9354149aa 100644
--- a/modules/pthread-rwlock
+++ b/modules/pthread-rwlock
@@ -24,7 +24,7 @@ Include:
<pthread.h>
Link:
-$(LIBTHREAD) or $(LIBMULTITHREAD)
+$(LIBPTHREAD) or $(LIBPMULTITHREAD)
License:
LGPLv2+
diff --git a/modules/pthread-rwlock-tests b/modules/pthread-rwlock-tests
index ddb64dcb30..a8d51ee972 100644
--- a/modules/pthread-rwlock-tests
+++ b/modules/pthread-rwlock-tests
@@ -12,4 +12,4 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-rwlock
check_PROGRAMS += test-pthread-rwlock
-test_pthread_rwlock_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@
+test_pthread_rwlock_LDADD = $(LDADD) @LIBPMULTITHREAD@ @YIELD_LIB@
diff --git a/modules/pthread-spin b/modules/pthread-spin
index a58b9f7ce8..53e0051c34 100644
--- a/modules/pthread-spin
+++ b/modules/pthread-spin
@@ -22,7 +22,7 @@ Include:
<pthread.h>
Link:
-$(LIBMULTITHREAD)
+$(LIBPMULTITHREAD)
License:
LGPLv2+
diff --git a/modules/pthread-thread b/modules/pthread-thread
index b9133d82e1..af6682b8ea 100644
--- a/modules/pthread-thread
+++ b/modules/pthread-thread
@@ -22,7 +22,7 @@ Include:
<pthread.h>
Link:
-$(LIBMULTITHREAD)
+$(LIBPMULTITHREAD)
License:
LGPLv2+
diff --git a/modules/pthread-thread-tests b/modules/pthread-thread-tests
index 497ce4f27b..fde0e0ade6 100644
--- a/modules/pthread-thread-tests
+++ b/modules/pthread-thread-tests
@@ -9,4 +9,4 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-thread
check_PROGRAMS += test-pthread-thread
-test_pthread_thread_LDADD = $(LDADD) @LIBMULTITHREAD@
+test_pthread_thread_LDADD = $(LDADD) @LIBPMULTITHREAD@
diff --git a/modules/pthread-tss b/modules/pthread-tss
index f4e2fde008..ab95d08a1b 100644
--- a/modules/pthread-tss
+++ b/modules/pthread-tss
@@ -22,7 +22,7 @@ Include:
<pthread.h>
Link:
-$(LIBMULTITHREAD)
+$(LIBPMULTITHREAD)
License:
LGPLv2+
diff --git a/modules/pthread-tss-tests b/modules/pthread-tss-tests
index 52707e38a6..3a33e563f0 100644
--- a/modules/pthread-tss-tests
+++ b/modules/pthread-tss-tests
@@ -12,4 +12,4 @@ configure.ac:
Makefile.am:
TESTS += test-pthread-tss
check_PROGRAMS += test-pthread-tss
-test_pthread_tss_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@
+test_pthread_tss_LDADD = $(LDADD) @LIBPMULTITHREAD@ @YIELD_LIB@