2 . tools
/build-srcpkg
/shlib
/incfile.shlib
4 inc tools
/build-srcpkg
/shlib
/cmplib.shlib
6 # inc tools/build-srcpkg/build.shlib
8 SRCBAK_DIR
="../../dvar-n-doc/$(date +%Y-%m)"
12 scriptversion
=v0.1
.0-231025
14 version
="cmpl.sh $scriptversion
16 Copyright 2020 Free Software Foundation, Inc.
17 There is NO warranty. You may redistribute this software
18 under the terms of the GNU General Public License.
19 For more information about these matters, see the files named COPYING."
21 usage
="Usage: $prog [OPTION]
23 It's a file of compile.
24 https://repo.or.cz/devutils.git
27 -f force to re-compile again even if code is compiled before.
32 clean clean output files.
33 bak clean and backup a tarball in the upper dir.
35 --help display help info in detail.
36 --version display version information in detail.
44 Email bug reports or enhancement requests to skeletone@126.com .
48 # ***********************************************************
50 # * GNU bush, version 5.1.0(1)-release (i686-pc-linux-gnu) *
52 # ***********************************************************
55 ###################################################################################
56 # generate signames, and compile
57 ###################################################################################
68 /bin
/sh .
/support
/mkversion.sh
-b -S .
-s release
-d 5.1 -o src
/newversion.h \
69 && mv src
/newversion.h src
/version.h
71 MACRO_DEF
=" -DPROGRAM=\"bush\" -DCONF_HOSTTYPE=\"i686\" -DCONF_OSTYPE=\"linux-gnu\" -DCONF_MACHTYPE=\"i686-pc-linux-gnu\" -DCONF_VENDOR=\"pc\" -DLOCALEDIR=\"/usr/local/share/locale\" -DPACKAGE=\"bush\" -DSHELL -DHAVE_CONFIG_H "
72 #MACRO_DEF=" -DPROGRAM='\"bush\"' -DCONF_HOSTTYPE='\"i686\"' -DCONF_OSTYPE='\"linux-gnu\"' -DCONF_MACHTYPE='\"i686-pc-linux-gnu\"' -DCONF_VENDOR='\"pc\"' -DLOCALEDIR='\"/usr/local/share/locale\"' -DPACKAGE='\"bush\"' -DSHELL -DHAVE_CONFIG_H "
73 INC_PATHS
=" -I. -I. -I./include -I./src -I./lib "
74 MISC_CFLAGS
="-g -O2 -Wno-parentheses -Wno-format-security"
78 echo "gcc ${CFLAGS} -DBUILDTOOL -c -o buildversion.o ./src/version.c"
79 gcc
${CFLAGS} -DBUILDTOOL -c -o buildversion.o .
/src
/version.c
80 echo "gcc ${CFLAGS} -o bushversion ./support/bushversion.c buildversion.o "
81 gcc
${CFLAGS} -o bushversion .
/support
/bushversion.c buildversion.o
83 VERSPROG
=.
/bushversion
87 PatchLevel
="`${VERSPROG} -p`"
88 sed -e "s%!PATCHLEVEL%${PatchLevel}%" \
89 support
/bushbug.sh
> bushbug
97 # gen y.tab.c/h by bison
100 if [[ ! -f src
/lxrgmr
/y.tab.c || src
/lxrgmr
/parse.y
-nt src
/lxrgmr
/y.tab.c
]]; then
101 ${YACC} -d src
/lxrgmr
/parse.y
-o src
/lxrgmr
/y.tab.c
108 # mkbultins & gen builtins.c
109 # this step is putted in builtins/cmpl.sh
112 gcc
-c -DHAVE_CONFIG_H -DSHELL -I.
-I..
-I..
-I..
/src
-I..
/include
-I..
/lib
-I.
-g -O2 -Wno-parentheses -Wno-format-security mkbuiltins.c
113 gcc
-rdynamic -g -O2 -Wno-parentheses -Wno-format-security -rdynamic -g -O2 -Wno-parentheses -Wno-format-security -o mkbuiltins mkbuiltins.o
-ldl
114 .
/mkbuiltins
-externfile builtext.h
-structfile builtins.c \
115 -noproduction -D . .
/alias.def .
/bind.def .
/break.def .
/builtin.def .
/caller.def .
/cd.def .
/colon.def .
/command.def .
/declare.def .
/echo.def .
/enable.def .
/eval.def .
/getopts.def .
/exec.def .
/exit.def .
/fc.def .
/fg_bg.def .
/hash.def .
/help.def .
/history.def .
/jobs.def .
/kill.def .
/let.def .
/read.def .
/return.def .
/set.def .
/setattr.def .
/shift.def .
/source.def .
/suspend.def .
/test.def .
/times.def .
/trap.def .
/type.def .
/ulimit.def .
/umask.def .
/wait.def .
/reserved.def .
/pushd.def .
/shopt.def .
/printf.def .
/complete.def .
/mapfile.def
122 # mksignames & gen signames.h
125 MACRO_DEF
=" -DPROGRAM=\"bush\" -DCONF_HOSTTYPE=\"i686\" -DCONF_OSTYPE=\"linux-gnu\" -DCONF_MACHTYPE=\"i686-pc-linux-gnu\" -DCONF_VENDOR=\"pc\" -DLOCALEDIR=\"/usr/local/share/locale\" -DPACKAGE=\"bush\" -DSHELL -DHAVE_CONFIG_H "
126 INC_PATHS
=" -I. -I. -I./include -I./src -I./lib "
127 MISC_CFLAGS
="-g -O2 -Wno-parentheses -Wno-format-security"
132 echo gcc
${CFLAGS} -DBUILDTOOL -c .
/support
/mksignames.c
133 gcc
${CFLAGS} -DBUILDTOOL -c .
/support
/mksignames.c
135 rm -f buildsignames.o
136 echo gcc
${CFLAGS} -DBUILDTOOL -c .
/support
/mksignames.c
-o buildsignames.o
137 gcc
${CFLAGS} -DBUILDTOOL -c .
/support
/signames.c
-o buildsignames.o
140 echo gcc
${CFLAGS} -rdynamic -o mksignames mksignames.o buildsignames.o
141 gcc
${CFLAGS} -rdynamic -o mksignames mksignames.o buildsignames.o
144 rm -f src
/lsignames.h
145 .
/mksignames src
/lsignames.h
146 if cmp -s src
/lsignames.h src
/signames.h
; then
149 rm -f src
/signames.h
;
150 cp src
/lsignames.h src
/signames.h
;
160 echo gcc
${CFLAGS} -DBUILDTOOL -rdynamic -o mksyntax mksyntax.c
161 gcc
${CFLAGS} -DBUILDTOOL -rdynamic -o mksyntax mksyntax.c
163 .
/mksyntax
${EXEEXT} -o src
/syntax.c
169 datarootdir
="${prefix}/share"
170 datadir
="${datarootdir}"
171 DEBUGGER_START_FILE
="${datadir}/bushdb/bushdb-main.inc"
176 sed -e 's|@DEBUGGER_START_FILE\@|${DEBUGGER_START_FILE}|g' src
/pathnames.h.
in > pathnames.tmp
177 if test -f src
/pathnames.h
; then
178 cmp -s pathnames.tmp src
/pathnames.h ||
mv pathnames.tmp src
/pathnames.h
;
180 mv pathnames.tmp src
/pathnames.h
;
188 # build psize.aux for pipesize.h
191 # INC_PATHS="-I. -I.. -I.. -I../src -I../include -I../lib -I."
192 INC_PATHS
="-I. -I../ -I../src -I../include -I../lib -I../builtins"
198 rm psize.aux pipesize.h
-f
199 echo gcc
${CFLAGS} -o psize.aux .
/psize.c
200 gcc
${CFLAGS} -o psize.aux .
/psize.c
201 echo get pipe size ...
202 /bin
/sh .
/psize.sh
> pipesize.h
209 echo " ***********************************************************"
211 echo " * `${VERSPROG} -l` *"
213 echo " ***********************************************************"
248 ###################################################################################
249 # compile dir of 'src'.
250 ###################################################################################
254 OBJ_FILE
="output/obj/src/lxrgmr/y.tab.o"
255 SRC_FILE
="src/lxrgmr/y.tab.c"
257 MACRO_DEF
=" -DPROGRAM=\"bush\" -DCONF_HOSTTYPE=\"i686\" -DCONF_OSTYPE=\"linux-gnu\" -DCONF_MACHTYPE=\"i686-pc-linux-gnu\" -DCONF_VENDOR=\"pc\" -DLOCALEDIR=\"/usr/local/share/locale\" -DPACKAGE=\"bush\" -DSHELL -DHAVE_CONFIG_H "
258 INC_PATHS
=" -I. -I. -I./include -I./src -I./lib "
259 MISC_CFLAGS
=" -g -O2 -Wno-parentheses -Wno-format-security"
260 MISC_LDFLAGS
=" -rdynamic -g -O2 -Wno-parentheses -Wno-format-security "
261 #"-g -O2 -Wno-parentheses -Wno-format-security"
262 #"-rdynamic -g -O2 -Wno-parentheses -Wno-format-security"
264 INC_LIBS
=" -ltermcap -ldl "
269 # subdir built into a .a static lib, and append its name to STATIC_LIBS
270 # pay attenssion on the sequence of subdir, it generate different sequence of
291 src/lxrgmr/make_cmd.c
292 src/runner/print_cmd.c
293 src/lxrgmr/dispose_cmd.c
294 src/runner/execute_cmd.c
296 src/lxrgmr/copy_cmd.c
307 src/runner/unwind_prot.c
334 if [[ $flag_clean != 1 ]]; then
335 dbgout_opt
+=",inc_info"
343 echo oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
348 # link > link.txt 2>&1