source: trunk/config.m4 @ 11

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

make it build on windows vc compiler

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