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.
 
 
 
 
 
 

106 lines
2.9 KiB

  1. #! /bin/bash
  2. SELF="$0"
  3. if test -e prepare.devel.inc ; then
  4. . prepare.devel.inc
  5. else
  6. echo prepare.devel.inc is required, see prepare.devel.inc.example >&2
  7. exit
  8. fi
  9. CTAGS=`which ctags 2>/dev/null || which exuberant-ctags 2>/dev/null `
  10. AWK=`which gawk 2>/dev/null || which awk 2>/dev/null `
  11. make_all() {
  12. make_xc_opcode_spec_def.h
  13. make_xc_const_string
  14. test -e tags && echo tags exists, skipping. use \""$0" tags\" to rebuild || make_tags
  15. }
  16. make_clean() {
  17. make_clean_xc_const_string
  18. echo "*" rm -f tags xc_opcode_spec_def.h
  19. rm -f tags xc_opcode_spec_def.h
  20. }
  21. make_xc_const_string() {
  22. make_xc_const_string_opcodes_php4.x.h
  23. make_xc_const_string_opcodes_php5.0.h
  24. make_xc_const_string_opcodes_php5.1.h
  25. make_xc_const_string_opcodes_php5.4.h
  26. make_xc_const_string_opcodes_php6.x.h
  27. }
  28. make_clean_xc_const_string() {
  29. echo "*" rm -f main/xc_const_string_opcodes_php*.h{,.tmp}
  30. rm -f main/xc_const_string_opcodes_php*.h
  31. }
  32. make_xc_const_string_opcodes_php4.x.h() {
  33. precheck main/xc_const_string_opcodes_php4.x.h "${PHP4_x_DIR}/Zend/zend_compile.h" && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
  34. }
  35. make_xc_const_string_opcodes_php5.0.h() {
  36. precheck main/xc_const_string_opcodes_php5.0.h "${PHP5_0_DIR}/Zend/zend_compile.h" && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
  37. }
  38. make_xc_const_string_opcodes_php5.1.h() {
  39. precheck main/xc_const_string_opcodes_php5.1.h "${PHP5_1_DIR}/Zend/zend_vm_def.h" && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
  40. }
  41. make_xc_const_string_opcodes_php5.4.h() {
  42. precheck main/xc_const_string_opcodes_php5.4.h "${PHP5_4_DIR}/Zend/zend_vm_def.h" && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
  43. }
  44. make_xc_const_string_opcodes_php6.x.h() {
  45. precheck main/xc_const_string_opcodes_php6.x.h "${PHP6_x_DIR}/Zend/zend_vm_def.h" && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
  46. }
  47. make_xc_opcode_spec_def.h() {
  48. precheck main/xc_opcode_spec_def.h "${EA_DIR}/opcodes.c" && "$AWK" -f ./devel/gen_xc_opcode_spec.awk < "$I" > "$O"
  49. }
  50. make_tags() {
  51. if test -z "$CTAGS" ; then
  52. echo tool ctags not found, skip building tags >&2
  53. return
  54. fi
  55. if test -d "${PHP_DEVEL_DIR}" ; then
  56. echo "* Making tags with ${PHP_DEVEL_DIR}"
  57. "$CTAGS" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard"
  58. else
  59. echo "* Making tags without php source files"
  60. "$CTAGS" -R .
  61. fi
  62. }
  63. error() {
  64. echo "$@" >&2
  65. }
  66. precheck() {
  67. if test -e "$2" ; then :; else
  68. error X skipping "$1" because "$2" not found
  69. return 1
  70. fi
  71. if test "$1" -ot "$2" ; then :; else
  72. echo O "$1" is up to date.
  73. return 1
  74. fi
  75. O="$1"
  76. I="$2"
  77. echo "* Making $1 from $2"
  78. return 0
  79. }
  80. if test -z "$1" ; then
  81. make_all
  82. else
  83. while ! test -z "$1" ; do
  84. eval "make_$1"
  85. shift
  86. done
  87. fi