1
0
Fork 0

make opcode_spec_def.h optional

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@8 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
Xuefer 2006-05-13 03:19:43 +00:00
parent f35684be8b
commit 93e9226d19
5 changed files with 31 additions and 0 deletions

View File

@ -7,7 +7,10 @@ AC_DEFUN([XCACHE_OPTION], [
[ --enable-xcache-$2 XCACHE: $4], no, no)
if test "$PHP_$3" = "yes"; then
xcache_sources="$xcache_sources $1.c"
HAVE_$3=1
AC_DEFINE([HAVE_$3], 1, [Define for XCACHE: $4])
else
HAVE_$3=
fi
])dnl
@ -56,6 +59,23 @@ if test "$PHP_XCACHE" != "no"; then
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 "$HAVE_XCACHE_DISASSEMBLER" = "1" ; then
ERROR(disassembler)
fi
undefine([ERROR])
fi
fi

View File

@ -5,6 +5,9 @@
#define return_value dst
#ifndef HAVE_XCACHE_OPCODE_SPEC_DEF
#error disassembler cannot be built without xcache/opcode_spec_def.h
#endif
static void xc_dasm(zval *dst, zend_op_array *op_array TSRMLS_DC) /* {{{ */
{
Bucket *b;

View File

@ -2,6 +2,7 @@
#include "opcode_spec.h"
#include "const_string.h"
#ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
/* {{{ opcode_spec */
#define OPSPEC(ext, op1, op2, res) { OPSPEC_##ext, OPSPEC_##op1, OPSPEC_##op2, OPSPEC_##res },
#ifdef ZEND_ENGINE_2
@ -23,6 +24,7 @@ const xc_opcode_spec_t *xc_get_opcode_spec(zend_uchar opcode)
return &xc_opcode_spec[opcode];
}
/* }}} */
#endif
/* {{{ op_spec */
#define OPSPECS_DEF_NAME(name) #name,

View File

@ -197,6 +197,7 @@ int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC) /* {{{ */
}
/* }}} */
#ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
static void xc_fix_opcode_ex_znode(int tofix, xc_op_spec_t spec, znode *znode, int type TSRMLS_DC) /* {{{ */
{
#ifdef ZEND_ENGINE_2
@ -261,6 +262,7 @@ int xc_undo_fix_opcode(zend_op_array *op_array TSRMLS_DC) /* {{{ */
return 0;
}
/* }}} */
#endif
void xc_install_function(char *filename, zend_function *func, zend_uchar type, char *key, uint len TSRMLS_DC) /* {{{ */
{

View File

@ -1505,6 +1505,7 @@ PHP_FUNCTION(xcache_get_op_spec)
xc_call_getter(xc_get_op_spec, xc_get_op_spec_count(), INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
#ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
/* {{{ proto string xcache_get_opcode_spec(int opcode) */
PHP_FUNCTION(xcache_get_opcode_spec)
{
@ -1528,6 +1529,7 @@ PHP_FUNCTION(xcache_get_opcode_spec)
RETURN_NULL();
}
/* }}} */
#endif
/* {{{ proto mixed xcache_get_special_value(zval value) */
PHP_FUNCTION(xcache_get_special_value)
{
@ -1600,7 +1602,9 @@ static function_entry xcache_functions[] = /* {{{ */
PHP_FE(xcache_get_op_type, NULL)
PHP_FE(xcache_get_data_type, NULL)
PHP_FE(xcache_get_opcode, NULL)
#ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
PHP_FE(xcache_get_opcode_spec, NULL)
#endif
PHP_FE(xcache_is_autoglobal, NULL)
PHP_FE(xcache_inc, NULL)
PHP_FE(xcache_dec, NULL)