source: trunk/config.m4

Last change on this file was 1555, checked in by moo, 2 weeks ago

separate plain c code to .h files

  • Property svn:eol-style set to native
File size: 4.5 KB
RevLine 
[1]1dnl vim:ts=2:sw=2:expandtab
2
[982]3AC_DEFUN([XCACHE_MODULE], [
[11]4  PHP_ARG_ENABLE(xcache-$1, for XCache $1,
5  [  --enable-xcache-$2    XCache: $4], no, no)
6  if test "$PHP_$3" != "no"; then
[1003]7    xcache_sources="$xcache_sources mod_$1/xc_$1.c"
[26]8    XCACHE_MODULES="$XCACHE_MODULES $1"
[8]9    HAVE_$3=1
[11]10    AC_DEFINE([HAVE_$3], 1, [Define for XCache: $4])
[8]11  else
12    HAVE_$3=
[1]13  fi
14])dnl
15
[11]16PHP_ARG_ENABLE(xcache, for XCache support,
[1345]17[  --enable-xcache         XCache Extension.])
[1]18
19if test "$PHP_XCACHE" != "no"; then
[982]20  PHP_ARG_ENABLE(xcache-constant, for XCache handle of compile time constant,
[95]21  [  --enable-xcache-constant        XCache: Handle new constants made by php compiler (e.g.: for __halt_compiler)], yes, no)
[982]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
[95]25
[1006]26  xcache_sources="xcache.c"
27  for i in \
28xc_trace.c \
29; do
30  xcache_sources="$xcache_sources util/$i"
31done
32  for i in \
[1135]33xc_allocator.c \
34xc_allocator_bestfit.c \
[1026]35xc_compatibility.c \
[1006]36xc_const_string.c \
[1026]37xc_extension.c \
38xc_ini.c \
[1366]39xc_mutex.c \
[1006]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
[1040]49  for i in \
50xc_cacher.c \
51; do
52  xcache_sources="$xcache_sources mod_cacher/$i"
53done
[26]54  XCACHE_MODULES="cacher"
[1040]55  AC_DEFINE([HAVE_XCACHE_CACHER], 1, [Define to enable XCache cacher])
[982]56  XCACHE_MODULE([optimizer],    [optimizer   ], [XCACHE_OPTIMIZER],    [(N/A)])
57  XCACHE_MODULE([coverager],    [coverager   ], [XCACHE_COVERAGER],    [Enable code coverage dumper, useful for testing php scripts])
58  XCACHE_MODULE([assembler],    [assembler   ], [XCACHE_ASSEMBLER],    [(N/A)])
[1004]59  XCACHE_MODULE([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, not for server usage])
[982]60  XCACHE_MODULE([encoder],      [encoder     ], [XCACHE_ENCODER],      [(N/A)])
61  XCACHE_MODULE([decoder],      [decoder     ], [XCACHE_DECODER],      [(N/A)])
[26]62  AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache])
[1]63
[11]64  PHP_ARG_ENABLE(xcache-test, for XCache self test,
65  [  --enable-xcache-test            XCache: Enable self test - FOR DEVELOPERS ONLY!!], no, no)
66  if test "$PHP_XCACHE_TEST" != "no"; then
[1]67    XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
[987]68    xcache_sources="$xcache_sources xcache/xc_malloc.c"
[11]69    AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test])
[1]70  else
71    XCACHE_ENABLE_TEST=
72  fi
73  PHP_SUBST([XCACHE_ENABLE_TEST])
74
[230]75  PHP_ARG_ENABLE(xcache-dprint, for XCache self test,
76  [  --enable-xcache-dprint          XCache: Enable debug print functions - FOR DEVELOPERS ONLY!!], no, no)
77  if test "$PHP_XCACHE_DPRINT" != "no"; then
78    AC_DEFINE([HAVE_XCACHE_DPRINT], 1, [Define to enable XCache debug print functions])
79  fi
80
[478]81  PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared)
[1414]82  for module in $XCACHE_MODULES; do
83    PHP_ADD_BUILD_DIR($ext_builddir/mod_$module)
84  done
[1001]85  PHP_ADD_BUILD_DIR($ext_builddir/util)
86  PHP_ADD_BUILD_DIR($ext_builddir/xcache)
[478]87  PHP_ADD_MAKEFILE_FRAGMENT()
[1011]88  PHP_ADD_MAKEFILE_FRAGMENT($ext_srcdir/Makefile.frag.deps)
[478]89
[355]90  AC_PATH_PROGS([XCACHE_AWK], [gawk awk])
[169]91  dnl clean locale for gawk 3.1.5 assertion bug
[355]92  if echo | LANG=C "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
93    XCACHE_AWK="LANG=C $XCACHE_AWK"
[169]94  else
[355]95    if echo | /usr/bin/env - "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
96      XCACHE_AWK="/usr/bin/env - $XCACHE_AWK"
[169]97    fi
98  fi
[355]99  PHP_SUBST([XCACHE_AWK])
[11]100  AC_PATH_PROGS([M4], [m4])
[410]101  if test "$PHP_XCACHE_TEST" != "no"; then
102    if echo | "$M4" -E > /dev/null 2>&1 ; then
103      M4="$M4 -E"
104    fi
[186]105  fi
[292]106   dnl fix for solaris m4: size of the push-back and argument
107  if echo | "$M4" -B 102400 > /dev/null 2>&1 ; then
108    M4="$M4 -B 102400"
109  fi
[22]110  PHP_SUBST([M4])
[11]111  AC_PATH_PROGS([GREP], [grep])
[22]112  PHP_SUBST([GREP])
[11]113  AC_PATH_PROGS([SED], [sed])
[22]114  PHP_SUBST([SED])
[11]115
116  AC_PATH_PROGS([INDENT], [indent cat])
[87]117  XCACHE_INDENT=cat
[1]118  case $INDENT in
119  */indent[)]
[842]120    XCACHE_INDENT="$INDENT"
121    opts="-kr --use-tabs --tab-size 4"
[36]122    if echo | $INDENT $opts > /dev/null 2>&1 ; then
[842]123      XCACHE_INDENT="$XCACHE_INDENT $opts"
[36]124    fi
[842]125    opts="-sob -nce"
126    if echo | $INDENT $opts > /dev/null 2>&1 ; then
127      XCACHE_INDENT="$XCACHE_INDENT $opts"
128    fi
129    opts="-l 160"
130    if echo | $INDENT $opts > /dev/null 2>&1 ; then
131      XCACHE_INDENT="$XCACHE_INDENT $opts"
132    fi
[1]133    ;;
134  esac
135  PHP_SUBST([XCACHE_INDENT])
136
[8]137  dnl $ac_srcdir etc require PHP_NEW_EXTENSION
[1555]138  XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4 $ac_srcdir/processor/*.h`
[1]139  PHP_SUBST([XCACHE_PROC_SOURCES])
140fi
Note: See TracBrowser for help on using the repository browser.