Index: /trunk/config.m4
===================================================================
--- /trunk/config.m4	(revision 7)
+++ /trunk/config.m4	(revision 8)
@@ -8,5 +8,8 @@
   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
@@ -57,5 +60,22 @@
   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
Index: /trunk/disassembler.c
===================================================================
--- /trunk/disassembler.c	(revision 7)
+++ /trunk/disassembler.c	(revision 8)
@@ -6,4 +6,7 @@
 #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) /* {{{ */
 {
Index: /trunk/opcode_spec.c
===================================================================
--- /trunk/opcode_spec.c	(revision 7)
+++ /trunk/opcode_spec.c	(revision 8)
@@ -3,4 +3,5 @@
 #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 },
@@ -24,4 +25,5 @@
 }
 /* }}} */
+#endif
 /* {{{ op_spec */
 
Index: /trunk/utils.c
===================================================================
--- /trunk/utils.c	(revision 7)
+++ /trunk/utils.c	(revision 8)
@@ -198,4 +198,5 @@
 /* }}} */
 
+#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) /* {{{ */
 {
@@ -262,4 +263,5 @@
 }
 /* }}} */
+#endif
 
 void xc_install_function(char *filename, zend_function *func, zend_uchar type, char *key, uint len TSRMLS_DC) /* {{{ */
Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 7)
+++ /trunk/xcache.c	(revision 8)
@@ -1506,4 +1506,5 @@
 }
 /* }}} */
+#ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
 /* {{{ proto string xcache_get_opcode_spec(int opcode) */
 PHP_FUNCTION(xcache_get_opcode_spec)
@@ -1529,4 +1530,5 @@
 }
 /* }}} */
+#endif
 /* {{{ proto mixed xcache_get_special_value(zval value) */
 PHP_FUNCTION(xcache_get_special_value)
@@ -1601,5 +1603,7 @@
 	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)
