]> granicus.if.org Git - php/commitdiff
Kill unnecessary quoting, and set host_alias to host, if only the latter
authorSascha Schumann <sas@php.net>
Wed, 19 Sep 2001 09:01:05 +0000 (09:01 +0000)
committerSascha Schumann <sas@php.net>
Wed, 19 Sep 2001 09:01:05 +0000 (09:01 +0000)
is defined.

TSRM/threads.m4

index 812b38e1ea8f96f3b5272ce8b85efb43108b8115..e0f934e5567862efe768a66426fa66df359c5319 100644 (file)
@@ -31,24 +31,27 @@ dnl
 dnl Set some magic defines to achieve POSIX threads conformance
 dnl
 AC_DEFUN(PTHREADS_FLAGS,[
+  if test -z "$host_alias" && test -n "$host"; then
+    host_alias=$host
+  fi
   if test -z "$host_alias"; then
     AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess)
   fi
-  case "$host_alias" in
+  case $host_alias in
   *solaris*)
     PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";;
   *freebsd*)
     PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";;
   *linux*)
-    PTHREAD_FLAGS="-D_REENTRANT";;
+    PTHREAD_FLAGS=-D_REENTRANT;;
   *aix*)
-    PTHREAD_FLAGS="-D_THREAD_SAFE";;
+    PTHREAD_FLAGS=-D_THREAD_SAFE;;
   *irix*)
-    PTHREAD_FLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS";;
+    PTHREAD_FLAGS=-D_POSIX_THREAD_SAFE_FUNCTIONS;;
   *hpux*)
-    PTHREAD_FLAGS="-D_REENTRANT";;
+    PTHREAD_FLAGS=-D_REENTRANT;;
   *sco*)
-    PTHREAD_FLAGS="-D_REENTRANT";;
+    PTHREAD_FLAGS=-D_REENTRANT;;
 dnl Solves sigwait() problem, creates problems with u_long etc.
 dnl    PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";;
   esac
@@ -77,11 +80,11 @@ int main() {
     int data = 1;
     pthread_mutexattr_init(&mattr);
     return pthread_create(&thd, NULL, thread_routine, &data);
-} ], [ 
-  pthreads_working="yes"
+} ], [
+  pthreads_working=yes
   ], [
-  pthreads_working="no"
-  ], pthreads_working="no" ) ] )dnl
+  pthreads_working=no
+  ], pthreads_working=no ) ] )dnl
 dnl
 dnl PTHREADS_CHECK()
 dnl
@@ -99,23 +102,23 @@ dnl  -threads          gcc (HP-UX)
 dnl
 AC_DEFUN(PTHREADS_CHECK,[
 
-save_CFLAGS="$CFLAGS"
-save_LIBS="$LIBS"
+save_CFLAGS=$CFLAGS
+save_LIBS=$LIBS
 PTHREADS_ASSIGN_VARS
 PTHREADS_CHECK_COMPILE
-LIBS="$save_LIBS"
-CFLAGS="$save_CFLAGS"
+LIBS=$save_LIBS
+CFLAGS=$save_CFLAGS
 
 AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
-ac_cv_pthreads_cflags=""
+ac_cv_pthreads_cflags=
 if test "$pthreads_working" != "yes"; then
   for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do 
-    ac_save="$CFLAGS"
+    ac_save=$CFLAGS
     CFLAGS="$CFLAGS $flag"
     PTHREADS_CHECK_COMPILE
-    CFLAGS="$ac_save"
+    CFLAGS=$ac_save
     if test "$pthreads_working" = "yes"; then
-      ac_cv_pthreads_cflags="$flag"
+      ac_cv_pthreads_cflags=$flag
       break
     fi
   done
@@ -123,15 +126,15 @@ fi
 ])
 
 AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
-ac_cv_pthreads_lib=""
+ac_cv_pthreads_lib=
 if test "$pthreads_working" != "yes"; then
   for lib in pthread pthreads c_r; do
-    ac_save="$LIBS"
+    ac_save=$LIBS
     LIBS="$LIBS -l$lib"
     PTHREADS_CHECK_COMPILE
-    LIBS="$ac_save"
+    LIBS=$ac_save
     if test "$pthreads_working" = "yes"; then
-      ac_cv_pthreads_lib="$lib"
+      ac_cv_pthreads_lib=$lib
       break
     fi
   done
@@ -139,9 +142,9 @@ fi
 ])
 
 if test "$pthreads_working" = "yes"; then
-  threads_result="POSIX Threads found"
+  threads_result="POSIX-Threads found"
 else
-  threads_result="POSIX Threads not found"
+  threads_result="POSIX-Threads not found"
 fi
 ])dnl
 dnl