@@ -26,30 +26,28 @@ PHP_ARG_WITH([capstone],
26
26
[ no] )
27
27
28
28
if test "$PHP_OPCACHE" != "no"; then
29
-
30
29
dnl Always build as shared extension
31
30
ext_shared=yes
32
31
33
32
AS_VAR_IF ( [ PHP_HUGE_CODE_PAGES] , [ yes] ,
34
33
[ AC_DEFINE ( [ HAVE_HUGE_CODE_PAGES] , [ 1] ,
35
34
[ Define to 1 to enable copying PHP CODE pages into HUGE PAGES.] ) ] )
36
35
37
- if test "$PHP_OPCACHE_JIT" = "yes"; then
38
- case $host_cpu in
39
- i[ [ 34567] ] 86*|x86*|aarch64|amd64)
40
- ;;
41
- *)
36
+ AS_VAR_IF ( [ PHP_OPCACHE_JIT] , [ yes] , [
37
+ AS_CASE ( [ $host_cpu] ,
38
+ [ [ i[ 34567] 86*|x86*|aarch64|amd64] ] , [ ] ,
39
+ [
42
40
AC_MSG_WARN ( [ JIT not supported by host architecture] )
43
41
PHP_OPCACHE_JIT=no
44
- ;;
45
- esac
42
+ ] )
43
+
46
44
if test "$host_vendor" = "apple" && test "$host_cpu" = "aarch64" && test "$PHP_THREAD_SAFETY" = "yes"; then
47
45
AC_MSG_WARN ( [ JIT not supported on Apple Silicon with ZTS] )
48
46
PHP_OPCACHE_JIT=no
49
47
fi
50
- fi
48
+ ] )
51
49
52
- if test "$ PHP_OPCACHE_JIT" = " yes" ; then
50
+ AS_VAR_IF ( [ PHP_OPCACHE_JIT] , [ yes] , [
53
51
AC_DEFINE ( [ HAVE_JIT] , [ 1] , [ Define to 1 to enable JIT.] )
54
52
ZEND_JIT_SRC=m4_normalize ( [ "
55
53
jit/ir/ir_cfg.c
@@ -70,30 +68,25 @@ if test "$PHP_OPCACHE" != "no"; then
70
68
"] )
71
69
72
70
dnl Find out which ABI we are using.
73
- case $host_alias in
74
- x86_64-*-darwin*)
71
+ AS_CASE ( [ $host_alias] ,
72
+ [ x86_64-*-darwin*] , [
75
73
IR_TARGET=IR_TARGET_X64
76
74
DASM_FLAGS="-D X64APPLE=1 -D X64=1"
77
75
DASM_ARCH="x86"
78
- ;;
79
- *x86_64*|amd64-*-freebsd*)
76
+ ] ,
77
+ [ *x86_64*|amd64-*-freebsd*] , [
80
78
IR_TARGET=IR_TARGET_X64
81
79
DASM_FLAGS="-D X64=1"
82
80
DASM_ARCH="x86"
83
- ;;
84
- i[ [ 34567] ] 86*)
85
- IR_TARGET=IR_TARGET_X86
86
- DASM_ARCH="x86"
87
- ;;
88
- x86*)
81
+ ] ,
82
+ [ [ i[ 34567] 86*|x86*] ] , [
89
83
IR_TARGET=IR_TARGET_X86
90
84
DASM_ARCH="x86"
91
- ;;
92
- aarch64*)
85
+ ] ,
86
+ [ aarch64*] , [
93
87
IR_TARGET=IR_TARGET_AARCH64
94
88
DASM_ARCH="aarch64"
95
- ;;
96
- esac
89
+ ] )
97
90
98
91
AS_VAR_IF ( [ PHP_CAPSTONE] , [ yes] ,
99
92
[ PKG_CHECK_MODULES([ CAPSTONE] , [ capstone >= 3.0.0] , [
@@ -109,12 +102,12 @@ if test "$PHP_OPCACHE" != "no"; then
109
102
110
103
JIT_CFLAGS="-I@ext_builddir@/jit/ir -D$IR_TARGET -DIR_PHP"
111
104
AS_VAR_IF ( [ ZEND_DEBUG] , [ yes] , [ JIT_CFLAGS="$JIT_CFLAGS -DIR_DEBUG"] )
112
- fi
105
+ ] )
113
106
114
107
AC_CHECK_FUNCS ( [ mprotect shm_create_largepage] )
115
108
116
109
AC_CACHE_CHECK ( [ for sysvipc shared memory support] , [ php_cv_shm_ipc] ,
117
- [ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
110
+ [ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [
118
111
#include <sys/types.h>
119
112
#include <sys/wait.h>
120
113
#include <sys/ipc.h>
@@ -178,7 +171,7 @@ int main(void) {
178
171
}
179
172
return 0;
180
173
}
181
- ] ] ) ] ,
174
+ ] ) ] ,
182
175
[ php_cv_shm_ipc=yes] ,
183
176
[ php_cv_shm_ipc=no] ,
184
177
[ php_cv_shm_ipc=no] ) ] )
@@ -188,7 +181,7 @@ AS_VAR_IF([php_cv_shm_ipc], [yes],
188
181
189
182
AC_CACHE_CHECK ( [ for mmap() using MAP_ANON shared memory support] ,
190
183
[ php_cv_shm_mmap_anon] ,
191
- [ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
184
+ [ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [
192
185
#include <sys/types.h>
193
186
#include <sys/wait.h>
194
187
#include <sys/mman.h>
@@ -234,7 +227,7 @@ int main(void) {
234
227
}
235
228
return 0;
236
229
}
237
- ] ] ) ] ,
230
+ ] ) ] ,
238
231
[ php_cv_shm_mmap_anon=yes] ,
239
232
[ php_cv_shm_mmap_anon=no] ,
240
233
[ AS_CASE ( [ $host_alias] ,
@@ -248,7 +241,7 @@ AS_VAR_IF([php_cv_shm_mmap_anon], [yes],
248
241
dnl needed: rt (older Linux and Solaris <= 10). Most systems have it in the C
249
242
dnl standard library (newer Linux, illumos, Solaris 11.4, macOS, BSD-based
250
243
dnl systems...). Haiku has it in the root library, which is linked by default.
251
- LIBS_save=" $LIBS"
244
+ LIBS_save=$LIBS
252
245
LIBS=
253
246
AC_SEARCH_LIBS ( [ shm_open] , [ rt] ,
254
247
[ AC_CACHE_CHECK ( [ for mmap() using shm_open() shared memory support] ,
@@ -321,14 +314,14 @@ int main(void) {
321
314
[ php_cv_shm_mmap_posix=no] )
322
315
] )
323
316
324
- if test "$ php_cv_shm_mmap_posix" = " yes"; then
317
+ AS_VAR_IF ( [ php_cv_shm_mmap_posix] , [ yes] , [
325
318
AS_VAR_IF ( [ ac_cv_search_shm_open] , [ "none required"] ,,
326
319
[ OPCACHE_SHARED_LIBADD="$OPCACHE_SHARED_LIBADD $ac_cv_search_shm_open"] )
327
320
AC_DEFINE ( [ HAVE_SHM_MMAP_POSIX] , [ 1] ,
328
321
[ Define to 1 if you have the POSIX mmap() SHM support.] )
329
- fi
322
+ ] )
330
323
] )
331
- LIBS=" $LIBS_save"
324
+ LIBS=$LIBS_save
332
325
333
326
PHP_NEW_EXTENSION([ opcache] , m4_normalize ( [
334
327
shared_alloc_mmap.c
@@ -356,10 +349,10 @@ int main(void) {
356
349
AC_MSG_FAILURE ( [ No supported shared memory caching support was found when configuring opcache.] )
357
350
fi
358
351
359
- if test "$ PHP_OPCACHE_JIT" = " yes"; then
352
+ AS_VAR_IF ( [ PHP_OPCACHE_JIT] , [ yes] , [
360
353
PHP_ADD_BUILD_DIR([ $ext_builddir/jit] )
361
354
PHP_ADD_BUILD_DIR([ $ext_builddir/jit/ir] )
362
355
PHP_ADD_MAKEFILE_FRAGMENT([ $ext_srcdir/jit/Makefile.frag] )
363
- fi
356
+ ] )
364
357
PHP_SUBST([ OPCACHE_SHARED_LIBADD] )
365
358
fi
0 commit comments