Merge remote-tracking branch 'mksh/master'
Conflicts: Build.sh check.pl check.t edit.c emacsfn.h exec.c funcs.c main.c misc.c sh.h var.c
This commit is contained in:
90
Build.sh
90
Build.sh
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.681 2015/07/06 17:48:28 tg Exp $'
|
||||
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.689 2015/07/10 17:16:23 tg Exp $'
|
||||
#-
|
||||
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
# 2011, 2012, 2013, 2014, 2015
|
||||
@ -578,8 +578,8 @@ if test -d $tfn || test -d $tfn.exe; then
|
||||
echo "$me: Error: ./$tfn is a directory!" >&2
|
||||
exit 1
|
||||
fi
|
||||
rmf a.exe* a.out* conftest.c *core core.* ${tfn}* *.bc *.dbg *.ll *.o *.gen \
|
||||
Rebuild.sh lft no signames.inc test.sh x vv.out
|
||||
rmf a.exe* a.out* conftest.c conftest.exe* *core core.* ${tfn}* *.bc *.dbg \
|
||||
*.ll *.o *.gen Rebuild.sh lft no signames.inc test.sh x vv.out
|
||||
|
||||
SRCS="lalloc.c eval.c exec.c expr.c funcs.c histrap.c jobs.c"
|
||||
SRCS="$SRCS lex.c main.c misc.c shf.c syn.c tree.c var.c"
|
||||
@ -683,14 +683,14 @@ esac
|
||||
# Configuration depending on OS name
|
||||
case $TARGET_OS in
|
||||
386BSD)
|
||||
: ${HAVE_CAN_OTWO=0}
|
||||
: "${HAVE_CAN_OTWO=0}"
|
||||
add_cppflags -DMKSH_NO_SIGSETJMP
|
||||
add_cppflags -DMKSH_TYPEDEF_SIG_ATOMIC_T=int
|
||||
add_cppflags -DMKSH_CONSERVATIVE_FDS
|
||||
;;
|
||||
AIX)
|
||||
add_cppflags -D_ALL_SOURCE
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
BeOS)
|
||||
case $KSH_VERSION in
|
||||
@ -709,7 +709,7 @@ BeOS)
|
||||
add_cppflags -DMKSH__NO_SETEUGID
|
||||
;;
|
||||
BSD/OS)
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
Coherent)
|
||||
oswarn="; it has major issues"
|
||||
@ -720,7 +720,7 @@ Coherent)
|
||||
add_cppflags -DMKSH_DISABLE_TTY_WARNING
|
||||
;;
|
||||
CYGWIN*)
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
Darwin)
|
||||
add_cppflags -D_DARWIN_C_SOURCE
|
||||
@ -733,7 +733,7 @@ FreeMiNT)
|
||||
oswarn="; it has minor issues"
|
||||
add_cppflags -D_GNU_SOURCE
|
||||
add_cppflags -DMKSH_CONSERVATIVE_FDS
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
GNU)
|
||||
case $CC in
|
||||
@ -758,11 +758,11 @@ Interix)
|
||||
ccpc='-X '
|
||||
ccpl='-Y '
|
||||
add_cppflags -D_ALL_SOURCE
|
||||
: ${LIBS='-lcrypt'}
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${LIBS=-lcrypt}"
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
IRIX*)
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
Linux)
|
||||
case $CC in
|
||||
@ -770,7 +770,7 @@ Linux)
|
||||
*) add_cppflags -D_GNU_SOURCE ;;
|
||||
esac
|
||||
add_cppflags -DSETUID_CAN_FAIL_WITH_EAGAIN
|
||||
: ${HAVE_REVOKE=0}
|
||||
: "${HAVE_REVOKE=0}"
|
||||
;;
|
||||
LynxOS)
|
||||
oswarn="; it has minor issues"
|
||||
@ -783,7 +783,7 @@ Minix-vmd)
|
||||
add_cppflags -DMKSH_CONSERVATIVE_FDS
|
||||
add_cppflags -D_MINIX_SOURCE
|
||||
oldish_ed=no-stderr-ed # no /bin/ed, maybe see below
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
Minix3)
|
||||
add_cppflags -DMKSH_UNEMPLOYED
|
||||
@ -791,23 +791,24 @@ Minix3)
|
||||
add_cppflags -DMKSH_NO_LIMITS
|
||||
add_cppflags -D_POSIX_SOURCE -D_POSIX_1_SOURCE=2 -D_MINIX
|
||||
oldish_ed=no-stderr-ed # /usr/bin/ed(!) is broken
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
MirBSD)
|
||||
;;
|
||||
MSYS_*)
|
||||
add_cppflags -DMKSH_ASSUME_UTF8=0; HAVE_ISSET_MKSH_ASSUME_UTF8=1
|
||||
# almost same as CYGWIN* (from RT|Chatzilla)
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
# broken on this OE (from ir0nh34d)
|
||||
: ${HAVE_STDINT_H=0}
|
||||
: "${HAVE_STDINT_H=0}"
|
||||
;;
|
||||
NetBSD)
|
||||
;;
|
||||
NEXTSTEP)
|
||||
add_cppflags -D_NEXT_SOURCE
|
||||
add_cppflags -D_POSIX_SOURCE
|
||||
: ${AWK=gawk} ${CC=cc -posix}
|
||||
: "${AWK=gawk}"
|
||||
: "${CC=cc -posix}"
|
||||
add_cppflags -DMKSH_NO_SIGSETJMP
|
||||
# NeXTstep cannot get a controlling tty
|
||||
add_cppflags -DMKSH_UNEMPLOYED
|
||||
@ -828,11 +829,15 @@ Ninix3)
|
||||
oswarn="; it has unknown issues"
|
||||
;;
|
||||
OpenBSD)
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
OS/2)
|
||||
: ${CC=gcc}
|
||||
: ${SIZE=echo ignore size}
|
||||
HAVE_TERMIOS_H=0
|
||||
HAVE_MKNOD=0 # setmode() incompatible
|
||||
oswarn="; it is currently being ported"
|
||||
check_categories="$check_categories nosymlink"
|
||||
: "${CC=gcc}"
|
||||
: "${SIZE=: size}"
|
||||
SRCS="$SRCS os2.c"
|
||||
add_cppflags -DMKSH_UNEMPLOYED
|
||||
add_cppflags -DMKSH_NOPROSPECTOFWORK
|
||||
@ -843,7 +848,7 @@ OSF1)
|
||||
add_cppflags -D_POSIX_C_SOURCE=200112L
|
||||
add_cppflags -D_XOPEN_SOURCE=600
|
||||
add_cppflags -D_XOPEN_SOURCE_EXTENDED
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
Plan9)
|
||||
add_cppflags -D_POSIX_SOURCE
|
||||
@ -861,7 +866,7 @@ Plan9)
|
||||
PW32*)
|
||||
HAVE_SIG_T=0 # incompatible
|
||||
oswarn=' and will currently not work'
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
QNX)
|
||||
add_cppflags -D__NO_EXT_QNX
|
||||
@ -871,7 +876,7 @@ QNX)
|
||||
oldish_ed=no-stderr-ed # oldish /bin/ed is broken
|
||||
;;
|
||||
esac
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
SCO_SV)
|
||||
case $TARGET_OSREV in
|
||||
@ -888,7 +893,7 @@ SCO_SV)
|
||||
;;
|
||||
esac
|
||||
add_cppflags -DMKSH_CONSERVATIVE_FDS
|
||||
: ${HAVE_SYS_SIGLIST=0} ${HAVE__SYS_SIGLIST=0}
|
||||
: "${HAVE_SYS_SIGLIST=0}${HAVE__SYS_SIGLIST=0}"
|
||||
;;
|
||||
skyos)
|
||||
oswarn="; it has minor issues"
|
||||
@ -903,15 +908,15 @@ syllable)
|
||||
oswarn=' and will currently not work'
|
||||
;;
|
||||
ULTRIX)
|
||||
: ${CC=cc -YPOSIX}
|
||||
: "${CC=cc -YPOSIX}"
|
||||
add_cppflags -DMKSH_TYPEDEF_SSIZE_T=int
|
||||
add_cppflags -DMKSH_CONSERVATIVE_FDS
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
UnixWare|UNIX_SV)
|
||||
# SCO UnixWare
|
||||
add_cppflags -DMKSH_CONSERVATIVE_FDS
|
||||
: ${HAVE_SYS_SIGLIST=0} ${HAVE__SYS_SIGLIST=0}
|
||||
: "${HAVE_SYS_SIGLIST=0}${HAVE__SYS_SIGLIST=0}"
|
||||
;;
|
||||
UWIN*)
|
||||
ccpc='-Yc,'
|
||||
@ -919,7 +924,7 @@ UWIN*)
|
||||
tsts=" 3<>/dev/tty"
|
||||
oswarn="; it will compile, but the target"
|
||||
oswarn="$oswarn${nl}platform itself is very flakey/unreliable"
|
||||
: ${HAVE_SETLOCALE_CTYPE=0}
|
||||
: "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
;;
|
||||
_svr4)
|
||||
# generic target for SVR4 Unix with uname -s = uname -n
|
||||
@ -933,9 +938,9 @@ _svr4)
|
||||
;;
|
||||
esac
|
||||
|
||||
: ${HAVE_MKNOD=0}
|
||||
: "${HAVE_MKNOD=0}"
|
||||
|
||||
: ${AWK=awk} ${CC=cc} ${NROFF=nroff} ${SIZE=size}
|
||||
: "${AWK=awk}${CC=cc}${NROFF=nroff}${SIZE=size}"
|
||||
test 0 = $r && echo | $NROFF -v 2>&1 | grep GNU >/dev/null 2>&1 && \
|
||||
echo | $NROFF -c >/dev/null 2>&1 && NROFF="$NROFF -c"
|
||||
|
||||
@ -1058,7 +1063,7 @@ ct="unknown"
|
||||
#endif
|
||||
;
|
||||
const char *
|
||||
#if defined(__KLIBC__)
|
||||
#if defined(__KLIBC__) && !defined(__OS2__)
|
||||
et="klibc"
|
||||
#else
|
||||
et="unknown"
|
||||
@ -1202,7 +1207,7 @@ uslc)
|
||||
SCO_SV:3.2*)
|
||||
# SCO OpenServer 5
|
||||
CFLAGS="$CFLAGS -g"
|
||||
: ${HAVE_CAN_OTWO=0} ${HAVE_CAN_OPTIMISE=0}
|
||||
: "${HAVE_CAN_OTWO=0}${HAVE_CAN_OPTIMISE=0}"
|
||||
;;
|
||||
esac
|
||||
vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -V conftest.c $LIBS"
|
||||
@ -1241,7 +1246,7 @@ unknown)
|
||||
;;
|
||||
esac
|
||||
$e "$bi==> which compiler seems to be used...$ao $ui$ct${et+ on $et}$ao"
|
||||
rmf conftest.c conftest.o conftest a.out* a.exe* vv.out
|
||||
rmf conftest.c conftest.o conftest a.out* a.exe* conftest.exe* vv.out
|
||||
|
||||
#
|
||||
# Compiler: works as-is, with -Wno-error and -Werror
|
||||
@ -1256,7 +1261,7 @@ test $ct = unknown || HAVE_COMPILER_KNOWN=1
|
||||
if ac_ifcpp 'if 0' compiler_fails '' \
|
||||
'if the compiler does not fail correctly'; then
|
||||
save_CFLAGS=$CFLAGS
|
||||
: ${HAVE_CAN_DELEXE=x}
|
||||
: "${HAVE_CAN_DELEXE=x}"
|
||||
case $ct in
|
||||
dec)
|
||||
CFLAGS="$CFLAGS ${ccpl}-non_shared"
|
||||
@ -1618,8 +1623,8 @@ phase=x
|
||||
#
|
||||
if ac_ifcpp 'ifdef MKSH_SMALL' isset_MKSH_SMALL '' \
|
||||
"if a reduced-feature mksh is requested"; then
|
||||
: ${HAVE_NICE=0}
|
||||
: ${HAVE_PERSISTENT_HISTORY=0}
|
||||
: "${HAVE_NICE=0}"
|
||||
: "${HAVE_PERSISTENT_HISTORY=0}"
|
||||
check_categories="$check_categories smksh"
|
||||
HAVE_ISSET_MKSH_CONSERVATIVE_FDS=1 # from sh.h
|
||||
fi
|
||||
@ -1633,7 +1638,7 @@ ac_ifcpp 'ifdef MKSH_NOPROSPECTOFWORK' isset_MKSH_NOPROSPECTOFWORK '' \
|
||||
"if mksh will be built without job signals" && \
|
||||
check_categories="$check_categories arge nojsig"
|
||||
ac_ifcpp 'ifdef MKSH_ASSUME_UTF8' isset_MKSH_ASSUME_UTF8 '' \
|
||||
'if the default UTF-8 mode is specified' && : ${HAVE_SETLOCALE_CTYPE=0}
|
||||
'if the default UTF-8 mode is specified' && : "${HAVE_SETLOCALE_CTYPE=0}"
|
||||
ac_ifcpp 'ifdef MKSH_CONSERVATIVE_FDS' isset_MKSH_CONSERVATIVE_FDS '' \
|
||||
'if traditional/conservative fd use is requested' && \
|
||||
check_categories="$check_categories convfds"
|
||||
@ -2338,7 +2343,7 @@ addsrcs '!' HAVE_STRLCPY strlcpy.c
|
||||
addsrcs USE_PRINTF_BUILTIN printf.c
|
||||
test 1 = "$USE_PRINTF_BUILTIN" && add_cppflags -DMKSH_PRINTF_BUILTIN
|
||||
test 1 = "$HAVE_CAN_VERB" && CFLAGS="$CFLAGS -verbose"
|
||||
add_cppflags -DMKSH_BUILD_R=510
|
||||
add_cppflags -DMKSH_BUILD_R=511
|
||||
|
||||
$e $bi$me: Finished configuration testing, now producing output.$ao
|
||||
|
||||
@ -2346,8 +2351,13 @@ files=
|
||||
objs=
|
||||
sp=
|
||||
case $tcfn in
|
||||
a.exe | conftest.exe) mkshexe=$tfn.exe ;;
|
||||
*) mkshexe=$tfn ;;
|
||||
a.exe|conftest.exe)
|
||||
mkshexe=$tfn.exe
|
||||
add_cppflags -DMKSH_EXE_EXT
|
||||
;;
|
||||
*)
|
||||
mkshexe=$tfn
|
||||
;;
|
||||
esac
|
||||
case $curdir in
|
||||
*\ *) mkshshebang="#!./$mkshexe" ;;
|
||||
|
Reference in New Issue
Block a user