source: trunk/prepare.devel @ 821

Last change on this file since 821 was 821, checked in by moo, 2 years ago

adds info for PHP_5_4

  • Property svn:eol-style set to native
File size: 2.6 KB
RevLine 
[52]1#! /bin/bash
[7]2SELF="$0"
[1]3
[43]4if test -e prepare.devel.inc ; then
5    . prepare.devel.inc
[3]6else
[43]7    echo prepare.devel.inc is required, see prepare.devel.inc.example >&2
[3]8    exit
9fi
[1]10
[3]11CTAGS=`which ctags 2>/dev/null || which exuberant-ctags 2>/dev/null `
12AWK=`which gawk 2>/dev/null || which awk 2>/dev/null `
[1]13
[3]14make_all() {
15    make_opcode_spec_def.h
16    make_const_string
[7]17    test -e tags && echo tags exists, skipping. use \""$0" tags\" to rebuild || make_tags
[3]18}
19
20make_clean() {
21    make_clean_const_string
22    echo "*" rm -f tags opcode_spec_def.h
[1]23    rm -f tags opcode_spec_def.h
[3]24}
[1]25
[3]26make_const_string() {
27    make_const_string_opcodes_php4.x.h
28    make_const_string_opcodes_php5.0.h
29    make_const_string_opcodes_php5.1.h
[821]30    make_const_string_opcodes_php5.4.h
[3]31    make_const_string_opcodes_php6.x.h
32}
[1]33
[3]34make_clean_const_string() {
[43]35    echo "*" rm -f const_string_opcodes_php*.h{,.tmp}
[3]36    rm -f const_string_opcodes_php*.h
37}
[1]38
[3]39make_const_string_opcodes_php4.x.h() {
[43]40    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"
[3]41}
[1]42
[3]43make_const_string_opcodes_php5.0.h() {
[52]44    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"
[3]45}
[1]46
[3]47make_const_string_opcodes_php5.1.h() {
[43]48    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"
[3]49}
[1]50
[821]51make_const_string_opcodes_php5.4.h() {
52    precheck const_string_opcodes_php5.4.h "${PHP5_4_DIR}/Zend/zend_vm_def.h"  && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
53}
54
[3]55make_const_string_opcodes_php6.x.h() {
[43]56    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"
[3]57}
[1]58
[3]59make_opcode_spec_def.h() {
60    precheck "opcode_spec_def.h" "${EA_DIR}/opcodes.c" && "$AWK" -f ./mkopcode_spec.awk < "$I" > "$O"
61}
[1]62
[3]63make_tags() {
64    if test -z "$CTAGS" ; then
[7]65        echo tool ctags not found, skip building tags >&2
[3]66        return
67    fi
[1]68
[3]69    if test -d "${PHP_DEVEL_DIR}" ; then
70        echo "* Making tags with ${PHP_DEVEL_DIR}"
71        "$CTAGS" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard"
72    else
73        echo "* Making tags without php source files"
74        "$CTAGS" -R .
75    fi
76}
[1]77
[3]78error() {
79    echo "$@" >&2
80}
81
82precheck() {
[52]83    if test -e "$2" ; then :; else
[3]84        error X skipping "$1" because "$2" not found
85        return 1
86    fi
[52]87    if test "$1" -ot "$2" ; then :; else
[3]88        echo O "$1" is up to date.
89        return 1
90    fi
91    O="$1"
92    I="$2"
93    echo "* Making $1 from $2"
94    return 0
95}
96
97if test -z "$1" ; then
98    make_all
99else
100    while ! test -z "$1" ; do
101        eval "make_$1"
102        shift
103    done
104fi
105
Note: See TracBrowser for help on using the repository browser.