some help from the autoconf portable shell docs
This commit is contained in:
parent
70babe6b0c
commit
36b7c841d3
23
Build.sh
23
Build.sh
@ -1,11 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $MirOS: src/bin/mksh/Build.sh,v 1.46 2006/08/12 20:01:35 tg Stab $
|
# $MirOS: src/bin/mksh/Build.sh,v 1.47 2006/08/12 20:19:36 tg Exp $
|
||||||
#-
|
#-
|
||||||
# This script recognises CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS and NROFF.
|
# This script recognises CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS and NROFF.
|
||||||
|
|
||||||
: ${CFLAGS=-O2 -fno-strict-aliasing -fno-strength-reduce -Wall}
|
: ${CFLAGS='-O2 -fno-strict-aliasing -fno-strength-reduce -Wall'}
|
||||||
: ${CC:=gcc} ${srcdir:=`dirname "$0"`} ${NROFF:=nroff}
|
: ${CC=gcc} ${NROFF=nroff}
|
||||||
curdir=`pwd`
|
curdir=`pwd` srcdir=`dirname "$0"`
|
||||||
echo | $NROFF -v 2>&1 | grep GNU >&- 2>&- && NROFF="$NROFF -c"
|
echo | $NROFF -v 2>&1 | grep GNU >&- 2>&- && NROFF="$NROFF -c"
|
||||||
|
|
||||||
e=echo
|
e=echo
|
||||||
@ -13,8 +13,9 @@ q=0
|
|||||||
r=0
|
r=0
|
||||||
x=0
|
x=0
|
||||||
|
|
||||||
while test -n "$1"; do
|
for i
|
||||||
case $1 in
|
do
|
||||||
|
case $i in
|
||||||
-d)
|
-d)
|
||||||
LDSTATIC=
|
LDSTATIC=
|
||||||
;;
|
;;
|
||||||
@ -29,11 +30,10 @@ while test -n "$1"; do
|
|||||||
x=1
|
x=1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "$0: Unknown option '$1'!" >&2
|
echo "$0: Unknown option '$i'!" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
|
||||||
done
|
done
|
||||||
|
|
||||||
v()
|
v()
|
||||||
@ -50,7 +50,7 @@ fi
|
|||||||
SRCS="$SRCS alloc.c edit.c eval.c exec.c expr.c funcs.c histrap.c"
|
SRCS="$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 $x = 1 || case "`uname -s 2>/dev/null || uname`" in
|
test $x = 1 || case `uname -s 2>/dev/null || uname` in
|
||||||
CYGWIN*)
|
CYGWIN*)
|
||||||
LDSTATIC= # they don't want it
|
LDSTATIC= # they don't want it
|
||||||
SRCS="$SRCS compat.c"
|
SRCS="$SRCS compat.c"
|
||||||
@ -84,9 +84,8 @@ esac
|
|||||||
|
|
||||||
if test x"$sigseen" = x:; then
|
if test x"$sigseen" = x:; then
|
||||||
$e Generating list of signal names
|
$e Generating list of signal names
|
||||||
NSIG=`( echo '#include <signal.h>'; echo "mksh_test: NSIG" ) | \
|
NSIG=`printf %d "`(echo '#include <signal.h>'; echo mksh_test: NSIG) | \
|
||||||
$CC $CPPFLAGS -E - | grep mksh_test: | sed 's/^mksh_test: //'`
|
$CC $CPPFLAGS -E - | grep mksh_test | sed 's/^mksh_test: //'`" 2>&-`
|
||||||
NSIG=`printf %d "$NSIG" 2>&-`
|
|
||||||
test $NSIG -gt 1 || exit 1
|
test $NSIG -gt 1 || exit 1
|
||||||
echo '#include <signal.h>' | $CC $CPPFLAGS -E -dD - | \
|
echo '#include <signal.h>' | $CC $CPPFLAGS -E -dD - | \
|
||||||
grep '[ ]SIG[A-Z0-9]*[ ]' | \
|
grep '[ ]SIG[A-Z0-9]*[ ]' | \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user