* order tests: we want to use correct NOWARN as much as possible
* "$e" and "echo" fixes for if the stuff begins with a -, and quoting cleanup (where feasible, feel free to send diffs) * cosmetics I hereby name this baby "Mirtoconf".
This commit is contained in:
parent
f946d405f8
commit
c231ab8cc4
27
Build.sh
27
Build.sh
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $MirOS: src/bin/mksh/Build.sh,v 1.121 2007/01/17 17:14:25 tg Exp $
|
# $MirOS: src/bin/mksh/Build.sh,v 1.122 2007/01/17 17:31:59 tg Exp $
|
||||||
#-
|
#-
|
||||||
# Environment: CC, CFLAGS, CPP, CPPFLAGS, LDFLAGS, LIBS, NOWARN, NROFF
|
# Environment: CC, CFLAGS, CPP, CPPFLAGS, LDFLAGS, LIBS, NOWARN, NROFF
|
||||||
# With -x (cross compile): TARGET_OS (default: uname -s)
|
# With -x (cross compile): TARGET_OS (default: uname -s)
|
||||||
@ -27,7 +27,8 @@ fi
|
|||||||
|
|
||||||
upper()
|
upper()
|
||||||
{
|
{
|
||||||
echo "$@" | tr qwertyuiopasdfghjklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM
|
echo :"$@" | sed 's/^://' | \
|
||||||
|
tr qwertyuiopasdfghjklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM
|
||||||
}
|
}
|
||||||
|
|
||||||
# pipe .c | ac_test[n] label [!] checkif[!]0 [setlabelifcheckis[!]0] useroutput
|
# pipe .c | ac_test[n] label [!] checkif[!]0 [setlabelifcheckis[!]0] useroutput
|
||||||
@ -116,7 +117,7 @@ if test -d mksh; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${CPP=false} ${CC=gcc} ${NROFF=nroff}
|
: ${CC=gcc} ${CPP=false} ${NROFF=nroff}
|
||||||
curdir=`pwd` srcdir=`dirname "$0"` check_categories=pdksh
|
curdir=`pwd` srcdir=`dirname "$0"` check_categories=pdksh
|
||||||
echo | $NROFF -v 2>&1 | grep GNU >/dev/null 2>&1 && NROFF="$NROFF -c"
|
echo | $NROFF -v 2>&1 | grep GNU >/dev/null 2>&1 && NROFF="$NROFF -c"
|
||||||
|
|
||||||
@ -189,11 +190,6 @@ test 1 = $HAVE_CAN_COMPILER_WORKS || exit 1
|
|||||||
ac_flags 0 wnoerror "$save_NOWARN"
|
ac_flags 0 wnoerror "$save_NOWARN"
|
||||||
test 1 = $HAVE_CAN_WNOERROR || save_NOWARN=
|
test 1 = $HAVE_CAN_WNOERROR || save_NOWARN=
|
||||||
ac_flags 0 werror "-Werror"
|
ac_flags 0 werror "-Werror"
|
||||||
i=`echo "$CFLAGS" | tr -c -d qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789-`
|
|
||||||
test x"$i" = x"" && ac_flags 1 otwo "-O2"
|
|
||||||
ac_flags 1 fnostrictaliasing "-fno-strict-aliasing"
|
|
||||||
ac_flags 1 fwrapv "-fwrapv"
|
|
||||||
ac_flags 1 wall "-Wall"
|
|
||||||
|
|
||||||
# The following tests are run with -Werror if possible
|
# The following tests are run with -Werror if possible
|
||||||
test 1 = $HAVE_CAN_WERROR && NOWARN=-Werror
|
test 1 = $HAVE_CAN_WERROR && NOWARN=-Werror
|
||||||
@ -224,6 +220,13 @@ EOF
|
|||||||
# End of tests run with -Werror
|
# End of tests run with -Werror
|
||||||
NOWARN=$save_NOWARN
|
NOWARN=$save_NOWARN
|
||||||
|
|
||||||
|
i=`echo :"$CFLAGS" | sed 's/^://' | \
|
||||||
|
tr -c -d qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789-`
|
||||||
|
test x"$i" = x"" && ac_flags 1 otwo "-O2"
|
||||||
|
ac_flags 1 fnostrictaliasing "-fno-strict-aliasing"
|
||||||
|
ac_flags 1 fwrapv "-fwrapv"
|
||||||
|
ac_flags 1 wall "-Wall"
|
||||||
|
|
||||||
ac_testn mksh_full '' "if we're building without MKSH_SMALL" <<-'EOF'
|
ac_testn mksh_full '' "if we're building without MKSH_SMALL" <<-'EOF'
|
||||||
#ifdef MKSH_SMALL
|
#ifdef MKSH_SMALL
|
||||||
#error OK, we are building an extra small mksh.
|
#error OK, we are building an extra small mksh.
|
||||||
@ -345,7 +348,7 @@ ac_test strlcpy <<-'EOF'
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
if test 1 = $NEED_MKSH_SIGNAME; then
|
if test 1 = $NEED_MKSH_SIGNAME; then
|
||||||
$e "... checking how to run the C Preprocessor"
|
$e ... checking how to run the C Preprocessor
|
||||||
rm -f x
|
rm -f x
|
||||||
save_CPP=$CPP
|
save_CPP=$CPP
|
||||||
for i in "$save_CPP" "$CC -E" "cpp" "/usr/libexec/cpp" "/lib/cpp"; do
|
for i in "$save_CPP" "$CC -E" "cpp" "/usr/libexec/cpp" "/lib/cpp"; do
|
||||||
@ -368,7 +371,7 @@ $e ... done.
|
|||||||
if test 1 = $NEED_MKSH_SIGNAME; then
|
if test 1 = $NEED_MKSH_SIGNAME; then
|
||||||
$e Generating list of signal names...
|
$e Generating list of signal names...
|
||||||
sigseen=:
|
sigseen=:
|
||||||
NSIG=`( echo '#include <signal.h>'; echo "mksh_cfg: NSIG" ) | \
|
NSIG=`( echo '#include <signal.h>'; echo mksh_cfg: NSIG ) | \
|
||||||
vq "$CPP $CPPFLAGS" | grep mksh_cfg: | \
|
vq "$CPP $CPPFLAGS" | grep mksh_cfg: | \
|
||||||
sed 's/^mksh_cfg: \([0-9x]*\).*$/\1/'`
|
sed 's/^mksh_cfg: \([0-9x]*\).*$/\1/'`
|
||||||
NSIG=`printf %d "$NSIG" 2>/dev/null`
|
NSIG=`printf %d "$NSIG" 2>/dev/null`
|
||||||
@ -378,7 +381,7 @@ if test 1 = $NEED_MKSH_SIGNAME; then
|
|||||||
grep '[ ]SIG[A-Z0-9]*[ ]' | \
|
grep '[ ]SIG[A-Z0-9]*[ ]' | \
|
||||||
sed 's/^\(.*[ ]SIG\)\([A-Z0-9]*\)\([ ].*\)$/\2/' | \
|
sed 's/^\(.*[ ]SIG\)\([A-Z0-9]*\)\([ ].*\)$/\2/' | \
|
||||||
while read name; do
|
while read name; do
|
||||||
( echo '#include <signal.h>'; echo "mksh_cfg: SIG$name" ) | \
|
( echo '#include <signal.h>'; echo mksh_cfg: SIG$name ) | \
|
||||||
vq "$CPP $CPPFLAGS" | grep mksh_cfg: | \
|
vq "$CPP $CPPFLAGS" | grep mksh_cfg: | \
|
||||||
sed 's/^mksh_cfg: \([0-9x]*\).*$/\1:'$name/
|
sed 's/^mksh_cfg: \([0-9x]*\).*$/\1:'$name/
|
||||||
done | grep -v '^:' | while IFS=: read nr name; do
|
done | grep -v '^:' | while IFS=: read nr name; do
|
||||||
@ -427,7 +430,7 @@ test -f /usr/ucb/$i && i=/usr/ucb/$i
|
|||||||
$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"
|
||||||
$e "# grep -qx /bin/mksh /etc/shells || echo /bin/mksh >>/etc/shells"
|
$e "# grep -x /bin/mksh /etc/shells >/dev/null || echo /bin/mksh >>/etc/shells"
|
||||||
$e "# $i -c -o root -g bin -m 444 dot.mkshrc /usr/share/doc/mksh/examples/"
|
$e "# $i -c -o root -g bin -m 444 dot.mkshrc /usr/share/doc/mksh/examples/"
|
||||||
$e
|
$e
|
||||||
$e Installing the manual:
|
$e Installing the manual:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user