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