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