2006-05-09 10:58:38 +00:00
|
|
|
dnl vim:ts=2:sw=2:expandtab
|
|
|
|
|
|
|
|
AC_DEFUN([XCACHE_OPTION], [
|
2006-05-24 07:52:48 +00:00
|
|
|
PHP_ARG_ENABLE(xcache-$1, for XCache $1,
|
|
|
|
[ --enable-xcache-$2 XCache: $4], no, no)
|
|
|
|
if test "$PHP_$3" != "no"; then
|
2006-05-09 10:58:38 +00:00
|
|
|
xcache_sources="$xcache_sources $1.c"
|
2006-05-26 02:28:17 +00:00
|
|
|
XCACHE_MODULES="$XCACHE_MODULES $1"
|
2006-05-13 03:19:43 +00:00
|
|
|
HAVE_$3=1
|
2006-05-24 07:52:48 +00:00
|
|
|
AC_DEFINE([HAVE_$3], 1, [Define for XCache: $4])
|
2006-05-13 03:19:43 +00:00
|
|
|
else
|
|
|
|
HAVE_$3=
|
2006-05-09 10:58:38 +00:00
|
|
|
fi
|
|
|
|
])dnl
|
|
|
|
|
2006-05-24 07:52:48 +00:00
|
|
|
PHP_ARG_ENABLE(xcache, for XCache support,
|
|
|
|
[ --enable-xcache Include XCache support.])
|
2006-05-09 10:58:38 +00:00
|
|
|
|
|
|
|
if test "$PHP_XCACHE" != "no"; then
|
2006-07-16 11:07:57 +00:00
|
|
|
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
|
|
|
|
|
2006-05-09 10:58:38 +00:00
|
|
|
xcache_sources="processor.c \
|
|
|
|
xcache.c \
|
|
|
|
mmap.c \
|
|
|
|
mem.c \
|
2006-09-09 00:56:44 +00:00
|
|
|
xc_malloc.c \
|
|
|
|
xc_shm.c \
|
2006-05-09 10:58:38 +00:00
|
|
|
const_string.c \
|
|
|
|
opcode_spec.c \
|
|
|
|
stack.c \
|
|
|
|
utils.c \
|
|
|
|
lock.c \
|
|
|
|
"
|
2006-05-26 02:28:17 +00:00
|
|
|
XCACHE_MODULES="cacher"
|
2006-05-09 10:58:38 +00:00
|
|
|
XCACHE_OPTION([optimizer], [optimizer ], [XCACHE_OPTIMIZER], [(N/A)])
|
2006-05-27 10:47:50 +00:00
|
|
|
XCACHE_OPTION([coverager], [coverager ], [XCACHE_COVERAGER], [Enable code coverage dumper, useful for testing php scripts])
|
2006-05-09 10:58:38 +00:00
|
|
|
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)])
|
2006-05-26 02:28:17 +00:00
|
|
|
AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache])
|
2006-05-09 10:58:38 +00:00
|
|
|
|
|
|
|
PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared)
|
|
|
|
PHP_ADD_MAKEFILE_FRAGMENT()
|
|
|
|
|
2006-05-24 07:52:48 +00:00
|
|
|
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
|
2006-05-09 10:58:38 +00:00
|
|
|
XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
|
2006-05-24 07:52:48 +00:00
|
|
|
AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test])
|
2006-05-09 10:58:38 +00:00
|
|
|
else
|
|
|
|
XCACHE_ENABLE_TEST=
|
|
|
|
fi
|
|
|
|
PHP_SUBST([XCACHE_ENABLE_TEST])
|
|
|
|
|
2006-10-10 00:31:50 +00:00
|
|
|
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
|
|
|
|
|
2007-02-15 11:46:05 +00:00
|
|
|
AC_PATH_PROGS([XCACHE_AWK], [gawk awk])
|
2006-09-16 01:09:22 +00:00
|
|
|
dnl clean locale for gawk 3.1.5 assertion bug
|
2007-02-15 11:46:05 +00:00
|
|
|
if echo | LANG=C "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
|
|
|
|
XCACHE_AWK="LANG=C $XCACHE_AWK"
|
2006-09-16 01:09:22 +00:00
|
|
|
else
|
2007-02-15 11:46:05 +00:00
|
|
|
if echo | /usr/bin/env - "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
|
|
|
|
XCACHE_AWK="/usr/bin/env - $XCACHE_AWK"
|
2006-09-16 01:09:22 +00:00
|
|
|
fi
|
|
|
|
fi
|
2007-02-15 11:46:05 +00:00
|
|
|
PHP_SUBST([XCACHE_AWK])
|
2006-05-24 07:52:48 +00:00
|
|
|
AC_PATH_PROGS([M4], [m4])
|
2006-09-19 00:35:40 +00:00
|
|
|
if echo | "$M4" -E > /dev/null 2>&1 ; then
|
|
|
|
M4="$M4 -E"
|
2006-12-02 02:28:29 +00:00
|
|
|
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"
|
2006-09-19 00:35:40 +00:00
|
|
|
fi
|
2006-05-25 06:49:48 +00:00
|
|
|
PHP_SUBST([M4])
|
2006-05-24 07:52:48 +00:00
|
|
|
AC_PATH_PROGS([GREP], [grep])
|
2006-05-25 06:49:48 +00:00
|
|
|
PHP_SUBST([GREP])
|
2006-05-24 07:52:48 +00:00
|
|
|
AC_PATH_PROGS([SED], [sed])
|
2006-05-25 06:49:48 +00:00
|
|
|
PHP_SUBST([SED])
|
2006-05-24 07:52:48 +00:00
|
|
|
|
|
|
|
AC_PATH_PROGS([INDENT], [indent cat])
|
2006-07-09 12:31:17 +00:00
|
|
|
XCACHE_INDENT=cat
|
2006-05-09 10:58:38 +00:00
|
|
|
case $INDENT in
|
|
|
|
*/indent[)]
|
2006-05-27 10:37:10 +00:00
|
|
|
opts="-kr --use-tabs --tab-size 4 -sob -nce"
|
|
|
|
if echo | $INDENT $opts > /dev/null 2>&1 ; then
|
|
|
|
XCACHE_INDENT="$INDENT $opts"
|
|
|
|
else
|
|
|
|
opts="-sob -nce"
|
|
|
|
if echo | $INDENT $opts > /dev/null 2>&1 ; then
|
|
|
|
XCACHE_INDENT="$INDENT $opts"
|
|
|
|
else
|
|
|
|
if echo | $INDENT > /dev/null 2>&1 ; then
|
|
|
|
XCACHE_INDENT="$INDENT"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2006-05-09 10:58:38 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
PHP_SUBST([XCACHE_INDENT])
|
|
|
|
|
2006-05-13 03:19:43 +00:00
|
|
|
dnl $ac_srcdir etc require PHP_NEW_EXTENSION
|
2006-05-09 10:58:38 +00:00
|
|
|
XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4`
|
|
|
|
PHP_SUBST([XCACHE_PROC_SOURCES])
|
2006-05-13 03:19:43 +00:00
|
|
|
|
2006-05-24 07:52:48 +00:00
|
|
|
AC_MSG_CHECKING(if you have opcode_spec_def.h for XCache)
|
2006-05-13 03:19:43 +00:00
|
|
|
if test -e "$ac_srcdir/opcode_spec_def.h" ; then
|
2006-05-24 07:52:48 +00:00
|
|
|
AC_DEFINE([HAVE_XCACHE_OPCODE_SPEC_DEF], 1, [Define if you have opcode_spec_def.h for XCache])
|
2006-05-13 03:19:43 +00:00
|
|
|
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])
|
|
|
|
])
|
2006-05-24 07:52:48 +00:00
|
|
|
if test "$PHP_XCACHE_DISASSEMBLER" != "no" ; then
|
2006-05-13 03:19:43 +00:00
|
|
|
ERROR(disassembler)
|
|
|
|
fi
|
|
|
|
undefine([ERROR])
|
|
|
|
fi
|
2006-05-09 10:58:38 +00:00
|
|
|
fi
|