summaryrefslogtreecommitdiffstats
path: root/acx_pthread.m4
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-07-16 09:05:50 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2009-07-16 09:05:50 +0200
commit22b018e369a66ee112cd7323c72d8ed05afc521f (patch)
treea93dcbf42fec6921167efecf532c3e524a4e4377 /acx_pthread.m4
parent391b7c18eccfdf4107f913a7cf77a00ef0dea703 (diff)
Update acx_pthread.m4 to not use AC_LANG_SAVE, AC_LANG_C and AC_TRY_LINK deprecated macros
Diffstat (limited to 'acx_pthread.m4')
-rw-r--r--acx_pthread.m418
1 files changed, 9 insertions, 9 deletions
diff --git a/acx_pthread.m4 b/acx_pthread.m4
index 417d61d..2a1309a 100644
--- a/acx_pthread.m4
+++ b/acx_pthread.m4
@@ -1,7 +1,6 @@
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_SAVE
-AC_LANG_C
+AC_LANG_PUSH([C])
acx_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
@@ -114,11 +113,11 @@ for flag in $acx_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);
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#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); ],
- [acx_pthread_ok=yes])
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ]])],
+ [acx_pthread_ok=yes],[])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
@@ -144,8 +143,9 @@ if test "x$acx_pthread_ok" = xyes; then
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
- AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
- [attr_name=$attr; break])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
+ [[int attr=$attr; return attr;]])],
+ [attr_name=$attr; break],[])
done
AC_MSG_RESULT($attr_name)
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
@@ -190,6 +190,6 @@ else
acx_pthread_ok=no
$2
fi
-AC_LANG_RESTORE
+AC_LANG_POP([C])
])dnl ACX_PTHREAD