source: trunk/config.m4 @ 1026

Last change on this file since 1026 was 1026, checked in by moo, 2 years ago

refactor: split extension init to sub module. TODO: compatibility regression

  • Property svn:eol-style set to native
File size: 4.4 KB
Line 
1dnl vim:ts=2:sw=2:expandtab
2
3AC_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 mod_$1/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
16PHP_ARG_ENABLE(xcache, for XCache support,
17[  --enable-xcache         Include XCache support.])
18
19if 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="xcache.c"
27  for i in \
28xc_stack.c \
29xc_trace.c \
30; do
31  xcache_sources="$xcache_sources util/$i"
32done
33  for i in \
34xc_compatibility.c \
35xc_const_string.c \
36xc_extension.c \
37xc_ini.c \
38xc_lock.c \
39xc_mem.c \
40xc_opcode_spec.c \
41xc_processor.c \
42xc_sandbox.c \
43xc_shm.c \
44xc_shm_mmap.c \
45xc_utils.c \
46; do
47  xcache_sources="$xcache_sources xcache/$i"
48done
49  XCACHE_MODULES="cacher"
50  XCACHE_MODULE([optimizer],    [optimizer   ], [XCACHE_OPTIMIZER],    [(N/A)])
51  XCACHE_MODULE([coverager],    [coverager   ], [XCACHE_COVERAGER],    [Enable code coverage dumper, useful for testing php scripts])
52  XCACHE_MODULE([assembler],    [assembler   ], [XCACHE_ASSEMBLER],    [(N/A)])
53  XCACHE_MODULE([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, not for server usage])
54  XCACHE_MODULE([encoder],      [encoder     ], [XCACHE_ENCODER],      [(N/A)])
55  XCACHE_MODULE([decoder],      [decoder     ], [XCACHE_DECODER],      [(N/A)])
56  AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache])
57
58  PHP_ARG_ENABLE(xcache-test, for XCache self test,
59  [  --enable-xcache-test            XCache: Enable self test - FOR DEVELOPERS ONLY!!], no, no)
60  if test "$PHP_XCACHE_TEST" != "no"; then
61    XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
62    xcache_sources="$xcache_sources xcache/xc_malloc.c"
63    AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test])
64  else
65    XCACHE_ENABLE_TEST=
66  fi
67  PHP_SUBST([XCACHE_ENABLE_TEST])
68
69  PHP_ARG_ENABLE(xcache-dprint, for XCache self test,
70  [  --enable-xcache-dprint          XCache: Enable debug print functions - FOR DEVELOPERS ONLY!!], no, no)
71  if test "$PHP_XCACHE_DPRINT" != "no"; then
72    AC_DEFINE([HAVE_XCACHE_DPRINT], 1, [Define to enable XCache debug print functions])
73  fi
74
75  PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared)
76  PHP_ADD_BUILD_DIR($ext_builddir/util)
77  PHP_ADD_BUILD_DIR($ext_builddir/xcache)
78  PHP_ADD_BUILD_DIR($ext_builddir/submodules)
79  PHP_ADD_MAKEFILE_FRAGMENT()
80  PHP_ADD_MAKEFILE_FRAGMENT($ext_srcdir/Makefile.frag.deps)
81
82  AC_PATH_PROGS([XCACHE_AWK], [gawk awk])
83  dnl clean locale for gawk 3.1.5 assertion bug
84  if echo | LANG=C "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
85    XCACHE_AWK="LANG=C $XCACHE_AWK"
86  else
87    if echo | /usr/bin/env - "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
88      XCACHE_AWK="/usr/bin/env - $XCACHE_AWK"
89    fi
90  fi
91  PHP_SUBST([XCACHE_AWK])
92  AC_PATH_PROGS([M4], [m4])
93  if test "$PHP_XCACHE_TEST" != "no"; then
94    if echo | "$M4" -E > /dev/null 2>&1 ; then
95      M4="$M4 -E"
96    fi
97  fi
98   dnl fix for solaris m4: size of the push-back and argument
99  if echo | "$M4" -B 102400 > /dev/null 2>&1 ; then
100    M4="$M4 -B 102400"
101  fi
102  PHP_SUBST([M4])
103  XCACHE_BACKTICK="'"'`'"'"
104  PHP_SUBST([XCACHE_BACKTICK])
105  AC_PATH_PROGS([GREP], [grep])
106  PHP_SUBST([GREP])
107  AC_PATH_PROGS([SED], [sed])
108  PHP_SUBST([SED])
109
110  AC_PATH_PROGS([INDENT], [indent cat])
111  XCACHE_INDENT=cat
112  case $INDENT in
113  */indent[)]
114    XCACHE_INDENT="$INDENT"
115    opts="-kr --use-tabs --tab-size 4"
116    if echo | $INDENT $opts > /dev/null 2>&1 ; then
117      XCACHE_INDENT="$XCACHE_INDENT $opts"
118    fi
119    opts="-sob -nce"
120    if echo | $INDENT $opts > /dev/null 2>&1 ; then
121      XCACHE_INDENT="$XCACHE_INDENT $opts"
122    fi
123    opts="-l 160"
124    if echo | $INDENT $opts > /dev/null 2>&1 ; then
125      XCACHE_INDENT="$XCACHE_INDENT $opts"
126    fi
127    ;;
128  esac
129  PHP_SUBST([XCACHE_INDENT])
130
131  dnl $ac_srcdir etc require PHP_NEW_EXTENSION
132  XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4`
133  PHP_SUBST([XCACHE_PROC_SOURCES])
134fi
Note: See TracBrowser for help on using the repository browser.