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.

100 lines
2.4 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_opcode_spec_def.h
  13. make_const_string
  14. test -e tags && echo tags exists, skipping. use \""$0" tags\" to rebuild || make_tags
  15. }
  16. make_clean() {
  17. make_clean_const_string
  18. echo "*" rm -f tags opcode_spec_def.h
  19. rm -f tags opcode_spec_def.h
  20. }
  21. make_const_string() {
  22. make_const_string_opcodes_php4.x.h
  23. make_const_string_opcodes_php5.0.h
  24. make_const_string_opcodes_php5.1.h
  25. make_const_string_opcodes_php6.x.h
  26. }
  27. make_clean_const_string() {
  28. echo "*" rm -f const_string_opcodes_php*.h{,.tmp}
  29. rm -f const_string_opcodes_php*.h
  30. }
  31. make_const_string_opcodes_php4.x.h() {
  32. precheck const_string_opcodes_php4.x.h "${PHP4_x_DIR}/Zend/zend_compile.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
  33. }
  34. make_const_string_opcodes_php5.0.h() {
  35. precheck const_string_opcodes_php5.0.h "${PHP5_0_DIR}/Zend/zend_compile.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
  36. }
  37. make_const_string_opcodes_php5.1.h() {
  38. precheck const_string_opcodes_php5.1.h "${PHP5_1_DIR}/Zend/zend_vm_def.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
  39. }
  40. make_const_string_opcodes_php6.x.h() {
  41. precheck const_string_opcodes_php6.x.h "${PHP6_x_DIR}/Zend/zend_vm_def.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
  42. }
  43. make_opcode_spec_def.h() {
  44. precheck "opcode_spec_def.h" "${EA_DIR}/opcodes.c" && "$AWK" -f ./mkopcode_spec.awk < "$I" > "$O"
  45. }
  46. make_tags() {
  47. if test -z "$CTAGS" ; then
  48. echo tool ctags not found, skip building tags >&2
  49. return
  50. fi
  51. if test -d "${PHP_DEVEL_DIR}" ; then
  52. echo "* Making tags with ${PHP_DEVEL_DIR}"
  53. "$CTAGS" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard"
  54. else
  55. echo "* Making tags without php source files"
  56. "$CTAGS" -R .
  57. fi
  58. }
  59. error() {
  60. echo "$@" >&2
  61. }
  62. precheck() {
  63. if test -e "$2" ; then :; else
  64. error X skipping "$1" because "$2" not found
  65. return 1
  66. fi
  67. if test "$1" -ot "$2" ; then :; else
  68. echo O "$1" is up to date.
  69. return 1
  70. fi
  71. O="$1"
  72. I="$2"
  73. echo "* Making $1 from $2"
  74. return 0
  75. }
  76. if test -z "$1" ; then
  77. make_all
  78. else
  79. while ! test -z "$1" ; do
  80. eval "make_$1"
  81. shift
  82. done
  83. fi