source: trunk/config.m4 @ 37

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

correct warning for coverager

File size: 3.3 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
20  xcache_sources="processor.c \
21                  xcache.c \
22                  mmap.c \
23                  mem.c \
24                  const_string.c \
25                  opcode_spec.c \
26                  stack.c \
27                  utils.c \
28                  lock.c \
29                  "
[26]30  XCACHE_MODULES="cacher"
[1]31  XCACHE_OPTION([optimizer],    [optimizer   ], [XCACHE_OPTIMIZER],    [(N/A)])
[37]32  XCACHE_OPTION([coverager],    [coverager   ], [XCACHE_COVERAGER],    [Enable code coverage dumper, useful for testing php scripts])
[1]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)])
[26]37  AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache])
[1]38
39  PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared)
40  PHP_ADD_MAKEFILE_FRAGMENT()
41
[11]42  PHP_ARG_ENABLE(xcache-test, for XCache self test,
43  [  --enable-xcache-test            XCache: Enable self test - FOR DEVELOPERS ONLY!!], no, no)
44  if test "$PHP_XCACHE_TEST" != "no"; then
[1]45    XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
[11]46    AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test])
[1]47  else
48    XCACHE_ENABLE_TEST=
49  fi
50  PHP_SUBST([XCACHE_ENABLE_TEST])
51
[11]52  AC_PATH_PROGS([AWK], [gawk awk])
[22]53  PHP_SUBST([AWK])
[11]54  AC_PATH_PROGS([M4], [m4])
[22]55  PHP_SUBST([M4])
[11]56  AC_PATH_PROGS([GREP], [grep])
[22]57  PHP_SUBST([GREP])
[11]58  AC_PATH_PROGS([SED], [sed])
[22]59  PHP_SUBST([SED])
[11]60
61  AC_PATH_PROGS([INDENT], [indent cat])
[1]62  case $INDENT in
63  */indent[)]
[36]64    opts="-kr --use-tabs --tab-size 4 -sob -nce"
65    if echo | $INDENT $opts > /dev/null 2>&1 ; then
66      XCACHE_INDENT="$INDENT $opts"
67    else
68      opts="-sob -nce"
69      if echo | $INDENT $opts > /dev/null 2>&1 ; then
70        XCACHE_INDENT="$INDENT $opts"
71      else
72        if echo | $INDENT > /dev/null 2>&1 ; then
73          XCACHE_INDENT="$INDENT"
74        fi
75      fi
76    fi
[1]77    ;;
78  *[)]
79    XCACHE_INDENT=cat
80    ;;
81  esac
82  PHP_SUBST([XCACHE_INDENT])
83
[8]84  dnl $ac_srcdir etc require PHP_NEW_EXTENSION
[1]85  XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4`
86  PHP_SUBST([XCACHE_PROC_SOURCES])
[8]87
[11]88  AC_MSG_CHECKING(if you have opcode_spec_def.h for XCache)
[8]89  if test -e "$ac_srcdir/opcode_spec_def.h" ; then
[11]90    AC_DEFINE([HAVE_XCACHE_OPCODE_SPEC_DEF], 1, [Define if you have opcode_spec_def.h for XCache])
[8]91    AC_MSG_RESULT(yes)
92  else
93    dnl check for features depend on opcode_spec_def.h
94    AC_MSG_RESULT(no)
95    define([ERROR], [
96      AC_MSG_ERROR([cannot build with $1, $ac_srcdir/opcode_spec_def.h required])
97    ])
[11]98    if test "$PHP_XCACHE_DISASSEMBLER" != "no" ; then
[8]99      ERROR(disassembler)
100    fi
101    undefine([ERROR])
102  fi
[1]103fi
Note: See TracBrowser for help on using the repository browser.