1 | dnl vim:ts=2:sw=2:expandtab |
---|
2 | |
---|
3 | AC_DEFUN([XCACHE_MODULE], [ |
---|
4 | PHP_ARG_ENABLE(xcache-$1, for XCache $1, |
---|
5 | [ --enable-xcache-$2 XCache: $4], no, no) |
---|
6 | if test "$PHP_$3" != "no"; then |
---|
7 | xcache_sources="$xcache_sources submodules/xc_$1.c" |
---|
8 | XCACHE_MODULES="$XCACHE_MODULES $1" |
---|
9 | HAVE_$3=1 |
---|
10 | AC_DEFINE([HAVE_$3], 1, [Define for XCache: $4]) |
---|
11 | else |
---|
12 | HAVE_$3= |
---|
13 | fi |
---|
14 | ])dnl |
---|
15 | |
---|
16 | PHP_ARG_ENABLE(xcache, for XCache support, |
---|
17 | [ --enable-xcache Include XCache support.]) |
---|
18 | |
---|
19 | if test "$PHP_XCACHE" != "no"; then |
---|
20 | PHP_ARG_ENABLE(xcache-constant, for XCache handle of compile time constant, |
---|
21 | [ --enable-xcache-constant XCache: Handle new constants made by php compiler (e.g.: for __halt_compiler)], yes, no) |
---|
22 | if test "$PHP_XCACHE_CONSTANT" != "no"; then |
---|
23 | AC_DEFINE([HAVE_XCACHE_CONSTANT], 1, [Define to enable XCache handling of compile time constants]) |
---|
24 | fi |
---|
25 | |
---|
26 | xcache_sources=" |
---|
27 | main/xc_const_string.c \ |
---|
28 | main/xc_lock.c \ |
---|
29 | main/xc_mem.c \ |
---|
30 | main/xc_opcode_spec.c \ |
---|
31 | main/xc_processor.c \ |
---|
32 | main/xc_shm.c \ |
---|
33 | main/xc_shm_mmap.c \ |
---|
34 | main/xc_utils.c \ |
---|
35 | util/xc_stack.c \ |
---|
36 | xcache.c \ |
---|
37 | " |
---|
38 | XCACHE_MODULES="cacher" |
---|
39 | XCACHE_MODULE([optimizer], [optimizer ], [XCACHE_OPTIMIZER], [(N/A)]) |
---|
40 | XCACHE_MODULE([coverager], [coverager ], [XCACHE_COVERAGER], [Enable code coverage dumper, useful for testing php scripts]) |
---|
41 | XCACHE_MODULE([assembler], [assembler ], [XCACHE_ASSEMBLER], [(N/A)]) |
---|
42 | XCACHE_MODULE([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, NOT for production server]) |
---|
43 | XCACHE_MODULE([encoder], [encoder ], [XCACHE_ENCODER], [(N/A)]) |
---|
44 | XCACHE_MODULE([decoder], [decoder ], [XCACHE_DECODER], [(N/A)]) |
---|
45 | AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache]) |
---|
46 | |
---|
47 | PHP_ARG_ENABLE(xcache-test, for XCache self test, |
---|
48 | [ --enable-xcache-test XCache: Enable self test - FOR DEVELOPERS ONLY!!], no, no) |
---|
49 | if test "$PHP_XCACHE_TEST" != "no"; then |
---|
50 | XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST |
---|
51 | xcache_sources="$xcache_sources main/xc_malloc.c" |
---|
52 | AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test]) |
---|
53 | else |
---|
54 | XCACHE_ENABLE_TEST= |
---|
55 | fi |
---|
56 | PHP_SUBST([XCACHE_ENABLE_TEST]) |
---|
57 | |
---|
58 | PHP_ARG_ENABLE(xcache-dprint, for XCache self test, |
---|
59 | [ --enable-xcache-dprint XCache: Enable debug print functions - FOR DEVELOPERS ONLY!!], no, no) |
---|
60 | if test "$PHP_XCACHE_DPRINT" != "no"; then |
---|
61 | AC_DEFINE([HAVE_XCACHE_DPRINT], 1, [Define to enable XCache debug print functions]) |
---|
62 | fi |
---|
63 | |
---|
64 | PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared) |
---|
65 | PHP_ADD_MAKEFILE_FRAGMENT() |
---|
66 | |
---|
67 | AC_PATH_PROGS([XCACHE_AWK], [gawk awk]) |
---|
68 | dnl clean locale for gawk 3.1.5 assertion bug |
---|
69 | if echo | LANG=C "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then |
---|
70 | XCACHE_AWK="LANG=C $XCACHE_AWK" |
---|
71 | else |
---|
72 | if echo | /usr/bin/env - "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then |
---|
73 | XCACHE_AWK="/usr/bin/env - $XCACHE_AWK" |
---|
74 | fi |
---|
75 | fi |
---|
76 | PHP_SUBST([XCACHE_AWK]) |
---|
77 | AC_PATH_PROGS([M4], [m4]) |
---|
78 | if test "$PHP_XCACHE_TEST" != "no"; then |
---|
79 | if echo | "$M4" -E > /dev/null 2>&1 ; then |
---|
80 | M4="$M4 -E" |
---|
81 | fi |
---|
82 | fi |
---|
83 | dnl fix for solaris m4: size of the push-back and argument |
---|
84 | if echo | "$M4" -B 102400 > /dev/null 2>&1 ; then |
---|
85 | M4="$M4 -B 102400" |
---|
86 | fi |
---|
87 | PHP_SUBST([M4]) |
---|
88 | XCACHE_BACKTICK="'"'`'"'" |
---|
89 | PHP_SUBST([XCACHE_BACKTICK]) |
---|
90 | AC_PATH_PROGS([GREP], [grep]) |
---|
91 | PHP_SUBST([GREP]) |
---|
92 | AC_PATH_PROGS([SED], [sed]) |
---|
93 | PHP_SUBST([SED]) |
---|
94 | |
---|
95 | AC_PATH_PROGS([INDENT], [indent cat]) |
---|
96 | XCACHE_INDENT=cat |
---|
97 | case $INDENT in |
---|
98 | */indent[)] |
---|
99 | XCACHE_INDENT="$INDENT" |
---|
100 | opts="-kr --use-tabs --tab-size 4" |
---|
101 | if echo | $INDENT $opts > /dev/null 2>&1 ; then |
---|
102 | XCACHE_INDENT="$XCACHE_INDENT $opts" |
---|
103 | fi |
---|
104 | opts="-sob -nce" |
---|
105 | if echo | $INDENT $opts > /dev/null 2>&1 ; then |
---|
106 | XCACHE_INDENT="$XCACHE_INDENT $opts" |
---|
107 | fi |
---|
108 | opts="-l 160" |
---|
109 | if echo | $INDENT $opts > /dev/null 2>&1 ; then |
---|
110 | XCACHE_INDENT="$XCACHE_INDENT $opts" |
---|
111 | fi |
---|
112 | ;; |
---|
113 | esac |
---|
114 | PHP_SUBST([XCACHE_INDENT]) |
---|
115 | |
---|
116 | dnl $ac_srcdir etc require PHP_NEW_EXTENSION |
---|
117 | XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4` |
---|
118 | PHP_SUBST([XCACHE_PROC_SOURCES]) |
---|
119 | fi |
---|