summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2009-12-30 18:46:53 +0100
committerPeter Simons <simons@cryp.to>2010-01-05 14:02:02 +0100
commit7a6c511965489c38f5d3bef4afe113e3fe11c2ac (patch)
tree68f72d3ac4f160405b2f3a2ba4e92ea987342610
parent4339f0a8a2803e1e954f461319b39c7f1a1f60fb (diff)
downloadautoconf-archive-7a6c511965489c38f5d3bef4afe113e3fe11c2ac.tar.gz
AX_PTHREAD: minor changes to the AC_TRY_LINK command so that the code compiles when -Wall and -Werror are set
-rw-r--r--NEWS2
-rw-r--r--m4/ax_pthread.m413
2 files changed, 11 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index b686427..d21d4f5 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@
environment and extended to support an
ACTION-IF-FOUND/ACTION-IF-NOT-FOUND-style API.
+ AX_PTHREAD has been updated to succeed when compiling with -Wall and -Werror.
+
AX_C_IFDEF has been deprecated, because the standard Autoconf macro
AC_CHECK_DECL provides the same functionality.
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index 8a1d24c..37502dd 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -192,10 +192,15 @@ for flag in $ax_pthread_flags; do
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
- AC_TRY_LINK([#include <pthread.h>],
- [pthread_t th; pthread_join(th, 0);
- pthread_attr_init(0); pthread_cleanup_push(0, 0);
- pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ AC_TRY_LINK([#include <pthread.h>
+ static void routine(void* a) {a=0;}
+ static void* start_routine(void* a) {return a;}],
+ [pthread_t th; pthread_attr_t attr;
+ pthread_join(th, 0);
+ pthread_attr_init(&attr);
+ pthread_cleanup_push(routine, 0);
+ pthread_create(&th,0,start_routine,0);
+ pthread_cleanup_pop(0); ],
[ax_pthread_ok=yes])
LIBS="$save_LIBS"