replace some cat with echo for speed

This commit is contained in:
tg
2008-10-24 21:35:21 +00:00
parent 5ac371071d
commit 9fca87b9c3

214
Build.sh
View File

@@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.359 2008/10/24 20:01:42 tg Exp $' srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.360 2008/10/24 21:35:21 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_NOPWNAM MKSH_NOVI # CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI
@@ -261,12 +261,10 @@ AIX)
CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
if test x"$LDFLAGS" = x""; then if test x"$LDFLAGS" = x""; then
LDFLAGS="${ccpl}-bI:crypt.exp" LDFLAGS="${ccpl}-bI:crypt.exp"
cat >crypt.exp <<-EOF echo '#!
#! __crypt_r
__crypt_r __encrypt_r
__encrypt_r __setkey_r' >crypt.exp
__setkey_r
EOF
fi fi
: ${LIBS='-lcrypt'} : ${LIBS='-lcrypt'}
: ${HAVE_SETLOCALE_CTYPE=0} : ${HAVE_SETLOCALE_CTYPE=0}
@@ -411,78 +409,72 @@ $e $bi$me: Scanning for functions... please ignore any errors.$ao
# - LLVM+clang defines __GNUC__ too # - LLVM+clang defines __GNUC__ too
CPP="$CC -E" CPP="$CC -E"
$e ... which compiler seems to be used $e ... which compiler seems to be used
cat >scn.c <<-'EOF' echo '#if defined(__ICC) || defined(__INTEL_COMPILER)
#if defined(__ICC) || defined(__INTEL_COMPILER) ct=icc
ct=icc #elif defined(__xlC__) || defined(__IBMC__)
#elif defined(__xlC__) || defined(__IBMC__) ct=xlc
ct=xlc #elif defined(__SUNPRO_C)
#elif defined(__SUNPRO_C) ct=sunpro
ct=sunpro #elif defined(__BORLANDC__)
#elif defined(__BORLANDC__) ct=bcc
ct=bcc #elif defined(__WATCOMC__)
#elif defined(__WATCOMC__) ct=watcom
ct=watcom #elif defined(__MWERKS__)
#elif defined(__MWERKS__) ct=metrowerks
ct=metrowerks #elif defined(__HP_cc)
#elif defined(__HP_cc) ct=hpcc
ct=hpcc #elif defined(__DECC) || (defined(__osf__) && !defined(__GNUC__))
#elif defined(__DECC) || (defined(__osf__) && !defined(__GNUC__)) ct=dec
ct=dec #elif defined(__PGI)
#elif defined(__PGI) ct=pgi
ct=pgi #elif defined(__DMC__)
#elif defined(__DMC__) ct=dmc
ct=dmc #elif defined(_MSC_VER)
#elif defined(_MSC_VER) ct=msc
ct=msc #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) ct=adsp
ct=adsp #elif defined(__IAR_SYSTEMS_ICC__)
#elif defined(__IAR_SYSTEMS_ICC__) ct=iar
ct=iar #elif defined(SDCC)
#elif defined(SDCC) ct=sdcc
ct=sdcc #elif defined(__PCC__)
#elif defined(__PCC__) ct=pcc
ct=pcc #elif defined(__TenDRA__)
#elif defined(__TenDRA__) ct=tendra
ct=tendra #elif defined(__TINYC__)
#elif defined(__TINYC__) ct=tcc
ct=tcc #elif defined(__llvm__) && defined(__clang__)
#elif defined(__llvm__) && defined(__clang__) ct=clang
ct=clang #elif defined(__GNUC__)
#elif defined(__GNUC__) ct=gcc
ct=gcc #elif defined(_COMPILER_VERSION)
#elif defined(_COMPILER_VERSION) ct=mipspro
ct=mipspro #elif defined(__sgi)
#elif defined(__sgi) ct=mipspro
ct=mipspro #elif defined(__hpux) || defined(__hpua)
#elif defined(__hpux) || defined(__hpua) ct=hpcc
ct=hpcc #elif defined(__ultrix)
#elif defined(__ultrix) ct=ucode
ct=ucode #else
#else ct=unknown
ct=unknown #endif' >scn.c
#endif
EOF
ct=unknown ct=unknown
vv ']' "$CPP scn.c | grep ct= | tr -d \\\\015 >x" vv ']' "$CPP scn.c | grep ct= | tr -d \\\\015 >x"
sed 's/^/[ /' x sed 's/^/[ /' x
eval `cat x` eval `cat x`
rm -f x rm -f x
cat >scn.c <<-'EOF' echo 'int main(void) { return (0); }' >scn.c
int main(void) { return (0); }
EOF
case $ct in case $ct in
adsp) adsp)
cat >&2 <<-'EOF' echo >&2 'Warning: Analog Devices C++ compiler for Blackfin, TigerSHARC
Warning: Analog Devices C++ compiler for Blackfin, TigerSHARC and SHARC (21000) DSPs detected. This compiler has not yet
and SHARC (21000) DSPs detected. This compiler has not yet been tested for compatibility with mksh. Continue at your
been tested for compatibility with mksh. Continue at your own risk, please report success/failure to the developers.'
own risk, please report success/failure to the developers.
EOF
;; ;;
bcc) bcc)
echo >&2 "Warning: Borland C++ Builder detected. This compiler might" echo >&2 "Warning: Borland C++ Builder detected. This compiler might
echo >&2 " produce broken executables. Continue at your own risk," produce broken executables. Continue at your own risk,
echo >&2 " please report success/failure to the developers." please report success/failure to the developers."
;; ;;
clang) clang)
# does not work with current "ccc" compiler driver # does not work with current "ccc" compiler driver
@@ -506,22 +498,18 @@ hpcc)
vv '|' "$CC -V scn.c" vv '|' "$CC -V scn.c"
;; ;;
iar) iar)
cat >&2 <<-'EOF' echo >&2 'Warning: IAR Systems (http://www.iar.com) compiler for embedded
Warning: IAR Systems (http://www.iar.com) compiler for embedded systems detected. This unsupported compiler has not yet
systems detected. This unsupported compiler has not yet been tested for compatibility with mksh. Continue at your
been tested for compatibility with mksh. Continue at your own risk, please report success/failure to the developers.'
own risk, please report success/failure to the developers.
EOF
;; ;;
icc) icc)
vv '|' "$CC -V" vv '|' "$CC -V"
;; ;;
metrowerks) metrowerks)
cat >&2 <<-'EOF' echo >&2 'Warning: Metrowerks C compiler detected. This has not yet
Warning: Metrowerks C compiler detected. This has not yet been tested for compatibility with mksh. Continue at your
been tested for compatibility with mksh. Continue at your own risk, please report success/failure to the developers.'
own risk, please report success/failure to the developers.
EOF
;; ;;
mipspro) mipspro)
vv '|' "$CC -version" vv '|' "$CC -version"
@@ -549,19 +537,15 @@ pcc)
vv '|' "$CC -v" vv '|' "$CC -v"
;; ;;
pgi) pgi)
cat >&2 <<-'EOF' echo >&2 'Warning: PGI detected. This unknown compiler has not yet
Warning: PGI detected. This unknown compiler has not yet been tested for compatibility with mksh. Continue at your
been tested for compatibility with mksh. Continue at your own risk, please report success/failure to the developers.'
own risk, please report success/failure to the developers.
EOF
;; ;;
sdcc) sdcc)
cat >&2 <<-'EOF' echo >&2 'Warning: sdcc (http://sdcc.sourceforge.net), the small devices
Warning: sdcc (http://sdcc.sourceforge.net), the small devices C compiler for embedded systems detected. This has not yet
C compiler for embedded systems detected. This has not yet been tested for compatibility with mksh. Continue at your
been tested for compatibility with mksh. Continue at your own risk, please report success/failure to the developers.'
own risk, please report success/failure to the developers.
EOF
;; ;;
sunpro) sunpro)
vv '|' "$CC -V scn.c" vv '|' "$CC -V scn.c"
@@ -577,11 +561,9 @@ ucode)
vv '|' "$CC -Wl,-V scn.c" vv '|' "$CC -Wl,-V scn.c"
;; ;;
watcom) watcom)
cat >&2 <<-'EOF' echo >&2 'Warning: Watcom C Compiler detected. This compiler has not yet
Warning: Watcom C Compiler detected. This compiler has not yet been tested for compatibility with mksh. Continue at your
been tested for compatibility with mksh. Continue at your own risk, please report success/failure to the developers.'
own risk, please report success/failure to the developers.
EOF
;; ;;
xlc) xlc)
vv '|' "$CC -qversion=verbose" vv '|' "$CC -qversion=verbose"
@@ -751,9 +733,7 @@ elif test $ct = mipspro; then
ac_flags 1 fullwarn -fullwarn 'for remark output support' ac_flags 1 fullwarn -fullwarn 'for remark output support'
elif test $ct = msc; then elif test $ct = msc; then
ac_flags 1 strpool "${ccpc}/GF" 'if string pooling can be enabled' ac_flags 1 strpool "${ccpc}/GF" 'if string pooling can be enabled'
cat >x <<-'EOF' echo 'int main(void) { char test[64] = ""; return (*test); }' >x
int main(void) { char test[64] = ""; return (*test); }
EOF
ac_flags - 1 stackon "${ccpc}/GZ" 'if stack checks can be enabled' <x ac_flags - 1 stackon "${ccpc}/GZ" 'if stack checks can be enabled' <x
ac_flags - 1 stckall "${ccpc}/Ge" 'stack checks for all functions' <x ac_flags - 1 stckall "${ccpc}/Ge" 'stack checks for all functions' <x
ac_flags - 1 secuchk "${ccpc}/GS" 'for compiler security checks' <x ac_flags - 1 secuchk "${ccpc}/GS" 'for compiler security checks' <x
@@ -906,14 +886,12 @@ ac_cppflags STDINT_H
# #
# Environment: definitions # Environment: definitions
# #
cat >lft.c <<-'EOF' echo '#include <sys/types.h>
#include <sys/types.h> /* check that off_t can represent 2^63-1 correctly, thx FSF */
/* check that off_t can represent 2^63-1 correctly, thx FSF */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 &&
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1];
LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main(void) { return (0); }' >lft.c
int main(void) { return (0); }
EOF
ac_testn can_lfs '' "for large file support" <lft.c ac_testn can_lfs '' "for large file support" <lft.c
save_CPPFLAGS=$CPPFLAGS save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64"
@@ -1218,17 +1196,15 @@ if test 0 = $HAVE_SYS_SIGNAME; then
$e No list of signal names available via cpp. Falling back... $e No list of signal names available via cpp. Falling back...
fi fi
sigseen=: sigseen=:
cat >scn.c <<-'EOF' echo '#include <signal.h>
#include <signal.h> #ifndef NSIG
#ifndef NSIG #if defined(_NSIG)
#if defined(_NSIG) #define NSIG _NSIG
#define NSIG _NSIG #elif defined(SIGMAX)
#elif defined(SIGMAX) #define NSIG (SIGMAX+1)
#define NSIG (SIGMAX+1) #endif
#endif #endif
#endif mksh_cfg: NSIG' >scn.c
mksh_cfg: NSIG
EOF
NSIG=`vq "$CPP $CPPFLAGS scn.c" | grep mksh_cfg: | \ NSIG=`vq "$CPP $CPPFLAGS scn.c" | grep mksh_cfg: | \
sed 's/^mksh_cfg:[ ]*\([0-9x ()+-]*\).*$/\1/'` sed 's/^mksh_cfg:[ ]*\([0-9x ()+-]*\).*$/\1/'`
case $NSIG in case $NSIG in