source: trunk/config.m4 @ 1004

Last change on this file since 1004 was 1004, checked in by moo, 21 months ago

refactor: fix win32 build. improve help a little bit

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