2 ###################################################################################
3 # generate signames, and compile
4 ###################################################################################
10 echo " ***********************************************************"
12 echo " * `${VERSPROG} -l` *"
14 echo " ***********************************************************"
23 if [ -r ${OUTDIR}/ver.build ]; then
24 cmpl_ver=`cat ${OUTDIR}/ver.build`
26 if [ -z "$cmpl_ver" ]; then
30 # increment the build version if that's what's required
32 if [ -n "$inc_build" ]; then
33 cmpl_ver=`expr 1 + $cmpl_ver`
36 if [ -n "$inc_build" ]; then
37 # Make sure we can write to ${OUTDIR}/ver.build
38 if [ -f ${OUTDIR}/ver.build ] && [ ! -w ${OUTDIR}/ver.build ]; then
39 echo "$PROGNAME: cannot write to ${OUTDIR}/ver.build, not incrementing build version" >&2
41 echo "$cmpl_ver" > ${OUTDIR}/ver.build
46 step_hostutils_prev_init ()
49 # /bin/sh tools/mkversion.sh -b -S . -s release -d 5.1 -o ${GENCODE_DIR}/inc/newversion.h \
50 # && mv ${GENCODE_DIR}/inc/newversion.h ${GENCODE_DIR}/inc/version.h
51 echo " ver2h ============================>"
53 ftpchk doc/VERSION ${GENCODE_DIR}/inc/version.h
54 if test ! -f build/version.h.in -a $? = 0 ; then
55 echo " [AUTOGEN] doc/VERSION => version.h"
60 ftpchk ${OUTDIR}/config.imi ${GENCODE_DIR}/inc/config.h
61 if test ! -f build/config.h.in -a -f ${OUTDIR}/config.imi -a $? = 0 ; then
62 echo " [AUTOGEN] config.imi => config.h"
69 step_hostutils_post_init ()
74 VERSPROG=$OUTDIR/bushversion
75 $OUTDIR/bushversion -l
77 ftpchk support/bushbug.sh ${OUTDIR}/bushbug
78 if [[ $? == 0 ]]; then
79 echo " [AUTOGEN] bushbug"
80 PatchLevel="`${VERSPROG} -p`"
81 sed -e "s%!PATCHLEVEL%${PatchLevel}%" \
82 support/bushbug.sh > ${OUTDIR}/bushbug
83 chmod a+rx ${OUTDIR}/bushbug
87 for file in `ls -1 builtins/*.def`; do
88 test "$file" -nt "${GENCODE_DIR}/inc/builtext.h" -o "$file" -nt "${GENCODE_DIR}/src/builtins.c" &&
89 flag=1 && echo "file $file is modified." && break
91 if test ! -f "${GENCODE_DIR}/inc/builtext.h" -o ! -f "${GENCODE_DIR}/src/builtins.c" -o flag = 1 ; then
92 echo " [AUTOGEN] builtins/*.def => ${GENCODE_DIR}/{src/builtins.c,inc/builtext.h}"
93 $OUTDIR/mkbuiltins -externfile ${GENCODE_DIR}/inc/builtext.h -structfile ${GENCODE_DIR}/src/builtins.c -noproduction -D . builtins/*.def
98 $OUTDIR/mksignames ${GENCODE_DIR}/inc/lsignames.h
99 if cmp -s ${GENCODE_DIR}/inc/lsignames.h ${GENCODE_DIR}/inc/signames.h ; then
102 echo " [AUTOGEN] ${GENCODE_DIR}/inc/signames.h"
103 rm -f ${GENCODE_DIR}/inc/signames.h ;
104 cp ${GENCODE_DIR}/inc/lsignames.h ${GENCODE_DIR}/inc/signames.h ;
108 if test ! -f "${GENCODE_DIR}/inc/pipesize.h" ; then
109 echo " [AUTOGEN] ${GENCODE_DIR}/src/syntax.c"
110 $OUTDIR/mksyntax${EXEEXT} -o ${GENCODE_DIR}/src/syntax.c
115 datarootdir="${prefix}/share"
116 datadir="${datarootdir}"
117 DEBUGGER_START_FILE="${datadir}/bushdb/bushdb-main.inc"
122 ftpchk src/pathnames.h.in ${GENCODE_DIR}/inc/pathnames.h
123 if test $? = 0 ; then
124 echo " [AUTOGEN] ${GENCODE_DIR}/inc/pathnames.h"
125 sed -e 's|@DEBUGGER_START_FILE\@|${DEBUGGER_START_FILE}|g' src/pathnames.h.in > ${GENCODE_DIR}/inc/pathnames.tmp
126 if test -f ${GENCODE_DIR}/inc/pathnames.h; then
127 cmp -s ${GENCODE_DIR}/inc/pathnames.tmp ${GENCODE_DIR}/inc/pathnames.h || mv ${GENCODE_DIR}/inc/pathnames.tmp ${GENCODE_DIR}/inc/pathnames.h;
129 mv ${GENCODE_DIR}/inc/pathnames.tmp ${GENCODE_DIR}/inc/pathnames.h;
131 rm -f ${GENCODE_DIR}/inc/pathnames.tmp
135 if test ! -f "${GENCODE_DIR}/inc/pipesize.h" ; then
136 echo " [AUTOGEN] ${GENCODE_DIR}/inc/pipesize.h"
137 /bin/sh builtins/psize.sh > ${GENCODE_DIR}/inc/tmp_pipesize.h
138 cmp -s ${GENCODE_DIR}/inc/tmp_pipesize.h ${GENCODE_DIR}/inc/pipesize.h || mv ${GENCODE_DIR}/inc/tmp_pipesize.h ${GENCODE_DIR}/inc/pipesize.h
139 rm -f ${GENCODE_DIR}/inc/tmp_pipesize.h