Skip to content

Commit ca9fd7a

Browse files
committed
make-bootstrap-jim, test-bootstrap-jim: support --no-regexp
To build without the jim builtin regex Signed-off-by: Steve Bennett <[email protected]>
1 parent 55a1127 commit ca9fd7a

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

make-bootstrap-jim

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@
44
# which can be compiled to provide a bootstrap version of jimsh.
55
# e.g. cc -o jimsh0 jimsh0.c
66

7+
JIMREGEXP_H=jimregexp.h
8+
JIMREGEXP_C=jimregexp.c
9+
JIM_REGEXP=JIM_REGEXP
10+
11+
while [ $# -gt 0 ]; do
12+
case "$1" in
13+
--no-regexp)
14+
# don't include builtin regexp extension
15+
JIMREGEXP_H=""
16+
JIMREGEXP_C=""
17+
JIM_REGEXP=""
18+
;;
19+
*)
20+
echo "Unknown option: $1"
21+
exit 1
22+
;;
23+
esac
24+
shift
25+
done
26+
727
makeext()
828
{
929
source="$1"
@@ -49,7 +69,7 @@ allexts="bootstrap aio readdir regexp file glob exec clock array stdlib tclcompa
4969
echo "/* This is single source file, bootstrap version of Jim Tcl. See http://jim.tcl.tk/ */"
5070

5171
# define some core features
52-
for i in JIM_COMPAT JIM_ANSIC JIM_REGEXP HAVE_NO_AUTOCONF JIM_TINY _JIMAUTOCONF_H; do
72+
for i in JIM_COMPAT JIM_ANSIC $JIM_REGEXP HAVE_NO_AUTOCONF JIM_TINY _JIMAUTOCONF_H; do
5373
echo "#define $i"
5474
done
5575
echo '#define TCL_LIBRARY "."'
@@ -121,7 +141,7 @@ outputsource()
121141
}
122142

123143
# Now output header files, removing references to jim header files
124-
for i in jim-win32compat.h utf8.h jim.h jim-subcmd.h jimregexp.h jim-signal.h jimiocompat.h; do
144+
for i in jim-win32compat.h utf8.h jim.h jim-subcmd.h $JIMREGEXP_H jim-signal.h jimiocompat.h; do
125145
outputsource $i
126146
done
127147

@@ -135,7 +155,7 @@ done
135155
makeloadexts $allexts
136156

137157
# And finally the core source code
138-
for i in jim.c jim-subcmd.c utf8.c jim-format.c jimregexp.c jimiocompat.c jim-win32compat.c jim-nosignal.c; do
158+
for i in jim.c jim-subcmd.c utf8.c jim-format.c $JIMREGEXP_C jimiocompat.c jim-win32compat.c jim-nosignal.c; do
139159
outputsource $i
140160
done
141161
echo "#ifndef JIM_BOOTSTRAP_LIB_ONLY"

test-bootstrap-jim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44
echo "Building bootstrap jimsh"
5-
./make-bootstrap-jim >jimsh_bootstrap.c
5+
./make-bootstrap-jim "$@" >jimsh_bootstrap.c
66
${CC:-cc} -o jimsh_bootstrap jimsh_bootstrap.c
77
echo "Testing bootstrap jimsh"
88
( cd tests; ../jimsh_bootstrap runall.tcl )

0 commit comments

Comments
 (0)