source: trunk/config.m4 @ 1473

Last change on this file since 1473 was 1473, checked in by moo, 10 months ago

processor: avoid using srcdir dstdir marco for m4

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