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.

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