source: trunk/config.m4 @ 8

Last change on this file since 8 was 8, checked in by moo, 8 years ago

make opcode_spec_def.h optional

File size: 2.6 KB
RevLine 
[1]1dnl
2dnl $Id:$
3dnl vim:ts=2:sw=2:expandtab
4
5AC_DEFUN([XCACHE_OPTION], [
6  PHP_ARG_ENABLE(xcache-$1, for XCACHE $1,
7  [  --enable-xcache-$2    XCACHE: $4], no, no)
8  if test "$PHP_$3" = "yes"; then
9    xcache_sources="$xcache_sources $1.c"
[8]10    HAVE_$3=1
[1]11    AC_DEFINE([HAVE_$3], 1, [Define for XCACHE: $4])
[8]12  else
13    HAVE_$3=
[1]14  fi
15])dnl
16
17PHP_ARG_ENABLE(xcache, for XCACHE support,
18[  --enable-xcache         Include XCACHE support.])
19
20if test "$PHP_XCACHE" != "no"; then
21  xcache_sources="processor.c \
22                  xcache.c \
23                  mmap.c \
24                  mem.c \
25                  const_string.c \
26                  opcode_spec.c \
27                  stack.c \
28                  utils.c \
29                  lock.c \
30                  "
31  XCACHE_OPTION([optimizer],    [optimizer   ], [XCACHE_OPTIMIZER],    [(N/A)])
32  XCACHE_OPTION([coverage],     [coverage    ], [XCACHE_COVERAGE],     [Enable code coverage dumper, NOT for production server])
33  XCACHE_OPTION([assembler],    [assembler   ], [XCACHE_ASSEMBLER],    [(N/A)])
34  XCACHE_OPTION([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, NOT for production server])
35  XCACHE_OPTION([encoder],      [encoder     ], [XCACHE_ENCODER],      [(N/A)])
36  XCACHE_OPTION([decoder],      [decoder     ], [XCACHE_DECODER],      [(N/A)])
37
38  PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared)
39  PHP_ADD_MAKEFILE_FRAGMENT()
40
41  PHP_ARG_ENABLE(xcache-test, for XCACHE self test,
42  [  --enable-xcache-test            XCACHE: Enable self test - FOR DEVELOPERS ONLY!!], no, no)
43  if test "$PHP_XCACHE_TEST" = "yes"; then
44    XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
45    AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCACHE self test])
46  else
47    XCACHE_ENABLE_TEST=
48  fi
49  PHP_SUBST([XCACHE_ENABLE_TEST])
50
51  AC_PATH_PROGS(INDENT, [indent cat])
52  case $INDENT in
53  */indent[)]
54    XCACHE_INDENT="$INDENT -kr --use-tabs --tab-size 4 -sob -nce"
55    ;;
56  *[)]
57    XCACHE_INDENT=cat
58    ;;
59  esac
60  PHP_SUBST([XCACHE_INDENT])
61
[8]62  dnl $ac_srcdir etc require PHP_NEW_EXTENSION
[1]63  XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4`
64  PHP_SUBST([XCACHE_PROC_SOURCES])
[8]65
66  AC_MSG_CHECKING(if you have opcode_spec_def.h for xcache)
67  if test -e "$ac_srcdir/opcode_spec_def.h" ; then
68    AC_DEFINE([HAVE_XCACHE_OPCODE_SPEC_DEF], 1, [Define if you have opcode_spec_def.h for xcache])
69    AC_MSG_RESULT(yes)
70  else
71    dnl check for features depend on opcode_spec_def.h
72    AC_MSG_RESULT(no)
73    define([ERROR], [
74      AC_MSG_ERROR([cannot build with $1, $ac_srcdir/opcode_spec_def.h required])
75    ])
76    if test "$HAVE_XCACHE_DISASSEMBLER" = "1" ; then
77      ERROR(disassembler)
78    fi
79    undefine([ERROR])
80  fi
[1]81fi
Note: See TracBrowser for help on using the repository browser.