source: trunk/config.m4 @ 694

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

fix quote for gnu win32 native tools

  • Property svn:eol-style set to native
File size: 4.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                  xc_shm.c \
31                  const_string.c \
32                  opcode_spec.c \
33                  stack.c \
34                  utils.c \
35                  lock.c \
36                  "
37  XCACHE_MODULES="cacher"
38  XCACHE_OPTION([optimizer],    [optimizer   ], [XCACHE_OPTIMIZER],    [(N/A)])
39  XCACHE_OPTION([coverager],    [coverager   ], [XCACHE_COVERAGER],    [Enable code coverage dumper, useful for testing php scripts])
40  XCACHE_OPTION([assembler],    [assembler   ], [XCACHE_ASSEMBLER],    [(N/A)])
41  XCACHE_OPTION([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, NOT for production server])
42  XCACHE_OPTION([encoder],      [encoder     ], [XCACHE_ENCODER],      [(N/A)])
43  XCACHE_OPTION([decoder],      [decoder     ], [XCACHE_DECODER],      [(N/A)])
44  AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache])
45
46  PHP_ARG_ENABLE(xcache-test, for XCache self test,
47  [  --enable-xcache-test            XCache: Enable self test - FOR DEVELOPERS ONLY!!], no, no)
48  if test "$PHP_XCACHE_TEST" != "no"; then
49    XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
50    xcache_sources="$xcache_sources xc_malloc.c"
51    AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test])
52  else
53    XCACHE_ENABLE_TEST=
54  fi
55  PHP_SUBST([XCACHE_ENABLE_TEST])
56
57  PHP_ARG_ENABLE(xcache-dprint, for XCache self test,
58  [  --enable-xcache-dprint          XCache: Enable debug print functions - FOR DEVELOPERS ONLY!!], no, no)
59  if test "$PHP_XCACHE_DPRINT" != "no"; then
60    AC_DEFINE([HAVE_XCACHE_DPRINT], 1, [Define to enable XCache debug print functions])
61  fi
62
63  PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared)
64  PHP_ADD_MAKEFILE_FRAGMENT()
65
66  AC_PATH_PROGS([XCACHE_AWK], [gawk awk])
67  dnl clean locale for gawk 3.1.5 assertion bug
68  if echo | LANG=C "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
69    XCACHE_AWK="LANG=C $XCACHE_AWK"
70  else
71    if echo | /usr/bin/env - "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
72      XCACHE_AWK="/usr/bin/env - $XCACHE_AWK"
73    fi
74  fi
75  PHP_SUBST([XCACHE_AWK])
76  AC_PATH_PROGS([M4], [m4])
77  if test "$PHP_XCACHE_TEST" != "no"; then
78    if echo | "$M4" -E > /dev/null 2>&1 ; then
79      M4="$M4 -E"
80    fi
81  fi
82   dnl fix for solaris m4: size of the push-back and argument
83  if echo | "$M4" -B 102400 > /dev/null 2>&1 ; then
84    M4="$M4 -B 102400"
85  fi
86  PHP_SUBST([M4])
87  XCACHE_BACKTICK="'"'`'"'"
88  PHP_SUBST([XCACHE_BACKTICK])
89  AC_PATH_PROGS([GREP], [grep])
90  PHP_SUBST([GREP])
91  AC_PATH_PROGS([SED], [sed])
92  PHP_SUBST([SED])
93
94  AC_PATH_PROGS([INDENT], [indent cat])
95  XCACHE_INDENT=cat
96  case $INDENT in
97  */indent[)]
98    opts="-kr --use-tabs --tab-size 4 -sob -nce"
99    if echo | $INDENT $opts > /dev/null 2>&1 ; then
100      XCACHE_INDENT="$INDENT $opts"
101    else
102      opts="-sob -nce"
103      if echo | $INDENT $opts > /dev/null 2>&1 ; then
104        XCACHE_INDENT="$INDENT $opts"
105      else
106        if echo | $INDENT > /dev/null 2>&1 ; then
107          XCACHE_INDENT="$INDENT"
108        fi
109      fi
110    fi
111    ;;
112  esac
113  PHP_SUBST([XCACHE_INDENT])
114
115  dnl $ac_srcdir etc require PHP_NEW_EXTENSION
116  XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4`
117  PHP_SUBST([XCACHE_PROC_SOURCES])
118
119  AC_MSG_CHECKING(if you have opcode_spec_def.h for XCache)
120  if test -e "$ac_srcdir/opcode_spec_def.h" ; then
121    AC_DEFINE([HAVE_XCACHE_OPCODE_SPEC_DEF], 1, [Define if you have opcode_spec_def.h for XCache])
122    AC_MSG_RESULT(yes)
123  else
124    dnl check for features depend on opcode_spec_def.h
125    AC_MSG_RESULT(no)
126    define([ERROR], [
127      AC_MSG_ERROR([cannot build with $1, $ac_srcdir/opcode_spec_def.h required])
128    ])
129    if test "$PHP_XCACHE_DISASSEMBLER" != "no" ; then
130      ERROR(disassembler)
131    fi
132    undefine([ERROR])
133  fi
134fi
Note: See TracBrowser for help on using the repository browser.