• move __GNUC__ test quite to the bottom, since I fear other compilers,

such as icc, define it too
• provide a Rebuild.sh skipping the mirtoconf checks – devel only!
This commit is contained in:
tg 2007-07-22 13:08:54 +00:00
parent 29d4125e3c
commit 211ecedf4e
1 changed files with 22 additions and 13 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.239 2007/07/17 19:41:26 tg Exp $ # $MirOS: src/bin/mksh/Build.sh,v 1.240 2007/07/22 13:08:54 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
@ -332,18 +332,18 @@ $e ... which compiler we seem to use
cat >scn.c <<-'EOF' cat >scn.c <<-'EOF'
#if defined(__ICC) || defined(__INTEL_COMPILER) #if defined(__ICC) || defined(__INTEL_COMPILER)
ct=icc ct=icc
#elif defined(__GNUC__)
ct=gcc
#elif defined(__SUNPRO_C) #elif defined(__SUNPRO_C)
ct=sunpro ct=sunpro
#elif defined(__hpux)
ct=hpcc
#elif defined(__BORLANDC__) #elif defined(__BORLANDC__)
ct=bcc ct=bcc
#elif defined(__DMC__) #elif defined(__DMC__)
ct=dmc ct=dmc
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
ct=msc ct=msc
#elif defined(__GNUC__)
ct=gcc
#elif defined(__hpux)
ct=hpcc
#else #else
ct=unknown ct=unknown
#endif #endif
@ -877,8 +877,25 @@ addsrcs HAVE_STRLCPY strlcpy.c
CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H -DCONFIG_H_FILENAME=\\\"sh.h\\\"" CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H -DCONFIG_H_FILENAME=\\\"sh.h\\\""
objs= objs=
case $curdir in
*\ *) echo "#!./mksh" >test.sh ;;
*) echo "#!$curdir/mksh" >test.sh ;;
esac
echo "export PATH='$PATH'" >>test.sh
echo "exec perl '$srcdir/check.pl' -s '$srcdir/check.t'" \
"-p '$curdir/mksh' -C $check_categories \$*$tsts" >>test.sh
chmod 755 test.sh
echo set -x >Rebuild.sh
for file in $SRCS; do for file in $SRCS; do
objs="$objs `echo x"$file" | sed 's/^x\(.*\)\.c$/\1.o/'`" objs="$objs `echo x"$file" | sed 's/^x\(.*\)\.c$/\1.o/'`"
test -f $file || file=$srcdir/$file
echo "$CC $CFLAGS $CPPFLAGS -c $file || exit 1" >>Rebuild.sh
done
echo "$CC $CFLAGS $LDFLAGS -o mksh $objs $LIBS" >>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 'test -f $result || exit 1; size $result' >>Rebuild.sh
for file in $SRCS; do
test -f $file || file=$srcdir/$file test -f $file || file=$srcdir/$file
v "$CC $CFLAGS $CPPFLAGS -c $file" || exit 1 v "$CC $CFLAGS $CPPFLAGS -c $file" || exit 1
done done
@ -890,14 +907,6 @@ test -f $result || exit 1
test $r = 1 || v "$NROFF -mdoc <'$srcdir/mksh.1' >mksh.cat1" || \ test $r = 1 || 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 $eq = 0 && test $h = 1 && v size $result
case $curdir in
*\ *) echo "#!./mksh" >test.sh ;;
*) echo "#!$curdir/mksh" >test.sh ;;
esac
echo "export PATH='$PATH'" >>test.sh
echo "exec perl '$srcdir/check.pl' -s '$srcdir/check.t'" \
"-p '$curdir/mksh' -C $check_categories \$*$tsts" >>test.sh
chmod 755 test.sh
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 $eq = 1 && e=: