make "test $x = 1" into "test 1 = $x" consistently

This commit is contained in:
tg 2007-09-11 17:47:25 +00:00
parent 0904ad7d89
commit 88bfbeb0f0

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.261 2007/09/10 20:16:47 tg Exp $ # $MirOS: src/bin/mksh/Build.sh,v 1.262 2007/09/11 17:47:25 tg Exp $
#- #-
# Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS # Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NEED_MKNOD MKSH_NOPWNAM # CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NEED_MKNOD MKSH_NOPWNAM
@ -120,9 +120,9 @@ ac_testn() {
test x"$tcfn" = x"no" && test -f a.out && tcfn=a.out test x"$tcfn" = x"no" && test -f a.out && tcfn=a.out
test x"$tcfn" = x"no" && test -f a.exe && tcfn=a.exe test x"$tcfn" = x"no" && test -f a.exe && tcfn=a.exe
if test -f $tcfn; then if test -f $tcfn; then
test $fr = 1 || fv=1 test 1 = $fr || fv=1
else else
test $fr = 0 || fv=1 test 0 = $fr || fv=1
fi fi
rm -f scn.c scn.o $tcfn rm -f scn.c scn.o $tcfn
ac_testdone ac_testdone
@ -155,7 +155,7 @@ ac_flags() {
test x"$ft" = x"" && ft="if $f can be used" test x"$ft" = x"" && ft="if $f can be used"
save_CFLAGS=$CFLAGS save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $f" CFLAGS="$CFLAGS $f"
if test $hf = 1; then if test 1 = $hf; then
ac_testn can_$vn '' "$ft" ac_testn can_$vn '' "$ft"
else else
ac_testn can_$vn '' "$ft" <<-'EOF' ac_testn can_$vn '' "$ft" <<-'EOF'
@ -184,7 +184,7 @@ ac_header() {
echo 'int main(void) { return (0); }' >>x echo 'int main(void) { return (0); }' >>x
ac_testn "$hv" "" "<$hf>" <x ac_testn "$hv" "" "<$hf>" <x
rm -f x rm -f x
test $na = 1 || ac_cppflags test 1 = $na || ac_cppflags
} }
addsrcs() { addsrcs() {
@ -234,7 +234,7 @@ done
SRCS="alloc.c edit.c eval.c exec.c expr.c funcs.c histrap.c" SRCS="alloc.c edit.c eval.c exec.c expr.c funcs.c histrap.c"
SRCS="$SRCS jobs.c lex.c main.c misc.c shf.c syn.c tree.c var.c" SRCS="$SRCS jobs.c lex.c main.c misc.c shf.c syn.c tree.c var.c"
test $r = 0 && echo | $NROFF -v 2>&1 | grep GNU >/dev/null 2>&1 && \ test 0 = $r && echo | $NROFF -v 2>&1 | grep GNU >/dev/null 2>&1 && \
NROFF="$NROFF -c" NROFF="$NROFF -c"
if test x"$srcdir" = x"."; then if test x"$srcdir" = x"."; then
CPPFLAGS="-I. $CPPFLAGS" CPPFLAGS="-I. $CPPFLAGS"
@ -378,7 +378,7 @@ cat >scn.c <<-'EOF'
EOF EOF
ct=unknown ct=unknown
eval 'v "$CPP scn.c | grep ct= | tr -d \\\\015 >x" 2>&'$h | sed 's/^/] /' eval 'v "$CPP scn.c | grep ct= | tr -d \\\\015 >x" 2>&'$h | sed 's/^/] /'
test $h = 1 && sed 's/^/[ /' x test 1 = $h && sed 's/^/[ /' x
eval `cat x` eval `cat x`
rm -f x rm -f x
case $ct in case $ct in
@ -413,32 +413,32 @@ ac_testn couldbe_tcc '!' compiler_known 0 'if this could be tcc' <<-EOF
#endif #endif
int main(void) { return (0); } int main(void) { return (0); }
EOF EOF
if test $HAVE_COULDBE_TCC = 1; then if test 1 = $HAVE_COULDBE_TCC; then
ct=tcc ct=tcc
CPP='cpp -D__TINYC__' CPP='cpp -D__TINYC__'
fi fi
ac_testn compiler_fails '' 'if the compiler does not fail correctly' <<-EOF ac_testn compiler_fails '' 'if the compiler does not fail correctly' <<-EOF
int main(void) { return (thiswillneverbedefinedIhope()); } int main(void) { return (thiswillneverbedefinedIhope()); }
EOF EOF
if test $HAVE_COMPILER_FAILS = 1; then if test 1 = $HAVE_COMPILER_FAILS; then
save_CFLAGS=$CFLAGS save_CFLAGS=$CFLAGS
if test $ct = dmc; then if test $ct = dmc; then
CFLAGS="$CFLAGS ${ccpl}/DELEXECUTABLE" CFLAGS="$CFLAGS ${ccpl}/DELEXECUTABLE"
ac_testn can_delexe compiler_fails 0 'for the /DELEXECUTABLE linker option' <<-EOF ac_testn can_delexe compiler_fails 0 'for the /DELEXECUTABLE linker option' <<-EOF
int main(void) { return (0); } int main(void) { return (0); }
EOF EOF
test $HAVE_CAN_DELEXE = 1 || CFLAGS=$save_CFLAGS test 1 = $HAVE_CAN_DELEXE || CFLAGS=$save_CFLAGS
else else
CFLAGS="$CFLAGS ${ccpl}+k" CFLAGS="$CFLAGS ${ccpl}+k"
ac_testn can_plusk compiler_fails 0 'for the +k linker option' <<-EOF ac_testn can_plusk compiler_fails 0 'for the +k linker option' <<-EOF
int main(void) { return (0); } int main(void) { return (0); }
EOF EOF
test $HAVE_CAN_PLUSK = 1 || CFLAGS=$save_CFLAGS test 1 = $HAVE_CAN_PLUSK || CFLAGS=$save_CFLAGS
fi fi
ac_testn compiler_still_fails '' 'if the compiler still does not fail correctly' <<-EOF ac_testn compiler_still_fails '' 'if the compiler still does not fail correctly' <<-EOF
int main(void) { return (thiswillneverbedefinedIhope()); } int main(void) { return (thiswillneverbedefinedIhope()); }
EOF EOF
test $HAVE_COMPILER_STILL_FAILS = 1 && exit 1 test 1 = $HAVE_COMPILER_STILL_FAILS && exit 1
fi fi
if test $ct = sunpro; then if test $ct = sunpro; then
@ -546,7 +546,7 @@ elif test $ct = xlc; then
#ac_flags 1 wp64 -qwarn64 # too verbose for now #ac_flags 1 wp64 -qwarn64 # too verbose for now
elif test $ct = tendra; then elif test $ct = tendra; then
ac_flags 0 ysystem -Ysystem ac_flags 0 ysystem -Ysystem
test $HAVE_CAN_YSYSTEM = 1 && CPPFLAGS="-Ysystem $CPPFLAGS" test 1 = $HAVE_CAN_YSYSTEM && CPPFLAGS="-Ysystem $CPPFLAGS"
ac_flags 1 extansi -Xa ac_flags 1 extansi -Xa
elif test $ct = tcc; then elif test $ct = tcc; then
ac_flags 1 boundschk -b ac_flags 1 boundschk -b
@ -671,7 +671,7 @@ if test 0 = $HAVE_CAN_INTTYPES; then
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
typedef unsigned int u_int32_t; typedef unsigned int u_int32_t;
EOF EOF
test 1 = $HAVE_CAN_INTTYPES2 || cat >>stdint.h <<-'EOF' test 1 = $HAVE_CAN_UINTTYPES || cat >>stdint.h <<-'EOF'
typedef unsigned char u_char; typedef unsigned char u_char;
typedef unsigned int u_int; typedef unsigned int u_int;
typedef unsigned long u_long; typedef unsigned long u_long;
@ -782,7 +782,7 @@ ac_testn arc4random <<-'EOF'
int main(void) { return (arc4random()); } int main(void) { return (arc4random()); }
EOF EOF
if test $HAVE_ARC4RANDOM = 0 && test -f "$srcdir/arc4random.c"; then if test 0 = $HAVE_ARC4RANDOM && test -f "$srcdir/arc4random.c"; then
ac_header sys/sysctl.h ac_header sys/sysctl.h
addsrcs HAVE_ARC4RANDOM arc4random.c addsrcs HAVE_ARC4RANDOM arc4random.c
HAVE_ARC4RANDOM=1 HAVE_ARC4RANDOM=1
@ -953,7 +953,7 @@ if test 0 = $HAVE_SYS_SIGNAME; then
*[\ \(\)+-]*) NSIG=`awk "BEGIN { print $NSIG }"` ;; *[\ \(\)+-]*) NSIG=`awk "BEGIN { print $NSIG }"` ;;
esac esac
NSIG=`printf %d "$NSIG" 2>/dev/null` NSIG=`printf %d "$NSIG" 2>/dev/null`
test $h = 1 && printf "NSIG=$NSIG ... " test 1 = $h && printf "NSIG=$NSIG ... "
signames="ABRT ALRM BUS CHLD CLD CONT EMT FPE HUP ILL INFO INT IO IOT" signames="ABRT ALRM BUS CHLD CLD CONT EMT FPE HUP ILL INFO INT IO IOT"
signames="$signames KILL PIPE PROF PWR QUIT SAK SEGV STOP SYS TERM" signames="$signames KILL PIPE PROF PWR QUIT SAK SEGV STOP SYS TERM"
signames="$signames TRAP TSTP TTIN TTOU URG USR1 USR2 WINCH XCPU XFSZ" signames="$signames TRAP TSTP TTIN TTOU URG USR1 USR2 WINCH XCPU XFSZ"
@ -973,7 +973,7 @@ if test 0 = $HAVE_SYS_SIGNAME; then
*:$nr:*) ;; *:$nr:*) ;;
*) echo " { $nr, \"$name\" }," *) echo " { $nr, \"$name\" },"
sigseen=$sigseen$nr: sigseen=$sigseen$nr:
test $h = 1 && printf "$name=$nr " >&2 test 1 = $h && printf "$name=$nr " >&2
;; ;;
esac esac
done 2>&1 >signames.inc done 2>&1 >signames.inc
@ -1001,7 +1001,7 @@ for file in $SRCS; do
echo "$CC $CFLAGS $CPPFLAGS -c $file || exit 1" >>Rebuild.sh echo "$CC $CFLAGS $CPPFLAGS -c $file || exit 1" >>Rebuild.sh
done done
echo "$CC $CFLAGS $LDFLAGS -o mksh $objs $LIBS" >>Rebuild.sh echo "$CC $CFLAGS $LDFLAGS -o mksh $objs $LIBS" >>Rebuild.sh
test $ct = msc || echo 'test $? = 0 || exit 1' >>Rebuild.sh test $ct = msc || echo 'test 0 = $? || exit 1' >>Rebuild.sh
echo 'result=mksh; test -f mksh.exe && result=mksh.exe' >>Rebuild.sh echo 'result=mksh; test -f mksh.exe && result=mksh.exe' >>Rebuild.sh
echo 'test -f $result || exit 1; size $result' >>Rebuild.sh echo 'test -f $result || exit 1; size $result' >>Rebuild.sh
for file in $SRCS; do for file in $SRCS; do
@ -1009,16 +1009,16 @@ for file in $SRCS; do
v "$CC $CFLAGS $CPPFLAGS -c $file" || exit 1 v "$CC $CFLAGS $CPPFLAGS -c $file" || exit 1
done done
v "$CC $CFLAGS $LDFLAGS -o mksh $objs $LIBS" v "$CC $CFLAGS $LDFLAGS -o mksh $objs $LIBS"
rv=$?; test $ct = msc -o $rv = 0 || exit 1 rv=$?; test $ct = msc -o 0 = $rv || exit 1
result=mksh result=mksh
test -f mksh.exe && result=mksh.exe test -f mksh.exe && result=mksh.exe
test -f $result || exit 1 test -f $result || exit 1
test $r = 1 || v "$NROFF -mdoc <'$srcdir/mksh.1' >mksh.cat1" || \ test 1 = $r || v "$NROFF -mdoc <'$srcdir/mksh.1' >mksh.cat1" || \
rm -f mksh.cat1 rm -f mksh.cat1
test $eq = 0 && test $h = 1 && v size $result test 0 = $eq && test 1 = $h && v size $result
i=install i=install
test -f /usr/ucb/$i && i=/usr/ucb/$i test -f /usr/ucb/$i && i=/usr/ucb/$i
test $eq = 1 && e=: test 1 = $eq && e=:
$e $e
$e Installing the shell: $e Installing the shell:
$e "# $i -c -s -o root -g bin -m 555 mksh /bin/mksh" $e "# $i -c -s -o root -g bin -m 555 mksh /bin/mksh"