Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 130 lines (102 sloc) 2.815 kB
9aef667 Rewrite TSRM_CHECK_GCC_ARG to cache its result
Sascha Schumann authored
1
2 dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)
69eec3f MFB_4_3: Quote macro names in AC_DEFUN()
foobar authored
3 AC_DEFUN([TSRM_CHECK_GCC_ARG],[
9aef667 Rewrite TSRM_CHECK_GCC_ARG to cache its result
Sascha Schumann authored
4 gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_)
5 AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [
6 echo 'void somefunc() { };' > conftest.c
aa3737e Improved check for GCC's -pthread and -pthreads flag
Sascha Schumann authored
7 cmd='$CC $1 -c conftest.c'
8 if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then
9aef667 Rewrite TSRM_CHECK_GCC_ARG to cache its result
Sascha Schumann authored
9 ac_result=no
aa3737e Improved check for GCC's -pthread and -pthreads flag
Sascha Schumann authored
10 else
9aef667 Rewrite TSRM_CHECK_GCC_ARG to cache its result
Sascha Schumann authored
11 ac_result=yes
aa3737e Improved check for GCC's -pthread and -pthreads flag
Sascha Schumann authored
12 fi
9aef667 Rewrite TSRM_CHECK_GCC_ARG to cache its result
Sascha Schumann authored
13 eval $gcc_arg_name=$ac_result
aa3737e Improved check for GCC's -pthread and -pthreads flag
Sascha Schumann authored
14 rm -f conftest.*
9aef667 Rewrite TSRM_CHECK_GCC_ARG to cache its result
Sascha Schumann authored
15 ])
16 if eval test "\$$gcc_arg_name" = "yes"; then
17 $2
18 else
19 :
20 $3
21 fi
aa3737e Improved check for GCC's -pthread and -pthreads flag
Sascha Schumann authored
22 ])
91549cf Move config code into separate file
Sascha Schumann authored
23
69eec3f MFB_4_3: Quote macro names in AC_DEFUN()
foobar authored
24 AC_DEFUN([TSRM_BASIC_CHECKS],[
91549cf Move config code into separate file
Sascha Schumann authored
25
26 AC_REQUIRE([AC_PROG_CC])dnl
27 dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
28 AC_REQUIRE([AC_PROG_CC_C_O])dnl
29 AC_REQUIRE([AC_PROG_RANLIB])dnl
30
31 AC_CHECK_HEADERS(stdarg.h)
32
33 ])
34
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
35
69eec3f MFB_4_3: Quote macro names in AC_DEFUN()
foobar authored
36 AC_DEFUN([TSRM_CHECK_PTH],[
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
37
38 AC_MSG_CHECKING(for GNU Pth)
39 PTH_PREFIX="`$1 --prefix`"
40 if test -z "$PTH_PREFIX"; then
41 AC_MSG_RESULT(Please check your Pth installation)
42 fi
43
44 CPPFLAGS="$CPPFLAGS `$1 --cflags`"
45 LDFLAGS="$LDFLAGS `$1 --ldflags`"
46 LIBS="$LIBS `$1 --libs`"
47
48 AC_DEFINE(GNUPTH, 1, [Whether you use GNU Pth])
49 AC_MSG_RESULT(yes - installed in $PTH_PREFIX)
50
51 ])
52
69eec3f MFB_4_3: Quote macro names in AC_DEFUN()
foobar authored
53 AC_DEFUN([TSRM_CHECK_ST],[
6ae7e5f Support for SGI's State Threads. Will be used by PHP's thttpd SAPI
Sascha Schumann authored
54 if test -r "$1/include/st.h"; then
55 CPPFLAGS="$CPPFLAGS -I$1/include"
56 LDFLAGS="$LDFLAGS -L$1/lib"
57 elif test -r "$1/st.h"; then
58 CPPFLAGS="$CPPFLAGS -I$1"
59 LDFLAGS="$LDFLAGS -L$1"
60 fi
66187ec nuke whitespace
Sascha Schumann authored
61 AC_CHECK_HEADERS(st.h,[],[
6ae7e5f Support for SGI's State Threads. Will be used by PHP's thttpd SAPI
Sascha Schumann authored
62 AC_MSG_ERROR([Sorry[,] I was unable to locate the State Threads header file. Please specify the prefix using --with-tsrm-st=/prefix])
63 ])
64 LIBS="$LIBS -lst"
65 AC_MSG_CHECKING(for SGI's State Threads)
66 AC_MSG_RESULT(yes)
67 AC_DEFINE(TSRM_ST, 1, [ ])
68 ])
69
05024cb Use improved POSIX threads check from threads.m4
Sascha Schumann authored
70 sinclude(threads.m4)
71 sinclude(TSRM/threads.m4)
a212154 Move the sincludes outside of AC_DEFUN(), so PHP can use the macros
Sascha Schumann authored
72
69eec3f MFB_4_3: Quote macro names in AC_DEFUN()
foobar authored
73 AC_DEFUN([TSRM_CHECK_PTHREADS],[
05024cb Use improved POSIX threads check from threads.m4
Sascha Schumann authored
74
75 PTHREADS_CHECK
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
76
2a0fbde Add BeOS thread support to TSRM. This should not impact on any other …
David Reid authored
77 if test "$beos_threads" = "1"; then
78 AC_DEFINE(BETHREADS, 1, Whether to use native BeOS threads)
79 else
80 if test "$pthreads_working" != "yes"; then
81 AC_MSG_ERROR(Your system seems to lack POSIX threads.)
82 fi
83
84 AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
85
86 AC_MSG_CHECKING(for POSIX threads)
87 AC_MSG_RESULT(yes)
88 fi
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
89 ])
90
91
69eec3f MFB_4_3: Quote macro names in AC_DEFUN()
foobar authored
92 AC_DEFUN([TSRM_THREADS_CHECKS],[
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
93
94 dnl For the thread implementations, we always use --with-*
95 dnl to maintain consistency
96
97 AC_ARG_WITH(tsrm-pth,
db50cd2 Aligned configure help texts.
foobar authored
98 [ --with-tsrm-pth[=pth-config]
99 Use GNU Pth.],[
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
100 TSRM_PTH=$withval
101 ],[
102 TSRM_PTH=no
103 ])
104
6ae7e5f Support for SGI's State Threads. Will be used by PHP's thttpd SAPI
Sascha Schumann authored
105 AC_ARG_WITH(tsrm-st,
db50cd2 Aligned configure help texts.
foobar authored
106 [ --with-tsrm-st Use SGI's State Threads],[
6ae7e5f Support for SGI's State Threads. Will be used by PHP's thttpd SAPI
Sascha Schumann authored
107 TSRM_ST=$withval
108 ],[
109 TSRM_ST=no
110 ])
111
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
112 AC_ARG_WITH(tsrm-pthreads,
113 [ --with-tsrm-pthreads Use POSIX threads (default)],[
114 TSRM_PTHREADS=$withval
115 ],[
116 TSRM_PTHREADS=yes
117 ])
118
119 test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config
120
121 if test "$TSRM_PTH" != "no"; then
122 TSRM_CHECK_PTH($TSRM_PTH)
6ae7e5f Support for SGI's State Threads. Will be used by PHP's thttpd SAPI
Sascha Schumann authored
123 elif test "$TSRM_ST" != "no"; then
124 TSRM_CHECK_ST($TSRM_ST)
fa1f318 Enable TSRM to use Pth
Sascha Schumann authored
125 elif test "$TSRM_PTHREADS" != "no"; then
126 TSRM_CHECK_PTHREADS
127 fi
128
91549cf Move config code into separate file
Sascha Schumann authored
129 ])
Something went wrong with that request. Please try again.