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.
 
 
 
 
 
 

141 lines
4.5 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 mod_$1/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 XCache Extension.])
  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="xcache.c"
  23. for i in \
  24. xc_trace.c \
  25. ; do
  26. xcache_sources="$xcache_sources util/$i"
  27. done
  28. for i in \
  29. xc_allocator.c \
  30. xc_allocator_bestfit.c \
  31. xc_compatibility.c \
  32. xc_const_string.c \
  33. xc_extension.c \
  34. xc_ini.c \
  35. xc_mutex.c \
  36. xc_opcode_spec.c \
  37. xc_processor.c \
  38. xc_sandbox.c \
  39. xc_shm.c \
  40. xc_shm_mmap.c \
  41. xc_utils.c \
  42. ; do
  43. xcache_sources="$xcache_sources xcache/$i"
  44. done
  45. for i in \
  46. xc_cacher.c \
  47. ; do
  48. xcache_sources="$xcache_sources mod_cacher/$i"
  49. done
  50. XCACHE_MODULES="cacher"
  51. AC_DEFINE([HAVE_XCACHE_CACHER], 1, [Define to enable XCache cacher])
  52. XCACHE_MODULE([optimizer], [optimizer ], [XCACHE_OPTIMIZER], [(N/A)])
  53. XCACHE_MODULE([coverager], [coverager ], [XCACHE_COVERAGER], [Enable code coverage dumper, useful for testing php scripts])
  54. XCACHE_MODULE([assembler], [assembler ], [XCACHE_ASSEMBLER], [(N/A)])
  55. XCACHE_MODULE([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, not for server usage])
  56. XCACHE_MODULE([encoder], [encoder ], [XCACHE_ENCODER], [(N/A)])
  57. XCACHE_MODULE([decoder], [decoder ], [XCACHE_DECODER], [(N/A)])
  58. AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache])
  59. PHP_ARG_ENABLE(xcache-test, for XCache self test,
  60. [ --enable-xcache-test XCache: Enable self test - FOR DEVELOPERS ONLY!!], no, no)
  61. if test "$PHP_XCACHE_TEST" != "no"; then
  62. XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
  63. xcache_sources="$xcache_sources xcache/xc_malloc.c"
  64. AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test])
  65. else
  66. XCACHE_ENABLE_TEST=
  67. fi
  68. PHP_SUBST([XCACHE_ENABLE_TEST])
  69. PHP_ARG_ENABLE(xcache-dprint, for XCache self test,
  70. [ --enable-xcache-dprint XCache: Enable debug print functions - FOR DEVELOPERS ONLY!!], no, no)
  71. if test "$PHP_XCACHE_DPRINT" != "no"; then
  72. AC_DEFINE([HAVE_XCACHE_DPRINT], 1, [Define to enable XCache debug print functions])
  73. fi
  74. PHP_NEW_EXTENSION(xcache, $xcache_sources, $ext_shared)
  75. for module in $XCACHE_MODULES; do
  76. PHP_ADD_BUILD_DIR($ext_builddir/mod_$module)
  77. done
  78. PHP_ADD_BUILD_DIR($ext_builddir/util)
  79. PHP_ADD_BUILD_DIR($ext_builddir/xcache)
  80. PHP_ADD_MAKEFILE_FRAGMENT()
  81. PHP_ADD_MAKEFILE_FRAGMENT($ext_srcdir/Makefile.frag.deps)
  82. AC_PATH_PROGS([XCACHE_AWK], [gawk awk])
  83. dnl clean locale for gawk 3.1.5 assertion bug
  84. if echo | LANG=C "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
  85. XCACHE_AWK="LANG=C $XCACHE_AWK"
  86. else
  87. if echo | /usr/bin/env - "$XCACHE_AWK" -- '' > /dev/null 2>&1 ; then
  88. XCACHE_AWK="/usr/bin/env - $XCACHE_AWK"
  89. fi
  90. fi
  91. PHP_SUBST([XCACHE_AWK])
  92. AC_PATH_PROGS([M4], [m4])
  93. if test "$PHP_XCACHE_TEST" != "no"; then
  94. if echo | "$M4" -E > /dev/null 2>&1 ; then
  95. M4="$M4 -E"
  96. fi
  97. fi
  98. dnl fix for solaris m4: size of the push-back and argument
  99. if echo | "$M4" -B 102400 > /dev/null 2>&1 ; then
  100. M4="$M4 -B 102400"
  101. fi
  102. PHP_SUBST([M4])
  103. AC_PATH_PROGS([GREP], [grep])
  104. PHP_SUBST([GREP])
  105. AC_PATH_PROGS([SED], [sed])
  106. PHP_SUBST([SED])
  107. AC_PATH_PROGS([INDENT], [indent cat])
  108. XCACHE_INDENT=cat
  109. case $INDENT in
  110. */indent[)]
  111. XCACHE_INDENT="$INDENT"
  112. opts="-kr --use-tabs --tab-size 4"
  113. if echo | $INDENT $opts > /dev/null 2>&1 ; then
  114. XCACHE_INDENT="$XCACHE_INDENT $opts"
  115. fi
  116. opts="-sob -nce"
  117. if echo | $INDENT $opts > /dev/null 2>&1 ; then
  118. XCACHE_INDENT="$XCACHE_INDENT $opts"
  119. fi
  120. opts="-l 160"
  121. if echo | $INDENT $opts > /dev/null 2>&1 ; then
  122. XCACHE_INDENT="$XCACHE_INDENT $opts"
  123. fi
  124. ;;
  125. esac
  126. PHP_SUBST([XCACHE_INDENT])
  127. dnl $ac_srcdir etc require PHP_NEW_EXTENSION
  128. XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4 $ac_srcdir/processor/*.h`
  129. PHP_SUBST([XCACHE_PROC_SOURCES])
  130. fi