XCache is a fast, stable PHP opcode cacher that has been proven and is now running on production servers under high load. https://xcache.lighttpd.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.0 KiB

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