summaryrefslogtreecommitdiff
path: root/TSRM/threads.m4
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-05-04 10:49:36 +0000
committerSascha Schumann <sas@php.net>2000-05-04 10:49:36 +0000
commit6c4d6ba5e3ebf03bb8f4cbc48a8551ad68b8f893 (patch)
tree84509c268d449d3caae5b58d360a92432eb43eb8 /TSRM/threads.m4
parentd0f3764ee2e10003d9c8ea4a1c17ff0be1303a9b (diff)
downloadphp-git-6c4d6ba5e3ebf03bb8f4cbc48a8551ad68b8f893.tar.gz
Don't automatically assign pthreads_cflags/pthreads_libs to env
variables. That allows us to check for the availability of POSIX threads before actually using it.
Diffstat (limited to 'TSRM/threads.m4')
-rw-r--r--TSRM/threads.m422
1 files changed, 13 insertions, 9 deletions
diff --git a/TSRM/threads.m4 b/TSRM/threads.m4
index 770cd5c4fd..2c8af928b9 100644
--- a/TSRM/threads.m4
+++ b/TSRM/threads.m4
@@ -88,13 +88,6 @@ dnl
dnl Try to find a way to enable POSIX threads
dnl
AC_DEFUN(PTHREADS_CHECK,[
-if test -n "$ac_cv_pthreads_lib"; then
- LIBS="$LIBS -l$ac_cv_pthreads_lib"
-fi
-
-if test -n "$ac_cv_pthreads_cflags"; then
- CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
-fi
PTHREADS_CHECK_COMPILE
@@ -105,11 +98,11 @@ if test "$pthreads_working" != "yes"; then
ac_save="$CFLAGS"
CFLAGS="$CFLAGS $flag"
PTHREADS_CHECK_COMPILE
+ CFLAGS="$ac_save"
if test "$pthreads_working" = "yes"; then
ac_cv_pthreads_cflags="$flag"
break
fi
- CFLAGS="$ac_save"
done
fi
])
@@ -121,11 +114,11 @@ if test "$pthreads_working" != "yes"; then
ac_save="$LIBS"
LIBS="$LIBS -l$lib"
PTHREADS_CHECK_COMPILE
+ LIBS="$ac_save"
if test "$pthreads_working" = "yes"; then
ac_cv_pthreads_lib="$lib"
break
fi
- LIBS="$ac_save"
done
fi
])
@@ -136,3 +129,14 @@ else
threads_result="POSIX Threads not found"
fi
])dnl
+dnl
+dnl
+AC_DEFUN(PTHREADS_ASSIGN_VARS,[
+if test -n "$ac_cv_pthreads_lib"; then
+ LIBS="$LIBS -l$ac_cv_pthreads_lib"
+fi
+
+if test -n "$ac_cv_pthreads_cflags"; then
+ CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
+fi
+])dnl