source: svn/trunk/config.m4 @ 186

Last change on this file since 186 was 186, checked in by Xuefer, 10 years ago

added argument "stop execution after first warning" for m4 to fail if anything wrong in structinfo.m4. our m4 scripts is warning free

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