diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2009-10-28 10:36:39 -0700 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2009-10-28 10:36:39 -0700 |
commit | 34f9b3eef6fdadbda0a846aa4d68691ac40eace5 (patch) | |
tree | 0b0fdfb35f8eb9324728de5a99e50e939aca650f /usr/src/lib/libshell/misc/buildksh93.sh | |
parent | 14969419acb89bb74e6c95fa472119b710224440 (diff) | |
download | illumos-joyent-34f9b3eef6fdadbda0a846aa4d68691ac40eace5.tar.gz |
Portions contributed by Olga Kryzhanovska <olga.kryzhanovska@gmail.com>
PSARC/2009/063 ksh93 update 2
PSARC/2009/248 ksh93 update to 2009-03-10
PSARC/2009/249 more ksh93 command conversions
6888396 libast sources should not include localedef.h
6605478 ksh93 profile shell option does not work
6631006 ksh93 hangs in situations that ksh handles okay
6661487 logname reports nothing after running the script command
6705126 first call to read doesn't honor new setting of HISTFILE
6764665 *libpp* Array overrun in libpp
6765756 *libast* Array overruns in libast
6769332 Recursive function+command substitutions terminate shell after 257 iterations
6777491 *ksh93* lacks arithmetric function iszero()
6778077 *ksh93* does not understand "THAW" as a signal for use with trap
6789247 [ku1] libast/ksh93 1-digit hexfloat base conversion rounds incorrectly
6791838 *ksh93* unset of a variable which is not set should return 0
6793714 RFE: Update /usr/bin/comm to AT&T AST "comm"
6793719 RFE: Update /usr/bin/cut to AT&T AST "cut"
6793721 RFE: Update /usr/bin/paste to AT&T AST "paste"
6793722 RFE: Update /usr/bin/cmp to AT&T AST "cmp"
6793726 RFE: Update /usr/bin/uniq to AT&T AST "uniq"
6793735 RFE: Update /usr/bin/wc to AT&T AST "wc"
6793744 RFE: Add /usr/share/doc/ksh/ for ksh93 documentation
6793747 RFE: Provide "print" builtin as /usr/bin/print for external applications
6793763 RFE: Update /usr/bin/ksh93 to ast-ksh.2009-05-05
6794952 RFE: Enable "globstar" mode in /etc/ksh.kshrc (= interactive ksh93 shells)
6805792 [ku1] Moving local compound var into array does not work
6805794 [ku1] printf returns "invalid character constant" for $ printf "%d\n" "'<euro>"
6805795 [ku1] ksh93 does not differ between -0 and +0
6805797 [ku1]Can't append to nodes of an array of compound vars if addressing them via nameref
6805799 Indexed compound variable arrays do not work...
6805800 [ku1] Declaring associative compound array does not work
6805813 RFE: Update /usr/bin/join to AT&T AST "join".
6805819 RFE: Update /usr/bin/tee to AT&T AST "tee".
6809663 shlint missing ending newline on errors
6811916 ksh93 repeatedly segfaults when "tee" builtin is interrupted via <ctrl-c> in interactive mode
6821113 SUNWosdem package issues
6828644 RFE: Update /usr/bin/logname to AT&T AST "logname".
6828692 RFE: Update /usr/bin/cksum to AT&T AST "cksum".
6834184 ksh93 gets SIGSEGV if HISTFILE is changed in place.
6834207 ksh93 gets SIGSEGV on interactive function definition with HISTSIZE unset
6835835 ksh93 "cat" builtin does not handle "-n" correctly
6841442 Need exception list for OS/Net trees managed via Subversion
6848486 "echo ${test}" with test undefined crashes the shell
6850672 ksh93 (VISUAL=vi) crashes with memory fault while scrolling through history
6855875 typeset -X x ; print $x # does not print sufficient digits to restore value
6857344 /usr/bin/hash core dump with invalid arguments
6866676 Need test suite module to test the kernel support for compiled shell scripts
6881017 Subshell doesn't exit, holds pipe open preventing callers from exiting
6884409 fts functions in libast library can result in segv with deep dir trees (similar to CERT VU#590371)
Diffstat (limited to 'usr/src/lib/libshell/misc/buildksh93.sh')
-rw-r--r-- | usr/src/lib/libshell/misc/buildksh93.sh | 67 |
1 files changed, 43 insertions, 24 deletions
diff --git a/usr/src/lib/libshell/misc/buildksh93.sh b/usr/src/lib/libshell/misc/buildksh93.sh index bc9c3c79a2..c590047edb 100644 --- a/usr/src/lib/libshell/misc/buildksh93.sh +++ b/usr/src/lib/libshell/misc/buildksh93.sh @@ -23,18 +23,18 @@ # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # -# buildksh93.ksh - ast-ksh standalone build script for the +# buildksh93.sh - ast-ksh standalone build script for the # OpenSolaris ksh93-integration project # # ksh93t sources can be downloaded like this from the AT&T site: -# wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/~gsf/download/tgz/INIT.2008-11-04.tgz' -# wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/~gsf/download/tgz/ast-ksh.2008-11-04.tgz' +# wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/sw/download/beta/INIT.2009-10-14.tgz' +# wget --http-user="I accept www.opensource.org/licenses/cpl" --http-passwd="." 'http://www.research.att.com/sw/download/beta/ast-ksh.2009-10-14.tgz' function fatal_error { @@ -93,7 +93,7 @@ cat <<ENDOFTEXT */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -143,6 +143,7 @@ extern "C" { /* undo ast_map.h #defines to avoid collision */ #undef basename #undef dirname +#undef mktemp /* Generated data, do not edit. */ XPG4CMDLIST(basename) @@ -159,6 +160,7 @@ BINCMDLIST(cksum) ASTCMDLIST(cksum) BINCMDLIST(cmp) ASTCMDLIST(cmp) +BINCMDLIST(comm) ASTCMDLIST(comm) XPG4CMDLIST(cp) ASTCMDLIST(cp) @@ -171,11 +173,13 @@ XPG4CMDLIST(expr) ASTCMDLIST(expr) ASTCMDLIST(fds) ASTCMDLIST(fmt) +BINCMDLIST(fold) ASTCMDLIST(fold) BINCMDLIST(head) ASTCMDLIST(head) XPG4CMDLIST(id) ASTCMDLIST(id) +BINCMDLIST(join) ASTCMDLIST(join) XPG4CMDLIST(ln) ASTCMDLIST(ln) @@ -185,10 +189,13 @@ BINCMDLIST(mkdir) ASTCMDLIST(mkdir) BINCMDLIST(mkfifo) ASTCMDLIST(mkfifo) +BINCMDLIST(mktemp) +ASTCMDLIST(mktemp) XPG4CMDLIST(mv) ASTCMDLIST(mv) BINCMDLIST(paste) ASTCMDLIST(paste) +BINCMDLIST(pathchk) ASTCMDLIST(pathchk) BINCMDLIST(rev) ASTCMDLIST(rev) @@ -204,6 +211,7 @@ SUSRBINCMDLIST(sync) SBINCMDLIST(sync) BINCMDLIST(sync) ASTCMDLIST(sync) +BINCMDLIST(tail) XPG4CMDLIST(tail) ASTCMDLIST(tail) BINCMDLIST(tee) @@ -305,14 +313,15 @@ function build_shell # gcc flags bgcc99="/usr/sfw/bin/gcc -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1" - bgcc_ccflags="${bon_flags} ${bast_flags} -D_lib_socket=1 -lsocket -lnsl" + bgcc_warnflags="-Wall -Wextra -Wno-unknown-pragmas -Wno-missing-braces -Wno-sign-compare -Wno-parentheses -Wno-uninitialized -Wno-implicit-function-declaration -Wno-unused -Wno-trigraphs -Wno-char-subscripts -Wno-switch" + bgcc_ccflags="${bon_flags} ${bgcc_warnflags} ${bast_flags} -D_lib_socket=1 -lsocket -lnsl" - case "${buildmode}" in - *.i386.32bit.suncc*) HOSTTYPE="sol11.i386" CC="${bsunc99}" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" ;; - *.i386.64bit.suncc*) HOSTTYPE="sol11.i386" CC="${bsunc99} -xarch=amd64 -KPIC" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" ;; - *.sparc.32bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99}" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;; - *.sparc.64bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99} -xarch=v9 -dalign -KPIC" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;; + # for -m32/-m64 flags see usr/src/Makefile.master, makefile symbols *_XARCH/co. + *.i386.32bit.suncc*) HOSTTYPE="sol11.i386" CC="${bsunc99} -m32" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" ;; + *.i386.64bit.suncc*) HOSTTYPE="sol11.i386" CC="${bsunc99} -m64 -KPIC" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" ;; + *.sparc.32bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99} -m32" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;; + *.sparc.64bit.suncc*) HOSTTYPE="sol11.sun4" CC="${bsunc99} -m64 -dalign -KPIC" cc_sharedlib="-G" CCFLAGS="${bsuncc_ccflags}" bsuncc_app_ccflags="${bsuncc_app_ccflags_sparc}" ;; *.i386.32bit.gcc*) HOSTTYPE="sol11.i386" CC="${bgcc99} -fPIC" cc_sharedlib="-shared" CCFLAGS="${bgcc_ccflags}" ;; *.i386.64bit.gcc*) HOSTTYPE="sol11.i386" CC="${bgcc99} -m64 -mtune=opteron -Ui386 -U__i386 -fPIC" cc_sharedlib="-shared" CCFLAGS="${bgcc_ccflags}" ;; @@ -349,17 +358,22 @@ function build_shell [[ -s $log ]] || fatal_error "build_shell: no make.out log found." + if [[ -f ${root}/lib/libast-g.a ]] then link_libast="ast-g" ; else link_libast="ast" ; fi + if [[ -f ${root}/lib/libdll-g.a ]] then link_libdll="dll-g" ; else link_libdll="dll" ; fi + if [[ -f ${root}/lib/libsum-g.a ]] then link_libsum="sum-g" ; else link_libsum="sum" ; fi + if [[ -f ${root}/lib/libcmd-g.a ]] then link_libcmd="cmd-g" ; else link_libcmd="cmd" ; fi + if [[ -f ${root}/lib/libshell-g.a ]] then link_libshell="shell-g" ; else link_libshell="shell" ; fi + if [[ "${buildmode}" != *.staticshell* ]] ; then # libcmd causes some trouble since there is a squatter in solaris # This has been fixed in Solaris 11/B48 but may require adjustments # for older Solaris releases for lib in libast libdll libsum libcmd libshell ; do - (( $? == 0 )) || exit 1 case "$lib" in libshell) - base="lib/" + base="src/cmd/ksh93/" vers=1 - link="-L${root}/lib/ -lcmd -lsum -ldll -last -lm" + link="-L${root}/lib/ -l${link_libcmd} -l${link_libsum} -l${link_libdll} -l${link_libast} -lm" ;; libdll) base="src/lib/${lib}" @@ -374,20 +388,23 @@ function build_shell *) base="src/lib/${lib}" vers=1 - link="-L${root}/lib/ -last -lm" + link="-L${root}/lib/ -l${link_libast} -lm" ;; esac ( cd "${root}/${base}" + + if [[ -f ${lib}-g.a ]] ; then lib_a="${lib}-g.a" ; else lib_a="${lib}.a" ; fi + if [[ "${buildmode}" == *solaris* ]] ; then - ${CC} ${cc_sharedlib} ${CCFLAGS} -Bdirect -Wl,-zallextract -Wl,-zmuldefs -o "${root}/lib/${lib}.so.${vers}" "${lib}.a" $link + ${CC} ${cc_sharedlib} ${CCFLAGS} -Bdirect -Wl,-zallextract -Wl,-zmuldefs -o "${root}/lib/${lib}.so.${vers}" "${lib_a}" $link else - ${CC} ${cc_sharedlib} ${CCFLAGS} -Wl,--whole-archive -Wl,-zmuldefs "${lib}.a" -Wl,--no-whole-archive -o "${root}/lib/${lib}.so.${vers}" $link + ${CC} ${cc_sharedlib} ${CCFLAGS} -Wl,--whole-archive -Wl,-zmuldefs "${lib_a}" -Wl,--no-whole-archive -o "${root}/lib/${lib}.so.${vers}" $link fi #rm ${lib}.a - mv "${lib}.a" "disabled_${lib}.a_" + mv "${lib_a}" "disabled_${lib_a}_" cd "${root}/lib" ln -sf "${lib}.so.${vers}" "${lib}.so" @@ -398,13 +415,13 @@ function build_shell base=src/cmd/ksh93 cd "${root}/${base}" rm -f \ - "${root}/lib/libshell.a" \ - "${root}/lib/libsum.a" \ - "${root}/lib/libdll.a" \ - "${root}/lib/libast.a" + "${root}/lib/libshell.a" "${root}/lib/libshell-g.a" \ + "${root}/lib/libsum.a" "${root}/lib/libsum-g.a" \ + "${root}/lib/libdll.a" "${root}/lib/libdll-g.a" \ + "${root}/lib/libast.a""${root}/lib/libast-g.a" if [[ "${buildmode}" == *solaris* ]] ; then - ${CC} ${CCFLAGS} ${bsuncc_app_ccflags} -L${root}/lib/ -Bdirect -o ksh pmain.o -lshell -Bstatic -lcmd -Bdynamic -lsum -ldll -last -lm -lmd -lsecdb + ${CC} ${CCFLAGS} ${bsuncc_app_ccflags} -L${root}/lib/ -Bdirect -o ksh pmain.o -lshell -Bstatic -l${link_libcmd} -Bdynamic -lsum -ldll -last -lm -lmd -lsecdb else ${CC} ${CCFLAGS} ${bsuncc_app_ccflags} -L${root}/lib/ -o ksh pmain.o -lshell -lcmd -lsum -ldll -last -lm fi @@ -445,6 +462,8 @@ function test_shell { set -o errexit set -o xtrace + + ulimit -s 65536 # need larger stack on 64bit SPARC to pass all tests export SHELL="$(ls -1 $PWD/arch/*/src/cmd/ksh93/ksh)" export LD_LIBRARY_PATH="$(ls -1ad $PWD/arch/*/lib):${LD_LIBRARY_PATH}" @@ -456,7 +475,7 @@ function test_shell [[ ! -f "${SHELL}" ]] && fatal_error "test_shell: |${SHELL}| is not a file." [[ ! -x "${SHELL}" ]] && fatal_error "test_shell: |${SHELL}| is not executable." - [[ "${TEST_LANG}" == "" ]] && TEST_LANG="C" + [[ "${TEST_LANG}" == "" ]] && TEST_LANG="C ja_JP.UTF-8" case "${buildmode}" in testshell.bcheck*) |