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.2 KiB

  1. dnl vim:ts=2:sw=2:expandtab
  2. AC_DEFUN([XCACHE_MODULE], [
  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 submodules/xc_$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="
  23. main/xc_const_string.c \
  24. main/xc_lock.c \
  25. main/xc_mem.c \
  26. main/xc_opcode_spec.c \
  27. main/xc_processor.c \
  28. main/xc_shm.c \
  29. main/xc_shm_mmap.c \
  30. main/xc_utils.c \
  31. util/xc_stack.c \
  32. xcache.c \
  33. "
  34. XCACHE_MODULES="cacher"
  35. XCACHE_MODULE([optimizer], [optimizer ], [XCACHE_OPTIMIZER], [(N/A)])
  36. XCACHE_MODULE([coverager], [coverager ], [XCACHE_COVERAGER], [Enable code coverage dumper, useful for testing php scripts])
  37. XCACHE_MODULE([assembler], [assembler ], [XCACHE_ASSEMBLER], [(N/A)])
  38. XCACHE_MODULE([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, NOT for production server])
  39. XCACHE_MODULE([encoder], [encoder ], [XCACHE_ENCODER], [(N/A)])
  40. XCACHE_MODULE([decoder], [decoder ], [XCACHE_DECODER], [(N/A)])
  41. AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache])
  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
  45. XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
  46. xcache_sources="$xcache_sources main/xc_malloc.c"
  47. AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test])
  48. else
  49. XCACHE_ENABLE_TEST=
  50. fi
  51. PHP_SUBST([XCACHE_ENABLE_TEST])
  52. PHP_ARG_ENABLE(xcache-dprint, for XCache self test,
  53. [ --enable-xcache-dprint XCache: Enable debug print functions - FOR DEVELOPERS ONLY!!], no, no)
  54. if test "$PHP_XCACHE_DPRINT" != "no"; then
  55. AC_DEFINE([HAVE_XCACHE_DPRINT], 1, [Define to enable XCache debug print functions])
  56. fi
  57. PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared)
  58. PHP_ADD_MAKEFILE_FRAGMENT()
  59. AC_PATH_PROGS([XCACHE_AWK], [gawk awk])
  60. dnl clean locale for gawk 3.1.5 assertion bug
  61. if echo | LANG=C "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
  62. XCACHE_AWK="LANG=C $XCACHE_AWK"
  63. else
  64. if echo | /usr/bin/env - "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
  65. XCACHE_AWK="/usr/bin/env - $XCACHE_AWK"
  66. fi
  67. fi
  68. PHP_SUBST([XCACHE_AWK])
  69. AC_PATH_PROGS([M4], [m4])
  70. if test "$PHP_XCACHE_TEST" != "no"; then
  71. if echo | "$M4" -E > /dev/null 2>&1 ; then
  72. M4="$M4 -E"
  73. fi
  74. fi
  75. dnl fix for solaris m4: size of the push-back and argument
  76. if echo | "$M4" -B 102400 > /dev/null 2>&1 ; then
  77. M4="$M4 -B 102400"
  78. fi
  79. PHP_SUBST([M4])
  80. XCACHE_BACKTICK="'"'`'"'"
  81. PHP_SUBST([XCACHE_BACKTICK])
  82. AC_PATH_PROGS([GREP], [grep])
  83. PHP_SUBST([GREP])
  84. AC_PATH_PROGS([SED], [sed])
  85. PHP_SUBST([SED])
  86. AC_PATH_PROGS([INDENT], [indent cat])
  87. XCACHE_INDENT=cat
  88. case $INDENT in
  89. */indent[)]
  90. XCACHE_INDENT="$INDENT"
  91. opts="-kr --use-tabs --tab-size 4"
  92. if echo | $INDENT $opts > /dev/null 2>&1 ; then
  93. XCACHE_INDENT="$XCACHE_INDENT $opts"
  94. fi
  95. opts="-sob -nce"
  96. if echo | $INDENT $opts > /dev/null 2>&1 ; then
  97. XCACHE_INDENT="$XCACHE_INDENT $opts"
  98. fi
  99. opts="-l 160"
  100. if echo | $INDENT $opts > /dev/null 2>&1 ; then
  101. XCACHE_INDENT="$XCACHE_INDENT $opts"
  102. fi
  103. ;;
  104. esac
  105. PHP_SUBST([XCACHE_INDENT])
  106. dnl $ac_srcdir etc require PHP_NEW_EXTENSION
  107. XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4`
  108. PHP_SUBST([XCACHE_PROC_SOURCES])
  109. fi