source: trunk/config.m4 @ 95

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

fixed #20, default: --enable-xcache-constant=yes

File size: 3.6 KB
Line 
1dnl vim:ts=2:sw=2:expandtab
2
3AC_DEFUN([XCACHE_OPTION], [
4  PHP_ARG_ENABLE(xcache-$1, for XCache $1,
5  [  --enable-xcache-$2    XCache: $4], no, no)
6  if test "$PHP_$3" != "no"; then
7    xcache_sources="$xcache_sources $1.c"
8    XCACHE_MODULES="$XCACHE_MODULES $1"
9    HAVE_$3=1
10    AC_DEFINE([HAVE_$3], 1, [Define for XCache: $4])
11  else
12    HAVE_$3=
13  fi
14])dnl
15
16PHP_ARG_ENABLE(xcache, for XCache support,
17[  --enable-xcache         Include XCache support.])
18
19if test "$PHP_XCACHE" != "no"; then
20    PHP_ARG_ENABLE(xcache-constant, for XCache handle of compile time constant,
21  [  --enable-xcache-constant        XCache: Handle new constants made by php compiler (e.g.: for __halt_compiler)], yes, no)
22    if test "$PHP_XCACHE_CONSTANT" != "no"; then
23        AC_DEFINE([HAVE_XCACHE_CONSTANT], 1, [Define to enable XCache handling of compile time constants])
24    fi
25
26  xcache_sources="processor.c \
27                  xcache.c \
28                  mmap.c \
29                  mem.c \
30                  const_string.c \
31                  opcode_spec.c \
32                  stack.c \
33                  utils.c \
34                  lock.c \
35                  "
36  XCACHE_MODULES="cacher"
37  XCACHE_OPTION([optimizer],    [optimizer   ], [XCACHE_OPTIMIZER],    [(N/A)])
38  XCACHE_OPTION([coverager],    [coverager   ], [XCACHE_COVERAGER],    [Enable code coverage dumper, useful for testing php scripts])
39  XCACHE_OPTION([assembler],    [assembler   ], [XCACHE_ASSEMBLER],    [(N/A)])
40  XCACHE_OPTION([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, NOT for production server])
41  XCACHE_OPTION([encoder],      [encoder     ], [XCACHE_ENCODER],      [(N/A)])
42  XCACHE_OPTION([decoder],      [decoder     ], [XCACHE_DECODER],      [(N/A)])
43  AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache])
44
45  PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared)
46  PHP_ADD_MAKEFILE_FRAGMENT()
47
48  PHP_ARG_ENABLE(xcache-test, for XCache self test,
49  [  --enable-xcache-test            XCache: Enable self test - FOR DEVELOPERS ONLY!!], no, no)
50  if test "$PHP_XCACHE_TEST" != "no"; then
51    XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
52    AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test])
53  else
54    XCACHE_ENABLE_TEST=
55  fi
56  PHP_SUBST([XCACHE_ENABLE_TEST])
57
58  AC_PATH_PROGS([AWK], [gawk awk])
59  PHP_SUBST([AWK])
60  AC_PATH_PROGS([M4], [m4])
61  PHP_SUBST([M4])
62  AC_PATH_PROGS([GREP], [grep])
63  PHP_SUBST([GREP])
64  AC_PATH_PROGS([SED], [sed])
65  PHP_SUBST([SED])
66
67  AC_PATH_PROGS([INDENT], [indent cat])
68  XCACHE_INDENT=cat
69  case $INDENT in
70  */indent[)]
71    opts="-kr --use-tabs --tab-size 4 -sob -nce"
72    if echo | $INDENT $opts > /dev/null 2>&1 ; then
73      XCACHE_INDENT="$INDENT $opts"
74    else
75      opts="-sob -nce"
76      if echo | $INDENT $opts > /dev/null 2>&1 ; then
77        XCACHE_INDENT="$INDENT $opts"
78      else
79        if echo | $INDENT > /dev/null 2>&1 ; then
80          XCACHE_INDENT="$INDENT"
81        fi
82      fi
83    fi
84    ;;
85  esac
86  PHP_SUBST([XCACHE_INDENT])
87
88  dnl $ac_srcdir etc require PHP_NEW_EXTENSION
89  XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4`
90  PHP_SUBST([XCACHE_PROC_SOURCES])
91
92  AC_MSG_CHECKING(if you have opcode_spec_def.h for XCache)
93  if test -e "$ac_srcdir/opcode_spec_def.h" ; then
94    AC_DEFINE([HAVE_XCACHE_OPCODE_SPEC_DEF], 1, [Define if you have opcode_spec_def.h for XCache])
95    AC_MSG_RESULT(yes)
96  else
97    dnl check for features depend on opcode_spec_def.h
98    AC_MSG_RESULT(no)
99    define([ERROR], [
100      AC_MSG_ERROR([cannot build with $1, $ac_srcdir/opcode_spec_def.h required])
101    ])
102    if test "$PHP_XCACHE_DISASSEMBLER" != "no" ; then
103      ERROR(disassembler)
104    fi
105    undefine([ERROR])
106  fi
107fi
Note: See TracBrowser for help on using the repository browser.