From 3950ffe2a485479f6561c27364d3d7df5a21d124 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sun, 24 Jun 2012 22:28:35 +0000 Subject: Imported Upstream version 93u+ --- README | 29 + bin/ignore | 24 + bin/mamprobe | 248 + bin/package | 7284 +++++++++++ bin/silent | 23 + lib/package/INIT.README | 1013 ++ lib/package/INIT.html | 991 ++ lib/package/INIT.pkg | 12 + lib/package/INIT.req | 0 lib/package/INIT.ver | 1 + lib/package/LICENSES/epl | 221 + lib/package/ast-ksh.README | 5212 ++++++++ lib/package/ast-ksh.html | 5346 ++++++++ lib/package/ast-ksh.pkg | 89 + lib/package/ast-ksh.req | 0 lib/package/ast-ksh.ver | 1 + lib/package/ast.def | 47 + lib/package/ast.lic | 5 + lib/package/epl.def | 8 + lib/package/ksh.pkg | 14 + lib/package/ksh.req | 0 lib/package/ksh.ver | 1 + lib/package/package.mk | 1537 +++ src/Makefile | 1 + src/Mamfile | 7 + src/cmd/INIT/C+probe | 870 ++ src/cmd/INIT/CONVERT.mk | 260 + src/cmd/INIT/MAPLIB.mk | 45 + src/cmd/INIT/MSGFUN.mk | 2 + src/cmd/INIT/MSGKEY.mk | 2 + src/cmd/INIT/Makefile | 293 + src/cmd/INIT/Mamfile | 1332 ++ src/cmd/INIT/PROBE.mk | 13 + src/cmd/INIT/RELEASE | 918 ++ src/cmd/INIT/TEST.mk | 197 + src/cmd/INIT/WWW.mk | 450 + src/cmd/INIT/ar.ibm.risc | 9 + src/cmd/INIT/cc.darwin | 73 + src/cmd/INIT/cc.darwin.i386 | 73 + src/cmd/INIT/cc.darwin.i386-64 | 73 + src/cmd/INIT/cc.hp.ia64 | 13 + src/cmd/INIT/cc.hp.pa | 13 + src/cmd/INIT/cc.hp.pa64 | 11 + src/cmd/INIT/cc.ibm.risc | 63 + src/cmd/INIT/cc.ibm.risc.gcc | 36 + src/cmd/INIT/cc.linux.i386-64-icc | 22 + src/cmd/INIT/cc.linux.i386-icc | 22 + src/cmd/INIT/cc.linux.ia64-icc | 22 + src/cmd/INIT/cc.lynxos.i386 | 81 + src/cmd/INIT/cc.lynxos.ppc | 85 + src/cmd/INIT/cc.mvs.390 | 279 + src/cmd/INIT/cc.next.i386 | 158 + src/cmd/INIT/cc.next.m68k | 9 + src/cmd/INIT/cc.osf.alpha | 9 + src/cmd/INIT/cc.pentium4 | 26 + src/cmd/INIT/cc.sco.i386 | 9 + src/cmd/INIT/cc.sgi.mips2 | 68 + src/cmd/INIT/cc.sgi.mips3 | 110 + src/cmd/INIT/cc.sgi.mips3-o32 | 65 + src/cmd/INIT/cc.sgi.mips4 | 90 + src/cmd/INIT/cc.sgi.mips4-n32 | 65 + src/cmd/INIT/cc.specialize | 35 + src/cmd/INIT/cc.unix.mc68k | 76 + src/cmd/INIT/crossexec.sh | 139 + src/cmd/INIT/db.c | 37 + src/cmd/INIT/ditto.sh | 460 + src/cmd/INIT/dl.c | 33 + src/cmd/INIT/execrate.sh | 179 + src/cmd/INIT/filter.sh | 98 + src/cmd/INIT/gdbm.c | 37 + src/cmd/INIT/gdbm1.c | 37 + src/cmd/INIT/gdbm2.c | 37 + src/cmd/INIT/hello.c | 23 + src/cmd/INIT/hosttype.tst | 6 + src/cmd/INIT/hurl.sh | 207 + src/cmd/INIT/iconv.c | 29 + src/cmd/INIT/iffe.sh | 4639 +++++++ src/cmd/INIT/iffe.tst | 1943 +++ src/cmd/INIT/ignore.sh | 43 + src/cmd/INIT/intl.c | 29 + src/cmd/INIT/ld.hp.pa | 5 + src/cmd/INIT/ldd.cygwin.i386 | 22 + src/cmd/INIT/ldd.darwin | 2 + src/cmd/INIT/ldd.hp.pa | 21 + src/cmd/INIT/ldd.ibm.risc | 16 + src/cmd/INIT/ldd.lynxos | 1 + src/cmd/INIT/ldd.mvs.390 | 18 + src/cmd/INIT/ldd.sgi | 2 + src/cmd/INIT/m.c | 34 + src/cmd/INIT/m2.c | 36 + src/cmd/INIT/m3.c | 36 + src/cmd/INIT/m4.c | 32 + src/cmd/INIT/m5.c | 32 + src/cmd/INIT/m6.c | 34 + src/cmd/INIT/make.probe | 2242 ++++ src/cmd/INIT/mamake.c | 2375 ++++ src/cmd/INIT/mamake.rt | 40 + src/cmd/INIT/mamake.tst | 63 + src/cmd/INIT/mamprobe.sh | 267 + src/cmd/INIT/mkdir.sh | 80 + src/cmd/INIT/mktest.sh | 641 + src/cmd/INIT/mprobe.sh | 30 + src/cmd/INIT/nsl.c | 31 + src/cmd/INIT/p.c | 24 + src/cmd/INIT/package.mk | 1537 +++ src/cmd/INIT/package.sh | 7302 +++++++++++ src/cmd/INIT/probe.win32 | 283 + src/cmd/INIT/proto.c | 5283 ++++++++ src/cmd/INIT/ratz.c | 5293 ++++++++ src/cmd/INIT/regress.sh | 1463 +++ src/cmd/INIT/release.c | 366 + src/cmd/INIT/rt.sh | 479 + src/cmd/INIT/silent.sh | 42 + src/cmd/INIT/socket.c | 33 + src/cmd/INIT/w.c | 30 + src/cmd/INIT/w2.c | 27 + src/cmd/Makefile | 1 + src/cmd/Mamfile | 7 + src/cmd/ksh93/COMPATIBILITY | 136 + src/cmd/ksh93/DESIGN | 170 + src/cmd/ksh93/Makefile | 248 + src/cmd/ksh93/Mamfile | 1527 +++ src/cmd/ksh93/OBSOLETE | 152 + src/cmd/ksh93/PROMO.mm | 141 + src/cmd/ksh93/README | 232 + src/cmd/ksh93/RELEASE | 2888 +++++ src/cmd/ksh93/RELEASE88 | 422 + src/cmd/ksh93/RELEASE93 | 455 + src/cmd/ksh93/TYPES | 182 + src/cmd/ksh93/bltins/alarm.c | 276 + src/cmd/ksh93/bltins/cd_pwd.c | 250 + src/cmd/ksh93/bltins/cflow.c | 117 + src/cmd/ksh93/bltins/enum.c | 284 + src/cmd/ksh93/bltins/getopts.c | 199 + src/cmd/ksh93/bltins/hist.c | 312 + src/cmd/ksh93/bltins/misc.c | 590 + src/cmd/ksh93/bltins/mkservice.c | 494 + src/cmd/ksh93/bltins/print.c | 1058 ++ src/cmd/ksh93/bltins/read.c | 802 ++ src/cmd/ksh93/bltins/regress.c | 343 + src/cmd/ksh93/bltins/sleep.c | 235 + src/cmd/ksh93/bltins/test.c | 667 + src/cmd/ksh93/bltins/trap.c | 420 + src/cmd/ksh93/bltins/typeset.c | 1471 +++ src/cmd/ksh93/bltins/ulimit.c | 216 + src/cmd/ksh93/bltins/umask.c | 98 + src/cmd/ksh93/bltins/whence.c | 294 + src/cmd/ksh93/builtins.mm | 648 + src/cmd/ksh93/data/aliases.c | 57 + src/cmd/ksh93/data/bash_pre_rc.sh | 255 + src/cmd/ksh93/data/builtins.c | 1902 +++ src/cmd/ksh93/data/keywords.c | 62 + src/cmd/ksh93/data/lexstates.c | 417 + src/cmd/ksh93/data/limits.c | 62 + src/cmd/ksh93/data/math.tab | 75 + src/cmd/ksh93/data/msg.c | 215 + src/cmd/ksh93/data/options.c | 149 + src/cmd/ksh93/data/signals.c | 244 + src/cmd/ksh93/data/strdata.c | 104 + src/cmd/ksh93/data/testops.c | 174 + src/cmd/ksh93/data/variables.c | 136 + src/cmd/ksh93/edit/completion.c | 572 + src/cmd/ksh93/edit/edit.c | 1806 +++ src/cmd/ksh93/edit/emacs.c | 1571 +++ src/cmd/ksh93/edit/hexpand.c | 734 ++ src/cmd/ksh93/edit/history.c | 1222 ++ src/cmd/ksh93/edit/vi.c | 2753 ++++ src/cmd/ksh93/features/cmds | 4 + src/cmd/ksh93/features/dynamic | 12 + src/cmd/ksh93/features/externs | 13 + src/cmd/ksh93/features/locale | 27 + src/cmd/ksh93/features/math.sh | 305 + src/cmd/ksh93/features/options | 47 + src/cmd/ksh93/features/poll | 157 + src/cmd/ksh93/features/rlimits | 3 + src/cmd/ksh93/features/setjmp | 18 + src/cmd/ksh93/features/sigfeatures | 49 + src/cmd/ksh93/features/time | 35 + src/cmd/ksh93/features/ttys | 3 + src/cmd/ksh93/fun/dirs | 108 + src/cmd/ksh93/fun/popd | 111 + src/cmd/ksh93/fun/pushd | 111 + src/cmd/ksh93/include/argnod.h | 145 + src/cmd/ksh93/include/builtins.h | 202 + src/cmd/ksh93/include/defs.h | 509 + src/cmd/ksh93/include/edit.h | 286 + src/cmd/ksh93/include/env.h | 50 + src/cmd/ksh93/include/fault.h | 127 + src/cmd/ksh93/include/fcin.h | 71 + src/cmd/ksh93/include/history.h | 75 + src/cmd/ksh93/include/io.h | 126 + src/cmd/ksh93/include/jobs.h | 216 + src/cmd/ksh93/include/lexstates.h | 157 + src/cmd/ksh93/include/name.h | 268 + src/cmd/ksh93/include/national.h | 37 + src/cmd/ksh93/include/nval.h | 311 + src/cmd/ksh93/include/path.h | 147 + src/cmd/ksh93/include/regress.h | 66 + src/cmd/ksh93/include/shell.h | 259 + src/cmd/ksh93/include/shlex.h | 171 + src/cmd/ksh93/include/shnodes.h | 221 + src/cmd/ksh93/include/shtable.h | 65 + src/cmd/ksh93/include/streval.h | 207 + src/cmd/ksh93/include/terminal.h | 195 + src/cmd/ksh93/include/test.h | 72 + src/cmd/ksh93/include/timeout.h | 30 + src/cmd/ksh93/include/ulimit.h | 174 + src/cmd/ksh93/include/variables.h | 111 + src/cmd/ksh93/include/version.h | 20 + src/cmd/ksh93/ksh-regress.rt | 71 + src/cmd/ksh93/ksh-regress.tst | 22544 +++++++++++++++++++++++++++++++++ src/cmd/ksh93/mamexec | 307 + src/cmd/ksh93/mamstate.c | 73 + src/cmd/ksh93/nval.3 | 688 + src/cmd/ksh93/sh.1 | 8142 ++++++++++++ src/cmd/ksh93/sh.memo | 3248 +++++ src/cmd/ksh93/sh/args.c | 892 ++ src/cmd/ksh93/sh/arith.c | 549 + src/cmd/ksh93/sh/array.c | 1843 +++ src/cmd/ksh93/sh/bash.c | 423 + src/cmd/ksh93/sh/defs.c | 48 + src/cmd/ksh93/sh/deparse.c | 603 + src/cmd/ksh93/sh/env.c | 255 + src/cmd/ksh93/sh/expand.c | 468 + src/cmd/ksh93/sh/fault.c | 672 + src/cmd/ksh93/sh/fcin.c | 214 + src/cmd/ksh93/sh/init.c | 2238 ++++ src/cmd/ksh93/sh/io.c | 2647 ++++ src/cmd/ksh93/sh/jobs.c | 2055 +++ src/cmd/ksh93/sh/lex.c | 2516 ++++ src/cmd/ksh93/sh/macro.c | 2814 ++++ src/cmd/ksh93/sh/main.c | 787 ++ src/cmd/ksh93/sh/name.c | 3684 ++++++ src/cmd/ksh93/sh/nvdisc.c | 1468 +++ src/cmd/ksh93/sh/nvtree.c | 1161 ++ src/cmd/ksh93/sh/nvtype.c | 1709 +++ src/cmd/ksh93/sh/parse.c | 2082 +++ src/cmd/ksh93/sh/path.c | 1824 +++ src/cmd/ksh93/sh/pmain.c | 46 + src/cmd/ksh93/sh/shcomp.c | 177 + src/cmd/ksh93/sh/streval.c | 1023 ++ src/cmd/ksh93/sh/string.c | 730 ++ src/cmd/ksh93/sh/subshell.c | 780 ++ src/cmd/ksh93/sh/suid_exec.c | 509 + src/cmd/ksh93/sh/tdump.c | 262 + src/cmd/ksh93/sh/timers.c | 248 + src/cmd/ksh93/sh/trestore.c | 353 + src/cmd/ksh93/sh/waitevent.c | 54 + src/cmd/ksh93/sh/xec.c | 3991 ++++++ src/cmd/ksh93/shell.3 | 414 + src/cmd/ksh93/tests/alias.sh | 102 + src/cmd/ksh93/tests/append.sh | 86 + src/cmd/ksh93/tests/arith.sh | 737 ++ src/cmd/ksh93/tests/arrays.sh | 588 + src/cmd/ksh93/tests/arrays2.sh | 212 + src/cmd/ksh93/tests/attributes.sh | 418 + src/cmd/ksh93/tests/basic.sh | 513 + src/cmd/ksh93/tests/bracket.sh | 340 + src/cmd/ksh93/tests/builtins.sh | 562 + src/cmd/ksh93/tests/case.sh | 85 + src/cmd/ksh93/tests/comvar.sh | 689 + src/cmd/ksh93/tests/comvario.sh | 686 + src/cmd/ksh93/tests/coprocess.sh | 360 + src/cmd/ksh93/tests/cubetype.sh | 213 + src/cmd/ksh93/tests/enum.sh | 68 + src/cmd/ksh93/tests/exit.sh | 80 + src/cmd/ksh93/tests/expand.sh | 126 + src/cmd/ksh93/tests/functions.sh | 1157 ++ src/cmd/ksh93/tests/glob.sh | 374 + src/cmd/ksh93/tests/grep.sh | 105 + src/cmd/ksh93/tests/heredoc.sh | 496 + src/cmd/ksh93/tests/io.sh | 484 + src/cmd/ksh93/tests/leaks.sh | 68 + src/cmd/ksh93/tests/locale.sh | 319 + src/cmd/ksh93/tests/math.sh | 202 + src/cmd/ksh93/tests/nameref.sh | 658 + src/cmd/ksh93/tests/options.sh | 544 + src/cmd/ksh93/tests/path.sh | 375 + src/cmd/ksh93/tests/pointtype.sh | 138 + src/cmd/ksh93/tests/pty.sh | 442 + src/cmd/ksh93/tests/quoting.sh | 369 + src/cmd/ksh93/tests/quoting2.sh | 215 + src/cmd/ksh93/tests/readcsv.sh | 65 + src/cmd/ksh93/tests/recttype.sh | 70 + src/cmd/ksh93/tests/restricted.sh | 83 + src/cmd/ksh93/tests/return.sh | 183 + src/cmd/ksh93/tests/select.sh | 67 + src/cmd/ksh93/tests/shtests | 235 + src/cmd/ksh93/tests/sigchld.sh | 160 + src/cmd/ksh93/tests/signal.sh | 435 + src/cmd/ksh93/tests/statics.sh | 690 + src/cmd/ksh93/tests/subshell.sh | 582 + src/cmd/ksh93/tests/substring.sh | 628 + src/cmd/ksh93/tests/tilde.sh | 101 + src/cmd/ksh93/tests/timetype.sh | 81 + src/cmd/ksh93/tests/treemove.sh | 163 + src/cmd/ksh93/tests/types.sh | 632 + src/cmd/ksh93/tests/variables.sh | 665 + src/cmd/ksh93/tests/vartree1.sh | 215 + src/cmd/ksh93/tests/vartree2.sh | 335 + src/lib/Makefile | 1 + src/lib/Mamfile | 7 + src/lib/libast/Makefile | 442 + src/lib/libast/Mamfile | 7356 +++++++++++ src/lib/libast/README | 95 + src/lib/libast/RELEASE | 1769 +++ src/lib/libast/aso/aso-fcntl.c | 188 + src/lib/libast/aso/aso-sem.c | 193 + src/lib/libast/aso/aso.c | 866 ++ src/lib/libast/aso/asohdr.h | 71 + src/lib/libast/aso/asolock.c | 55 + src/lib/libast/aso/asometh.c | 43 + src/lib/libast/aso/asorelax.c | 56 + src/lib/libast/astsa/README-astsa | 15 + src/lib/libast/astsa/aso.c | 56 + src/lib/libast/astsa/aso.h | 32 + src/lib/libast/astsa/ast.c | 85 + src/lib/libast/astsa/ast.h | 156 + src/lib/libast/astsa/ast_common.h | 49 + src/lib/libast/astsa/astsa.manifest | 50 + src/lib/libast/astsa/astsa.mm | 33 + src/lib/libast/astsa/astsa.omk | 82 + src/lib/libast/astsa/ccode.h | 34 + src/lib/libast/astsa/debug.h | 29 + src/lib/libast/astsa/error.c | 103 + src/lib/libast/astsa/error.h | 66 + src/lib/libast/astsa/hashkey.h | 61 + src/lib/libast/astsa/mkast_sa | 150 + src/lib/libast/astsa/option.h | 106 + src/lib/libast/astsa/optlib.h | 105 + src/lib/libast/astsa/sfstr.c | 246 + src/lib/libast/astsa/sfstr.h | 60 + src/lib/libast/astsa/strdup.c | 37 + src/lib/libast/astsa/strmatch.c | 597 + src/lib/libast/astsa/times.h | 27 + src/lib/libast/astsa/vmalloc.c | 102 + src/lib/libast/astsa/vmalloc.h | 61 + src/lib/libast/cdt/cdtlib.h | 183 + src/lib/libast/cdt/dtclose.c | 66 + src/lib/libast/cdt/dtcomp.c | 60 + src/lib/libast/cdt/dtdisc.c | 91 + src/lib/libast/cdt/dthash.c | 431 + src/lib/libast/cdt/dthdr.h | 37 + src/lib/libast/cdt/dtlist.c | 387 + src/lib/libast/cdt/dtmethod.c | 107 + src/lib/libast/cdt/dtnew.c | 81 + src/lib/libast/cdt/dtopen.c | 177 + src/lib/libast/cdt/dtstrhash.c | 61 + src/lib/libast/cdt/dttree.c | 696 + src/lib/libast/cdt/dtview.c | 157 + src/lib/libast/cdt/dtwalk.c | 53 + src/lib/libast/comp/atexit.c | 115 + src/lib/libast/comp/basename.c | 55 + src/lib/libast/comp/catopen.c | 182 + src/lib/libast/comp/closelog.c | 51 + src/lib/libast/comp/conf.sh | 1635 +++ src/lib/libast/comp/conf.tab | 601 + src/lib/libast/comp/creat64.c | 38 + src/lib/libast/comp/dirname.c | 61 + src/lib/libast/comp/dup2.c | 46 + src/lib/libast/comp/eaccess.c | 139 + src/lib/libast/comp/errno.c | 40 + src/lib/libast/comp/execlp.c | 50 + src/lib/libast/comp/execve.c | 70 + src/lib/libast/comp/execvp.c | 50 + src/lib/libast/comp/execvpe.c | 78 + src/lib/libast/comp/fakelink.h | 34 + src/lib/libast/comp/fcntl.c | 98 + src/lib/libast/comp/fmtmsg.h | 141 + src/lib/libast/comp/fmtmsglib.c | 335 + src/lib/libast/comp/fnmatch.c | 79 + src/lib/libast/comp/fnmatch.h | 61 + src/lib/libast/comp/frexp.c | 153 + src/lib/libast/comp/frexpl.c | 161 + src/lib/libast/comp/fsync.c | 46 + src/lib/libast/comp/ftw.c | 50 + src/lib/libast/comp/ftw.h | 60 + src/lib/libast/comp/getdate.c | 83 + src/lib/libast/comp/getgroups.c | 78 + src/lib/libast/comp/getlogin.c | 42 + src/lib/libast/comp/getopt.c | 78 + src/lib/libast/comp/getopt.h | 51 + src/lib/libast/comp/getoptl.c | 151 + src/lib/libast/comp/getpgrp.c | 47 + src/lib/libast/comp/getsubopt.c | 84 + src/lib/libast/comp/getwd.c | 37 + src/lib/libast/comp/gross.c | 99 + src/lib/libast/comp/gross_sgi.h | 188 + src/lib/libast/comp/hsearch.c | 138 + src/lib/libast/comp/iconv.c | 1599 +++ src/lib/libast/comp/killpg.c | 40 + src/lib/libast/comp/libgen.h | 52 + src/lib/libast/comp/link.c | 47 + src/lib/libast/comp/localeconv.c | 100 + src/lib/libast/comp/lstat.c | 39 + src/lib/libast/comp/memccpy.c | 51 + src/lib/libast/comp/memchr.c | 49 + src/lib/libast/comp/memcmp.c | 45 + src/lib/libast/comp/memcpy.c | 60 + src/lib/libast/comp/memmove.c | 53 + src/lib/libast/comp/memset.c | 42 + src/lib/libast/comp/mkdir.c | 62 + src/lib/libast/comp/mkfifo.c | 50 + src/lib/libast/comp/mknod.c | 50 + src/lib/libast/comp/mktemp.c | 85 + src/lib/libast/comp/mktime.c | 77 + src/lib/libast/comp/mount.c | 49 + src/lib/libast/comp/nftw.c | 61 + src/lib/libast/comp/omitted.c | 1152 ++ src/lib/libast/comp/open.c | 119 + src/lib/libast/comp/openlog.c | 58 + src/lib/libast/comp/putenv.c | 53 + src/lib/libast/comp/re_comp.c | 81 + src/lib/libast/comp/re_comp.h | 41 + src/lib/libast/comp/readlink.c | 61 + src/lib/libast/comp/realpath.c | 48 + src/lib/libast/comp/regcmp.c | 224 + src/lib/libast/comp/regexp.c | 123 + src/lib/libast/comp/regexp.h | 129 + src/lib/libast/comp/remove.c | 49 + src/lib/libast/comp/rename.c | 98 + src/lib/libast/comp/resolvepath.c | 72 + src/lib/libast/comp/rmdir.c | 66 + src/lib/libast/comp/setenv.c | 58 + src/lib/libast/comp/setlocale.c | 2865 +++++ src/lib/libast/comp/setlogmask.c | 48 + src/lib/libast/comp/setpgid.c | 80 + src/lib/libast/comp/setsid.c | 90 + src/lib/libast/comp/sigflag.c | 52 + src/lib/libast/comp/sigunblock.c | 63 + src/lib/libast/comp/spawnveg.c | 296 + src/lib/libast/comp/statvfs.c | 163 + src/lib/libast/comp/strcasecmp.c | 58 + src/lib/libast/comp/strchr.c | 57 + src/lib/libast/comp/strftime.c | 104 + src/lib/libast/comp/strncasecmp.c | 62 + src/lib/libast/comp/strptime.c | 82 + src/lib/libast/comp/strrchr.c | 60 + src/lib/libast/comp/strstr.c | 76 + src/lib/libast/comp/strtod.c | 31 + src/lib/libast/comp/strtol.c | 34 + src/lib/libast/comp/strtold.c | 50 + src/lib/libast/comp/strtoll.c | 44 + src/lib/libast/comp/strtoul.c | 35 + src/lib/libast/comp/strtoull.c | 45 + src/lib/libast/comp/swab.c | 60 + src/lib/libast/comp/symlink.c | 59 + src/lib/libast/comp/syslog.c | 367 + src/lib/libast/comp/syslog.h | 132 + src/lib/libast/comp/sysloglib.h | 54 + src/lib/libast/comp/system.c | 55 + src/lib/libast/comp/tempnam.c | 58 + src/lib/libast/comp/tmpnam.c | 51 + src/lib/libast/comp/transition.c | 86 + src/lib/libast/comp/tsearch.c | 240 + src/lib/libast/comp/unlink.c | 38 + src/lib/libast/comp/unsetenv.c | 50 + src/lib/libast/comp/vfork.c | 55 + src/lib/libast/comp/waitpid.c | 199 + src/lib/libast/comp/wc.c | 139 + src/lib/libast/comp/wordexp.c | 217 + src/lib/libast/comp/wordexp.h | 63 + src/lib/libast/dir/dirlib.h | 174 + src/lib/libast/dir/dirstd.h | 63 + src/lib/libast/dir/getdents.c | 166 + src/lib/libast/dir/opendir.c | 95 + src/lib/libast/dir/readdir.c | 61 + src/lib/libast/dir/rewinddir.c | 46 + src/lib/libast/dir/seekdir.c | 56 + src/lib/libast/dir/telldir.c | 43 + src/lib/libast/disc/memfatal.c | 82 + src/lib/libast/disc/sfdcdio.c | 229 + src/lib/libast/disc/sfdcdos.c | 416 + src/lib/libast/disc/sfdcfilter.c | 186 + src/lib/libast/disc/sfdchdr.h | 28 + src/lib/libast/disc/sfdcmore.c | 369 + src/lib/libast/disc/sfdcprefix.c | 153 + src/lib/libast/disc/sfdcseekable.c | 227 + src/lib/libast/disc/sfdcslow.c | 84 + src/lib/libast/disc/sfdcsubstr.c | 217 + src/lib/libast/disc/sfdctee.c | 102 + src/lib/libast/disc/sfdcunion.c | 203 + src/lib/libast/disc/sfkeyprintf.c | 392 + src/lib/libast/disc/sfstrtmp.c | 62 + src/lib/libast/features/align.c | 188 + src/lib/libast/features/api | 11 + src/lib/libast/features/aso | 671 + src/lib/libast/features/botch.c | 72 + src/lib/libast/features/ccode | 81 + src/lib/libast/features/common | 624 + src/lib/libast/features/dirent | 275 + src/lib/libast/features/eaccess | 11 + src/lib/libast/features/errno | 31 + src/lib/libast/features/fcntl.c | 360 + src/lib/libast/features/float | 1191 ++ src/lib/libast/features/fs | 251 + src/lib/libast/features/hack | 1 + src/lib/libast/features/iconv | 116 + src/lib/libast/features/isoc99 | 13 + src/lib/libast/features/lib | 664 + src/lib/libast/features/libpath.sh | 73 + src/lib/libast/features/limits.c | 339 + src/lib/libast/features/locale | 28 + src/lib/libast/features/map.c | 565 + src/lib/libast/features/mmap | 342 + src/lib/libast/features/mode.c | 218 + src/lib/libast/features/ndbm | 29 + src/lib/libast/features/nl_types | 64 + src/lib/libast/features/omitted | 110 + src/lib/libast/features/options | 1 + src/lib/libast/features/param.sh | 47 + src/lib/libast/features/preroot.sh | 46 + src/lib/libast/features/prog | 12 + src/lib/libast/features/sfinit.c | 94 + src/lib/libast/features/sfio | 170 + src/lib/libast/features/sig.sh | 132 + src/lib/libast/features/siglist | 14 + src/lib/libast/features/signal.c | 371 + src/lib/libast/features/sizeof | 13 + src/lib/libast/features/standards | 153 + src/lib/libast/features/stdio | 568 + src/lib/libast/features/sys | 272 + src/lib/libast/features/syscall | 18 + src/lib/libast/features/time | 46 + src/lib/libast/features/tmlib | 45 + src/lib/libast/features/tmx | 106 + src/lib/libast/features/tty | 127 + src/lib/libast/features/tv | 81 + src/lib/libast/features/tvlib | 80 + src/lib/libast/features/uwin | 10 + src/lib/libast/features/vfork | 13 + src/lib/libast/features/vmalloc | 220 + src/lib/libast/features/wait | 9 + src/lib/libast/features/wchar | 158 + src/lib/libast/features/wctype | 14 + src/lib/libast/hash/hashalloc.c | 200 + src/lib/libast/hash/hashdump.c | 173 + src/lib/libast/hash/hashfree.c | 144 + src/lib/libast/hash/hashlast.c | 43 + src/lib/libast/hash/hashlib.h | 104 + src/lib/libast/hash/hashlook.c | 367 + src/lib/libast/hash/hashscan.c | 139 + src/lib/libast/hash/hashsize.c | 84 + src/lib/libast/hash/hashview.c | 88 + src/lib/libast/hash/hashwalk.c | 51 + src/lib/libast/hash/memhash.c | 45 + src/lib/libast/hash/memsum.c | 53 + src/lib/libast/hash/strhash.c | 45 + src/lib/libast/hash/strkey.c | 49 + src/lib/libast/hash/strsum.c | 53 + src/lib/libast/include/aso.h | 183 + src/lib/libast/include/ast.h | 405 + src/lib/libast/include/ast_dir.h | 77 + src/lib/libast/include/ast_getopt.h | 42 + src/lib/libast/include/ast_std.h | 362 + src/lib/libast/include/ast_windows.h | 39 + src/lib/libast/include/ccode.h | 90 + src/lib/libast/include/cdt.h | 354 + src/lib/libast/include/cmdarg.h | 92 + src/lib/libast/include/debug.h | 109 + src/lib/libast/include/dt.h | 41 + src/lib/libast/include/error.h | 182 + src/lib/libast/include/find.h | 86 + src/lib/libast/include/fnv.h | 72 + src/lib/libast/include/fs3d.h | 117 + src/lib/libast/include/fts.h | 162 + src/lib/libast/include/ftwalk.h | 124 + src/lib/libast/include/glob.h | 146 + src/lib/libast/include/hash.h | 202 + src/lib/libast/include/hashkey.h | 62 + src/lib/libast/include/hashpart.h | 51 + src/lib/libast/include/ip6.h | 40 + src/lib/libast/include/ls.h | 88 + src/lib/libast/include/magic.h | 86 + src/lib/libast/include/magicid.h | 46 + src/lib/libast/include/mc.h | 96 + src/lib/libast/include/mime.h | 91 + src/lib/libast/include/mnt.h | 58 + src/lib/libast/include/modecanon.h | 65 + src/lib/libast/include/modex.h | 51 + src/lib/libast/include/namval.h | 42 + src/lib/libast/include/option.h | 106 + src/lib/libast/include/proc.h | 108 + src/lib/libast/include/recfmt.h | 83 + src/lib/libast/include/regex.h | 248 + src/lib/libast/include/sfdisc.h | 70 + src/lib/libast/include/sfio.h | 457 + src/lib/libast/include/sfio_s.h | 51 + src/lib/libast/include/sfio_t.h | 126 + src/lib/libast/include/shcmd.h | 112 + src/lib/libast/include/stack.h | 83 + src/lib/libast/include/stak.h | 55 + src/lib/libast/include/stk.h | 78 + src/lib/libast/include/swap.h | 53 + src/lib/libast/include/tar.h | 118 + src/lib/libast/include/times.h | 54 + src/lib/libast/include/tm.h | 192 + src/lib/libast/include/tok.h | 47 + src/lib/libast/include/usage.h | 37 + src/lib/libast/include/vdb.h | 46 + src/lib/libast/include/vecargs.h | 45 + src/lib/libast/include/vmalloc.h | 335 + src/lib/libast/include/wait.h | 98 + src/lib/libast/man/LIBAST.3 | 98 + src/lib/libast/man/aso.3 | 355 + src/lib/libast/man/ast.3 | 283 + src/lib/libast/man/astsa.3 | 161 + src/lib/libast/man/cdt.3 | 617 + src/lib/libast/man/chr.3 | 126 + src/lib/libast/man/compat.3 | 103 + src/lib/libast/man/error.3 | 283 + src/lib/libast/man/find.3 | 89 + src/lib/libast/man/fmt.3 | 213 + src/lib/libast/man/fmtls.3 | 143 + src/lib/libast/man/fs3d.3 | 92 + src/lib/libast/man/ftwalk.3 | 235 + src/lib/libast/man/getcwd.3 | 67 + src/lib/libast/man/hash.3 | 644 + src/lib/libast/man/iblocks.3 | 62 + src/lib/libast/man/int.3 | 68 + src/lib/libast/man/ip6.3 | 85 + src/lib/libast/man/magic.3 | 493 + src/lib/libast/man/mem.3 | 98 + src/lib/libast/man/mime.3 | 117 + src/lib/libast/man/modecanon.3 | 104 + src/lib/libast/man/optget.3 | 68 + src/lib/libast/man/path.3 | 391 + src/lib/libast/man/preroot.3 | 151 + src/lib/libast/man/proc.3 | 319 + src/lib/libast/man/re.3 | 214 + src/lib/libast/man/regex.3 | 163 + src/lib/libast/man/setenviron.3 | 79 + src/lib/libast/man/sfdisc.3 | 118 + src/lib/libast/man/sfio.3 | 2373 ++++ src/lib/libast/man/sig.3 | 75 + src/lib/libast/man/spawnveg.3 | 97 + src/lib/libast/man/stak.3 | 169 + src/lib/libast/man/stk.3 | 165 + src/lib/libast/man/strcopy.3 | 54 + src/lib/libast/man/strdup.3 | 55 + src/lib/libast/man/strelapsed.3 | 77 + src/lib/libast/man/strerror.3 | 53 + src/lib/libast/man/stresc.3 | 53 + src/lib/libast/man/streval.3 | 83 + src/lib/libast/man/strgid.3 | 53 + src/lib/libast/man/strmatch.3 | 101 + src/lib/libast/man/stropt.3 | 130 + src/lib/libast/man/strperm.3 | 109 + src/lib/libast/man/strsignal.3 | 53 + src/lib/libast/man/strsort.3 | 73 + src/lib/libast/man/strtape.3 | 86 + src/lib/libast/man/strton.3 | 97 + src/lib/libast/man/struid.3 | 53 + src/lib/libast/man/swap.3 | 138 + src/lib/libast/man/tab.3 | 74 + src/lib/libast/man/tm.3 | 775 ++ src/lib/libast/man/tmx.3 | 576 + src/lib/libast/man/tok.3 | 217 + src/lib/libast/man/touch.3 | 68 + src/lib/libast/man/tv.3 | 173 + src/lib/libast/man/vecargs.3 | 126 + src/lib/libast/man/vmalloc.3 | 640 + src/lib/libast/misc/astintercept.c | 53 + src/lib/libast/misc/cmdarg.c | 382 + src/lib/libast/misc/conformance.c | 151 + src/lib/libast/misc/debug.c | 66 + src/lib/libast/misc/error.c | 659 + src/lib/libast/misc/errorf.c | 41 + src/lib/libast/misc/errormsg.c | 41 + src/lib/libast/misc/errorx.c | 50 + src/lib/libast/misc/fastfind.c | 1282 ++ src/lib/libast/misc/findlib.h | 123 + src/lib/libast/misc/fmtrec.c | 102 + src/lib/libast/misc/fs3d.c | 116 + src/lib/libast/misc/fts.c | 1605 +++ src/lib/libast/misc/ftwalk.c | 156 + src/lib/libast/misc/ftwflags.c | 35 + src/lib/libast/misc/getcwd.c | 334 + src/lib/libast/misc/getenv.c | 113 + src/lib/libast/misc/glob.c | 829 ++ src/lib/libast/misc/intercepts.h | 40 + src/lib/libast/misc/magic.c | 2497 ++++ src/lib/libast/misc/magic.tab | 1721 +++ src/lib/libast/misc/mime.c | 839 ++ src/lib/libast/misc/mimelib.h | 52 + src/lib/libast/misc/mimetype.c | 69 + src/lib/libast/misc/optctx.c | 70 + src/lib/libast/misc/optesc.c | 93 + src/lib/libast/misc/optget.c | 5751 +++++++++ src/lib/libast/misc/optjoin.c | 129 + src/lib/libast/misc/optlib.h | 115 + src/lib/libast/misc/procclose.c | 98 + src/lib/libast/misc/procfree.c | 43 + src/lib/libast/misc/proclib.h | 64 + src/lib/libast/misc/procopen.c | 941 ++ src/lib/libast/misc/procrun.c | 49 + src/lib/libast/misc/recfmt.c | 165 + src/lib/libast/misc/reclen.c | 71 + src/lib/libast/misc/recstr.c | 206 + src/lib/libast/misc/setenviron.c | 147 + src/lib/libast/misc/sigcrit.c | 199 + src/lib/libast/misc/sigdata.c | 40 + src/lib/libast/misc/signal.c | 136 + src/lib/libast/misc/stack.c | 172 + src/lib/libast/misc/state.c | 42 + src/lib/libast/misc/stk.c | 553 + src/lib/libast/misc/systrace.c | 68 + src/lib/libast/misc/translate.c | 437 + src/lib/libast/misc/univdata.c | 58 + src/lib/libast/misc/univlib.h | 93 + src/lib/libast/obsolete/spawn.c | 152 + src/lib/libast/path/pathaccess.c | 69 + src/lib/libast/path/pathbin.c | 46 + src/lib/libast/path/pathcanon.c | 222 + src/lib/libast/path/pathcat.c | 98 + src/lib/libast/path/pathcd.c | 142 + src/lib/libast/path/pathcheck.c | 91 + src/lib/libast/path/pathexists.c | 134 + src/lib/libast/path/pathfind.c | 168 + src/lib/libast/path/pathgetlink.c | 102 + src/lib/libast/path/pathkey.c | 320 + src/lib/libast/path/pathnative.c | 126 + src/lib/libast/path/pathpath.c | 127 + src/lib/libast/path/pathposix.c | 128 + src/lib/libast/path/pathprobe.c | 316 + src/lib/libast/path/pathprog.c | 128 + src/lib/libast/path/pathrepl.c | 93 + src/lib/libast/path/pathsetlink.c | 72 + src/lib/libast/path/pathshell.c | 112 + src/lib/libast/path/pathstat.c | 45 + src/lib/libast/path/pathtemp.c | 337 + src/lib/libast/path/pathtmp.c | 41 + src/lib/libast/port/astconf.c | 1718 +++ src/lib/libast/port/astcopy.c | 90 + src/lib/libast/port/astdynamic.c | 132 + src/lib/libast/port/astlicense.c | 1292 ++ src/lib/libast/port/astmath.c | 72 + src/lib/libast/port/astquery.c | 114 + src/lib/libast/port/aststatic.c | 44 + src/lib/libast/port/astwinsize.c | 143 + src/lib/libast/port/atmain.C | 37 + src/lib/libast/port/iblocks.c | 95 + src/lib/libast/port/lc.c | 883 ++ src/lib/libast/port/lc.tab | 275 + src/lib/libast/port/lcgen.c | 791 ++ src/lib/libast/port/lclang.h | 120 + src/lib/libast/port/lclib.h | 71 + src/lib/libast/port/mc.c | 675 + src/lib/libast/port/mnt.c | 816 ++ src/lib/libast/port/touch.c | 74 + src/lib/libast/preroot/getpreroot.c | 165 + src/lib/libast/preroot/ispreroot.c | 71 + src/lib/libast/preroot/realopen.c | 47 + src/lib/libast/preroot/setpreroot.c | 75 + src/lib/libast/regex/regalloc.c | 36 + src/lib/libast/regex/regcache.c | 198 + src/lib/libast/regex/regclass.c | 298 + src/lib/libast/regex/regcoll.c | 120 + src/lib/libast/regex/regcomp.c | 3544 ++++++ src/lib/libast/regex/regdecomp.c | 448 + src/lib/libast/regex/regerror.c | 95 + src/lib/libast/regex/regexec.c | 54 + src/lib/libast/regex/regfatal.c | 49 + src/lib/libast/regex/reginit.c | 412 + src/lib/libast/regex/reglib.h | 582 + src/lib/libast/regex/regnexec.c | 2045 +++ src/lib/libast/regex/regrecord.c | 34 + src/lib/libast/regex/regrexec.c | 145 + src/lib/libast/regex/regstat.c | 53 + src/lib/libast/regex/regsub.c | 269 + src/lib/libast/regex/regsubcomp.c | 377 + src/lib/libast/regex/regsubexec.c | 196 + src/lib/libast/sfio/_sfclrerr.c | 34 + src/lib/libast/sfio/_sfdlen.c | 34 + src/lib/libast/sfio/_sfeof.c | 34 + src/lib/libast/sfio/_sferror.c | 34 + src/lib/libast/sfio/_sffileno.c | 34 + src/lib/libast/sfio/_sfgetc.c | 34 + src/lib/libast/sfio/_sfgetl.c | 42 + src/lib/libast/sfio/_sfgetl2.c | 50 + src/lib/libast/sfio/_sfgetu.c | 42 + src/lib/libast/sfio/_sfgetu2.c | 50 + src/lib/libast/sfio/_sfllen.c | 34 + src/lib/libast/sfio/_sfopen.c | 219 + src/lib/libast/sfio/_sfputc.c | 35 + src/lib/libast/sfio/_sfputd.c | 96 + src/lib/libast/sfio/_sfputl.c | 82 + src/lib/libast/sfio/_sfputm.c | 78 + src/lib/libast/sfio/_sfputu.c | 75 + src/lib/libast/sfio/_sfslen.c | 33 + src/lib/libast/sfio/_sfstacked.c | 34 + src/lib/libast/sfio/_sfulen.c | 34 + src/lib/libast/sfio/_sfvalue.c | 34 + src/lib/libast/sfio/sfclose.c | 178 + src/lib/libast/sfio/sfclrlock.c | 63 + src/lib/libast/sfio/sfcvt.c | 532 + src/lib/libast/sfio/sfdisc.c | 271 + src/lib/libast/sfio/sfdlen.c | 58 + src/lib/libast/sfio/sfecvt.c | 38 + src/lib/libast/sfio/sfexcept.c | 133 + src/lib/libast/sfio/sfextern.c | 99 + src/lib/libast/sfio/sffcvt.c | 38 + src/lib/libast/sfio/sffilbuf.c | 116 + src/lib/libast/sfio/sfflsbuf.c | 126 + src/lib/libast/sfio/sfgetd.c | 79 + src/lib/libast/sfio/sfgetl.c | 70 + src/lib/libast/sfio/sfgetm.c | 68 + src/lib/libast/sfio/sfgetr.c | 169 + src/lib/libast/sfio/sfgetu.c | 67 + src/lib/libast/sfio/sfhdr.h | 1302 ++ src/lib/libast/sfio/sfllen.c | 39 + src/lib/libast/sfio/sfmode.c | 596 + src/lib/libast/sfio/sfmove.c | 242 + src/lib/libast/sfio/sfmutex.c | 69 + src/lib/libast/sfio/sfnew.c | 129 + src/lib/libast/sfio/sfnotify.c | 38 + src/lib/libast/sfio/sfnputc.c | 81 + src/lib/libast/sfio/sfopen.c | 40 + src/lib/libast/sfio/sfpeek.c | 89 + src/lib/libast/sfio/sfpkrd.c | 325 + src/lib/libast/sfio/sfpoll.c | 250 + src/lib/libast/sfio/sfpool.c | 369 + src/lib/libast/sfio/sfpopen.c | 293 + src/lib/libast/sfio/sfprintf.c | 114 + src/lib/libast/sfio/sfprints.c | 125 + src/lib/libast/sfio/sfpurge.c | 98 + src/lib/libast/sfio/sfputd.c | 35 + src/lib/libast/sfio/sfputl.c | 35 + src/lib/libast/sfio/sfputm.c | 36 + src/lib/libast/sfio/sfputr.c | 136 + src/lib/libast/sfio/sfputu.c | 35 + src/lib/libast/sfio/sfraise.c | 107 + src/lib/libast/sfio/sfrd.c | 317 + src/lib/libast/sfio/sfread.c | 140 + src/lib/libast/sfio/sfreserve.c | 210 + src/lib/libast/sfio/sfresize.c | 83 + src/lib/libast/sfio/sfscanf.c | 102 + src/lib/libast/sfio/sfseek.c | 281 + src/lib/libast/sfio/sfset.c | 99 + src/lib/libast/sfio/sfsetbuf.c | 426 + src/lib/libast/sfio/sfsetfd.c | 136 + src/lib/libast/sfio/sfsize.c | 109 + src/lib/libast/sfio/sfsk.c | 106 + src/lib/libast/sfio/sfstack.c | 115 + src/lib/libast/sfio/sfstrtod.c | 157 + src/lib/libast/sfio/sfstrtof.h | 568 + src/lib/libast/sfio/sfswap.c | 119 + src/lib/libast/sfio/sfsync.c | 172 + src/lib/libast/sfio/sftable.c | 543 + src/lib/libast/sfio/sftell.c | 59 + src/lib/libast/sfio/sftmp.c | 402 + src/lib/libast/sfio/sfungetc.c | 108 + src/lib/libast/sfio/sfvprintf.c | 1445 +++ src/lib/libast/sfio/sfvscanf.c | 1100 ++ src/lib/libast/sfio/sfwalk.c | 67 + src/lib/libast/sfio/sfwr.c | 252 + src/lib/libast/sfio/sfwrite.c | 171 + src/lib/libast/sfio/vthread.h | 219 + src/lib/libast/std/bytesex.h | 43 + src/lib/libast/std/dirent.h | 22 + src/lib/libast/std/endian.h | 54 + src/lib/libast/std/iconv.h | 22 + src/lib/libast/std/nl_types.h | 22 + src/lib/libast/std/stdio.h | 22 + src/lib/libast/std/wchar.h | 22 + src/lib/libast/std/wctype.h | 22 + src/lib/libast/stdio/_doprnt.c | 32 + src/lib/libast/stdio/_doscan.c | 32 + src/lib/libast/stdio/_filbuf.c | 36 + src/lib/libast/stdio/_flsbuf.c | 44 + src/lib/libast/stdio/_stdfun.c | 80 + src/lib/libast/stdio/_stdopen.c | 32 + src/lib/libast/stdio/_stdprintf.c | 38 + src/lib/libast/stdio/_stdscanf.c | 38 + src/lib/libast/stdio/_stdsprnt.c | 38 + src/lib/libast/stdio/_stdvbuf.c | 32 + src/lib/libast/stdio/_stdvsnprnt.c | 32 + src/lib/libast/stdio/_stdvsprnt.c | 32 + src/lib/libast/stdio/_stdvsscn.c | 32 + src/lib/libast/stdio/asprintf.c | 36 + src/lib/libast/stdio/clearerr.c | 33 + src/lib/libast/stdio/fclose.c | 32 + src/lib/libast/stdio/fcloseall.c | 57 + src/lib/libast/stdio/fdopen.c | 34 + src/lib/libast/stdio/feof.c | 42 + src/lib/libast/stdio/ferror.c | 42 + src/lib/libast/stdio/fflush.c | 41 + src/lib/libast/stdio/fgetc.c | 32 + src/lib/libast/stdio/fgetpos.c | 48 + src/lib/libast/stdio/fgets.c | 110 + src/lib/libast/stdio/fgetwc.c | 35 + src/lib/libast/stdio/fgetws.c | 52 + src/lib/libast/stdio/fileno.c | 42 + src/lib/libast/stdio/flockfile.c | 32 + src/lib/libast/stdio/fmemopen.c | 32 + src/lib/libast/stdio/fopen.c | 30 + src/lib/libast/stdio/fprintf.c | 39 + src/lib/libast/stdio/fpurge.c | 32 + src/lib/libast/stdio/fputc.c | 42 + src/lib/libast/stdio/fputs.c | 32 + src/lib/libast/stdio/fputwc.c | 33 + src/lib/libast/stdio/fputws.c | 36 + src/lib/libast/stdio/fread.c | 34 + src/lib/libast/stdio/freopen.c | 32 + src/lib/libast/stdio/fscanf.c | 39 + src/lib/libast/stdio/fseek.c | 48 + src/lib/libast/stdio/fseeko.c | 48 + src/lib/libast/stdio/fsetpos.c | 48 + src/lib/libast/stdio/ftell.c | 48 + src/lib/libast/stdio/ftello.c | 48 + src/lib/libast/stdio/ftrylockfile.c | 32 + src/lib/libast/stdio/funlockfile.c | 32 + src/lib/libast/stdio/fwide.c | 51 + src/lib/libast/stdio/fwprintf.c | 36 + src/lib/libast/stdio/fwrite.c | 34 + src/lib/libast/stdio/fwscanf.c | 39 + src/lib/libast/stdio/getc.c | 42 + src/lib/libast/stdio/getchar.c | 40 + src/lib/libast/stdio/getdelim.c | 96 + src/lib/libast/stdio/getline.c | 36 + src/lib/libast/stdio/getw.c | 34 + src/lib/libast/stdio/getwc.c | 31 + src/lib/libast/stdio/getwchar.c | 31 + src/lib/libast/stdio/pclose.c | 32 + src/lib/libast/stdio/popen.c | 30 + src/lib/libast/stdio/printf.c | 36 + src/lib/libast/stdio/putc.c | 42 + src/lib/libast/stdio/putchar.c | 40 + src/lib/libast/stdio/puts.c | 30 + src/lib/libast/stdio/putw.c | 32 + src/lib/libast/stdio/putwc.c | 31 + src/lib/libast/stdio/putwchar.c | 31 + src/lib/libast/stdio/rewind.c | 33 + src/lib/libast/stdio/scanf.c | 36 + src/lib/libast/stdio/setbuf.c | 32 + src/lib/libast/stdio/setbuffer.c | 32 + src/lib/libast/stdio/setlinebuf.c | 33 + src/lib/libast/stdio/setvbuf.c | 48 + src/lib/libast/stdio/snprintf.c | 36 + src/lib/libast/stdio/sprintf.c | 36 + src/lib/libast/stdio/sscanf.c | 36 + src/lib/libast/stdio/stdhdr.h | 115 + src/lib/libast/stdio/stdio_c99.c | 118 + src/lib/libast/stdio/swprintf.c | 36 + src/lib/libast/stdio/swscanf.c | 36 + src/lib/libast/stdio/tmpfile.c | 30 + src/lib/libast/stdio/ungetc.c | 32 + src/lib/libast/stdio/ungetwc.c | 39 + src/lib/libast/stdio/vasprintf.c | 45 + src/lib/libast/stdio/vfprintf.c | 32 + src/lib/libast/stdio/vfscanf.c | 32 + src/lib/libast/stdio/vfwprintf.c | 68 + src/lib/libast/stdio/vfwscanf.c | 129 + src/lib/libast/stdio/vprintf.c | 30 + src/lib/libast/stdio/vscanf.c | 30 + src/lib/libast/stdio/vsnprintf.c | 52 + src/lib/libast/stdio/vsprintf.c | 30 + src/lib/libast/stdio/vsscanf.c | 30 + src/lib/libast/stdio/vswprintf.c | 55 + src/lib/libast/stdio/vswscanf.c | 51 + src/lib/libast/stdio/vwprintf.c | 30 + src/lib/libast/stdio/vwscanf.c | 30 + src/lib/libast/stdio/wprintf.c | 36 + src/lib/libast/stdio/wscanf.c | 36 + src/lib/libast/string/base64.c | 312 + src/lib/libast/string/ccmap.c | 746 ++ src/lib/libast/string/ccmapid.c | 173 + src/lib/libast/string/ccnative.c | 56 + src/lib/libast/string/chresc.c | 235 + src/lib/libast/string/chrtoi.c | 55 + src/lib/libast/string/fmtbase.c | 70 + src/lib/libast/string/fmtbuf.c | 69 + src/lib/libast/string/fmtclock.c | 63 + src/lib/libast/string/fmtdev.c | 60 + src/lib/libast/string/fmtelapsed.c | 61 + src/lib/libast/string/fmterror.c | 37 + src/lib/libast/string/fmtesc.c | 248 + src/lib/libast/string/fmtfmt.c | 205 + src/lib/libast/string/fmtfs.c | 100 + src/lib/libast/string/fmtgid.c | 101 + src/lib/libast/string/fmtident.c | 77 + src/lib/libast/string/fmtint.c | 122 + src/lib/libast/string/fmtip4.c | 43 + src/lib/libast/string/fmtip6.c | 175 + src/lib/libast/string/fmtls.c | 120 + src/lib/libast/string/fmtmatch.c | 286 + src/lib/libast/string/fmtmode.c | 47 + src/lib/libast/string/fmtnum.c | 92 + src/lib/libast/string/fmtperm.c | 91 + src/lib/libast/string/fmtre.c | 226 + src/lib/libast/string/fmtscale.c | 94 + src/lib/libast/string/fmtsignal.c | 62 + src/lib/libast/string/fmttime.c | 41 + src/lib/libast/string/fmttmx.c | 45 + src/lib/libast/string/fmttv.c | 44 + src/lib/libast/string/fmtuid.c | 101 + src/lib/libast/string/fmtversion.c | 53 + src/lib/libast/string/memdup.c | 44 + src/lib/libast/string/modedata.c | 69 + src/lib/libast/string/modei.c | 55 + src/lib/libast/string/modelib.h | 55 + src/lib/libast/string/modex.c | 75 + src/lib/libast/string/stracmp.c | 62 + src/lib/libast/string/strcopy.c | 36 + src/lib/libast/string/strdup.c | 60 + src/lib/libast/string/strelapsed.c | 154 + src/lib/libast/string/strerror.c | 148 + src/lib/libast/string/stresc.c | 67 + src/lib/libast/string/streval.c | 50 + src/lib/libast/string/strexpr.c | 294 + src/lib/libast/string/strgid.c | 121 + src/lib/libast/string/strlcat.c | 83 + src/lib/libast/string/strlcpy.c | 71 + src/lib/libast/string/strlook.c | 50 + src/lib/libast/string/strmatch.c | 171 + src/lib/libast/string/strmode.c | 51 + src/lib/libast/string/strnacmp.c | 66 + src/lib/libast/string/strncopy.c | 46 + src/lib/libast/string/strnpcmp.c | 51 + src/lib/libast/string/strntod.c | 32 + src/lib/libast/string/strntol.c | 31 + src/lib/libast/string/strntold.c | 32 + src/lib/libast/string/strntoll.c | 31 + src/lib/libast/string/strnton.c | 32 + src/lib/libast/string/strntonll.c | 32 + src/lib/libast/string/strntoul.c | 32 + src/lib/libast/string/strntoull.c | 32 + src/lib/libast/string/strnvcmp.c | 86 + src/lib/libast/string/stropt.c | 188 + src/lib/libast/string/strpcmp.c | 44 + src/lib/libast/string/strperm.c | 267 + src/lib/libast/string/strpsearch.c | 125 + src/lib/libast/string/strsearch.c | 57 + src/lib/libast/string/strsort.c | 57 + src/lib/libast/string/strtape.c | 148 + src/lib/libast/string/strtoi.h | 640 + src/lib/libast/string/strtoip4.c | 150 + src/lib/libast/string/strtoip6.c | 204 + src/lib/libast/string/strton.c | 31 + src/lib/libast/string/strtonll.c | 31 + src/lib/libast/string/struid.c | 109 + src/lib/libast/string/struniq.c | 51 + src/lib/libast/string/strvcmp.c | 74 + src/lib/libast/string/swapget.c | 57 + src/lib/libast/string/swapmem.c | 109 + src/lib/libast/string/swapop.c | 59 + src/lib/libast/string/swapput.c | 50 + src/lib/libast/string/tok.c | 190 + src/lib/libast/string/tokline.c | 193 + src/lib/libast/string/tokscan.c | 360 + src/lib/libast/string/wc2utf8.c | 74 + src/lib/libast/tm/tmdata.c | 288 + src/lib/libast/tm/tmdate.c | 41 + src/lib/libast/tm/tmequiv.c | 57 + src/lib/libast/tm/tmfix.c | 173 + src/lib/libast/tm/tmfmt.c | 41 + src/lib/libast/tm/tmform.c | 44 + src/lib/libast/tm/tmgoff.c | 77 + src/lib/libast/tm/tminit.c | 460 + src/lib/libast/tm/tmleap.c | 41 + src/lib/libast/tm/tmlex.c | 67 + src/lib/libast/tm/tmlocale.c | 644 + src/lib/libast/tm/tmmake.c | 41 + src/lib/libast/tm/tmpoff.c | 62 + src/lib/libast/tm/tmscan.c | 41 + src/lib/libast/tm/tmsleep.c | 42 + src/lib/libast/tm/tmtime.c | 41 + src/lib/libast/tm/tmtype.c | 57 + src/lib/libast/tm/tmweek.c | 87 + src/lib/libast/tm/tmword.c | 89 + src/lib/libast/tm/tmxdate.c | 1745 +++ src/lib/libast/tm/tmxduration.c | 80 + src/lib/libast/tm/tmxfmt.c | 703 + src/lib/libast/tm/tmxgettime.c | 44 + src/lib/libast/tm/tmxleap.c | 51 + src/lib/libast/tm/tmxmake.c | 140 + src/lib/libast/tm/tmxscan.c | 533 + src/lib/libast/tm/tmxsettime.c | 45 + src/lib/libast/tm/tmxsleep.c | 41 + src/lib/libast/tm/tmxtime.c | 137 + src/lib/libast/tm/tmxtouch.c | 81 + src/lib/libast/tm/tmzone.c | 95 + src/lib/libast/tm/tvcmp.c | 46 + src/lib/libast/tm/tvgettime.c | 70 + src/lib/libast/tm/tvsettime.c | 72 + src/lib/libast/tm/tvsleep.c | 144 + src/lib/libast/tm/tvtouch.c | 295 + src/lib/libast/uwin/a64l.c | 76 + src/lib/libast/uwin/acosh.c | 108 + src/lib/libast/uwin/asinh.c | 107 + src/lib/libast/uwin/atanh.c | 89 + src/lib/libast/uwin/cbrt.c | 38 + src/lib/libast/uwin/crypt.c | 959 ++ src/lib/libast/uwin/erf.c | 403 + src/lib/libast/uwin/err.c | 124 + src/lib/libast/uwin/exp.c | 213 + src/lib/libast/uwin/exp__E.c | 142 + src/lib/libast/uwin/expm1.c | 173 + src/lib/libast/uwin/gamma.c | 343 + src/lib/libast/uwin/getpass.c | 79 + src/lib/libast/uwin/lgamma.c | 316 + src/lib/libast/uwin/log.c | 496 + src/lib/libast/uwin/log1p.c | 176 + src/lib/libast/uwin/log__L.c | 116 + src/lib/libast/uwin/mathimpl.h | 103 + src/lib/libast/uwin/mini.sym | 84 + src/lib/libast/uwin/rand48.c | 177 + src/lib/libast/uwin/random.c | 381 + src/lib/libast/uwin/rcmd.c | 571 + src/lib/libast/uwin/rint.c | 41 + src/lib/libast/uwin/rlib.h | 80 + src/lib/libast/uwin/support.c | 605 + src/lib/libast/vec/vecargs.c | 76 + src/lib/libast/vec/vecfile.c | 62 + src/lib/libast/vec/vecfree.c | 48 + src/lib/libast/vec/vecload.c | 96 + src/lib/libast/vec/vecstring.c | 46 + src/lib/libast/vmalloc/malloc.c | 1438 +++ src/lib/libast/vmalloc/vmbest.c | 1390 ++ src/lib/libast/vmalloc/vmclear.c | 85 + src/lib/libast/vmalloc/vmclose.c | 91 + src/lib/libast/vmalloc/vmdcheap.c | 63 + src/lib/libast/vmalloc/vmdebug.c | 745 ++ src/lib/libast/vmalloc/vmdisc.c | 55 + src/lib/libast/vmalloc/vmexit.c | 100 + src/lib/libast/vmalloc/vmgetmem.c | 51 + src/lib/libast/vmalloc/vmhdr.h | 530 + src/lib/libast/vmalloc/vmlast.c | 431 + src/lib/libast/vmalloc/vmmopen.c | 518 + src/lib/libast/vmalloc/vmopen.c | 180 + src/lib/libast/vmalloc/vmpool.c | 316 + src/lib/libast/vmalloc/vmprivate.c | 292 + src/lib/libast/vmalloc/vmprofile.c | 709 ++ src/lib/libast/vmalloc/vmregion.c | 61 + src/lib/libast/vmalloc/vmsegment.c | 58 + src/lib/libast/vmalloc/vmset.c | 62 + src/lib/libast/vmalloc/vmstat.c | 145 + src/lib/libast/vmalloc/vmstrdup.c | 48 + src/lib/libast/vmalloc/vmtrace.c | 286 + src/lib/libast/vmalloc/vmwalk.c | 69 + src/lib/libcmd/Makefile | 90 + src/lib/libcmd/Mamfile | 866 ++ src/lib/libcmd/RELEASE | 328 + src/lib/libcmd/basename.c | 139 + src/lib/libcmd/cat.c | 557 + src/lib/libcmd/chgrp.c | 501 + src/lib/libcmd/chmod.c | 325 + src/lib/libcmd/chown.c | 39 + src/lib/libcmd/cksum.c | 632 + src/lib/libcmd/cmd.h | 163 + src/lib/libcmd/cmdinit.c | 75 + src/lib/libcmd/cmp.c | 383 + src/lib/libcmd/comm.c | 203 + src/lib/libcmd/cp.c | 1009 ++ src/lib/libcmd/cut.c | 702 + src/lib/libcmd/date.c | 515 + src/lib/libcmd/dirname.c | 139 + src/lib/libcmd/expr.c | 535 + src/lib/libcmd/fds.c | 360 + src/lib/libcmd/features/ids | 9 + src/lib/libcmd/features/sockets | 3 + src/lib/libcmd/features/symlink | 23 + src/lib/libcmd/features/utsname | 15 + src/lib/libcmd/fmt.c | 635 + src/lib/libcmd/fold.c | 240 + src/lib/libcmd/fts_fix.c | 57 + src/lib/libcmd/fts_fix.h | 49 + src/lib/libcmd/getconf.c | 396 + src/lib/libcmd/head.c | 150 + src/lib/libcmd/id.c | 472 + src/lib/libcmd/join.c | 984 ++ src/lib/libcmd/lib.c | 25 + src/lib/libcmd/ln.c | 35 + src/lib/libcmd/logname.c | 78 + src/lib/libcmd/md5sum.c | 35 + src/lib/libcmd/mkdir.c | 189 + src/lib/libcmd/mkfifo.c | 96 + src/lib/libcmd/mktemp.c | 169 + src/lib/libcmd/mv.c | 35 + src/lib/libcmd/paste.c | 288 + src/lib/libcmd/pathchk.c | 265 + src/lib/libcmd/pids.c | 124 + src/lib/libcmd/rev.c | 168 + src/lib/libcmd/rev.h | 34 + src/lib/libcmd/revlib.c | 112 + src/lib/libcmd/rm.c | 417 + src/lib/libcmd/rmdir.c | 126 + src/lib/libcmd/stty.c | 971 ++ src/lib/libcmd/sum.c | 35 + src/lib/libcmd/sync.c | 79 + src/lib/libcmd/tail.c | 773 ++ src/lib/libcmd/tee.c | 204 + src/lib/libcmd/tty.c | 105 + src/lib/libcmd/uname.c | 514 + src/lib/libcmd/uniq.c | 342 + src/lib/libcmd/vmstate.c | 197 + src/lib/libcmd/wc.c | 188 + src/lib/libcmd/wc.h | 59 + src/lib/libcmd/wclib.c | 505 + src/lib/libcoshell/Makefile | 20 + src/lib/libcoshell/Mamfile | 464 + src/lib/libcoshell/RELEASE | 49 + src/lib/libcoshell/coclose.c | 113 + src/lib/libcoshell/codata.c | 169 + src/lib/libcoshell/coexec.c | 449 + src/lib/libcoshell/coexport.c | 80 + src/lib/libcoshell/coinit.c | 431 + src/lib/libcoshell/cokill.c | 134 + src/lib/libcoshell/colib.h | 137 + src/lib/libcoshell/coopen.c | 411 + src/lib/libcoshell/coquote.c | 60 + src/lib/libcoshell/coshell.3 | 396 + src/lib/libcoshell/coshell.h | 143 + src/lib/libcoshell/costash.c | 40 + src/lib/libcoshell/cosync.c | 127 + src/lib/libcoshell/cowait.c | 411 + src/lib/libcoshell/ignore.sh | 45 + src/lib/libcoshell/procrun.c | 56 + src/lib/libcoshell/silent.sh | 44 + src/lib/libcoshell/system.c | 57 + src/lib/libdll/Makefile | 17 + src/lib/libdll/Mamfile | 319 + src/lib/libdll/RELEASE | 52 + src/lib/libdll/dlfcn.c | 536 + src/lib/libdll/dll_lib.c | 183 + src/lib/libdll/dllcheck.c | 85 + src/lib/libdll/dllerror.c | 52 + src/lib/libdll/dllfind.c | 46 + src/lib/libdll/dlllib.h | 34 + src/lib/libdll/dlllook.c | 46 + src/lib/libdll/dllnext.c | 223 + src/lib/libdll/dllopen.c | 93 + src/lib/libdll/dllplug.c | 126 + src/lib/libdll/dllscan.c | 525 + src/lib/libdll/features/dll | 263 + src/lib/libsum/Makefile | 11 + src/lib/libsum/Mamfile | 245 + src/lib/libsum/RELEASE | 16 + src/lib/libsum/features/sum | 4 + src/lib/libsum/sum-ast4.c | 120 + src/lib/libsum/sum-att.c | 60 + src/lib/libsum/sum-bsd.c | 48 + src/lib/libsum/sum-crc.c | 191 + src/lib/libsum/sum-lmd.c | 330 + src/lib/libsum/sum-md5.c | 355 + src/lib/libsum/sum-prng.c | 113 + src/lib/libsum/sum-sha1.c | 323 + src/lib/libsum/sum-sha2.c | 1229 ++ src/lib/libsum/sum.h | 65 + src/lib/libsum/sumlib.c | 376 + 1250 files changed, 373344 insertions(+) create mode 100644 README create mode 100755 bin/ignore create mode 100755 bin/mamprobe create mode 100755 bin/package create mode 100755 bin/silent create mode 100644 lib/package/INIT.README create mode 100644 lib/package/INIT.html create mode 100644 lib/package/INIT.pkg create mode 100644 lib/package/INIT.req create mode 100644 lib/package/INIT.ver create mode 100644 lib/package/LICENSES/epl create mode 100644 lib/package/ast-ksh.README create mode 100644 lib/package/ast-ksh.html create mode 100644 lib/package/ast-ksh.pkg create mode 100644 lib/package/ast-ksh.req create mode 100644 lib/package/ast-ksh.ver create mode 100644 lib/package/ast.def create mode 100644 lib/package/ast.lic create mode 100644 lib/package/epl.def create mode 100644 lib/package/ksh.pkg create mode 100644 lib/package/ksh.req create mode 100644 lib/package/ksh.ver create mode 100644 lib/package/package.mk create mode 100644 src/Makefile create mode 100644 src/Mamfile create mode 100644 src/cmd/INIT/C+probe create mode 100644 src/cmd/INIT/CONVERT.mk create mode 100644 src/cmd/INIT/MAPLIB.mk create mode 100644 src/cmd/INIT/MSGFUN.mk create mode 100644 src/cmd/INIT/MSGKEY.mk create mode 100644 src/cmd/INIT/Makefile create mode 100644 src/cmd/INIT/Mamfile create mode 100644 src/cmd/INIT/PROBE.mk create mode 100644 src/cmd/INIT/RELEASE create mode 100644 src/cmd/INIT/TEST.mk create mode 100644 src/cmd/INIT/WWW.mk create mode 100755 src/cmd/INIT/ar.ibm.risc create mode 100755 src/cmd/INIT/cc.darwin create mode 100755 src/cmd/INIT/cc.darwin.i386 create mode 100755 src/cmd/INIT/cc.darwin.i386-64 create mode 100755 src/cmd/INIT/cc.hp.ia64 create mode 100755 src/cmd/INIT/cc.hp.pa create mode 100755 src/cmd/INIT/cc.hp.pa64 create mode 100755 src/cmd/INIT/cc.ibm.risc create mode 100755 src/cmd/INIT/cc.ibm.risc.gcc create mode 100755 src/cmd/INIT/cc.linux.i386-64-icc create mode 100755 src/cmd/INIT/cc.linux.i386-icc create mode 100755 src/cmd/INIT/cc.linux.ia64-icc create mode 100755 src/cmd/INIT/cc.lynxos.i386 create mode 100755 src/cmd/INIT/cc.lynxos.ppc create mode 100755 src/cmd/INIT/cc.mvs.390 create mode 100755 src/cmd/INIT/cc.next.i386 create mode 100755 src/cmd/INIT/cc.next.m68k create mode 100755 src/cmd/INIT/cc.osf.alpha create mode 100755 src/cmd/INIT/cc.pentium4 create mode 100755 src/cmd/INIT/cc.sco.i386 create mode 100755 src/cmd/INIT/cc.sgi.mips2 create mode 100755 src/cmd/INIT/cc.sgi.mips3 create mode 100755 src/cmd/INIT/cc.sgi.mips3-o32 create mode 100755 src/cmd/INIT/cc.sgi.mips4 create mode 100755 src/cmd/INIT/cc.sgi.mips4-n32 create mode 100755 src/cmd/INIT/cc.specialize create mode 100755 src/cmd/INIT/cc.unix.mc68k create mode 100644 src/cmd/INIT/crossexec.sh create mode 100644 src/cmd/INIT/db.c create mode 100644 src/cmd/INIT/ditto.sh create mode 100644 src/cmd/INIT/dl.c create mode 100644 src/cmd/INIT/execrate.sh create mode 100644 src/cmd/INIT/filter.sh create mode 100644 src/cmd/INIT/gdbm.c create mode 100644 src/cmd/INIT/gdbm1.c create mode 100644 src/cmd/INIT/gdbm2.c create mode 100755 src/cmd/INIT/hello.c create mode 100644 src/cmd/INIT/hosttype.tst create mode 100644 src/cmd/INIT/hurl.sh create mode 100644 src/cmd/INIT/iconv.c create mode 100644 src/cmd/INIT/iffe.sh create mode 100644 src/cmd/INIT/iffe.tst create mode 100644 src/cmd/INIT/ignore.sh create mode 100644 src/cmd/INIT/intl.c create mode 100755 src/cmd/INIT/ld.hp.pa create mode 100755 src/cmd/INIT/ldd.cygwin.i386 create mode 100755 src/cmd/INIT/ldd.darwin create mode 100755 src/cmd/INIT/ldd.hp.pa create mode 100755 src/cmd/INIT/ldd.ibm.risc create mode 100755 src/cmd/INIT/ldd.lynxos create mode 100755 src/cmd/INIT/ldd.mvs.390 create mode 100755 src/cmd/INIT/ldd.sgi create mode 100644 src/cmd/INIT/m.c create mode 100644 src/cmd/INIT/m2.c create mode 100644 src/cmd/INIT/m3.c create mode 100644 src/cmd/INIT/m4.c create mode 100644 src/cmd/INIT/m5.c create mode 100644 src/cmd/INIT/m6.c create mode 100644 src/cmd/INIT/make.probe create mode 100644 src/cmd/INIT/mamake.c create mode 100644 src/cmd/INIT/mamake.rt create mode 100644 src/cmd/INIT/mamake.tst create mode 100644 src/cmd/INIT/mamprobe.sh create mode 100644 src/cmd/INIT/mkdir.sh create mode 100755 src/cmd/INIT/mktest.sh create mode 100644 src/cmd/INIT/mprobe.sh create mode 100644 src/cmd/INIT/nsl.c create mode 100644 src/cmd/INIT/p.c create mode 100644 src/cmd/INIT/package.mk create mode 100644 src/cmd/INIT/package.sh create mode 100644 src/cmd/INIT/probe.win32 create mode 100644 src/cmd/INIT/proto.c create mode 100644 src/cmd/INIT/ratz.c create mode 100644 src/cmd/INIT/regress.sh create mode 100644 src/cmd/INIT/release.c create mode 100644 src/cmd/INIT/rt.sh create mode 100644 src/cmd/INIT/silent.sh create mode 100644 src/cmd/INIT/socket.c create mode 100644 src/cmd/INIT/w.c create mode 100644 src/cmd/INIT/w2.c create mode 100644 src/cmd/Makefile create mode 100644 src/cmd/Mamfile create mode 100644 src/cmd/ksh93/COMPATIBILITY create mode 100644 src/cmd/ksh93/DESIGN create mode 100644 src/cmd/ksh93/Makefile create mode 100644 src/cmd/ksh93/Mamfile create mode 100644 src/cmd/ksh93/OBSOLETE create mode 100644 src/cmd/ksh93/PROMO.mm create mode 100644 src/cmd/ksh93/README create mode 100644 src/cmd/ksh93/RELEASE create mode 100644 src/cmd/ksh93/RELEASE88 create mode 100644 src/cmd/ksh93/RELEASE93 create mode 100644 src/cmd/ksh93/TYPES create mode 100644 src/cmd/ksh93/bltins/alarm.c create mode 100644 src/cmd/ksh93/bltins/cd_pwd.c create mode 100644 src/cmd/ksh93/bltins/cflow.c create mode 100644 src/cmd/ksh93/bltins/enum.c create mode 100644 src/cmd/ksh93/bltins/getopts.c create mode 100644 src/cmd/ksh93/bltins/hist.c create mode 100644 src/cmd/ksh93/bltins/misc.c create mode 100644 src/cmd/ksh93/bltins/mkservice.c create mode 100644 src/cmd/ksh93/bltins/print.c create mode 100644 src/cmd/ksh93/bltins/read.c create mode 100644 src/cmd/ksh93/bltins/regress.c create mode 100644 src/cmd/ksh93/bltins/sleep.c create mode 100644 src/cmd/ksh93/bltins/test.c create mode 100644 src/cmd/ksh93/bltins/trap.c create mode 100644 src/cmd/ksh93/bltins/typeset.c create mode 100644 src/cmd/ksh93/bltins/ulimit.c create mode 100644 src/cmd/ksh93/bltins/umask.c create mode 100644 src/cmd/ksh93/bltins/whence.c create mode 100644 src/cmd/ksh93/builtins.mm create mode 100644 src/cmd/ksh93/data/aliases.c create mode 100644 src/cmd/ksh93/data/bash_pre_rc.sh create mode 100644 src/cmd/ksh93/data/builtins.c create mode 100644 src/cmd/ksh93/data/keywords.c create mode 100644 src/cmd/ksh93/data/lexstates.c create mode 100644 src/cmd/ksh93/data/limits.c create mode 100644 src/cmd/ksh93/data/math.tab create mode 100644 src/cmd/ksh93/data/msg.c create mode 100644 src/cmd/ksh93/data/options.c create mode 100644 src/cmd/ksh93/data/signals.c create mode 100644 src/cmd/ksh93/data/strdata.c create mode 100644 src/cmd/ksh93/data/testops.c create mode 100644 src/cmd/ksh93/data/variables.c create mode 100644 src/cmd/ksh93/edit/completion.c create mode 100644 src/cmd/ksh93/edit/edit.c create mode 100644 src/cmd/ksh93/edit/emacs.c create mode 100644 src/cmd/ksh93/edit/hexpand.c create mode 100644 src/cmd/ksh93/edit/history.c create mode 100644 src/cmd/ksh93/edit/vi.c create mode 100644 src/cmd/ksh93/features/cmds create mode 100644 src/cmd/ksh93/features/dynamic create mode 100644 src/cmd/ksh93/features/externs create mode 100644 src/cmd/ksh93/features/locale create mode 100644 src/cmd/ksh93/features/math.sh create mode 100755 src/cmd/ksh93/features/options create mode 100644 src/cmd/ksh93/features/poll create mode 100644 src/cmd/ksh93/features/rlimits create mode 100644 src/cmd/ksh93/features/setjmp create mode 100644 src/cmd/ksh93/features/sigfeatures create mode 100644 src/cmd/ksh93/features/time create mode 100644 src/cmd/ksh93/features/ttys create mode 100755 src/cmd/ksh93/fun/dirs create mode 100755 src/cmd/ksh93/fun/popd create mode 100755 src/cmd/ksh93/fun/pushd create mode 100644 src/cmd/ksh93/include/argnod.h create mode 100644 src/cmd/ksh93/include/builtins.h create mode 100644 src/cmd/ksh93/include/defs.h create mode 100644 src/cmd/ksh93/include/edit.h create mode 100644 src/cmd/ksh93/include/env.h create mode 100644 src/cmd/ksh93/include/fault.h create mode 100644 src/cmd/ksh93/include/fcin.h create mode 100644 src/cmd/ksh93/include/history.h create mode 100644 src/cmd/ksh93/include/io.h create mode 100644 src/cmd/ksh93/include/jobs.h create mode 100644 src/cmd/ksh93/include/lexstates.h create mode 100644 src/cmd/ksh93/include/name.h create mode 100644 src/cmd/ksh93/include/national.h create mode 100644 src/cmd/ksh93/include/nval.h create mode 100644 src/cmd/ksh93/include/path.h create mode 100644 src/cmd/ksh93/include/regress.h create mode 100644 src/cmd/ksh93/include/shell.h create mode 100644 src/cmd/ksh93/include/shlex.h create mode 100644 src/cmd/ksh93/include/shnodes.h create mode 100644 src/cmd/ksh93/include/shtable.h create mode 100644 src/cmd/ksh93/include/streval.h create mode 100644 src/cmd/ksh93/include/terminal.h create mode 100644 src/cmd/ksh93/include/test.h create mode 100644 src/cmd/ksh93/include/timeout.h create mode 100644 src/cmd/ksh93/include/ulimit.h create mode 100644 src/cmd/ksh93/include/variables.h create mode 100644 src/cmd/ksh93/include/version.h create mode 100644 src/cmd/ksh93/ksh-regress.rt create mode 100644 src/cmd/ksh93/ksh-regress.tst create mode 100755 src/cmd/ksh93/mamexec create mode 100644 src/cmd/ksh93/mamstate.c create mode 100644 src/cmd/ksh93/nval.3 create mode 100644 src/cmd/ksh93/sh.1 create mode 100644 src/cmd/ksh93/sh.memo create mode 100644 src/cmd/ksh93/sh/args.c create mode 100644 src/cmd/ksh93/sh/arith.c create mode 100644 src/cmd/ksh93/sh/array.c create mode 100644 src/cmd/ksh93/sh/bash.c create mode 100644 src/cmd/ksh93/sh/defs.c create mode 100644 src/cmd/ksh93/sh/deparse.c create mode 100644 src/cmd/ksh93/sh/env.c create mode 100644 src/cmd/ksh93/sh/expand.c create mode 100644 src/cmd/ksh93/sh/fault.c create mode 100644 src/cmd/ksh93/sh/fcin.c create mode 100644 src/cmd/ksh93/sh/init.c create mode 100644 src/cmd/ksh93/sh/io.c create mode 100644 src/cmd/ksh93/sh/jobs.c create mode 100644 src/cmd/ksh93/sh/lex.c create mode 100644 src/cmd/ksh93/sh/macro.c create mode 100644 src/cmd/ksh93/sh/main.c create mode 100644 src/cmd/ksh93/sh/name.c create mode 100644 src/cmd/ksh93/sh/nvdisc.c create mode 100644 src/cmd/ksh93/sh/nvtree.c create mode 100644 src/cmd/ksh93/sh/nvtype.c create mode 100644 src/cmd/ksh93/sh/parse.c create mode 100644 src/cmd/ksh93/sh/path.c create mode 100644 src/cmd/ksh93/sh/pmain.c create mode 100644 src/cmd/ksh93/sh/shcomp.c create mode 100644 src/cmd/ksh93/sh/streval.c create mode 100644 src/cmd/ksh93/sh/string.c create mode 100644 src/cmd/ksh93/sh/subshell.c create mode 100644 src/cmd/ksh93/sh/suid_exec.c create mode 100644 src/cmd/ksh93/sh/tdump.c create mode 100644 src/cmd/ksh93/sh/timers.c create mode 100644 src/cmd/ksh93/sh/trestore.c create mode 100644 src/cmd/ksh93/sh/waitevent.c create mode 100644 src/cmd/ksh93/sh/xec.c create mode 100644 src/cmd/ksh93/shell.3 create mode 100755 src/cmd/ksh93/tests/alias.sh create mode 100755 src/cmd/ksh93/tests/append.sh create mode 100755 src/cmd/ksh93/tests/arith.sh create mode 100755 src/cmd/ksh93/tests/arrays.sh create mode 100755 src/cmd/ksh93/tests/arrays2.sh create mode 100755 src/cmd/ksh93/tests/attributes.sh create mode 100755 src/cmd/ksh93/tests/basic.sh create mode 100755 src/cmd/ksh93/tests/bracket.sh create mode 100755 src/cmd/ksh93/tests/builtins.sh create mode 100755 src/cmd/ksh93/tests/case.sh create mode 100755 src/cmd/ksh93/tests/comvar.sh create mode 100644 src/cmd/ksh93/tests/comvario.sh create mode 100755 src/cmd/ksh93/tests/coprocess.sh create mode 100755 src/cmd/ksh93/tests/cubetype.sh create mode 100755 src/cmd/ksh93/tests/enum.sh create mode 100755 src/cmd/ksh93/tests/exit.sh create mode 100755 src/cmd/ksh93/tests/expand.sh create mode 100755 src/cmd/ksh93/tests/functions.sh create mode 100755 src/cmd/ksh93/tests/glob.sh create mode 100755 src/cmd/ksh93/tests/grep.sh create mode 100755 src/cmd/ksh93/tests/heredoc.sh create mode 100755 src/cmd/ksh93/tests/io.sh create mode 100755 src/cmd/ksh93/tests/leaks.sh create mode 100755 src/cmd/ksh93/tests/locale.sh create mode 100644 src/cmd/ksh93/tests/math.sh create mode 100755 src/cmd/ksh93/tests/nameref.sh create mode 100755 src/cmd/ksh93/tests/options.sh create mode 100755 src/cmd/ksh93/tests/path.sh create mode 100755 src/cmd/ksh93/tests/pointtype.sh create mode 100755 src/cmd/ksh93/tests/pty.sh create mode 100755 src/cmd/ksh93/tests/quoting.sh create mode 100755 src/cmd/ksh93/tests/quoting2.sh create mode 100644 src/cmd/ksh93/tests/readcsv.sh create mode 100755 src/cmd/ksh93/tests/recttype.sh create mode 100755 src/cmd/ksh93/tests/restricted.sh create mode 100755 src/cmd/ksh93/tests/return.sh create mode 100755 src/cmd/ksh93/tests/select.sh create mode 100755 src/cmd/ksh93/tests/shtests create mode 100755 src/cmd/ksh93/tests/sigchld.sh create mode 100755 src/cmd/ksh93/tests/signal.sh create mode 100755 src/cmd/ksh93/tests/statics.sh create mode 100755 src/cmd/ksh93/tests/subshell.sh create mode 100755 src/cmd/ksh93/tests/substring.sh create mode 100755 src/cmd/ksh93/tests/tilde.sh create mode 100755 src/cmd/ksh93/tests/timetype.sh create mode 100755 src/cmd/ksh93/tests/treemove.sh create mode 100755 src/cmd/ksh93/tests/types.sh create mode 100755 src/cmd/ksh93/tests/variables.sh create mode 100755 src/cmd/ksh93/tests/vartree1.sh create mode 100755 src/cmd/ksh93/tests/vartree2.sh create mode 100644 src/lib/Makefile create mode 100644 src/lib/Mamfile create mode 100644 src/lib/libast/Makefile create mode 100644 src/lib/libast/Mamfile create mode 100644 src/lib/libast/README create mode 100644 src/lib/libast/RELEASE create mode 100644 src/lib/libast/aso/aso-fcntl.c create mode 100644 src/lib/libast/aso/aso-sem.c create mode 100644 src/lib/libast/aso/aso.c create mode 100644 src/lib/libast/aso/asohdr.h create mode 100644 src/lib/libast/aso/asolock.c create mode 100644 src/lib/libast/aso/asometh.c create mode 100644 src/lib/libast/aso/asorelax.c create mode 100644 src/lib/libast/astsa/README-astsa create mode 100644 src/lib/libast/astsa/aso.c create mode 100644 src/lib/libast/astsa/aso.h create mode 100644 src/lib/libast/astsa/ast.c create mode 100644 src/lib/libast/astsa/ast.h create mode 100644 src/lib/libast/astsa/ast_common.h create mode 100644 src/lib/libast/astsa/astsa.manifest create mode 100644 src/lib/libast/astsa/astsa.mm create mode 100644 src/lib/libast/astsa/astsa.omk create mode 100644 src/lib/libast/astsa/ccode.h create mode 100644 src/lib/libast/astsa/debug.h create mode 100644 src/lib/libast/astsa/error.c create mode 100644 src/lib/libast/astsa/error.h create mode 100644 src/lib/libast/astsa/hashkey.h create mode 100755 src/lib/libast/astsa/mkast_sa create mode 100644 src/lib/libast/astsa/option.h create mode 100644 src/lib/libast/astsa/optlib.h create mode 100644 src/lib/libast/astsa/sfstr.c create mode 100644 src/lib/libast/astsa/sfstr.h create mode 100644 src/lib/libast/astsa/strdup.c create mode 100644 src/lib/libast/astsa/strmatch.c create mode 100644 src/lib/libast/astsa/times.h create mode 100644 src/lib/libast/astsa/vmalloc.c create mode 100644 src/lib/libast/astsa/vmalloc.h create mode 100644 src/lib/libast/cdt/cdtlib.h create mode 100644 src/lib/libast/cdt/dtclose.c create mode 100644 src/lib/libast/cdt/dtcomp.c create mode 100644 src/lib/libast/cdt/dtdisc.c create mode 100644 src/lib/libast/cdt/dthash.c create mode 100644 src/lib/libast/cdt/dthdr.h create mode 100644 src/lib/libast/cdt/dtlist.c create mode 100644 src/lib/libast/cdt/dtmethod.c create mode 100644 src/lib/libast/cdt/dtnew.c create mode 100644 src/lib/libast/cdt/dtopen.c create mode 100644 src/lib/libast/cdt/dtstrhash.c create mode 100644 src/lib/libast/cdt/dttree.c create mode 100644 src/lib/libast/cdt/dtview.c create mode 100644 src/lib/libast/cdt/dtwalk.c create mode 100644 src/lib/libast/comp/atexit.c create mode 100644 src/lib/libast/comp/basename.c create mode 100644 src/lib/libast/comp/catopen.c create mode 100644 src/lib/libast/comp/closelog.c create mode 100644 src/lib/libast/comp/conf.sh create mode 100644 src/lib/libast/comp/conf.tab create mode 100644 src/lib/libast/comp/creat64.c create mode 100644 src/lib/libast/comp/dirname.c create mode 100644 src/lib/libast/comp/dup2.c create mode 100644 src/lib/libast/comp/eaccess.c create mode 100644 src/lib/libast/comp/errno.c create mode 100644 src/lib/libast/comp/execlp.c create mode 100644 src/lib/libast/comp/execve.c create mode 100644 src/lib/libast/comp/execvp.c create mode 100644 src/lib/libast/comp/execvpe.c create mode 100644 src/lib/libast/comp/fakelink.h create mode 100644 src/lib/libast/comp/fcntl.c create mode 100644 src/lib/libast/comp/fmtmsg.h create mode 100644 src/lib/libast/comp/fmtmsglib.c create mode 100644 src/lib/libast/comp/fnmatch.c create mode 100644 src/lib/libast/comp/fnmatch.h create mode 100644 src/lib/libast/comp/frexp.c create mode 100644 src/lib/libast/comp/frexpl.c create mode 100644 src/lib/libast/comp/fsync.c create mode 100644 src/lib/libast/comp/ftw.c create mode 100644 src/lib/libast/comp/ftw.h create mode 100644 src/lib/libast/comp/getdate.c create mode 100644 src/lib/libast/comp/getgroups.c create mode 100644 src/lib/libast/comp/getlogin.c create mode 100644 src/lib/libast/comp/getopt.c create mode 100644 src/lib/libast/comp/getopt.h create mode 100644 src/lib/libast/comp/getoptl.c create mode 100644 src/lib/libast/comp/getpgrp.c create mode 100644 src/lib/libast/comp/getsubopt.c create mode 100644 src/lib/libast/comp/getwd.c create mode 100644 src/lib/libast/comp/gross.c create mode 100644 src/lib/libast/comp/gross_sgi.h create mode 100644 src/lib/libast/comp/hsearch.c create mode 100644 src/lib/libast/comp/iconv.c create mode 100644 src/lib/libast/comp/killpg.c create mode 100644 src/lib/libast/comp/libgen.h create mode 100644 src/lib/libast/comp/link.c create mode 100644 src/lib/libast/comp/localeconv.c create mode 100644 src/lib/libast/comp/lstat.c create mode 100644 src/lib/libast/comp/memccpy.c create mode 100644 src/lib/libast/comp/memchr.c create mode 100644 src/lib/libast/comp/memcmp.c create mode 100644 src/lib/libast/comp/memcpy.c create mode 100644 src/lib/libast/comp/memmove.c create mode 100644 src/lib/libast/comp/memset.c create mode 100644 src/lib/libast/comp/mkdir.c create mode 100644 src/lib/libast/comp/mkfifo.c create mode 100644 src/lib/libast/comp/mknod.c create mode 100644 src/lib/libast/comp/mktemp.c create mode 100644 src/lib/libast/comp/mktime.c create mode 100644 src/lib/libast/comp/mount.c create mode 100644 src/lib/libast/comp/nftw.c create mode 100644 src/lib/libast/comp/omitted.c create mode 100644 src/lib/libast/comp/open.c create mode 100644 src/lib/libast/comp/openlog.c create mode 100644 src/lib/libast/comp/putenv.c create mode 100644 src/lib/libast/comp/re_comp.c create mode 100644 src/lib/libast/comp/re_comp.h create mode 100644 src/lib/libast/comp/readlink.c create mode 100644 src/lib/libast/comp/realpath.c create mode 100644 src/lib/libast/comp/regcmp.c create mode 100644 src/lib/libast/comp/regexp.c create mode 100644 src/lib/libast/comp/regexp.h create mode 100644 src/lib/libast/comp/remove.c create mode 100644 src/lib/libast/comp/rename.c create mode 100644 src/lib/libast/comp/resolvepath.c create mode 100644 src/lib/libast/comp/rmdir.c create mode 100644 src/lib/libast/comp/setenv.c create mode 100644 src/lib/libast/comp/setlocale.c create mode 100644 src/lib/libast/comp/setlogmask.c create mode 100644 src/lib/libast/comp/setpgid.c create mode 100644 src/lib/libast/comp/setsid.c create mode 100644 src/lib/libast/comp/sigflag.c create mode 100644 src/lib/libast/comp/sigunblock.c create mode 100644 src/lib/libast/comp/spawnveg.c create mode 100644 src/lib/libast/comp/statvfs.c create mode 100644 src/lib/libast/comp/strcasecmp.c create mode 100644 src/lib/libast/comp/strchr.c create mode 100644 src/lib/libast/comp/strftime.c create mode 100644 src/lib/libast/comp/strncasecmp.c create mode 100644 src/lib/libast/comp/strptime.c create mode 100644 src/lib/libast/comp/strrchr.c create mode 100644 src/lib/libast/comp/strstr.c create mode 100644 src/lib/libast/comp/strtod.c create mode 100644 src/lib/libast/comp/strtol.c create mode 100644 src/lib/libast/comp/strtold.c create mode 100644 src/lib/libast/comp/strtoll.c create mode 100644 src/lib/libast/comp/strtoul.c create mode 100644 src/lib/libast/comp/strtoull.c create mode 100644 src/lib/libast/comp/swab.c create mode 100644 src/lib/libast/comp/symlink.c create mode 100644 src/lib/libast/comp/syslog.c create mode 100644 src/lib/libast/comp/syslog.h create mode 100644 src/lib/libast/comp/sysloglib.h create mode 100644 src/lib/libast/comp/system.c create mode 100644 src/lib/libast/comp/tempnam.c create mode 100644 src/lib/libast/comp/tmpnam.c create mode 100644 src/lib/libast/comp/transition.c create mode 100644 src/lib/libast/comp/tsearch.c create mode 100644 src/lib/libast/comp/unlink.c create mode 100644 src/lib/libast/comp/unsetenv.c create mode 100644 src/lib/libast/comp/vfork.c create mode 100644 src/lib/libast/comp/waitpid.c create mode 100644 src/lib/libast/comp/wc.c create mode 100644 src/lib/libast/comp/wordexp.c create mode 100644 src/lib/libast/comp/wordexp.h create mode 100644 src/lib/libast/dir/dirlib.h create mode 100644 src/lib/libast/dir/dirstd.h create mode 100644 src/lib/libast/dir/getdents.c create mode 100644 src/lib/libast/dir/opendir.c create mode 100644 src/lib/libast/dir/readdir.c create mode 100644 src/lib/libast/dir/rewinddir.c create mode 100644 src/lib/libast/dir/seekdir.c create mode 100644 src/lib/libast/dir/telldir.c create mode 100644 src/lib/libast/disc/memfatal.c create mode 100644 src/lib/libast/disc/sfdcdio.c create mode 100644 src/lib/libast/disc/sfdcdos.c create mode 100644 src/lib/libast/disc/sfdcfilter.c create mode 100644 src/lib/libast/disc/sfdchdr.h create mode 100644 src/lib/libast/disc/sfdcmore.c create mode 100644 src/lib/libast/disc/sfdcprefix.c create mode 100644 src/lib/libast/disc/sfdcseekable.c create mode 100644 src/lib/libast/disc/sfdcslow.c create mode 100644 src/lib/libast/disc/sfdcsubstr.c create mode 100644 src/lib/libast/disc/sfdctee.c create mode 100644 src/lib/libast/disc/sfdcunion.c create mode 100644 src/lib/libast/disc/sfkeyprintf.c create mode 100644 src/lib/libast/disc/sfstrtmp.c create mode 100644 src/lib/libast/features/align.c create mode 100644 src/lib/libast/features/api create mode 100644 src/lib/libast/features/aso create mode 100644 src/lib/libast/features/botch.c create mode 100644 src/lib/libast/features/ccode create mode 100644 src/lib/libast/features/common create mode 100644 src/lib/libast/features/dirent create mode 100644 src/lib/libast/features/eaccess create mode 100644 src/lib/libast/features/errno create mode 100644 src/lib/libast/features/fcntl.c create mode 100644 src/lib/libast/features/float create mode 100644 src/lib/libast/features/fs create mode 100644 src/lib/libast/features/hack create mode 100644 src/lib/libast/features/iconv create mode 100644 src/lib/libast/features/isoc99 create mode 100644 src/lib/libast/features/lib create mode 100644 src/lib/libast/features/libpath.sh create mode 100644 src/lib/libast/features/limits.c create mode 100644 src/lib/libast/features/locale create mode 100644 src/lib/libast/features/map.c create mode 100644 src/lib/libast/features/mmap create mode 100644 src/lib/libast/features/mode.c create mode 100644 src/lib/libast/features/ndbm create mode 100644 src/lib/libast/features/nl_types create mode 100644 src/lib/libast/features/omitted create mode 100644 src/lib/libast/features/options create mode 100644 src/lib/libast/features/param.sh create mode 100644 src/lib/libast/features/preroot.sh create mode 100644 src/lib/libast/features/prog create mode 100644 src/lib/libast/features/sfinit.c create mode 100644 src/lib/libast/features/sfio create mode 100644 src/lib/libast/features/sig.sh create mode 100644 src/lib/libast/features/siglist create mode 100644 src/lib/libast/features/signal.c create mode 100644 src/lib/libast/features/sizeof create mode 100644 src/lib/libast/features/standards create mode 100644 src/lib/libast/features/stdio create mode 100644 src/lib/libast/features/sys create mode 100644 src/lib/libast/features/syscall create mode 100644 src/lib/libast/features/time create mode 100644 src/lib/libast/features/tmlib create mode 100644 src/lib/libast/features/tmx create mode 100644 src/lib/libast/features/tty create mode 100644 src/lib/libast/features/tv create mode 100644 src/lib/libast/features/tvlib create mode 100644 src/lib/libast/features/uwin create mode 100644 src/lib/libast/features/vfork create mode 100644 src/lib/libast/features/vmalloc create mode 100644 src/lib/libast/features/wait create mode 100644 src/lib/libast/features/wchar create mode 100644 src/lib/libast/features/wctype create mode 100644 src/lib/libast/hash/hashalloc.c create mode 100644 src/lib/libast/hash/hashdump.c create mode 100644 src/lib/libast/hash/hashfree.c create mode 100644 src/lib/libast/hash/hashlast.c create mode 100644 src/lib/libast/hash/hashlib.h create mode 100644 src/lib/libast/hash/hashlook.c create mode 100644 src/lib/libast/hash/hashscan.c create mode 100644 src/lib/libast/hash/hashsize.c create mode 100644 src/lib/libast/hash/hashview.c create mode 100644 src/lib/libast/hash/hashwalk.c create mode 100644 src/lib/libast/hash/memhash.c create mode 100644 src/lib/libast/hash/memsum.c create mode 100644 src/lib/libast/hash/strhash.c create mode 100644 src/lib/libast/hash/strkey.c create mode 100644 src/lib/libast/hash/strsum.c create mode 100644 src/lib/libast/include/aso.h create mode 100644 src/lib/libast/include/ast.h create mode 100644 src/lib/libast/include/ast_dir.h create mode 100644 src/lib/libast/include/ast_getopt.h create mode 100644 src/lib/libast/include/ast_std.h create mode 100644 src/lib/libast/include/ast_windows.h create mode 100644 src/lib/libast/include/ccode.h create mode 100644 src/lib/libast/include/cdt.h create mode 100644 src/lib/libast/include/cmdarg.h create mode 100644 src/lib/libast/include/debug.h create mode 100644 src/lib/libast/include/dt.h create mode 100644 src/lib/libast/include/error.h create mode 100644 src/lib/libast/include/find.h create mode 100644 src/lib/libast/include/fnv.h create mode 100644 src/lib/libast/include/fs3d.h create mode 100644 src/lib/libast/include/fts.h create mode 100644 src/lib/libast/include/ftwalk.h create mode 100644 src/lib/libast/include/glob.h create mode 100644 src/lib/libast/include/hash.h create mode 100644 src/lib/libast/include/hashkey.h create mode 100644 src/lib/libast/include/hashpart.h create mode 100644 src/lib/libast/include/ip6.h create mode 100644 src/lib/libast/include/ls.h create mode 100644 src/lib/libast/include/magic.h create mode 100644 src/lib/libast/include/magicid.h create mode 100644 src/lib/libast/include/mc.h create mode 100644 src/lib/libast/include/mime.h create mode 100644 src/lib/libast/include/mnt.h create mode 100644 src/lib/libast/include/modecanon.h create mode 100644 src/lib/libast/include/modex.h create mode 100644 src/lib/libast/include/namval.h create mode 100644 src/lib/libast/include/option.h create mode 100644 src/lib/libast/include/proc.h create mode 100644 src/lib/libast/include/recfmt.h create mode 100644 src/lib/libast/include/regex.h create mode 100644 src/lib/libast/include/sfdisc.h create mode 100644 src/lib/libast/include/sfio.h create mode 100644 src/lib/libast/include/sfio_s.h create mode 100644 src/lib/libast/include/sfio_t.h create mode 100644 src/lib/libast/include/shcmd.h create mode 100644 src/lib/libast/include/stack.h create mode 100644 src/lib/libast/include/stak.h create mode 100644 src/lib/libast/include/stk.h create mode 100644 src/lib/libast/include/swap.h create mode 100644 src/lib/libast/include/tar.h create mode 100644 src/lib/libast/include/times.h create mode 100644 src/lib/libast/include/tm.h create mode 100644 src/lib/libast/include/tok.h create mode 100644 src/lib/libast/include/usage.h create mode 100644 src/lib/libast/include/vdb.h create mode 100644 src/lib/libast/include/vecargs.h create mode 100644 src/lib/libast/include/vmalloc.h create mode 100644 src/lib/libast/include/wait.h create mode 100644 src/lib/libast/man/LIBAST.3 create mode 100644 src/lib/libast/man/aso.3 create mode 100644 src/lib/libast/man/ast.3 create mode 100644 src/lib/libast/man/astsa.3 create mode 100644 src/lib/libast/man/cdt.3 create mode 100644 src/lib/libast/man/chr.3 create mode 100644 src/lib/libast/man/compat.3 create mode 100644 src/lib/libast/man/error.3 create mode 100644 src/lib/libast/man/find.3 create mode 100644 src/lib/libast/man/fmt.3 create mode 100644 src/lib/libast/man/fmtls.3 create mode 100644 src/lib/libast/man/fs3d.3 create mode 100644 src/lib/libast/man/ftwalk.3 create mode 100644 src/lib/libast/man/getcwd.3 create mode 100644 src/lib/libast/man/hash.3 create mode 100644 src/lib/libast/man/iblocks.3 create mode 100644 src/lib/libast/man/int.3 create mode 100644 src/lib/libast/man/ip6.3 create mode 100644 src/lib/libast/man/magic.3 create mode 100644 src/lib/libast/man/mem.3 create mode 100644 src/lib/libast/man/mime.3 create mode 100644 src/lib/libast/man/modecanon.3 create mode 100644 src/lib/libast/man/optget.3 create mode 100644 src/lib/libast/man/path.3 create mode 100644 src/lib/libast/man/preroot.3 create mode 100644 src/lib/libast/man/proc.3 create mode 100644 src/lib/libast/man/re.3 create mode 100644 src/lib/libast/man/regex.3 create mode 100644 src/lib/libast/man/setenviron.3 create mode 100644 src/lib/libast/man/sfdisc.3 create mode 100644 src/lib/libast/man/sfio.3 create mode 100644 src/lib/libast/man/sig.3 create mode 100644 src/lib/libast/man/spawnveg.3 create mode 100644 src/lib/libast/man/stak.3 create mode 100644 src/lib/libast/man/stk.3 create mode 100644 src/lib/libast/man/strcopy.3 create mode 100644 src/lib/libast/man/strdup.3 create mode 100644 src/lib/libast/man/strelapsed.3 create mode 100644 src/lib/libast/man/strerror.3 create mode 100644 src/lib/libast/man/stresc.3 create mode 100644 src/lib/libast/man/streval.3 create mode 100644 src/lib/libast/man/strgid.3 create mode 100644 src/lib/libast/man/strmatch.3 create mode 100644 src/lib/libast/man/stropt.3 create mode 100644 src/lib/libast/man/strperm.3 create mode 100644 src/lib/libast/man/strsignal.3 create mode 100644 src/lib/libast/man/strsort.3 create mode 100644 src/lib/libast/man/strtape.3 create mode 100644 src/lib/libast/man/strton.3 create mode 100644 src/lib/libast/man/struid.3 create mode 100644 src/lib/libast/man/swap.3 create mode 100644 src/lib/libast/man/tab.3 create mode 100644 src/lib/libast/man/tm.3 create mode 100644 src/lib/libast/man/tmx.3 create mode 100644 src/lib/libast/man/tok.3 create mode 100644 src/lib/libast/man/touch.3 create mode 100644 src/lib/libast/man/tv.3 create mode 100644 src/lib/libast/man/vecargs.3 create mode 100644 src/lib/libast/man/vmalloc.3 create mode 100644 src/lib/libast/misc/astintercept.c create mode 100644 src/lib/libast/misc/cmdarg.c create mode 100644 src/lib/libast/misc/conformance.c create mode 100644 src/lib/libast/misc/debug.c create mode 100644 src/lib/libast/misc/error.c create mode 100644 src/lib/libast/misc/errorf.c create mode 100644 src/lib/libast/misc/errormsg.c create mode 100644 src/lib/libast/misc/errorx.c create mode 100644 src/lib/libast/misc/fastfind.c create mode 100644 src/lib/libast/misc/findlib.h create mode 100644 src/lib/libast/misc/fmtrec.c create mode 100644 src/lib/libast/misc/fs3d.c create mode 100644 src/lib/libast/misc/fts.c create mode 100644 src/lib/libast/misc/ftwalk.c create mode 100644 src/lib/libast/misc/ftwflags.c create mode 100644 src/lib/libast/misc/getcwd.c create mode 100644 src/lib/libast/misc/getenv.c create mode 100644 src/lib/libast/misc/glob.c create mode 100644 src/lib/libast/misc/intercepts.h create mode 100644 src/lib/libast/misc/magic.c create mode 100644 src/lib/libast/misc/magic.tab create mode 100644 src/lib/libast/misc/mime.c create mode 100644 src/lib/libast/misc/mimelib.h create mode 100644 src/lib/libast/misc/mimetype.c create mode 100644 src/lib/libast/misc/optctx.c create mode 100644 src/lib/libast/misc/optesc.c create mode 100644 src/lib/libast/misc/optget.c create mode 100644 src/lib/libast/misc/optjoin.c create mode 100644 src/lib/libast/misc/optlib.h create mode 100644 src/lib/libast/misc/procclose.c create mode 100644 src/lib/libast/misc/procfree.c create mode 100644 src/lib/libast/misc/proclib.h create mode 100644 src/lib/libast/misc/procopen.c create mode 100644 src/lib/libast/misc/procrun.c create mode 100644 src/lib/libast/misc/recfmt.c create mode 100644 src/lib/libast/misc/reclen.c create mode 100644 src/lib/libast/misc/recstr.c create mode 100644 src/lib/libast/misc/setenviron.c create mode 100644 src/lib/libast/misc/sigcrit.c create mode 100644 src/lib/libast/misc/sigdata.c create mode 100644 src/lib/libast/misc/signal.c create mode 100644 src/lib/libast/misc/stack.c create mode 100644 src/lib/libast/misc/state.c create mode 100644 src/lib/libast/misc/stk.c create mode 100644 src/lib/libast/misc/systrace.c create mode 100644 src/lib/libast/misc/translate.c create mode 100644 src/lib/libast/misc/univdata.c create mode 100644 src/lib/libast/misc/univlib.h create mode 100644 src/lib/libast/obsolete/spawn.c create mode 100644 src/lib/libast/path/pathaccess.c create mode 100644 src/lib/libast/path/pathbin.c create mode 100644 src/lib/libast/path/pathcanon.c create mode 100644 src/lib/libast/path/pathcat.c create mode 100644 src/lib/libast/path/pathcd.c create mode 100644 src/lib/libast/path/pathcheck.c create mode 100644 src/lib/libast/path/pathexists.c create mode 100644 src/lib/libast/path/pathfind.c create mode 100644 src/lib/libast/path/pathgetlink.c create mode 100644 src/lib/libast/path/pathkey.c create mode 100644 src/lib/libast/path/pathnative.c create mode 100644 src/lib/libast/path/pathpath.c create mode 100644 src/lib/libast/path/pathposix.c create mode 100644 src/lib/libast/path/pathprobe.c create mode 100644 src/lib/libast/path/pathprog.c create mode 100644 src/lib/libast/path/pathrepl.c create mode 100644 src/lib/libast/path/pathsetlink.c create mode 100644 src/lib/libast/path/pathshell.c create mode 100644 src/lib/libast/path/pathstat.c create mode 100644 src/lib/libast/path/pathtemp.c create mode 100644 src/lib/libast/path/pathtmp.c create mode 100644 src/lib/libast/port/astconf.c create mode 100644 src/lib/libast/port/astcopy.c create mode 100644 src/lib/libast/port/astdynamic.c create mode 100644 src/lib/libast/port/astlicense.c create mode 100644 src/lib/libast/port/astmath.c create mode 100644 src/lib/libast/port/astquery.c create mode 100644 src/lib/libast/port/aststatic.c create mode 100644 src/lib/libast/port/astwinsize.c create mode 100644 src/lib/libast/port/atmain.C create mode 100644 src/lib/libast/port/iblocks.c create mode 100644 src/lib/libast/port/lc.c create mode 100644 src/lib/libast/port/lc.tab create mode 100644 src/lib/libast/port/lcgen.c create mode 100644 src/lib/libast/port/lclang.h create mode 100644 src/lib/libast/port/lclib.h create mode 100644 src/lib/libast/port/mc.c create mode 100644 src/lib/libast/port/mnt.c create mode 100644 src/lib/libast/port/touch.c create mode 100644 src/lib/libast/preroot/getpreroot.c create mode 100644 src/lib/libast/preroot/ispreroot.c create mode 100644 src/lib/libast/preroot/realopen.c create mode 100644 src/lib/libast/preroot/setpreroot.c create mode 100644 src/lib/libast/regex/regalloc.c create mode 100644 src/lib/libast/regex/regcache.c create mode 100644 src/lib/libast/regex/regclass.c create mode 100644 src/lib/libast/regex/regcoll.c create mode 100644 src/lib/libast/regex/regcomp.c create mode 100644 src/lib/libast/regex/regdecomp.c create mode 100644 src/lib/libast/regex/regerror.c create mode 100644 src/lib/libast/regex/regexec.c create mode 100644 src/lib/libast/regex/regfatal.c create mode 100644 src/lib/libast/regex/reginit.c create mode 100644 src/lib/libast/regex/reglib.h create mode 100644 src/lib/libast/regex/regnexec.c create mode 100644 src/lib/libast/regex/regrecord.c create mode 100644 src/lib/libast/regex/regrexec.c create mode 100644 src/lib/libast/regex/regstat.c create mode 100644 src/lib/libast/regex/regsub.c create mode 100644 src/lib/libast/regex/regsubcomp.c create mode 100644 src/lib/libast/regex/regsubexec.c create mode 100644 src/lib/libast/sfio/_sfclrerr.c create mode 100644 src/lib/libast/sfio/_sfdlen.c create mode 100644 src/lib/libast/sfio/_sfeof.c create mode 100644 src/lib/libast/sfio/_sferror.c create mode 100644 src/lib/libast/sfio/_sffileno.c create mode 100644 src/lib/libast/sfio/_sfgetc.c create mode 100644 src/lib/libast/sfio/_sfgetl.c create mode 100644 src/lib/libast/sfio/_sfgetl2.c create mode 100644 src/lib/libast/sfio/_sfgetu.c create mode 100644 src/lib/libast/sfio/_sfgetu2.c create mode 100644 src/lib/libast/sfio/_sfllen.c create mode 100644 src/lib/libast/sfio/_sfopen.c create mode 100644 src/lib/libast/sfio/_sfputc.c create mode 100644 src/lib/libast/sfio/_sfputd.c create mode 100644 src/lib/libast/sfio/_sfputl.c create mode 100644 src/lib/libast/sfio/_sfputm.c create mode 100644 src/lib/libast/sfio/_sfputu.c create mode 100644 src/lib/libast/sfio/_sfslen.c create mode 100644 src/lib/libast/sfio/_sfstacked.c create mode 100644 src/lib/libast/sfio/_sfulen.c create mode 100644 src/lib/libast/sfio/_sfvalue.c create mode 100644 src/lib/libast/sfio/sfclose.c create mode 100644 src/lib/libast/sfio/sfclrlock.c create mode 100644 src/lib/libast/sfio/sfcvt.c create mode 100644 src/lib/libast/sfio/sfdisc.c create mode 100644 src/lib/libast/sfio/sfdlen.c create mode 100644 src/lib/libast/sfio/sfecvt.c create mode 100644 src/lib/libast/sfio/sfexcept.c create mode 100644 src/lib/libast/sfio/sfextern.c create mode 100644 src/lib/libast/sfio/sffcvt.c create mode 100644 src/lib/libast/sfio/sffilbuf.c create mode 100644 src/lib/libast/sfio/sfflsbuf.c create mode 100644 src/lib/libast/sfio/sfgetd.c create mode 100644 src/lib/libast/sfio/sfgetl.c create mode 100644 src/lib/libast/sfio/sfgetm.c create mode 100644 src/lib/libast/sfio/sfgetr.c create mode 100644 src/lib/libast/sfio/sfgetu.c create mode 100644 src/lib/libast/sfio/sfhdr.h create mode 100644 src/lib/libast/sfio/sfllen.c create mode 100644 src/lib/libast/sfio/sfmode.c create mode 100644 src/lib/libast/sfio/sfmove.c create mode 100644 src/lib/libast/sfio/sfmutex.c create mode 100644 src/lib/libast/sfio/sfnew.c create mode 100644 src/lib/libast/sfio/sfnotify.c create mode 100644 src/lib/libast/sfio/sfnputc.c create mode 100644 src/lib/libast/sfio/sfopen.c create mode 100644 src/lib/libast/sfio/sfpeek.c create mode 100644 src/lib/libast/sfio/sfpkrd.c create mode 100644 src/lib/libast/sfio/sfpoll.c create mode 100644 src/lib/libast/sfio/sfpool.c create mode 100644 src/lib/libast/sfio/sfpopen.c create mode 100644 src/lib/libast/sfio/sfprintf.c create mode 100644 src/lib/libast/sfio/sfprints.c create mode 100644 src/lib/libast/sfio/sfpurge.c create mode 100644 src/lib/libast/sfio/sfputd.c create mode 100644 src/lib/libast/sfio/sfputl.c create mode 100644 src/lib/libast/sfio/sfputm.c create mode 100644 src/lib/libast/sfio/sfputr.c create mode 100644 src/lib/libast/sfio/sfputu.c create mode 100644 src/lib/libast/sfio/sfraise.c create mode 100644 src/lib/libast/sfio/sfrd.c create mode 100644 src/lib/libast/sfio/sfread.c create mode 100644 src/lib/libast/sfio/sfreserve.c create mode 100644 src/lib/libast/sfio/sfresize.c create mode 100644 src/lib/libast/sfio/sfscanf.c create mode 100644 src/lib/libast/sfio/sfseek.c create mode 100644 src/lib/libast/sfio/sfset.c create mode 100644 src/lib/libast/sfio/sfsetbuf.c create mode 100644 src/lib/libast/sfio/sfsetfd.c create mode 100644 src/lib/libast/sfio/sfsize.c create mode 100644 src/lib/libast/sfio/sfsk.c create mode 100644 src/lib/libast/sfio/sfstack.c create mode 100644 src/lib/libast/sfio/sfstrtod.c create mode 100644 src/lib/libast/sfio/sfstrtof.h create mode 100644 src/lib/libast/sfio/sfswap.c create mode 100644 src/lib/libast/sfio/sfsync.c create mode 100644 src/lib/libast/sfio/sftable.c create mode 100644 src/lib/libast/sfio/sftell.c create mode 100644 src/lib/libast/sfio/sftmp.c create mode 100644 src/lib/libast/sfio/sfungetc.c create mode 100644 src/lib/libast/sfio/sfvprintf.c create mode 100644 src/lib/libast/sfio/sfvscanf.c create mode 100644 src/lib/libast/sfio/sfwalk.c create mode 100644 src/lib/libast/sfio/sfwr.c create mode 100644 src/lib/libast/sfio/sfwrite.c create mode 100644 src/lib/libast/sfio/vthread.h create mode 100644 src/lib/libast/std/bytesex.h create mode 100644 src/lib/libast/std/dirent.h create mode 100644 src/lib/libast/std/endian.h create mode 100644 src/lib/libast/std/iconv.h create mode 100644 src/lib/libast/std/nl_types.h create mode 100644 src/lib/libast/std/stdio.h create mode 100644 src/lib/libast/std/wchar.h create mode 100644 src/lib/libast/std/wctype.h create mode 100644 src/lib/libast/stdio/_doprnt.c create mode 100644 src/lib/libast/stdio/_doscan.c create mode 100644 src/lib/libast/stdio/_filbuf.c create mode 100644 src/lib/libast/stdio/_flsbuf.c create mode 100644 src/lib/libast/stdio/_stdfun.c create mode 100644 src/lib/libast/stdio/_stdopen.c create mode 100644 src/lib/libast/stdio/_stdprintf.c create mode 100644 src/lib/libast/stdio/_stdscanf.c create mode 100644 src/lib/libast/stdio/_stdsprnt.c create mode 100644 src/lib/libast/stdio/_stdvbuf.c create mode 100644 src/lib/libast/stdio/_stdvsnprnt.c create mode 100644 src/lib/libast/stdio/_stdvsprnt.c create mode 100644 src/lib/libast/stdio/_stdvsscn.c create mode 100644 src/lib/libast/stdio/asprintf.c create mode 100644 src/lib/libast/stdio/clearerr.c create mode 100644 src/lib/libast/stdio/fclose.c create mode 100644 src/lib/libast/stdio/fcloseall.c create mode 100644 src/lib/libast/stdio/fdopen.c create mode 100644 src/lib/libast/stdio/feof.c create mode 100644 src/lib/libast/stdio/ferror.c create mode 100644 src/lib/libast/stdio/fflush.c create mode 100644 src/lib/libast/stdio/fgetc.c create mode 100644 src/lib/libast/stdio/fgetpos.c create mode 100644 src/lib/libast/stdio/fgets.c create mode 100644 src/lib/libast/stdio/fgetwc.c create mode 100644 src/lib/libast/stdio/fgetws.c create mode 100644 src/lib/libast/stdio/fileno.c create mode 100644 src/lib/libast/stdio/flockfile.c create mode 100644 src/lib/libast/stdio/fmemopen.c create mode 100644 src/lib/libast/stdio/fopen.c create mode 100644 src/lib/libast/stdio/fprintf.c create mode 100644 src/lib/libast/stdio/fpurge.c create mode 100644 src/lib/libast/stdio/fputc.c create mode 100644 src/lib/libast/stdio/fputs.c create mode 100644 src/lib/libast/stdio/fputwc.c create mode 100644 src/lib/libast/stdio/fputws.c create mode 100644 src/lib/libast/stdio/fread.c create mode 100644 src/lib/libast/stdio/freopen.c create mode 100644 src/lib/libast/stdio/fscanf.c create mode 100644 src/lib/libast/stdio/fseek.c create mode 100644 src/lib/libast/stdio/fseeko.c create mode 100644 src/lib/libast/stdio/fsetpos.c create mode 100644 src/lib/libast/stdio/ftell.c create mode 100644 src/lib/libast/stdio/ftello.c create mode 100644 src/lib/libast/stdio/ftrylockfile.c create mode 100644 src/lib/libast/stdio/funlockfile.c create mode 100644 src/lib/libast/stdio/fwide.c create mode 100644 src/lib/libast/stdio/fwprintf.c create mode 100644 src/lib/libast/stdio/fwrite.c create mode 100644 src/lib/libast/stdio/fwscanf.c create mode 100644 src/lib/libast/stdio/getc.c create mode 100644 src/lib/libast/stdio/getchar.c create mode 100644 src/lib/libast/stdio/getdelim.c create mode 100644 src/lib/libast/stdio/getline.c create mode 100644 src/lib/libast/stdio/getw.c create mode 100644 src/lib/libast/stdio/getwc.c create mode 100644 src/lib/libast/stdio/getwchar.c create mode 100644 src/lib/libast/stdio/pclose.c create mode 100644 src/lib/libast/stdio/popen.c create mode 100644 src/lib/libast/stdio/printf.c create mode 100644 src/lib/libast/stdio/putc.c create mode 100644 src/lib/libast/stdio/putchar.c create mode 100644 src/lib/libast/stdio/puts.c create mode 100644 src/lib/libast/stdio/putw.c create mode 100644 src/lib/libast/stdio/putwc.c create mode 100644 src/lib/libast/stdio/putwchar.c create mode 100644 src/lib/libast/stdio/rewind.c create mode 100644 src/lib/libast/stdio/scanf.c create mode 100644 src/lib/libast/stdio/setbuf.c create mode 100644 src/lib/libast/stdio/setbuffer.c create mode 100644 src/lib/libast/stdio/setlinebuf.c create mode 100644 src/lib/libast/stdio/setvbuf.c create mode 100644 src/lib/libast/stdio/snprintf.c create mode 100644 src/lib/libast/stdio/sprintf.c create mode 100644 src/lib/libast/stdio/sscanf.c create mode 100644 src/lib/libast/stdio/stdhdr.h create mode 100644 src/lib/libast/stdio/stdio_c99.c create mode 100644 src/lib/libast/stdio/swprintf.c create mode 100644 src/lib/libast/stdio/swscanf.c create mode 100644 src/lib/libast/stdio/tmpfile.c create mode 100644 src/lib/libast/stdio/ungetc.c create mode 100644 src/lib/libast/stdio/ungetwc.c create mode 100644 src/lib/libast/stdio/vasprintf.c create mode 100644 src/lib/libast/stdio/vfprintf.c create mode 100644 src/lib/libast/stdio/vfscanf.c create mode 100644 src/lib/libast/stdio/vfwprintf.c create mode 100644 src/lib/libast/stdio/vfwscanf.c create mode 100644 src/lib/libast/stdio/vprintf.c create mode 100644 src/lib/libast/stdio/vscanf.c create mode 100644 src/lib/libast/stdio/vsnprintf.c create mode 100644 src/lib/libast/stdio/vsprintf.c create mode 100644 src/lib/libast/stdio/vsscanf.c create mode 100644 src/lib/libast/stdio/vswprintf.c create mode 100644 src/lib/libast/stdio/vswscanf.c create mode 100644 src/lib/libast/stdio/vwprintf.c create mode 100644 src/lib/libast/stdio/vwscanf.c create mode 100644 src/lib/libast/stdio/wprintf.c create mode 100644 src/lib/libast/stdio/wscanf.c create mode 100644 src/lib/libast/string/base64.c create mode 100644 src/lib/libast/string/ccmap.c create mode 100644 src/lib/libast/string/ccmapid.c create mode 100644 src/lib/libast/string/ccnative.c create mode 100644 src/lib/libast/string/chresc.c create mode 100644 src/lib/libast/string/chrtoi.c create mode 100644 src/lib/libast/string/fmtbase.c create mode 100644 src/lib/libast/string/fmtbuf.c create mode 100644 src/lib/libast/string/fmtclock.c create mode 100644 src/lib/libast/string/fmtdev.c create mode 100644 src/lib/libast/string/fmtelapsed.c create mode 100644 src/lib/libast/string/fmterror.c create mode 100644 src/lib/libast/string/fmtesc.c create mode 100644 src/lib/libast/string/fmtfmt.c create mode 100644 src/lib/libast/string/fmtfs.c create mode 100644 src/lib/libast/string/fmtgid.c create mode 100644 src/lib/libast/string/fmtident.c create mode 100644 src/lib/libast/string/fmtint.c create mode 100644 src/lib/libast/string/fmtip4.c create mode 100644 src/lib/libast/string/fmtip6.c create mode 100644 src/lib/libast/string/fmtls.c create mode 100644 src/lib/libast/string/fmtmatch.c create mode 100644 src/lib/libast/string/fmtmode.c create mode 100644 src/lib/libast/string/fmtnum.c create mode 100644 src/lib/libast/string/fmtperm.c create mode 100644 src/lib/libast/string/fmtre.c create mode 100644 src/lib/libast/string/fmtscale.c create mode 100644 src/lib/libast/string/fmtsignal.c create mode 100644 src/lib/libast/string/fmttime.c create mode 100644 src/lib/libast/string/fmttmx.c create mode 100644 src/lib/libast/string/fmttv.c create mode 100644 src/lib/libast/string/fmtuid.c create mode 100644 src/lib/libast/string/fmtversion.c create mode 100644 src/lib/libast/string/memdup.c create mode 100644 src/lib/libast/string/modedata.c create mode 100644 src/lib/libast/string/modei.c create mode 100644 src/lib/libast/string/modelib.h create mode 100644 src/lib/libast/string/modex.c create mode 100644 src/lib/libast/string/stracmp.c create mode 100644 src/lib/libast/string/strcopy.c create mode 100644 src/lib/libast/string/strdup.c create mode 100644 src/lib/libast/string/strelapsed.c create mode 100644 src/lib/libast/string/strerror.c create mode 100644 src/lib/libast/string/stresc.c create mode 100644 src/lib/libast/string/streval.c create mode 100644 src/lib/libast/string/strexpr.c create mode 100644 src/lib/libast/string/strgid.c create mode 100644 src/lib/libast/string/strlcat.c create mode 100644 src/lib/libast/string/strlcpy.c create mode 100644 src/lib/libast/string/strlook.c create mode 100644 src/lib/libast/string/strmatch.c create mode 100644 src/lib/libast/string/strmode.c create mode 100644 src/lib/libast/string/strnacmp.c create mode 100644 src/lib/libast/string/strncopy.c create mode 100644 src/lib/libast/string/strnpcmp.c create mode 100644 src/lib/libast/string/strntod.c create mode 100644 src/lib/libast/string/strntol.c create mode 100644 src/lib/libast/string/strntold.c create mode 100644 src/lib/libast/string/strntoll.c create mode 100644 src/lib/libast/string/strnton.c create mode 100644 src/lib/libast/string/strntonll.c create mode 100644 src/lib/libast/string/strntoul.c create mode 100644 src/lib/libast/string/strntoull.c create mode 100644 src/lib/libast/string/strnvcmp.c create mode 100644 src/lib/libast/string/stropt.c create mode 100644 src/lib/libast/string/strpcmp.c create mode 100644 src/lib/libast/string/strperm.c create mode 100644 src/lib/libast/string/strpsearch.c create mode 100644 src/lib/libast/string/strsearch.c create mode 100644 src/lib/libast/string/strsort.c create mode 100644 src/lib/libast/string/strtape.c create mode 100644 src/lib/libast/string/strtoi.h create mode 100644 src/lib/libast/string/strtoip4.c create mode 100644 src/lib/libast/string/strtoip6.c create mode 100644 src/lib/libast/string/strton.c create mode 100644 src/lib/libast/string/strtonll.c create mode 100644 src/lib/libast/string/struid.c create mode 100644 src/lib/libast/string/struniq.c create mode 100644 src/lib/libast/string/strvcmp.c create mode 100644 src/lib/libast/string/swapget.c create mode 100644 src/lib/libast/string/swapmem.c create mode 100644 src/lib/libast/string/swapop.c create mode 100644 src/lib/libast/string/swapput.c create mode 100644 src/lib/libast/string/tok.c create mode 100644 src/lib/libast/string/tokline.c create mode 100644 src/lib/libast/string/tokscan.c create mode 100644 src/lib/libast/string/wc2utf8.c create mode 100644 src/lib/libast/tm/tmdata.c create mode 100644 src/lib/libast/tm/tmdate.c create mode 100644 src/lib/libast/tm/tmequiv.c create mode 100644 src/lib/libast/tm/tmfix.c create mode 100644 src/lib/libast/tm/tmfmt.c create mode 100644 src/lib/libast/tm/tmform.c create mode 100644 src/lib/libast/tm/tmgoff.c create mode 100644 src/lib/libast/tm/tminit.c create mode 100644 src/lib/libast/tm/tmleap.c create mode 100644 src/lib/libast/tm/tmlex.c create mode 100644 src/lib/libast/tm/tmlocale.c create mode 100644 src/lib/libast/tm/tmmake.c create mode 100644 src/lib/libast/tm/tmpoff.c create mode 100644 src/lib/libast/tm/tmscan.c create mode 100644 src/lib/libast/tm/tmsleep.c create mode 100644 src/lib/libast/tm/tmtime.c create mode 100644 src/lib/libast/tm/tmtype.c create mode 100644 src/lib/libast/tm/tmweek.c create mode 100644 src/lib/libast/tm/tmword.c create mode 100644 src/lib/libast/tm/tmxdate.c create mode 100644 src/lib/libast/tm/tmxduration.c create mode 100644 src/lib/libast/tm/tmxfmt.c create mode 100644 src/lib/libast/tm/tmxgettime.c create mode 100644 src/lib/libast/tm/tmxleap.c create mode 100644 src/lib/libast/tm/tmxmake.c create mode 100644 src/lib/libast/tm/tmxscan.c create mode 100644 src/lib/libast/tm/tmxsettime.c create mode 100644 src/lib/libast/tm/tmxsleep.c create mode 100644 src/lib/libast/tm/tmxtime.c create mode 100644 src/lib/libast/tm/tmxtouch.c create mode 100644 src/lib/libast/tm/tmzone.c create mode 100644 src/lib/libast/tm/tvcmp.c create mode 100644 src/lib/libast/tm/tvgettime.c create mode 100644 src/lib/libast/tm/tvsettime.c create mode 100644 src/lib/libast/tm/tvsleep.c create mode 100644 src/lib/libast/tm/tvtouch.c create mode 100644 src/lib/libast/uwin/a64l.c create mode 100644 src/lib/libast/uwin/acosh.c create mode 100644 src/lib/libast/uwin/asinh.c create mode 100644 src/lib/libast/uwin/atanh.c create mode 100644 src/lib/libast/uwin/cbrt.c create mode 100644 src/lib/libast/uwin/crypt.c create mode 100644 src/lib/libast/uwin/erf.c create mode 100644 src/lib/libast/uwin/err.c create mode 100644 src/lib/libast/uwin/exp.c create mode 100644 src/lib/libast/uwin/exp__E.c create mode 100644 src/lib/libast/uwin/expm1.c create mode 100644 src/lib/libast/uwin/gamma.c create mode 100644 src/lib/libast/uwin/getpass.c create mode 100644 src/lib/libast/uwin/lgamma.c create mode 100644 src/lib/libast/uwin/log.c create mode 100644 src/lib/libast/uwin/log1p.c create mode 100644 src/lib/libast/uwin/log__L.c create mode 100644 src/lib/libast/uwin/mathimpl.h create mode 100644 src/lib/libast/uwin/mini.sym create mode 100644 src/lib/libast/uwin/rand48.c create mode 100644 src/lib/libast/uwin/random.c create mode 100644 src/lib/libast/uwin/rcmd.c create mode 100644 src/lib/libast/uwin/rint.c create mode 100644 src/lib/libast/uwin/rlib.h create mode 100644 src/lib/libast/uwin/support.c create mode 100644 src/lib/libast/vec/vecargs.c create mode 100644 src/lib/libast/vec/vecfile.c create mode 100644 src/lib/libast/vec/vecfree.c create mode 100644 src/lib/libast/vec/vecload.c create mode 100644 src/lib/libast/vec/vecstring.c create mode 100644 src/lib/libast/vmalloc/malloc.c create mode 100644 src/lib/libast/vmalloc/vmbest.c create mode 100644 src/lib/libast/vmalloc/vmclear.c create mode 100644 src/lib/libast/vmalloc/vmclose.c create mode 100644 src/lib/libast/vmalloc/vmdcheap.c create mode 100644 src/lib/libast/vmalloc/vmdebug.c create mode 100644 src/lib/libast/vmalloc/vmdisc.c create mode 100644 src/lib/libast/vmalloc/vmexit.c create mode 100644 src/lib/libast/vmalloc/vmgetmem.c create mode 100644 src/lib/libast/vmalloc/vmhdr.h create mode 100644 src/lib/libast/vmalloc/vmlast.c create mode 100644 src/lib/libast/vmalloc/vmmopen.c create mode 100644 src/lib/libast/vmalloc/vmopen.c create mode 100644 src/lib/libast/vmalloc/vmpool.c create mode 100644 src/lib/libast/vmalloc/vmprivate.c create mode 100644 src/lib/libast/vmalloc/vmprofile.c create mode 100644 src/lib/libast/vmalloc/vmregion.c create mode 100644 src/lib/libast/vmalloc/vmsegment.c create mode 100644 src/lib/libast/vmalloc/vmset.c create mode 100644 src/lib/libast/vmalloc/vmstat.c create mode 100644 src/lib/libast/vmalloc/vmstrdup.c create mode 100644 src/lib/libast/vmalloc/vmtrace.c create mode 100644 src/lib/libast/vmalloc/vmwalk.c create mode 100644 src/lib/libcmd/Makefile create mode 100644 src/lib/libcmd/Mamfile create mode 100644 src/lib/libcmd/RELEASE create mode 100644 src/lib/libcmd/basename.c create mode 100644 src/lib/libcmd/cat.c create mode 100644 src/lib/libcmd/chgrp.c create mode 100644 src/lib/libcmd/chmod.c create mode 100644 src/lib/libcmd/chown.c create mode 100644 src/lib/libcmd/cksum.c create mode 100644 src/lib/libcmd/cmd.h create mode 100644 src/lib/libcmd/cmdinit.c create mode 100644 src/lib/libcmd/cmp.c create mode 100644 src/lib/libcmd/comm.c create mode 100644 src/lib/libcmd/cp.c create mode 100644 src/lib/libcmd/cut.c create mode 100644 src/lib/libcmd/date.c create mode 100644 src/lib/libcmd/dirname.c create mode 100644 src/lib/libcmd/expr.c create mode 100644 src/lib/libcmd/fds.c create mode 100644 src/lib/libcmd/features/ids create mode 100644 src/lib/libcmd/features/sockets create mode 100644 src/lib/libcmd/features/symlink create mode 100644 src/lib/libcmd/features/utsname create mode 100644 src/lib/libcmd/fmt.c create mode 100644 src/lib/libcmd/fold.c create mode 100644 src/lib/libcmd/fts_fix.c create mode 100644 src/lib/libcmd/fts_fix.h create mode 100644 src/lib/libcmd/getconf.c create mode 100644 src/lib/libcmd/head.c create mode 100644 src/lib/libcmd/id.c create mode 100644 src/lib/libcmd/join.c create mode 100644 src/lib/libcmd/lib.c create mode 100644 src/lib/libcmd/ln.c create mode 100644 src/lib/libcmd/logname.c create mode 100644 src/lib/libcmd/md5sum.c create mode 100644 src/lib/libcmd/mkdir.c create mode 100644 src/lib/libcmd/mkfifo.c create mode 100644 src/lib/libcmd/mktemp.c create mode 100644 src/lib/libcmd/mv.c create mode 100644 src/lib/libcmd/paste.c create mode 100644 src/lib/libcmd/pathchk.c create mode 100644 src/lib/libcmd/pids.c create mode 100644 src/lib/libcmd/rev.c create mode 100644 src/lib/libcmd/rev.h create mode 100644 src/lib/libcmd/revlib.c create mode 100644 src/lib/libcmd/rm.c create mode 100644 src/lib/libcmd/rmdir.c create mode 100644 src/lib/libcmd/stty.c create mode 100644 src/lib/libcmd/sum.c create mode 100644 src/lib/libcmd/sync.c create mode 100644 src/lib/libcmd/tail.c create mode 100644 src/lib/libcmd/tee.c create mode 100644 src/lib/libcmd/tty.c create mode 100644 src/lib/libcmd/uname.c create mode 100644 src/lib/libcmd/uniq.c create mode 100644 src/lib/libcmd/vmstate.c create mode 100644 src/lib/libcmd/wc.c create mode 100644 src/lib/libcmd/wc.h create mode 100644 src/lib/libcmd/wclib.c create mode 100644 src/lib/libcoshell/Makefile create mode 100644 src/lib/libcoshell/Mamfile create mode 100644 src/lib/libcoshell/RELEASE create mode 100644 src/lib/libcoshell/coclose.c create mode 100644 src/lib/libcoshell/codata.c create mode 100644 src/lib/libcoshell/coexec.c create mode 100644 src/lib/libcoshell/coexport.c create mode 100644 src/lib/libcoshell/coinit.c create mode 100644 src/lib/libcoshell/cokill.c create mode 100644 src/lib/libcoshell/colib.h create mode 100644 src/lib/libcoshell/coopen.c create mode 100644 src/lib/libcoshell/coquote.c create mode 100644 src/lib/libcoshell/coshell.3 create mode 100644 src/lib/libcoshell/coshell.h create mode 100644 src/lib/libcoshell/costash.c create mode 100644 src/lib/libcoshell/cosync.c create mode 100644 src/lib/libcoshell/cowait.c create mode 100644 src/lib/libcoshell/ignore.sh create mode 100644 src/lib/libcoshell/procrun.c create mode 100644 src/lib/libcoshell/silent.sh create mode 100644 src/lib/libcoshell/system.c create mode 100644 src/lib/libdll/Makefile create mode 100644 src/lib/libdll/Mamfile create mode 100644 src/lib/libdll/RELEASE create mode 100644 src/lib/libdll/dlfcn.c create mode 100644 src/lib/libdll/dll_lib.c create mode 100644 src/lib/libdll/dllcheck.c create mode 100644 src/lib/libdll/dllerror.c create mode 100644 src/lib/libdll/dllfind.c create mode 100644 src/lib/libdll/dlllib.h create mode 100644 src/lib/libdll/dlllook.c create mode 100644 src/lib/libdll/dllnext.c create mode 100644 src/lib/libdll/dllopen.c create mode 100644 src/lib/libdll/dllplug.c create mode 100644 src/lib/libdll/dllscan.c create mode 100644 src/lib/libdll/features/dll create mode 100644 src/lib/libsum/Makefile create mode 100644 src/lib/libsum/Mamfile create mode 100644 src/lib/libsum/RELEASE create mode 100644 src/lib/libsum/features/sum create mode 100644 src/lib/libsum/sum-ast4.c create mode 100644 src/lib/libsum/sum-att.c create mode 100644 src/lib/libsum/sum-bsd.c create mode 100644 src/lib/libsum/sum-crc.c create mode 100644 src/lib/libsum/sum-lmd.c create mode 100644 src/lib/libsum/sum-md5.c create mode 100644 src/lib/libsum/sum-prng.c create mode 100644 src/lib/libsum/sum-sha1.c create mode 100644 src/lib/libsum/sum-sha2.c create mode 100644 src/lib/libsum/sum.h create mode 100644 src/lib/libsum/sumlib.c diff --git a/README b/README new file mode 100644 index 0000000..cf7ba4e --- /dev/null +++ b/README @@ -0,0 +1,29 @@ +This is a package root directory $PACKAGEROOT. Source and binary +packages in this directory tree are controlled by the command + + bin/package + +Binary files may be in this directory or in the install root directory + + INSTALLROOT=$PACKAGEROOT/arch/`bin/package` + +For more information run + + bin/package help + +Many of the packaged commands self-document via the --man and --html +options; those that do have no separate man page. + +Each package is covered by one of the license files + + lib/package/LICENSES/ + +where is the license type for the package. At the top +of each license file is a URL; the license covers all software that +refers to this URL. For details run + + bin/package license [] + +Any archives, distributions or packages made from source or +binaries covered by license(s) must contain the corresponding +license file(s). diff --git a/bin/ignore b/bin/ignore new file mode 100755 index 0000000..2e795f4 --- /dev/null +++ b/bin/ignore @@ -0,0 +1,24 @@ +# non-ksh script for the nmake ignore prefix +# @(#)ignore (AT&T Research) 1992-08-11 + +case $-:$BASH_VERSION in +*x*:[0123456789]*) : bash set -x is broken :; set +ex ;; +esac + +while : +do case $# in + 0) exit 0 ;; + esac + case $1 in + *=*) case $RANDOM in + $RANDOM)`echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; + *) export "$1" ;; + esac + shift + ;; + *) break + ;; + esac +done +"$@" +exit 0 diff --git a/bin/mamprobe b/bin/mamprobe new file mode 100755 index 0000000..033c4d2 --- /dev/null +++ b/bin/mamprobe @@ -0,0 +1,248 @@ +### this script contains archaic constructs that work with all sh variants ### +# mamprobe - generate MAM cc probe info +# Glenn Fowler + +case $-:$BASH_VERSION in +*x*:[0123456789]*) : bash set -x is broken :; set +ex ;; +esac + +command=mamprobe + +# check the options + +opt= + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: mamprobe (AT&T Labs Research) 2011-02-11 $ +] +[+NAME?mamprobe - generate MAM cc probe info] +[+DESCRIPTION?\bmamprobe\b generates MAM (make abstract machine) \bcc\b(1) + probe information for use by \bmamake\b(1). \acc-path\a is the + absolute path of the probed compiler and \ainfo-file\a is where + the information is placed. \ainfo-file\a is usually + \b$INSTALLROOT/lib/probe/C/mam/\b\ahash\a, where \ahash\a is a hash + of \acc-path\a. Any \ainfo-file\a directories are created if needed. + If \ainfo-file\a is \b-\b then the probe information is written to + the standard output.] +[+?\bmamprobe\b and \bmamake\b are used in the bootstrap phase of + \bpackage\b(1) installation before \bnmake\b(1) is built. The + probed variable names are the \bnmake\b(1) names with a \bmam_\b + prefix, \bCC\b converted to \bcc\b, and \b.\b converted to \b_\b. + Additional variables are:]{ + [+_hosttype_?the \bpackage\b(1) host type] + [+mam_cc_L?\b-L\b\adir\a supported] + [+STDCAT?command to execute for \bcat\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCHMOD?command to execute for \bchmod\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCMP?command to execute for \bcmp\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCP?command to execute for \bcp\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDED?command to execute for \bed\b(1) or \bex\b(1)] + [+STDEDFLAGS?flags for \bSTDED\b] + [+STDLN?command to execute for \bln\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDMV?command to execute for \bmv\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDRM?command to execute for \brm\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] +} +[d:debug?Enable probe script debug trace.] + +info-file cc-path + +[+SEE ALSO?\bexecrate\b(1), \bpackage\b(1), \bmamake\b(1), \bnmake\b(1), + \bprobe\b(1)] +' + while getopts -a "$command" "$USAGE" OPT + do case $OPT in + d) opt=-d ;; + esac + done + shift `expr $OPTIND - 1` + ;; +*) while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + -) break + ;; + -d) opt=-d + ;; + -*) echo $command: $1: unknown option >&2 + ;; + *) break + ;; + esac + set '' + break + done + ;; +esac + +# check the args + +case $1 in +-) ;; +/*) ;; +*) set '' ;; +esac +case $2 in +/*) ;; +*) set '' ;; +esac +case $# in +0|1) echo "Usage: $command info-file cc-path" >&2; exit 2 ;; +esac +info=$1 +shift +cc=$* + +# find the make probe script + +ifs=${IFS-' + '} +IFS=: +set $PATH +IFS=$ifs +script=lib/probe/C/make/probe +while : +do case $# in + 0) echo "$0: ../$script: probe script not found on PATH" >&2 + exit 1 + ;; + esac + case $1 in + '') continue ;; + esac + makeprobe=`echo $1 | sed 's,[^/]*$,'$script,` + if test -x $makeprobe + then break + fi + shift +done + +# create the info dir if necessary + +case $info in +/*) i=X$info + ifs=${IFS-' + '} + IFS=/ + set $i + IFS=$ifs + while : + do i=$1 + shift + case $i in + X) break ;; + esac + done + case $info in + //*) path=/ ;; + *) path= ;; + esac + while : + do case $# in + 0|1) break ;; + esac + comp=$1 + shift + case $comp in + '') continue ;; + esac + path=$path/$comp + if test ! -d $path + then mkdir $path || exit + fi + done + ;; +esac + +# generate info in a tmp file and rename when finished + +case $info in +-) ;; +*) tmp=/tmp/mam$$ + trap "exec >/dev/null; rm -f $tmp" 0 1 2 3 15 + exec > $tmp + echo "probing C language processor $cc for mam information" >&2 + ;; +esac + +echo "note generated by $0 for $cc" + +( + set '' $opt $cc + shift + . $makeprobe "$@" + + case " $CC_DIALECT " in + *" -L "*) echo "CC.L = 1" ;; + esac + +) | sed \ + -e '/^CC\./!d' \ + -e 's/^CC./setv mam_cc_/' \ + -e 's/^\([^=.]*\)\./\1_/' \ + -e 's/^\([^=.]*\)\./\1_/' \ + -e 's/ =//' \ + -e 's/\$("\([^"]*\)")/\1/g' \ + -e 's/\$(\([^)]*\))/${\1}/g' \ + -e 's/\${CC\./${mam_cc_}/g' + +echo 'setv _hosttype_ ${mam_cc_HOSTTYPE}' + +# STD* are standard commands/flags with possible execrate(1) + +if ( +ed < /dev/null 2>&1 +then STDED=ed +else STDED=ex +fi +STDEDFLAGS=- +set STDCAT cat STDCHMOD chmod STDCMP cmp STDCP cp STDLN ln STDMV mv STDRM rm +while : +do case $# in + 0|1) break ;; + esac + p=$2 + for d in /bin /usr/bin /usr/sbin + do if test -x $d/$p + then p=$d/$p + break + fi + done + eval $1=\$p + shift + shift +done +if execrate +then for n in STDCAT STDCHMOD STDCMP STDCP STDLN STDMV STDRM + do eval $n=\"execrate \$$n\" + done +fi +for n in STDCAT STDCHMOD STDCMP STDCP STDED STDEDFLAGS STDLN STDMV STDRM +do eval echo setv \$n \$$n +done + +# all done + +case $info in +-) ;; +*) exec >/dev/null + test -f $info && rm -f $info + cp $tmp $info + chmod -w $info + ;; +esac diff --git a/bin/package b/bin/package new file mode 100755 index 0000000..f7f4c86 --- /dev/null +++ b/bin/package @@ -0,0 +1,7284 @@ +USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +### this script contains archaic constructs that work with all sh variants ### +# package - source and binary package control +# Glenn Fowler + +command=package + +case $-:$BASH_VERSION in +*x*:[0123456789]*) : bash set -x is broken :; set +ex ;; +esac + +# ksh checks -- ksh between 2007-11-05 and 2011-11-11 conflict with new -lcmd -- wea culpa +checksh() +{ + egrep 'Version.*(88|1993)' $1 >/dev/null 2>&1 || + $1 -c '(( .sh.version >= 20111111 ))' >/dev/null 2>&1 +} + +case $_AST_BIN_PACKAGE_:$SHELL:$0 in +1:*|*:/bin/sh:*) + ;; +*:*/*:*/*) + _AST_BIN_PACKAGE_=1 # prevent non-interactive sh .rc referencing bin/package recursion # + export _AST_BIN_PACKAGE_ + if checksh $SHELL + then : no -lcmd conflict : + else case " $* " in + *" debug "*|*" DEBUG "*|*" show "*) + echo $command: $SHELL: warning: possible -lcmd conflict -- falling back to /bin/sh >&2 + ;; + esac + SHELL=/bin/sh + export SHELL + exec $SHELL "$0" "$@" + fi + ;; +esac + +LC_ALL=C +export LC_ALL + +src="cmd contrib etc lib" +use="/usr/common /exp /usr/local /usr/add-on /usr/addon /usr/tools /usr /opt" +usr="/home" +lib="" # nee /usr/local/lib /usr/local/shlib +ccs="/usr/kvm /usr/ccs/bin" +org="gnu GNU" +makefiles="Mamfile Nmakefile nmakefile Makefile makefile" +env="HOSTTYPE NPROC PACKAGEROOT INSTALLROOT PATH" +checksum=md5sum +checksum_commands="$checksum md5" +checksum_empty="d41d8cd98f00b204e9800998ecf8427e" + +package_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC=' + +PACKAGE_admin_tail_timeout=${PACKAGE_admin_tail_timeout:-"1m"} + +CROSS=0 + +admin_db=admin.db +admin_env=admin.env +admin_ditto="ditto --checksum --delete --verbose" +admin_ditto_update=--update +admin_ditto_skip="OFFICIAL|core|old|*.core|*.tmp|.nfs*" +admin_list='PACKAGE.$type.lst' +admin_ping="ping -c 1 -w 5" + +default_url=default.url +MAKESKIP=${MAKESKIP:-"*[-.]*"} +RATZ=ratz +SED= +TAR=tar +TARFLAGS=xv +TARPROBE=B +TR= + +all_types='*.*|sun4' # all but sun4 match *.* + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: package (AT&T Research) 2012-02-29 $ +]'$USAGE_LICENSE$' +[+NAME?package - source and binary package control] +[+DESCRIPTION?The \bpackage\b command controls source and binary + packages. It is a \bsh\b(1) script coded for maximal portability. All + package files are in the \b$PACKAGEROOT\b directory tree. + \b$PACKAGEROOT\b must at minumum contain a \bbin/package\b command or a + \blib/package\b directory. Binary package files are in the + \b$INSTALLROOT\b (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where + \ahosttpe\a=`\bpackage\b`. All \aactions\a but \bhost\b and \buse\b + require the current directory to be under \b$PACKAGEROOT\b. See + \bDETAILS\b for more information.] +[+?Note that no environment variables need be set by the user; + \bpackage\b determines the environment based on the current working + directory. The \buse\b action starts a \bsh\b(1) with the environment + initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set + by explicit command argument assignments to override the defaults.] +[+?Packages are composed of components. Each component is built and + installed by an \bast\b \bnmake\b(1) makefile. Each package is also + described by an \bnmake\b makefile that lists its components and + provides a content description. The package makefile and component + makefiles provide all the information required to read, write, build + and install packages.] +[+?Package recipients only need \bsh\b(1) and \bcc\b(1) to build and + install source packages, and \bsh\b to install binary packages. + \bnmake\b and \bksh93\b are required to write new packages. An + \b$INSTALLROOT/bin/cc\b script may be supplied for some architectures. + This script supplies a reasonable set of default options for compilers + that accept multiple dialects or generate multiple object/executable + formats.] +[+?The command arguments are composed of a sequence of words: zero or + more \aqualifiers\a, one \aaction\a, and zero or more action-specific + \aarguments\a, and zero or more \aname=value\a definitions. \apackage\a + names a particular package. The naming scheme is a \b-\b separated + hierarchy; the leftmost parts describe ownership, e.g., + \bgnu-fileutils\b, \bast-base\b. If no packages are specified then all + packages are operated on. \boptget\b(3) documentation options are also + supported. The default with no arguments is \bhost type\b.] +[+?The qualifiers are:] + { + [+authorize \aname\a?Remote authorization user name or license + acceptance phrase.] + [+debug|environment?Show environment and actions but do not + execute.] + [+flat?Collapse \b$INSTALLROOT\b { bin fun include lib } onto + \b$PACKAGEROOT\b.] + [+force?Force the action to override saved state.] + [+never?Run make -N and show other actions.] + [+only?Only operate on the specified packages.] + [+password \apassword\a?Remote authorization or license + acceptance password.] + [+quiet?Do not list captured action output.] + [+show?Run make -n and show other actions.] + [+verbose?Provide detailed action output.] + [+DEBUG?Trace the package script actions in detail.] + } +[+?The actions are:] + { + [+admin\b [\ball\b]] [\bdb\b \afile\a]] [\bon\b \apattern\a]][\aaction\a ...]]?Apply + \aaction\a ... to the hosts listed in \afile\a. If \afile\a is + omitted then \badmin.db\b is assumed. The caller must have + \brcp\b(1) and \brsh\b(1) or \bscp\b(1) and \bssh\b(1) access + to the hosts. Output for \aaction\a is saved per-host in the + file \aaction\a\b.log/\b\ahost\a. Logs can be viewed by + \bpackage admin\b [\bon\b \ahost\a]] \bresults\b [\aaction\a]]. + By default only local PACKAGEROOT hosts are selected from + \afile\a; \ball\b selects all hosts. \bon\b \apattern\a selects + only hosts matching the \b|\b separated \apattern\a. \afile\a + contains four types of lines. Blank lines and lines beginning + with \b#\b are ignored. Lines starting with \aid\a=\avalue\a + are variable assignments. Set admin_ping to local conventions + if \"'$admin_ping$'\" fails. If a package list is not specified + on the command line the \aaction\a applies to all packages; a + variable assigment \bpackage\b=\"\alist\a\" applies \aaction\a + to the packages in \alist\a for subsequent hosts in \afile\a. + The remaining line type is a host description consisting of 6 + tab separated fields. The first 3 are mandatory; the remaining + 3 are updated by the \badmin\b action. \afile\a is saved in + \afile\a\b.old\b before update. The fields are:] + { + [+hosttype?The host type as reported by + \"\bpackage\b\".] + [+[user@]]host?The host name and optionally user name + for \brcp\b(1) and \brsh\b(1) access.] + [+[remote::[[master]]::]]]]PACKAGEROOT?The absolute remote package + root directory and optionally the remote protocol (rsh + or ssh) if the directory is on a different server than + the master package root directory. If + \blib/package/admin/'$admin_env$'\b exists under this + directory then it is sourced by \bsh\b(1) before + \aaction\a is done. If this field begins with \b-\b + then the host is ignored. If this field contains \b:\b + then \bditto\b(1) is used to sync the remote \bsrc\b + directory hierarchy to the local one. If [\amaster\a]]: + is specified then the sync is deferred to the \amaster\a + host. If \amaster\a is omitted (two :) then the sync is + disabled. These directories must exist on the remote side: + \blib/package\b, \bsrc/cmd\b, \bsrc/lib\b.] + [+date?\aYYMMDD\a of the last action.] + [+time?Elapsed wall time for the last action.] + [+M T W?The \badmin\b action \bmake\b, \btest\b and + \bwrite\b action error counts. A non-numeric value in + any of these fields disables the corresponding action.] + } + [+clean | clobber?Delete the \barch/\b\aHOSTTYPE\a hierarchy; this + deletes all generated files and directories for \aHOSTTYPE\a. + The heirarchy can be rebuilt by \bpackage make\b.] + [+contents\b [ \apackage\a ... ]]?List description and + components for \apackage\a on the standard output.] + [+copyright\b [ \apackage\a ... ]]?List the general copyright + notice(s) for \apackage\a on the standard output. Note that + individual components in \apackage\a may contain additional or + replacement notices.] + [+export\b [ \avariable\a ...]]?List \aname\a=\avalue\a for + \avariable\a, one per line. If the \bonly\b attribute is + specified then only the variable values are listed. If no + variables are specified then \b'$env$'\b are assumed.] + [+help\b [ \aaction\a ]]?Display help text on the standard + error (standard output for \aaction\a).] + [+host\b [ \aattribute\a ... ]]?List + architecture/implementation dependent host information on the + standard output. \btype\b is listed if no attributes are + specified. Information is listed on a single line in + \aattribute\a order. The attributes are:] + { + [+canon \aname\a?An external host type name to be + converted to \bpackage\b syntax.] + [+cpu?The number of cpus; 1 if the host is not a + multiprocessor.] + [+name?The host name.] + [+rating?The cpu rating in pseudo mips; the value is + useful useful only in comparisons with rating values of + other hosts. Other than a vax rating (mercifully) fixed + at 1, ratings can vary wildly but consistently from + vendor mips ratings. \bcc\b(1) may be required to + determine the rating.] + [+type?The host type, usually in the form + \avendor\a.\aarchitecture\a, with an optional trailing + -\aversion\a. The main theme is that type names within + a family of architectures are named in a similar, + predictable style. OS point release information is + avoided as much as possible, but vendor resistance to + release incompatibilities has for the most part been + futile.] + } + [+html\b [ \aaction\a ]]?Display html help text on the standard + error (standard output for \aaction\a).] + [+install\b [ \aarchitecture\a ... ]] \adirectory\a [ \apackage\a ... ]]?Copy + the package binary hierarchy to \adirectory\a. If + \aarchitecture\a is omitted then all architectures are + installed. If \bflat\b is specified then exactly one + \aarchitecture\a must be specified; this architecture will be + installed in \adirectory\a without the \barch/\b\aHOSTTYPE\a + directory prefixes. Otherwise each architecture will be + installed in a separate \barch/\b\aHOSTTYPE\a subdirectory of + \adirectory\a. The \aarchitecture\a \b-\b names the current + architecture. \adirectory\a must be an existing directory. If + \apackage\a is omitted then all binary packages are installed. + This action requires \bnmake\b.] + [+license\b [ \apackage\a ... ]]?List the source license(s) for + \apackage\a on the standard output. Note that individual + components in \apackage\a may contain additional or replacement + licenses.] + [+list\b [ \apackage\a ... ]]?List the name, version and + prerequisites for \apackage\a on the standard output.] + [+make\b [ \apackage\a ]] [ \aoption\a ... ]] [ \atarget\a ... ]]?Build + and install. The default \atarget\a is \binstall\b, which makes + and installs \apackage\a. If the standard output is a terminal + then the output is also captured in + \b$INSTALLROOT/lib/package/gen/make.out\b. The build is done in + the \b$INSTALLROOT\b directory tree viewpathed on top of the + \b$PACKAGEROOT\b directory tree. If \bflat\b is specified then + the \b$INSTALLROOT\b { bin fun include lib } directories are + linked to the same directories in the package root. Only one + architecture may be \bflat\b. Leaf directory names matching the + \b|\b-separated shell pattern \b$MAKESKIP\b are ignored. The + \bview\b action is done before making. \aoption\a operands are + passed to the underlying make command.] + [+read\b [ \apackage\a ... | \aarchive\a ... ]]?Read the named + package or archive(s). Must be run from the package root + directory. Archives are searched for in \b.\b and + \blib/package/tgz\b. Each package archive is read only once. + The file \blib/package/tgz/\b\apackage\a[.\atype\a]]\b.tim\b + tracks the read time. See the \bwrite\b action for archive + naming conventions. Text file archive member are assumed to be + ASCII or UTF-8 encoded.] + [+regress?\bdiff\b(1) the current and previous \bpackage test\b + results.] + [+release\b [ [\aCC\a]]\aYY-MM-DD\a [ [\acc\a]]\ayy-mm-dd\a ]]]] [ \apackage\a ]]?Display + recent changes for the date range [\aCC\a]]\aYY-MM-DD\a (up to + [\acc\a]]\ayy-mm-dd\a.), where \b-\b means lowest (or highest.) + If no dates are specified then changes for the last 4 months + are listed. \apackage\a may be a package or component name.] + [+remove\b [ \apackage\a ]]?Remove files installed for + \apackage\a.] + [+results\b [ \bfailed\b ]] [ \bpath\b ]] [ \bold\b ]] [\bmake\b | \btest\b | \bwrite\b ]]?List + results and interesting messages captured by the most recent + \bmake\b (default), \btest\b or \bwrite\b action. \bold\b + specifies the previous results, if any (current and previous + results are retained.) \b$HOME/.pkgresults\b, if it exists, + must contain an \begrep\b(1) expression of result lines to be + ignored. \bfailed\b lists failures only and \bpath\b lists the + results file path name only.] + [+setup\b [ beta ]] [ binary ]] [ source ]] [ \aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?This + action initializes the current directory as a package root, runs the + \bupdate\b action to download new or out of date packages, and runs the + \bread\b action on those packages. If \bflat\b is specified then the + \b$INSTALLROOT\b { bin fun include lib } directories are linked to the + same directories in the package root. Only one architecture may be + \bflat\b. See the \bupdate\b and \bread\b action descriptions for + argument details.] + [+test\b [ \apackage\a ]]?Run the regression tests for + \apackage\a. If the standard output is a terminal then the + output is also captured in + \b$INSTALLROOT/lib/package/gen/test.out\b. In general a package + must be made before it can be tested. Components tested with + the \bregress\b(1) command require \bksh93\b. If \bonly\b is + also specified then only the listed package components are + tested, otherwise the closure of the components is tested.] + [+update\b [ beta ]] [ binary ]] [ source ]] [\aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?Download + the latest release of the selected and required packages from \aurl\a + (e.g., \bhttp://www.research.att.com/sw/download\b) into the directory + \b$PACKAGEROOT/lib/package/tgz\b. \bbeta\b acesses beta packages; + download these at your own risk. If \aarchitecture\a is omitted then + only architectures already present in the \btgz\b directory will be + downloaded. If \aarchitecture\a is \b-\b then all posted architectures + will be downloaded. If \aurl\a matches \b*.url\b then it is interpreted + as a file containing shell variable assignments for \burl\b, + \bauthorize\b and \bpassword\b. If \aurl\a is omitted then the + definitions for \burl\b, \bauthorize\b and \bpassword\b in + \b$PACKAGEROOT/lib/package/tgz/default.url\b, if it exists, are used. + If \b$PACKAGEROOT/lib/package/tgz/default.url\b does not exist then it + is initialized with the current \burl\b, \bauthorize\b and \bpassword\b + values and read permission for the current user only. If \apackage\a is + omitted then only packages already present in the tgz directory will be + downloaded. If \apackage\a is \b-\b then all posted packages will be + downloaded. If \bsource\b and \bbinary\b are omitted then both source + and binary packages will be downloaded. If \bonly\b is specified then + only the named packages are updated; otherwise the closure of required + packages is updated. This action requires \bwget\b(1), \blynx\b(1), + \bcurl\b(1) or a shell that supports io to + \b/dev/tcp/\b\ahost\a/\aport\a.] + [+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run + \acommand\a, or an interactive shell if \acommand\a is omitted, + with the environment initialized for using the package (can you + say \ashared\a \alibrary\a or \adll\a without cussing?) If + \auid\a or \apackage\a or \a.\a is specified then it is used + to determine a \b$PACKAGEROOT\b, possibly different from + the current directory. For example, to try out bozo`s package: + \bpackage use bozo\b. The \buse\b action may be run from any + directory. If the file \b$INSTALLROOT/lib/package/profile\b is + readable then it is sourced to initialize the environment. 32 or 64 + implies \b$PACKAGEROOT\b of . and specifies the target architecture + word size (which may be silently ignored.)] + [+verify\b [ \apackage\a ]]?Verify installed binary files + against the checksum files in + \b$INSTALLROOT/lib/\b\apackage\a\b/gen/*.sum\b. The checksum + files contain mode, user and group information. If the checksum + matches for a given file then the mode, user and group are + changed as necessary to match the checksum entry. A warning is + printed on the standard error for each mismatch. Requires the + \bast\b package \bcksum\b(1) command.] + [+view\b?Initialize the architecture specific viewpath + hierarchy. If \bflat\b is specified then the \b$INSTALLROOT\b { + bin fun include lib } directories are linked to the same + directories in the package root. Only one architecture may be + \bflat\b. The \bmake\b action implicitly calls this action.] + [+write\b [\aformat\a]] \atype\a ... [ \apackage\a ...]]?Write + a package archive for \apackage\a. All work is done in the + \b$PACKAGEROOT/lib/package\b directory. \aformat\a-specific + files are placed in the \aformat\a subdirectory. A + \apackage\a[.\atype\a]]\b.tim\b file in this directory tracks + the write time and prevents a package from being read in the + same root it was written. If more than one file is generated + for a particular \aformat\a then those files are placed in the + \aformat\a/\apackage\a subdirectory. File names in the + \aformat\a subdirectory will contain the package name, a + \ayyyy-mm-dd\a date, and for binary packages, \aHOSTTYPE\a. If + \apackage\a is omitted then an ordered list of previously + written packages is generated. If \bonly\b is specified then + only the named packages will be written; otherwise prerequisite + packages are written first. Package components must be listed + in \apackage\a\b.pkg\b. \aformat\a may be one of:] + { + [+cyg?Generate a \bcygwin\b package.] + [+exp?Generate an \bexptools\b maintainer source + archive and \aNPD\a file, suitable for \bexpmake\b(1)] + [+lcl?Generate a package archive suitable for + restoration into the local source tree (i.e., the + source is not annotated for licencing.)] + [+pkg?Generate a \bpkgmk\b(1) package suitable for + \bpkgadd\b(1).] + [+rpm?Generate an \brpm\b(1) package.] + [+tgz?Generate a \bgzip\b(1) \btar\b(1) package + archive. This is the default.] + [+tst?Generate a \btgz\b format package archive in the + \btst\b subdirectory. Version state files are not updated.] + } + [+?\btype\b specifies the package type which must be one of + \bsource\b, \bbinary\b or \bruntime\b. A source package + contains the source needed to build the corresponding binary + package. A binary package includes the libraries and headers + needed for compiling and linking against the public interfaces. + A runtime package contains the commands and required dynamic + libraries.] + [+?A package may be either a \bbase\b or \bdelta\b. A base + package contains a complete copy of all components. A delta + package contains only changes from a previous base package. + Delta recipients must have the \bast\b \bpax\b(1) command (in + the \bast-base\b package.) If neither \bbase\b nor \bdelta\b is + specified, then the current base is overwritten if there are no + deltas referring to the current base. Only the \btgz\b and + \blcl\b formats support \bdelta\b. If \bbase\b is specified + then a new base and two delta archives are generated: one delta + to generate the new base from the old, and one delta to + generate the old base from the new; the old base is then + removed. If \bdelta\b is specified then a new delta referring + to the current base is written.] + [+?\apackage\a\b.pkg\b may reference other packages. By default + a pointer to those packages is written. The recipient \bpackage + read\b will then check that all required packages have been + downloaded. If \bclosure\b is specified then the components for + all package references are included in the generated package. + This may be useful for \blcl\b and versioning.] + [+?All formats but \blcl\b annotate each \bsource\b file (not + already annotated) with a license comment as it is written to + the package archive using \bproto\b(1).] + } +[+DETAILS?The package directory hierarchy is rooted at + \b$PACKAGEROOT\b. All source and binaries reside under this tree. A two + level viewpath is used to separate source and binaries. The top view is + architecture specific, the bottom view is shared source. All building + is done in the architecture specific view; no source view files are + intentionally changed. This means that many different binary + architectures can be made from a single copy of the source.] +[+?Independent \b$PACKAGEROOT\b hierarchies can be combined by + appending \b$INSTALLROOT:$PACKAGEROOT\b pairs to \bVPATH\b. The + \bVPATH\b viewing order is from left to right. Each \b$PACKAGEROOT\b + must have a \b$PACKAGEROOT/lib/package\b directory.] +[+?Each package contains one or more components. Component source for + the \afoo\a command is in \b$PACKAGEROOT/src/cmd/\b\afoo\a, and source + for the \abar\a library is in \b$PACKAGEROOT/src/lib/lib\b\abar\a. This + naming is for convenience only; the underlying makefiles handle + inter-component build order. The \bINIT\b component, which contains + generic package support files, is always made first, then the + components named \bINIT\b*, then the component order determined by the + closure of component makefile dependencies.] +[+?\b$PACKAGEROOT/lib/package\b contains package specific files. The + package naming convention is \agroup\a[-\apart\a]]; e.g., \bast-base\b, + \bgnu-fileutils\b. The *\b.pkg\b files are ast \bnmake\b(1) makefiles + that contain the package name, package components, references to other + packages, and a short package description. *\b.pkg\b files are used by + \bpackage write\b to generate new source and binary packages.] +[+?\b$PACKAGEROOT/lib/package/\b\agroup\a\b.lic\b files contain license + information that is used by the \bast\b \bproto\b(1) and \bnmake\b(1) + commands to generate source and binary license strings. \agroup\a is + determined by the first \b:PACKAGE:\b operator name listed in the + component \bnmake\b makefile. \agroup\a\b.lic\b files are part of the + licensing documentation. Each component may have its own \bLICENSE\b file + that overrides the \agroup\a\b.lic\b file. The full text of the licenses + are in the \b$PACKAGEROOT/lib/package/LICENSES\b and + \b$INSTALLROOT/lib/package/LICENSES\b directories.] +[+?A few files are generated in \b$PACKAGEROOT/lib/package/gen\b and + \b$INSTALLROOT/lib/package/gen\b. \apackage\a\b.ver\b contains one line + consisting of \apackage version release\a \b1\b for the most recent + instance of \apackage\a read into \b$PACKAGEROOT\b, where \apackage\a + is the package name, \aversion\a is the \aYYYY-MM-DD\a base version, + and \arelease\a is \aversion\a for the base release or \aYYYY-MM-DD\a + for delta releases. \apackage\a\b.req\b contains *\b.ver\b entries for + the packages required by \apackage\a, except that the fourth field is + \b0\b instead of \b1\b. All packages except \bINIT\b require the + \bINIT\b package. A simple sort of \apackage\a\b.pkg\b and *\b.ver\b + determines if the required package have been read in. Finally, + \apackage\a\b.README\b and \apackage\a\a.html\b contain the README text + for \apackage\a and all its components. Included are all changes added + to the component \bRELEASE\b, \bCHANGES\b or \bChangeLog\b files dated + since the two most recent base releases. Component \bRELEASE\b files + contain tag lines of the form [\aYY\a]]\aYY-MM-DD\a [ \atext\a ]] (or + \bdate\b(1) format dates) followed by README text, in reverse + chronological order (newer entries at the top of the file.) \bpackage + release\b lists this information, and \bpackage contents ...\b lists + the descriptions and components.] +[+?\b$HOSTYPE\b names the current binary architecture and is determined + by the output of \bpackage\b (no arguments.) The \b$HOSTTYPE\b naming + scheme is used to separate incompatible executable and object formats. + All architecture specific binaries are placed under \b$INSTALLROOT\b + (\b$PACKAGEROOT/arch/$HOSTTYPE\b.) There are a few places that match + against \b$HOSTTYPE\b when making binaries; these are limited to + makefile compiler workarounds, e.g., if \b$HOSTTYPE\b matches \bhp.*\b + then turn off the optimizer for these objects. All other architecture + dependent logic is handled either by the \bast\b \biffe\b(1) command or + by component specific configure scripts. Explicit \b$HOSTYPE\b + values matching *,*cc*[,-*,...]] optionally set the default \bCC\b and + \bCCFLAGS\b. This is handy for build farms that support different + compilers on the same architecture.] +[+?Each component contains an \bast\b \bnmake\b(1) makefile (either + \bNmakefile\b or \bMakefile\b) and a \bMAM\b (make abstract machine) + file (\bMamfile\b.) A Mamfile contains a portable makefile description + that is used by \bmamake\b(1) to simulate \bnmake\b. Currently there is + no support for old-make/gnu-make makefiles; if the binaries are just + being built then \bmamake\b will suffice; if source or makefile + modifications are anticipated then \bnmake\b (in the \bast-base\b + package) should be used. Mamfiles are automatically generated by + \bpackage write\b.] +[+?Most component C source is prototyped. If \b$CC\b (default value + \bcc\b) is not a prototyping C compiler then \bpackage make\b runs + \bproto\b(1) on portions of the \b$PACKAGEROOT/src\b tree and places + the converted output files in the \b$PACKAGEROOT/proto/src\b tree. + Converted files are then viewpathed over the original source. + \bproto\b(1) converts an ANSI C subset to code that is compatible with + K&R, ANSI, and C++ dialects.] +[+?All scripts and commands under \b$PACKAGEROOT\b use \b$PATH\b + relative pathnames (via the \bast\b \bpathpath\b(3) function); there + are no imbedded absolute pathnames. This means that binaries generated + under \b$PACKAGEROOT\b may be copied to a different root; users need + only change their \b$PATH\b variable to reference the new installation + root \bbin\b directory. \bpackage install\b installs binary packages in + a new \b$INSTALLROOT\b.] + +[ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] + +[+SEE ALSO?\bautoconfig\b(1), \bcksum\b(1), \bexecrate\b(1), \bexpmake\b(1), + \bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bnmake\b(1), \bpax\b(1), + \bpkgadd\b(1), \bpkgmk\b(1), \bproto\b(1), \bratz\b(1), \brpm\b(1), + \bsh\b(1), \btar\b(1), \boptget\b(3)] +' + case $* in + help) set -- --man ;; + esac + while getopts -a $command "$USAGE" OPT + do : + done + shift $OPTIND-1 + ;; +esac + +# check the args + +case $AR in +'') AR=ar ;; +esac +case $CC in +'') CC=cc ;; +esac +case $LD in +'') LD=ld ;; +esac +case $NM in +'') NM=nm ;; +esac + +action= +admin_all=1 +admin_on= +authorize= +bit= +exec= +flat=0 +force=0 +global= +hi= +html=0 +ifs=${IFS-' + '} +lo= +make= +makeflags='-k -K' +nmakeflags= +nmakesep= +nl=" +" +noexec= +only=0 +output= +package_src= +password= +quiet=0 +show=: +tab=" " +verbose=0 +AUTHORIZE= +DEBUG= +HURL= +PROTOROOT=- +SHELLMAGIC=- + +unset FIGNORE BINDIR DLLDIR ETCDIR FUNDIR INCLUDEDIR LIBDIR LOCALEDIR MANDIR SHAREDIR 2>/dev/null || true + +while : +do case $# in + 0) set host type ;; + esac + case $1 in + admin|clean|clobber|contents|copyright|export|host|install|license|list|make|read|regress|release|remove|results|setup|test|update|use|verify|view|write|TEST) + action=$1 + shift + break + ;; + authorize) + case $# in + 1) echo $command: $1: authorization user name argument expected >&2; exit 1 ;; + esac + shift + authorize=$1 + shift + continue + ;; + debug|environment) + exec=echo make=echo show=echo + ;; + flat) flat=1 + ;; + force) force=1 + ;; + never) exec=echo noexec=-N + ;; + only) only=1 + ;; + password) + case $# in + 1) echo $command: $1: authorization password argument expected >&2; exit 1 ;; + esac + shift + password=$1 + shift + continue + ;; + quiet) quiet=1 + ;; + show) exec=echo noexec=-n + ;; + verbose)verbose=1 + ;; + DEBUG) DEBUG=1 + PS4='+$LINENO:$SECONDS+ ' + set -x + ;; + help|HELP|html|man|--[?m]*) + case $1 in + help) code=0 + case $2 in + '') exec 1>&2 ;; + esac + ;; + html) code=0 html=1 + ;; + *) code=2 + exec 1>&2 + ;; + esac + case $html in + 1) bO=" + +$2 package installation instructions + +" + eO=' +' + bH="

" + eH='

' + bP='

' + bL='

' + bL2='

' + eL='

' + bT='' + bD='' eD='' + bB='' eB='' + bI='' eI='' + bX='

'			eX='
' + bF='' eF='' + Camp='&' + Mcurl='curl(1)' + Mdate='date(1)' + Mfile='file(1)' + Mgunzip='gunzip(1)' + Mhurl='hurl(1)' + Mlynx='lynx(1)' + Mnmake='nmake(1)' + Mpackage='package(1)' + Mproto='proto(1)' + Mratz='ratz' + Mtar='tar(1)' + Mwget='wget(1)' + ;; + *) bO='' eO='' + bH='' eH=':' + bP='' + bL='' eL='' + bL2='' + bT=' ' + bD=' ' eD='' + bB='' eB='' + bI='' eI='' + bX='' eX='' + bF='"' eF='"' + Camp='&' + Mcurl='curl(1)' + Mdate='date(1)' + Mfile='file(1)' + Mgunzip='gunzip(1)' + Mhurl='hurl(1)' + Mlynx='lynx(1)' + Mnmake='nmake(1)' + Mpackage='package(1)' + Mproto='proto(1)' + Mratz='ratz' + Mtar='tar(1)' + Mwget='wget(1)' + ;; + esac + case $2 in + binary) echo "${bO} +${bH}Binary Package Installation Instructions${eH} +${bL} +${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may + have setuid executables, few must be owned by ${bI}root${eI}. These are best + changed manually when the security implications are understood.${eD} +${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work + area for all packages.${eD} +${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the + download site. If you already clicked, or if your system does not have + ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions + for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} + script which works with ksh and modern bash. The top level URL is:${bX} + URL=http://www.research.att.com/sw/download${eX}${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} + test -d bin || mkdir bin + url=\$URL/package + (wget -O bin/package \$url||curl -L \$url||hurl \$url) > bin/package + chmod +x bin/package${eX}${eD} +${bT}(5)${bD}Determine the list of package names you want from the download site, then + use the ${Mpackage} command to do the actual download:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + setup binary \$URL ${bI}PACKAGE${eI} ...${eX} + (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for + ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest + binary package(s); covered and up-to-date packages are not downloaded again unless + ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. + If the package root will contain only one architecture then you can install in ${bB}bin${eB} and + ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this + instead:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + flat setup binary \$URL ${bB}PACKAGE${eB} ...${eX} + To update the same packages from the same URL run:${bX} + bin/package setup binary${eX}${eD} +${bT}(6)${bD}The packaged binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + ${Mfile} and ${Mnmake}, require the path of the bin directory to be + exported in ${bB}PATH${eb}.${eD} +${bT}(7)${bD}You can run the binaries directly from the package root, or you can + install them in a public root (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} + bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} + This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to + preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the + ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a + flat install:${bX} + cd \$INSTALLROOT + cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} +${bT}(8)${bD}To summarize, after the first time, the download cycle for the latest + binary release is:${bX} + bin/package setup binary${eX}${eD}${eL} + +${bH}Binary Package Installation Instructions -- Plan B${eH} +${bL} +${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives + into that directory.${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} + binary package:${bX} + gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz | + ${TAR} ${TARFLAGS}f -${eX} + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz + If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} + binary package:${bX} + mkdir bin + cp lib/package/tgz/ratz.${bI}YYYY-MM-DD.HOSTTYPE${eI}.exe bin/ratz + chmod +x bin/ratz + bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD/HOSTTYPE${eI}.tgz +${bT}(5)${bD}Read all unread package archive(s):${bX} + bin/package read${eX} + Both source and binary packages will be read by this step.${eD}${eL}${eO}" + ;; + intro) echo "${bO} +${bH}Package Hierarchy Details${eH} +${bP} +The package directory hierarchy is rooted at ${bB}\$PACKAGEROOT${eB}. All source and +binaries reside under this tree. A two level viewpath is used to separate +source and binaries. The top view is architecture specific, the bottom view +is shared source. All building is done in the architecture specific view; +no source view files are intentionally changed. This means that many +different binary architectures can be made from a single copy of the source. +${bP} +Each package contains one or more components. Component source for the ${bI}FOO${eI} +command is in ${bB}\$PACKAGEROOT/src/cmd/${eB}${bI}FOO${eI}, and source for the ${bI}BAR${eI} library is +in ${bB}\$PACKAGEROOT/src/lib/lib${eB}${bI}BAR${eI}. This naming is for convenience only; the +underlying makefiles handle inter-component build order. The ${bB}INIT${eB} component, +which contains generic package support files, is always made first, then the +components named ${bB}INIT${eB}*, then the order determined by the closure of component +makefile dependencies. +${bP} +${bB}\$PACKAGEROOT/lib/package${eB} contains package specific files. The package naming +convention is ${bI}GROUP${eI}[${bI}-PART${eI}]; e.g., ${bB}ast-base${eB}, ${bB}gnu-fileutils${eB}. The *${bB}.pkg${eB} files +are ${bB}ast${eB} ${Mnmake} makefiles that contain the package name, package components, +references to other packages, and a short package description. *${bB}.pkg${eB} files +are used by ${bF}package write${eF} to generate new source and binary packages. +${bP} +${bB}\$PACKAGEROOT/lib/package/${eB}${bI}GROUP${eI}${bB}.lic${eB} files contain license information that +is used by the ${bB}ast${eB} ${Mproto} and ${Mnmake} commands to generate source and +binary license strings. ${bI}GROUP${eI} is determined by the first ${bB}:PACKAGE:${eB} operator +name listed in the component ${bB}nmake${eB} makefile. ${bI}GROUP${eI}${bB}.lic${eB} files are part of the +licensing documentation. Each component may have its own ${bB}LICENSE${eB} file that +overrides the ${bI}GROUP${eI}${bB}.lic${eB} file. The full text of the licenses are in the +${bB}\$PACKAGEROOT/lib/package/LICENSES${eB} and ${bB}\$INSTALLROOT/lib/package/LICENSES${eB} +directories. +${bP} +A few files are generated in ${bB}\$PACKAGEROOT/lib/package/gen${eB} and +${bB}\$INSTALLROOT/lib/package/gen${eB}. ${bI}PACKAGE${eI}${bB}.ver${eB} contains one line consisting of${bX} + ${bI}PACKAGE VERSION RELEASE${eI} 1${eX} +for the most recent instance of ${bI}PACKAGE${eI} read into ${bB}\$PACKAGEROOT${eB}, where +${bI}PACKAGE${eI} is the package name, ${bI}VERSION${eI} is the ${bI}YYYY-MM-DD${eI} base version, +and ${bI}RELEASE${eI} is ${bI}VERSION${eI} for the base release or ${bI}YYYY-MM-DD${eI} for delta releases. +${bI}PACKAGE${eI}${bB}.req${eB} contains *${bB}.ver${eB} entries for the packages required by +${bI}PACKAGE${eI}, except that the fourth field is 0 instead of 1. All packages +except ${bB}INIT${eB} and ${Mratz} require the ${bB}INIT${eB} package. A simple sort of ${bI}PACKAGE${eI}${bB}.pkg${eB} +and *${bB}.ver${eB} determines if the required package have been read in. Finally, +${bI}PACKAGE${eI}${bB}.README${eB} contains the ${bB}README${eB} text for ${bI}PACKAGE${eI} and all its +components. Included are all changes added to the component ${bB}RELEASE${eB}, +${bB}CHANGES${eB} or ${bB}ChangeLog${eB} files dated since the two most recent base +releases. Component ${bB}RELEASE${eB} files contain tag lines of the form +[${bI}CC${eI}]${bI}YY-MM-DD${eI} [ ${bI}TEXT${eI} ] (or ${Mdate} format dates) followed by README +text, in reverse chronological order (newer entries at the top of the +file.) ${bF}package release${eF} generates this information, and +${bF}package contents ...${eF} lists the descriptions and components. +${bP} +${bB}\$HOSTYPE${eB} names the current binary architecture and is determined by the +output of ${bF}package${eF} (no arguments.) The ${bB}\$HOSTTYPE${eB} naming scheme is used +to separate incompatible executable and object formats. All architecture +specific binaries are placed under ${bB}\$INSTALLROOT${eB} (${bB}\$PACKAGEROOT/arch/\$HOSTTYPE${eB}.) +There are a few places that match against ${bB}\$HOSTTYPE${eB} when making binaries; these +are limited to makefile compiler workarounds, e.g., if ${bB}\$HOSTTYPE${eB} matches +'hp.*' then turn off the optimizer for these objects. All other architecture +dependent logic is handled either by ${bB}\$INSTALLROOT/bin/iffe${eB} or by component +specific configure scripts. Explicit ${bB}\$HOSTYPE${eB} values matching *,*cc*[,-*,...] +optionally set the default ${bB}CC${eB} and ${bB}CCFLAGS${eB}. This is handy for build +farms that support different compilers on the same architecture. +${bP} +Each component contains an ${bB}ast${eB} ${Mnmake} makefile (either ${bB}Nmakefile${eB} or ${bB}Makefile${eB}) +and a ${bI}MAM${eI} (make abstract machine) file (${bB}Mamfile${eB}.) A Mamfile contains a portable +makefile description that is used by ${bB}\$INSTALLROOT/bin/mamake${eB} to simulate +${bB}nmake${eB}. Currently there is no support for old-make/gnu-make makefiles; if +the binaries are just being built then ${bB}mamake${eB} will suffice; if source or +makefile modifications are anticipated then ${bB}nmake${eB} (from the ${bB}ast-open${eB} or +${bB}ast-base${eB} package) should be used. Mamfiles are automatically generated by +${bF}package write${eF}. +${bP} +Most component C source is prototyped. If ${bB}\$CC${eB} (default value ${bB}cc${eB}) is not a +prototyping C compiler then ${bF}package make${eF} runs ${Mproto} on portions of the +${bB}\$PACKAGEROOT/src${eB} tree and places the converted output files in the +${bB}\$PACKAGEROOT/proto/src${eB} tree. Converted files are then viewpathed over the +original source. The ${bB}ast${eB} ${Mproto} command converts an ANSI C subset to code +that is compatible with K&R, ANSI, and C++ dialects. +${bP} +All scripts and commands under ${bB}\$PACKAGEROOT${eB} use ${bB}\$PATH${eB} relative pathnames; +there are no imbedded absolute pathnames. This means that binaries generated +under ${bB}\$PACKAGEROOT${eB} may be copied to a different root; users need only change +their ${bB}\$PATH${eB} variable to reference the new instalation root bin directory. +${bF}package install${eF} installs binary packages in a new ${bB}\$INSTALLROOT${eB}. +${eO}" + ;; + source) echo "${bO} +${bH}Source Package Installation Instructions${eH} +${bL} +${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may + have setuid executables, few must be owned by ${bI}root${eI}. These are best + changed manually when the security implications are understood.${eD} +${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work + area for all packages. +${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the + download site. If you already clicked, or if your system does not have + ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions + for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} + script which works with ksh and modern bash. The top level URL is:${bX} + URL=http://www.research.att.com/sw/download${eX}${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} + test -d bin || mkdir bin + url=\$URL/package + (wget -O bin/package \$url||curl -L \$url||hurl \$url) > bin/package + chmod +x bin/package${eX}${eD} +${bT}(5)${bD}Determine the list of package names you want from the download site, then + use the ${Mpackage} command to do the actual download:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + setup source \$URL ${bB}PACKAGE${eB} ...${eX} + (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for + ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest + source package(s); covered and up-to-date packages are not downloaded again unless + ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. + If the package root will contain only one architecture then you can install in ${bB}bin${eB} and + ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this + instead:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + flat setup source \$URL ${bB}PACKAGE${eB} ...${eX} + To update the same packages from the same URL run:${bX} + bin/package setup source${eX}${eD} +${bT}(6)${bD}Build and install; all generated files are placed under ${bB}arch/${eB}${bI}HOSTTYPE${eI} + (${bB}\$INSTALLROOT${eB}), where ${bI}HOSTTYPE${eI} is the output of ${bB}bin/package${eB} (with no + arguments.) ${bI}name=value${eI} arguments are supported; ${bB}CC${eB} and ${bB}debug=1${eB} (compile + with -g instead of -O) are likely candidates. The output is written to + the terminal and captured in ${bB}\$INSTALLROOT/lib/package/gen/make.out${eB}:${bX} + bin/package make${eX}${eD} +${bT}(7)${bD}List make results and interesting errors:${bX} + bin/package results${eX} + Run the regression tests:${bX} + bin/package test${eX} + List test results and errors:${bX} + bin/package results test${eX}${eD} +${bT}(8)${bD}The generated binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + ${Mfile} and ${Mnmake}, require the path of the bin directory to be + exported in ${bB}PATH${eb}.${eD} +${bT}(9)${bD}You can run the binaries directly from the package root, or you can + install them in a public root after you are satisfied with the make and + test actions (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} + bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} + This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to + preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the + ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a + flat install:${bX} + cd \$INSTALLROOT + cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} +${bT}(10)${bD}To summarize, after the first time the download, build, and test cycle + for the latest source release is:${bX} + bin/package setup source + bin/package make + bin/package test${eX}${eD}${eL} + +${bH}Source Package Installation Instructions -- Plan B${eH} +${bL} +${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives + into that directory.${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} + source package:${bX} + gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz | ${TAR} ${TARFLAGS}f -${eX} + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz + If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} + source package, compile it, and manually read the ${bB}INIT${eB} + source package:${bX} + mkdir bin + cp lib/package/tgz/ratz.${bI}YYYY-MM-DD${eI}.c lib/package/tgz/ratz.c + cc -o bin/ratz lib/package/tgz/ratz.c + bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz +${bT}(5)${bD}Read all unread package archive(s):${bX} + bin/package read${eX} + Both source and binary packages will be read by this step.${eD}${eL}${eO}" + ;; + *) echo "Usage: $command [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] + + The $command command controls source and binary packages. It must be run + within the package root directory tree. See \"$command help intro\" for + details. In the following, PACKAGE names either a package or a component + within a package; if omitted, all packages are operated on. The default + action is \"host type\". + + qualifier: + authorize NAME Remote authorization name or license acceptance phrase. + debug|environment Show environment and actions; do not execute. + flat Collapse \$INSTALLROOT { bin fun include lib } onto \$PACKAGEROOT. + force Force the action to override saved state. + never Run make -N; otherwise show other actions. + only Only operate on the specified packages. + password PASSWORD Remote authorization or license acceptance password. + quiet Do not list captured make and test action output. + show Run make -n; otherwise show other actions. + DEBUG Trace the package script actions in detail for debugging. + action: + admin [ all ] [ db FILE ] [ on PATTERN ] [ action ... ] + Apply ACTION ... to the hosts listed in FILE. If FILE is + omitted then "admin.db" is assumed. The caller must have rcp(1) + and rsh(1) or scp(1) and ssh(1) access to the hosts. Output + for the action is saved per-host in ACTION.log/HOST. Logs + can be viewed by \"package admin [on HOST] results [ACTION]\". + By default only local PACKAGEROOT hosts are selected from FILE; + \"all\" selects all hosts. \"on PATTERN\" selects only + hosts matching the | separated PATTERN. FILE contains four + types of lines. Blank lines and lines beginning with # are + ignored. Lines starting with id=value are variable assignments. + Set admin_ping to local conventions if \"$admin_ping\" fails. + If a package list is not specified on the command line the + action applies to all packages; a variable assigment + package=list applies action to the packages in list for + subsequent hosts in FILE. The remaining line type is a host + description consisting of 6 tab separated fields. The first 3 + are mandatory; the remaining 3 are updated by the admin action: + hosttype + The host type as reported by package. + [user@]host + The host name and optionally user name for rcp(1) + and rsh(1) access. + [remote:[[master]:]]PACKAGEROOT + The absolute remote package root directory and + optionally the remote prorocol (rsh or ssh) if + the directory is on a different server than the + master package root directory. If + lib/package/admin/$admin_env exists under + this directory then it is sourced by sh(1) + before ACTION is done. If this field begins with - + then the host is ignored. If this field contains + : then ditto(1) is used to sync the remote src + directory hierarchy to the local one. If [master]: + is specified then the sync is deferred to the + master host. If master is omitted (two :) then + the sync is disabled. These directories must exist + on the remote side: lib/package, src/cmd, src/lib. + date YYMMDD of the last action. + date Elapsed wall time of the last action. + M T W The admin action make, test and write action error + counts. A non-numeric value in any of these fields + disables the corresponding action. + clean | clobber + Delete the arch/HOSTTYPE hierarchy; this deletes all generated + files and directories for HOSTTYPE. The heirarchy can be rebuilt + by package make.] + contents [ package ... ] + List description and components for PACKAGE on the standard + output. + copyright [ package ... ] + List the general copyright notice(s) for PACKAGE on the + standard output. Note that individual components in PACKAGE + may contain additional or replacement notices. + export [ VARIABLE ... ] + List NAME=VALUE for each VARIABLE, one per line. If the + \"only\" attribute is specified then only the variable + values are listed. If no variables are specified then + $env are assumed. + help [ ACTION ] + Display help text on the standard error [ standard output + for ACTION ]. + host [ canon cpu name rating type ... ] + List architecture/implementation dependent host information + on the standard output. type is listed if no attributes are + specified. Information is listed on a single line in attributes + order. The attributes are: + canon The next argument is a host type name to be + converted to package syntax. + cpu The number of cpus; 1 if the host is not a + multiprocessor. + name The host name. + rating The cpu rating in pseudo mips; the value is useful + useful only in comparisons with rating values of + other hosts. Other than a vax rating fixed at 1, + ratings can vary wildly but consistently from + vendor mips ratings. cc(1) may be required to + determine the rating. + type The host type, usually of the form + vendor.architecture, with an optional trailing + -version. The main theme is that type names within + a family of architectures are named in a similar, + predictable style. Os point release information is + avoided as much as possible, but vendor resistance + to release incompatibilities has for the most part + been futile. + html [ ACTION ] + Display html help text on the standard error [ standard output + for ACTION ]. + install [ ARCHITECTURE ... ] DIR [ PACKAGE ... ] + Copy the package binary hierarchy to DIR. If ARCHITECTURE is + omitted then all architectures are installed. If the \"flat\" + attribute is specified then exactly one ARCHITECTURE must be + specified; this architecture will be installed in DIR without + the \"arch/HOSTTYPE\" directory prefixes. Otherwise each + architecture will be installed in a separate \"arch/HOSTTYPE\" + subdirectory of DIR. The ARCHITECTURE - names the current + architecture. DIR must be an existing directory. If PACKAGE + is omitted then all binary packages are installed. This action + requires nmake. + license [ package ... ] + List the source license(s) for PACKAGE on the standard output. + Note that individual components in PACKAGE may contain + additional or replacement licenses. + list [ PACKAGE ... ] + List the name, version and prerequisites for PACKAGE on the + standard output. + make [ PACKAGE ] [ OPTION ... ] [ TARGET ... ] + Build and install. The default TARGET is install, which + makes and installs all packages. If the standard output + is a terminal then the output is also captured in + \$INSTALLROOT/lib/package/gen/make.out. The build is done + in the \$INSTALLROOT directory tree viewpathed on top of + the \$PACKAGEROOT directory tree. If \"flat\" is specified then + the \$INSTALLROOT { bin fun include lib } directories are + linked to the same directories in the package root. Only + one architecture may be flat. Leaf directory names matching + the |-separated shell pattern \$MAKESKIP are ignored. The + view action is done before making. OPTION operands are + passed to the underlying make command. + read [ package ... | archive ... ] + Read the named package archive(s). Must be run from the + package root directory. Archives are searched for in . + and lib/package/tgz. Each package is read only once. The + file lib/package/tgz/package[.type].tim tracks the read time. + See the write action for archive naming conventions. Text + file archive member are assumed to be ASCII or UTF-8 encoded. + regress diff(1) the current and previous package test results. + release [ [CC]YY-MM-DD [ [cc]yy-mm-dd ] ] [ package ] + Display recent changes since [CC]YY-MM-DD (up to [cc]yy-mm-dd), + where - means lowest (or highest.) If no dates are specified + then changes for the last 4 months are listed. PACKAGE may + be a package or component name. + remove PACKAGE + Remove files installed for PACKAGE. + results [ path ] [ old ] [ make | test ] + List results and interesting messages captured by the most + recent make (default), test or write action. old specifies the + previous results, if any (current and previous results are + retained.) $HOME/.pkgresults, if it exists, must contain an + egrep(1) expression of result lines to be ignored. failed lists + failures only and path lists the results file path only. + setup [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] + The action initializes the current directory as a package root, + runs the update action to download new or out of date packages, + and runs the read action on those packages. If \"flat\" is + specified then the \$INSTALLROOT { bin fun include lib } + directories are linked to the same directories in the package + root. Only one architecture may be flat. See the update and + read actions for argument details. + test [ PACKAGE ] + Run the regression tests for PACKAGE. If the standard output + is a terminal then the output is also captured in + \$INSTALLROOT/lib/package/gen/test.out. In general a package + must be made before it can be tested. Components tested with + the \bregress\b(1) command require \bksh93\b. If only is + also specified then only the listed package components are + tested, otherwise the closure of the components is tested. + update [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] + Download the latest release of the selected and required + packages from URL (e.g., + http://www.research.att.com/sw/download) into the directory + \$PACKAGEROOT/lib/package/tgz. beta acesses beta packages; + download these at your own risk. If ARCHITECTURE is omitted + then only architectures already present in the tgz directory + will be downloaded. If ARCHITECTURE is - then all posted + architectures will be downloaded. If URL matches *.url then + it is interpreted as a file containing shell variable + assignments for url, authorize and password. If URL is + omitted then the definitions for url, authorize and password + in \$PACKAGEROOT/lib/package/tgz/$default_url, if it exists, + are used. If \$PACKAGEROOT/lib/package/tgz/$default_url does + not exist then it is initialized with the current url, + authorize and password values and read permission for the + current user only. If PACKAGE is omitted then only + packages already present in the tgz directory will be + downloaded. If PACKAGE is - then all posted packages will be + downloaded. If source and binary are omitted then both source + and binary packages will be downloaded. If \bonly\b is + specified then only the named packages are updated; otherwise + the closure of required packages is updated. This action + requires wget(1), lynx(1), curl(1) or a shell that supports + io to /dev/tcp/HOST/PORT. + use [ uid | PACKAGE | . [ 32 | 64 ] | 32 | 64 | - ] [ COMMAND ... ] + Run COMMAND or an interactive shell if COMMAND is omitted, with + the environment initialized for using the package (can you say + shared library without cussing?) If uid or PACKAGE or . is + specified then it is used to determine a \$PACKAGEROOT, + possibly different from the current directory. For example, to + try out bozo's package: \"package use bozo\". In this case the + command may be run from any directory. If the file + \$INSTALLROOT/lib/package/profile is readable then it is + sourced to initialize the environment. 32 or 64 implies + \$PACKAGEROOT of . and specifies the target architecture word + size (which may be silently ignored.) + verify [ PACKAGE ] + Verify installed binary files against the checksum files in + \$INSTALLROOT/lib/package/gen/*.sum. The checksum files contain + mode, user and group information. If the checksum matches + for a given file then the mode, user and group are changed + as necessary to match the checksum entry. A warning is printed + on the standard error for each mismatch. Requires the ast + package cksum(1) command. + view + Initialize the architecture specific viewpath hierarchy. The + make action implicitly calls this action. If \"flat\" is specified + then the \$INSTALLROOT { bin fun include lib } directories are + linked to the same directories in the package root. Only one + architecture may be flat. + write [closure] [cyg|exp|lcl|pkg|rpm|tgz|tst] [base|delta] + [binary|runtime|source] PACKAGE + Write a package archive for PACKAGE. All work is done in the + \$PACKAGEROOT/lib/package directory. FORMAT-specific files + are placed in the FORMAT subdirectory. A PACKAGE[.TYPE].tim + file in this directory tracksthe write time and prevents a + package from being read in the same root it was written. If + more than one file is generated for a particular FORMAT then + those files are placed in the FORMAT/PACKAGE subdirectory. + File names in the FORMAT subdirectory will contain the package + name, a YYYY-MM-DD date, and for binary packages, HOSTTYPE. + If PACKAGE is omitted then an ordered list of previously + written packages is generated. If \"only\" is specified then + only the named packages will be written; otherwise + prerequisite packages are written first. Package components + must be listed in PACKAGE.pkg. FORMAT may be one of: + cyg generate a cygwin package + exp generate an exptools(1) maintainer source archive + and NPD file in the exp subdirectory, suitable for + expmake(1); support files are placed in the + exp/PACKAGE subdirectory + lcl generate a package archive or delta in the lcl + subdirectory, suitable for restoration into the + primary source tree (no source licence annotation) + pkg generate a pkgmk(1) package, suitable for pkgadd(1) + rpm generate an rpm(1) package + tgz generate a gzip(1) tar(1) package archive; this is + the default + tst generate tgz FORMAT package archive in the tst + subdirectory; version state files are not updated + The package type must be one of source, binary or runtime. + A source package contains the source needed to build the + corresponding binary package. A binary package includes the + libraries and headers needed for compiling and linking + against the public interfaces. A runtime package contains + the commands and required dynamic libraries. A package may + be either a base or delta. A base package contains a + complete copy of all components. A delta package contains + only changes from a previous base package. Delta recipients + must have the ast pax(1) command (in the ast-base package.) + If neither base nor delta is specified, then the current + base is overwritten if there are no deltas referring to the + current base. Only the tgz and lcl formats support delta. + If base is specified then a new base and two delta archives + are generated: one delta to generate the new base from the + old, and one delta to generate the old base from the new; + the old base is then removed. If delta is specified then a + new delta referring to the current base is written. + package.pkg may reference other packages. By default a + pointer to those packages is written. The recipient package + read will then check that all required packages have been + downloaded. If closure is specified then the components for + all package references are included in the generated + package. This may be useful for lcl and versioning. All + formats but lcl annotate each source file (not already + annotated) with a license comment as it is written to the + package archive using proto(1). + name=value: + variable definition: typically CC=cc or CCFLAGS=-g." + ;; + esac + exit $code + ;; + *=*) set DEFAULT host type "$@" + ;; + *) echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2 + exit 2 + ;; + esac + global="$global $1" + shift +done + +# gather HOSTTYPE *,* options +# ,*cc*,-*,... set CC and CCFLAGS + +hostopts() +{ + _ifs_=$IFS + IFS=, + set '' $HOSTTYPE + IFS=$_ifs_ + shift + while : + do case $# in + 0|1) break ;; + esac + shift + case $1 in + *cc*) CC=$1 + while : + do case $# in + 0|1) break ;; + esac + case $2 in + -*) case $assign_CCFLAGS in + ?*) assign_CCFLAGS="$assign_CCFLAGS " ;; + esac + assign_CCFLAGS="$assign_CCFLAGS$2" + shift + ;; + *) break + ;; + esac + done + ;; + esac + done +} + +# collect command line targets and definitions + +case $_PACKAGE_HOSTTYPE_ in +?*) HOSTTYPE=$_PACKAGE_HOSTTYPE_ + KEEP_HOSTTYPE=1 + ;; +*) KEEP_HOSTTYPE=0 + ;; +esac +KEEP_PACKAGEROOT=0 +KEEP_SHELL=0 +USER_VPATH= +args= +assign= +assign_CCFLAGS= +for i +do case $i in + *:*=*) args="$args $i" + continue + ;; + *=*) eval `echo ' ' "$i" | sed 's,^[ ]*\([^=]*\)=\(.*\),n=\1 v='\''\2'\'','` + ;; + esac + case $i in + AR=*|LD=*|NM=*) + assign="$assign $n='$v'" + eval $n='$'v + ;; + CC=*) eval $n='$'v + ;; + CCFLAGS=*) + eval $n='$'v + assign_CCFLAGS="CCFLAGS=\"\$CCFLAGS\"" + ;; + HOSTTYPE=*) + eval $n='$'v + case $HOSTTYPE in + ?*) KEEP_HOSTTYPE=1 ;; + esac + ;; + HURL=*) eval $n='$'v + ;; + PACKAGEROOT=*) + eval $n='$'v + case $PACKAGEROOT in + ?*) KEEP_PACKAGEROOT=1 ;; + esac + ;; + SHELL=*)eval $n='$'v + case $SHELL in + ?*) KEEP_SHELL=1 ;; + esac + ;; + TAR=*) eval $n='$'v + ;; + TARFLAGS=*) + eval $n='$'v + ;; + VPATH=*)eval USER_$n='$'v + ;; + 'debug=1') + makeflags="$makeflags --debug-symbols" + ;; + 'strip=1') + makeflags="$makeflags --strip-symbols" + ;; + *=*) assign="$assign $n='$v'" + ;; + *) args="$args $i" + ;; + esac +done +case $HOSTTYPE in +*,*) hostopts $HOSTTYPE ;; +esac +case $assign_CCFLAGS in +?*) assign="$assign $assign_CCFLAGS" +esac +case $CC in +''|cc) ;; +*) export CC ;; +esac + +# grab action specific args + +case $action in +admin) while : + do case $# in + 0) set list + break + ;; + esac + case $1 in + all) admin_all=1 + ;; + db) case $# in + 1) echo $command: $action: $1: db file argument expected >&2 + exit 1 + ;; + esac + shift + admin_db=$1 + ;; + on) case $# in + 1) echo $command: $action: $1: host pattern argument expected >&2 + exit 1 + ;; + esac + shift + admin_on=$1 + ;; + *) break + ;; + esac + shift + done + admin_action=$1 + admin_args=$* + for i + do case $i in + debug|environment|force|never|only|quiet|show|DEBUG) + ;; + *) admin_action=$i + break + ;; + esac + done + ;; +setup) PACKAGEROOT=${PWD:-`pwd`} + export PACKAGEROOT + KEEP_PACKAGEROOT=1 + ;; +use) case $1 in + .|32|64)case $1 in + 32|64) bit=$1 ;; + esac + shift + + # HOSTTYPE specific setup + + case $HOSTTYPE in + win32.*)sys=uwin + wow=`uname -i` + case $bit in + 32) case $HOSTTYPE in + *-64) HOSTTYPE=${HOSTTYPE%-64} ;; + esac + case $wow in + */32) ;; + *) vpath / /$bit ;; + esac + ;; + 64) case $HOSTTYPE in + *-64) ;; + *) HOSTTYPE=$HOSTTYPE-64 ;; + esac + case $wow in + */32) echo $command: cannot build $bit-bit on $wow $sys >&2; exit 2 ;; + *) vpath / /$bit ;; + esac + ;; + esac + case $bit in + '') PS1="($sys) " ;; + *) PS1="($sys-$bit) " ;; + esac + + $exec umask 002 + $exec unset MAKESKIP + + $exec export P=$PWD + $exec export A=$P/arch/$HOSTTYPE + + $exec export CDPATH=:..:$A/src/cmd:$A/src/lib:$A/src/uwin:$P/lib/package + $exec export INSTALLROOT=$A + $exec export PACKAGEROOT=$P + $exec export PATH=$A/bin:$P/bin:$PATH + $exec export PS1="$PS1" + $exec export VPATH=$A:$P + $exec export nativepp=/usr/lib + + if test '' != "$INSTALLROOT" -a -d $INSTALLROOT/include/ast + then $exec export PACKAGE_ast=$INSTALLROOT + elif test -d ${PWD%/*}/ast/arch/$HOSTTYPE + then $exec export PACKAGE_ast=${PWD%/*}/ast/arch/$HOSTTYPE + fi + + # run the command + + case $# in + 0) case $show in + ':') $exec exec $SHELL ;; + esac + ;; + *) $exec exec $SHELL -c "$@" + ;; + esac + exit + ;; + esac + PACKAGEROOT=${PWD:-`pwd`} + $show export PACKAGEROOT + esac + ;; +esac + +# true if arg is a valid PACKAGEROOT + +packageroot() # dir +{ + test -d $1/lib/$command -o -x $1/bin/$command +} + +# true if arg is executable + +executable() # [!] command +{ + case $1 in + '!') test ! -x "$2" -a ! -x "$2.exe"; return ;; + *) test -x "$1" -o -x "$1.exe"; return ;; + esac +} + +# initialize SHELLMAGIC +# tangible proof of cygwin's disdain for unix (well, this and execrate) + +shellmagic() +{ + case $SHELLMAGIC in + '') ;; + -) if test -f /emx/bin/sh.exe + then SHELLMAGIC='#!/emx/bin/sh.exe'$nl + elif test -f /bin/env.exe + then SHELLMAGIC='#!/bin/env sh'$nl + else SHELLMAGIC= + fi + ;; + esac +} + +# true if arg is executable command on $PATH + +onpath() # command +{ + _onpath_b=$1 + case $_onpath_b in + /*) if executable $_onpath_b + then _onpath_=$_onpath_b + return 0 + fi + return 1 + ;; + esac + IFS=':' + set '' $PATH + IFS=$ifs + shift + for _onpath_d + do case $_onpath_d in + '') _onpath_d=. ;; + esac + if executable "$_onpath_d/$_onpath_b" + then _onpath_=$_onpath_d/$_onpath_b + return 0 + fi + done + return 1 +} + +# true if no nmake or nmake not from AT&T or nmake too old + +nonmake() # nmake +{ + _nonmake_version=`( $1 -n -f - 'print $(MAKEVERSION:@/.*AT&T.* //:/-//G:@/.* .*/19960101/)' . ) /dev/null || echo 19840919` + if test $_nonmake_version -lt 20001031 + then return 0 + fi + return 1 +} + +# determine local host attributes + +hostinfo() # attribute ... +{ + case $DEBUG in + 1) set -x ;; + esac + map= + something= + path=$PATH + for i in $ccs + do PATH=$PATH:$i + done + for i in $use + do for j in $org + do PATH=$PATH:$i/$j/bin + done + PATH=$PATH:$i/bin + done + # LD_LIBRARY_PATH may be out of sync with PATH here + case $SED in + '') SED=sed + $SED 1d < /dev/null > /dev/null 2>&1 || + for dir in /bin /usr/bin + do if test -x $dir/$SED + then SED=$dir/$SED + break + fi + done + TR=tr + $TR < /dev/null > /dev/null 2>&1 || + for dir in /bin /usr/bin + do if test -x $dir/$TR + then TR=$dir/$TR + break + fi + done + ;; + esac + case $PACKAGE_PATH in + ?*) for i in `echo $PACKAGE_PATH | $SED 's,:, ,g'` + do PATH=$PATH:$i/bin + done + ;; + esac + + # validate the args + + canon= + cc=$CC + for info + do case $canon in + -) canon=$info + ;; + *) case $info in + */*|*[cC][cC]) + cc=$info + ;; + canon) canon=- + something=1 + ;; + cpu|name|rating|type) + something=1 + ;; + *) echo "$command: $action: $info: unknown attribute" >&2 + exit 1 + ;; + esac + ;; + esac + done + case $canon in + -) echo "$command: $action: canon: host type name expected" >&2 + exit 1 + ;; + esac + case $something in + "") set "$@" type ;; + esac + case $DEBUG in + '') exec 9>&2 + exec 2>/dev/null + ;; + esac + + # compute the info + + _hostinfo_= + for info + do + case $info in + cpu) case $NPROC in + [123456789]*) + _hostinfo_="$_hostinfo_ $NPROC" + continue + ;; + esac + cpu=`grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo` + case $cpu in + [123456789]*) + _hostinfo_="$_hostinfo_ $cpu" + continue + ;; + esac + cpu=1 + # exact match + set \ + hinv '^Processor [0123456789]' \ + psrinfo 'on-line' \ + 'cat /reg/LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ + 'cat /proc/registry/HKEY_LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | grep -c "$2"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift + done + case $cpu in + 0|1) set \ + /bin/mpstat + + while : + do case $# in + 0) break ;; + esac + if executable $1 + then case `$1 | grep -ic '^cpu '` in + 1) cpu=`$1 | grep -ic '^ *[0123456789][0123456789]* '` + break + ;; + esac + fi + shift + done + ;; + esac + case $cpu in + 0|1) # token match + set \ + /usr/kvm/mpstat 'cpu[0123456789]' \ + /usr/etc/cpustatus 'enable' \ + /usr/alliant/showsched 'CE' \ + 'ls /config/hw/system/cpu' 'cpu' \ + prtconf 'cpu-unit' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | $TR ' ' ' + +' | grep -c "^$2"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift + done + ;; + esac + case $cpu in + 0|1) # special match + set \ + \ + hinv \ + '/^[0123456789][0123456789]* .* Processors*$/' \ + '/[ ].*//' \ + \ + /usr/bin/hostinfo \ + '/^[0123456789][0123456789]* .* physically available\.*$/' \ + '/[ ].*//' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | $SED -e "${2}!d" -e "s${3}"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift;shift + done + ;; + esac + case $cpu in + 0|1) cpu=`( + cd ${TMPDIR:-/tmp} + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.c < +#include +int main() +{ + printf("%d\n", pthread_num_processors_np()); + return 0; +} +! + for o in -lpthread '' + do if $CC $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 || + gcc $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 + then ./$tmp.exe + break + fi + done + )` + case $cpu in + [0123456789]*) ;; + *) cpu=1 ;; + esac + ;; + esac + _hostinfo_="$_hostinfo_ $cpu" + ;; + name) _name_=`hostname || uname -n || cat /etc/whoami || echo local` + _hostinfo_="$_hostinfo_ $_name_" + ;; + rating) for rating in `grep -i ^bogomips /proc/cpuinfo 2>/dev/null | $SED -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,'` + do case $rating in + [0123456789]*) break ;; + esac + done + case $rating in + [0123456789]*) ;; + *) cd ${TMPDIR:-/tmp} + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.c < +#include +#if TD || TZ +#include +#else +extern time_t time(); +#endif +int main() +{ + register unsigned long i; + register unsigned long j; + register unsigned long k; + unsigned long l; + unsigned long m; + unsigned long t; + int x; +#if TD || TZ + struct timeval b; + struct timeval e; +#if TZ + struct timezone z; +#endif +#endif + l = 500; + m = 890; + x = 0; + for (;;) + { +#if TD || TZ +#if TZ + gettimeofday(&b, &z); +#else + gettimeofday(&b); +#endif +#else + t = (unsigned long)time((time_t*)0); +#endif + k = 0; + for (i = 0; i < l; i++) + for (j = 0; j < 50000; j++) + k += j; +#if TD || TZ +#if TZ + gettimeofday(&e, &z); +#else + gettimeofday(&e); +#endif + t = (e.tv_sec - b.tv_sec) * 1000 + (e.tv_usec - b.tv_usec) / 1000; + if (!x++ && t < 1000) + { + t = 10000 / t; + l = (l * t) / 10; + continue; + } +#else + t = ((unsigned long)time((time_t*)0) - t) * 1000; + if (!x++ && t < 20000) + { + t = 200000l / t; + l = (l * t) / 10; + continue; + } +#endif +#if PR + printf("[ k=%lu l=%lu m=%lu t=%lu ] ", k, l, m, t); +#endif + if (t == 0) + t = 1; + break; + } + printf("%lu\n", ((l * m) / 10) / t); + return k == 0; +} +! + rating= + for o in -DTZ -DTD '' + do if $CC $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 || + gcc $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 + then rating=`./$tmp.exe` + break + fi + done + case $rating in + [0123456789]*) ;; + *) rating=1 ;; + esac + ;; + esac + _hostinfo_="$_hostinfo_ $rating" + ;; + type|canon) + case $CROSS:$canon in + 0:) case $cc in + cc) case $KEEP_HOSTTYPE:$HOSTTYPE in + 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$HOSTTYPE + then KEEP_HOSTTYPE=1 + fi + ;; + esac + ;; + esac + case $KEEP_HOSTTYPE in + 1) _hostinfo_="$_hostinfo_ $HOSTTYPE" + continue + ;; + esac + ;; + esac + case $cc in + /*) a=`$cc -dumpmachine $CCFLAGS 2>/dev/null` + case $a in + '') case $CCFLAGS in + ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + esac + ;; + esac + case $a in + ''|*' '*|*/*:*) + ;; + *.*-*) _hostinfo_="$_hostinfo_ $a" + continue + ;; + *-*-*) case $canon in + '') canon=$a ;; + esac + ;; + *) _hostinfo_="$_hostinfo_ $a" + continue + ;; + esac + ;; + esac + IFS=: + set /$IFS$PATH + IFS=$ifs + shift + f=../lib/hostinfo/typemap + for i + do case $i in + "") i=. ;; + esac + case $canon in + '') case $cc in + /*|cc) ;; + *) if executable $i/$cc + then a=`$i/$cc -dumpmachine $CCFLAGS 2>/dev/null` + case $a in + '') case $CCFLAGS in + ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + esac + ;; + esac + case $a in + ''|*' '*|*/*:*) + ;; + *-*) canon=$a + ;; + *) _hostinfo_="$_hostinfo_ $a" + continue 2 + ;; + esac + fi + ;; + esac + ;; + esac + if test -f "$i/$f" + then map="`grep -v '^#' $i/$f` $map" + fi + done + + # inconsistent -dumpmachine filtered here + + case -${canon}- in + --|*-powerpc-*) + h=`hostname || uname -n || cat /etc/whoami` + case $h in + '') h=local ;; + esac + a=`arch || uname -m || att uname -m || uname -s || att uname -s` + case $a in + *[\ \ ]*) a=`echo $a | $SED "s/[ ]/-/g"` ;; + esac + case $a in + '') a=unknown ;; + esac + m=`mach || machine || uname -p || att uname -p` + case $m in + *[\ \ ]*) m=`echo $m | $SED "s/[ ]/-/g"` ;; + esac + case $m in + '') m=unknown ;; + esac + x=`uname -a || att uname -a` + case $x in + '') x="unknown $host unknown unknown unknown unknown unknown" ;; + esac + set "" $h $a $m $x + expected=$1 host=$2 arch=$3 mach=$4 os=$5 sys=$6 rel=$7 ver=$8 + ;; + *) case $canon in + *-*) IFS=- + set "" $canon + shift + IFS=$ifs + case $# in + 2) host= mach= arch=$1 os=$2 sys= rel= ;; + *) host= mach=$2 arch=$1 os=$3 sys= rel= ;; + esac + case $os in + [abcdefghijklmnopqrstuvwxyz]*[0123456789]) + eval `echo $os | $SED -e 's/^\([^0123456789.]*\)\.*\(.*\)/os=\1 rel=\2/'` + ;; + esac + ;; + *) arch=$canon mach= os= sys= rel= + ;; + esac + ;; + esac + type=unknown + case $host in + *.*) host=`echo $host | $SED -e 's/\..*//'` ;; + esac + case $mach in + unknown) + mach= + ;; + [Rr][0123][0123456789][0123456789][0123456789]) + mach=mips1 + ;; + [Rr][4][0123456789][0123456789][0123456789]) + mach=mips2 + ;; + [Rr][56789][0123456789][0123456789][0123456789]|[Rr][123456789][0123456789][0123456789][0123456789][0123456789]) + mach=mips4 + ;; + pc) arch=i386 + mach= + ;; + [Pp][Oo][Ww][Ee][Rr][Pp][Cc]) + arch=ppc + mach= + ;; + *) case $arch in + 34[0123456789][0123456789]) + os=ncr + arch=i386 + ;; + esac + ;; + esac + case $canon in + '') set \ + \ + /NextDeveloper -d next - \ + /config/hw/system/cpu -d tandem mach \ + + while : + do case $# in + 0) break ;; + esac + if test $2 $1 + then os=$3 + case $4 in + arch) mach=$arch ;; + mach) arch=$mach ;; + esac + break + fi + shift;shift;shift;shift + done + ;; + esac + case $os in + AIX*|aix*) + type=ibm.risc + ;; + HP-UX) case $arch in + 9000/[78]*) + type=hp.pa + ;; + */*) type=hp.`echo $arch | $SED 's,/,_,g'` + ;; + *) type=hp.$arch + ;; + esac + ;; + [Ii][Rr][Ii][Xx]*) + set xx `hinv | $SED -e '/^CPU:/!d' -e 's/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + shift + type=$1 + n= + case $2 in + r[0123][0123456789][0123456789][0123456789]) + n=1 + ;; + r[4][0123][0123456789][0123456789]) + n=2 + ;; + r[4][456789][0123456789][0123456789]|r[5][0123456789][0123456789][0123456789]) + n=3 + ;; + r[6789][0123456789][0123456789][0123456789]|r[123456789][0123456789][0123456789][0123456789][0123456789]) + n=4 + ;; + esac + case $rel in + [01234].*|5.[012]|5.[012].*) + case $n in + 1) ;; + *) n=2 ;; + esac + ;; + 5.*) case $n in + 2) n=3 ;; + esac + ;; + esac + if executable $cc + then a=$cc + else IFS=: + set /$IFS$PATH + IFS=$ifs + shift + for i + do a=$i/$cc + if executable $a + then break + fi + done + fi + split=' +' + a=`strings $a < /dev/null | $SED -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | $SED -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q` + case $a in + [0123456789]) n=$a ;; + esac + case $n in + 4) a=`$cc -${type}3 2>&1` + case $a in + *unknown*|*install*|*conflict*) + ;; + *) n=3 + ;; + esac + ;; + esac + a=`$cc -show F0oB@r.c 2>&1` + case $n:$a in + [!2]:*mips2*) n=2 ;; + [!23]:*mips3*) n=3 ;; + [!234]:*mips4*) n=4 ;; + esac + case $n:$a in + [!2]:*[Oo]32*) abi=-o32 ;; + [!3]:*[Nn]32*) abi=-n32 ;; + esac + mach=${type}$n + type=sgi.$mach + ;; + OSx*|SMP*|pyramid) + type=pyr + ;; + OS/390) type=mvs.390 + ;; + [Ss][Cc][Oo]*) + type=sco + ;; + [Ss]ol*) + v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + case $v in + [6789]|[1-9][0-9]) + ;; + *) v= + ;; + esac + case $arch in + '') case $mach in + '') arch=sun4 ;; + *) arch=$mach ;; + esac + ;; + esac + case $arch in + sparc) arch=sun4 ;; + esac + type=sol$v.$arch + ;; + [Ss]un*)type=`echo $arch | $SED -e 's/\(sun.\).*/\1/'` + case $type in + sparc) type=sun4 ;; + esac + case $rel in + [01234]*) + ;; + '') case $os in + *[Oo][Ss]) + ;; + *) type=sol.$type + ;; + esac + ;; + *) case $type in + '') case $mach in + sparc*) type=sun4 ;; + *) type=$mach ;; + esac + ;; + esac + v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + case $v in + [6789]|[1-9][0-9]) + ;; + *) v= + ;; + esac + type=sol$v.$type + ;; + esac + case $type in + sun*|*.*) + ;; + *) type=sun.$type + ;; + esac + ;; + [Uu][Nn][Ii][Xx]_[Ss][Vv]) + type=unixware + ;; + UTS*|uts*) + if test -x /bin/u370 -o -x /bin/u390 + then type=uts.390 + else case $arch in + '') arch=$mach ;; + esac + type=uts.$arch + fi + ;; + $host) type=$arch + case $type in + *.*|*[0123456789]*86|*68*) + ;; + *) case $mach in + *[0123456789]*86|*68*|mips) + type=$type.$mach + ;; + esac + ;; + esac + ;; + unknown) + case $arch in + ?*) case $arch in + sun*) mach= ;; + esac + type=$arch + case $mach in + ?*) type=$type.$mach ;; + esac + ;; + esac + ;; + *) case $ver in + FTX*|ftx*) + case $mach in + *[0123456789][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*) + mach=`echo $mach | $SED -e 's/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*$//'` + ;; + esac + type=stratus.$mach + ;; + *) case $arch in + [Oo][Ss][-/.]2) + type=os2 + arch=$rel + ;; + *) type=`echo $os | $SED -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//'` + ;; + esac + case $type in + [Cc][Yy][Gg][Ww][Ii][Nn]_*) + type=cygwin + ;; + [Uu][Ww][Ii][Nn]*|[Ww]indows_[0123456789][0123456789]|[Ww]indows_[Nn][Tt]) + type=win32 + arch=`echo $arch | $SED -e 's/_[^_]*$//'` + ;; + esac + case $arch in + '') case $mach in + ?*) type=$type.$mach ;; + esac + ;; + *) type=$type.$arch ;; + esac + ;; + esac + esac + case $type in + [0123456789]*) + case $mach in + ?*) type=$mach ;; + esac + case $type in + */MC) type=ncr.$type ;; + esac + ;; + *.*) ;; + *[0123456789]*86|*68*) + case $rel in + [34].[0123456789]*) + type=att.$type + ;; + esac + ;; + [abcdefghijklmnopqrstuvwxyz]*[0123456789]) + ;; + [abcdefghijklmnopqrstuvwxyz]*) case $mach in + $type) case $ver in + Fault*|fault*|FAULT*) + type=ft.$type + ;; + esac + ;; + ?*) case $arch in + '') type=$type.$mach ;; + *) type=$type.$arch ;; + esac + ;; + esac + ;; + esac + case $type in + *[-_]32|*[-_]64|*[-_]128) + bits=`echo $type | $SED 's,.*[-_],,'` + type=`echo $type | $SED 's,[-_][0-9]*$,,'` + ;; + *) bits= + ;; + esac + type=`echo $type | $SED -e 's%[-+/].*%%' | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + case $type in + *.*) lhs=`echo $type | $SED -e 's/\..*//'` + rhs=`echo $type | $SED -e 's/.*\.//'` + case $rhs in + [x0123456789]*86) rhs=i$rhs ;; + 68*) rhs=m$rhs ;; + esac + case $rhs in + i[x23456789]86|i?[x23456789]86|*86pc) + rhs=i386 ;; + powerpc) rhs=ppc ;; + s[0123456789]*[0123456789]x) + rhs=`echo $rhs | $SED -e 's/x$/-64/'` ;; + esac + case $rhs in + arm[abcdefghijklmnopqrstuvwxyz_][0123456789]*) + rhs=arm ;; + hppa) rhs=pa ;; + esac + case $lhs in + ?*coff|?*dwarf|?*elf) + case $lhs in + ?*coff) x=coff ;; + ?*dwarf)x=coff ;; + ?*elf) x=elf ;; + esac + lhs=`echo ${lhs}XXX | $SED -e "s/${x}XXX//"` + ;; + esac + case $lhs in + bsdi) lhs=bsd ;; + darwin) case $rel in + [01234567].*) lhs=${lhs}7 ;; + esac + ;; + freebsd) case $rel in + [01234].*) lhs=${lhs}4 ;; + [123456789]*.*) lhs=${lhs}`echo $rel | $SED -e 's/\..*//'` ;; + esac + ;; + hpux) lhs=hp ;; + mvs) rhs=390 ;; + esac + case $lhs in + '') type=$rhs ;; + $rhs) type=$lhs ;; + *) type=$lhs.$rhs ;; + esac + ;; + esac + case $type in + sgi.mips*) + case $mach in + mips2) type=sgi.$mach + abi=-o32 + ;; + mips3) type=sgi.$mach + abi=-n32 + ;; + mips[456789]) + type=sgi.$mach + case $abi in + *-n32) ;; + *) abi=-64 ;; + esac + ;; + *) pwd=`pwd` + cd ${TMPDIR:-/tmp} + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.a.c < $tmp.b.c </dev/null 2>&1 + rm -f $tmp.* + trap - 0 1 2 + cd $pwd + ;; + esac + case $type$abi in + sgi.mips2-o32) + ;; + sgi.mips3) + type=$type-o32 + ;; + sgi.mips3-n32) + ;; + sgi.mips4) + type=$type-o32 + ;; + sgi.mips[456789]-64) + ;; + *) type=$type$abi + ;; + esac + ;; + *) case $bits in + '') case `file /bin/sh 2>/dev/null` in + *universal*64*) + pwd=`pwd` + cd ${TMPDIR:-/tmp} + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.a.c </dev/null 2>&1 + rm -f $tmp.* + trap - 0 1 2 + cd $pwd + ;; + esac + ;; + esac + ;; + esac + case $bits in + 32) case $type in + *.i386) bits= ;; + esac + ;; + esac + case $bits in + ?*) type=$type-$bits ;; + esac + + # last chance mapping + + set "" "" $map + while : + do case $# in + [012]) break ;; + esac + shift;shift + eval " case \$type in + $1) type=\$2; break ;; + esac" + done + _hostinfo_="$_hostinfo_ $type" + ;; + esac + done + set '' $_hostinfo_ + shift + _hostinfo_=$* + + # restore the global state + + PATH=$path + case $DEBUG in + '') exec 2>&9 + exec 9>&- + ;; + esac +} + +# info message + +note() # message ... +{ + echo $command: "$@" >&2 +} + +# cc checks +# +# CC: compiler base name name +# cc: full path, empty if not found + +checkcc() +{ + cc= + if onpath $CC + then cc=$_onpath_ + else case $CC in + cc) if onpath gcc + then CC=gcc + cc=$_onpath_ + fi + ;; + esac + fi + case $cc in + '') case $action in + make|test) note "$CC: not found"; exit 1 ;; + *) note "warning: $CC: not found" ;; + esac + ;; + esac +} + +# some actions have their own PACKAGEROOT or kick out early + +case $action in +host) eval u=$package_use + case $u in + $PACKAGE_USE) + ;; + *) if onpath $0 + then case $_onpath_ in + */arch/$HOSTTYPE/bin/package) + KEEP_HOSTTYPE=1 + ;; + *) KEEP_HOSTTYPE=0 + ;; + esac + else KEEP_HOSTTYPE=0 + fi + ;; + esac + hostinfo $args + echo $_hostinfo_ + exit 0 + ;; +export|setup|use) + x= + ;; +*) x= + eval u=$package_use + case $u in + $PACKAGE_USE) + case :$PATH: in + *:$INSTALLROOT/bin:*) + case $LIBPATH: in + $INSTALLROOT/bin:$INSTALLROOT/lib:*) + case $SHLIB_PATH: in + $INSTALLROOT/lib:*) + x=1 + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; +esac +run=- +case $x in +1) : accept the current package use environment + + OK=ok + KSH=$EXECROOT/bin/ksh + MAKE=nmake + NMAKE=$EXECROOT/bin/$MAKE + SUM=$EXECROOT/bin/sum + TEE=$EXECROOT/bin/tee + INITROOT=$PACKAGEROOT/src/cmd/INIT + checkcc + ;; +*) hosttype= + case $KEEP_PACKAGEROOT in + 0) case $action in + use) PACKAGEROOT= + case $show in + echo) exec=echo make=echo show=echo ;; + esac + set '' $args + shift + case $# in + 0) ;; + *) case $1 in + -|.) ;; + /*) PACKAGEROOT=$1 + ;; + *) i=`echo ~$1` + if packageroot $i + then PACKAGEROOT=$i + else for i in `echo $HOME | sed -e 's,/[^/]*$,,'` $usr $use + do if packageroot $i/$1 + then PACKAGEROOT=$i/$1 + break + fi + done + case $PACKAGEROOT in + '') hosttype=$1 ;; + esac + fi + ;; + esac + shift + ;; + esac + run="$@" + ;; + esac + case $PACKAGEROOT in + '') PACKAGEROOT=${PWD:-`pwd`} ;; + esac + + # . must be within the PACKAGEROOT tree + + i=X$PACKAGEROOT + IFS=/ + set $i + IFS=$ifs + while : + do i=$1 + shift + case $i in + X) break ;; + esac + done + case $PACKAGEROOT in + //*) d=/ ;; + *) d= ;; + esac + case $1 in + home) k=1 ;; + *) k=0 ;; + esac + for i + do case $i in + '') continue ;; + esac + d=$d/$i + case $k in + 2) k=1 + ;; + 1) k=0 + ;; + 0) case $i in + arch) k=2 + ;; + *) if packageroot $d + then PACKAGEROOT=$d + fi + ;; + esac + ;; + esac + done + ;; + esac + INITROOT=$PACKAGEROOT/src/cmd/INIT + $show PACKAGEROOT=$PACKAGEROOT + $show export PACKAGEROOT + export PACKAGEROOT + + # initialize the architecture environment + + case $KEEP_HOSTTYPE in + 0) hostinfo type + HOSTTYPE=$_hostinfo_ + ;; + 1) _PACKAGE_HOSTTYPE_=$HOSTTYPE + export _PACKAGE_HOSTTYPE_ + ;; + esac + $show HOSTTYPE=$HOSTTYPE + $show export HOSTTYPE + export HOSTTYPE + INSTALLROOT=$PACKAGEROOT/arch/$HOSTTYPE + case $action in + admin|install|make|read|remove|test|verify|view|write) + ;; + *) if test ! -d $INSTALLROOT + then INSTALLROOT=$PACKAGEROOT + fi + ;; + esac + $show INSTALLROOT=$INSTALLROOT + $show export INSTALLROOT + export INSTALLROOT + + # HOSTTYPE specific package profile + + if test -r $INSTALLROOT/lib/package/profile + then . $INSTALLROOT/lib/package/profile + fi + + # check the basic package hierarchy + + case $action in + export|use) + packageroot $PACKAGEROOT || { + echo "$command: $PACKAGEROOT: invalid package root directory" >&2 + exit 1 + } + case $KEEP_HOSTTYPE:$hosttype in + 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$hosttype + then KEEP_HOSTTYPE=1 + HOSTTYPE=$hosttype + else echo "$command: $hosttype: package root not found" >&2 + exit 1 + fi + ;; + esac + ;; + *) packageroot $PACKAGEROOT || { + case $KEEP_PACKAGEROOT in + 1) ;; + *) echo "$command: $PACKAGEROOT: must be in the package root directory tree" >&2 + exit 1 + ;; + esac + } + + case $action in + admin) ;; + *) for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in lib + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + ;; + esac + + # no $INITROOT means INIT already installed elsewhere + + if test -d $INITROOT + then + # update the basic package commands + + for i in execrate ignore mamprobe silent + do test -h $PACKAGEROOT/bin/$i 2>/dev/null || + case `ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null` in + "$INITROOT/$i.sh"*) + note update $PACKAGEROOT/bin/$i + shellmagic + case $SHELLMAGIC in + '') $exec cp $INITROOT/$i.sh $PACKAGEROOT/bin/$i || exit + ;; + *) case $exec in + '') { + echo "$SHELLMAGIC" + cat $INITROOT/$i.sh + } > $PACKAGEROOT/bin/$i || exit + ;; + *) echo "{ +echo \"$SHELLMAGIC\" +cat $INITROOT/$i.sh +} > $PACKAGEROOT/bin/$i" + ;; + esac + ;; + esac + $exec chmod +x $PACKAGEROOT/bin/$i || exit + ;; + esac + done + fi + ;; + esac + path=$PATH + PATH=$INSTALLROOT/bin:$PACKAGEROOT/bin:$PATH + checkcc + PATH=$path + case $cc in + ?*) if test -f $INITROOT/hello.c + then + # check if $CC (full path $cc) is a cross compiler + + ( + cd /tmp || exit 3 + cp $INITROOT/hello.c pkg$$.c || exit 3 + $cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || { + if $cc -Dnew=old -o pkg$$.exe pkg$$.c > /dev/null 2>&1 + then echo "$command: ${warn}$CC: must be a C compiler (not C++)" >&2 + else cat pkg$$.e + echo "$command: ${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" >&2 + fi + exit 2 + } + if ./pkg$$.exe >/dev/null 2>&1 + then code=0 + else code=1 + fi + rm -f pkg$$.* + exit $code + ) + code=$? + case $code in + 1) CROSS=1 ;; + esac + fi + ;; + esac + EXECTYPE=$HOSTTYPE + EXECROOT=$INSTALLROOT + case $CROSS in + 0) # dll hackery -- why is this so complicated? + + abi= + case $HOSTTYPE in + sgi.mips[0123456789]*) + x=rld + if executable /lib32/$x || executable /lib64/$x + then case $INSTALLROOT in + */sgi.mips[0123456789]*) + u=`echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,'` + ;; + *) u= + ;; + esac + for a in "n=2 v= l=" "n=3 v=N32 l=lib32" "n=4-n32 v=N32 l=lib32" "n=4 v=64 l=lib64" + do eval $a + case $v in + N32) case $n:$HOSTTYPE in + *-n32:*-n32) ;; + *-n32:*) continue ;; + *:*-n32) continue ;; + esac + ;; + esac + case $l in + ?*) if executable ! /$l/$x + then continue + fi + ;; + esac + case $u in + '') case $HOSTTYPE in + sgi.mips$n|sgi.mips$n-*) + abi="$abi 'd=$INSTALLROOT v=$v'" + ;; + *) continue + ;; + esac + ;; + *) if test -d $u$n + then abi="$abi 'd=$u$n v=$v'" + fi + ;; + esac + done + fi + ;; + esac + case $abi in + '') abi="'d=$INSTALLROOT v='" ;; + esac + p=0 + eval " + for a in $abi + do eval \$a + eval \" + case \\\$LD_LIBRARY\${v}_PATH: in + \\\$d/lib:*) + ;; + *) x=\\\$LD_LIBRARY\${v}_PATH + case \\\$x in + ''|:*) ;; + *) x=:\\\$x ;; + esac + LD_LIBRARY\${v}_PATH=\$d/lib\\\$x + export LD_LIBRARY\${v}_PATH + p=1 + ;; + esac + \" + done + " + case $LD_LIBRARY_PATH in + '') ;; + *) for d in $lib + do case $HOSTTYPE in + *64) if test -d ${d}64 + then d=${d}64 + fi + ;; + esac + case :$LD_LIBRARY_PATH: in + *:$d:*) ;; + *) if test -d $d + then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$d + p=1 + fi + ;; + esac + done + ;; + esac + case $p in + 1) $show LD_LIBRARY_PATH=$LD_LIBRARY_PATH + $show export LD_LIBRARY_PATH + export LD_LIBRARY_PATH + ;; + esac + case $LIBPATH: in + $INSTALLROOT/bin:$INSTALLROOT/lib:*) + ;; + *) case $LIBPATH in + '') LIBPATH=/usr/lib:/lib ;; + esac + LIBPATH=$INSTALLROOT/bin:$INSTALLROOT/lib:$LIBPATH + $show LIBPATH=$LIBPATH + $show export LIBPATH + export LIBPATH + ;; + esac + case $SHLIB_PATH: in + $INSTALLROOT/lib:*) + ;; + *) SHLIB_PATH=$INSTALLROOT/lib${SHLIB_PATH:+:$SHLIB_PATH} + $show SHLIB_PATH=$SHLIB_PATH + $show export SHLIB_PATH + export SHLIB_PATH + ;; + esac + case $DYLD_LIBRARY_PATH: in + $INSTALLROOT/lib:*) + ;; + *) DYLD_LIBRARY_PATH=$INSTALLROOT/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH} + $show DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH + $show export DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH + ;; + esac + case $_RLD_ROOT in + $INSTALLROOT/arch*) ;; + ':') _RLD_ROOT=$INSTALLROOT/arch:/ ;; + /|*:/) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT ;; + *) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT:/ ;; + esac + $show _RLD_ROOT=$_RLD_ROOT + $show export _RLD_ROOT + export _RLD_ROOT + + # now set up PATH + # + # NOTE: PACKAGEROOT==INSTALLROOT is possible for binary installations + + case $PATH: in + $PACKAGEROOT/bin:*) + ;; + *) PATH=$PACKAGEROOT/bin:$PATH + ;; + esac + case $PATH: in + $INSTALLROOT/bin:*) + ;; + *) PATH=$INSTALLROOT/bin:$PATH + ;; + esac + $show PATH=$PATH + $show export PATH + export PATH + ;; + *) for i in package proto nmake + do if onpath $i + then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'` + EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'` + break + fi + done + case $HOSTTYPE in + $EXECTYPE) + OCC=$CC + CC=cc + hostinfo type + EXECTYPE=$_hostinfo_ + case $HOSTTYPE in + $EXECTYPE) + echo "$command: $CC: seems to be a cross-compiler" >&2 + echo "$command: set HOSTTYPE to something other than the native $EXECTYPE" >&2 + exit 1 + ;; + esac + ;; + esac + $show EXECTYPE=$EXECTYPE + $show export EXECTYPE + export EXECTYPE + ;; + esac + $show EXECROOT=$EXECROOT + $show export EXECROOT + export EXECROOT + + # use these if possible + + OK=ok + KSH=$EXECROOT/bin/ksh + MAKE=nmake + NMAKE=$EXECROOT/bin/$MAKE + SUM=$EXECROOT/bin/sum + TEE=$EXECROOT/bin/tee + + # grab a decent default shell + + case $KEEP_SHELL in + 0) executable "$SHELL" || SHELL= + case $SHELL in + ?*) checksh $SHELL || SHELL= ;; + esac + case $SHELL in + ''|/bin/*|/usr/bin/*) + case $SHELL in + '') SHELL=/bin/sh ;; + esac + for i in ksh sh bash + do if onpath $i && checksh $_onpath_ + then SHELL=$_onpath_ + break + fi + done + ;; + */*ksh) if executable $KSH + then SHELL=$KSH + fi + ;; + esac + ;; + esac + + # $SHELL must be /bin/sh compatible + + case $SHELL in + /bin/sh);; + '') SHELL=/bin/sh + ;; + *) $SHELL -c 'trap "exit 0" 0; exit 1' 2>/dev/null + case $? in + 1) SHELL=/bin/sh + ;; + *) # catch (our own) pipe/socket configuration mismatches + $SHELL -c "date | $SHELL -c 'read x'" + case $? in + 0) ;; + *) SHELL=/bin/sh ;; + esac + ;; + esac + ;; + esac + export SHELL + $show SHELL=$SHELL + $show export SHELL + COSHELL=$SHELL + export COSHELL + $show COSHELL=$COSHELL + $show export COSHELL + + # tame the environment + + case $action in + use) ;; + *) ENV= + ERROR_OPTIONS= + export ENV ERROR_OPTIONS + ;; + esac + + # finalize the views + + case $USER_VPATH in + '') case $VPATH in + ?*) IFS=':' + set '' $VPATH + shift + IFS=$ifs + USER_VPATH= + for i + do case $i in + */arch/$HOSTTYPE) ;; + */arch/*/*) ;; + */arch/*) continue ;; + esac + if packageroot $i + then case $USER_VPATH in + '') USER_VPATH=$i ;; + ?*) USER_VPATH=$USER_VPATH:$i ;; + esac + fi + done + esac + ;; + esac + case $USER_VPATH in + ?*) IFS=':' + set '' $USER_VPATH + shift + IFS=$ifs + USER_VPATH= + USER_VPATH_CHAIN= + p=$PACKAGEROOT + for i + do case $i in + ''|$PACKAGEROOT|$INSTALLROOT) + ;; + ?*) USER_VPATH=$USER_VPATH:$i + USER_VPATH_CHAIN="$USER_VPATH_CHAIN $p $i" + p=$i + case $PROTOROOT in + -) executable $i/bin/mamake && PROTOROOT= ;; + esac + ;; + esac + done + ;; + esac + ;; +esac +PACKAGESRC=$PACKAGEROOT/lib/package +PACKAGEBIN=$INSTALLROOT/lib/package +case $action:$run in +use:-) set '' $args + shift + case $# in + 0) ;; + *) shift ;; + esac + run="$@" + ;; +esac + +# more cygwin hassles + +case $HOSTTYPE in +cygwin.*) + lose= + case $CYGWIN in + *nontsec*) + lose=ntsec + ;; + *ntsec*);; + *) exe=/tmp/pkg$$.exe + rm -f $exe + : > $exe + if test -x $exe + then lose=ntsec + fi + ;; + esac + case $CYGWIN in + *nobinmode*) + case $lose in + '') lose=binmode ;; + *) lose="$lose binmode" ;; + esac + ;; + esac + case $lose in + ?*) echo "$command: $HOSTTYPE: export '$lose' in CYGWIN or languish in windows" >&2 + exit 1 + ;; + esac + ;; +esac + +# set up the view state + +VIEW_bin=$INSTALLROOT VIEW_src=$PACKAGEROOT VIEW_all="$INSTALLROOT $PACKAGEROOT" +if (vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN) >/dev/null 2>&1 && + vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN +then $show vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN +else VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + $show export VPATH + export VPATH + IFS=':' + set '' $VPATH + shift + IFS=$ifs + for i + do case $i in + */arch/*/*) + VIEW_src="$VIEW_src $i" + ;; + */arch/*) + VIEW_bin="$VIEW_bin $i" + ;; + *) + VIEW_src="$VIEW_src $i" + ;; + esac + VIEW_all="$VIEW_all $i" + done +fi + +# return 0 if arg in src|bin|all view + +view() # [test] [-|type] [src|bin|all] file +{ + case $1 in + -[dfsx])_view_T_=$1; shift ;; + *) _view_T_=-f ;; + esac + case $1 in + -) _view_t_= ;; + *) _view_t_=$1 ;; + esac + shift + case $1 in + all) shift; _view_v_=$VIEW_all ;; + bin) shift; _view_v_=$VIEW_bin ;; + src) shift; _view_v_=$VIEW_src ;; + *) _view_v_=$VIEW_all ;; + esac + case $1 in + /*) if test $_view_T_ $1 + then _view_=$1 + return 0 + fi + ;; + *) for _view_d_ in $_view_v_ + do if test $_view_T_ $_view_d_/$1 + then _view_=$_view_d_/$1 + return 0 + fi + done + ;; + esac + _view_= + case $_view_t_ in + ?*) echo $command: $1: $_view_t_ not found >&2 ;; + esac + return 1 +} + +# determine the package and targets + +case $action in +admin) case $admin_action in + results)action=$admin_action + set '' $admin_args + shift;shift + admin_args="admin $*" + case $admin_on in + '') target=$admin_args ;; + *) target="on $admin_on $admin_args" ;; + esac + ;; + esac + ;; +release)set '' $args + target= + while : + do shift + case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + target="$target $1" + ;; + *) break + ;; + esac + done + package=$* + ;; +setup) # { update read } with optional (bin|fun|include|lib) symlinks + # flat option sets up { bin fun include lib } symlinks from + # $INSTALLROOT to $PACKAGEROOT + + # . is the package root + + set '' $args + shift + types= + url= + while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + flat) flat=1 # backwards compatibility -- documentation dropped + ;; + *://*|*.url) + url=$1 + shift + break + ;; + *) types="$types $1" + ;; + esac + shift + done + if test ! -d $PACKAGEROOT/lib/package/tgz + then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit + fi + case " $types " in + *" source "*) + case " $* " in + ' ') ;; + *" INIT "*) + ;; + *) view - all src/cmd/INIT || + set INIT "$@" + ;; + esac + ;; + esac + packages=`$0 $global authorize "$authorize" password "$password" update setup $types $url "$@" PACKAGEROOT=$PACKAGEROOT` + case $packages in + ?*) $0 $global read $packages PACKAGEROOT=$PACKAGEROOT + esac + exit + ;; +*) package= + target= + set '' $args + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + ''|-) target="$target $package" + package= + ;; + *) if view - src "lib/package/$1.pkg" + then package="$package $1" + else target="$target $package $1" + package= + fi + ;; + esac + done + ;; +esac + +# flatten -- assumes symlink support + +case $flat in +1) case $action in + make|read|setup|update|use|view) + if test ! -d $INSTALLROOT + then $exec mkdir -p $INSTALLROOT || exit + fi + for i in bin include lib fun man share + do if test ! -d $INSTALLROOT/../../$i + then $exec mkdir $INSTALLROOT/../../$i + fi + if test ! -d $INSTALLROOT/$i + then if test ! -h $INSTALLROOT/$i + then $exec ln -s ../../$i $INSTALLROOT/$i + fi + elif test ! -h $INSTALLROOT/$i + then for x in $INSTALLROOT/$i/.[a-z]* $INSTALLROOT/$i/* + do if test -f $x -o -d $x + then if test ! -d $INSTALLROOT/$i/$x || test ! -d $INSTALLROOT/../../$i/$x + then $exec mv $x $INSTALLROOT/../../$i + fi + fi + done + $exec rm -rf $INSTALLROOT/$i + $exec ln -s ../../$i $INSTALLROOT/$i + fi + done + ;; + esac + ;; +esac + +# check that cmd args are up to date a.out's + +checkaout() # cmd ... +{ + case $PROTOROOT in + -) PROTOROOT= + case $* in + ratz) if test -f $INITROOT/ratz.c -a -w $PACKAGEROOT + then test -f $INITROOT/hello.c || { + cat > $INITROOT/hello.c <<'!' +#ifndef printf +#include +#endif +int main() { int new = 0; printf("hello world\n"); return new;} +! + } + test -f $INITROOT/p.c || { + cat > $INITROOT/p.c <<'!' +/* + * small test for prototyping cc + */ + +int main(int argc, char** argv) { return argc || argv; } +! + } + fi + ;; + esac + test -f $INITROOT/hello.c -a -f $INITROOT/p.c -a -w $PACKAGEROOT || { + for i + do onpath $i || { + echo "$command: $i: command not found" >&2 + return 1 + } + done + return 0 + } + case $cc in + '') _PACKAGE_cc=0 + ;; + *) _PACKAGE_cc=1 + test -f $INITROOT/hello.c -a -f $INITROOT/p.c || { + echo "$command: $INITROOT: INIT package source not found" >&2 + return 1 + } + executable $INSTALLROOT/bin/nmake || { + # check for prototyping cc + # NOTE: proto.c must be K&R compatible + + $CC -c $INITROOT/p.c >/dev/null 2>&1 + c=$? + rm -f p.* + test 0 != "$c" && { + checkaout proto || return + PROTOROOT=$PACKAGEROOT/proto + $show PROTOROOT=$PACKAGEROOT/proto + export PROTOROOT + INITPROTO=$PROTOROOT/src/cmd/INIT + note proto convert $PACKAGEROOT/src into $PROTOROOT/src + if test -d $PACKAGEROOT/src/cmd/nmake + then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libcoshell src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" + else dirs="src" + fi + ( + if test -f $PROTOROOT/UPDATE + then newer="-newer $PROTOROOT/UPDATE" + else newer="" + fi + case $exec in + '') cd $PACKAGEROOT + find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto + ;; + *) $exec cd $PACKAGEROOT + $exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto" + ;; + esac + $exec touch $PROTOROOT/UPDATE + ) + if (vpath $INSTALLROOT - $INSTALLROOT $PROTOROOT $PROTOROOT $PACKAGEROOT) >/dev/null 2>&1 && + vpath $INSTALLROOT - $INSTALLROOT $PROTOROOT $PROTOROOT $PACKAGEROOT + then $show vpath $INSTALLROOT $PROTOROOT $PROTOROOT $PACKAGEROOT $USER_VPATH_CHAIN + else VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + export VPATH + fi + } + } + for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return + done + ;; + esac + ;; + esac + case $_PACKAGE_cc in + '') case $cc in + '') _PACKAGE_cc=0 ;; + *) _PACKAGE_cc=1 ;; + esac + ;; + esac + for i + do eval j=\$_PACKAGE_AOUT_$i + case $j in + '') eval _PACKAGE_AOUT_$i=1 ;; + *) continue ;; + esac + k=$_PACKAGE_cc + if test -f $INITROOT/$i.c + then k=${k}1 + else k=${k}0 + fi + if executable $EXECROOT/bin/$i + then k=${k}1 + else k=${k}0 + fi + : $k : compiler : source : binary : + case $k in + *00) view - bin/$i && continue ;; + esac + case $k in + 000) echo "$command: $i: not found: download the INIT package $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 010) echo "$command: $i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 100) echo "$command: $i: not found: download the INIT package source or $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 110) case $CROSS in + 1) echo "$command: $i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" >&2 + return 1 + ;; + esac + ;; + ?01) : accept binary + continue + ;; + 011) : accept binary + continue + ;; + ??1) case $CROSS in + 1) continue ;; + esac + ;; + esac + case `ls -t $INITROOT/$i.c $INSTALLROOT/bin/$i 2>/dev/null` in + "$INITROOT/$i.c"*) + note update $INSTALLROOT/bin/$i + if test proto != "$i" && executable $INSTALLROOT/bin/proto + then case $exec in + '') $INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c || return ;; + *) $exec "$INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c" ;; + esac + $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $i.c || return + $exec rm -f $i.c + else if test ! -d $INSTALLROOT/bin + then for j in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return + done + fi + if test '' != "$PROTOROOT" -a -f $INITPROTO/$i.c + then $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITPROTO/$i.c || return + else $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return + fi + case $i:$exec in + proto:) test -d $INSTALLROOT/include || mkdir $INSTALLROOT/include + $INSTALLROOT/bin/proto -f /dev/null > $i.c + cmp -s $i.c $INSTALLROOT/include/prototyped.h 2>/dev/null || cp $i.c $INSTALLROOT/include/prototyped.h + rm $i.c + ;; + esac + fi + test -f $i.o && $exec rm -f $i.o + i=$PATH + PATH=/bin + PATH=$i + ;; + esac + done + return 0 +} + +# check package requirements against received packages + +requirements() # source|binary [ package ] +{ + case $1 in + binary) r=$VIEW_BIN ;; + source) r=$VIEW_SRC ;; + *) r=$VIEW_ALL ;; + esac + shift + case $1 in + '') x= ;; + *) x=$* ;; + esac + set '' + for d in $r + do set "$@" $d/gen/*.ver + case $x in + '') set "$@" $d/gen/*.req + ;; + *) for p in $x + do set "$@" $d/gen/$p.req + done + ;; + esac + done + shift + e=0 + x=$* + y= + n= + set '' + for i in $x + do p=`echo $i | sed -e 's,.*/,,' -e 's,\....$,,'` + if test -f $i + then set "$@" $i + y="$y $p" + else case $p in + '*') ;; + *) n="$n $p" ;; + esac + fi + done + for i in $n + do case " $y " in + *" $i "*) + ;; + *) echo "$command: $i: must read or write package" >&2 + e=1 + ;; + esac + done + case $e in + 1) exit 1 ;; + esac + shift + test 0 != "$#" && release=`sort -r "$@" | { + q= + e=0 + o= + while read p v r s + do q="$q +$v $r" + case $p in + $o) continue ;; + esac + case $s in + 0) e=1 + case $r in + base) echo "$command: base package $p.$v or newer required" >&2 ;; + *) echo "$command: delta package $p.$v.$r or newer required" >&2 ;; + esac + ;; + esac + o=$p + done + case $e in + 0) echo "$q" | sort | { read v r; read v r; echo $v; } ;; + 1) echo ERROR ;; + esac + }` + case $release in + ERROR) case $force in + 0) exit 1 ;; + esac + ;; + ?*) eval `echo $release | sed -e 's,\(.*\)-\(.*\)-\(.*\),yy=\1 mm=\2 dd=\3,'` + # slide back 4 months + case $mm in + 01) mm=09 dd=1 ;; + 02) mm=10 dd=1 ;; + 03) mm=11 dd=1 ;; + 04) mm=12 dd=1 ;; + 05) mm=01 dd=0 ;; + 06) mm=02 dd=0 ;; + 07) mm=03 dd=0 ;; + 08) mm=04 dd=0 ;; + 09) mm=05 dd=0 ;; + 10) mm=06 dd=0 ;; + 11) mm=07 dd=0 ;; + 12) mm=08 dd=0 ;; + esac + case $dd in + 1) yy=`expr $yy - 1` ;; + esac + release=$yy-$mm-01 + count=1 + lo=$release + release="-f $release -r $count" + ;; + esac +} + +# write ordered package prerequisite list to the standard output + +order() # [ package ] +{ + _order_t_=lib/package/tgz + case $action in + binary) _order_a_=.$HOSTTYPE ;; + *) _order_a_= ;; + esac + _order_n_=$# + case $_order_n_ in + 0) _order_p_= + for _order_v_ in $VIEW_all + do for _order_f_ in $_order_v_/lib/package/*.pkg + do if test -f $_order_f_ + then _order_p_="$_order_p_ $_order_f_" + fi + done + done + set '' $_order_p_ + shift + esac + { + if test ratz != "$*" + then for _order_f_ in ratz INIT + do if view -s - src $_order_t_/$_order_f_$_order_a_.tim + then echo $_order_f_ $_order_f_ + fi + done + fi + for _order_f_ + do while : + do view - src $_order_f_ && break + case $_order_f_ in + *.pkg) ;; + *) _order_f_=$_order_f_.pkg; view - src $_order_f_ && break ;; + esac + case $_order_f_ in + */*) ;; + *) _order_f_=lib/package/$_order_f_; view - src $_order_f_ && break ;; + esac + echo "$command: $_order_f_: not a package" >&2 + continue 2 + done + _order_f_=$_view_ + _order_p_=`echo $_order_f_ | sed -e 's,.*/,,' -e 's,\.pkg$,,'` + case $_order_n_ in + 0) view -s - src $_order_t_/$_order_p_$_order_a_.tim || continue ;; + esac + echo $_order_p_ $_order_p_ + case $_order_p_ in + INIT|ratz) + ;; + *) echo INIT $_order_p_ + ;; + esac + { + req= req_sep= + op=:: + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :REQUIRES:) + req="$req$req_sep$1" + req_sep=" " + ;; + esac + ;; + esac + done + done + for _order_i_ in $req + do if view - src lib/package/$_order_i_.pkg + then case $_order_u_ in + 0) view -s - src $_order_t_/$_order_i_$_order_a_.tim || continue ;; + esac + echo $_order_i_ $_order_i_; echo INIT $_order_i_; echo $_order_i_ $_order_p_ + fi + done + } < $_order_f_ + done + } | tsort +} + +# generate the package component list in _components_ + +components() # [ package ] +{ + _components_= + for p + do case $p in + '') ;; + INIT) case " $_components_ " in + *" $p "*) ;; + *) _components_="$_components_ $p" ;; + esac + ;; + *) if view - src lib/package/$p.pkg + then p=$_view_ + op=:: + exec < $p + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :PACKAGE:) + case " $_components_ " in + *" $1 "*) ;; + *) _components_="$_components_ $1" ;; + esac + ;; + esac + ;; + esac + done + done + exec < /dev/null + elif test -d $PACKAGEROOT/src/cmd/$p -o -d $PACKAGEROOT/src/lib/$p + then _components_="$_components_ $p" + else echo "$command: $p: package or component not found" >&2 + exit 1 + fi + ;; + esac + done +} + +# list main environment values + +showenv() +{ + case $1 in + ''|make)for __i__ in CC SHELL $env + do eval echo $__i__='$'$__i__ + done + ;; + esac +} + +# capture command output + +capture() # file command ... +{ + case $make:$noexec in + :) case $action in + install|make|view) + o=$action + ;; + *) case $package in + ''|*' '*) + o=$action + ;; + *) o=$package + ;; + esac + ;; + esac + case $action in + write) d=$PACKAGESRC/gen ;; + *) d=$PACKAGEBIN/gen ;; + esac + test -d $d || $exec mkdir $d + o=$d/$o + case $o in + $output)o=$o.out + s= + ;; + *) output=$o + if test -f $o.old + then mv $o.old $o.out.1 + if test -f $o.out + then mv $o.out $o.out.2 + fi + elif test -f $o.out + then for i in `ls -t $o.out.? 2>/dev/null` + do break + done + case $i in + *.1) i=2 ;; + *.2) i=3 ;; + *.3) i=4 ;; + *.4) i=5 ;; + *.5) i=6 ;; + *.6) i=7 ;; + *.7) i=8 ;; + *.8) i=9 ;; + *) i=1 ;; + esac + mv $o.out $o.out.$i + fi + o=$o.out + : > $o + note $action output captured in $o + s="$command: $action start at `date` in $INSTALLROOT" + case $quiet in + 0) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT 2>&1 | \$TEE -a $o" 0 1 2 ;; + *) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT >> $o" 0 1 2 ;; + esac + ;; + esac + case $quiet in + 0) if executable ! $TEE + then TEE=tee + fi + { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null 2>&1 | $TEE -a $o + ;; + *) { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null > $o 2>&1 + ;; + esac + ;; + *) $make "$@" + ;; + esac +} + +package_install() # dest sum +{ + dest=$1 sum=$2 + ot= + code=0 + sed -e '/ /!d' -e 's,[^ ]* ,,' -e 's, \(arch/[^/]*\)/, \1 ,' -e '/ arch\//!s,^[^ ]* [^ ]* [^ ]*,& .,' -e 's,/\([^ /]*\)$, \1,' $sum | + while read mode user group arch dir file + do case $flat:$arch in + 1:*|?:.)t=$dest/$dir ;; + *) t=$dest/$arch/$dir ;; + esac + case $t in + $ot) ;; + *) if test ! -d "$t" + then $exec mkdir -p "$t" || exit + fi + ot=$t + ;; + esac + case $file in + ?*) case $arch in + .) f=$dir/$file ;; + *) f=$arch/$dir/$file ;; + esac + if test -f "$f" + then t=$t/$file + case $quiet in + 0) echo "$t" ;; + esac + $exec cp -f "$f" "$t" || code=1 + $exec chmod $mode "$t" || code=1 + fi + ;; + esac + done + return $code +} + +package_verify() # sum +{ + $exec $SUM -cp $1 +} + +make_recurse() # dir +{ + for _make_recurse_j in $makefiles + do if view - $1/$_make_recurse_j + then return + fi + done + if test -d $1 + then case $exec in + '') echo :MAKE: > $1/Makefile || exit ;; + *) $exec "echo :MAKE: > $1/Makefile" ;; + esac + fi +} + +get() # host path [ file size ] +{ + case $HURL in + '') HURL=. + for i in wget lynx curl + do if onpath $i + then HURL=$i + break; + fi + done + AUTHORIZE="User-Agent: package AT&T Research\\r\\n" + case $HURL:$authorize in + .:?*) AUTHORIZE="${AUTHORIZE}Authorization: Basic `print -n -r -- $authorize:$password | uuencode -h -x base64`\\r\\n" ;; + esac + ;; + esac + getfd=8 + case $3 in + '') case $HURL in + .) host=$1 + path=$2 + while : + do eval "exec $getfd<> /dev/tcp/$host/80" || exit + case $path in + /*) ;; + *) path=/$path ;; + esac + print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd + cat <&8 > get.tmp + got=`sed -e 1q get.tmp` + case $got in + *" "200" "*) + got=`sed -e '1,/^.$/d' -e '/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]/!d' get.tmp` + : > get.err + code=0 + break + ;; + *" "30[123]" "*) + got=`sed -e '/^Location: /!d' -e 's,^Location: \(.*\)://\([^/]*\)\(/.*\),prot='\''\1'\'' host='\''\2'\'' path='\''\3'\'',' get.tmp` + case $got in + '') rm get.tmp + echo "$command: $action: $url: redirect error" >&2 + exit 1 + ;; + esac + eval $got + ;; + *) rm get.tmp + echo "$command: $action: $url: $got" >&2 + echo '' "$got" > get.err + code=1 + break + ;; + esac + done + ;; + curl) case $authorize in + '') curl -s -L -o get.tmp http://$1/$2 2> get.err; code=$? ;; + *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` + case $code in + 0) if grep '^

Authorization Required

' get.tmp > get.err + then code=1 + fi + ;; + esac + ;; + hurl) case $authorize in + '') hurl http://$1/$2 > get.tmp 2> get.err; code=$? ;; + *) hurl -a "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` + ;; + lynx) case $authorize in + '') lynx -source http://$1/$2 > get.tmp 2> get.err; code=$? ;; + *) lynx -source -auth "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` + ;; + wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2 2> get.err + code=$? + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` + ;; + *) echo $command: $action: $HURL: url get command not found >&2 + exit 1 + ;; + esac + if test 0 != "$code" + then case `cat get.err get.tmp 2>/dev/null` in + *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) + echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 + ;; + *) cat get.err + ;; + esac + rm -f get.tmp get.err + echo $command: $action: $2: download failed >&2 + exit 1 + fi + rm -f get.tmp get.err + ;; + *) case $exec in + '') echo "$3 ($4 bytes):" >&2 + case $HURL in + .) eval "exec $getfd<> /dev/tcp/$1/80" || exit + path=$2/$3 + case $path in + /*) ;; + *) path=/$path ;; + esac + print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd + read got <&$getfd + case $got in + *" 200 "*) + code=0 + : > get.err + ;; + *) echo '' "$got" > get.err + code=1 + ;; + esac + while read got <&$getfd + do case $got in + ''|?) break ;; + esac + done + cat <&$getfd > get.tmp + ;; + curl) case $authorize in + '') curl -s -L -o get.tmp http://$1/$2/$3 2> get.err; code=$? ;; + *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2/$3 2> get.err; code=$? + esac + case $code in + 0) if grep '^

Authorization Required

' get.tmp > get.err + then code=1 + fi + ;; + esac + ;; + hurl) case $authorize in + '') ksh -x hurl http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + *) ksh -x hurl -a "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + esac + ;; + lynx) case $authorize in + '') lynx -source http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + *) lynx -source -auth "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + esac + ;; + wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2/$3 2> get.err + code=$? + ;; + *) echo $command: $action: $HURL: url get command not found >&2 + exit 1 + ;; + esac + if test 0 != "$code" + then case `cat get.err get.tmp` in + *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) + echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 + ;; + *) cat get.err + ;; + esac + rm get.tmp get.err + echo $command: $action: $3: download failed >&2 + exit 1 + fi + rm get.err + case $checksum:$5 in + :*|*:-) z=`wc -c < get.tmp` + case " $z " in + *" $4 "*) + ;; + *) rm -f get.tmp + echo $command: $3: download error: expected $4 bytes, got $z >&2 + exit 1 + ;; + esac + ;; + *) z=`$checksum < get.tmp | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` + case " $z " in + *" $5 "*) + ;; + *) rm -f get.tmp + echo $command: $3: download $checksum error: expected $5, got $z >&2 + exit 1 + ;; + esac + ;; + esac + mv get.tmp $3 || exit + ;; + *) echo "$3 ($4 bytes)" >&2 + ;; + esac + esac +} + +# generate copyright notice + +copyright() +{ + if test -f $1.lic + then echo $1 package general copyright notice + echo + proto -c'#' -p -s -l $1.lic -o type=verbose,author='*' /dev/null + return 0 + fi + case $1 in + *-*) eval `echo '' $1 | sed 's/\([^-]*\)-\(.*\)/__j__="\1" __i__="\2"/'` + if copyright $__i__ || copyright $__j__ + then return 0 + fi + ;; + esac + return 1 +} + +# run remote make on host + +remote() # host no-exec-background +{ + host=$1 + background=$2 + eval name=\$${host}_name user=\$${host}_user snarf=\$${host}_snarf type=\$${host}_type rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep log=\$${host}_log + case $keep in + 1*) ;; + *) return ;; + esac + case $host in + $main) ;; + *) case $exec in + '') exec > $admin_log/$log 2>&1 ;; + *) echo "exec > $admin_log/$log 2>&1" ;; + esac + ;; + esac + if $admin_ping $name >/dev/null 2>&1 || $admin_ping $name >/dev/null 2>&1 + then cmd=". ./.profile" + case $root in + .) root= + ;; + *) cmd="$cmd && cd $root" + root=$root/ + ;; + esac + cmd="$cmd && { test -f lib/package/admin/$admin_env && . ./lib/package/admin/$admin_env || true ;} && PATH=\${PWD:-\`pwd\`}/bin:\$PATH \${SHELL:-/bin/sh} -c 'package $admin_args PACKAGEROOT=\${PWD:-\`pwd\`} HOSTTYPE=$type VPATH='" + case $admin_binary in + '') snarf= ;; + esac + case $snarf in + '') $exec $rsh $user$name "$cmd" $background + ;; + *?) rcp=`echo $rsh | sed 's/\(.\).*/\1/'`cp + case $background in + ?*) $exec "{" ;; + esac + $exec $rsh $user$name "$cmd" + eval lst=$admin_list + case $admin_pkgs in + '') filter=cat ;; + *) filter="egrep lib/package/tgz/($admin_pkgs)\\." ;; + esac + if $exec $rcp $user$name:${root}lib/package/tgz/$lst $PACKAGESRC/tgz + then $exec $rcp `$filter $PACKAGESRC/tgz/$lst | sed "s,^,$user$name:,"` $PACKAGESRC/tgz + else echo "$command: $user$name:${root}lib/package/tgz/$lst: not found" >&2 + fi + case $background in + ?*) $exec "} $background" ;; + esac + ;; + esac + else echo "$command: $name: down" >&2 + fi +} + +# update package_src + +checksrc() +{ + case $package_src in + '') package_src=$src + for _i_ in `cd $PACKAGESRC; ls *.def *.lic *.pkg 2>/dev/null | sed 's/[-.].*//'` + do case " $package_src " in + *" $_i_ "*) + ;; + *) package_src="$package_src $_i_" + ;; + esac + done + ;; + esac +} + +# check for native ascii 0:yes 1:no + +__isascii__= + +isascii() +{ + case $__isascii__ in + '') case `echo A | od -o | sed -e 's/[ ]*$//' -e '/[ ]/!d' -e 's/.*[ ]//'` in + 005101|040412) __isascii__=0 ;; + *) __isascii__=1 ;; + esac + esac + return $__isascii__ +} + +case $action in + +admin) while test ! -f $admin_db + do case $admin_db in + /*) echo $command: $action: $admin_db: data file not found >&2 + exit 1 + ;; + esac + view file src lib/package/admin/$admin_db || exit 1 + admin_db=$_view_ + done + admin_components= + case $admin_action in + list) cat $admin_db + exit + ;; + test) set $admin_args + while : + do case $# in + 1) break ;; + esac + shift + case $1 in + *=*) ;; + *) admin_components=-$1 + break + ;; + esac + done + ;; + esac + : all work done in $PACKAGESRC/admin + cd $PACKAGESRC/admin || exit + checksrc + packages= + admin_log=${admin_action}${admin_components}.log + exec < $admin_db || exit + test -d $admin_log || $exec mkdir $admin_log || exit + case $admin_on in + '') admin_on="*" ;; + esac + hostname= + hosts= + logs= + local_hosts= + local_types= + pids= + remote_hosts= + sync_hosts= + admin_host=_admin_host_ + admin_out= + case " $admin_args " in + *" write binary "*|*" write "*" binary "*) + admin_binary=1 + ;; + *) admin_binary= + ;; + esac + case $only in + 1) admin_args="only $admin_args" ;; + esac + trap 'kill $pids >/dev/null 2>&1' 1 2 3 15 + index=0 + while read type host root date time make test write comment + do case $type in + ''|'#'*);; + *=*) eval "$type $host $root $date $time $make $test $write $comment" + ;; + *) case $admin_action in + make|test|write) + eval f='$'$admin_action + case $f in + *[!0123456789]*) continue ;; + esac + ;; + esac + rsh=rsh + case $host in + *@*) IFS=@ + set '' $host + IFS=$ifs + user=${2}@ + host=$3 + ;; + *) user= + ;; + esac + : type=$type host=$host root=$root date=$date time=$time make=$make test=$test write=$write : + name=$host + host=`echo $name | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789],__,g'` + eval x='$'${host}_index + eval ${host}_index=1 + case $x in + 1) i=0 + while : + do case $i in + $index) h='' + break + ;; + esac + i=`expr $i + 1` + eval h='$'${admin_host}${i}_name + case $h in + $host) host=${admin_host}${i} + eval user='$'${host}_user root='$'${host}_rsh:$host:'$'${host}_root + break + ;; + esac + done + ;; + esac + case $root in + *:$name:*)root=`echo '' $root | sed 's,:.*,:,'` ;; + esac + case $root in + *:*:*) index=`expr $index + 1` + host=${admin_host}$index + ;; + *:*) case " $sync_hosts " in + *" $name ${admin_host}"*) + set '' '' $sync_hosts + while : + do shift + shift + case $1 in + $name) host=$2 + break + ;; + esac + done + ;; + *) index=`expr $index + 1` + host=${admin_host}$index + sync_hosts="$sync_hosts $name $host" + ;; + esac + ;; + *) index=`expr $index + 1` + host=${admin_host}$index + ;; + esac + case $root in + -*) continue + ;; + *:*) case $admin_all in + 0) continue ;; + esac + case $root in + *:) root=${root}. ;; + esac + IFS=: + set '' $root + IFS=$ifs + sync=$host + case $hostname in + '') hostinfo name + hostname=$_hostinfo_ + ;; + esac + shift + case $# in + 0) ;; + 1) root=$1 + ;; + 2) rsh=$1 root=$2 + ;; + *) rsh=$1 sync=$2 root=$3 + case $sync in + ${admin_host}*) + ;; + ?*) case " $sync_hosts " in + *" $sync ${admin_host}"*) + set '' '' $sync_hosts + while : + do shift + shift + case $1 in + $sync) sync=$2 + break + ;; + esac + done + ;; + *) index=`expr $index + 1` + x=${admin_host}$index + sync_hosts="$sync_hosts $sync $x" + sync=$x + ;; + esac + ;; + esac + ;; + esac + ;; + *) sync= + ;; + esac + case $name in + $admin_on) + keep=1 + ;; + *) case " $admin_on " in + *" $name "*) keep=1 ;; + *) keep=0 ;; + esac + ;; + esac + case " $admin_out " in + *" $name "*) + log=$name.$type + ;; + *) admin_out="$admin_out $name" + log=$name + ;; + esac + case $sync in + '') local_types="$local_types $type" ;; + esac + case $sync in + $host) remote_hosts="$remote_hosts $host" + ;; + ?*) eval ${sync}_share=\"\$${sync}_share $host\" + ;; + '') local_hosts="$local_hosts $host" + ;; + esac + eval ${host}_name='$'name ${host}_type='$'type ${host}_user='$'user ${host}_sync='$'sync ${host}_snarf='$'sync ${host}_rsh='$'rsh ${host}_root='$'root ${host}_keep='$'keep ${host}_log='$'log + ;; + esac + done + p= + for i in $admin_args + do p="$i $p" + done + admin_pkgs= + for i in $p + do if view - src "lib/package/$i.pkg" + then case $admin_pkgs in + '') admin_pkgs="$i" ;; + *) admin_pkgs="$admin_pkgs|$i" ;; + esac + fi + done + : "admin_binary :" $admin_binary + : "admin_args :" $admin_args + : "admin_pkgs :" $admin_pkgs + : "admin_on :" "$admin_on" + : "local_hosts :" $local_hosts + : "local_types :" $local_types + : "remote_hosts :" $remote_hosts + : "sync_hosts :" $sync_hosts + : "sync_share :" $sync_share + case $admin_binary in + 1) admin_bin_types= + admin_bin_main= + for main in $local_hosts $remote_hosts + do eval share=\$${main}_share keep=\$${main}_keep + case $keep in + 0*) continue ;; + esac + for host in $main $share + do case " $admin_bin_hosts " in + *" $host "*) + continue + ;; + esac + eval type=\$${host}_type + case " $admin_bin_types " in + *" $type "*) + continue + ;; + esac + case " $types " in + " ") ;; + *" $type "*) + ;; + *) continue + ;; + esac + admin_bin_hosts="$admin_bin_hosts $host" + admin_bin_types="$admin_bin_types $type" + case " $admin_bin_hosts " in + *" $main "*) + ;; + *) case " $admin_bin_main " in + *" $main "*) + ;; + *) admin_bin_main="$admin_bin_main $main" + ;; + esac + ;; + esac + done + done + local= + remote= + for host in $admin_bin_main $admin_bin_hosts + do case " $local_hosts " in + *" $host "*) + local="$local $host" + ;; + *) case " $remote_hosts " in + *" $host "*) + remote="$remote $host" + ;; + esac + ;; + esac + done + local_hosts=$local + remote_hosts=$remote + ;; + esac + for host in $remote_hosts $local_hosts + do eval share=\$${host}_share + case $share in + ?*) while : + do oshare=$share + for s in $share + do eval r='$'${s}_share + case $r in + ?*) case " $share " in + *" $r "*) ;; + *) share="$share $r" ;; + esac + ;; + esac + done + case $share in + $oshare) eval ${host}_share="'$share'" + break + ;; + esac + done + ;; + esac + done + for host in $remote_hosts + do eval type=\$${host}_type + case " $local_types " in + *" $type "*) + eval ${host}_snarf= + ;; + esac + eval name=\$${host}_name keep=\$${host}_keep share=\$${host}_share + for share in $share + do eval type=\$${share}_type keep=\$keep\$${share}_keep + case " $local_types " in + *" $type "*) + eval ${share}_snarf= + ;; + esac + done + case $keep in + 0*1*) keep=2$keep ;; + *1*) ;; + *) keep=0 ;; + esac + eval ${host}_keep=$keep + done + for host in $remote_hosts $local_hosts + do eval name=\$${host}_name user=\$${host}_user type=\$${host}_type sync=\$${host}_sync snarf=\$${host}_snarf share=\$${host}_share rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep + case $keep in + 0*) continue ;; + esac + case $sync in + '') case $admin_action in + ditto) continue ;; + esac + case $admin_binary in + 1) case $keep in + 1*|?*1*);; + *) continue ;; + esac + ;; + esac + ;; + esac + eval main_log='$'${host}_log + main= + share_keep= + for i in $host $share + do eval n='$'${i}_name t='$'${i}_type q='$'${i}_sync s='$'${i}_snarf l='$'${i}_log k='$'${i}_keep + case $main:$k in + :*) ;; + *:0) continue ;; + esac + case $admin_binary in + 1) case $s:$q in + :?*) continue ;; + esac + case " $admin_bin_hosts " in + *" $i "*) + ;; + *) continue + ;; + esac + ;; + esac + case $main in + '') main=$i ;; + *) share_keep="$share_keep $i" ;; + esac + echo package "$admin_args" "[ $n $t ]" + case $exec in + '') : > $admin_log/$l ;; + *) $exec ": > $admin_log/$l" ;; + esac + done + host=$main + share=$share_keep + case $force in + 0) admin_ditto_update=--update ;; + *) admin_ditto_update= ;; + esac + case $exec in + '') { + case $admin_binary:$sync in + :?*) eval syncname='$'${sync}_name + test -x $PACKAGEROOT/bin/package && $admin_ditto $admin_ditto_update --remote=$rsh --expr="name=='package'" $PACKAGEROOT/bin $user$syncname:$root/bin + test -d $PACKAGESRC && $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1&&path!='LICENSES/*')status=SKIP;path=='LICENSES*|*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package + for dir in $package_src + do case $MAKESKIP in + '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; + *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; + esac + test -d $PACKAGEROOT/src/$dir && $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir + done + ;; + esac + case $admin_action in + ditto) ;; + ?*) pids= + set '' $host $share + while : + do shift + case $# in + 0) break + ;; + 1) remote $1 + ;; + *) remote $1 & + pids="$pids $!" + ;; + esac + done + case $pids in + ?*) wait $pids ;; + esac + ;; + esac + } < /dev/null > $admin_log/$main_log 2>&1 & + pids="$pids $!" + ;; + *) echo "{" + case $admin_binary:$sync in + :?*) eval syncname='$'${sync}_name + test -d $PACKAGESRC && echo $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1)status=SKIP;name=='*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package + for dir in $package_src + do case $MAKESKIP in + '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; + *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; + esac + test -d $PACKAGEROOT/src/$dir && echo $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir + done + ;; + esac + case $admin_action in + ditto) ;; + ?*) pids= + set '' $host $share + while : + do shift + case $# in + 0) break + ;; + 1) remote $1 + ;; + *) remote $1 "&" + pids=1 + ;; + esac + done + case $pids in + 1) echo wait ;; + esac + ;; + esac + echo "} < /dev/null > $admin_log/$main_log 2>&1 &" + ;; + esac + eval name='$'${main}_name + hosts="$hosts $name" + logs="$logs $main_log" + for share in $share + do eval keep=\$${share}_keep + case $keep in + 1) eval name='$'${share}_name log='$'${share}_log + hosts="$hosts $name" + logs="$logs $log" + ;; + esac + done + done + case $exec in + '') # track the progress + case $quiet in + 0) cd $admin_log + tail -t $PACKAGE_admin_tail_timeout -f $logs + cd .. + ;; + esac + # wait for the remote actions to complete + wait + trap - 1 2 3 15 + # update the db + exec < $admin_db || exit + exec 9>&1 + D=`date +%y%m%d` + while read line + do set -- $line + case $1 in + ''|'#'*|*=*) + ;; + *) case " $hosts " in + *" $2 "*) + : ast date command assumed : + E=`eval date -E \`egrep '[ ](start|done)[ ][ ]*at[ ]' $admin_log/$2 | sed -e 's/.*[ ][ ]*at[ ][ ]*//' -e 's/[ ][ ]*in[ ].*$//' -e 's/.*/"&"/'\`` + M=$6 T=$7 W=$8 + case $admin_action in + make|view) + M=`egrep -c ']:.* (\*\*\*.* code|don'\''t know) | \*\*\* termination code ' $admin_log/$2` ;; + test) T=`grep -ci 'fail[es]' $admin_log/$2` ;; + *) W=`grep '^[abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyz]*:.' $admin_log/$2 | egrep -cv 'start at|done at|output captured|warning:|: package not found|whence: command not found'` ;; + esac + case $1 in + ?|??|???|????|?????|??????|???????) + t1=' ' + ;; + ????????|?????????|??????????|???????????|????????????|?????????????|??????????????|???????????????) + t1=' ' + ;; + *) t1='' + ;; + esac + case $2 in + ?|??|???|????|?????|??????|???????) + t2=' ' + ;; + *) t2='' + ;; + esac + case $3 in + ?|??|???|????|?????|??????|???????) + t3=' ' + ;; + *) t3='' + ;; + esac + case $E in + ?????) E=" $E" ;; + ????) E=" $E" ;; + ???) E=" $E" ;; + ??) E=" $E" ;; + ?) E=" $E" ;; + esac + case $M in + ???) M="$M" ;; + ??) M=" $M" ;; + ?) M=" $M" ;; + '') M=" 0" ;; + esac + case $T in + ???) T="$T" ;; + ??) T=" $T" ;; + ?) T=" $T" ;; + '') T=" 0" ;; + esac + case $W in + ???) W="$W" ;; + ??) W=" $W" ;; + ?) W=" $W" ;; + '') W=" 0" ;; + esac + A=$1$t1 + H=$2$t2 + R=$3$t3 + case $# in + [0-8]) C= + ;; + *) shift 8 + C=" $*" + ;; + esac + echo "$A $H $R $D $E $M $T $W$C" + echo "$A $H $R $D $E $M $T $W$C" >&9 + continue + ;; + esac + ;; + esac + echo "$line" + done > $admin_db.new + mv $admin_db $admin_db.old + mv $admin_db.new $admin_db + ;; + esac + ;; + +clean|clobber) + cd $PACKAGEROOT + $exec rm -rf $INSTALLROOT + exit + ;; + +contents|list) + # all work in $PACKAGESRC + + cd $PACKAGESRC + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' *.pkg + case $2 in + '*.pkg') + echo $command: $action: no packages >&2 + exit 1 + ;; + esac + set '' `echo $* | sed 's,\.pkg,,g'` + shift + ;; + esac + sep="$nl " + echo packages in $PACKAGEROOT + case $action in + list) echo + echo "NAME${nl}VERSION${nl}RELEASE${nl}TYPE${nl}STATUS${nl}REQUIRES${nl}----${nl}-------${nl}-------${nl}----${nl}------${nl}--------" | pr -6 -a -o4 -t + ;; + esac + { + omit=: + for pkg + do if test ! -f $pkg.pkg + then echo $command: $action: $pkg: not a package >&2 + else if test -f gen/$pkg.ver + then set '' `cat gen/$pkg.ver` + case $3 in + $2) ver=base ;; + *) ver=$3 ;; + esac + if test -s tgz/$pkg.tim + then sts=local + else sts= + fi + else ver= + sts=unwritten + fi + typ= + txt= + cmp= cmp_sep= + req= req_sep= + op=:: + exec < $pkg.pkg + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :DESCRIPTION:) + txt="$txt$sep$line" + break + ;; + :PACKAGE:) + cmp="$cmp$cmp_sep$1" + cmp_sep=$nl + ;; + :REQUIRES:) + req="$req$req_sep$1" + req_sep=" " + ;; + esac + ;; + esac + done + done + exec < /dev/null + case $txt in + ?*) txt="$nl$txt" ;; + esac + case :$ver: in + *::*) ;; + *) case $action in + list) case $sts in + '') case `ls -t "tgz/$pkg.$ver.base" "tgz/$pkg.tim" 2>/dev/null` in + "tgz/$pkg.tim"*) + sts=read + ;; + *) sts=unread + ;; + esac + ;; + esac + echo "$pkg${nl}$ver${nl}base${nl}$typ${nl}$sts${nl}$req" + case $typ in + '') omit=$omit$pkg.$ver.base: ;; + esac + ;; + *) case $req in + ?*) req=": $req" ;; + esac + echo + echo $pkg $ver $req "$txt" + case $cmp in + ?*) echo "${sep}Components in this package:$nl" + echo "$cmp" | pr -4 -o4 -t ;; + esac + ;; + esac + ;; + esac + fi + done + case $argc:$action in + 0:list) if test -d tgz + then cd tgz + # f:file p:package v:version r:release t:type u:update + for f in `find . -name '*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*' -print | sed 's,^\./,,' | sort -r` + do eval `echo "$f" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` + case $t in + '') case $omit in + *:$p.$v.$r:*) continue ;; + esac + u=$p.tim + ;; + *) u=$p.$t.tim + ;; + esac + if test -s "$u" + then s=local + elif test -f "$u" + then case `ls -t "$f" "$u" 2>/dev/null` in + "$u"*) s=read ;; + *) s=unread ;; + esac + else s=unread + fi + echo "$p$nl$v$nl$r$nl$t$nl$s$nl" + done + fi + ;; + esac + } | + case $action in + list) pr -6 -a -o4 -t | sort -u ;; + *) cat ;; + esac + case $argc in + 0) if test -d $PACKAGEROOT/arch + then echo + echo architectures in $PACKAGEROOT + echo + for i in `ls $PACKAGEROOT/arch` + do if test -f $PACKAGEROOT/arch/$i/lib/package/gen/host + then h=`cat $PACKAGEROOT/arch/$i/lib/package/gen/host` + else h= + fi + echo $i + echo $h + echo + echo + done | pr -4 -a -o4 -t + fi + ;; + esac + ;; + +copyright) + # all work in $PACKAGESRC + + cd $PACKAGESRC + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' `echo *.lic | sed 's,\.lic,,g'` + shift + case $1 in + '*') echo $command: $action: no packages >&2 + exit 1 + ;; + esac + ;; + esac + checkaout proto || exit + for i + do copyright $i + done + ;; + +export) case $INSTALLROOT in + $PACKAGEROOT) + INSTALLROOT=$INSTALLROOT/arch/$HOSTTYPE + ;; + esac + case $only in + 0) v='$i=' ;; + *) v= ;; + esac + set '' $target $package + case $# in + 1) set '' $env ;; + esac + while : + do case $# in + 1) break ;; + esac + shift + i=$1 + eval echo ${v}'$'${i} + done + ;; + +install)cd $PACKAGEROOT + set '' $package + shift + case $only in + 0) set '' `order "$@"` + shift + ;; + esac + case $# in + 0) echo "$command: at least one package name expected" >&2 + exit 1 + ;; + esac + package=$* + requirements - $package + set '' $target + shift + case $1 in + flat) flat=1 # backwards compatibility -- documentation dropped + shift + ;; + esac + case $# in + 0) echo "$command: $action: target directory argument expected" >&2 + exit 1 + ;; + esac + target= + while : + do case $# in + 1) directory=$1 + break + ;; + esac + target="$target $1" + shift + done + if test ! -d $directory + then echo "$command: $action: $directory: target directory not found" >&2 + exit 1 + fi + case $target in + '') cd arch + set '' * + shift + target=$* + cd .. + ;; + esac + code=0 + makecheck=1 + for a in $target + do case $a in + -) a=$HOSTTYPE ;; + esac + case $flat:$a in + 1:*|?:.)dest=$directory + ;; + *) dest=$directory/arch/$a + if test "" = "$exec" -a ! -d $dest + then mkdir -p $dest || { + echo "$command: $dest: destination directory must exist" >&2 + exit 1 + } + fi + ;; + esac + for i in $package + do if test "ratz" = "$i" + then : skip + elif test -f arch/$a/lib/package/gen/$i.sum + then package_install $directory arch/$a/lib/package/gen/$i.sum || code=1 + elif test ! -d arch/$a/bin + then echo "$command: $a: invalid architecture" >&2 + elif test ! -d $dest + then echo "$command: $dest: destination directory must exist" >&2 + else if test "" != "$makecheck" + then if onpath $MAKE + then MAKE=$_onpath_ + else echo "$command: $MAKE: not found" >&2 + exit 1 + fi + makecheck= + fi + if test "" != "$exec" + then ( + trap - 0 1 2 15 + echo "=== $i installation manifest ===" + cd arch/$a + ( + cd lib/package + INSTALLROOT=$PACKAGEROOT/arch/$a + VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH + export INSTALLROOT VPATH + $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign + ) | sort -u + ) + else ( + set - + cd arch/$a + ( + cd lib/package + INSTALLROOT=$PACKAGEROOT/arch/$a + VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH + export INSTALLROOT VPATH + echo lib/$command + $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign + ) | sort -u | pax -drw -ps $dest + ) + fi + fi + done + done + exit $code + ;; + +license)# all work in $PACKAGESRC/LICENSES + + cd $PACKAGESRC/LICENSES || exit + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' * + shift + case $1 in + '*') echo $command: $action: no licenses >&2 + exit 1 + ;; + esac + ;; + *) checkaout proto || exit + a= + for i + do while : + do if test -f ../$i.lic + then j=`proto -df -l ../$i.lic -o query=type /dev/null 2>/dev/null` + case $j in + ?*) if test -f $j + then case " $a " in + *" $j "*) ;; + *) a="$a $j" ;; + esac + fi + break + ;; + esac + fi + case $i in + *-*) i=`echo $i | sed 's/-[^-]*$//'` + ;; + *) echo "$command: $i: package license not found" >&2 + break + ;; + esac + done + done + set '' $a + shift + ;; + esac + for i + do case $exec in + '') echo + echo " --- $i source license ---" + echo + cat $i + ;; + *) echo $PACKAGESRC/LICENSES/$i + ;; + esac + done + ;; + +make|view) + cd $PACKAGEROOT + case $package in + '') lic="lib/package/*.lic" + ;; + *) for i in $package + do lic="$lic lib/package/$i.lic" + case $i in + *-*) lic="$lic lib/package/"`echo $i | sed 's,-.*,,'`".lic" ;; + esac + done + ;; + esac + checksrc + requirements source $package + components $package + package=$_components_ + + # check for some required commands + + must="$AR" + warn="$NM yacc bison" + test="$must $warn" + have= + IFS=: + set /$IFS$PATH + IFS=$ifs + shift + for t in $test + do if executable $t + then have="$have $t" + fi + done + for d + do for t in $test + do case " $have " in + *" $t "*) + ;; + *) if executable $d/$t + then have="$have $t" + fi + ;; + esac + done + done + case " $have " in + *" bison "*) ;; + *" yacc "*) have="$have bison" ;; + esac + case " $have " in + *" yacc "*) ;; + *" bison "*) have="$have yacc" ;; + esac + for t in $test + do case " $have " in + *" $t "*) + ;; + *) case " $must " in + *" $t "*) + echo "$command: $t: not found -- must be on PATH to $action" >&2 + exit 1 + ;; + *) echo "$command: warning: $t: not found -- some $action actions may fail" >&2 + ;; + esac + ;; + esac + done + + # verify the top view + + if test ! -d $PACKAGEROOT/src + then note no source packages to make + exit 0 + elif test ! -d $INSTALLROOT/src + then note initialize the $INSTALLROOT view + fi + for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in bin bin/$OK bin/$OK/lib fun include lib lib/package lib/package/gen src man man/man1 man/man3 man/man8 + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + make_recurse src + o= k= + for i in $makefiles + do case $o in + ?*) o="$o -o" k="$k|" ;; + esac + o="$o -name $i" + k="$k$i" + done + o="( $o ) -print" + for d in $package_src + do i=src/$d + if test -d $i + then test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + make_recurse $i + for j in `cd $i; find . $o 2>/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/[^/]*$,,' | sort -u` + do case $j in + $k|$MAKESKIP) continue ;; + esac + test -d $INSTALLROOT/$i/$j || + $exec mkdir -p $INSTALLROOT/$i/$j || exit + done + fi + done + def= + for i in $lic + do test -f $i || continue + cmp -s $i $INSTALLROOT/$i 2>/dev/null || + $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i + for j in `grep '^. .*\.def$' $i` + do case $j in + .) ;; + *) case " $def " in + *" $i "*) ;; + *) def="$def $i" ;; + esac + ;; + esac + done + done + for i in $def + do i=lib/package/$i + test -f $i || continue + cmp -s $i $INSTALLROOT/$i 2>/dev/null || + $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i + done + + # check $CC and { ar cc ld ldd } intercepts + + h="${HOSTTYPE} ${HOSTTYPE}.*" + case $HOSTTYPE in + *.*) t=`echo $HOSTTYPE | sed 's/[.][^.]*//'` + h="$h $t" + ;; + *) t=$HOSTTYPE + ;; + esac + case $t in + *[0123456789]) + t=`echo $t | sed 's/[0123456789]*$//'` + h="$h $t" + ;; + esac + case $CC in + cc) c=cc + b=$INSTALLROOT/bin/$c + t=$INSTALLROOT/lib/package/gen/$c.tim + intercept=0 + for k in $h + do for s in $INITROOT/$c.$k + do test -x "$s" || continue + if cmp -s "$s" "$b" >/dev/null 2>&1 + then intercept=1 + break 2 + fi + case `ls -t "$t" "$b" "$s" 2>/dev/null` in + $t*) ;; + $b*) cc=$b + ;; + $s*) cd $INSTALLROOT/lib/package/gen + tmp=pkg$$ + eval '$'exec echo "'int main(){return 0;}' > $tmp.c" + if $exec $s -o $tmp.exe $tmp.c >/dev/null 2>&1 && + test -x $tmp.exe + then case $HOSTTYPE in + *.mips*)$s -version >/dev/null 2>&1 || s= ;; + esac + case $s in + ?*) $exec sed "s/^HOSTTYPE=.*/HOSTTYPE=$HOSTTYPE/" < "$s" > "$b" || exit + $exec chmod +x "$b" || exit + cc=$b + intercept=1 + note update $b + ;; + esac + fi + $exec rm -f $tmp.* + $exec touch "$t" + cd $PACKAGEROOT + ;; + esac + break 2 + done + done + case $intercept in + 1) c=ld + b=$INSTALLROOT/bin/$c + for k in $h + do for s in $INITROOT/$c.$k + do test -x "$s" || continue + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done + done + ;; + esac + ;; + esac + c=ldd + b=$INSTALLROOT/bin/$c + for t in $h + do s=$INITROOT/$c.$t + test -x "$s" || continue + onpath $c || + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done +# following code stubbed out just in case ar.ibm.risc is needed +# c=ar +# b=$INSTALLROOT/bin/$c +# for t in $h +# do s=$INITROOT/$c.$t +# test -x "$s" || continue +# onpath $c || +# case `ls -t "$b" "$s" 2>/dev/null` in +# $b*) ;; +# $s*) x=`$s -tv /foo/bar.a 2>&1 | egrep -i 'option|usage'` +# case $x in +# '') $exec cp "$s" "$b" +# note update $b +# ;; +# esac +# ;; +# esac +# done + case $cc in + /*) ;; + *) echo "$command: $CC: not found -- set CC=C-compiler" >&2 + exit 1 + ;; + esac + case $exec in + '') cd $INSTALLROOT/lib/package/gen + tmp=pkg$$ + echo 'int main(){return 0;}' > $tmp.c + if $CC -o $tmp.exe $tmp.c > /dev/null 2> $tmp.err && + test -x $tmp.exe + then : ok + else echo "$command: $CC: failed to compile this program:" >&2 + cat $tmp.c >&2 + if test -s $tmp.err + then cat $tmp.err >&2 + else echo "$command: $CC: not a C compiler" >&2 + fi + rm -f $tmp.* + exit 1 + fi + rm -f $tmp.* + cd $PACKAGEROOT + ;; + esac + + # remember the default $CC + + case $CC in + cc) ;; + *) if test -x $INSTALLROOT/bin/cc + then case `sed 1q $INSTALLROOT/bin/cc` in + ": $CC :") + CC=cc + export CC + ;; + *) assign="$assign CC=\"\$CC\"" + ;; + esac + else case $CROSS in + 1) assign="$assign CC=\"\$CC\"" + ;; + *) case $exec in + '') { + echo ": $CC :" + echo "$CC \"\$@\"" + } > $INSTALLROOT/bin/cc + chmod +x $INSTALLROOT/bin/cc + ;; + *) note generate a $INSTALLROOT/bin/cc wrapper for $CC + ;; + esac + CC=cc + export CC + ;; + esac + fi + ;; + esac + + # no $INITROOT means INIT already installed elsewhere + + if test -d $INITROOT + then + # update probe scripts + + for i in lib/probe lib/probe/C lib/probe/C/make + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + i=$INSTALLROOT/lib/probe/C/make/probe + j=$INITROOT/C+probe + k=$INITROOT/make.probe + case `ls -t $i $j $k 2>/dev/null` in + $i*) ;; + *) if test -f $j -a -f $k + then note update $i + shellmagic + case $exec in + '') { + case $SHELLMAGIC in + ?*) echo "$SHELLMAGIC" ;; + esac + cat $j $k + } > $i || exit + ;; + *) echo "{ +echo $SHELLMAGIC +cat $j $k +} > $i" + ;; + esac + $exec chmod +x $i || exit + fi + ;; + esac + fi + + # initialize a few mamake related commands + + checkaout mamake proto ratz release || exit + + # execrate if necessary + + if (execrate) >/dev/null 2>&1 + then execrate=execrate + $make cd $INSTALLROOT/bin + for i in chmod chgrp cmp cp ln mv rm + do if test ! -x $OK/$i -a -x /bin/$i.exe + then shellmagic + case $exec in + '') echo "$SHELLMAGIC"'execrate /bin/'$i' "$@"' > $OK/$i + chmod +x $OK/$i + ;; + *) $exec echo \'"$SHELLMAGIC"'execrate /bin/'$i' "$@"'\'' >' $OK/$i + $exec chmod +x $OK/$i + ;; + esac + fi + done + PATH=$INSTALLROOT/bin/$OK:$PATH + export PATH + else execrate= + fi + case $action in + view) exit 0 ;; + esac + + # all work under $INSTALLROOT/src + + $make cd $INSTALLROOT/src + + # record the build host name + + case $noexec in + '') hostinfo name + echo "$_hostinfo_" | sed 's,\..*,,' > $PACKAGEBIN/gen/host + ;; + esac + + # make in parallel if possible + + case $NPROC in + '') hostinfo cpu + case $_hostinfo_ in + 0|1) ;; + *) NPROC=$_hostinfo_ + $show NPROC=$NPROC + $show export NPROC + export NPROC + ;; + esac + ;; + esac + + # separate flags from target list + + case $target in + *-*) a= + for t in $target + do case $t in + -[eiknFKNV]*|--*-symbols) + makeflags="$makeflags $t" + ;; + -*) nmakeflags="$nmakeflags $t" + ;; + *) a="$a $t" + ;; + esac + done + target=$a + ;; + esac + + # generate nmake first if possible + + if executable ! $NMAKE && test -d $PACKAGEROOT/src/cmd/nmake + then if nonmake $MAKE + then note make $NMAKE with mamake + c=$CC + a=$assign + case $HOSTTYPE in + win32*|cygwin*) + CC="$CC -D_BLD_STATIC" + accept="libast" + case $assign in + *' CC='*) ;; + *) assign="$assign CC=\"\$CC\"" ;; + esac + ;; + *) accept=nmake + ;; + esac + eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign + assign=$a + CC=$c + case $make$noexec in + '') if executable ! $NMAKE + then echo "$command: $action: errors making $NMAKE" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + if test '' != "$PROTOROOT" + then if (vpath $INSTALLROOT - $PROTOROOT - $INSTALLROOT $PACKAGEROOT) >/dev/null 2>&1 && + vpath $INSTALLROOT - $PROTOROOT - $INSTALLROOT $PACKAGEROOT + then $show vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN + else VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + export VPATH + fi + fi + note believe generated files for $accept + eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign + $exec touch $INSTALLROOT/bin/.paths + note make the remaining targets with $NMAKE + else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign + case $make$noexec in + '') if executable ! $NMAKE + then echo "$command: $action: errors making $NMAKE" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + fi + fi + + # generate ksh next if possible + + if nonmake $MAKE + then : no need to generate ksh next -- it could be the only package + elif test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH + then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign + case $make$noexec in + '') if executable ! $KSH + then echo "$command: $action: errors making $KSH" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + fi + + # mamprobe data should have been generated by this point + + case $exec in + '') if test ! -f $INSTALLROOT/bin/.paths -o -w $INSTALLROOT/bin/.paths + then nl=" +" + o=`cat $INSTALLROOT/bin/.paths 2>/dev/null` + v= + n= + case $nl$o in + *${nl}FPATH=*|*#FPATH=*|*[Nn][Oo]FPATH=*) + ;; + *) case $n in + '') ;; + *) n="$n$nl" v="$v|" ;; + esac + n="${n}FPATH=../fun" + v="${v}FPATH" + ;; + esac + case $nl$o in + *${nl}BUILTIN_LIB=*|*#BUILTIN_LIB=*|*[Nn][Oo]BUILTIN_LIB=*) + ;; + *) case $n in + '') ;; + *) n="$n$nl" v="$v|" ;; + esac + if grep '^setv mam_cc_DIALECT .* EXPORT=[AD]LL' $INSTALLROOT/lib/probe/C/mam/* >/dev/null 2>&1 + then x= + else x='no' + fi + n="${n}${x}BUILTIN_LIB=cmd" + v="${v}BUILTIN_LIB" + ;; + esac + case $n in + ?*) case $o in + ?*) o=`egrep -v "($v)=" $INSTALLROOT/bin/.paths`$nl ;; + esac + echo "# use { # no NO } prefix instead of XX to permanently disable #$nl$o$n" > $INSTALLROOT/bin/.paths + ;; + esac + fi + ;; + esac + + # run from separate copies since nmake and ksh may be rebuilt + + case $EXECROOT in + $INSTALLROOT) + $make cd $INSTALLROOT/bin + if executable /bin/cp + then cp=/bin/cp + else cp=cp + fi + if executable /bin/mv + then mv=/bin/mv + else mv=mv + fi + if executable /bin/rm + then rm=/bin/rm + else rm=rm + fi + for i in \ + ksh nmake tee cp ln mv rm \ + *ast*.dll *cmd*.dll *dll*.dll *shell*.dll + do executable $i && { + cmp -s $i $OK/$i 2>/dev/null || { + test -f $OK/$i && + $exec $execrate $rm $OK/$i &2 + exit 1 + ;; + esac + $exec $execrate $cp $i $OK/$i + } + } + done + if test -f ../lib/make/makerules.mo + then cmp -s ../lib/make/makerules.mo $OK/lib/makerules.mo || + $exec $execrate $cp -p ../lib/make/makerules.mo $OK/lib/makerules.mo || + $exec $execrate $cp ../lib/make/makerules.mo $OK/lib/makerules.mo + fi + if executable $OK/nmake + then MAKE="$INSTALLROOT/bin/$OK/nmake LOCALRULESPATH=$INSTALLROOT/bin/$OK/lib" + fi + if executable $OK/tee + then TEE=$INSTALLROOT/bin/$OK/tee + fi + if test "$KEEP_SHELL" != 1 && executable $OK/ksh + then SHELL=$INSTALLROOT/bin/$OK/ksh + export SHELL + COSHELL=$SHELL + export COSHELL + fi + case :$PATH: in + *:$INSTALLROOT/bin/$OK:*) + ;; + *) PATH=$INSTALLROOT/bin/$OK:$PATH + export PATH + ;; + esac + $make cd $INSTALLROOT/src + ;; + esac + + # fall back to mamake if nmake not found or too old + + if nonmake $MAKE + then note make with mamake + case $target in + '') target="install" ;; + esac + eval capture mamake \$makeflags \$noexec \$target $assign + else case $target in + '') target="install cc-" ;; + esac + eval capture \$MAKE \$makeflags \$nmakeflags \$noexec recurse \$target \$nmakesep \$package $assign + fi + ;; + +read) case ${PWD:-`pwd`} in + $PACKAGEROOT) + ;; + *) echo "$command: must be in package root directory" >&2 + exit 1 + ;; + esac + PAX= + if onpath pax + then case `$_onpath_ -rw --?meter 2>&1` in + *--meter*) PAX=pax ;; + esac + fi + code=0 + i= + x= + remove= + touch= + set '' $target + case $2 in + lcl|tgz)tgz=$2 + shift 2 + target=$* + ;; + *) tgz=tgz + ;; + esac + set '' $package $target + case $# in + 1) verbose=: + set '' `ls lib/package/$tgz/*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + ;; + *) verbose= + ;; + esac + shift + files= + for f + do if test -f "$f" + then : ok + elif test -f "lib/package/$tgz/$f" + then f=lib/package/$tgz/$f + else set '' `ls -r ${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + if test '' != "$2" -a -f "$2" + then f=$2 + else set '' `ls -r lib/package/$tgz/${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + if test '' != "$2" -a -f "$2" + then f=$2 + else echo "$command: $f: package archive not found" >&2 + continue + fi + fi + fi + files="$files $f" + done + case $files in + '') echo "$command: lib/package/$tgz: no package archives" >&2 + exit 1 + ;; + esac + set '' `ls -r $files 2>/dev/null` + shift + f1= f2= f3= f4= + for f + do case $f in + ratz.*|*/ratz.*) + f1="$f1 $f" + ;; + INIT.*|*/INIT.*) + f2="$f2 $f" + ;; + INIT*|*/INIT*) + f3="$f3 $f" + ;; + *) f4="$f4 $f" + ;; + esac + done + gen= + set '' $f1 $f2 $f3 $f4 + while : + do shift + case $# in + 0) break ;; + esac + f=$1 + case $f in + *.gz) : standalone packages unbundled manually + continue + ;; + *.md5) : tarball checksum + continue + ;; + *?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*) + ;; + *) echo "$command: $f: not a package archive" >&2 + code=1 + continue + ;; + esac + case $f in + */*) eval `echo "$f" | sed -e 's,\(.*/\)\(.*\),d=\1 a=\2,'` ;; + *) d= a=$f ;; + esac + # f:file d:dir a:base p:package v:version r:release t:type + eval `echo "$a" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` + case $r in + base) y=$p.base ;; + *) y=$p.delta ;; + esac + case " $x " in + *" $y "*) + continue + ;; + esac + case $t in + '') w=$PACKAGESRC + q= + Q= + m= + ;; + *) w=$PACKAGEROOT/arch/$t/lib/package + q=".$t" + Q="_$t" + m="[_.]$t" + ;; + esac + u=$d$p$q.tim + if test -s "$u" + then continue + else case $force in + 0) case `ls -t "$f" "$u" 2>/dev/null` in + "$u"*) case $verbose in + 1) note $p already read ;; + esac + continue + ;; + esac + ;; + esac + fi + case $p in + INIT) if test -f $PACKAGEROOT/bin/package + then $exec mv $PACKAGEROOT/bin/package $PACKAGEROOT/bin/package.old + fi + ;; + esac + z= + case $r in + base) # base archive + if test ratz = "$p" + then # ratz packages are not archives + case $t in + '') for i in src src/cmd src/cmd/INIT + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + $exec cp $f $PACKAGEROOT/src/cmd/INIT/$p.c + ;; + *) for i in arch arch/$t arch/$t/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + $exec cp $f $PACKAGEROOT/arch/$t/bin/$p && + $exec chmod +x $PACKAGEROOT/arch/$t/bin/$p + ;; + esac + elif test "" != "$PAX" + then $exec pax -L --from=ascii --local -m -ps -rvf "$f" || { + code=1 + continue + } + else if onpath gunzip && onpath $TAR && isascii + then case $TARPROBE in + ?*) for i in $TARPROBE + do if $TAR ${i}f - /dev/null > /dev/null 2>&1 + then TARFLAGS=$TARFLAGS$i + fi + done + TARPROBE= + ;; + esac + if gunzip -l < "$f" > /dev/null 2>&1 + then case $exec in + '') $exec gunzip < "$f" | $TAR ${TARFLAGS}f - ;; + *) $exec "gunzip < $f | $TAR ${TARFLAGS}f -" ;; + esac || { + code=1 + continue + } + else $exec $TAR ${TARFLAGS}f "$f" || { + code=1 + continue + } + fi + else checkaout ratz && onpath ratz || { + code=1 + continue + } + RATZ=$_onpath_ + case $exec in + '') echo $f: + $exec $RATZ -lm < "$f" + ;; + *) $exec "$RATZ -lm < $f" + ;; + esac || { + code=1 + continue + } + fi + if test -f $PACKAGEBIN/gen/$p.sum + then while read md5 mode usr grp file + do case $file in + -*) file=./$file ;; + esac + case $mode in + [01234567][01234567][01234567][01234567]) + case $grp in + -) ;; + *) $exec chgrp $grp "$file" ;; + esac + case $usr in + -) ;; + *) $exec chown $usr "$file" ;; + esac + $exec chmod $mode "$file" + ;; + esac + done < $PACKAGEBIN/gen/$p.sum + fi + fi + ;; + *) # delta archive + test "" != "$PAX" || { + echo "$command: $f: pax required to read delta archive" >&2 + code=1 + continue + } + case `echo "$v: +$r:" | sort` in + $r:*) y=$p.base + b=${d}${p}_${r}${Q}.tgz + test -f "$b" || b=${d}${p}.${r}${q}.tgz + test -f "$b" || { + case " $gen " in + *" $b "*) + ;; + *) case $# in + 1) echo "$command: $f: base archive $b required to read delta" >&2 + code=1 + ;; + *) shift + y=$1 + shift + set '' $y $f "$@" + esac + continue + ;; + esac + } + # -m with delta bug fixed 2005-02-08 + $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { + code=1 + continue + } + note $f: generate new base $d$p.$v$q.tgz + $exec pax -rf "$f" -z "$b" -wf $d$p.$v$q.tgz -x tgz || { + code=1 + continue + } + case $exec in + '') echo $p $v $v 1 > $w/gen/$p.ver + ;; + *) z=$d${p}[_.]$v$q.tgz + $exec "echo $p $v $v 1 > $w/gen/$p.ver" + gen="$gen $d$p.$v$q.tgz" + ;; + esac + case " $remove " in + *" $f "*) ;; + *) remove="$remove $f" ;; + esac + ;; + *) b=${d}${p}_${v}${Q}.tgz + test -f "$b" || b=${d}${p}.${v}${q}.tgz + test -f "$b" || { + case " $gen " in + *" $b "*) + ;; + *) case $# in + 1) echo "$command: $f: base archive $b required to read delta" >&2 + code=1 + ;; + *) shift + y=$1 + shift + set '' $y $f "$@" + esac + continue + ;; + esac + } + # -m with delta bug fixed 2005-02-08 + $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { + code=1 + continue + } + ;; + esac + ;; + *) echo "$command: $f: unknown archive type" >&2 + code=1 + continue + ;; + esac + + # check for ini files + + if executable $w/$p.ini + then $exec $w/$p.ini read || { + code=1 + continue + } + fi + + # add to the obsolete list + + k= + for i in `ls $d$p[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]????$m* $z 2>/dev/null` + do case $i in + *.md5) continue + ;; + $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) + ;; + $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) + continue + ;; + esac + case $k in + ?*) case " $remove " in + *" $k "*) ;; + *) remove="$remove $k" ;; + esac + ;; + esac + k=$i + done + x="$x $y" + case " $touch " in + *" $u "*) ;; + *) touch="$touch $u" ;; + esac + done + if test ! -f $PACKAGEROOT/bin/package -a -f $PACKAGEROOT/bin/package.old + then $exec cp $PACKAGEROOT/bin/package.old $PACKAGEROOT/bin/package + fi + + # drop obsolete archives + + case $remove in + ?*) $exec rm -f $remove ;; + esac + + # mark the updated archives + + case $touch in + ?*) sleep 1; $exec touch $touch ;; + esac + + # check the requirements + + case $code$exec in + 0) requirements - $x ;; + esac + exit $code + ;; + +regress)if test ! -d $PACKAGEBIN/gen + then echo "$command: 'package make' and 'package test' required for regression" >&2 + exit 1 + fi + dir=$PACKAGEBIN/gen + cd $dir + for s in out old + do case `ls -t regress.$s test.$s 2>/dev/null` in + regress*) + ;; + test*) if test -f regress.$s + then $exec mv regress.$s regress.old + fi + case $exec in + '') egrep -i '\*\*\*|FAIL|^TEST.* [123456789][0123456789]* error|core.*dump' test.$s | + sed -e '/\*\*\* [0123456789]/d' \ + -e '/^TEST.\//s,/[^ ]*/,,' \ + -e 's,[ ][ ]*$,,' \ + -e 's/[0123456789][0123456789]*:* \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*[Cc][Oo][Rr][Ee][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*)\)/\1/' \ + -e 's/\.sh failed at .* with /.sh failed /' \ + > regress.$s + ;; + *) $exec filter test failures from $dir/test.$s to $dir/regress.$s + ;; + esac + ;; + esac + done + if test -f regress.out -a -f regress.old + then $exec diff -b regress.out regress.old + else echo "$command: at least 2 test runs required for regression" >&2 + exit 1 + fi + ;; + +release)count= lo= hi= + checksrc + checkaout release || exit + requirements source $package + components $package + package=$_components_ + set '' $target + shift + case $# in + 0) ;; + *) case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + case $1 in + -) lo= release= ;; + *) lo=$1 release="-f $1" ;; + esac + shift + case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + case $1 in + -) hi= ;; + *) hi=$1 release="$release -t $1" ;; + esac + shift + ;; + esac + ;; + [0123456789]|[0123456789][0123456789]|[0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789][0123456789]*) + count=$1 + release="-r $count" + shift + ;; + esac + ;; + esac + case $# in + 0) case $package in + '') package=* ;; + esac + ;; + *) case $package in + '') package=$* + ;; + *) echo $command: $*: lo-date hi-date arguments expected >&2 + exit 1 + ;; + esac + ;; + esac + echo + case $count:$lo:$hi in + ::) echo "All recorded changes follow." ;; + 1::) echo "Changes since the last release follow." ;; + ?*::) echo "Changes since the last $count releases follow." ;; + 1:?*:) echo "Changes since $lo or the last release follow." ;; + *:?*:*) echo "Changes since $lo follow." ;; + *::?*) echo "Changes before $hi follow." ;; + *) echo "Changes between $lo and $hi follow." ;; + esac + x= + for r in $INSTALLROOT $PACKAGEROOT + do for s in $package_src + do d=$r/src/$s + if test -d $d + then cd $d + for i in $package + do if test -h $i 2>/dev/null + then continue + fi + case " $x " in + *" $i "*) continue ;; + esac + for f in RELEASE CHANGES ChangeLog + do if test -f $i/$f + then $exec release $release $i/$f + x="$x $i" + for f in $i/*/$f + do if test -f $f + then $exec release $release $f + fi + done + break + fi + done + done + fi + done + done + ;; + +remove) echo "$command: $action: not implemented yet" >&2 + exit 1 + ;; + +results)set '' $target + shift + def=make + dir=$PACKAGEBIN/gen + case $verbose in + 0) filter=yes ;; + *) filter=cat ;; + esac + path=0 + suf=out + on= + while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + admin) dir=$PACKAGESRC/admin + ;; + error*|fail*) + filter=errors + ;; + make|test|view|write) + def=$1 + case $filter:$1:$SHELL in + errors:*:*) ;; + *:test:*/ksh*) filter=rt ;; + esac + ;; + old) suf=old + ;; + on) case $# in + 1) echo $command: $action: $1: host pattern argument expected >&2 + exit 1 + ;; + esac + shift + case $on in + ?*) on="$on|" ;; + esac + on="$on$1" + ;; + path) path=1 + ;; + test) def=test + filter=rt + ;; + *) break + ;; + esac + shift + done + case $dir in + */admin)case $on in + '') on="*" ;; + *) on="@($on)" ;; + esac + def=$def.log/$on + ;; + esac + case $# in + 0) set "$def" ;; + esac + m= + t= + for i + do k=0 + eval set '""' $i - $i.$suf - $dir/$i - $dir/$i.$suf - + shift + for j + do case $j in + -) case $k in + 1) continue 2 ;; + esac + ;; + *) if test -f $j + then k=1 + case /$j in + */test.*) t="$t $j" ;; + *) m="$m $j" ;; + esac + fi + ;; + esac + done + echo "$command: $i action output not found" >&2 + exit 1 + done + sep= + case $t in + ?*) case $path in + 0) for j in $t + do echo "$sep==> $j <==" + sep=$nl + case $filter in + cat) $exec cat $j + ;; + errors) $exec egrep -i '\*\*\*|FAIL[ES]|^TEST.* [123456789][0123456789]* error|core.*dump' $j | sed -e '/^TEST.\//s,/[^ ]*/,,' + ;; + rt) $exec rt - $j + ;; + *) $exec egrep -i '^TEST|FAIL' $j + ;; + esac + done + ;; + 1) echo $t + ;; + esac + ;; + esac + case $m in + ?*) case $path in + 0) case $filter in + cat) cat $m + ;; + *) if test -f $HOME/.pkgresults + then i="`cat $HOME/.pkgresults`" + case $i in + '|'*) ;; + *) i="|$i" ;; + esac + else i= + fi + for j in $m + do echo "$sep==> $j <==" + sep=$nl + case $filter in + errors) $exeg egrep '^pax:|\*\*\*' $j + ;; + *) $exec egrep -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|pragma.*prototyped|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | + $exec grep : + ;; + esac + done + ;; + esac + ;; + 1) echo $m + ;; + esac + esac + ;; + +test) requirements source $package + components $package + package=$_components_ + case $only in + 0) only= ;; + 1) only=--recurse=only ;; + esac + + # must have nmake + + if nonmake $MAKE + then echo $command: $action: must have $MAKE to test >&2 + exit 1 + fi + + # all work under $INSTALLROOT/src + + $make cd $INSTALLROOT/src + + # disable core dumps (could be disasterous over nfs) + + (ulimit -c 0) > /dev/null 2>&1 && ulimit -c 0 + + # do the tests + + eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign + ;; + +update) # download the latest release.version for selected packages + + # all work in $PACKAGEROOT/lib/package/tgz + + if test ! -d $PACKAGEROOT/lib/package/tgz + then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit + $exec cd $PACKAGEROOT/lib/package/tgz + else cd $PACKAGEROOT/lib/package/tgz + fi + + # get the architectures, update query url, and packages + + set '' $args + op=update + tgz=tgz + source= + binary= + setup= + types= + url= + urlfile=$default_url + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + beta) op=beta + tgz=beta + ;; + binary) binary=1 + ;; + setup) setup=1 + ;; + source) source=1 + ;; + *://*) url=$1 + shift + break + ;; + *.url) urlfile=$1 + if test ! -s $urlfile + then echo $command: $urlfile: not found >&2; exit 1 + fi + break + ;; + $all_types) + binary=1 + types="$types $1" + ;; + *) break + ;; + esac + done + case $source:$binary in + :) source=1 binary=1 + ;; + :1) case $types in + '') types=$HOSTTYPE ;; + esac + ;; + esac + case $url in + '') case $urlfile in + $default_url) + if test ! -s $urlfile + then echo $command: url argument expected >&2; exit 1 + fi + ;; + *) default_url= + ;; + esac + url= + if grep '^url=' $urlfile >/dev/null + then a=$authorize + p=$password + case $urlfile in + */*) ;; + *) urlfile=./$urlfile ;; + esac + . $urlfile + case $a:$p in + $authorize:$password) + default_url= + ;; + *) case $a in + ?*) authorize=$a ;; + esac + case $p in + ?*) password=$p ;; + esac + ;; + esac + else url=`cat $urlfile` + fi + ;; + esac + case $exec in + ?*) default_url= ;; + esac + + # get the update list + + eval `echo $url | sed 's,\(.*\)://\([^/]*\)/\(.*\),prot=\"\1\" host=\"\2\" dir=\"\3\",'` + get $host $dir/$op.html + + # get/check the package names + + case " $* " in + *" - "*)case $source in + 1) source_packages=$* ;; + *) source_packages= ;; + esac + case $binary in + 1) binary_packages=$* ;; + *) binary_packages= ;; + esac + package_hit=$* + ;; + " ") nl=" +" + case $source in + 1) p= + for f in `ls *.????-??-??.* 2>/dev/null` + do case $f in + *.????-??-??.????-??-??.*.*) + ;; + *.????-??-??.????-??-??.*) + p=$p$nl$f + ;; + *.????-??-??.*.*) + ;; + *.????-??-??.*) + p=$p$nl$f + ;; + esac + done + set '' `echo "$p" | sed 's,\..*,,' | sort -u` + shift + source_packages=$* + ;; + *) source_packages= + ;; + esac + case $binary in + 1) p= + for f in `ls *.????-??-??.* 2>/dev/null` + do case $f in + *.????-??-??.????-??-??.*.*) + p=$p$nl$f + ;; + *.????-??-??.????-??-??.*) + ;; + *.????-??-??.*.*) + p=$p$nl$f + ;; + *.????-??-??.*) + ;; + esac + done + set '' `echo "$p" | sed 's,\..*,,' | sort -u` + shift + binary_packages=$* + ;; + *) binary_packages= + ;; + esac + package_hit="$source_packages $binary_packages" + ;; + *) case $source in + 1) source_packages=$* ;; + *) source_packages= ;; + esac + case $binary in + 1) binary_packages=$* ;; + *) binary_packages= ;; + esac + package_hit= + ;; + esac + + # get the latest updates + + types_test= + types_local= + dir=$dir/$tgz + case $default_url in + ?*) echo "url='$url' authorize='$authorize' password='$password'" > $default_url + case $authorize in + ?*) chmod go-rwx $default_url ;; + esac + ;; + esac + echo "$got" > got.tmp + case $only in + 0) exec < got.tmp + covered= + while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment + do case $requires in + ''|-*) continue ;; + esac + IFS=: + set '' $requires + IFS=$ifs + case $type in + -) case " $source_packages " in + *" $name "*|*" - "*) + for name + do case " $source_packages " in + *" $name "*) + ;; + *) source_packages="$source_packages $name" + covered=$covered:$covers + ;; + esac + done + ;; + esac + ;; + *) case " $binary_packages " in + *" $name "*|*" - "*) + for name + do case " $binary_packages " in + *" $name "*) + ;; + *) binary_packages="$binary_packages $name" + covered=$covered:$covers + ;; + esac + done + ;; + esac + ;; + esac + done + case $covered in + ?*) x=$source_packages + source_packages= + for name in $x + do case :$covered: in + *:$name:*) ;; + *) source_packages="$source_packages $name" ;; + esac + done + x=$binary_packages + binary_packages= + for name in $x + do case :$covered: in + *:$name:*) ;; + *) binary_packages="$binary_packages $name" ;; + esac + done + ;; + esac + ;; + esac + checksum= + for i in $checksum_commands + do case `( $i ) < /dev/null 2> /dev/null` in + ${checksum_empty}|${checksum_empty}[\ \ ]*) + checksum=$i + break + ;; + esac + done + case $checksum in + '') echo $command: warning: '{' $checksum_commands '}' command not found -- only download sizes will be checked >&2 ;; + esac + exec < got.tmp + while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment + do case $verbose in + 1) case $type in + -) i= ;; + *) i=.$type ;; + esac + j="$name.$base$i.$suffix" + case $delta in + -) j="$j -" ;; + *) j="$j $name.$base.$delta$i.$suffix" ;; + esac + case $sync in + -) j="$j -" ;; + *) j="$j $name.$base.$sync$i.$suffix" ;; + esac + echo $command: $j $base_size:$base_sum $delta_size:$delta_sum $sync_size:$sync_sum $requires >&2 + esac + case " $package_hit " in + *" $name "*|*" - "*) + ;; + *) package_hit="$package_hit $name" + ;; + esac + case $type in + -) case " $source_packages " in + *" $name "*|*" - "*) + if test -s $name.tim + then continue + fi + lcl=$name.$base.$suffix + if test -f $lcl + then case $checksum:$base_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" + then rmt= + case $sync:$sync_size in + -*|*[-:]) + ;; + *) lcl=$name.$base.$sync.$suffix + if test -f $lcl + then rmt=1 + get $host $dir $lcl $sync_size $sync_sum + fi + ;; + esac + case $base:$base_size in + -*|*[-:]) + ;; + *) case $rmt in + '') lcl=$name.$base.$suffix + get $host $dir $lcl $base_size $base_sum + ;; + esac + ;; + esac + fi + case $delta:$delta_size in + -*|*[-:]) + ;; + *) lcl=$name.$delta.$base.$suffix + if test -f $lcl + then case $checksum:$delta_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" + then get $host $dir $lcl $delta_size $delta_sum + fi + ;; + esac + ;; + esac + ;; + *) case " $binary_packages " in + *" $name "*|*" - "*) + if test -s $name.$type.tim + then continue + fi + case " $types " in + *" - "*);; + " ") case " $types_test " in + *" $type "*) + ;; + *) types_test="$types_test $type" + for i in *.????-??-??.$type.* *.????-??-??.????-??-??.$type.* + do if test -f $i + then types_local="$types_local $type" + fi + break + done + ;; + esac + case " $types_local " in + *" $type "*) + ;; + *) continue + ;; + esac + ;; + *) case " $types " in + *" $type "*) + ;; + *) continue + ;; + esac + ;; + esac + lcl=$name.$base.$type.$suffix + if test -f $lcl + then case $checksum:$base_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" + then rmt= + case $sync:$sync_size in + -*|*[-:]) + ;; + *) lcl=$name.$base.$sync.$type.$suffix + if test -f $lcl + then rmt=1 + get $host $dir $lcl $sync_size $sync_sum + fi + ;; + esac + case $base:$base_size in + -*|*[-:]) + ;; + *) case $rmt in + '') lcl=$name.$base.$type.$suffix + get $host $dir $lcl $base_size $base_sum + ;; + esac + ;; + esac + fi + case $delta:$delta_size in + -*|*[-:]) + ;; + *) lcl=$name.$delta.$base.$type.$suffix + if test -f $lcl + then sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` + else sum=X + fi + if test -f $lcl + then case $checksum:$delta_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" + then get $host $dir $lcl $delta_size $delta_sum + fi + ;; + esac + ;; + esac + ;; + esac + done + closure= + for name in $source_packages $binary_packages + do case $name in + -) ;; + *) case " $package_hit " in + *" $name "*) + case $setup in + 1) case " $closure " in + *" $name "*) + ;; + *) closure="$closure $name" + ;; + esac + ;; + esac + ;; + *) echo $command: $name: unknown package >&2 + ;; + esac + ;; + esac + done + exec <&- + rm -f got.tmp + case $closure in + ?*) echo $closure ;; + esac + ;; + +use) # finalize the environment + + x=:.. + for d in `( cd $PACKAGEROOT; ls src/*/Makefile src/*/Nmakefile 2>/dev/null | sed 's,/[^/]*$,,' | sort -u )` + do x=$x:$INSTALLROOT/$d + done + x=$x:$INSTALLROOT + case $CDPATH: in + $x:*) ;; + *) CDPATH=$x:$CDPATH + $show CDPATH=$CDPATH + $show export CDPATH + export CDPATH + ;; + esac + P=$PACKAGEROOT + $show P=$P + $show export P + export P + A=$INSTALLROOT + $show A=$A + $show export A + export A + case $NPROC in + '') hostinfo cpu + case $_hostinfo_ in + 0|1) ;; + *) NPROC=$_hostinfo_ + $show NPROC=$NPROC + $show export NPROC + export NPROC + ;; + esac + ;; + esac + eval PACKAGE_USE=$package_use + export PACKAGE_USE + + # run the command + + case $run in + '') case $show in + ':') $exec exec $SHELL ;; + esac + ;; + *) $exec exec $SHELL -c "$run" + ;; + esac + ;; + +verify) cd $PACKAGEROOT + requirements binary $package + if executable ! $SUM + then echo "$command: $action: $SUM command required" >&2 + exit 1 + fi + case $target in + '') cd arch + set '' * + shift + target=$* + cd .. + ;; + esac + code=0 + for a in $target + do case $package in + '') set '' arch/$a/lib/package/gen/*.sum + shift + if test -f $1 + then for i + do package_verify $i || code=1 + done + else echo "$command: warning: $a: no binary packages" >&2 + fi + ;; + *) for i in $package + do if test -f arch/$a/lib/package/gen/$i.sum + then package_verify arch/$a/lib/package/gen/$i.sum || code=1 + else echo "$command: warning: $a: no binary package for $i" >&2 + fi + done + ;; + esac + done + exit $code + ;; + +write) set '' $target + shift + action= + list= + qualifier= + while : + do case $1 in + base|closure|delta|exp|lcl|pkg|rpm|tgz) + qualifier="$qualifier $1" + ;; + binary) action=$1 + type=$HOSTTYPE + eval list=$PACKAGESRC/tgz/$admin_list + ;; + cyg) qualifier="$qualifier $1" + assign="$assign closure=1" + only=1 + ;; + runtime|source) + action=$1 + ;; + tst) qualifier="$qualifier tgz" + assign="$assign copyright=0 'PACKAGEDIR=\$(PACKAGESRC)/tst'" + ;; + nocopyright) + assign="$assign copyright=0" + ;; + *) break + ;; + esac + shift + done + case $action in + '') echo "$command: binary or source operand expected" >&2 + exit 1 + ;; + esac + set '' "$@" $package + shift + case $only in + 0) set '' `order "$@"` + shift + ;; + esac + case $# in + 0) echo "$command: at least one package name expected" >&2 + exit 1 + ;; + esac + if nonmake $MAKE + then echo "$command: must have $MAKE to generate archives" >&2 + exit 1 + fi + + # all work under $PACKAGEBIN + + $make cd $PACKAGEBIN + case $list in + ?*) $exec rm -f $list ;; + esac + + # go for it + + for package + do if view - all $package.pkg || view - all lib/package/$package.pkg + then eval capture \$MAKE \$makeflags -X ignore \$noexec -f \$package.pkg \$qualifier \$action $assign + else echo "$command: $package: not a package" >&2 + fi + done + ;; + +TEST) set '' $target $package + shift + case $1 in + binary|source) + action=$1 + shift + ;; + esac + order "$@" + ;; + +*) echo "$command: $action: internal error" >&2 + exit 1 + ;; + +esac diff --git a/bin/silent b/bin/silent new file mode 100755 index 0000000..c05e231 --- /dev/null +++ b/bin/silent @@ -0,0 +1,23 @@ +# non-ksh stub for the nmake silent prefix +# @(#)silent (AT&T Research) 1992-08-11 + +case $-:$BASH_VERSION in +*x*:[01234567899]*) : bash set -x is broken :; set +ex ;; +esac + +while : +do case $# in + 0) exit 0 ;; + esac + case $1 in + *=*) case $RANDOM in + $RANDOM)`echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; + *) export "$1" ;; + esac + shift + ;; + *) break + ;; + esac +done +"$@" diff --git a/lib/package/INIT.README b/lib/package/INIT.README new file mode 100644 index 0000000..aa6af8b --- /dev/null +++ b/lib/package/INIT.README @@ -0,0 +1,1013 @@ +The INIT package is required by all but the standalone and self +extracting archive packages. It contains the package command, support +scripts, and utilities. The package command installs binary packages, +makes source packages, and generates new package tarballs. + +Source Package Installation Instructions: + + (1) Do not install packages as root/super-user. Although some components may + have setuid executables, few must be owned by root. These are best + changed manually when the security implications are understood. + (2) Choose a package root directory and cd to it. This will be a local work + area for all packages. + (3) These instructions bypass the click to download package links on the + download site. If you already clicked, or if your system does not have + curl(1), hurl(1), lynx(1) or wget(1) then use the alternate instructions + for (3),(4),(5) in plan B below. Plan B installs the hurl(1) + script which works with ksh and modern bash. The top level URL is: + URL=http://www.research.att.com/sw/download + (4) If the bin/package script does not exist then run: + test -d bin || mkdir bin + url=$URL/package + (wget -O bin/package $url||curl -L $url||hurl $url) > bin/package + chmod +x bin/package + (5) Determine the list of package names you want from the download site, then + use the package(1) command to do the actual download: + bin/package authorize "NAME" password "PASSWORD" \ + setup source $URL PACKAGE ... + (Refer to the AUTHORIZATION paragraph on the main download page for + NAME/PASSWORD details.) This downloads the closure of the latest + source package(s); covered and up-to-date packages are not downloaded again unless + package force ... is specified. Package content is verified using md5sum. + If the package root will contain only one architecture then you can install in bin and + lib instead of arch/HOSTTYPE/bin and arch/HOSTTYPE/lib by running this + instead: + bin/package authorize "NAME" password "PASSWORD" \ + flat setup source $URL PACKAGE ... + To update the same packages from the same URL run: + bin/package setup source + (6) Build and install; all generated files are placed under arch/HOSTTYPE + ($INSTALLROOT), where HOSTTYPE is the output of bin/package (with no + arguments.) name=value arguments are supported; CC and debug=1 (compile + with -g instead of -O) are likely candidates. The output is written to + the terminal and captured in $INSTALLROOT/lib/package/gen/make.out: + bin/package make + (7) List make results and interesting errors: + bin/package results + Run the regression tests: + bin/package test + List test results and errors: + bin/package results test + (8) The generated binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + file(1) and nmake(1), require the path of the bin directory to be + exported in PATH. + (9) You can run the binaries directly from the package root, or you can + install them in a public root after you are satisfied with the make and + test actions (requires the AT&T nmake(1) command): + bin/package flat install DIRECTORY PACKAGE + This will install in DIRECTORY/bin and DIRECTORY/lib. If you want to + preserve the arch/HOSTTYPE hierarchy under DIRECTORY then omit the + flat argument. If you don't have nmake(1) then the following will do a + flat install: + cd $INSTALLROOT + cp -p -r bin lib include DIRECTORY + (10) To summarize, after the first time the download, build, and test cycle + for the latest source release is: + bin/package setup source + bin/package make + bin/package test + +Source Package Installation Instructions -- Plan B: + + (3) Create the subdirectory lib/package/tgz and download all package archives + into that directory. + (4) If the bin/package script does not exist then manually read the INIT + source package: + gunzip < lib/package/tgz/INIT.YYYY-MM-DD.tgz | tar xvf - + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + tar xvf - lib/package/tgz/INIT.YYYY-MM-DD.tgz + If your system does not have tar(1) or gunzip(1) then download the ratz + source package, compile it, and manually read the INIT + source package: + mkdir bin + cp lib/package/tgz/ratz.YYYY-MM-DD.c lib/package/tgz/ratz.c + cc -o bin/ratz lib/package/tgz/ratz.c + bin/ratz -lm < lib/package/tgz/INIT.YYYY-MM-DD.tgz + (5) Read all unread package archive(s): + bin/package read + Both source and binary packages will be read by this step. + +All recorded changes follow. + +:::::::: INIT :::::::: + +12-02-29 cc.darwin.i386*: handle default cc vs kernel bittedness +12-02-29 C+probe: add __TIMESTAMP__ to the nopredefined list +12-02-29 package.sh: don't assume grep -q or /usr/local/lib in LD_LIBRARY_PATH +12-02-29 package.sh: fix ksh vs -lcmd compatibility checks +12-02-23 iffe.sh: checkcc() before checkread() for sensible diagnostics +12-02-14 package.mk: { --clobber --compare --link=lib*.a* } for --mam=static +12-02-14 package.mk: export LICENSEFILEDEFAULT instead of LICENSEFILE +12-02-14 package.sh: handle @(cc|ld).${HOSTTYPE}* intercepts +12-02-07 package.sh: add { clean clobber } actions +12-02-02 regress.sh: fix ulimit -c defaults for --nokeep +12-01-18 regress.sh: add INPUT|OUTPUT|ERROR -e 'filter' to filter before comparison +12-01-21 package.sh: fix `admin make' bug that created unused $INSTALLROOT/lib +12-01-21 Makefile: :PACKAGE: license=ast -- oops +12-01-20 cc.darwin,cc.mvs.390: tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err +12-01-12 package.sh: add admin make share closure to handle alternate HOSTTYPEs +11-12-13 iffe.sh: add /**/ test code comment to disable default #include +11-11-11 C+probe: test for .so before .sl +11-10-26 package.sh: don't forget about *.pkg for admin update +11-10-18 cc.*-icc: update and add more +11-10-11 package.sh: handle package make|view when no source installed +11-09-11 package.sh: count admin '*** termination code' errors +11-08-31 mamake.c: add -e, ignore use recursive prereq timestamps +11-08-29 iffe.sh: add ``set stdio try1.h - try2.h ...'' +11-08-29 iffe.sh: trap EXIT => trap 0 for ancient sh +11-08-11 iffe.sh: handle ancient sort that doesn't have -k +11-06-01 make.probe: add more /lib64 logic +11-05-01 package.sh: fix admin ditto to sync LICENSES too +11-03-25 package.sh: initialize { $SED $TR } before first use! +11-03-21 package.sh: fix vpath probes +11-03-17 iffe.sh: fix cleanup to rm $tmp* instead of $tmp*.* +11-02-24 package.sh: change curl usage to "curl -L ..." +11-02-11 package.sh,C+probe,make.probe,mamprobe.sh: add ###.*archiac.*### +11-02-02 Makefile: add :MAPLIB: check for ancient -lw +11-02-02 make.probe: handle -print-multi-directory => 64 => /usr/lib64 /lib64 +11-02-02 package.sh: HOSTTYPE=*,*cc*[,-*,...] sets CC [ and CCFLAGS ] +11-02-02 make.probe: handle gcc $ORIGIN link but exec failure -- gee thanks +11-01-25 cc.hp.ia64: bundled cc is a pile of shaving cream +11-01-07 iffe.sh: check debug==3 for is_hdr() failure +10-11-22 ditto.sh: fix timing problem between |& and exec &p +10-11-10 package.sh: fix cc cross compile check to use checkcc absolute path +10-10-10 package.sh: list main env vars at start of make action +10-10-10 ratz.c: tweak widnows delays +10-09-10 ratz.c: add _SEAR_ARGS for _SEAR_EXEC +10-09-01 package.sh: fix ratz from source logic +10-08-25 package.mk: consolidate license file search in .package.licenses. +10-08-22 ratz.c: run sear bootstrap command detached +10-08-20 C+probe: version_stamp only if version_flags works +10-08-17 package.sh: unset makerules *DIR variables in env +10-08-15 package.sh: "make" action now lists some env values +10-08-11 mktest.sh: add "DO command ..." +10-07-27 rt.sh: handle "rt X=Y ..." +10-06-29 ratz.c: non-option sear args passed to sear_exec() +10-06-25 iffe.sh: "api" op chanegd to not do "map-libc" type mappings +10-06-25 package.sh: "force admin ditto" => no ditto --update option +10-06-22 C+probe: handle cc that require .[ci] input for version info +10-06-21 ditto.sh: change default remote access to ssh (about time) +10-06-12 regress.sh: DISGNOSTICS [ 1 | 0 | pattern ] and fix EXIT for all +10-06-09 package.sh: add AT&T to usable nmake check +10-06-06 iffe.sh,iffe.tst: add { api ver } ops +10-04-22 package.sh: update "html binary|source" NAME/PASSWORD info +10-04-15 iffe.sh: don't forget candidate headers for hdr|sys! +10-04-11 WWW.mk: disable man page metarule -- now done by admin-man(1) +10-02-14 package.sh: $CC verification needs $INSTALLROOT/bin in PATH +10-02-11 package.sh: fix package admin make report error count +10-02-02 package.sh: fix write binary bug that did scp on local fs +10-02-02 package.mk: up to date binary targets must still be in PACKAGE.*.lst +10-01-01 package.sh: fix premature $INSTALLROOT/bin during cross compile check +10-01-01 make.probe: handle ['"] in CC.VERSION.STRING +09-12-04 iffe.sh: add "opt name" to check for name in $PACKAGE_OPTIONS +09-11-30 mktest.sh: change RESET to STATE.RESET to make it global +09-11-14 make.probe: use gcc { -print-multi-directory -print-search-dirs } +09-11-11 package.sh: re-order and combine cc checks +09-10-27 C+probe,make.probe,probe.win32: add CC.SUFFIX.DEBUG +09-10-21 iffe.sh,Makefile: test -e is not in ksh88! +09-10-06 iffe.sh: handle cc -E #error with 0 exit status (sgi) +09-10-06 package.sh: stub in ar intercept checks -- not used yet +09-10-06 ar.ibm.risc: add ar intercept because some aix require -Xfoo first!! +09-09-24 regress.sh: fix UMASK logic to create test support files before umask +09-08-28 release.c: change docs to mention stdin if no file operands +09-08-24 package.sh: fix isascii() bug that failed on od(1) trailing space +09-08-20 make.probe: add CC.SHARED.NAME +09-08-20 regress.sh: add { JOB CONTINUE EXITED KILL FIFO } +09-08-11 package.sh: filter lines containing : for package results +09-07-31 make.probe: add CC.AR.ARFLAGS (for aix ar -xany) +09-07-31 package.sh,cc.*: fix -dumpmachine to handle 32/64/* bit options +09-06-24 package.sh: fix admin.db output formatting +09-05-05 package.sh: export dll hackery environment vars +09-05-05 package.sh: handle non-identifier hostnames +09-05-05 mamake.c: pass undefined ${...} identifiers to the shell +09-05-05 mamake.rt: add macro expansion regression tests +09-05-01 iffe.sh: fix output initialization *again* +09-04-28 package.sh: handle admin.db contact field $9 +09-04-15 iffe.sh: add implicit "ini" op to initialize io for subsequent ops +09-03-31 regress.sh: EXPORT before test => global ENVIRON[] +09-03-26 package.sh: test fail pattern is 'fail[es]' +09-03-26 UNIT - ... appends (options) to command line +09-03-19 TEST.mk: x.tst => x only if x is command target +09-03-15 regress.sh: add ${MAIN} for base name of main unit +09-03-10 TEST.mk: add .SOURCE:tests if tests is a dir +09-03-03 regress.sh: allow command line unit to override UNIT +09-03-03 mktest.sh: handle IO == $'\n' +09-02-02 package.sh: delay $INSTALLROOT/bin/.paths generation until mamprobe runs +09-01-30 cc.mvs.390: c89 balks at [ ()] in -Dname="..."! +09-01-27 package.sh: add isascii() to use ratz instead of tar +09-01-20 hurl.sh: add --size=bytes option +09-01-08 TEST.mk: add test.* prereqs, multiple arg lists with :T=*: binding +09-01-03 regress.sh: fix UNIT to allow command line override +09-01-03 mktest.sh: handle TWD +08-12-24 package.sh: fix cross-compile HOSTTYPE logic +08-12-15 package.sh,hurl.sh: handle http codes { 301 302 303 } +08-10-16 make.probe '-fno-stack-protector -fno-stack-protector-all' to cop out!! +08-09-30 rt.sh: fix ksh93 regression test signal count +08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input +08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo +08-09-20 make.probe: handle another /usr/bin/file shared lib description +08-09-20 regress.sh: add --pipefail for SET pipe-input ... +08-09-17 Makefile: add gdbm1.c for +08-09-10 make.probe: add CC.NOPROTECT +08-08-08 mktest.sh: add --width=width +08-08-05 dbm.req: favor sleepycat ndbm compatibility +08-08-04 C+probe: fix stdlib initialization logic +08-06-24 package.sh: fix $INSTALLROOT/bin/cc intercept time stamp file typo +08-06-20 TEST.mk: make the localyunit before *.rt => *.tst -- doh +08-06-20 mktest.sh: prepend $PWD onto PATH for local units -- doh^2 +08-06-11 regress.sh: fix bug that skipped the last test +08-05-20 regress.sh: add --local to put *.tmp dir in local fs +08-05-05 regress.sh: add IF command ... ELIF command ... ELSE ... FI +08-05-01 package.sh: package test => ulimit -c 0 +08-04-28 regress.sh: fix EXPORT quoting +08-04-28 regress.sh: fix UNIT set check args too +08-04-24 rt.sh: exit code > 256 => signal termination +08-04-10 C+probe: change probe_so order to check .so last (macos ld workaround) +08-04-01 package.sh: handle multiple admin HOSTTYPEs per HOST +08-03-28 C+probe: add C++ #include (no extension) dir probes +08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally +08-02-28 make.probe: fix probe_warn to include ld! +08-02-02 make.probe: add CC.RUNPATH to match default -L order +08-01-31 package.sh: check lib64 for LD_LIBRARY_PATH +08-01-31 iffe.sh: tweak ancient /bin/sh workarounds +08-01-28 make.probe: darwin ld export dynamic is -force_flat_namespace +08-01-28 C+probe: handle sgi cc error message but exit 0 botch(es) +08-01-23 package.sh: fix checksum doc typo +08-01-09 C+probe: add __FUNCTION__ to the undef (don't check) list +07-12-14 iffe.sh: add set nooptimize +07-12-03 package.sh: add LC_ALL=C +07-11-27 package.sh: fix overaggressive *.md5 cleanup +07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal +07-11-05 package.sh: fix write op error count pattern +07-11-05 package.mk: fix $(~req) .ver binding +07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING] +07-08-01 package.sh: handle 'package read lcl|tgz' +07-05-08 regress.sh: execute basename instead of absolute path for short $0 +07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer +07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh +07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...} +07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG +07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe +07-03-28 package.sh: fix binary tgz architecture type duplication +07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst +07-03-28 iffe.sh: add -F header to mac test +07-03-23 make.probe: handle file(1) that returns 'archive' for .so +07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF +07-03-11 package.sh: add nocopyright and tst => nocopyright +07-03-11 package.mk: add copyright=0 +07-03-08 C+probe: restore IFS after probe.ini +07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR} +07-01-05 package.sh: fix "admin write binary" logic +07-01-01 iffe.sh: add "cmd" --verbose trace +07-01-01 iffe.sh: sort => LC_ALL=C sort +07-01-01 C+probe: LC_ALL=C +06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local! +06-11-23 package.sh: *.md5 are not tarballs -- doh +06-11-23 iffe.sh: add -F, --features=feature-test-header +06-11-11 make.probe: favor lib64 over lib for hosttype==*64 +06-10-31 make.probe: add "-ignore-source-dir -iquote" test +06-10-31 iffe.sh: add status{...} code block +06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?) +06-10-11 package.sh: handle already gunzip'd *.tgz +06-10-06 iffe.sh: add reference for header content tests +06-09-27 regress.sh: fix UMASK to do DO too (duh) +06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics) +06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together +06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too +06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io +06-09-05 C+probe: add { probe_version version_stamp version_string } +06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING] +06-08-27 regress.sh,mktest.sh: add UMASK +06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE +06-08-25 mktest.sh: add IGNORESPACE +06-08-24 mktest.sh: handle \000 in data +06-08-24 regress.sh: handle -f* for INPUT|OUTPUT|ERROR +06-08-16 package.sh: fix 'install flat' logic +06-08-11 rt.sh: handle style=shell %K date format +06-07-17 ratz.c: fix __MVS__ FAR definition +06-07-17 iffe.sh: "header x.h" -- deprecate "include x.h" for .SCAN.iffe +06-07-17 package.sh: differentiate urls vs. assignments +06-06-27 rt.sh: add --failed, --heading +06-06-27 C+probe,TEST.mk,make.probe,mktest.sh,regress.sh: 'ulimit -c 0' +06-06-26 cc.darwin.ppc: handle -lcc_dynamic disappearance +06-06-25 mktest.sh: implement PROG +06-06-11 Makefile: add -ldbm :MAPLIB:, provide public MAPLIB.mk +06-05-06 package.sh: add PACKAGE_admin_tail_timeout +06-05-22 ratz.c: upgrade to zlib-1.2.3 +06-05-09 package.sh: fix admin.db docs +06-03-11 package.sh: fix `package use - command ...' +06-03-05 make.probe: work around pedantic bash 3.1 mismatched " in `.` +06-02-14 package.sh: "results failed test" == "results test failed" + cc.sgi.*: add _AST_cc_OPTIONS parameterization, -OPT:Olimit=0 + cc.linux.ia64-icc: add for intel cc +06-02-02 package.sh: freebsd stuck with os version for all arch +06-02-01 package.mk: fix locale logic (tw -d requires dir arg) +06-01-31 package.sh: require $CC only for make|test +06-01-30 package.sh,hurl.sh: use the backwards-compatible --http-passwd + package.sh: add more pdksh => /bin/sh checks +06-01-26 package.sh: wget --http-pass => --http-password + package.sh: fix wget error logic + hurl.sh: wget --http-pass => --http-password +06-01-11 package.mk: pass package.license.class to make --mam too + package.mk: variants=pattern => --variants=pattern + package.sh: darwin rel<=7 => darwin7.ppc + package.sh: freebsd rel<=4 => freebsd4 + package.sh: freebsd rel<=5 => freebsd5 +05-12-07 iffe.sh: don't emit if | (XXX) +05-12-05 make.probe: disable readonly.exe core dump via ulimit -c 0 +05-09-22 mktest.sh: add EXEC [ ++NOOUTPUT ++NOERROR ++NOEXIT ] +05-09-21 mktest.sh: fix --style=shell compare to ignore \r +05-09-12 TEST.mk: all --force to force %.rt regeneration +05-09-05 TEST.mk: regenerate from %.rt only if newer, :SAVE: %.tst +05-08-25 mktest.sh: add + TEST.mk: add %.rt=>%.tst for mktest +05-08-18 package.sh: 'package host cpu' now checks $NPROC first +05-07-17 iffe.sh: add { define extern include print } ops + iffe.sh: accept output{...}end output on success only -- doh +05-07-01 package.sh: add TARPROBE for tar B flag probe +05-06-24 package.sh: fix binary read chmod via *.sum +05-06-06 package.sh: fix KEEP_HOSTTYPE logic to handle synthesized types +05-06-01 make.probe: verify that cc_pic works for hosted cc + cc.lynxos.ppc: make -mshared the default + package.sh: note $INSTALLROOT/bin/@(cc|ld|ldd) installation +05-05-25 make.probe: add CC.INCLUDE.LOCAL instead of -I- in CC.DIALECT +05-05-24 iffe.sh: really fix grouping logic -- with tests this time + package.sh: pipe/socket configuration mismatches => use /bin/sh +05-04-28 TEST.mk: add $(TESTS) +05-04-19 package.sh: package results test uses rt if possible + iffe.sh: fix 'op var - ... - ...' grouping logic +05-04-15 rt.sh: handle autom4ate style +05-04-11 regress.sh: fix unit name when command line unit also specified + rt.sh: handle all ast package test output formats + package.sh: fix make docs for options passed to underlying make +05-04-08 package.sh: cp -p makerules.mo to $OK to preserve mtime + regress.sh: add "TITLE name" to change TEST output title +05-04-01 rt.sh: add pretty make test + regress.sh wrapper +05-03-29 package.sh: test -e path => test -f path -o -d path +05-03-24 make.probe: fix CC.PICBIG probe to prefer -fPIC over -fpic -- doh +05-03-19 mamake.c: command line name=var also defines name.FORCE=var +05-03-11 regress.sh: unset LC_ALL when LC_* EXPORT'd + package.sh: old make.out saved in circular make.out.[1-9] + mamake.c: sync with nmake :W=O: +05-03-01 package.sh: fix flat hierarchy initialization + package.sh: admin action now properly resets sibling remote logs + package.mk: relax unknown/unwritten package messages to warnings + package.sh: handle space in command line name=value + make.probe: add mvs -Wc,dll,exportall,longname,rent to CC.DLL probe +05-02-24 package.sh: hosttype *.powerpc => *.ppc + cc.lynxos.ppc,ldd.lynxos.ppc: add +05-02-22 mamake.c: fix { -G --debug-symbols -S --strip-symbols } MAMAKEFLAGS bug +05-02-20 probe.win32: handle /platformsdk mount +05-02-19 package.sh,package.mk: add write tst for tgz in tst subdir +05-02-18 package.sh: accept cc -dumpmachine with 0 or 1 - +05-02-14 package.sh: handle mutiple architectures per host in admin.db + Makefile,package.sh: honor $INSTALLROOT/bin/.paths overrides + package.sh: normalize trailing [-_]bits in host type + iffe.sh: some ksh-compatible shells don't do *(pattern) +05-02-11 iffe.sh: back out 05-01-11 child process stdin hijack + cc.lynxos.i386: -dynamic instead of -static default +05-02-10 package.sh: cyg usr/doc => usr/share/doc +05-02-08 package.sh: drop -m with pax -- delta bug fixed 2005-02-08 + iffe.sh: work around old bash 0<... redirection bug +05-02-06 package.mk: source.tgz: update generated files only when they change +05-02-02 *.sh,*probe: IFS may be unset and { ash bsh } don't on startup -- wow +05-01-11 package.sh: update setup docs to include authorize+password + package.mk: fix .source.cyg final directory edit + package.mk: notice=1 for conspicuous empty NOTICE file + WWW.mk: fix *-index.html installation + filter.sh: retain input file suffix in tmp copy + mamexec.c: fix non-contiguous "exec" bug that skipped lines + iffe.sh: fix candidate lib test to try grouping subsequent libs + iffe.sh: fix child process stdin hijack that skipped input lines + iffe.sh: --shell=osh to force read -r compatibility command + iffe.sh: chop iffe input leading space before # for KnR compatibility +05-01-05 package.sh: add ${TAR} ${TARFLAGS} and tar B flag for pipes + mamake.c: fix makefile scan to ignore lib*.[hH] + iffe.sh: immunize function/symbol tests from aggressive -O +04-12-28 WWW.mk: add :WWWPAGE: faq.*.mm index generator +04-12-21 ratz.c: make sure tmp dir is writable -- doh +04-12-08 iffe.sh: fix dat test for aggressive -O +04-12-01 iffe.sh: add `include file' to pull in #define's for `exp' +04-11-11 package.sh: default MAKESKIP is "*[-.]*" +04-10-22 ratz.c: change docs to note zlib license + mamake.c: handle --debug-symbols and --strip-symbols + package.sh: make (debug|strip)=1 => --(debug|strip)-symbols + package.mk: add :LICENSE: => package.license.class + mamake.c: fix recursive order logic +04-10-18 package.mk: add :LICENSE:, :OMIT: to omit package subdirs +04-10-11 package.sh: add 'authorize name' and 'password password' +04-10-01 iffe.sh: double check $static link with ! $static + Makefile: add BUILTIN_LIB to $INSTALLROOT/bin/.paths + make.probe: add CC.DIALECT EXPORT={ALL,REF,EXT,DLL} + package.sh: add BUILTIN_LIB to $INSTALLROOT/bin/.paths +04-09-21 package.mk: $(init)$(name) is now an implicit prereq +04-09-09 package.sh: copy makerules.mo to $INSTALLROOT/bin/ok +04-09-01 package.mk,package.sh: rename *.txt => *.README + package.mk: add the runtime package type (no *.[ah]) + iffe.sh: fix key test reports +04-08-26 Makefile: { add m2.c m3.c } -lm tests for { frexp[l] ldexp[l] } +04-08-11 package.mk: handle HOSTTYPE for solaris > 9 + package.sh: add `checkaout proto' for { make view } + package.sh: check for { md5sum md5 } + iffe.sh: add {if|elif|else|endif} test ... + iffe.sh: add 'exp - expression' and '( expression )' + iffe.sh: add 'name = test ...' user defined macros + iffe.sh: add '! test ...' negation + TEST.mk: add implied { .c .sh } generated prereq + cc.darwin.ppc: handle 10.3 -dylib mess +04-08-01 package.mk: let include handle nested requirements -- duh +04-07-31 package.sh: attempt a second ping before admin assumes host down +04-07-26 package.sh: fix hp.ia64 HOSTTYPE +04-07-23 probe.win32: generalize #include dir order search +04-07-17 regress.sh: add INPUT -x for chmod +x +04-07-01 regress.sh: TMP => TWD +04-06-29 regress.sh: put COMMAND in $TWD too +04-06-21 regress.sh: mkdir -p INPUT and OUTPUT intermediate dirs + TEST.mk: add :TEST: -- to disable .c .sh search +04-06-18 TEST.mk: add .SCAN.tst +04-06-17 regress.sh: TEST returns true if active, false otherwise + regress.sh: add CD to change test pwd from $TWD +04-06-16 regress.sh: add TWD for ./unit.tmp override + regress.sh: DO now flushes previous test + regress.sh: INPUT and OUTPUT handle -f for printf instead of print +04-06-11 package.sh: make sure $INSTALLROOT/bin is in front of $PATH + package.sh: skip nmake if older than 2000-10-31 +04-05-20 package.sh: fix arg vs. package parse with - or '' to disambuguate +04-05-11 package.sh: package verbose update lists closure for package setup + package.sh: add src/lib/libardir to nmake proto bootstrap + regress.sh: probe for rm -u vs. chmod -R u+rwx +04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH +04-04-15 make.probe: check probe_libdir false positives + package.sh: add lib/package/*.lic src package subdirs + package.mk: add mamfile=0 to inhibit Mamfile generation + iffe.sh: config name_DECLARED => HAVE_name_DECL + iffe.sh: fix mac to handle default value +04-04-11 iffe.sh: normalize sed [\\\\/] quoting +04-04-04 package.mk: only checksum generated tarballs + mamprobe.sh: add STDCHMOD +04-04-01 C+probe: set export LANG=C for uniform error messages + make.probe: another CC.STDLIB tweak + package.sh: fix regress core dump pattern, expand [a-z] match ranges +04-03-31 Makefile: add intl :MAPLIB: test + make.probe: fix CC.STDLIB search; drop CC.* path duplicates +04-03-28 iffe.sh: drop unused exec $stdin<&0 dup +04-03-25 Makefile: add iconv :MAPLIB: + package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override +04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz) + package.sh: update base change on md5 sum instead of size + iffe.sh: adjust case label \ and keyword quoting for ancient /bin/sh +04-03-22 probe.win32: ncc => nld +04-03-19 CONVERT.mk: change the instructions and old source dir default + package.mk: fix recurse=list check + package.mk: add *.md5 checksum for each *.(c|exe|tgz) + package.sh: fix update base/delta/sync existence check +04-03-18 iffe.sh: -d2 does not remove core dumps on exit +04-03-17 package.sh: fix make recurse arg/action order +04-02-29 package.sh: add regress action to compare current and previous tests + package.sh: fix sgi.mips[23] HOSTTYPE test for old irix cc + package.sh: add `export variable ...' + package.sh: admin action now handles host name with non-id chars + package.sh: non-numeric M T W in admin.db disables that action + package.sh: fix admin write binary local vs. shared clash + cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable + cc.hp.pa64: sync with cc.hp.pa + cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib + probe.win32: sync with make.probe + make.probe: fix last chance dynamic test + make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E + make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall + make.probe: move probe_dll_def to the end of probe_dll + package.mk: capture subcomponent mamfile recursion +04-02-24 make.probe: strip "..." from cc/ld traces + iffe.sh: add ``set [no]define'' to disable macro #define/#undef +04-02-23 make.probe: rework CC.LD search +04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export + make.probe: resurrect CC.PIC with separate semantics from CC.DLL + make.probe: add CC.SHARED.LD for CC.SHARED linker + C+probe: clear DISPLAY to stifle interactive windows +04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end + make.probe: add { CC.AR CC.SIZE }, fix cross command search + cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug +04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++ +04-02-04 package.sh: fix cross compilation bug that mixed binary formats +04-02-02 package.sh: package admin now ditto's bin/package too +04-01-30 cc.sgi.mips3: drop warning 3421 +04-01-11 regress.sh: output label#count for tests in loops +04-01-05 regress.sh: fix bug that ignored the first SAME +04-01-04 crossexec.sh: fix typo that did not recognize rcp +03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse() +03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency +03-09-23 ratz.c: fix tar header number parse bug that skipped to next number + regress.sh: rm cleanup now handles files matching -* +03-09-11 iffe.sh: add unnamed { ... } blocks + regress.sh: add COPY from to, like MOVE but comprison still done + regress.sh: rm -rfu to handle test dirs w/o u+rwx +03-08-14 Makfile: add hello.c to the manifest +03-08-11 package.sh: fix `html binary' generation +03-06-21 package.sh: fix INITROOT initialization bug + package.sh: make sure admin logs exists before tail'ing +03-06-11 probe.win32: fix $(BINDIR) typo that expanded in sh instead of make + cc.mvs.390: return code 4 yields exit code 3 but its *really* ok + package.sh: fix onpath function global var conflict + make.probe: add CC.DIALECT { GNU -dD } + package.mk: add Mamfile to lcl manifest +03-06-10 package.sh: fix setup action typo that only checked the INIT package + package.sh: *.s390x => *.s390-64 +03-06-09 package.mk: add cyg :POSTINSTALL: +03-06-08 make.probe: fix CC.STDLIB logic + hurl.sh: add User-Agent identification + package.sh: tweak source and binary installation instructions + cc.hp.pa,ld.hp.pa: +-Wl,+cdp,${INSTALLROOT}/lib/: drops abs lib paths + ldd.hp.pa: add +03-06-06 package.sh: fix $INSTALLROOT/bin/ldd check + make.probe: add CC.STDLIB verification +03-06-04 make.probe: add +forceread +noforceread +03-05-11 hurl.sh: handle http://host:port/path +03-05-06 package.sh: fix setup action PACKAGEROOT and INIT logic +03-05-05 package.mk: fix cygwin tarball names +03-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile +03-04-27 make.probe: fix mvs CC.PREFIX.SHARED "lib" => "" + make.probe: add CC.DLL.DIR = $(BINDIR) or $(LIBDIR) + make.probe: add { CC.LD.LAZY CC.LD.NOLAZY CC.LD.RECORD CC.LD.NORECORD } + probe.win32: sync with latest CC.* +03-04-25 mamprobe.sh: add args to `. $makeprobe' for ancient sh +03-04-23 package.mk: fix dup "covered by" licenses +03-04-22 probe.win32: CC.DIALECT += "LIBPP -I-" for all cc's + package.sh: fix admin write binary tarball snarf +03-04-21 package.mk: package covered *.@(pkg|lic) too +03-04-15 package.mk: don't generate incremental archives for lcl + package.mk: add incremental=[source:1 binary:0] archive control + package.sh: generate $INSTALLROOT/bin/cc wrapper for CC != cc + package.sh: admin must ditto lib/package/*.@(pkg|lic) too + mamake.c: ignore time of ignore prereqs + mamake.c: -D2 lists propagated times +03-04-11 package.mk: tidy up cyg tarballs + package.sh: fix old shell clash between get() and $get +03-04-05 package.mk: restore *.inx generation somehow lost during cyg additions + package.sh: add pthread_num_processors_np() last resort for cpu count + package.sh: use `make believe' to accept mamake generated files + package.sh: handle `make [make-flags] [target ...]' + mamake.c: ignore -e +03-03-21 package.mk: fix cyg old make typo + package.sh: switch to `package setup' instructions +03-03-19 package.sh: add registry checks for `host cpu' + package.sh: `results failed' now lists core dump messages +03-03-17 package.sh: on cygwin verify 'ntsec binmode' in $CYGWIN or die + Makefile: install gcc wrapper if no cc + package.mk: add :DETAILS: { :README: :EXPORT: :INSTALL: :TEST: } ops +03-03-12 package.mk: add :DETAILS: for style-specific details +03-03-11 package.sh: add beta setup/update support + TEST.mk: add (TESTCC) prereq for .sh tests +03-03-07 hurl.sh: add +03-03-06 iffe.sh: fix lib win32 test cygwin vs native incompatibility + iffe.sh: change internal stdio.h guard to handle C++ inline vs. macro +03-03-03 package.sh: check for curl or wget for update + package.sh: add setup action == update read make + package.sh: fix packageroot() typo that showed up in non ~user shells + mamake.c: treat name+=value args like name=value + mamake.c: add ${var?*|value?match?no-match?} + mamake.c: fix archive vs. dynamic bind logic +03-02-28 package.sh: add the "cyg" (cygwin) package type + package.mk: add "cyg" stubs, :CATEGORY: for category name(s) +03-02-25 mamake.c: add -D4 system(3) debug trace +03-02-24 package.mk: change --mismatch to --corrupt=accept +03-02-14 ratz.c: add _WIN32 setmode([01],O_BINARY) and fopen "rb"/"wb" +03-02-12 Makefile: handle getconf LIBPATH with host pattern +03-01-31 package.mk: fix .lic search +03-01-30 package.sh: handle { INIT ksh nmake } already installed elsewhere + package.sh: admin handles command outside of $PACKAGEROOT/bin + Makefile: install $(INSTALLROOT)/lib/make/package.mk +03-01-28 package.sh: admin remote commands on one line to please syslog +03-01-23 probe.win32: borland and mingw32 tweaks +03-01-22 package.sh: fix $CC test to ignore set -x trace -- duh +03-01-16 ditto.sh: tw --chop on by default +03-01-14 package.sh: use /bin/cp to copy previous binaries to bin/ok/ + package.sh: admin now initiates remote exec and copy from local host +03-01-12 package.sh: handle admin "xxx:" default root +03-01-03 probe.win32: add /usr/include/borland path truncation workaround +02-12-10 iffe.sh: add <&$nullin >&$nullout to checkread() $cc +02-12-06 probe.win32: fix inlcude => include typo, add lcc lib + probe.win32: CC.MAKE.OPTIONS = nativepp=0 +02-12-04 mamake.c: fix ${foo-bar} to expand foo if defined +02-11-28 probe.win32: add C++ and -I- CC.DIALECT checks +02-11-26 package.sh: package release now checks for second level files +02-11-22 package.sh: update action now uses HTTP/1.0 +02-11-21 probe.win32: update the vc include dir test +02-11-20 make.probe: fix CC.LD.ORIGIN typo that expanded make var +02-11-13 packahe.mk: fix list.install => list.installed typo +02-11-12 make.probe: add CC.LD.ORIGIN for a.out origin dir relative dll search + make.probe: add CC.LD.STRIP for link time a.out strip + package.sh: fix package_use vs. PACKAGE_USE check +02-10-24 WWW.mk: fix bug that required a :WWWBIN: assertion to post +02-10-23 mamake.c: fix unuinitialized time in make() + ratz.c: fix meter buffer overflow +02-10-20 package.sh: fix lib/probe/C/make/probe update test +02-10-18 probe.win32: update for mingw + make.probe: add bash workaround to SHELLMAGIC test + package.sh: work around yet another cygwin hassle +02-10-17 iffe.sh: short circuit id check for *[-+/\\]* +02-10-08 regress.sh: unset FIGNORE to avoid rm . errors + package.sh: unset FIGNORE to avoid rm . errors + package.sh: $CC must at least compile and executable hello world +02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz + package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS) + iffe.sh: add identifier checks for tests that (implicitly) require them + iffe.sh: disambiguate a few --config macros +02-10-02 iffe.sh: fix shell=bsh `hdr a/b' +02-09-30 package.sh: handle chmod of -* files + package.sh: verify that $SHELL is Bourne compatible + package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation + iffe.sh: fix bug that didn't define mac variable on success +02-09-22 package.sh: handle admin_action=ditto + iffe.sh: --config sizeof(foo) macro is SIZEOF_foo + iffe.sh: fix long.long test so it doesn't defeat uwin "typ long.long" + mamprobe.sh: convert $("foo") nmake string constants +02-09-21 mamprobe.sh: "-" info-path writes probe info to stdout +02-09-11 make.probe: move from nmake src to be part of mamprobe.sh + mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end + mamake.c: pass cc absolute path to mamprobe + package.sh: generate mamprobe -- yuk (at least its confined to INIT) + iffe.sh: lcl,nxt: drop default sys/ check + ditto.sh: tw --logical by default; add --physical +02-09-10 package.sh: SHELLMAGIC creeps into package too -- duh and fooey +02-09-09 ditto.sh: test that remote .profile exists before sourcing +02-09-06 package.sh: don't ditto nfs junk + ditto.sh: --show now lists directory ops instead of enumerating all +02-09-05 ditto.sh: add --remote={rsh|ssh} + package.sh: add admin [[{rsh|ssh|-}]:]directory +02-09-02 iffe.sh: change 'print -r --' to 'print -r -' for ksh86 compatibility +02-09-01 cc.unix.mc68k: add for ancient 3b1 +02-08-22 package.sh: fix component() to test for components -- duh + Makefile: add LICENSE:.DONTCARE to workaround mam +02-08-11 iffe.sh: provide defaults for LD_* additions +02-08-07 ratz.c: change -m to use * instead of non-portable inverse video +02-07-17 mamprobe.sh: close tmp file in trap before rm for cygwin + package.sh: fix "type" to handle i1586 (P4) + package.sh: add the view action +02-06-28 package.sh: handle multiple packages for release action +02-06-27 package.sh: catch sol*.sparc=>sol*.sun4 when CC=gcc +02-06-14 package.sh: fix admin_action to not include qualifiers + package.sh: fix help/html doc typo +02-06-11 package.sh: fix ditto update doc to `PACKAGEROOT field matching *:*' +02-06-07 WWW.mk: change substitute $("\n") to \n +02-06-06 package.sh: clarify output streams for help/html +02-05-22 mamake.c: fix executable file check to use (S_IXUSR|S_IXGRP|S_IXOTH) +02-04-04 package.sh: fix update to differentiate *.sun4 and sun4 +02-03-27 package.sh: yacc/bison warning only if both missing +02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems +02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package + package.sh: precheck $CC, not `cc' + package.sh: fix install to use pax -ps to preserve set-uid/gid + package.sh: fix install to use list.installed for existing files only +02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read + package.sh: fix update delta sync fetch +02-02-14 iffe.sh: fix macro{ }end docs to include " + iffe.sh: add dfn to extract #define from headers + iffe.sh: handle nxt #include ok but no line sync + iffe.sh: drop local header clash logic + iffe.sh: add -X, --exclude=dir to exclude -I dirs + iffe.sh: lcl,nxt now generate <...> headers instead of "..." + package.sh: admin.db root dir matching -* disables host + package.mk: fix package.src.pat typo -- too many ) + package.mk: add { :COVERS: :DESCRIPTION: :REQUIRES: } + package.sh: handle { :COVERS: :DESCRIPTION: :REQUIRES: } + Makefile: move proto.c generation to the proto component dir +02-02-02 execrate.sh: add for .exe challenged win32 systems/commands + mamprobe.sh: add STD* commands/flags + mamake.c: update mamprobe info when older than mamprobe executable + package.sh: move ed/ex workaround to mamprobe.sh + package.sh: fix `host type' bug that incorrectly assumed sun4 for sol + package.sh: add execrate(1) hooks for challenged systems + package.sh: add check for { cc ar nm yacc/bison } before make + ratz.c: fix "rb" vs. "r" macro tests + iffe.sh: add nxt, similar to lcl but defines _nxt_foo for #include + iffe.sh,package.sh: remove vaibale from sccs,cvs ident strings -- duh +02-01-24 C+probe: check CC.DYNAMIC to handle cc that accept but ignore -B* + iffe.sh: handle 'mem struct.a.b' +02-01-22 iffe.sh: cache (internal) `foo vs. struct foo' test results + package.sh: uts.370 => uts.390 +02-01-18 package.sh: fix uts hosttype +02-01-17 package.sh: add 'results failed ...' to list failures only + package.sh: change ARCH internal var to all_types to avoid env conflict + iffe.sh: fix hdr/lib precheck that missed some -- ouch + iffe.sh: fix noexecute test that forgot to check compile first! +02-01-15 ratz.c: fix path[] type typo +02-01-01 package.mk: tighten license search +02-01-08 package.sh: `pwd` => ${PWD:-`pwd`} + package.mk: expand license file pattern match +02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value" + iffe.sh: fix initial check to honor --config +01-12-25 iffe.sh: fix bug where -o file restored old file +01-12-23 package.mk: uniq the closure lists +01-12-07 ratz.c: fix --meter to retain paths containing " -- " +01-11-30 ratz.c: use sear_system() to execute; should work on all windows +01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status +01-11-26 ditto.sh: drop n+=v for ksh compatibility +01-11-21 ditto.sh: add rsync script replacement [hey, it works!] + package.sh: add [ditto]:directory notation to admin.db +01-10-31 package.sh: handle *.sum paths with embedded space + package.sh: change executable() to onpath() + package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack) + package.sh: add os2 fix to `host type' + mamake.c: add .exe hack + iffe.sh: fix intrinsic function lib test + mamprobe.sh: update pic probe to match make.probe for linux.ia64 +01-10-30 package.sh: make action skeleton view now checks subdirs +01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP + package.mk: tarball package.notice replaces `license accepted' prompt + package.sh: eliminate `license accepted' prompt + package.sh: add update to download latest from a url + package.sh: use builtin arithmetic when we know its ksh + iffe.sh: unkown -> unknown +01-10-18 package.sh: convert to YYYY-MM-DD delta releases instead of NNNN + package.mk: convert to YYYY-MM-DD delta releases instead of NNNN + ratz.c: fix -m for paths containing \f\n\r\v +01-10-16 ratz.c: _SEA_* => SEAR_* + ratz.c: preserve stdin for sear_exec() + ratz.c: add recursive sear_rm_r() to sear_exec() tmp dir cleanup +01-10-10 mamprobe.sh: add mam_cc_SHELLMAGIC + package.sh: add nfs wakeup call to admin to avoid stale file handles +01-10-04 cc.darwin.ppc: -flat_namespace is not longer the default (huh) +01-10-01 package make: prepend $INSTALLROOT/bin/ok to PATH + package read: save cpy of bin/package when reading the INIT package + mamprobe.sh: allow cc path with optional arguments +01-09-24 Makefile,package.sh: add $INSTALLROOT/bin/.paths initialization +01-09-19 package.mk: add recurse to list.package.* + package.sh: bootstrap build nmake with _BLD_STATIC for _WIN32 +01-09-11 ratz.c: add _SEA_SKIP & _SEA_COMMAND for self extracting archives +01-09-07 package.mk: fix output capture to not generate files names with spaces +01-09-07 package.mk: fix delta release number search +01-08-11 package.mk: handle single gz executable packages (e.g., for ksh) + package.sh: fix package install to require nmake only if no *.sum + iffe.sh: drop ancient menu and prompt actions; check ./hdr.h clash +01-07-17 package: fix use cross compile test to generate files in /tmp +01-06-27 ratz: handle hard and soft links if possible +01-06-07 Makefile: fix :MAPLIB: for sco +01-05-31 crossexec.sh: add + iffe.sh: add -x crosstype to run crossexec + iffe.sh: exp test now handles pass{}end fail{}end yes{}end no{}end + package.sh: add package host canon external-host-type-name + package.sh: fix `use USER' lookup for shells that support ~USER + cc.*: add -dumpmachine to dump target HOSTTYPE +01-05-18 iffe.sh: drop $HOME/tmp/t.sh debug trace -- oops +01-05-01 mamake.c: scan() now handles :PACKAGE: foo:command +01-04-26 *.sh: expand [a-z][A-Z][0-9] for non-contiguous character codes + iffe.sh: fix run *.sh for shells that don't $* across . command + cc.mvs.390: recode for /bin/sh +01-04-25 package.mk: include non cc-g variants by default + package.sh: *[._]* => *?[_.]* for mvs.390 /bin/sh +01-04-24 TEST.mk: no tests for VARIANT=="DLL" +01-04-22 package.mk,package.sh: tarball text members are ascii encoded +01-04-18 package.mk: allow package name to be the same as one of its components + cc.mvs.390: handle .C .cpp .cxx + cc.mvs.390: compensate for -o that does not overwrite +01-04-01 regress: fix SAME that just skipped it -- we should regress regress! + iffe: fix bug that didn't emit _hdr_foo for internal hdr tests + iffe: fix lcl bug for cc -E that doesn't emit line syncs + ratz: add ascii=>ebcdic conversion for text archive members + mamake: fix buffer overlap bug that clobbered the probe file path +01-03-17 iffe: handle : separator as first arg +01-03-15 mamake.c,ratz.c,release.c: add and +01-02-26 iffe.sh: fix bug that omitted runtime #define for `mac' op +01-02-22 cc.ibm.risc: handle SF_CLOSE clash in +01-02-14 cc.sgi.mips3,cc.sgi.mips4: handle -mips2 -mips3 -mips4 for cross cc + C+probe: quote "$cc" when its an argument! + mamake: execute actions with $SHELL, ignored signals back to default + package.sh: nmake check error output to /dev/null + package.sh: fix INIT a.out updates for knr cc + package.sh: package list now handles large tgz dirs + package.sh: *-ok executables moved to ok/* for *.dll systems + iffe.sh: change "exec >&-" to "exec >/dev/null" else linux mkdir fails! + mamake: handle `bind -lx [dontcare]' +01-02-12 ratz.c: fix _PACKAGE_ast includes + package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/ + package.sh: $CC ^HOSTTYPE=[A-Za-z_0-9.]*$ overrides HOSTTYPE + iffe.sh: fix dat code that used previous $tmp.exe + iffe.sh: fix dat code for _DLL imports +01-02-09 iffe.sh: add copy() for shells with the dissappearing here doc bug +01-02-08 Makefile: guard against null $(CC.HOSTTYPE) +01-02-06 Makefile: separate out cc,ld,ldd workarounds (so they will be packaged) +01-02-02 package.sh: fix package use for $INSTALLROOT != */$HOSTTYPE + package.sh: create intermediate recursion makefiles when needed + package.sh: add $SECONDS to the DEBUG trace prompt +01-01-01 ratz.c: #ifdef for uwin ncc + iffe.sh,package.sh: check PACKAGE_PATH for local installations + package.sh: add psrinfo for osf.alpha host cpu + package.sh: change pax --meter probe; some hang on /dev/tty + package.sh: fix `install flat ARCH' + mamake: eliminate loops from scan order + C+probe: add probe_verbose -V for aix cc=xlc + cc.ibm.risc,ldd.ibm.risc: add + package.mk: list refs to top-level licenses only + package.mk: add local link table to change log html +00-12-25 package.sh: `no package archives' is a hard error, duh + package.sh: reorder host type logic for lame shells + mamake.c: getcwd => getwd for NeXT -- how about posix==default guys + iffe.sh: really gross workaround for NeXT -lposix stdout null's + iffe.sh: handle cc -E that insists on compiling +00-12-15 iffe.sh: ancient sh function call blows $*; call only when $# == 0 + *.sh: `getopts 2>/dev/null` => `(getopts)2>/dev/null` for ancient sh + package.sh: fix LD_LIBRARY*_PATH initialization + cc.next.m68k: add for _POSIX_SOURCE and linker multiply defined syms +00-12-12 ratz: add --meter + package.sh: a few VPATH fixes + Makefile: don't override *.mips* cc if -version not accepted +00-12-11 package.mk: *.inx now contains name=value +00-12-07 package.sh: handle PC netscape . => _ pathname mangle + WWW.mk: .tar.gz => .tgz +00-11-27 package.sh: add checklicense() to do license checks at read time + package.mk: change component list from preformat to table +00-10-31 package.mk: *.pkg must assert closure + package.mk: add cc- variants to list.package.binary + package.sh: omit dups from package list + package.sh: invalid arg gives one line Usage + package.sh: relax checkaout checks for non-owners + package.sh: package use sets NPROC if not already set or [01] + proto.c: add $(INSTALLROOT)/include/ast hack +00-10-26 WWW.mk: add .SOURCE rhs to :WWWPAGE: +00-10-25 package: fix install + package.mk: add list.install +00-10-22 regress: fix VIEW to skip empty dirs +00-10-19 package.mk: $(PACKAGEROOT)/bin/nmake => $(PACKAGEROOT)/bin/manmake + iffe: validate #define identifiers +00-10-18 C+probe: mac os10 additions + package: add DYLD_LIBRARY_PATH initialization + add ldd.$(CC.HOSTTYPE) +00-10-01 iffe: handle -I* -L* options +00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs +00-09-19 C+probe: add probe_longlong +00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake +00-09-08 iffe: verfiy that $cc is a C compiler +00-06-14 mamprobe: fix win32.* probe + mamake: fix bug that used lower view path for generation + package: don't clobber $PACKAGEROOT/bin/nmake +00-06-01 C+probe: fix stdinclude *again* + package: fix write delta source to use default pax format + package: add disambiguating bias for sgi.mips3 over sgi.mips4 + package.mk: fix for directory content packages lib ast-locale +00-05-01 iffe: fix invalid _LIB_ macro identifier +00-04-11 C+probe: uniq stdinclude and stdlib, fix usrinclude +00-04-01 regress: fix explicit OUTPUT bug that didn't compare with expected +00-03-17 package: all archives are .tgz for binary download + package: $(PACKAGEROOT)/LICENSES/* in source and binary archives + package: implement install and verify actions + iffe: add exp, pth file dir ..., fix lib - -lfoo, fix lib - - -la -lb + iffe: -L* must affect LD_LIBRARY* hacks for .exe tests -- yuk + package.mk: add *.pkg :INDEX: +00-03-07 package: add admin action +00-03-06 makefile: install optional make probe override script C+make+probe.lcl +00-02-14 --- release 1.0 --- + ratz: treat "foo/" as a dir, not a regular file + package: clarify source and binary installation instructions + package: fix so binary packages can install without cc + package: "ratz" now a non-archive package (the only one) for bootstrap + package: handle VPATH=a:b arg + package.mk: "ratz" package adjustments + Makefile: use :PACKAGE_INIT: to support binary INIT packages + WWW.mk: add :WWWALL: + C.probe: fix .so check that let .dll slip through + iffe: fix config sh var assignment for HAVE_member_IN_struct + iffe: fix config sh var assignment for symbol_DECLARED + package: delay PATH export until dll hack exports complete + package: don't forget binary package $(INSTALLROOT)/lib(32|64) + package: add delta change log for source packages +00-02-10 mamprobe: add mam_cc_DLLBIG + package: fix spelling typos + package: add html help output + package.mk: beef up source and binary help => html +00-02-08 package: mkdir man/man[138] in the new arch to cover MAM bug +00-01-28 package,release: add -rcount to release + package: fix linux "host cpu" and "host rating" + package: copy *.lic to $PACKAGEBIN for "make" and "write binary" + package: fix 'release change log' case match +00-01-24 package: add copyright action + mamprobe: add -D_BLD_DLL to mam_cc_DLL +00-01-11 package: tsort for package write + package: early verification that $CC works + package: add non-interactive command arg for use action + proto: fix -C intermediate mkdir() + mamprobe: unixware.i386 ksh workaround + C.probe: move hosttype to C.probe (with unixware.i386 workaround) + WWW.mk: fix mm2html option quoting + WWW.mk: add .SCAN.mm + WWW.mk: don't force static=1; grab dll's instead + *.sh: fix getopts test to handle botched implementations like osf.alpha + iffe.sh: fix read -r test +99-12-25 iffe: tweak verbose messages + iffe: hand code non-optget getopts parse + iffe: fix bash quoting bug again + iffe: do test -w . after option parse + package: fix PACKAGEROOT search +99-11-19 --- release 0.2 --- +99-11-19 first working package & friends +99-10-31 change from lib0ast to INIT; add MAM and package bootstrap + hostinfo: gobbled by package +99-10-01 iffe: add --config, yes{...}end no{...}end, fix read -r workaround +99-09-27 iffe: add --all --verbose, --* set options +99-09-22 regress: -v disables long line truncation +99-09-11 WWW.mk: WWWDIR and MM2HTMLINFO are now lists searched in $(HOME) +99-08-11 hostinfo: fix type sgi.mips4 +99-06-24 WWW.mk: add +99-06-08 hostinfo.sh: ${TMPDIR:-/tmp} +99-06-07 TEST.mk: add +99-06-01 iffe: add `siz type' for _siz_type == sizeof(type) +99-05-11 hostinfo,iffe,regress,use: long options +99-05-01 C.probe: fix over aggressive stdinclude, e.g., /usr/include/machine +99-04-01 hostinfo: sgi.mips? -o32 and -n32 checks + iffe: check that . is writable +99-03-17 hostinfo: fix for cc not found + dl.c,hello.c,m.c: headers in conditionals to force .DONTCARE + C.probe: extra check for include dirs pulled in by +99-03-03 regress: add `UNIT - ...' for extra args + Makefile: add (_hosttype_) prereq for cc +99-01-23 hostinfo: tweak rating, use /proc/cpuinfo if there +99-01-11 C.probe: shlib before lib, /usr before / +98-12-25 iffe: work around win32.alpha intrinsic clash with -O +98-11-11 regress: fix UNIT PATH lookup +98-11-01 regress: add PROG +98-10-01 hostinfo: add unixware.* + use: export PACKAGE_* +98-08-11 C.probe: add /usr/include check (for sco CC) + hostinfo: handle uwin uname update +98-05-01 regress: fix bug sometimes didn't list last test +98-04-01 hostinfo: add cc path arg + hostinfo: now works with /bin/sh + Makefile: strengthed -lm probe +98-01-23 Makefile: check for -ldl -lm + C.probe: handle gcc -v -E phony include dirs + iffe: fix lcl by dropping sort -u -- we need the real first + iffe: `mem x' to test if x is a non-opaque struct +98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3 + $(INSTALLROOT)/lib64 for sgi.mips4 + add cc.hp.pa +98-01-01 cc.sgi.mips*: turn off ld library multiply defined +97-10-11 regress: add VIEW function for locating data +97-10-01 Makefile: -ldl test moved to libdll Makefile +97-08-11 regress: add MOVE + regress: add SAME + regress: use getopts + regress: `EXEC' repeats previous test +97-07-17 use: tweak PATH and LIBPATH bootstrap order + iffe: fix lcl bug that botched pathnames with embedded spaces +97-06-12 iffe: add npt `needs prototype' test +97-05-09 hostinfo: mvs.* => mvs.390 + Makefile: cc.$(_hosttype_) workaround installed here + iffe: fix nolink{ ... }end + iffe: add [no]static{ ... }end for static link test + C.probe: _probe_PATH => _probe_export which must be eval'd +97-04-01 use: _RLD_ROOT set too +97-03-17 mm2html: changed inner loop + mm2html: handle .if|.ie|.el, .so + mm2html: handle different man styles + mm2html: differentiate mm/man in some non-obvious cases + hostinfo: r5000 is not mips4 +97-02-14 hostinfo: validate type with cc +96-12-25 C.probe: uwin tweaks + iffe: use `...` instead of $(...) for alpha /bin/sh + iffe: fix `typ' divide by 0 + iffe: `lcl' now drops X: prefix + iffe: +l* -> -l* + iffe: eval around ${...#%...} for bsd /bin/sh + use: add sgi.mips LD_LIBRARY_PATH variants + use: add -e to list exports + iffe: lcl leaves leading [a-zA-Z]: for dos + iffe: fix no{link|output|execute} logic + C.probe: don't automatically add /usr/include for non-hosted compilers + C.probe: don't automatically place /usr/include last + C.probe: check gcc style -v -E for stdinclude usrinclude +96-11-28 iffe: check BASH_VERSION for IFS botch + iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx) + hostinfo: fix sgi.mips[234] tests + hostinfo: fix ncr.i386 tests +96-10-31 iffe: work around old bsh here doc bug by running separate sh +96-10-11 iffe: *.iffe and *.iff for iffe src files + hostinfo: tighten sgi.mips cpu type check +96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib +96-09-17 iffe: fix typ bug that failed for single id types! +96-08-31 hostinfo: handle recent sgi hinv cpu changes +96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx +96-05-09 C.probe: drop multiple / in stdinclude +96-02-29 use: package root must have bin and lib subdir + mm2html: add + C.probe: probe_members += -whole-archive for gcc + iffe: add + fix the blasted `...'...\\...'...` +96-01-31 use: add pkg dir + hostinfo: add tandem +96-01-01 hostinfo: windows_nt|windows[0-9][0-9] -> win32 +95-11-24 hostinfo: linux-aout.* for non-elf linux +95-11-11 use: add aix LIBPATH +95-10-11 hostinfo: no args prints type +95-08-11 use: add +95-05-09 save original PATH in _probe_PATH + beef up library dir probe +95-04-01 use c source suffix if it still preserves the dialect + add hostinfo + add lib/hostinfo/typemap user type map + add sol.sun4 cpu count + fix C.probe to properly handle C/C++ combined compiler drivers + add NeXT to hostinfo + bummer: mach has /usr/bin/hostinfo +95-03-19 fix dialect executable test +95-03-19 --- release 0.0 --- diff --git a/lib/package/INIT.html b/lib/package/INIT.html new file mode 100644 index 0000000..42cb7cc --- /dev/null +++ b/lib/package/INIT.html @@ -0,0 +1,991 @@ + + + + + + + INIT package + + + + + +
+ +

+

INIT package

+The INIT package is required by all but the standalone +and self extracting archive packages. It contains +the package command, support scripts, and utilities. +The package command installs binary packages, makes +source packages, and generates new package tarballs. +Components in this package: +

+

+ + + +
+INIT
+

+The software is covered by this license: +

+Individual components may be covered by separate licenses; +refer to the component source and/or binaries for more information. +

+A recent +release change log +is also included. +

+


release change log

+
+
+All recorded changes follow.
+
+
+

+


INIT changes

+
+
+12-02-29 cc.darwin.i386*: handle default cc vs kernel bittedness
+12-02-29 C+probe: add __TIMESTAMP__ to the nopredefined list
+12-02-29 package.sh: don't assume grep -q or /usr/local/lib in LD_LIBRARY_PATH
+12-02-29 package.sh: fix ksh vs -lcmd compatibility checks
+12-02-23 iffe.sh: checkcc() before checkread() for sensible diagnostics
+12-02-14 package.mk: { --clobber --compare --link=lib*.a* } for --mam=static
+12-02-14 package.mk: export LICENSEFILEDEFAULT instead of LICENSEFILE
+12-02-14 package.sh: handle @(cc|ld).${HOSTTYPE}* intercepts
+12-02-07 package.sh: add { clean clobber } actions
+12-02-02 regress.sh: fix ulimit -c defaults for --nokeep
+12-01-18 regress.sh: add INPUT|OUTPUT|ERROR -e 'filter' to filter before comparison
+12-01-21 package.sh: fix `admin make' bug that created unused $INSTALLROOT/lib
+12-01-21 Makefile: :PACKAGE: license=ast -- oops
+12-01-20 cc.darwin,cc.mvs.390: tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
+12-01-12 package.sh: add admin make share closure to handle alternate HOSTTYPEs
+11-12-13 iffe.sh: add /*<NOSTDIO>*/ test code comment to disable default #include <stdio.h>
+11-11-11 C+probe: test for .so before .sl
+11-10-26 package.sh: don't forget about *.pkg for admin update
+11-10-18 cc.*-icc: update and add more
+11-10-11 package.sh: handle package make|view when no source installed
+11-09-11 package.sh: count admin '*** termination code' errors
+11-08-31 mamake.c: add -e, ignore use recursive prereq timestamps
+11-08-29 iffe.sh: add ``set stdio try1.h - try2.h ...''
+11-08-29 iffe.sh: trap EXIT => trap 0 for ancient sh
+11-08-11 iffe.sh: handle ancient sort that doesn't have -k
+11-06-01 make.probe: add more /lib64 logic
+11-05-01 package.sh: fix admin ditto to sync LICENSES too
+11-03-25 package.sh: initialize { $SED $TR } before first use!
+11-03-21 package.sh: fix vpath probes
+11-03-17 iffe.sh: fix cleanup to rm $tmp* instead of $tmp*.*
+11-02-24 package.sh: change curl usage to "curl -L ..."
+11-02-11 package.sh,C+probe,make.probe,mamprobe.sh: add ###.*archiac.*###
+11-02-02 Makefile: add :MAPLIB: check for ancient -lw
+11-02-02 make.probe: handle -print-multi-directory => 64 => /usr/lib64 /lib64
+11-02-02 package.sh: HOSTTYPE=*,*cc*[,-*,...] sets CC [ and CCFLAGS ]
+11-02-02 make.probe: handle gcc $ORIGIN link but exec failure -- gee thanks
+11-01-25 cc.hp.ia64: bundled cc is a pile of shaving cream
+11-01-07 iffe.sh: check debug==3 for is_hdr() failure
+10-11-22 ditto.sh: fix timing problem between |& and exec &p
+10-11-10 package.sh: fix cc cross compile check to use checkcc absolute path
+10-10-10 package.sh: list main env vars at start of make action
+10-10-10 ratz.c: tweak widnows delays
+10-09-10 ratz.c: add _SEAR_ARGS for _SEAR_EXEC
+10-09-01 package.sh: fix ratz from source logic
+10-08-25 package.mk: consolidate license file search in .package.licenses.
+10-08-22 ratz.c: run sear bootstrap command detached
+10-08-20 C+probe: version_stamp only if version_flags works
+10-08-17 package.sh: unset makerules *DIR variables in env
+10-08-15 package.sh: "make" action now lists some env values
+10-08-11 mktest.sh: add "DO command ..."
+10-07-27 rt.sh: handle "rt X=Y ..."
+10-06-29 ratz.c: non-option sear args passed to sear_exec()
+10-06-25 iffe.sh: "api" op chanegd to not do "map-libc" type mappings
+10-06-25 package.sh: "force admin ditto" => no ditto --update option
+10-06-22 C+probe: handle cc that require .[ci] input for version info
+10-06-21 ditto.sh: change default remote access to ssh (about time)
+10-06-12 regress.sh: DISGNOSTICS [ 1 | 0 | pattern ] and fix EXIT for all
+10-06-09 package.sh: add AT&T to usable nmake check
+10-06-06 iffe.sh,iffe.tst: add { api ver } ops
+10-04-22 package.sh: update "html binary|source" NAME/PASSWORD info
+10-04-15 iffe.sh: don't forget candidate headers for hdr|sys!
+10-04-11 WWW.mk: disable man page metarule -- now done by admin-man(1)
+10-02-14 package.sh: $CC verification needs $INSTALLROOT/bin in PATH
+10-02-11 package.sh: fix package admin make report error count
+10-02-02 package.sh: fix write binary bug that did scp on local fs
+10-02-02 package.mk: up to date binary targets must still be in PACKAGE.*.lst
+10-01-01 package.sh: fix premature $INSTALLROOT/bin during cross compile check
+10-01-01 make.probe: handle ['"] in CC.VERSION.STRING
+09-12-04 iffe.sh: add "opt name" to check for name in $PACKAGE_OPTIONS
+09-11-30 mktest.sh: change RESET to STATE.RESET to make it global
+09-11-14 make.probe: use gcc { -print-multi-directory -print-search-dirs }
+09-11-11 package.sh: re-order and combine cc checks
+09-10-27 C+probe,make.probe,probe.win32: add CC.SUFFIX.DEBUG
+09-10-21 iffe.sh,Makefile: test -e is not in ksh88!
+09-10-06 iffe.sh: handle cc -E #error with 0 exit status (sgi)
+09-10-06 package.sh: stub in ar intercept checks -- not used yet
+09-10-06 ar.ibm.risc: add ar intercept because some aix require -Xfoo first!!
+09-09-24 regress.sh: fix UMASK logic to create test support files before umask
+09-08-28 release.c: change docs to mention stdin if no file operands
+09-08-24 package.sh: fix isascii() bug that failed on od(1) trailing space
+09-08-20 make.probe: add CC.SHARED.NAME
+09-08-20 regress.sh: add { JOB CONTINUE EXITED KILL FIFO }
+09-08-11 package.sh: filter lines containing : for package results
+09-07-31 make.probe: add CC.AR.ARFLAGS (for aix ar -xany)
+09-07-31 package.sh,cc.*: fix -dumpmachine to handle 32/64/* bit options
+09-06-24 package.sh: fix admin.db output formatting
+09-05-05 package.sh: export dll hackery environment vars
+09-05-05 package.sh: handle non-identifier hostnames
+09-05-05 mamake.c: pass undefined ${...} identifiers to the shell
+09-05-05 mamake.rt: add macro expansion regression tests
+09-05-01 iffe.sh: fix output initialization *again*
+09-04-28 package.sh: handle admin.db contact field $9
+09-04-15 iffe.sh: add implicit "ini" op to initialize io for subsequent ops
+09-03-31 regress.sh: EXPORT before test => global ENVIRON[]
+09-03-26 package.sh: test fail pattern is 'fail[es]'
+09-03-26 UNIT - ... appends (options) to command line
+09-03-19 TEST.mk: x.tst => x only if x is command target
+09-03-15 regress.sh: add ${MAIN} for base name of main unit
+09-03-10 TEST.mk: add .SOURCE:tests if tests is a dir
+09-03-03 regress.sh: allow command line unit to override UNIT
+09-03-03 mktest.sh: handle IO == $'
+09-02-02 package.sh: delay $INSTALLROOT/bin/.paths generation until mamprobe runs
+09-01-30 cc.mvs.390: c89 balks at [ ()] in -Dname="..."!
+09-01-27 package.sh: add isascii() to use ratz instead of tar
+09-01-20 hurl.sh: add --size=bytes option
+09-01-08 TEST.mk: add test.* prereqs, multiple arg lists with :T=*: binding
+09-01-03 regress.sh: fix UNIT to allow command line override
+09-01-03 mktest.sh: handle TWD
+08-12-24 package.sh: fix cross-compile HOSTTYPE logic
+08-12-15 package.sh,hurl.sh: handle http codes { 301 302 303 }
+08-10-16 make.probe '-fno-stack-protector -fno-stack-protector-all' to cop out!!
+08-09-30 rt.sh: fix ksh93 regression test signal count
+08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input
+08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo
+08-09-20 make.probe: handle another /usr/bin/file shared lib description
+08-09-20 regress.sh: add --pipefail for SET pipe-input ...
+08-09-17 Makefile: add gdbm1.c for <gdbm-ndbm.h>
+08-09-10 make.probe: add CC.NOPROTECT
+08-08-08 mktest.sh: add --width=width
+08-08-05 dbm.req: favor sleepycat ndbm compatibility
+08-08-04 C+probe: fix stdlib initialization logic
+08-06-24 package.sh: fix $INSTALLROOT/bin/cc intercept time stamp file typo
+08-06-20 TEST.mk: make the localyunit before *.rt => *.tst -- doh
+08-06-20 mktest.sh: prepend $PWD onto PATH for local units -- doh^2
+08-06-11 regress.sh: fix bug that skipped the last test
+08-05-20 regress.sh: add --local to put *.tmp dir in local fs
+08-05-05 regress.sh: add IF command ... ELIF command ... ELSE ... FI
+08-05-01 package.sh: package test => ulimit -c 0
+08-04-28 regress.sh: fix EXPORT quoting
+08-04-28 regress.sh: fix UNIT set check args too
+08-04-24 rt.sh: exit code > 256 => signal termination
+08-04-10 C+probe: change probe_so order to check .so last (macos ld workaround)
+08-04-01 package.sh: handle multiple admin HOSTTYPEs per HOST
+08-03-28 C+probe: add C++ #include <iostream> (no extension) dir probes
+08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally
+08-02-28 make.probe: fix probe_warn to include ld!
+08-02-02 make.probe: add CC.RUNPATH to match default -L order
+08-01-31 package.sh: check lib64 for LD_LIBRARY_PATH
+08-01-31 iffe.sh: tweak ancient /bin/sh workarounds
+08-01-28 make.probe: darwin ld export dynamic is -force_flat_namespace
+08-01-28 C+probe: handle sgi cc error message but exit 0 botch(es)
+08-01-23 package.sh: fix checksum doc typo
+08-01-09 C+probe: add __FUNCTION__ to the undef (don't check) list
+07-12-14 iffe.sh: add set nooptimize
+07-12-03 package.sh: add LC_ALL=C
+07-11-27 package.sh: fix overaggressive *.md5 cleanup
+07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal
+07-11-05 package.sh: fix write op error count pattern
+07-11-05 package.mk: fix $(~req) .ver binding
+07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING]
+07-08-01 package.sh: handle 'package read lcl|tgz'
+07-05-08 regress.sh: execute basename instead of absolute path for short $0
+07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer
+07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh
+07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...}
+07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG
+07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe
+07-03-28 package.sh: fix binary tgz architecture type duplication
+07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst
+07-03-28 iffe.sh: add -F header to mac test
+07-03-23 make.probe: handle file(1) that returns 'archive' for .so
+07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF
+07-03-11 package.sh: add nocopyright and tst => nocopyright
+07-03-11 package.mk: add copyright=0
+07-03-08 C+probe: restore IFS after probe.ini
+07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR}
+07-01-05 package.sh: fix "admin write binary" logic
+07-01-01 iffe.sh: add "cmd" --verbose trace
+07-01-01 iffe.sh: sort => LC_ALL=C sort
+07-01-01 C+probe: LC_ALL=C
+06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local!
+06-11-23 package.sh: *.md5 are not tarballs -- doh
+06-11-23 iffe.sh: add -F, --features=feature-test-header
+06-11-11 make.probe: favor lib64 over lib for hosttype==*64
+06-10-31 make.probe: add "-ignore-source-dir -iquote" test
+06-10-31 iffe.sh: add status{...} code block
+06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?)
+06-10-11 package.sh: handle already gunzip'd *.tgz
+06-10-06 iffe.sh: add reference for header content tests
+06-09-27 regress.sh: fix UMASK to do DO too (duh)
+06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics)
+06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together
+06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too
+06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io
+06-09-05 C+probe: add { probe_version version_stamp version_string }
+06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING]
+06-08-27 regress.sh,mktest.sh: add UMASK
+06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE
+06-08-25 mktest.sh: add IGNORESPACE
+06-08-24 mktest.sh: handle  00 in data
+06-08-24 regress.sh: handle -f* for INPUT|OUTPUT|ERROR
+06-08-16 package.sh: fix 'install flat' logic
+06-08-11 rt.sh: handle style=shell %K date format
+06-07-17 ratz.c: fix __MVS__ FAR definition
+06-07-17 iffe.sh: "header x.h" -- deprecate "include x.h" for .SCAN.iffe
+06-07-17 package.sh: differentiate urls vs. assignments
+06-06-27 rt.sh: add --failed, --heading
+06-06-27 C+probe,TEST.mk,make.probe,mktest.sh,regress.sh: 'ulimit -c 0'
+06-06-26 cc.darwin.ppc: handle -lcc_dynamic disappearance
+06-06-25 mktest.sh: implement PROG
+06-06-11 Makefile: add -ldbm :MAPLIB:, provide public MAPLIB.mk
+06-05-06 package.sh: add PACKAGE_admin_tail_timeout
+06-05-22 ratz.c: upgrade to zlib-1.2.3
+06-05-09 package.sh: fix admin.db docs
+06-03-11 package.sh: fix `package use - command ...'
+06-03-05 make.probe: work around pedantic bash 3.1 mismatched " in `.`
+06-02-14 package.sh: "results failed test" == "results test failed"
+	 cc.sgi.*: add _AST_cc_OPTIONS parameterization, -OPT:Olimit=0
+	 cc.linux.ia64-icc: add for intel cc
+06-02-02 package.sh: freebsd stuck with os version for all arch
+06-02-01 package.mk: fix locale logic (tw -d requires dir arg)
+06-01-31 package.sh: require $CC only for make|test
+06-01-30 package.sh,hurl.sh: use the backwards-compatible --http-passwd
+	 package.sh: add more pdksh => /bin/sh checks
+06-01-26 package.sh: wget --http-pass => --http-password
+	 package.sh: fix wget error logic
+	 hurl.sh: wget --http-pass => --http-password
+06-01-11 package.mk: pass package.license.class to make --mam too
+	 package.mk: variants=pattern => --variants=pattern
+	 package.sh: darwin rel<=7 => darwin7.ppc
+	 package.sh: freebsd rel<=4 => freebsd4
+	 package.sh: freebsd rel<=5 => freebsd5
+05-12-07 iffe.sh: don't emit <stdio.h> if <sfio.h>|<ast.h> (XXX)
+05-12-05 make.probe: disable readonly.exe core dump via ulimit -c 0
+05-09-22 mktest.sh: add EXEC [ ++NOOUTPUT ++NOERROR ++NOEXIT ]
+05-09-21 mktest.sh: fix --style=shell compare to ignore \r
+05-09-12 TEST.mk: all --force to force %.rt regeneration
+05-09-05 TEST.mk: regenerate from %.rt only if newer, :SAVE: %.tst
+05-08-25 mktest.sh: add
+	 TEST.mk: add %.rt=>%.tst for mktest
+05-08-18 package.sh: 'package host cpu' now checks $NPROC first
+05-07-17 iffe.sh: add { define extern include print } ops
+	 iffe.sh: accept output{...}end output on success only -- doh
+05-07-01 package.sh: add TARPROBE for tar B flag probe
+05-06-24 package.sh: fix binary read chmod via *.sum
+05-06-06 package.sh: fix KEEP_HOSTTYPE logic to handle synthesized types
+05-06-01 make.probe: verify that cc_pic works for hosted cc
+	 cc.lynxos.ppc: make -mshared the default
+	 package.sh: note $INSTALLROOT/bin/@(cc|ld|ldd) installation
+05-05-25 make.probe: add CC.INCLUDE.LOCAL instead of -I- in CC.DIALECT
+05-05-24 iffe.sh: really fix grouping logic -- with tests this time
+	 package.sh: pipe/socket configuration mismatches => use /bin/sh
+05-04-28 TEST.mk: add $(TESTS)
+05-04-19 package.sh: package results test uses rt if possible
+	 iffe.sh: fix 'op var - ... - ...' grouping logic
+05-04-15 rt.sh: handle autom4ate style
+05-04-11 regress.sh: fix unit name when command line unit also specified
+	 rt.sh: handle all ast package test output formats
+	 package.sh: fix make docs for options passed to underlying make
+05-04-08 package.sh: cp -p makerules.mo to $OK to preserve mtime
+	 regress.sh: add "TITLE name" to change TEST output title
+05-04-01 rt.sh: add pretty make test + regress.sh wrapper
+05-03-29 package.sh: test -e path => test -f path -o -d path
+05-03-24 make.probe: fix CC.PICBIG probe to prefer -fPIC over -fpic -- doh
+05-03-19 mamake.c: command line name=var also defines name.FORCE=var
+05-03-11 regress.sh: unset LC_ALL when LC_* EXPORT'd
+	 package.sh: old make.out saved in circular make.out.[1-9]
+	 mamake.c: sync with nmake :W=O:
+05-03-01 package.sh: fix flat hierarchy initialization
+	 package.sh: admin action now properly resets sibling remote logs
+	 package.mk: relax unknown/unwritten package messages to warnings
+	 package.sh: handle space in command line name=value
+	 make.probe: add mvs -Wc,dll,exportall,longname,rent to CC.DLL probe
+05-02-24 package.sh: hosttype *.powerpc => *.ppc
+	 cc.lynxos.ppc,ldd.lynxos.ppc: add
+05-02-22 mamake.c: fix { -G --debug-symbols -S --strip-symbols } MAMAKEFLAGS bug
+05-02-20 probe.win32: handle /platformsdk mount
+05-02-19 package.sh,package.mk: add write tst for tgz in tst subdir
+05-02-18 package.sh: accept cc -dumpmachine with 0 or 1 -
+05-02-14 package.sh: handle mutiple architectures per host in admin.db
+	 Makefile,package.sh: honor $INSTALLROOT/bin/.paths overrides
+	 package.sh: normalize trailing [-_]bits in host type
+	 iffe.sh: some ksh-compatible shells don't do *(pattern)
+05-02-11 iffe.sh: back out 05-01-11 child process stdin hijack
+	 cc.lynxos.i386: -dynamic instead of -static default
+05-02-10 package.sh: cyg usr/doc => usr/share/doc
+05-02-08 package.sh: drop -m with pax -- delta bug fixed 2005-02-08
+	 iffe.sh: work around old bash 0<... redirection bug
+05-02-06 package.mk: source.tgz: update generated files only when they change
+05-02-02 *.sh,*probe: IFS may be unset and { ash bsh } don't on startup -- wow
+05-01-11 package.sh: update setup docs to include authorize+password
+	 package.mk: fix .source.cyg final directory edit
+	 package.mk: notice=1 for conspicuous empty NOTICE file
+	 WWW.mk: fix *-index.html installation
+	 filter.sh: retain input file suffix in tmp copy
+	 mamexec.c: fix non-contiguous "exec" bug that skipped lines
+	 iffe.sh: fix candidate lib test to try grouping subsequent libs
+	 iffe.sh: fix child process stdin hijack that skipped input lines
+	 iffe.sh: --shell=osh to force read -r compatibility command
+	 iffe.sh: chop iffe input leading space before # for KnR compatibility
+05-01-05 package.sh: add ${TAR} ${TARFLAGS} and tar B flag for pipes
+	 mamake.c: fix makefile scan to ignore lib*.[hH]
+	 iffe.sh: immunize function/symbol tests from aggressive -O
+04-12-28 WWW.mk: add :WWWPAGE: faq.*.mm index generator
+04-12-21 ratz.c: make sure tmp dir is writable -- doh
+04-12-08 iffe.sh: fix dat test for aggressive -O
+04-12-01 iffe.sh: add `include file' to pull in #define's for `exp'
+04-11-11 package.sh: default MAKESKIP is "*[-.]*"
+04-10-22 ratz.c: change docs to note zlib license
+	 mamake.c: handle --debug-symbols and --strip-symbols
+	 package.sh: make (debug|strip)=1 => --(debug|strip)-symbols
+	 package.mk: add :LICENSE: => package.license.class
+	 mamake.c: fix recursive order logic
+04-10-18 package.mk: add :LICENSE:, :OMIT: to omit package subdirs
+04-10-11 package.sh: add 'authorize name' and 'password password'
+04-10-01 iffe.sh: double check $static link with ! $static
+	 Makefile: add BUILTIN_LIB to $INSTALLROOT/bin/.paths
+	 make.probe: add CC.DIALECT EXPORT={ALL,REF,EXT,DLL}
+	 package.sh: add BUILTIN_LIB to $INSTALLROOT/bin/.paths
+04-09-21 package.mk: $(init)$(name) is now an implicit prereq
+04-09-09 package.sh: copy makerules.mo to $INSTALLROOT/bin/ok
+04-09-01 package.mk,package.sh: rename *.txt => *.README
+	 package.mk: add the runtime package type (no *.[ah])
+	 iffe.sh: fix key test reports
+04-08-26 Makefile: { add m2.c m3.c } -lm tests for { frexp[l] ldexp[l] }
+04-08-11 package.mk: handle HOSTTYPE for solaris > 9 
+	 package.sh: add `checkaout proto' for { make view }
+	 package.sh: check for { md5sum md5 }
+	 iffe.sh: add {if|elif|else|endif} test ...
+	 iffe.sh: add 'exp - expression' and '( expression )'
+	 iffe.sh: add 'name = test ...' user defined macros
+	 iffe.sh: add '! test ...' negation
+	 TEST.mk: add implied { .c .sh } generated prereq
+	 cc.darwin.ppc: handle 10.3 -dylib mess
+04-08-01 package.mk: let include handle nested requirements -- duh
+04-07-31 package.sh: attempt a second ping before admin assumes host down
+04-07-26 package.sh: fix hp.ia64 HOSTTYPE
+04-07-23 probe.win32: generalize #include dir order search
+04-07-17 regress.sh: add INPUT -x for chmod +x
+04-07-01 regress.sh: TMP => TWD
+04-06-29 regress.sh: put COMMAND in $TWD too
+04-06-21 regress.sh: mkdir -p INPUT and OUTPUT intermediate dirs
+	 TEST.mk: add :TEST: -- to disable .c .sh search
+04-06-18 TEST.mk: add .SCAN.tst
+04-06-17 regress.sh: TEST returns true if active, false otherwise
+	 regress.sh: add CD to change test pwd from $TWD
+04-06-16 regress.sh: add TWD for ./unit.tmp override
+	 regress.sh: DO now flushes previous test
+	 regress.sh: INPUT and OUTPUT handle -f for printf instead of print
+04-06-11 package.sh: make sure $INSTALLROOT/bin is in front of $PATH
+	 package.sh: skip nmake if older than 2000-10-31
+04-05-20 package.sh: fix arg vs. package parse with - or '' to disambuguate
+04-05-11 package.sh: package verbose update lists closure for package setup
+	 package.sh: add src/lib/libardir to nmake proto bootstrap
+	 regress.sh: probe for rm -u vs. chmod -R u+rwx
+04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH
+04-04-15 make.probe: check probe_libdir false positives
+	 package.sh: add lib/package/*.lic src package subdirs
+	 package.mk: add mamfile=0 to inhibit Mamfile generation
+	 iffe.sh: config name_DECLARED => HAVE_name_DECL
+	 iffe.sh: fix mac to handle default value
+04-04-11 iffe.sh: normalize sed [\\\\/] quoting
+04-04-04 package.mk: only checksum generated tarballs
+	 mamprobe.sh: add STDCHMOD
+04-04-01 C+probe: set export LANG=C for uniform error messages
+	 make.probe: another CC.STDLIB tweak
+	 package.sh: fix regress core dump pattern, expand [a-z] match ranges
+04-03-31 Makefile: add intl :MAPLIB: test
+	 make.probe: fix CC.STDLIB search; drop CC.* path duplicates
+04-03-28 iffe.sh: drop unused exec $stdin<&0 dup
+04-03-25 Makefile: add iconv :MAPLIB:
+	 package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override
+04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz)
+	 package.sh: update base change on md5 sum instead of size
+	 iffe.sh: adjust case label  and keyword quoting for ancient /bin/sh
+04-03-22 probe.win32: ncc => nld
+04-03-19 CONVERT.mk: change the instructions and old source dir default
+	 package.mk: fix recurse=list check
+	 package.mk: add *.md5 checksum for each *.(c|exe|tgz)
+	 package.sh: fix update base/delta/sync existence check
+04-03-18 iffe.sh: -d2 does not remove core dumps on exit
+04-03-17 package.sh: fix make recurse arg/action order
+04-02-29 package.sh: add regress action to compare current and previous tests
+	 package.sh: fix sgi.mips[23] HOSTTYPE test for old irix cc
+	 package.sh: add `export variable ...'
+	 package.sh: admin action now handles host name with non-id chars
+	 package.sh: non-numeric M T W in admin.db disables that action
+	 package.sh: fix admin write binary local vs. shared clash
+	 cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable
+	 cc.hp.pa64: sync with cc.hp.pa
+	 cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib
+	 probe.win32: sync with make.probe
+	 make.probe: fix last chance dynamic test
+	 make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E
+	 make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall
+	 make.probe: move probe_dll_def to the end of probe_dll
+	 package.mk: capture subcomponent mamfile recursion
+04-02-24 make.probe: strip "..." from cc/ld traces
+	 iffe.sh: add ``set [no]define'' to disable macro #define/#undef
+04-02-23 make.probe: rework CC.LD search
+04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export
+	 make.probe: resurrect CC.PIC with separate semantics from CC.DLL
+	 make.probe: add CC.SHARED.LD for CC.SHARED linker
+	 C+probe: clear DISPLAY to stifle interactive windows
+04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end
+	 make.probe: add { CC.AR CC.SIZE }, fix cross command search
+	 cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug
+04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++
+04-02-04 package.sh: fix cross compilation bug that mixed binary formats
+04-02-02 package.sh: package admin now ditto's bin/package too
+04-01-30 cc.sgi.mips3: drop warning 3421
+04-01-11 regress.sh: output label#count for tests in loops
+04-01-05 regress.sh: fix bug that ignored the first SAME
+04-01-04 crossexec.sh: fix typo that did not recognize rcp
+03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse()
+03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency
+03-09-23 ratz.c: fix tar header number parse bug that skipped to next number
+	 regress.sh: rm cleanup now handles files matching -*
+03-09-11 iffe.sh: add unnamed { ... } blocks
+	 regress.sh: add COPY from to, like MOVE but comprison still done
+	 regress.sh: rm -rfu to handle test dirs w/o u+rwx
+03-08-14 Makfile: add hello.c to the manifest
+03-08-11 package.sh: fix `html binary' generation
+03-06-21 package.sh: fix INITROOT initialization bug
+	 package.sh: make sure admin logs exists before tail'ing
+03-06-11 probe.win32: fix $(BINDIR) typo that expanded in sh instead of make
+	 cc.mvs.390: return code 4 yields exit code 3 but its *really* ok
+	 package.sh: fix onpath function global var conflict
+	 make.probe: add CC.DIALECT { GNU -dD }
+	 package.mk: add Mamfile to lcl manifest
+03-06-10 package.sh: fix setup action typo that only checked the INIT package
+	 package.sh: *.s390x => *.s390-64
+03-06-09 package.mk: add cyg :POSTINSTALL:
+03-06-08 make.probe: fix CC.STDLIB logic
+	 hurl.sh: add User-Agent identification
+	 package.sh: tweak source and binary installation instructions
+	 cc.hp.pa,ld.hp.pa: +-Wl,+cdp,${INSTALLROOT}/lib/: drops abs lib paths
+	 ldd.hp.pa: add
+03-06-06 package.sh: fix $INSTALLROOT/bin/ldd check
+	 make.probe: add CC.STDLIB verification
+03-06-04 make.probe: add +forceread +noforceread
+03-05-11 hurl.sh: handle http://host:port/path
+03-05-06 package.sh: fix setup action PACKAGEROOT and INIT logic
+03-05-05 package.mk: fix cygwin tarball names
+03-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile
+03-04-27 make.probe: fix mvs CC.PREFIX.SHARED "lib" => ""
+	 make.probe: add CC.DLL.DIR = $(BINDIR) or $(LIBDIR) 
+	 make.probe: add { CC.LD.LAZY CC.LD.NOLAZY CC.LD.RECORD CC.LD.NORECORD }
+	 probe.win32: sync with latest CC.*
+03-04-25 mamprobe.sh: add args to `. $makeprobe' for ancient sh
+03-04-23 package.mk: fix dup "covered by" licenses
+03-04-22 probe.win32: CC.DIALECT += "LIBPP -I-" for all cc's
+	 package.sh: fix admin write binary tarball snarf
+03-04-21 package.mk: package covered *.@(pkg|lic) too
+03-04-15 package.mk: don't generate incremental archives for lcl 
+	 package.mk: add incremental=[source:1 binary:0] archive control
+	 package.sh: generate $INSTALLROOT/bin/cc wrapper for CC != cc
+	 package.sh: admin must ditto lib/package/*.@(pkg|lic) too
+	 mamake.c: ignore time of ignore prereqs
+	 mamake.c: -D2 lists propagated times
+03-04-11 package.mk: tidy up cyg tarballs
+	 package.sh: fix old shell clash between get() and $get
+03-04-05 package.mk: restore *.inx generation somehow lost during cyg additions
+	 package.sh: add pthread_num_processors_np() last resort for cpu count
+	 package.sh: use `make believe' to accept mamake generated files
+	 package.sh: handle `make [make-flags] [target ...]'
+	 mamake.c: ignore -e
+03-03-21 package.mk: fix cyg old make typo
+	 package.sh: switch to `package setup' instructions
+03-03-19 package.sh: add registry checks for `host cpu'
+	 package.sh: `results failed' now lists core dump messages
+03-03-17 package.sh: on cygwin verify 'ntsec binmode' in $CYGWIN or die
+	 Makefile: install gcc wrapper if no cc
+	 package.mk: add :DETAILS: { :README: :EXPORT: :INSTALL: :TEST: } ops
+03-03-12 package.mk: add :DETAILS: for style-specific details
+03-03-11 package.sh: add beta setup/update support
+	 TEST.mk: add (TESTCC) prereq for .sh tests
+03-03-07 hurl.sh: add
+03-03-06 iffe.sh: fix lib win32 test cygwin vs native incompatibility
+	 iffe.sh: change internal stdio.h guard to handle C++ inline vs. macro
+03-03-03 package.sh: check for curl or wget for update
+	 package.sh: add setup action == update read make
+	 package.sh: fix packageroot() typo that showed up in non ~user shells
+	 mamake.c: treat name+=value args like name=value
+	 mamake.c: add ${var?*|value?match?no-match?}
+	 mamake.c: fix archive vs. dynamic bind logic
+03-02-28 package.sh: add the "cyg" (cygwin) package type
+	 package.mk: add "cyg" stubs, :CATEGORY: for category name(s)
+03-02-25 mamake.c: add -D4 system(3) debug trace
+03-02-24 package.mk: change --mismatch to --corrupt=accept
+03-02-14 ratz.c: add _WIN32 setmode([01],O_BINARY) and fopen "rb"/"wb"
+03-02-12 Makefile: handle getconf LIBPATH with host pattern
+03-01-31 package.mk: fix .lic search
+03-01-30 package.sh: handle { INIT ksh nmake } already installed elsewhere
+	 package.sh: admin handles command outside of $PACKAGEROOT/bin
+	 Makefile: install $(INSTALLROOT)/lib/make/package.mk
+03-01-28 package.sh: admin remote commands on one line to please syslog
+03-01-23 probe.win32: borland and mingw32 tweaks
+03-01-22 package.sh: fix $CC test to ignore set -x trace -- duh
+03-01-16 ditto.sh: tw --chop on by default
+03-01-14 package.sh: use /bin/cp to copy previous binaries to bin/ok/
+	 package.sh: admin now initiates remote exec and copy from local host
+03-01-12 package.sh: handle admin "xxx:" default root
+03-01-03 probe.win32: add /usr/include/borland path truncation workaround
+02-12-10 iffe.sh: add <&$nullin >&$nullout to checkread() $cc
+02-12-06 probe.win32: fix inlcude => include typo, add lcc lib
+	 probe.win32: CC.MAKE.OPTIONS = nativepp=0
+02-12-04 mamake.c: fix ${foo-bar} to expand foo if defined
+02-11-28 probe.win32: add C++ and -I- CC.DIALECT checks
+02-11-26 package.sh: package release now checks for second level files
+02-11-22 package.sh: update action now uses HTTP/1.0
+02-11-21 probe.win32: update the vc include dir test
+02-11-20 make.probe: fix CC.LD.ORIGIN typo that expanded make var
+02-11-13 packahe.mk: fix list.install => list.installed typo
+02-11-12 make.probe: add CC.LD.ORIGIN for a.out origin dir relative dll search
+	 make.probe: add CC.LD.STRIP for link time a.out strip
+	 package.sh: fix package_use vs. PACKAGE_USE check
+02-10-24 WWW.mk: fix bug that required a :WWWBIN: assertion to post
+02-10-23 mamake.c: fix unuinitialized time in make()
+	 ratz.c: fix meter buffer overflow
+02-10-20 package.sh: fix lib/probe/C/make/probe update test
+02-10-18 probe.win32: update for mingw
+	 make.probe: add bash workaround to SHELLMAGIC test
+	 package.sh: work around yet another cygwin hassle
+02-10-17 iffe.sh: short circuit id check for *[-+/\\]*
+02-10-08 regress.sh: unset FIGNORE to avoid rm . errors
+	 package.sh: unset FIGNORE to avoid rm . errors
+	 package.sh: $CC must at least compile and executable hello world
+02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz
+	 package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS)
+	 iffe.sh: add identifier checks for tests that (implicitly) require them
+	 iffe.sh: disambiguate a few --config macros
+02-10-02 iffe.sh: fix shell=bsh `hdr a/b'
+02-09-30 package.sh: handle chmod of -* files
+	 package.sh: verify that $SHELL is Bourne compatible
+	 package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation
+	 iffe.sh: fix bug that didn't define mac variable on success
+02-09-22 package.sh: handle admin_action=ditto
+	 iffe.sh: --config sizeof(foo) macro is SIZEOF_foo
+	 iffe.sh: fix long.long test so it doesn't defeat uwin "typ long.long"
+	 mamprobe.sh: convert $("foo") nmake string constants
+02-09-21 mamprobe.sh: "-" info-path writes probe info to stdout
+02-09-11 make.probe: move from nmake src to be part of mamprobe.sh
+	 mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end
+	 mamake.c: pass cc absolute path to mamprobe
+	 package.sh: generate mamprobe -- yuk (at least its confined to INIT)
+	 iffe.sh: lcl,nxt: drop default sys/ check
+	 ditto.sh: tw --logical by default; add --physical
+02-09-10 package.sh: SHELLMAGIC creeps into package too -- duh and fooey
+02-09-09 ditto.sh: test that remote .profile exists before sourcing
+02-09-06 package.sh: don't ditto nfs junk
+	 ditto.sh: --show now lists directory ops instead of enumerating all
+02-09-05 ditto.sh: add --remote={rsh|ssh}
+	 package.sh: add admin [[{rsh|ssh|-}]:]directory
+02-09-02 iffe.sh: change 'print -r --' to 'print -r -' for ksh86 compatibility
+02-09-01 cc.unix.mc68k: add for ancient 3b1
+02-08-22 package.sh: fix component() to test for components -- duh
+	 Makefile: add LICENSE:.DONTCARE to workaround mam
+02-08-11 iffe.sh: provide defaults for LD_* additions
+02-08-07 ratz.c: change -m to use * instead of non-portable inverse video
+02-07-17 mamprobe.sh: close tmp file in trap before rm for cygwin
+	 package.sh: fix "type" to handle i1586 (P4)
+	 package.sh: add the view action
+02-06-28 package.sh: handle multiple packages for release action
+02-06-27 package.sh: catch sol*.sparc=>sol*.sun4 when CC=gcc
+02-06-14 package.sh: fix admin_action to not include qualifiers
+	 package.sh: fix help/html doc typo
+02-06-11 package.sh: fix ditto update doc to `PACKAGEROOT field matching *:*'
+02-06-07 WWW.mk: change substitute $(") to 
+02-06-06 package.sh: clarify output streams for help/html
+02-05-22 mamake.c: fix executable file check to use (S_IXUSR|S_IXGRP|S_IXOTH)
+02-04-04 package.sh: fix update to differentiate *.sun4 and sun4
+02-03-27 package.sh: yacc/bison warning only if both missing
+02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems
+02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package
+	 package.sh: precheck $CC, not `cc'
+	 package.sh: fix install to use pax -ps to preserve set-uid/gid
+	 package.sh: fix install to use list.installed for existing files only
+02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read
+	 package.sh: fix update delta sync fetch
+02-02-14 iffe.sh: fix macro{ }end docs to include "
+	 iffe.sh: add dfn to extract #define from headers
+	 iffe.sh: handle nxt #include ok but no line sync
+	 iffe.sh: drop local header clash logic
+	 iffe.sh: add -X, --exclude=dir to exclude -I dirs
+	 iffe.sh: lcl,nxt now generate <...> headers instead of "..."
+	 package.sh: admin.db root dir matching -* disables host
+	 package.mk: fix package.src.pat typo -- too many )
+	 package.mk: add { :COVERS: :DESCRIPTION: :REQUIRES: }
+	 package.sh: handle { :COVERS: :DESCRIPTION: :REQUIRES: }
+	 Makefile: move proto.c generation to the proto component dir
+02-02-02 execrate.sh: add for .exe challenged win32 systems/commands
+	 mamprobe.sh: add STD* commands/flags
+	 mamake.c: update mamprobe info when older than mamprobe executable
+	 package.sh: move ed/ex workaround to mamprobe.sh
+	 package.sh: fix `host type' bug that incorrectly assumed sun4 for sol
+	 package.sh: add execrate(1) hooks for challenged systems
+	 package.sh: add check for { cc ar nm yacc/bison } before make
+	 ratz.c: fix "rb" vs. "r" macro tests
+	 iffe.sh: add nxt, similar to lcl but defines _nxt_foo for #include
+	 iffe.sh,package.sh: remove vaibale from sccs,cvs ident strings -- duh
+02-01-24 C+probe: check CC.DYNAMIC to handle cc that accept but ignore -B*
+	 iffe.sh: handle 'mem struct.a.b'
+02-01-22 iffe.sh: cache (internal) `foo vs. struct foo' test results
+	 package.sh: uts.370 => uts.390
+02-01-18 package.sh: fix uts hosttype
+02-01-17 package.sh: add 'results failed ...' to list failures only
+	 package.sh: change ARCH internal var to all_types to avoid env conflict
+	 iffe.sh: fix hdr/lib precheck that missed some -- ouch
+	 iffe.sh: fix noexecute test that forgot to check compile first!
+02-01-15 ratz.c: fix path[] type typo
+02-01-01 package.mk: tighten license search
+02-01-08 package.sh: `pwd` => ${PWD:-`pwd`}
+	 package.mk: expand license file pattern match
+02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value"
+	 iffe.sh: fix initial <sys/types.h> check to honor --config
+01-12-25 iffe.sh: fix bug where -o file restored old file
+01-12-23 package.mk: uniq the closure lists
+01-12-07 ratz.c: fix --meter to retain paths containing " -- "
+01-11-30 ratz.c: use sear_system() to execute; should work on all windows
+01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status
+01-11-26 ditto.sh: drop n+=v for ksh compatibility
+01-11-21 ditto.sh: add rsync script replacement [hey, it works!]
+	 package.sh: add [ditto]:directory notation to admin.db
+01-10-31 package.sh: handle *.sum paths with embedded space
+	 package.sh: change executable() to onpath()
+	 package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack)
+	 package.sh: add os2 fix to `host type'
+	 mamake.c: add .exe hack
+	 iffe.sh: fix intrinsic function lib test
+	 mamprobe.sh: update pic probe to match make.probe for linux.ia64
+01-10-30 package.sh: make action skeleton view now checks subdirs
+01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP
+	 package.mk: tarball package.notice replaces `license accepted' prompt
+	 package.sh: eliminate `license accepted' prompt
+	 package.sh: add update to download latest from a url
+	 package.sh: use builtin arithmetic when we know its ksh
+	 iffe.sh: unkown -> unknown
+01-10-18 package.sh: convert to YYYY-MM-DD delta releases instead of NNNN
+	 package.mk: convert to YYYY-MM-DD delta releases instead of NNNN
+	 ratz.c: fix -m for paths containing <\>n\r\v
+01-10-16 ratz.c: _SEA_* => SEAR_*
+	 ratz.c: preserve stdin for sear_exec()
+	 ratz.c: add recursive sear_rm_r() to sear_exec() tmp dir cleanup
+01-10-10 mamprobe.sh: add mam_cc_SHELLMAGIC
+	 package.sh: add nfs wakeup call to admin to avoid stale file handles
+01-10-04 cc.darwin.ppc: -flat_namespace is not longer the default (huh)
+01-10-01 package make: prepend $INSTALLROOT/bin/ok to PATH
+	 package read: save cpy of bin/package when reading the INIT package
+	 mamprobe.sh: allow cc path with optional arguments
+01-09-24 Makefile,package.sh: add $INSTALLROOT/bin/.paths initialization
+01-09-19 package.mk: add recurse to list.package.*
+	 package.sh: bootstrap build nmake with _BLD_STATIC for _WIN32
+01-09-11 ratz.c: add _SEA_SKIP & _SEA_COMMAND for self extracting archives
+01-09-07 package.mk: fix output capture to not generate files names with spaces
+01-09-07 package.mk: fix delta release number search
+01-08-11 package.mk: handle single gz executable packages (e.g., for ksh)
+	 package.sh: fix package install to require nmake only if no *.sum
+	 iffe.sh: drop ancient menu and prompt actions; check ./hdr.h clash
+01-07-17 package: fix use cross compile test to generate files in /tmp 
+01-06-27 ratz: handle hard and soft links if possible
+01-06-07 Makefile: fix :MAPLIB: for sco
+01-05-31 crossexec.sh: add
+	 iffe.sh: add -x crosstype to run crossexec
+	 iffe.sh: exp test now handles pass{}end fail{}end yes{}end no{}end
+	 package.sh: add package host canon external-host-type-name
+	 package.sh: fix `use USER' lookup for shells that support ~USER
+	 cc.*: add -dumpmachine to dump target HOSTTYPE
+01-05-18 iffe.sh: drop $HOME/tmp/t.sh debug trace -- oops
+01-05-01 mamake.c: scan() now handles :PACKAGE: foo:command
+01-04-26 *.sh: expand [a-z][A-Z][0-9] for non-contiguous character codes
+	 iffe.sh: fix run *.sh for shells that don't $* across . command
+	 cc.mvs.390: recode for /bin/sh
+01-04-25 package.mk: include non cc-g variants by default
+	 package.sh: *[._]* => *?[_.]* for mvs.390 /bin/sh
+01-04-24 TEST.mk: no tests for VARIANT=="DLL"
+01-04-22 package.mk,package.sh: tarball text members are ascii encoded
+01-04-18 package.mk: allow package name to be the same as one of its components
+         cc.mvs.390: handle .C .cpp .cxx
+         cc.mvs.390: compensate for -o that does not overwrite
+01-04-01 regress: fix SAME that just skipped it -- we should regress regress!
+	 iffe: fix bug that didn't emit _hdr_foo for internal hdr tests
+	 iffe: fix lcl bug for cc -E that doesn't emit line syncs
+	 ratz: add ascii=>ebcdic conversion for text archive members
+	 mamake: fix buffer overlap bug that clobbered the probe file path
+01-03-17 iffe: handle : separator as first arg
+01-03-15 mamake.c,ratz.c,release.c: add <stdlib.h> and <string.h>
+01-02-26 iffe.sh: fix bug that omitted runtime #define for `mac' op
+01-02-22 cc.ibm.risc: handle SF_CLOSE clash in <sfio.h>
+01-02-14 cc.sgi.mips3,cc.sgi.mips4: handle -mips2 -mips3 -mips4 for cross cc
+	 C+probe: quote "$cc" when its an argument!
+	 mamake: execute actions with $SHELL, ignored signals back to default
+	 package.sh: nmake check error output to /dev/null
+	 package.sh: fix INIT a.out updates for knr cc
+	 package.sh: package list now handles large tgz dirs
+	 package.sh: *-ok executables moved to ok/* for *.dll systems
+	 iffe.sh: change "exec >&-" to "exec >/dev/null" else linux mkdir fails!
+	 mamake: handle `bind -lx [dontcare]'
+01-02-12 ratz.c: fix _PACKAGE_ast includes
+	 package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/
+	 package.sh: $CC ^HOSTTYPE=[A-Za-z_0-9.]*$ overrides HOSTTYPE
+	 iffe.sh: fix dat code that used previous $tmp.exe
+	 iffe.sh: fix dat code for _DLL imports
+01-02-09 iffe.sh: add copy() for shells with the dissappearing here doc bug
+01-02-08 Makefile: guard against null $(CC.HOSTTYPE)
+01-02-06 Makefile: separate out cc,ld,ldd workarounds (so they will be packaged)
+01-02-02 package.sh: fix package use for $INSTALLROOT != */$HOSTTYPE
+	 package.sh: create intermediate recursion makefiles when needed
+	 package.sh: add $SECONDS to the DEBUG trace prompt
+01-01-01 ratz.c: #ifdef for uwin ncc
+	 iffe.sh,package.sh: check PACKAGE_PATH for local installations
+	 package.sh: add psrinfo for osf.alpha host cpu 
+	 package.sh: change pax --meter probe; some hang on /dev/tty
+	 package.sh: fix `install flat ARCH'
+	 mamake: eliminate loops from scan order
+	 C+probe: add probe_verbose -V for aix cc=xlc
+	 cc.ibm.risc,ldd.ibm.risc: add
+	 package.mk: list refs to top-level licenses only
+	 package.mk: add local link table to change log html
+00-12-25 package.sh: `no package archives' is a hard error, duh
+	 package.sh: reorder host type logic for lame shells
+	 mamake.c: getcwd => getwd for NeXT -- how about posix==default guys
+	 iffe.sh: really gross workaround for NeXT -lposix stdout null's
+	 iffe.sh: handle cc -E that insists on compiling
+00-12-15 iffe.sh: ancient sh function call blows $*; call only when $# == 0
+	 *.sh: `getopts 2>/dev/null` => `(getopts)2>/dev/null` for ancient sh
+	 package.sh: fix LD_LIBRARY*_PATH initialization
+	 cc.next.m68k: add for _POSIX_SOURCE and linker multiply defined syms
+00-12-12 ratz: add --meter
+	 package.sh: a few VPATH fixes
+	 Makefile: don't override *.mips* cc if -version not accepted
+00-12-11 package.mk: *.inx now contains name=value
+00-12-07 package.sh: handle PC netscape . => _ pathname mangle
+	 WWW.mk: .tar.gz => .tgz
+00-11-27 package.sh: add checklicense() to do license checks at read time
+	 package.mk: change component list from preformat to table
+00-10-31 package.mk: *.pkg must assert closure
+	 package.mk: add cc- variants to list.package.binary
+	 package.sh: omit dups from package list
+	 package.sh: invalid arg gives one line Usage
+	 package.sh: relax checkaout checks for non-owners
+	 package.sh: package use sets NPROC if not already set or [01]
+	 proto.c: add $(INSTALLROOT)/include/ast hack
+00-10-26 WWW.mk: add .SOURCE rhs to :WWWPAGE:
+00-10-25 package: fix install
+	 package.mk: add list.install
+00-10-22 regress: fix VIEW to skip empty dirs
+00-10-19 package.mk: $(PACKAGEROOT)/bin/nmake => $(PACKAGEROOT)/bin/manmake
+	 iffe: validate #define identifiers
+00-10-18 C+probe: mac os10 additions
+	 package: add DYLD_LIBRARY_PATH initialization
+	 add ldd.$(CC.HOSTTYPE)
+00-10-01 iffe: handle -I* -L* options
+00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs
+00-09-19 C+probe: add probe_longlong
+00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake
+00-09-08 iffe: verfiy that $cc is a C compiler
+00-06-14 mamprobe: fix win32.* probe
+	 mamake: fix bug that used lower view path for generation
+	 package: don't clobber $PACKAGEROOT/bin/nmake
+00-06-01 C+probe: fix stdinclude *again*
+	 package: fix write delta source to use default pax format
+	 package: add disambiguating bias for sgi.mips3 over sgi.mips4
+	 package.mk: fix for directory content packages lib ast-locale
+00-05-01 iffe: fix invalid _LIB_ macro identifier 
+00-04-11 C+probe: uniq stdinclude and stdlib, fix usrinclude
+00-04-01 regress: fix explicit OUTPUT bug that didn't compare with expected
+00-03-17 package: all archives are .tgz for binary download
+	 package: $(PACKAGEROOT)/LICENSES/* in source and binary archives
+	 package: implement install and verify actions
+	 iffe: add exp, pth file dir ..., fix lib - -lfoo, fix lib - - -la -lb
+	 iffe: -L* must affect LD_LIBRARY* hacks for .exe tests -- yuk
+	 package.mk: add *.pkg :INDEX:
+00-03-07 package: add admin action
+00-03-06 makefile: install optional make probe override script C+make+probe.lcl
+00-02-14 --- release 1.0 ---
+	 ratz: treat "foo/" as a dir, not a regular file
+	 package: clarify source and binary installation instructions
+	 package: fix so binary packages can install without cc
+	 package: "ratz" now a non-archive package (the only one) for bootstrap
+	 package: handle VPATH=a:b arg
+	 package.mk: "ratz" package adjustments
+	 Makefile: use :PACKAGE_INIT: to support binary INIT packages
+	 WWW.mk: add :WWWALL:
+	 C.probe: fix .so check that let .dll slip through
+	 iffe: fix config sh var assignment for HAVE_member_IN_struct
+	 iffe: fix config sh var assignment for symbol_DECLARED
+	 package: delay PATH export until dll hack exports complete
+	 package: don't forget binary package $(INSTALLROOT)/lib(32|64)
+	 package: add delta change log for source packages
+00-02-10 mamprobe: add mam_cc_DLLBIG
+	 package: fix spelling typos
+	 package: add html help output
+	 package.mk: beef up source and binary help => html
+00-02-08 package: mkdir man/man[138] in the new arch to cover MAM bug
+00-01-28 package,release: add -rcount to release
+	 package: fix linux "host cpu" and "host rating"
+	 package: copy *.lic to $PACKAGEBIN for "make" and "write binary"
+	 package: fix 'release change log' case match
+00-01-24 package: add copyright action
+	 mamprobe: add -D_BLD_DLL to mam_cc_DLL
+00-01-11 package: tsort for package write
+	 package: early verification that $CC works
+	 package: add non-interactive command arg for use action
+	 proto: fix -C intermediate mkdir()
+	 mamprobe: unixware.i386 ksh workaround
+	 C.probe: move hosttype to C.probe (with unixware.i386 workaround)
+	 WWW.mk: fix mm2html option quoting
+	 WWW.mk: add .SCAN.mm
+	 WWW.mk: don't force static=1; grab dll's instead
+	 *.sh: fix getopts test to handle botched implementations like osf.alpha
+	 iffe.sh: fix read -r test
+99-12-25 iffe: tweak verbose messages
+	 iffe: hand code non-optget getopts parse
+	 iffe: fix bash quoting bug again
+	 iffe: do test -w . after option parse
+	 package: fix PACKAGEROOT search
+99-11-19 --- release 0.2 ---
+99-11-19 first working package & friends
+99-10-31 change from lib0ast to INIT; add MAM and package bootstrap
+	 hostinfo: gobbled by package
+99-10-01 iffe: add --config, yes{...}end no{...}end, fix read -r workaround
+99-09-27 iffe: add --all --verbose, --* set options
+99-09-22 regress: -v disables long line truncation
+99-09-11 WWW.mk: WWWDIR and MM2HTMLINFO are now lists searched in $(HOME)
+99-08-11 hostinfo: fix type sgi.mips4
+99-06-24 WWW.mk: add
+99-06-08 hostinfo.sh: ${TMPDIR:-/tmp}
+99-06-07 TEST.mk: add
+99-06-01 iffe: add `siz type' for _siz_type == sizeof(type)
+99-05-11 hostinfo,iffe,regress,use: long options
+99-05-01 C.probe: fix over aggressive stdinclude, e.g., /usr/include/machine
+99-04-01 hostinfo: sgi.mips? -o32 and -n32 checks
+	 iffe: check that . is writable
+99-03-17 hostinfo: fix for cc not found
+	 dl.c,hello.c,m.c: headers in conditionals to force .DONTCARE
+	 C.probe: extra check for include dirs pulled in by <sys/types.h>
+99-03-03 regress: add `UNIT - ...' for extra args
+	 Makefile: add (_hosttype_) prereq for cc
+99-01-23 hostinfo: tweak rating, use /proc/cpuinfo if there
+99-01-11 C.probe: shlib before lib, /usr before /
+98-12-25 iffe: work around win32.alpha intrinsic clash with -O
+98-11-11 regress: fix UNIT PATH lookup
+98-11-01 regress: add PROG
+98-10-01 hostinfo: add unixware.*
+	 use: export PACKAGE_* 
+98-08-11 C.probe: add /usr/include check (for sco CC)
+	 hostinfo: handle uwin uname update
+98-05-01 regress: fix bug sometimes didn't list last test
+98-04-01 hostinfo: add cc path arg
+	 hostinfo: now works with /bin/sh
+	 Makefile: strengthed -lm probe
+98-01-23 Makefile: check for -ldl -lm
+	 C.probe: handle gcc -v -E phony include dirs
+	 iffe: fix lcl by dropping sort -u -- we need the real first
+	 iffe: `mem x' to test if x is a non-opaque struct
+98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3
+	 $(INSTALLROOT)/lib64 for sgi.mips4
+	 add cc.hp.pa
+98-01-01 cc.sgi.mips*: turn off ld library multiply defined
+97-10-11 regress: add VIEW function for locating data
+97-10-01 Makefile: -ldl test moved to libdll Makefile
+97-08-11 regress: add MOVE
+	 regress: add SAME
+	 regress: use getopts
+	 regress: `EXEC' repeats previous test
+97-07-17 use: tweak PATH and LIBPATH bootstrap order
+	 iffe: fix lcl bug that botched pathnames with embedded spaces
+97-06-12 iffe: add npt `needs prototype' test
+97-05-09 hostinfo: mvs.* => mvs.390
+	 Makefile: cc.$(_hosttype_) workaround installed here
+	 iffe: fix nolink{ ... }end
+	 iffe: add [no]static{ ... }end for static link test
+	 C.probe: _probe_PATH => _probe_export which must be eval'd
+97-04-01 use: _RLD_ROOT set too
+97-03-17 mm2html: changed inner loop
+	 mm2html: handle .if|.ie|.el, .so
+	 mm2html: handle different man styles
+	 mm2html: differentiate mm/man in some non-obvious cases
+	 hostinfo: r5000 is not mips4
+97-02-14 hostinfo: validate type with cc
+96-12-25 C.probe: uwin tweaks
+	 iffe: use `...` instead of $(...) for alpha /bin/sh
+	 iffe: fix `typ' divide by 0
+	 iffe: `lcl' now drops X: prefix
+	 iffe: +l* -> -l*
+	 iffe: eval around ${...#%...} for bsd /bin/sh
+	 use: add sgi.mips LD_LIBRARY<abi>_PATH variants
+	 use: add -e to list exports
+	 iffe: lcl leaves leading [a-zA-Z]: for dos
+	 iffe: fix no{link|output|execute} logic
+	 C.probe: don't automatically add /usr/include for non-hosted compilers
+	 C.probe: don't automatically place /usr/include last
+	 C.probe: check gcc style -v -E for stdinclude usrinclude
+96-11-28 iffe: check BASH_VERSION for IFS botch
+	 iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx)
+	 hostinfo: fix sgi.mips[234] tests
+	 hostinfo: fix ncr.i386 tests
+96-10-31 iffe: work around old bsh here doc bug by running separate sh
+96-10-11 iffe: *.iffe and *.iff for iffe src files
+	 hostinfo: tighten sgi.mips cpu type check
+96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib
+96-09-17 iffe: fix typ bug that failed for single id types!
+96-08-31 hostinfo: handle recent sgi hinv cpu changes
+96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx
+96-05-09 C.probe: drop multiple / in stdinclude
+96-02-29 use: package root must have bin and lib subdir
+	 mm2html: add
+	 C.probe: probe_members += -whole-archive for gcc
+	 iffe: add + fix the blasted `...'...\...'...`
+96-01-31 use: add pkg dir
+	 hostinfo: add tandem
+96-01-01 hostinfo: windows_nt|windows[0-9][0-9] -> win32
+95-11-24 hostinfo: linux-aout.* for non-elf linux
+95-11-11 use: add aix LIBPATH
+95-10-11 hostinfo: no args prints type
+95-08-11 use: add
+95-05-09 save original PATH in _probe_PATH
+	 beef up library dir probe
+95-04-01 use c source suffix if it still preserves the dialect
+	 add hostinfo
+	 add lib/hostinfo/typemap user type map
+	 add sol.sun4 cpu count
+	 fix C.probe to properly handle C/C++ combined compiler drivers
+	 add NeXT to hostinfo
+	 bummer: mach has /usr/bin/hostinfo
+95-03-19 fix dialect executable test
+95-03-19 --- release 0.0 ---
+
+

+


+ + + + + + +
March 13, 2012
+

+ +

+ + + diff --git a/lib/package/INIT.pkg b/lib/package/INIT.pkg new file mode 100644 index 0000000..32f1456 --- /dev/null +++ b/lib/package/INIT.pkg @@ -0,0 +1,12 @@ +INIT :PACKAGE: + +:CATEGORY: admin utils + +:INDEX: the package command with support scripts and utilities + +:DESCRIPTION: + The INIT package is required by all but the standalone + and self extracting archive packages. It contains + the package command, support scripts, and utilities. + The package command installs binary packages, makes + source packages, and generates new package tarballs. diff --git a/lib/package/INIT.req b/lib/package/INIT.req new file mode 100644 index 0000000..e69de29 diff --git a/lib/package/INIT.ver b/lib/package/INIT.ver new file mode 100644 index 0000000..f681461 --- /dev/null +++ b/lib/package/INIT.ver @@ -0,0 +1 @@ +INIT 2012-02-29 2012-02-29 1 diff --git a/lib/package/LICENSES/epl b/lib/package/LICENSES/epl new file mode 100644 index 0000000..b1dfb87 --- /dev/null +++ b/lib/package/LICENSES/epl @@ -0,0 +1,221 @@ ++------------------------------------------------------------------------------+ +| This license covers all software that refers to the URL | +| http://www.eclipse.org/org/documents/epl-v10.html | ++------------------------------------------------------------------------------+ + +Eclipse Public License - v 1.0 + + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC + LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM + CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + + 1. DEFINITIONS + + "Contribution" means: + + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + + ii) additions to the Program; + + where such changes and/or additions to the Program originate from and are + distributed by that particular Contributor. A Contribution 'originates' from + a Contributor if it was added to the Program by such Contributor itself or + anyone acting on such Contributor's behalf. Contributions do not include + additions to the Program which: (i) are separate modules of software + distributed in conjunction with the Program under their own license + agreement, and (ii) are not derivative works of the Program. + + "Contributor" means any person or entity that distributes the Program. + + "Licensed Patents" mean patent claims licensable by a Contributor which are + necessarily infringed by the use or sale of its Contribution alone or when + combined with the Program. + + "Program" means the Contributions distributed in accordance with this + Agreement. + + "Recipient" means anyone who receives the Program under this Agreement, + including all Contributors. + + 2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly perform, + distribute and sublicense the Contribution of such Contributor, if any, and + such derivative works, in source code and object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of the + Contribution and the Program if, at the time the Contribution is added by + the Contributor, such addition of the Contribution causes such combination + to be covered by the Licensed Patents. The patent license shall not apply to + any other combinations which include the Contribution. No hardware per se is + licensed hereunder. + + c) Recipient understands that although each Contributor grants the licenses + to its Contributions set forth herein, no assurances are provided by any + Contributor that the Program does not infringe the patent or other + intellectual property rights of any other entity. Each Contributor disclaims + any liability to Recipient for claims brought by any other entity based on + infringement of intellectual property rights or otherwise. As a condition to + exercising the rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual property rights + needed, if any. For example, if a third party patent license is required to + allow Recipient to distribute the Program, it is Recipient's responsibility + to acquire that license before distributing the Program. + + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright license + set forth in this Agreement. + + 3. REQUIREMENTS + + A Contributor may choose to distribute the Program in object code form under + its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all warranties and + conditions, express and implied, including warranties or conditions of title + and non-infringement, and implied warranties or conditions of + merchantability and fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all liability for + damages, including direct, indirect, special, incidental and consequential + damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement are offered + by that Contributor alone and not by any other party; and + + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable manner + on or through a medium customarily used for software exchange. + + When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the Program. + + Contributors may not remove or alter any copyright notices contained within + the Program. + + Each Contributor must identify itself as the originator of its Contribution, + if any, in a manner that reasonably allows subsequent Recipients to identify + the originator of the Contribution. + + 4. COMMERCIAL DISTRIBUTION + + Commercial distributors of software may accept certain responsibilities with + respect to end users, business partners and the like. While this license is + intended to facilitate the commercial use of the Program, the Contributor + who includes the Program in a commercial product offering should do so in a + manner which does not create potential liability for other Contributors. + Therefore, if a Contributor includes the Program in a commercial product + offering, such Contributor ("Commercial Contributor") hereby agrees to + defend and indemnify every other Contributor ("Indemnified Contributor") + against any losses, damages and costs (collectively "Losses") arising from + claims, lawsuits and other legal actions brought by a third party against + the Indemnified Contributor to the extent caused by the acts or omissions of + such Commercial Contributor in connection with its distribution of the + Program in a commercial product offering. The obligations in this section do + not apply to any claims or Losses relating to any actual or alleged + intellectual property infringement. In order to qualify, an Indemnified + Contributor must: a) promptly notify the Commercial Contributor in writing + of such claim, and b) allow the Commercial Contributor to control, and + cooperate with the Commercial Contributor in, the defense and any related + settlement negotiations. The Indemnified Contributor may participate in any + such claim at its own expense. + + For example, a Contributor might include the Program in a commercial product + offering, Product X. That Contributor is then a Commercial Contributor. If + that Commercial Contributor then makes performance claims, or offers + warranties related to Product X, those performance claims and warranties are + such Commercial Contributor's responsibility alone. Under this section, the + Commercial Contributor would have to defend claims against the other + Contributors related to those performance claims and warranties, and if a + court requires any other Contributor to pay any damages as a result, the + Commercial Contributor must pay those damages. + + 5. NO WARRANTY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON + AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER + EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR + CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A + PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the + appropriateness of using and distributing the Program and assumes all risks + associated with its exercise of rights under this Agreement , including but + not limited to the risks and costs of program errors, compliance with + applicable laws, damage to or loss of data, programs or equipment, and + unavailability or interruption of operations. + + 6. DISCLAIMER OF LIABILITY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY + CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION + LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE + EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGES. + + 7. GENERAL + + If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of the + remainder of the terms of this Agreement, and without further action by the + parties hereto, such provision shall be reformed to the minimum extent + necessary to make such provision valid and enforceable. + + If Recipient institutes patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Program itself + (excluding combinations of the Program with other software or hardware) + infringes such Recipient's patent(s), then such Recipient's rights granted + under Section 2(b) shall terminate as of the date such litigation is filed. + + All Recipient's rights under this Agreement shall terminate if it fails to + comply with any of the material terms or conditions of this Agreement and + does not cure such failure in a reasonable period of time after becoming + aware of such noncompliance. If all Recipient's rights under this Agreement + terminate, Recipient agrees to cease use and distribution of the Program as + soon as reasonably practicable. However, Recipient's obligations under this + Agreement and any licenses granted by Recipient relating to the Program + shall continue and survive. + + Everyone is permitted to copy and distribute copies of this Agreement, but + in order to avoid inconsistency the Agreement is copyrighted and may only be + modified in the following manner. The Agreement Steward reserves the right + to publish new versions (including revisions) of this Agreement from time to + time. No one other than the Agreement Steward has the right to modify this + Agreement. The Eclipse Foundation is the initial Agreement Steward. The + Eclipse Foundation may assign the responsibility to serve as the Agreement + Steward to a suitable separate entity. Each new version of the Agreement + will be given a distinguishing version number. The Program (including + Contributions) may always be distributed subject to the version of the + Agreement under which it was received. In addition, after a new version of + the Agreement is published, Contributor may elect to distribute the Program + (including its Contributions) under the new version. Except as expressly + stated in Sections 2(a) and 2(b) above, Recipient receives no rights or + licenses to the intellectual property of any Contributor under this + Agreement, whether expressly, by implication, estoppel or otherwise. All + rights in the Program not expressly granted under this Agreement are + reserved. + + This Agreement is governed by the laws of the State of New York and the + intellectual property laws of the United States of America. No party to this + Agreement will bring a legal action under this Agreement more than one year + after the cause of action arose. Each party waives its rights to a jury + trial in any resulting litigation. diff --git a/lib/package/ast-ksh.README b/lib/package/ast-ksh.README new file mode 100644 index 0000000..7d67d3f --- /dev/null +++ b/lib/package/ast-ksh.README @@ -0,0 +1,5212 @@ +The AT&T Software Technology ast-ksh package from AT&T Research +contains ksh and support libraries. This is the minimal set of +components needed to build ksh. This package is a superset of the +following package: ksh; you won't need this if you download ast-ksh. + +Source Package Installation Instructions: + + (1) Do not install packages as root/super-user. Although some components may + have setuid executables, few must be owned by root. These are best + changed manually when the security implications are understood. + (2) Choose a package root directory and cd to it. This will be a local work + area for all packages. + (3) These instructions bypass the click to download package links on the + download site. If you already clicked, or if your system does not have + curl(1), hurl(1), lynx(1) or wget(1) then use the alternate instructions + for (3),(4),(5) in plan B below. Plan B installs the hurl(1) + script which works with ksh and modern bash. The top level URL is: + URL=http://www.research.att.com/sw/download + (4) If the bin/package script does not exist then run: + test -d bin || mkdir bin + url=$URL/package + (wget -O bin/package $url||curl -L $url||hurl $url) > bin/package + chmod +x bin/package + (5) Determine the list of package names you want from the download site, then + use the package(1) command to do the actual download: + bin/package authorize "NAME" password "PASSWORD" \ + setup source $URL PACKAGE ... + (Refer to the AUTHORIZATION paragraph on the main download page for + NAME/PASSWORD details.) This downloads the closure of the latest + source package(s); covered and up-to-date packages are not downloaded again unless + package force ... is specified. Package content is verified using md5sum. + If the package root will contain only one architecture then you can install in bin and + lib instead of arch/HOSTTYPE/bin and arch/HOSTTYPE/lib by running this + instead: + bin/package authorize "NAME" password "PASSWORD" \ + flat setup source $URL PACKAGE ... + To update the same packages from the same URL run: + bin/package setup source + (6) Build and install; all generated files are placed under arch/HOSTTYPE + ($INSTALLROOT), where HOSTTYPE is the output of bin/package (with no + arguments.) name=value arguments are supported; CC and debug=1 (compile + with -g instead of -O) are likely candidates. The output is written to + the terminal and captured in $INSTALLROOT/lib/package/gen/make.out: + bin/package make + (7) List make results and interesting errors: + bin/package results + Run the regression tests: + bin/package test + List test results and errors: + bin/package results test + (8) The generated binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + file(1) and nmake(1), require the path of the bin directory to be + exported in PATH. + (9) You can run the binaries directly from the package root, or you can + install them in a public root after you are satisfied with the make and + test actions (requires the AT&T nmake(1) command): + bin/package flat install DIRECTORY PACKAGE + This will install in DIRECTORY/bin and DIRECTORY/lib. If you want to + preserve the arch/HOSTTYPE hierarchy under DIRECTORY then omit the + flat argument. If you don't have nmake(1) then the following will do a + flat install: + cd $INSTALLROOT + cp -p -r bin lib include DIRECTORY + (10) To summarize, after the first time the download, build, and test cycle + for the latest source release is: + bin/package setup source + bin/package make + bin/package test + +Source Package Installation Instructions -- Plan B: + + (3) Create the subdirectory lib/package/tgz and download all package archives + into that directory. + (4) If the bin/package script does not exist then manually read the INIT + source package: + gunzip < lib/package/tgz/INIT.YYYY-MM-DD.tgz | tar xvf - + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + tar xvf - lib/package/tgz/INIT.YYYY-MM-DD.tgz + If your system does not have tar(1) or gunzip(1) then download the ratz + source package, compile it, and manually read the INIT + source package: + mkdir bin + cp lib/package/tgz/ratz.YYYY-MM-DD.c lib/package/tgz/ratz.c + cc -o bin/ratz lib/package/tgz/ratz.c + bin/ratz -lm < lib/package/tgz/INIT.YYYY-MM-DD.tgz + (5) Read all unread package archive(s): + bin/package read + Both source and binary packages will be read by this step. + +All recorded changes follow. + +:::::::: ksh93 :::::::: + +12-02-29 --- Release ksh93u+ --- +12-02-29 A bug which could lead to a core dump when more that four shared + libraries were added with the builtin command has been fixed. +12-02-29 Fixed a few bugs which caused SIGCHLD to be blocked preventing + background jobs from being reaped until a foreground job was run. +12-02-27 A bug in which sh -c for a simple command caused a fork() has been + fixed. +12-02-27 A timing bug on systems such as AIX that doesn't support vfork() + that could cause the exist status to get lost has been fixed. +12-02-22 A private file descriptor that was not close-on-exec for a command + substitution and has been fixed. +12-02-14 A bug in which ^Z did not stop a pipeline when the last component + was a shell built-in has been fixed. +12-02-14 getconf("PATH") used to initialize ed(1) path. +12-02-13 +In earlier version read from standard input would fail when called + from the KEYBD trap. Now read options -N, -n, and -t should work + when called from a KEYBD trap. +12-02-13 If FCEDIT is not set and fc is invoked without the -e option, + ed will be invoked if found instead of /bin/ed. +12-02-10 Another bug in the saving and restoring of IFS in a subshell + that caused a core dump has been fixed. +12-02-08 A bug in which .sh.fun disciplines could be cleared after a + function completes has been fixed. +12-02-08 A bug in job control in which the foregroup process group was not + set correctly after restarting a stopped pipeline has been fixed. +12-02-07 A bug in which numbers with leading zeros could be treated as + octal constants outside of ((...)) has been fixed. +12-02-06 A bug in arithmetic with compound variables containing multiple + array elements has been fixed. +12-02-02 A bug in the ulimit option table was fixed. +12-01-26 A bug in which a set command that did not change monitor could + effect the behavior of the monitor when monitor mode is on is fixed. +12-01-21 +You can now test whether the shell implements a math function using + typeset -f .sh.math.name, where name is the name of the function. +12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte + characters correctly has been fixed. +12-01-20 A bug that could cause the shell to hang waiting for an incorrect + job pid has been fixed. +12-01-19 A memory leak which occured for a nested command subtiution has been + fixed. +12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute + for some other variables, for exampe, HISTFILE has been fixed. +12-01-16 A bug in which .sh.match was not correct after a substring match when + the replacement string contained a substring match has been fixed. +12-01-12 +Files that are sourced from profile files are now read and executed + one command at a time so that alias definitions take effect as they + do for profile files. +12-01-12 A bug in which whence -p would find a function if one existed and + there was no command of that name on PATH. +12-01-11 Change b_* prototype (int, char**, void*) => (int, char**, Shbltin_t*). +12-01-05 A bug in which read was not terminating for a signal that had a trap + set has been fixed. +12-01-01 A timing problem with >; has been fixed. +12-01-01 A macro expansion memory leak has been fixed. +11-12-26 A bug in array assignments of the form arr=( $arr[i] ...) in which + arr was not unset before the assignment has been fixed. +11-12-20 A number of code changes were made based on the results of errors + indicated by static code analysis. +11-12-13 In vi edit mode a lteral can now be entered by preceding it + with a backshash. +11-12-13 When tab is entered for completion after a ' or ", the ' and " + characters are no longer deleted. +11-12-07 A bug in which a program in the current direcotry with a . in the + name could fail to execute when both PATH and FPATH end with :. has + been fixed. +11-12-07 I fixed a bug in which a variable expansion in a large here-document + could be expanded to a null string. +11-12-06 An optimization to read was added in the case the the read command + was redirected from a file. +11-12-06 Changes were made to make the line limit for read unlimited by + default. +11-12-05 A bug in which unsetting an array variable did not completely clear + the variable in some cases has been fixed. +11-12-02 +The printf alternative character # when applied to the %q format will + quote argument in a form suitable for a field in a .csv format file. +11-12-02 +A -S option was added to read to be able to read .csv format files. +11-11-28 A bug in which redirection of standard error in a function called from + command substitution caused standard error to be lost has ben fixed. +11-11-21 [[ (-n foo) ]] no longer requires a space before (. +11-11-11 The readonly attribute for a variable now applies to compound + assignments to that variable. +11-11-07 Changes were made to reduce the stack size to allow deeper function + recursion. +11-10-10 +Added alternate flag to printf %H for encoding of URI's. +11-10-10 A bug which could lead to a core dump when the shell was invoked + with more than twenty five open files has been fixed. +11-10-06 A bug in the scoping of name references in functions called by other + functions has been fixed. +11-10-05 A bug in which wait on a pid may return the exit status of an + earlier background job with that pid instead has been fixed. +11-09-22 A bug in which a read timed out with TMOUT did not always restore + the terminal state has been fixed. +11-09-21 An optimization that allowed the last command in a script to use + the same process id as the script has been eliminated. +11-09-21 Added letoctal option that enables the let command to recognize + octal constants starting with 0. +11-09-20 A bug in which ${var.} could cause a core dump has been fixed. +11-09-20 A bug with SHOPT_EDPREDICT when neither vi or emacs was enabled for + lines beginning with # when in a multibyte locale has been fixed. +11-09-20 A bug in emacs edit mode with SHOPT_EDPREDICT that would cause + history searches matching comments lines to generate predictions + has been fixed. Only user typed comment lines generate predictions. +11-09-20 A bug in emacs edit mode with a search that matches a comment line + that could cause a core dump has been fixed. +11-09-16 A bug in which a command name ending in .. could cause the shell to + abort has been fixed. +11-09-16 The characters ! + - % and @ in file names are no longer escaped with + file name completion. +11-09-13 The let command no longer treats numbers starting with 0 as octal + constants. +11-09-08 A bug in which printf "%R" could cause a core dump for invalid shell + patterns has been fixed. +11-08-09 With set -u, ${var#pattern} reported that var was unset for special + variables. +11-08-03 A bug in which the shell did not preserve the exit status for a + coprocess has been fixed. +11-08-02 A bug in the saving and restoring of IFS in command substitution that + caused a core dump has been fixed. +11-07-21 Modified the 10-08-27 bug fix so that background jobs started in for + and while loops created interactively generate completion messages. +11-07-20 I fixed a bug in here documents in which multi-byte characters that + crossed buffer boundaries were not processed correctly. +11-06-22 The shell compiler now supports process substitution. +11-06-22 +Added code to support process substitution on systems that do + not supply the /dev/fd directory. +11-06-21 Fixed extraneous jobs Done messages when builtin is at the end of a + pipeline. +11-06-20 Fixed two regression tests. +11-06-20 Fixed a bug introduced on last update. +11-06-14 A bug with pipefail in which the shell would wait for background + jobs to complete has been fixed. +11-06-09 A bug which caused the options.sh regression test to fail on OS390 + Linux has been fixed. The bug could also have affected other systems. +11-06-07 +A number of changes to support the still undocuments namespace option + have been added. +11-06-06 A bug in which command substitution of eval would hang when it had + standard error redirected to standard output has been fixed. +11-06-01 A bug in case statement fall through (;&) ignoring set -e was fixed. +11-06-01 A bug in which creating a left or right justified upper or lowercase + variable with an empty string has been fixed. +11-06-01 A bug in which the .paths directory wasn't read when a subshell was + executed before any other command has been fixed. +11-05-31 The shell now gives an error when a type variable is assigned to + an array instance when the array has been declared a compound variable + array. +11-05-31 A bug in which typeset -m of an array instance did not remove the + original instance has been fixed. +11-05-28 A bug in which typeset -m dest=src fails when src and are passed as + name references was fixed. +11-05-28 A bug in which typeset -m "c.board[1][i]=el", where el is a compound + variable core dumps has been fixed. +11-05-28 Two bugs in the display of arrays of compound variables with print -v + have been fixed. +11-05-27 A bug with command substitution with the shift jis locale has been + fixed. +11-05-25 A bug in which unset -f foo, called within function foo could cause + the shell to core dump has been fixed. +11-05-24 A bug in unsetting arrays of compound variables that could lead to + a core dump has been fixed. +11-05-24 A scoping bug in with typeset -m for variables passed as references + has been fixed. +11-05-09 A bug in which 'typeset +p array[$i]' in a subshell could cause an + exception has been fixed. +11-05-03 Two more scoping bugs with name references and read -C were fixed. +11-05-03 A potential race condition which occurs when here-documents are + processed in asynchronous blocks has been eliminated. +11-05-02 Another scoping bug with name references defined in a function has + been fixed. +11-05-02 A bug in which the shell discards saved exit status of a job if it is + followed by a subshell execution has been fixed. +11-04-28 The shell now checks for numerical overflows with process ids. +11-04-28 Another scoping bug with compound variables defined by name references + inside a function has been fixed. +11-04-28 A bug which caused a core dump on 32 bit systems with the basic.sh + regression test has been fixed. +11-04-27 A scope binding error for name references has been fixed. +11-04-27 Assignment of compound variable to compound array element by name + is now working. +11-04-26 I fixed a bug with SHOPT_FIXEDARRAY compilation that could cause + an a core dump for not fixed arrays. +11-04-25 A bug in the references to two dimensional compound arrays has + been fixed. +11-04-20 A bug in which a name reference to a multidimentional index array + index, nameref x=foo[3][4], did not work correctly has been fixed. +11-04-18 Changes were added to allow fixed size arrays of variable sized + objects when the SHOPT_FIXEDARRAY compile option defined on 10-09-28. +11-04-18 A bug in which name references to array elements could fail has + been fixed. +11-04-15 +A compile option, SHOPT_2DMATCH, has been added which causes + .sh.match to be a two dimensional array after ${var//pat/str} + where the first dimension is the pattern number and the second is + the match instance. +11-04-11 A bug in which readonly var, where var is exported could cause var + to be unset has been fixed. +11-04-06 A tokenizer bug in which ${x/{3}(\d)/ } would cause in infinite + loop has been fixed. +11-04-05 A bug in which ${!x.} could cause a core dump has been fixed. +11-04-04 A bug in which cleaning out the history file could terminate before + keeping all the recent history events has been fixed. +11-03-29 A bug in which ${#array[@]} was 1 rather than 0 after issuing + typeset array[7] has been fixed. +11-03-29 The subscript out or range message for fixed arrays has been fixed. +11-03-29 A bug in which suspend could cause a core dump has been fixed. +11-03-24 For the showme option added 09-09-09, commands beginning with a ; + inside an arithmetic for loop, no longer produce syntax errors. +11-03-18 A bug in _WINIX ~domain/user expansion has been fixed. +11-03-16 A bug in the pipefail option which could cause a script to hang + has been fixed. +11-03-12 The shell no longer treats ${##pattern} as a syntax error. +11-03-11 A bug in typeset -u on systems that don't supply the towctrans() + function has been fixed. +11-03-11 A bug in which a compound assignment of the form var[sub]=(...) + would evaluate sub for each assignment has been fixed. +11-03-07 A bug in which reassigning a compound variable to an associative + array index could incorrectly increase the count of the number + of elements has been fixed. +11-03-04 +The tilde expansion on windows has been modified to handle user + names of the form domain/user so that ~domain/user now expands + to the home directory of that domain user. +11-03-03 A bug in which the width of the prompt was calculated incorectly + which cause the wrong line length for edit commands has been fixed. +11-03-02 A bug in which a global variables set from within a function inside + a subshell can leave side effects in parent shell has been fixed. +11-03-01 A bug in which whence -a could dump core when the first match + was due to : in PATH and the program was in the current directory. +11-02-28 A bug in emacs mode with SHOPT_EDPREDICT (added on 10-05-20) which + disabled prediction on a line starting with # when the cursor was not + at the end of line has been fixed. +11-02-28 The output format for compound variables with set has been fixed. +11-02-25 A bug which could lead to a core dump occurred when a shell script + without #! is invoked by name from a parent shell that has name + references defined and the script creates name references of the + same name. +11-02-21 The shell now fails with a syntax error when a here-document in a + command substition is not completed before the closing ), for + example, $( foobar <&- doesn't work has been fixed. +11-02-07 A bug on some systems for which a command subtitution could hang + has been fixed. +11-01-28 A bug in file name completion for files containing both multibyte + characters shell special characters has been fixed. +11-01-18 The .sh.match variable now shows elements that do not match as + as not set rather than an empty string. +11-01-18 A bug with typeset -m of an array into an element of an indexed + array has been fixed. +11-01-13 A bug in handling of arrays of compound variables inside ((...)) which + reported a syntax error been fixed. +11-01-10 A bug in arithmetic assignment operators of the form op= for array + variables when the same array was referenced on the left and the + right hand side with different indices has been fixed. +11-01-10 A bug in which the output of time was lost when { time...;} 2>&1 + occurred inside command substition has been fixed. +11-01-07 [[ -v sh.match[i] ]] was returning false when sh.match[i] was set. +11-01-05 Added and modified warning messages with sh -n. +11-01-02 Fixed bugs with typeset -l/-u/-M and arrays. +10-12-28 Fixed a bug with typeset -l/-u/-M values in arithmetic expressions. +10-12-26 Fixed a time parsing bug in sleep and localeconv() initialization. +10-12-23 Prevented the shell from generating a core dump when it sends itself + a termination signal because the last command terminated with that + signal. This prevents a core dump to be overwritten by the shell. +10-12-22 A bug in the expansion of ${A[@]} ${B[@]}, introduced in 10-12-01 + when A="" B=B has been fixed. +10-12-21 +Use MS_3D in b_vpath() for setting win32 WoW mount defaults. +10-12-17 A bug in the expansion of ${var:i:j} which caused a core dump when + i > ${#var} has been fixed. +10-12-16 +sleep now treats . as decimal point even in locales that use comma. +10-12-16 +typeset -M mapname was added to generalize on toupper and tolowwer + mapping as provided with wctrans(). +10-12-10 A bug in which typeset -l displayed namespaces as well as lower case + variables has been fixed. +10-12-06 A bug in which a pipeline could terminate prematurely for a pipeline + whose right hand side is a builtin, and whose left hand side ends in + a simple command that has standard output redirected has been fixed. +10-12-06 A bug in hexfloat assignments when the right hand side is a string + variable starting with 0x has been fixed. +10-12-01 A bug in the expansion of ${$1+"$@"} which causes the last positional + parameter to disappear when it is empty has been fixed. +10-12-01 A number of changes were made to reduce the startup time. +10-11-29 When wait is interrupted by a signal that is caught, it now exits + with a non-zero exit status. +10-11-29 When a variable is used directly in an arithmetic expression, + leading zeros no longer cause the value to be treated as an + octal constant. This was true in previous versions for justified + variables. +10-11-29 An incorrect warning message was eliminated with the -n option for + arithmetic expressions with associative arrays. +10-11-29 Some changes were made to slightly reduces startup time. +10-11-24 A bug in which a name reference is make to arr[0] when arr is not + an array has been fixed. +10-11-23 If a type definition is made without a compound variable assignment it + produces an error message and no longer shows up as a defined type. +10-11-22 The handling of \ inside [...] for for shell and ~(E) patterns has + been fixed. +10-11-22 A patch was made to pfsh to handle an error case. +10-11-22 +Modified types defined in namespace so that they do not clash with + types in other namespaces. Types can be referenced using + .namespace.typename. +10-11-22 A bug which caused functions addressed as .namespace.funct to not + work has been fixed. +10-11-22 A bug in which if nr was a name reference to an unset associative + array subscript, then ${!nr} did not output the subscript correctly + has been fixed. +10-11-18 A bug in which shcomp -n was not processing double quotes correctly + has been fixed. +10-11-18 Fixed a bug in which typeset -T foo; typeset -T could cause a + core dump. +10-11-17 Fixed a bug in which the error message for set -u could come out + garbelled. +10-11-17 Modified the parser so that typeset -a var=(...) no longer checks + the first index for aliases and reserved words. +10-11-17 A bug in which a subshell command consisted of only a for or until + command has been fixed. +10-11-16 Fixed a bug in which typeset -u would display namespace variables + as well as upper case variables. +10-11-16 A bug which could cause a core dump when unsetting a type variable + when there are references to type elements has been fixed. +10-11-15 A bug which could cause a core dump when unsetting a compound + array variable when there are references to array subscripts has + been fixed. +10-11-15 A bug in which using typeset -m to move an indexed array instance + to another array could cause the array to display incorrectly has + been fixed. +10-11-12 A bug in which the unset discipline function for a type is called + when the type is initialized has been fixed. +10-11-12 The sequences \< and \> are now preserved after patterns containing + ~(E) in ${var/pattern/string} expansions. +10-11-11 A bug in typeset -m when the variables were compound arrary instances + has been fixed. +10-11-10 A bug in output of a compound variable with types containing types + has been fixed. +10-11-10 Fixed ``name=value export [-p]'' to list environment. +10-11-09 shtests resets SIGPIPE to SIG_DFL for all tests. +10-11-09 Fixed a bug in expansion of $"..." when used in assignments. +10-11-09 Fixed a getaddrinfo() memory leak that didn't call freeaddrinfo() + after an interrupt. +10-11-08 Modified the behavior of set -u so that the shell terminates with + error message when when var is unset with ${!var} and ${#var}. +10-11-02 Fix a bug in which a signal received while in a subshell could be + ignored. +10-10-26 Fix a bug where terminal interrupt was ignored while in vi/emacs + edit search mode. +10-10-26 Fix $'a\0b'c to expand to 'ac'. +10-10-26 Provide user defined round() if not in . +10-10-26 Fix bug where $((undefined_function(1))) dumped core. +10-10-22 Provide user defined iszero() if not in . +10-10-22 Fixed a bug with BGX compile option that could cause the shell to + hang. +10-10-22 Fixed a bug with user define math function on systems for which + char is unsigned. +10-10-21 A bug in which function autoloaded in a function leaves a file open + has been fixed. +10-10-20 Modified the behavior of set -u so that the shell terminates when + when var is unset with ${var op string} when op is #, % or /. +10-10-20 Fixed a bug with the AUDIT option in which the audit file was not + not close-on-exec. +10-10-20 +Made a number of changes and fixes for the NAMESPACE compile option + which as added on 10-06-09 but some problems still remain. +10-10-15 Fixed a bug in which arithmetic functions (added on 10-03-24) did + not work when the function definition was in the same compound + command in which the function was referenced. +10-10-13 A bug in which creating an associative array of compound variables + with no members as an element of a compound variable did not work + has been fixed. +10-10-08 A bug in which killing the last command in a function defined + with function name, terminated the calling script has been fixed. +10-10-08 A bug which could cause a core dump if IFS is unset inside a function + has been fixed. +10-10-07 +To reduce unwanted side effects, invoking typeset without the export + option and without an assignment now causes the variables to be unset + if the variable is inherited from the environment. +10-10-06 The closing brace for ${ command } is now a token no matter what + character follows it. +10-10-04 The change for $'...' expansion on 10-08-09 did not expand parameters + contained in the error message and this has been fixed. +10-10-04 A bug in which a declaration of indexed array (-a_ in a type + definition would be displayed as a compound indexed array (-C -a) + has been fixed. +10-09-30 The C99 math function ldexp has been added. +10-09-30 A bug with two dimensional arrays with expansion of the form + ${ref[0..5]} where ref is a nameref to array[i] has been fixed. +10-09-29 A bug in which an eval with redirections invoked from a dot script + would not restore the file has been fixed. +10-09-29 A bug in which loading a function from FPATH could leave a file + descriptor open has been fixed. +10-09-28 +A new compile option SHOPT_FIXEDARRAY has been added and is being + evaluation. It allows fixed sized indexed arrays be to defined + using "typeset array[dim1][dim2]...[dimn]". Fixed sized arrays + are used the same way indexed arrays are. Currently, only fixed + arrays of fixed objects (float, int, and justifies objects) are + supported. +10-09-22 A bug which could cause an exception when a function with static + variables was redefined has been fixed. +10-09-21 A bug in the processing of (command&) which created a job in the + parent process has been fixed. +10-09-21 A for loop optimization bug with arithmetic expression evaluation + has been fixed. +10-09-21 A bug in which a recursive function containing a pipeline could + lead to an exception fixed after 8 levels of recursion has been + fixed. +10-09-18 A bug in which the count of elements in an array was wrong leading + to an exception has been fixed. +10-09-13 A bug which occurred when both xtrace and showme options where + specified in which the xtrace option disabled showme has been fixed. +10-09-13 A bug in which creating a reference to an array variable with any + elements could cause subsequent array elements to be treated as + compound variables has been fixed. +10-09-09 A bug which caused ((c.ar[x][y])) to be treated as a syntax error + has been fixed. +10-09-08 A bug in the processing of references to multidimensional arrays + in arithmetic expressions has been fixed. +10-09-08 A bug in the handling of multi-dimensional arrays which caused + the number of elements in each dimension to be incorrect has + been fixed. +10-09-07 The change for messages on 10-08-09 did not handle message in + assignments and this has been fixed. +10-09-07 A bug in the indentation of compound variables in arrays when + output with print -v has been fixed. +10-09-07 A rare bug with indexed arrays when assigned a null string that could + cause a core dump has been fixed. +10-09-03 A number of changes were made for jobs pools. +10-08-31 typeset -p was modified to output name references after other + variables so that the output could be used as input. +10-08-31 A bug with typeset -p in which variables with attributes but + without attributes were not displayed correctly has been fixed. +10-08-27 +When running a subshell, the current pool is unset. +10-08-27 A bug in which jobs started from within for or while lists in + interactive shells could generate completion messages has been fixed. +10-08-25 Fixed a couple of bugs related to job pools. +10-08-24 +[[ -e /dev/xxx/ ]] can be used to check whether special files of + those names are handled by the shell. +10-08-24 A bug in the running of a compiled dot script in which only the + first command was executed has been fixed. +10-08-23 A bug which sometimes caused a core dump with a configure script + has been fixed. +10-08-20 A bug in command substitution which caused a configure script to + hang has been fixed. +10-08-19 Eliminated unnecessary ; from output of compound variable with + typeset -p. +10-08-17 Fixed a bug in command substitution in which under certain + circumstances a file whose size is a power of 2 plus one, and the last + character was not a new-line, could cause memory corruption. +10-08-13 +Added static discipline functions to type similar to C++ static + class functions. +10-08-11 A bug in time when applied to a pipeline in which the shell did + not wait for all elements of the pipeline to complete has been fixed. +10-08-11 Restored sh_fmtq() quoting to not quote NAME= in NAME=VALUE. +10-08-09 +Modified the expansion of message strings, $"...", so that they + are expanded each time they are referenced rather than expanding + them when the script is compiled or read in. +10-08-06 +The process id for jobs in job pools is now of the form poolname.n + where n is the jobid in that pool. Commands that accept job names + or numbers now understand names in this format. +10-08-05 A bug in which an assignment from within an arithmetic expression + inside a function would create a local variable has been fixed. +10-08-04 A bug in the expanding of variables whose names contain multibyte + characters has been fixed. +10-08-04 A bug which caused an exception when processing scripts compiled + with shcomp -n has been fixed. +10-08-02 Tests using very small buffer sizes uncovered a number of bug most + connected with here documents which have been fixed. +10-07-27 The format modifier , used for digit grouping with d and f formats + has been documented. +10-07-26 cd '' now produces and error rather than changing to the current + directory. +10-07-26 A bug in multi-byte locales which the last character of a + multi-byte character is a \ or pattern character which could occur + when the character was the last character of a command substitution + has been fixed. +10-07-23 Another bug in the processing of ${var:offset;len} in multi-byte + locales when len is larger than the number of characters has been + fixed. +10-07-23 Many coding changes have been made to eliminate most of the uses + of global variables in the shell code. +10-07-22 Fixed a bug in which discipline functions were not being invoked + when it was invoked as ref.discipline where ref was a name reference + to an array instance. +10-07-22 Fixed a bug in which discipline functions were not being invoked it + was invoked on a two dimensional array, i.e., arr[5][9].discipline. +10-07-19 Fixed a buffering problem which occurred when running a script with + ssh and the parent ssh process is killed. +10-07-14 Modified the parser to treat ((...)) inside [[...]] as ( (...) ) to + that it is a nested (...). +10-07-09 A bug in the handling of process substitution inside command + substitution as part of a pipeline has been fixed. +10-07-07 A bug in the output for compound variables containing + multi-dimensional arrays has been fixed. +10-07-06 ksh now recovers from changes made by bash to the history file without + loosing history commands. +10-06-25 A bug in which a large here document containing command substitutions + of a dynamically loaded function that contained a here document + could get truncated has been fixed. +10-06-24 If after executing a script found in FPATH, if a function, builtin, + or type name corresponding to that script is not defined, the shell + now outputs an error message and returns value 126. +10-06-23 Floating point functions that happened to return integer values + were being treated as if the function returned integers so that + integer division could be used instead of floating point division. +10-06-22 Fixed a bug in earlier ksh93u in which an arithmetic assignment to a + variable in the global scope would instead create a local variable if + the variable had an attribute but did not have a value. +10-06-18 Modified trap handling so that if the same signal is received when + executing the handler, it is deferred until the handler completes. +10-06-16 Fixed a bug in which ulimit -v was setting the the cpu limit + on Linux. +10-06-14 +The command 'typeset -T' now generates the list of type definitions + in a format that can be used as input to the shell. +10-06-09 Put in patch from Solaris for output quoting with %q. +10-06-09 +Made changes to the NAMESPACE compile option so that it now seems + to work. With this option, namespace { command;} will + run command in the namespace .name so that all variables and + functions created by command are accessible outside the name + space via .name.var and .name.fun. Variables and functions that + are not in the namespace are not modified when running command. +10-06-07 Change most internal interfaces to take Sh_t* argument. +10-06-03 +Types can be loaded on first reference by putting definitions in + PFPATH. +10-06-03 +The shell is now able to parse commands which use type statements + before the typeset -T command to define the type executes. +10-06-03 A bug in the quoting for name reference declarations which did + not properly handle [ and ] in subscripts for associative arrays. +10-06-02 A bug in which a discipline function defined by a type instance to + override the default was not being registered has been fixed. +10-06-02 A bug in which read -C of an associative array of compound variables + was not working has been fixed. +10-06-02 A bug in which the error message for an unset parameter with set -u + did not contain the name of the variable has been fixed. +10-06-01 A bug in typeset -m for moving an indexed array instance to a variable + has been fixed. +10-06-01 A bug in which caused memory to be freed twice when unset was called + for an indexed array that had get or set disciplines has been fixed. +10-06-01 A bug in which the %b format of printf was not preserving NUL bytes + with \0 has been fixed. +10-06-01 A bug in the handling of name references to array variables in + arithmetic expressions has been fixed. +10-05-28 Fixed bugs in changing attributes for two dimensional arrays. +10-05-28 Eliminated a few unreferenced variables and a reference to + uninitialized memory. +10-05-27 Rewrote the subshell code to avoid using pipes an many cases. +10-05-24 Fixed a bug which cause an exception when both -l and -s were + specified with typeset -i. +10-05-21 Inputting of three dimensional indexed arrays with ( ( (...)...)...) + was not working and has been fixed. +10-05-21 A bug in which adding the attributes -Ai to a variable via a name + reference could cause the value to display incorrectly has been fixed. +10-05-21 A bug in which using $var inside ((...)) did not work when var was + a hex float variable. +10-05-20 +The compile option SHOPT_EDPREDICT has been added. When this option + is on, as you type a line beginning with a # the following characters + are treated as a shell pattern and cause matching lines from the + history file to be displayed as a numbered list as you type. + You can scroll up and down this list or you can use nTAB + to make this the current line (n defaults to 1 of omitted) or + n to execute. +10-05-20 A bug which caused an exception when multiple levels of composite + functions in arithemtic expressions has been fixed. +10-05-19 <<< with an empty string no longer gives an error. +10-05-19 A bug in arithmetic evaluation when a name reference to an array + instance was used has been fixed. +10-05-14 A bug in which the shell treats a valid index array assignment, + typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed. +10-05-13 A bug in creating name references to associative array variable + after a lookup of one of its elements has been fixed. +10-05-12 Two bugs in the handling of function static type variables in + subshells have been fixed. One could cause an exception and the + other would leave side effects in the parent shell. +10-05-10 A bug in which static variables in functions were not being saved and + restored properly when running subshells has been fixed. +10-05-05 A bug in which print -v did not work correctly when an operand was an + indexed array element referring to a compound variable has been fixed. +10-05-05 A change to improve performance by special casing empty string + assignments to avoid repeated malloc() and free(). +10-05-05 A bug in which creating a name reference to a non-existent associative + array element would create the array element has been fixed. +10-05-04 A bug in which name references to static variables in the static + scope were not found has been fixed. +10-04-30 Do not use socketpair() on systems that implement ioctl(I_PEEK) + on pipes. +10-04-29 +When the current job pool is set, coprocess are run in a job pool. +10-04-28 A type defined with a member foo that is an associative array without + elements followed by an expansion ${bar.foo[a]} and an assignment + bar.foo[a]=b, no longer indicates that ${#bar.foo[@]} has 0 members. +10-04-27 Another bug in which a nested command substitution could hang if it + generated too much data has been fixed. +10-04-26 A type defined with a member that is an indexed array without elements + would behave as if the 0th element of each instance was defined after + a non-zero element was specified and this has been fixed. +10-04-26 A bug in which types defined in a subshell were not undefined when + the subshell completed has been fixed. +10-04-23 For file completion in commmand line editing, file names starting + with # are now escaped so that they are not treated as comments. +10-04-23 A bug in which ${t.var:=value}, where t is an instance of a type + variable, could assign value to the type variable rather than to + the type instance has been fixed. +10-04-23 +Added &| which can be used in place of | to have portions of a + pipeline executed in the pool. +10-04-22 +The .sh.pool variable was added for use with job pools. +10-04-22 A bug in which a nested command substitution could hang if it + generated too much data has been fixed. +10-04-20 A bug which corrupted one byte of memory when read was called with + reads that did not use a delimiter has been fixed. +10-04-19 The display of a compound variable with an embedded array with + attributes was sometimes not working correctly and has been fixed. +10-04-16 A bug in which attributes were not be propagated to elements in + an associative array has been fixed. +10-04-15 A bug which caused scripts containing user defined math functions to + fail to compile with shcomp has been fixed. +10-04-15 +Job pools have been added with the SHOPT_COSHELL compilation option. + A job pool allows a collection of background jobs to run either locally + or remotely and to be managed as a unit. The command '& name ...' + creates or uses a named job pool for subsequent background jobs. + kill, wait, and jobs allow the pool name as operands. +10-04-14 A bug in which a coprocess connection could terminate prematurely + when running a nested subshell has been fixed. +10-04-12 +Enumeration constants can be used in arithmetic expressions with the + ==, != and = operators when the left hand side is an enum variable + and the right hand side is an enumeration constant. +10-04-07 A bug in which setting the trap on CHLD to ignore could cause + an incorrect exit status has been fixed. +10-04-06 A bug in which LINENO was not incremented for a here-document when + the here-document word was followed by a comment has been fixed. +10-04-06 The optimization that execs the last process of a script rather + than creating a new process has been removed when a trap on + interrupt has been set. +10-04-06 Unsetting the 'C', 'A' or 'a' typeset attribute now produces an + error message rather than generating an exception. +10-04-06 A bug in which .sh.name contained the subscript and .sh.subscript + was empty in some cases with discipline functions on array instances + has been fixed. +10-04-05 A bug in the edit modes where preceding the interrupt character with + the literal next character did not work has been fixed. +10-04-05 A bug in the creation of type instances of arrays which could cause + an exception has been fixed. +10-03-30 A bug in the display of a compound variable containing an indexed + array of compound variables has been fixed. +10-03-24 +Arithmetic functions can be defined using the shell function syntax, + 'function .sh.math.name x y z{...}' , where name is the function name + invoked within ((...)) and x y z are long double arguments passed + as name references. y and z are used for functions with two and + three arguments respectively. The value of the function is the value + of the long double .sh.value variable when the function returns. +10-03-24 A bug in which integer division was mistakenly used when the + numerator was a binary operator with the first operand floating + point and the second integer, e.g. (.1**3)/3, has been fixed. +10-03-24 The >; file operator was modified so that the temporary file is + created in the same physical directory as file. +10-03-23 A warning message was added to sh -n when $var was used inside + ((...)) instead of var. +10-03-19 fmin was added to the list of math function on the man page. +10-03-19 Fixed the return value for unalias when the alias did not + exist. +10-03-19 A bug in which the SHLVL variable exported the value it had on + input rather than the incremented value has been fixed. +10-03-19 A bug which causes whence -q to go into an infinite loop has been + fixed. +10-03-19 Removed space between Stopped message and (SIGTTIN) and (SIGTTOUT). +10-03-17 Modified profile shell execution so that when builtins that + correspond to executable have extended attributes, they are + executed by pfksh instead of being treated as built-ins. +10-03-16 A bug in whence -a which produced duplicate lines of output has + been fixed. +10-03-16 A bug in the handling of process groups in monitor mode for + command substitutions has been fixed. +10-03-15 Fixed a bug in which read -u[fd] could cause the shell to core + dump when fd was greater than open_max. +10-03-15 +Modified the shell I/O so that the shell will not fail if the + ulimit for open_max is increased as part of the script. +10-03-12 A bug in which a here-document containing command substitutions + that contained here-documents did not process correctly has been + fixed. +10-03-12 A bug in which the terminal is not restored to canonical mode + after read times out when in a multibyte locale with no edit mode + enabled has been fixed. + +10-03-05 --- Release ksh93t+ --- +10-03-05 A variable unset memory leak has been fixed and tests/leaks.sh + has been added to verify the fix. +10-03-04 Documentation, comment, and diagnostic spelling typos corrected. +10-02-14 Fix sh_getenv() initialization to cooperate with the 3d fs. +10-02-12 A bug in which the get discipline function was not invoked for + associative array subscripts for unset array elements has been fixed. +10-02-12 A bug which could occur if the last line of a script was an eval + that executed multiple commands has been fixed. +10-02-02 A buffer overflow in read and another in binary type base64 + encoding were fixed. +10-01-20 A bug in the evaluation of arithmetic expression in which the + subscript was evaluated twice for $((foo[x++]++)) has been fixed. +10-01-19 A workaround for a double-free of a trap in both a subshell and its + parent has been added. +10-01-18 A bug in type handling of typeset -H has been fixed. +10-01-15 The "adding empty subscript" warning now only emitted with -x set. +10-01-01 A bug in the parser in which '$((case i in i):;esac);:))' was not + parsed correctly was fixed. +10-01-01 A bug in the parser in which '$(( 2 , 3.6 ))' dumped core for locales + with radix char , and thousands separator . has been fixed. +09-12-28 A bug in the handling of SIGCLD on systems that generated SIGCLD + while blocked waiting for process to complete has been fixed. +09-12-24 ast setlocale() reworked to differentiate env var changes from user + override. +09-12-18 A bug with the SHOPT_BGX option set which disabled traps for signals + < SIGCHLD when a trap for a signal > SIGCHLD was set has been fixed. +09-12-18 A bug where [[ -v var ]] was incorrect for some variables (including + LC_* vars) has been fixed. +09-12-15 A bug that produced a syntax error when a multibyte character + straddled a buffer boundary has been fixed. +09-12-11 A bug where the subscript of an unset variable was not evaluated has + been fixed. +09-12-09 A bug where shcomp dumped core on certain syntax errors has been fixed. +09-12-07 A bug where a parent shell environment var reset in a subshell removed + the value in subsequent children of the parent shell has been fixed. +09-12-04 A bug in which in some cases a trap in a function executed in + a subshell could trigger twice has been fixed. +09-12-03 A bug in which SHLVL exported with some attributes could cause + the shell to abort at startup has been fixed. +09-12-02 A bug with pipefail in which the shell could hang waiting for the + writer to complete before the last reader command has been fixed. +09-11-30 A bug in which a trap could be inherited by the first element of + a pipeline when the command had more than 63 arguments that did + not contain any macro expansions has been fixed. +09-11-19 When read from a terminal was called from with a while or for loop, + and an edit mode was on, a backspace or erase no longer will + overwrite the prompt. +09-11-17 +Change .paths parse to handle BUILTIN_LIB=foo BUILTIN_LIB=foo-1.2. +09-11-17 Inside a function, typeset foo.bar will bind foo to global variable + foo if local variable foo does not exist, instead of creating a + local variable. +09-11-17 "read -n1" from the terminal has been fixed to read exactly one character. +09-11-11 Job control now works for subshell commands, (...). +09-11-11 If set -e is on for an interactive shell errors in special builtins + now cause the shell to exit. +09-11-11 A bug in which an interrupt handler processed during the read builtin + when IFS did not contain a new line has been fixed. +09-11-09 A bug in which a variable that has been unset in a subshell and then + exported from that subshell does not show up in the environment + has been fixed. +09-11-02 ``,2'' is now a valid numeric constant for locales with + decimal_point=','. +09-11-02 A bug where "return" in .profile did not restore the shell state + has been fixed. +09-10-31 A bug that corrupted saved exit status when pids wrapped around has + been fixed. +09-10-26 A bug in { LANG LC_ALL LC_category } ordering has been fixed in -last. +09-10-16 A bug where notification to libast that the environment has changed + has been fixed. +09-10-12 A bug in which a function loaded in a subshell could leave side + effects in the parent shell has been fixed. +09-10-12 A bug in converting a printf %d operand to a number when the operand + contains multiple subscripts for the same variable has been fixed. +09-10-09 A bug in the handling of the escape character \ in directory prefixes + in command completion has been fixed. +09-10-09 $PATH processing has been changed to delay dir stat() and .paths + lookup until the directory is needed in the path search. +09-09-28 Call the ast setlocale() intercept on unset too. +09-09-24 A bug in which LANG=foo; LC_ALL=foo; unset LC_ALL; did not revert + LC_CTYPE etc. to the LANG value has been fixed. +09-09-17 A bug in which unsetting SVLVL could cause a script invoked by + name without #! to core dump has been fixed. +09-09-16 A bug in which a pipeline in a here-document could hang when the + pipefail option was on has been fixed. +09-09-09 A bug in the processing of line joining in here documents which + occurred when a buffer began with has been fixed. +09-09-09 +A leading ; with commands in a brace group or parenthesis group + no longer causes an error. It now is used for the "showme" option. +09-09-09 A bug in which a subshell containing a background process could + block until the background process completed has been fixed. +09-09-04 A bug in handing ${var[sub]}, where var is a nameref has been fixed. +09-09-03 A bug which caused an index array to have the wrong number of elements + when it was converted from a compound variable by adding an another + element has been fixed. +09-09-03 Specifying export for a compound variable now generates an error. +09-09-02 $"..." localizations strings are no longer recognized inside `...`. +09-09-01 A bug in the for loop optimizer in the handling of type static + variables has been fixed. +09-09-01 An error message is not displayed when * and @ are used as subscripts. +09-09-01 Several bugs in the processing for types that included an associative + array of another type has been fixed. +09-09-01 A bug in the tracing of [[ a < b ]] and [[ a > b ]] has been fixed. +09-08-26 The .sh.file variable was not being set for a script that was run + by name and didn't start with #! and this has been fixed. +09-08-25 A bug in which a function called to deeply from command substitution + did not display an error message has been fixed. +09-08-24 +When processing profiles, ksh93 now violates the POSIX standard and + treats &> as a redirection operator similar to bash. +09-08-23 A bug in the handling of the trap on SIGPIPE that could lead to a + memory fault has been fixed. +09-08-21 A bug in the handling of the comma operator in arithmetic expressions + that could cause a core dump on some systems has been fixed. +09-08-20 A bug in which a compound variable containing an array of a type + that doesn't have any elements now expands correctly. +09-08-19 A bug which disabled function tracing inside a function after + a call to another function has been fixed. +09-08-19 A bug in which initializing a compound variable instance to another + compound variable by name has been fixed. +09-08-18 A bug in which compound variable instances could be lost after + an instance that invoked a type method discipline has been fixed. +09-08-18 A bug in which a discipline function for a type applied to an + array instance when invoked in a function ignored the subscript + has been fixed. +09-08-18 A scoping error with variables in arithmetic expression with + type variables when reference with a name reference has been fixed. +09-08-10 Several memory leaks were fixed primarily related to subshells. +09-08-06 A bug in which setting the trap on CHLD to ignore could cause + a script to hang has been fixed. +09-07-08 A bug in the processing of name reference assignments when it + contained pattern expansions with quoting has been fixed. +09-06-22 +The default width for typeset -X has been changed so that there + should be no loss of precision when converting to a string. +09-06-19 A bug in the printing of array elements for binary variables with + printf %B has been fixed. +09-06-19 A bug which caused a core dump with trap DEBUG set with an array + assignment with no elements has been fixed. +09-06-19 A bug with read with typeset -b -Z has been fixed. +09-06-19 Two bugs related to read -b for array variables has been fixed. +09-06-19 A bug with typeset for compound variables containing arrays of + compound variables has been fixed. +09-06-18 A bug in appending a compound variable to a an indexed array of + compound variables has been fixed. +09-06-18 A bug which occurs when appending a compound variable to an indexed + array element has been fixed. +09-06-18 Setting VISUAL to a value other than one ending in vi or emacs will + no longer unset the edit mode. +09-06-17 A bug in typeset -m when moving a local compound variable to a + global compound variable via a name reference has been fixed. +09-06-17 A bug in appending to nodes of an array of compound variables when + addressing them via nameref has been fixed. +09-06-17 A bug in typeset -p var, when var is an array of compound variables + in which the output only contained on array element has been fixed. +09-06-17 The prefix expansion ${!y.@} now works when y is a name + reference to an element of an array. +09-06-16 Traps on signals that are ignored when the shell is invoked + no longer display. Previously they were ignored as required but + would be listed with trap -p. +09-06-12 A bug in vi edit mode in which hitting the up arrow key at the + end of a line longer than 40 characters which caused a core dump + has been fixed. +09-06-11 A bug in which "eval non-builtin &" would create two processes, + one for the & and another for non-builtin has been fixed. +09-06-08 When var is an identifier and is unset, ${var} no longer tries to + run command substitution on the command var. +09-06-08 +Process substitution arguments of the form <(command) can now be + used following the < redirection operator to redirect from command. +09-05-13 A bug in which redirections of the form 2>&1 1>&5 inside command + substitution could cause the command substitution to hang has been + fixed. +09-05-12 To conform with POSIX, the -u option only checks for unset variables + and subscript elements rather than checking for all parameters. +09-05-12 A bug which could cause a core dump when a variable whose name + begins with a . was referenced as part of a name reference inside + a function has been fixed. +09-05-01 A bug that caused a core dump when SIGWINCH was received and + both vi and emacs mode were off has been fixed. +09-04-22 +Default alias compound='typeset -C' added. +09-04-15 A bug that caused ${...;} to hang for large files has been fixed. +09-04-08 A change was made in the -n option which printed out an incorrect + warning with <>. +09-04-07 The emacs edit command M-_ and M_. and the vi command _ was fixed + to handle the case there there is no history file. +09-04-05 A bug in handling new-lines with read -n has been fixed. +09-04-05 The ENV variable defaults the the file named by $HOME/.kshrc rather + then to the string $HOME/.kshrc. +09-03-31 A bug in which a nested command substitution with redirections could + leave a file descriptor open has been fixed. +09-03-24 +ksh now only uses the value of the _ variable on startup if it can + verify that it was set by the invoking process rather than being + inherited by some other ancestor. +09-03-24 +When ksh is invoked without -p and ruid!=euid, and the shell is + compiled without SHOPT_P_UID or ruid=SHOPT_P_UID then euid is set + to ruid. A bug that did the wrong test (ruid&1 inside a command substitution wasn't working + correctly has been fixed. +09-02-02 A bug in the call stack of arithmetic function with 2 args + returning int has been fixed. +09-01-30 A bug in which 'eval print \$0' inside a function was giving the + wrong value for $0 has been fixed. +09-01-28 A bug in which a command substitution could return an exit status + of 127 when the pipefail option is enabled has been fixed. +09-01-26 ksh93 now generates an error message if you attempt to create + a global name reference to a local variable. +09-01-26 +The [[ -v var ]] operator was modified to test for array elements. +09-01-23 +The redirection operator <>; was added. It is similar to <> + except that if the command it is applied to succeeds, the file + is truncated to the offset at the command completion. +09-01-23 The default file descriptor for <> was changed to 1. +09-01-20 A bug in which the exit status specified in an exit trap was + not used when a process terminated with a signal has been fixed. +09-01-19 A bug in which a signal whose default action is to terminate + a process could be ignored when the process is running a sub-shell + has been fixed. +09-01-19 A bug in which sending SIGWINCH to a process that reads from a pipe + could cause a memory fault has been fixed. +09-01-16 +The -R unary operator was added to [[...]] and test to check whether + a variable is a name reference. +09-01-16 +The -v unary operator was added to [[...]] and test to check whether + a variable is set. +09-01-14 The unset built-in was modified to return 0 exit status when + unsetting a variable that was unset to conform with the POSIX + standard. +09-01-14 The unset built-in was modified to continue to unset variables + after encountering a variable that it could not unset to + conform to the POSIX standard. +09-01-14 The parameter expansion ${x+value} no longer expands the value of + the variable x when determining whether x is set or not. +09-01-13 A bug in which background jobs and pipelines that were not waited + for could, in rare instances, cause the shell to go into an infinite + loop or fail has been fixed. +09-01-06 A bug in indexed arrays of compound variables in which referencing + non-existent sub-variable in an arithmetic expression could cause + the sub-variable to be created has been fixed. +09-01-05 A bug in which the \ character did not escape extended regular + expression pattern characters has been fixed. +08-12-24 A bug in which killing the last element of a pipe did not cause + a write to the pipe to generate a SIGPIPE has been fixed. +08-12-19 A bug which could cause command substitution to hang when the + last element of a pipeline in a command substitution was a built-in + and the output was more that PIPE_BUFF. +08-12-18 A bug which occurs when a here documented marker embedded in a + command substitution occurs on a buffer boundary has been fixed. +08-12-17 A bug in the output of typeset -p for variables that had attributes + but did not have a value has been fixed. +08-12-16 A bug in which a name reference to a name reference variable that + references an array element has been fixed. +08-12-16 A bug in which a variable given both the -A and -C attribute along + with an initial assignment didn't work correctly has been fixed. +08-12-10 The [[ -t fd ]] test was fixed to handle fd>9. +08-12-10 A bug where function stack misalignment could cause a bus error + has been fixed. +08-12-09 Command completion was changed to use \ to quote special characters + instead of quoting the argument in single quotes. +08-12-07 A bug in typeset -m which occurred when the target node was an + associative array element has been fixed. +08-12-07 A timing bug on some systems (for example darwin), that could + cause the last process of a pipeline entered interactively to fail + with an "Exec format error" has been fixed. +08-12-04 +SHOPT_BGX enables background job extensions. Noted by "J" in + the version string when enabled. (1) JOBMAX=n limits the number + of concurrent & jobs to n; the n+1 & job will block until a + running background job completes. (2) SIGCHLD traps are queued + so that each completing background job gets its own trap; $! is + set to the job pid and $? is set to the job exit status at the + beginning of the trap. (3) sleep -s added to sleep until the time + expires or until a signal is delivered. +08-12-04 The sign of floating point zero is preserved across arithmetic + function calls. +08-12-04 A bug that caused print(1) to produce garbled stdout/stderr + output has been fixed. +08-12-04 A bug in which printf "%d\n" "''" did not output the + numerical value of the EURO symbol, 8354, has been fixed. +08-11-24 + /dev/fd* and /dev/std* redirections are first attempted with + open() to preserve seek semantics; failing that the corresponding + file descriptors are dup()'d. +08-11-20 A bug which could cause a core dump if a function compiled with + shcomp was found has been fixed. +08-11-20 A bug in which jobs were not cleared from the jobs table for + interactive shells when the pipefail option is on has been fixed. +08-11-11 A bug in which a field that was unset in a type definition and later + set for an instance could appear twice when displaying the variable + has been fixed. +08-11-11 A bug in which running a simple command & inside a function would + not return the correct process id has been fixed. +08-11-10 A bug in which the exit status of a command could be lost if the pid + was that of the most recent command substitution that had completed + has been fixed. +08-11-10 The maximum depth for subshells has been increased from 256 to 65536. +08-11-06 A bug which could cause a core dump when the _ reference variable was + used as an embedded type with a compound assignment has been fixed. + +08-10-31 --- Release ksh93t --- +08-10-31 Variable scoping/initialization bugs that could dump core were fixed. +08-10-24 The lexer now accepts all RE characters for patterns prefixed + with a ksh ~(...) option expression. +08-10-24 +For ${var/pat/sub} \0 in sub expands to the text matched by pat. +08-10-18 A bug in array scoping that could dump core has been fixed. +08-10-10 read -n and -N fixed to count characters in multibyte locales. +08-10-10 A bug that mishandled _.array[] type references has been fixed. +08-10-09 +${.sh.version} now contains a concatenation of the following (after + 'Version') denoting compile time features: + A SHOPT_AUDIT + B SHOPT_BASH + L SHOPT_ACCT + M SHOPT_MULTIBYTE +08-10-09 A bug that caused subshell command substitution with redirection + to hang has been fixed. +08-10-08 Output errors, other than to stderr, now result in a diagnostic. +08-10-08 ksh93 now supports types that contain arrays of other types as + members. Earlier versions core dumped in this case. +08-10-05 A bug which caused the shell to emit a syntax error for an arithmetic + statement of the form (( var.name[sub] = value)) has been fixed. +08-10-01 A bug that caused subshell command substitution to hang has + been fixed. +08-09-29 When the -p export option of typeset is used with other options, + only those variables matching the specified options are displayed. +08-09-29 When the shell reads the environment and finds variables that are + not valid shell assignments, it now passes these on to subsequent + commands rather than deleting them. +08-09-29 A bug in the display of compound variables containing an indexed + array of compound variables has been fixed. +08-09-29 A bug in the display of compound variables containing an associative + array with a subscript containing a . in the name has been fixed. +08-09-26 A core dump in the subshell environment restore has been fixed. +08-09-24 $(...) has been fixed to properly set the exit status in $?. +08-09-23 $(<...) with IFS=$'\n\n' has been fixed to retain all but the last + of multiple trailing newlines. +08-09-23 The -p option to typeset when used with other attributes, restricts + the output to variables with the specified attributes. +08-09-22 A bug that sometimes lost the exit status of a job has been fixed. +08-09-21 A bug that retained trailing command substitution newlines in + cases where the command caused the shell to fork has been fixed. +08-09-19 type, whence -v, and command -v were fixed to comply with POSIX + by writing 'not found' diagnostics to the standard error. +08-09-18 test and [...] were fixed to comply with POSIX in the case + of test '(' binop ')' where binop is a valid binary test operator. +08-09-16 +If a method discipline named create is specified when defining a + type, this function will be called when an instance is created. +08-09-15 +The variable _ is now set as a reference to the compound variable + when defining a compound variable or a type. +08-09-10 The shell now prints an error message when the type name specified + for an indexed array subscript is not an enumeration type. +08-09-10 A bug in which a subshell that spawned a background process could + loose output that was produced after the foreground completed + has been fixed. +08-09-10 A timing bug on some systems that could cause coprocesses started by a + subshell to not clean up and prevent other coprocesses has been fixed. +08-09-09 The typeset -m option is now able to rename array elements from + the same array. +08-09-09 The exit status of 2 from the DEBUG trap causes the next command + to be skipped. An exit value of 255 from a DEBUG trap called from + a function causes the function to return. +08-09-08 A bug in which a coprocess created in a subshell that did not + complete when the subshell terminated could prevent a coprocess + from being created in the parent shell has been fixed. +08-09-05 An assignment of the form name1=name2 where name1 and name2 + are both compound variables causes name1 to get a copy of name2. + name1+=name2 causes name2 sub-variables to be appended to name1. +08-09-05 A bug in which unsetting a compound variable did not unset all + the sub-variables has been fixed. +08-09-01 A bug in the subshell cleanup code that could cause SIGSEGV has + been fixed. +06-08-26 +The SHLVL variable which is an environment variable used by bash + and zsh that gets incremented when the shell starts. +08-08-25 +For an indexed array, a negative subscript now refers to offsets + from the end so that -1 refers to the last element. +08-08-24 An alignment error for shorts on 64 bit architectures has been fixed. +08-08-22 If oldvar is a compound variable, typeset -C newvar=oldvar creates + newvar as a copy of oldvar. +08-08-19 +The ALRM signal no longer cause the sleep builtin to terminate. +08-08-13 When used in an arithmetic expression, the .sh.version variable + now produces a number that will be increasing for each release. +08-08-11 A bug in which type instantiation with a compound assignment in + a dot script in which the type is defined has been fixed. +08-08-07 +The -m option has been added to typeset to move or rename a + variable. Not documented yet. +08-08-06 A bug in read when used in a loop when a prompt was specified + when reading from a terminal has been fixed. +08-08-01 A bug with the pipefail option in which a nested pipeline could + cause an asynchronous command to block has been fixed. +08-08-01 A for loop optimizer bug that treats .sh.lineno as an invariant + has been fixed. +08-07-30 A bug in which expanding compound variable that had a get discipline + from with a here document could cause a syntax error has been fixed. +08-07-18 A bug in which a nameref caused a local variable to be created + rather than binding to an existing variable in the global scope + has been fixed. +08-07-17 A bug which occurred when a nameref was created from within a + function that was part of a pipeline has been fixed. +08-07-14 +The compile option SHOPT_STATS was added. With this option the + compound variable .sh.stats keeps usage statistics that could help + with performance tuning. +08-07-10 +The output of set now always uses a single line for each variable. + For array variables, the complete set of values is now displayed. +08-07-09 +The typeset -C option can be used with arrays to indicate that + each element should default to a compound variable. +08-07-08 +The %B format now outputs compound variables and arrays. The + alternate flag # can be used to cause output into a single line. +08-07-03 When the window change signal, WINCH, is received, the current + edit line is redrawn in place. +08-07-01 A bug in the handling of shared variables when inside an embedded + type has been fixed. +08-06-29 A bug in multiline edit mode which occurred when the prompt length + was three characters or less has been fixed. +08-06-23 A bug in which the SIGCLD was not be triggered when background + jobs completed has been fixed. +08-06-23 _KSH_VERSION added as a name reference to .sh.version. +08-06-20 type now outputs 'special builtin' for special builtins. +08-06-19 A couple of bugs in multi-dimensional arrays have been fixed. +08-06-19 A bug in which a syntax error in a dot script could generated + a syntax error in the next subsequent command has been fixed. +08-06-17 Reduced the maximum function call depth to 2048 to avoid exceptions + on some architectures. +08-06-16 A bug in which printf "%B" could generate an exception when the + specified variable was not set has been fixed. +08-06-16 +When typeset -p is followed by variable names, it now displays + the attributes names and values for the specific names. +08-06-14 A bug that could effect the drawing of the screen from multiline + emacs or gmacs mode when walking up the history file has been fixed. +08-06-13 A bug in which a compound variable defined in a subshell could + have side effects into the parent shell has been fixed. +08-06-13 A number of bugs related to using .sh.level to set the stack from + for DEBUG traps have been fixed. +08-06-13 +The .sh.lineno variable has been added. When .sh.level is changed + inside a DEBUG trap, the .sh.lineno contains the calling line number + for the specified stack frame. +08-06-13 The .sh.level variable has been documented and now works. +08-06-11 +The -C option has been added to read for reading compound command + definitions from a file. +08-06-11 +The . command is now permitted inside a compound command definition. + The dot script can contain declaration commands and dot commands. +08-06-09 +Add -C option to typeset so that typeset -C foo, is equivalent + to foo=(). +08-06-09 Added -n warning message for typeset option orderings that are valid + with ksh88 but not valid with ksh93, for example Lx5. +08-06-09 A bug in which the return value for an assignment command containing + a command substitution with that failed was zero when the assignment + contained redirections has been fixed. +08-06-09 A bug in the quoting of $ inside a ERE pattern ~(E)(pattern) + has been fixed. +08-06-06 A bug when processing `` command substitution with the character + sequence \$' has been fixed. +08-06-02 +When defining a type, the typeset -r attribute causes this field + to be required to be specified for each instance of the type and + does not allow a default value. +08-06-02 Several bugs in which compound variables were modified by + subshells have been fixed. +08-05-22 +The ceil function has been added to the math functions. +08-05-21 A bug in which a name reference defined in a function and passed + as an argument to another function could cause an incorrect binding. +08-05-21 A bug in freeing compound variables that are local to functions + has been fixed. +08-05-19 +The array expansions ${array[sub1..sub2]} and ${!array[sub1..sub2]} + to expand to the value (or subscripts) for array between sub1 and + sub2 inclusive. For associative arrays, the range is based on + location in the POSIX locale. The .. must be explicit and cannot + result from an expansion. +08-05-15 The trap on SIGCLD is no longer triggered by the completion of + the foreground job as with ksh88. +08-05-14 A bug in the implementation of the editing feature added on + 07-09-19 in emacs mode has been fixed. +08-05-12 A bug in processing the test built-in with parenthesis has been + fixed. +08-05-12 The unset built-in now returns non-zero when deleting an array + subscript that is not set. +08-05-08 +Changing the value of HISTFILE or HISTSIZE will cause the old + history file to be close and reopened with the new name or size. +08-05-08 When FPATH is changed functions that were found via a path search + will be searched for again. +08-05-08 A parser bug in which reserved words and labels were recognized + inside compound indexed array assignment after a new-line has + been fixed. +08-05-07 A bug in getopts when handling numerical option arguments has + been fixed. +08-05-07 +The typeset -S option was added for variables outside type + definitions to provide a storage class similar to C static + inside a function defined with function name. When outside + type definitions and outside a function, the -S option cause + the specified variable so be unset before the assignment and + before the remaining attributes are supplied. +08-05-07 A bug that affected the cursor movement in multiline mode when + a character was deleted from near the beginning of the any + line other than the first. +08-05-01 In multiline edit mode, the refresh operation will now clear + the remaining portion of the last line. +08-05-01 A bug in computing prompt widths for the edit modes for prompts + with multibyte characters has been fixed. +08-05-01 A bug in the multiline edit mode which could cause the current + line to be displayed incorrectly when moving backwards from third + or higher line to the previous line has been fixed. +08-05-01 A bug in which options set in functions declared with the function + name syntax were carried across into functions invoked by these + functions has been fixed. +08-04-30 A bug which could cause a coprocess to hang when the read end + is a builtin command has been fixed. +08-04-30 +The emacs and vi editors have been modified to handle window + change commands as soon as they happen rather than waiting for + the next command. +08-04-28 A bug in which ${!x} did not expand to x when x was unset has been + fixed. +08-04-27 A bug in which the assignment x=(typeset -a foo=([0]=abc)) created + x.foo as an associative array has been fixed. +08-04-25 A bug in which $# did not report correctly when there were more + than 32K positional parameters has been fixed. +08-04-04 Choose the name _ as the sub-variable that holds type or instance + specific data used by discipline functions. +08-03-27 A bug in which the terminal group was not given back to the parent + shell when the last part of a pipeline was handled by the parent shell + and the other parts of the pipeline complete has been fixed. + The symptom was that the pipeline became uninterruptable. +08-03-25 A bug in restricted mode introduced in ksh93s that caused scripts + that did not use #! to executed in restricted mode has been fixed. +08-03-25 A bug in which the pipefail option did not work for a pipeline + within a pipeline has been fixed. +08-03-24 A bug in which OPTIND was not set correctly in subshells has + been fixed. +08-03-24 A bug which could cause a memory exception when a compound variable + containing an indexed array with only element 0 defined was expanded. +08-03-20 A bug in which ${!var[sub].*} was treated as an error has been fixed. +08-03-20 Associative array assignments of the form ([name]=value ...) + now allow ; as well as space tab and new line to separate elements. +08-03-18 A buffering problem in which standard error was sometimes + not flushed before sleep has been fixed. +08-03-17 A bug in which a signal sent to $$ while in a subshell would be + sent to the subshell rather than the parent has been fixed. +08-03-17 + A --default option added to set(1) to handle set +o POSIX semantics. + set --state added as a long name alias for set +o. +08-03-14 A bug in which using monitor mode from within a script could + cause the terminal group to change has been fixed. +08-03-10 The new ${...} command substitution will treat the trailing } + as a reserved word even if it is not at the beginning of a command, + for example, ${ date }. +08-03-10 If the name of the ENV begins with /./ or ././ then the + /etc/ksh.kshrc file will not be executed on systems that support + this interactive initialization file. +08-03-07 A bug in which ksh -i did not run the ENV file has been fixed. +08-03-07 A bug in which ulimit did not always produce the same output as + ulimit -fS has been fixed. +08-03-04 A bug in multiline mode in emacs and vi mode which could cause the + cursor to be on the wrong line when interrupt was hit has been fixed. +08-03-03 The change made in ksh93s+ on 07-06-18 in which braces became + optional for ${a[i]} inside [[...]] was restored in the case + where the argument can be a pattern. +08-03-03 A bug in which creating a name reference to an associative array + instance would fail when the subscript contained characters [ or + ] has been fixed. +08-02-29 +The redirection operator >; has been added which for non-special + files, generates the output in a temporary file and writes the + specified file only of the command has completed successfully. +08-02-15 A bug in ${var/pattern/string} for patterns of the form ?(*) and +(*) + has bee fixed. +08-02-07 A bug in which test \( ! -e \) produced an error has been fixed. +08-02-14 +The typeset -a option can now optionally be followed by the name + of an enumeration type which allows subscripts to be enumerations. +08-02-14 +The enum builtin which creates enumeration types has been added. +08-02-12 The backoff logic when there are no more processes has been fixed. +08-02-07 The -X option has been added to typeset. The -X option creates + a double precision number that gets displayed using the C99 %a + format. It can be used along with -l for long double. +08-01-31 The -T option to typeset has been added for creating typed + variables. Also the -h and -S options have been added to + typeset that are only applicable when defining a type. +08-01-31 The prefix expansion operator @ has been added. ${@name} + expands to the type of name or yields the attributes. +07-11-15 A bug in the macro expander for multibyte characters in which + part of the character contains a file pattern byte has been fixed. +07-10-03 A bug in which : was not allowed as part of an alias name has been + fixed. +07-09-26 A bug in which appending a compound variable to a compound variable + or to an index array didn't work has been fixed. +07-09-19 In both emacs and vi edit mode, the escape sequence \E[A (usually + cursor up, when the cursor is at the end of the line will fetch + the most recent line starting with the current line. +07-09-18 The value of ${!var} was correct when var was a reference to an + array instance. +07-09-18 The value of ${!var[sub]} was not expanding to var[sub] and this + was fixed. It also fixed ${name} where name is a name reference + to var[sub]. +07-09-18 +It is now legal to create a name reference without an initialization. + It will be bound to a variable on the first assignment. +07-08-30 +A discipline function can be invoked as ${x.foo} and is equivalent + to ${ x.foo;} and can be invoked as x.foo inside ((...)). +07-07-09 A bug in which typeset -a did not list indexed arrays has been + fixed. +07-07-03 +The command substitution ${ command;} has been added. It behaves + like $(command) except that command is executed in the current + shell environment. The ${ must be followed by a blank or an + operator. + +08-04-17 --- Release ksh93s+ --- +08-04-17 A bug in which umask was not being restored correctly after a + subshell has been fixed. +08-04-15 A bug in which sending a STOP signal to a job control shell started + from within a shell function caused cause the invoking shell to + terminate has been fixed. +08-04-11 A bug which caused $(exec > /dev/null) to go into an infinite loop + has been fixed. +08-03-27 A bug in which typeset -LZ was being treated as -RZ has been fixed. +08-03-06 A bug with ksh -P on systems that support the the profile shell, + in which it would exit after running a non-builtin has been fixed. +08-01-31 A bug in which command substitution inside ((...)) could cause + syntax errors or lead to core dumps has been fixed. +08-01-17 A bug in which discipline functions could be deleted when invoked + from a subshell has been fixed. +08-01-17 A bug in which a command substitution consisting only of + assignments was treated as a noop has been fixed. +08-01-17 A bug in which discipline functions invoked from withing a + compound assignment could fail has been fixed. +08-01-16 Incomplete arithmetic assignments, for example ((x += )), now + generate an error message. +08-01-16 A bug in which a set discipline defined for a variable before + an array assignment could cause a core dump has been fixed. +08-01-03 A bug in on some systems in which exit status 0 is incorrectly + returned by a process that catches the SIGCONT signal is stopped + and then continued. +07-12-13 A race condition in which a program that has been stopped and then + continued could loose the exit status has been fixed. +07-12-12 Code to check for file system out of space write errors for all + writes has been added. +07-12-11 A bug in the macro expander for multibyte characters in which + part of the character contains a file pattern byte has been fixed. +07-12-06 A bug in the emacs edit mode when multiline was set that output + a backspace before the newline to the screen has been fixed. +07-12-04 A bug in which using TAB after a variable name listing expansion + in the edit modes would cause the $ to disappear has been fixed. +07-11-28 A bug in which setting IFS to readonly could cause a subsequent + command substitution to fail has been fixed. +07-11-27 A work around for a gcc 4.* C99 "feature" that could cause a job + control shell to go into an infinite loop by adding the volatile + attribute to some auto vars in functions that call setjmp(). +07-11-27 A bug in which the shell could read ahead on a pipe causing the + standard input to be incorrectly positioned has been fixed. +07-11-27 A bug in which compound variable UTF-8 multibyte values were not + expanded or traced properly has been fixed. +07-11-21 A bug where an unbalanced '[' in a command argument was not treated + properly has been fixed. +07-11-15 A bug in which compatibility mode (no long option names) getopts(1) + incorrectly set the value of OPTARG for flag options has been fixed. +07-11-15 A bug in which "hash -- name" treated "--" as an invalid name operand + has been fixed. +07-11-15 typeset now handles "-t -- [-r] [--]" for s5r4 hash(1) compatibility. +07-11-15 A bug in which the umask builtin mis-handled symbolic mode operands + has been fixed. +07-11-15 Bugs in which shell arithmetic and the printf builtin mis-handled the + signs of { -NaN -Inf -0.0 } have been fixed. +07-11-15 +The full { SIGRTMIN SIGRTMIN+1 ... SIGRTMAX-1 SIGRTMAX } range + of signals, determined at runtime, are now supported. +07-11-15 A bug in which creating an index array with only subscript 0 created + only a simple variable has been fixed. +07-11-14 A bug in which appending to an indexed array using the form + name+=([sub]=value) could cause the array to become an associative + array has been fixed. +07-11-14 A bug in which typeset without arguments could coredump if a + variable is declared as in indexed array and has no elements has + been fixed. +07-11-14 A bug in which creating a local SECONDS variable with typeset in + a function could corrupt memory has been fixed. +07-11-14 A bug which could cause a core dump when a script invoked by name + from a function used compound variables has been fixed. +07-11-05 A bug in which printf %d "'AB" did not diagnose unconverted characters + has been fixed. +07-11-05 printf %g "'A" support added for all floating point formats. +07-11-01 A bug in which typeset -f fun did not display the function definition + when invoked in a subshell has been fixed. +07-10-29 The sleep builtin was fixed so that all floating point constants + are valid operands. +07-10-10 A bug in which the locale was not being restored after + LANG=value command has been fixed. +07-09-20 A bug in which a nameref to a compound variable that was local + to the calling function would not expand correctly when displaying + is value has been fixed. +07-09-19 A bug which cause cause a core dump if .sh.edchar returned + 80 characters or more from a keyboard trap has been fixed. +07-09-14 A bug in which could cause a core dump when more than 8 file + descriptors were in use has been fixed. +07-09-10 A bug in which creating a name reference to an instance of + an array when the array name is itself a reference has been fixed. +07-09-10 The file completion code has been modified so that after an = in + any word, each : will be considered a path delimiter. +07-09-06 A bug in which subprocess cleanup could corrupt the malloc() heap + has been fixed. +07-08-26 A bug in which a name reference to an associative array instance + could cause the subscript to be evaluated as an arithmetic expression + has been fixed. +07-08-22 A bug in which the value of an array instance was of a compound + variable was not expanded correctly has been fixed. +07-08-14 A bug which could cause a core dump when a compound assignment was + made to a compound variable element with a typeset -a attribute + has been fixed. +07-08-08 A bug in which a trap ignored in a subshell caused it to be + ignored by the parent has been fixed. +07-08-07 A bug in which the set command would generated erroneous output + for a variable with the -RZ attribute if the variable name had been + passed to a function has been fixed. +07-08-02 A bug in which read x[1] could core dump has been fixed. +07-08-02 A second bug in which after read x[sub] into an associative array + of an element that hasn't been assigned could lead to a core dump + has been fixed. +07-07-31 A bug in which a pipeline that completed correctly could have + an exit status of 127 when pipefail was enabled has been fixed. +07-07-09 +The SHOPT_AUDIT compile option has been added for keyboard logging. +07-06-25 In vi insert mode, ksh no longer emits a backspace character + before the carriage return when the newline is entered. +07-06-25 A bug in which pipefail would cause a command to return 0 + when the pipeline was the last command and the failure happened + on a component other than the last has been fixed. +07-06-25 A bug in the expansion of ${var/pattern/rep} when pattern or rep + contained a left parenthesis in single quotes has been fixed. +07-06-18 The braces for a subscripted variable with ${var[sub]} are now + optional when inside [[...]], ((...)) or as a subscript. +07-05-28 A bug in brace expansion in which single and double quotes did + not treat the comma as a literal character has been fixed. +07-05-24 The -p option of whence now disables -v. +07-05-23 Several bug fixes in compound variables and arrays of arrays + have been made. +07-05-15 A bug in which the %B format of printf was affected by the + locale has been fixed. +07-05-14 A bug in which \ was not removed in the replacement pattern with + ${var/pattern/rep} when it was not followed by \ or a digit has + been fixed. +07-05-10 A bug in which ksh -R file core dumped if no script was specified + has been fixed. it not displays an error message. +07-05-07 Added additional Solaris signals to signal table. +07-04-30 A bug in which a pipeline with command substitution inside a + function could cause a pipeline that invokes this function to + hang when the pipefail option is on has been fixed. +07-04-30 +Added -q to whence. +07-04-18 A small memory leak with each redirection of a non-builtin has + been fixed. +07-03-08 A bug in which set +o output command line options has been fixed. +07-03-08 A bug in which an error in read (for example, an invalid variable + name), could leave the terminal in raw mode has been fixed. +07-03-06 A bug in which read could core dump when specified with an array + variable with a subscript that is an arithmetic expression has + been fixed. +07-03-06 Several serious bugs with the restricted shell were reported and + fixed. +07-03-02 If a job is stopped, and subsequently restarted with a CONT + signal and exits normally, ksh93 was incorrectly exiting with + the exit status of the stop signal number. +07-02-26 +M-^L added to emacs mode to clear the screen. +07-02-26 A bug in which setting a variable readonly in a subshell would + cause an unset error when the subshell completed has been fixed. +07-02-19 +The format with printf uses the new = flag to center the output. +07-02-19 A bug in which ksh93 did not allow multibyte characters in + identifier names has been fixed. +07-02-19 A bug introduced in ksh93 that causes global compound variable + definitions inside functions to exit with "no parent" has been fixed. +07-02-19 A bug in which using compound commands in process redirection + arguments would give syntax errors <(...) and >(...) has been fixed. +07-01-29 A bug which caused the shell to core dump which can occur when a + built-in exits without closing files that it opens has been fixed. +07-01-26 A bug in which ~(E) in patterns containing \ that are not inside () + has been fixed. + +06-12-29 --- Release ksh93s --- +06-12-29 A bug in which the value of IFS could be changed after a command + substitution has been fixed. +06-12-22 +/dev/(tcp|udp|sctp)/HOST/SEVRICE now handles IPv6 addresses on + systems that provide getaddrinfo(3). +06-12-19 +A -v option was added to read. With this option the value of + the first variable name argument will become the default value + when read from a terminal device. +06-11-20 A bug in which "${foo[@]:1}}" expands a null argument (instead of + no argument), when foo[0] is not empty has been fixed. +06-11-16 The discipline functions have been modified to allow each subscript + to act independently. Currently the discipline function will not + be called when called from a discipline function of the same variable. +06-11-14 A bug which could cause a core dump if a file descriptor for + an internal file was closed from with a subshell has been fixed. +06-10-30 +The redirections <# pattern, and <## pattern have been added. + Both seek forward to the beginning of the next line that contains + the pattern. The <## form copies the skipped portion to standard + output. +06-10-26 +On systems that support stream control transport, the virtual file + name /dev/sctp/host/port can now be used to establish connections. +06-10-26 +The printf modifier # when used with d produces units in thousands + with a single letter suffix added. The modifier # when used with + the i specification provides units of 1024 with a two letter suffix. +06-10-24 The value of $! is now set to the process id of a job put + into the background with the bg command as required by POSIX. +06-10-23 A bug in which the value of $! was affected by a background + job started from a subshell has been fixed. +06-10-23 A bug in ${var:offset:len} in multibyte locales has been fixed. +06-10-15 +The remaining math functions from C99 were added for any system + that supports them. +06-10-13 The klockwork.com software detected a few coding errors that + have been fixed. +06-10-12 A bug when skipping over `...` with ${x:=`...`} when x is set + has been fixed. +06-10-11 A bug in process floating constants produced by the %a format + of printf has been fixed. +06-10-06 A bug in which IFS was not being restored correctly in some + cases after a subshell has been fixed. +06-10-06 A bug in which pipefail was not detecting some failures in + pipelines with 3 or more states has been fixed. +06-10-03 A bug in the processing of >(...) with builtins which could + cause the builtin to hang has been fixed. +06-10-03 A bug in the for loop optimizer which causes >(...) process + substitution to be ignored has been fixed. +06-09-17 +The -a option was added to typeset for indexed arrays. This + is only needed when using the ([subscript]=value ...) form. +06-09-06 +The showme option was added. Each simple command not beginning + with a redirection and not occurring with in the while, until, if, + select condition can be preceded by a semi-colon which will + be ignored when showme is off. When showme is on, any command + preceded by a colon will be traced but not executed. +06-08-16 +As a new feature, a leading ~(N) on a pattern has no effect + except when used for file expansion. In this case if not + matches are found, the pattern is replaced by nothing rather + than itself. +06-08-11 A bug in the expansion of ${.sh.match[i]:${#.shmatch[i]}} has + been fixed. +06-08-10 +The read builtin options -n and -N have been modified to treat + the size as characters rather than bytes unless storing into a + binary (typeset -B) variable. +06-07-27 +When the here document operator << is followed directly by a # + rather than a -, the first line of the here-document determines + how much whitespace is removed for each line. +06-07-26 A bug in the C-shell history (enabled with set -H) in which the + history event !$ was not processed has been fixed. +06-07-21 A bug on some systems in which assigning PATH on a command line + would not take effect has been fixed. +06-07-20 Add ksh93 and rksh93 as allowable names for ksh binaries. +06-07-20 Removed the SHOPT_OO compilation option which was only partially + implemented. +06-07-20 The ability to use egrep, grep, and fgrep expressions within + shell patterns has been documented. +06-07-17 A bug with arithmetic command expressions for locales in which + the comma is a thousands separator has been fixed. +06-07-13 +The default HISTSIZE was increased from 128 to 512. +06-07-13 A multibyte problem with locales that use shift codes has been fixed. +06-06-23 A number of bug fixes for command, file, and variable completion + have been mode. +06-06-20 +Floating point division by zero now yields the constant Inf or -Inf + and floating functions with invalid arguments yield NaN. +06-06-20 +The floating point constants Inf and NaN can be used in arithmetic + expressions. +06-06-20 +The functions isinf(), isnan(), tanhl() have been added for + arithmetic expressions. +06-06-13 Internal change to use ordering for variables instead of hashing + to speed up prefix matching. +06-06-13 A window between fork/exec in which a signal could get lost + and cause a program to hang has been eliminated +06-06-13 A bug in edit completion with quoted strings has been fixed. +06-06-07 The restricted options can now be enabled by set as well as on + the command line. Once set, it can not be disabled. +06-06-04 Modified built-in binding so that for systems for which /bin + and /usr/bin are the same, a builtin bound to /bin will get + selected when either /bin or /usr/bin is scanned. +06-06-04 +Added literal-next character processing for emacs/gmacs mode. + This change is not compatible with earlier versions of ksh93 + and ksh88 when the stty lnext is control-v. The sequence + escape-control-v will display the shell version. +06-05-31 +Modified emacs and vi mode so that entering a TAB after a partial + TAB completion, generates a listing of possible completions. + After the second TAB, a number followed by a TAB will perform + the completion with the corresponding item. +06-05-19 +Modified arithmetic so that conversions to strings default to + the maximum number of precision digits. +06-05-16 Bug fixes for multibyte locales. +06-05-10 The =~ operator was added to [[...]] and [[ string ~= ERE ]] + is equivalent to [[ string == ~(E)ERE ]]. +06-04-25 A bug in the vi edit mode which could cause the shell to core dump + when switching from emacs mode. +06-04-17 A bug in which using LANG or LC_ in assignment lists with builtins + did not restore the localed correctly has been fixed. +06-04-04 A bug in which discipline functions could not be added to variables + whose names started with .sh has been fixed. +06-03-28 +The -s option to typeset was added to modify -i to indicate short + integers. +06-03-28 A bug in which variables assignment lists before functions + defined with function name were not passed on the functions + invoked by this function has been fixed. +06-03-28 A bug in which name references defined within a function defined + with function name could not be used with compound variables has + been fixed. +06-03-27 A bug in which read <&p (print >&p) would cause the coprocess input + (output) pipe to close before reading from (after writing to) + it has been fixed. +06-02-28 A bug in which stopping a job created with the hist builtin command + would create a job that could not be restarted has been fixed. + +06-01-24 --- Release ksh93r --- +06-01-24 A bug in which running commands with standard output closed would + not work as expected has been fixed. +06-01-23 A bug in which print -u could fail when file descriptor was + open for writing has been fixed. +06-01-19 The ?: arithmetic operator fixed to work when the operation after + the colon was an assignment. +05-12-24 A bug which could lead to a core dump when elements of a compound + variable were array elements, i.e. foo=(bar=(1 2)), has been fixed. +05-12-13 An arithmetic bug in which x+=y+=z was not working has been fixed. +05-12-13 An arithmetic bug in which x||y was returning x when x was non-zero + rather than 1 has been fixed. +05-12-07 +The aliases for integer and float have been changed to use attributes + -li and -lE to handle long long and long double types. +05-12-07 +The histexpand (-H) option has been added which allows C-shell + style history expansions using the history character !. +05-12-07 +The multiline option was added which changes that way the edit + modes handle lines longer than the window width. Instead of + horizontal scrolling, multiple lines on the screen are used. +05-12-05 The whence builtin now returns an absolute pathname when the + command is found in the current directory. +05-11-29 A bug which caused ksh -c '[[ ! ((' to core dump rather than + report a syntax error has been fixed. +05-11-29 A bug when reading fixed length records into typeset -b variables + which caused a zero byte to terminate the value has been fixed. +05-11-22 +The ability to seek to an offset within a file has been added + with the new I/O redirection operators, <# and >#. Currently, + these redirection operators must be followed by ((expr)) + but in a future release, it should be able to used to seek forward + to the specified shell pattern. In addition $(n<#) expands to the + current byte offset for file descriptor n. +05-11-22 +The .sh.match array variable is now set after each [[ ... ]] + pattern match. Previously it was only set for substring matches. +05-10-17 A bug in which the library path variable could be prefixed + with a directory when a .path file was not encountered in + the directory of the executable has been fixed. +05-09-15 A for/while loop optimizer bug in which $OPTIND was not + correctly expanded has been fixed. +05-09-05 A bug in which a history command that invoked a history + command could go into an infinite loop has been fixed. +05-08-31 +In the case that IFS contains to adjacent new-lines so that + new-line is not treated as a space delimiter, only a single + new-line is deleted at the end of a command substitution. +05-08-19 +When a tilde substitution expands to the / directory and is + followed by a /, it is replaced by the empty string. +05-08-16 A bug in which n<&m did not synchronize m has been fixed. +05-08-16 A bug in which process substitution ( <() and >() ) was not + working within for and while loops has been fixed. +05-07-24 A bug in which the pattern ~(E)(foo|bar) was treated as a syntax + error has been fixed. +05-07-24 A bug in completion with =, where n was the one of the + previous selection choices has been fixed. +05-07-21 A bug with multibyte input when no edit mode was specified which + caused the input line to shift left/right has been fixed. +05-06-24 A race condition which could cause the exit status to get lost + on some fast systems has been fixed. +05-06-21 A bug in which nested patterns of the form {m,n}(pat) would cause + syntax errors has been fixed. +05-06-21 A bug in the macro expander has been fixed which could cause a + syntax error for an expansion of the form ${x-$(...)} when + x is set and the command substitution contained certain strings. +05-06-08 +On systems for which echo does not do System V style \ expansions, + the -e option was added to enable these expansion. +05-06-08 A bug in which ${var op pattern} to not work when inside an + arithmetic expression has been fixed. +05-05-23 +An extension to shell patterns that allows matching of nested + groups while skipping over quoted strings has been added. +05-05-18 A bug in which the line number for errors was not correct for + functions loaded from FPATH has been fixed. +05-04-18 A bug in which the exit status $? is not set when a trap triggered + by the [[...]] command is executed has been fixed. +05-04-08 +Redirection operators can be directly preceded with {varname} + with no intervening space, where varname is a variable name which + allows the shell to select a file descriptor > 10 and store it + into varname. +05-04-08 +SHOPT_CMDLIB_BLTIN=1 now includes generated table. +05-04-07 +[[ -o ?option ]] is true if "option" is a supported option. +05-04-05 A bug in handling file completion with spaces in the names + has been fixed. +05-03-25 +The SIGWINCH signal is caught by default to keeps the LINES and + COLUMNS variables in sync with the actual window size. +05-03-25 +Building ksh with SHOPT_REMOTE=1 causes ksh to set --rc if stdin is + a socket (presumably part of a remote shell invocation.) +05-03-25 +Building ksh with SHOPT_SYSRC=1 causes interactive ksh to source + /etc/ksh.kshrc (if it exists) before sourcing the $ENV file. +05-03-25 +{first..last[..incr][%fmt]} sequences added to brace expansions + when braceexpand is enabled. +05-03-03 A bug where a SIGCHLD interrupt could cause a fifo open to fail has + been fixed. +05-02-25 A bug in which a builtin command run in the background could + keep a file descriptor open which could cause a foreground + process to hang has been fixed. +05-02-24 A bug where builtin library commands (e.g., date and TZ) failed to + detect environment variable changes has been fixed. +05-02-22 +The read builtin and word splitting are now consistent with respect + to IFS -- both treat IFS as field delimiters. +05-02-22 +The read builtin no longer strips off trailing delimiters that + are not space characters when there are fewer variables than fields. +05-02-17 A builtin bug on systems where dlsym(libcmd) returns link-time + bindings has been fixed. +05-02-12 A bug in which the lib_init() function for .paths BUILTIN_LIB + libraries was not called has been fixed. +05-02-06 A bug on some systems in which moving the write end of a co-process + to a numbered file descriptor could cause it to close has been fixed. +05-02-06 A bug in the vi-edit mode in which the character under the cursor + was not deleted in some cases with the d% directive has been fixed. +05-02-06 A bug where external builtin stdout/stderr redirection corrupted + stdout has been fixed. +05-02-04 A bug where times formatting assumed CLK_TCK==60 has been fixed. + +05-01-11 --- Release ksh93q --- +05-01-11 A bug in the integral divide by zero check has been fixed. +05-01-11 +The -l option has been added to read /etc/profile and + $HOME/.profile, if they exist, before the first command. +05-01-11 An argument parsing bug that caused `kill -s x -- n' to fail has + been fixed. +05-01-11 +The .paths file, introduced in ksh93m, which can appear in + any directory in PATH, now allows a line of the form 'BUILTIN_LIB=.' + When a command is searched for this directory, and the full path + matches the path of the built-in version of the command (listed + by the 'builtin' command) then the built-in version of the command + is used. When ksh is built with SHOPT_CMDLIB_DIR=1 then all libcmd + functions become builtins with the '/opt/ast/bin/' directory prefix. +05-01-10 A bug in which a nameref to a compound name caused a core dump has + been fixed. +05-01-09 A bug in which some SIGCHLD interrupts (from child processes exiting) + caused a fatal print/echo error diagnostic has been fixed. +04-12-24 A bug in which some SIGCHLD interrupts (from child processes exiting) + corrupted the internal process/job list, sometimes causing the shell + to hang, has been fixed. +04-12-01 A bug in which typeset -Fn truncated less than n digits for large + numbers has been fixed. +04-11-25 A bug in which standard error could be closed after a redirection + to /dev/stderr has been fixed. +04-11-17 A bug in which an expansion of the form ${array[@]:3} could expand + to ${array[0]} when ${array[3]} was not set has been fixed. +04-10-22 +The -E or -orc command line option reads ${ENV-$HOME/.kshrc} file. +04-10-22 +`-o foo' equivalent to `+o nofoo', `-o nobar' equivalent to `+o bar'. + `--foo' equivalent to `-o foo', `--nofoo' equivalent to `+o foo' +04-10-05 +The .paths file, introduced in ksh93m, which can appear in + any directory in PATH, now allows a line of the form + 'BUILTIN_LIB=libname'. When a command is searched for this directory, + the shared library named by libname will first be searched for a + built-in version of the command. +04-09-03 <<< here documents now handle quotes in the word token correctly. +04-08-08 +The maximum size for read -n and and read -N was increased from + 4095 to 32M. +04-08-04 +printf %q was modified so that if an no operand was supplied, no + no output would be generated rather than a quoted empty string. +04-08-01 +The -n and -N options of the read builtin has been modified + when reading variables with the binary attribute so that the + data is stored directly rather than through assignment. +04-08-01 +The shcomp command has been modified to process alias commands + under some conditions. +04-07-31 +The .sh.match variable added in ksh93l, now works like other + indexed arrays. +04-07-08 A loop optimizer bug which occurs when typeset is used in + a for or while loop inside a function has been fixed. +04-06-24 +The number of subexpressions in a pattern was increased to 64 + from the current number of 20. +04-06-17 +The -t option to read was modified to allow seconds to be + specified as any arithmetic expression rather than just + an integral number of seconds, for example even -t 'sin(.5)' + is now valid. +04-06-16 Two small memory leak problems were fixed. +04-06-15 A bug in ${var/pattern/"string"} which occurred when string + contained pattern matching characters has been fixed. +04-05-08 printf $'%d\n' produced an erroneous error message and has + been fixed. +04-05-24 A bug in which an associative array without any elements could + cause a core dump when a script with an associative array with + the same name was declared in a script invoked by name has + been fixed. +04-05-11 A bug in which an exec statement could close the script that + is being processed in a script that is run by name causing + a failure has been fixed. +04-04-28 +If the first character of assignment to an integer variable was 0, + the variable had been treated as unsigned. This behavior was + undocumented and has been removed. +04-04-05 A bug in which the positioning of standard input could be incorrect + after reading from standard input from a subshell has been fixed. +04-03-30 A bug in the for loop optimizer which in rare cases could cause + memory corruption has been fixed. +04-03-29 +The preset alias source='command .' has been added. +04-03-29 A bug introduced in ksh93p on some systems in which invoked by + name with #! on the first line would not get the signals handling + initialized correctly has been fixed. +04-03-29 A bug introduced in ksh93p in which a HUP signal received by + a shell that is a session group leader was not passed down to + its children has been fixed. + +04-02-28 --- Release ksh93p --- +04-02-28 +The ability to apply an append discipline to any variable has + been added. +04-02-14 A bug in which the exportall option (set -a) would cause incorrect + results for arrays has been fixed. +04-02-02 A bug in which an exported array would pass more than + the first element to a script invoked by name has been fixed. +04-02-02 A bug on some systems in which name=value pairs preceding a script + invoked by name was not getting passed to the script has been fixed. +04-01-20 A bug in which an unset discipline function could cause a core + dump on some systems has been fixed. +04-01-12 A bug in which a continue or break called outside a loop from + inside a function defined with name() syntax could affect + the invoking function has been fixed. +04-01-08 If a command name begins with ~, only filename completion will be + attempted rather than pathname completion using the builtin editors. +04-01-08 A bug in the vi edit mode in which the wrong repeat count on + multiple word replacements with the . directive has been fixed. +04-01-06 Backspace characters are now handled correctly in prompt strings. +04-01-06 +The getopts builtin has been modified to accept numerical + arguments of size long long on systems that support this. +04-01-06 A bug in which unsetting all elements of an associative array + would cause it to be treated as an indexed array has been fixed. +03-12-15 A bug in which a quoted string ending with an unescaped $ would + delete the ending $ in certain cases has been fixed. +03-12-05 A bug in which the shell could hang when set -x tracing a command + when an invalid multibyte character is encountered has been fixed. +03-12-05 On some systems, if the KEYBD trap is set, then commands that use + the meta key were not processed until return was hit. This + has been fixed. +03-12-05 A problem which occurred when the login shell was not a group + leader that could cause it to fail has been fixed. +03-12-05 A problem in which a shell could core dump after receiving a signal + that should cause it to terminate while it was in the process + of acquiring more space has been fixed. +03-12-05 +If ENV is not specified, the shell will default to $HOME/.kshrc + for interactive shells. +03-11-21 A bug introduced in ksh93o in which the DEBUG trap could get + disabled after it triggered has been fixed. +03-11-04 A bug in which using arithmetic prefix operators ++ or -- on a + non-lvalue could cause a core dump has been fixed. +03-11-04 A bug in which leading zeros were stripped from variable + expansions within arithmetic computation to avoid being treated + as octal constants when they should not have, has been fixed. +03-10-08 A bug introduced in ksh93o in which a large here document inside + a function definition could get corrupted has been fixed. +03-09-22 A bug in which the .get discipline function was not being + called when a string variable was implicitly referenced from + within a numerical expression has been fixed. +03-09-22 A bug in which a script without a leading #! could get executed + by /bin/sh rather than the current shell on some systems has + been fixed. +03-09-12 +To improve conformance with ksh88, leading zeros will be ignored + when getting the numerical value of a string variable so that + they will not be treated as octal constants. +03-09-03 +The builtin kill command now processes obsolete invocations + such as kill -1 -pid. +03-09-02 The restriction on modifying FPATH in a restricted shell (sh -r) + has been documented. +03-09-02 +The restricted shell (sh -r) has been modified to disallow + executing command -p. +03-08-07 A bug in which the KEYBD trap was not being invoked when + characters with the 8th bit set has been fixed. +03-08-02 A parser bug introduced in ksh93o which caused the character + after () in a Posix function definition to be skipped + when reading from standard input has been fixed. +03-08-01 A bug in which "${foo#pattern}(x)" treated (x) as if it were + part of the pattern has been fixed. +03-08-01 +The command -x option has been modified so that any trailing + arguments that do expand to a single word will be included + on each invocation, so that commands like command -x mv * dir + work as expected. + +03-07-20 --- Release ksh93o+ --- +03-07-20 A bug in which could cause memory corruption when a posix + function invoked another one has been fixed. +03-07-15 A bug in which a file descriptor>2 could be closed before + executing a script has been fixed. +03-07-15 A parsing error for <() and >() process substitutions inside + command substitution has been fixed. +03-07-15 A parsing error for patterns of the form {...}(...) when + used inside ${...} has been fixed. +03-07-15 An error in which expanding an indexed array inside a compound + variable could cause a core dump has been fixed. +03-07-15 A bug in which on rare occasions a job completion interrupt + could cause to core dump has been fixed. +03-06-26 A bug in which process substitution embedded within command + substitution would generate a syntax error has been fixed. +03-96-23 A bug in which ${@:offset:len} could core dump when there + were no arguments has been fixed. +03-96-23 A bug in which ${X[@]:offset:len} could core dump when X + was unset has been fixed. +03-06-22 +The -x option was added to the command builtin. If this + option is on, and the number of arguments would exceed ARG_MAX, + the command will be invoked multiple times with a subset of + the arguments. For example, with alias grep='command -x grep, + any number of arguments can be specified. +03-06-14 A bug in which could cause a core dump on some systems with + vi and emacs editors with the MULTIBYTE option has been fixed. +03-06-06 A bug in which the shell could core dump when a script was + run from its directory, and the script name a symlink to a file + beginning with .., has been fixed. +03-06-05 A bug in which the shell could core dump when a child process + that it is unaware of terminates while it is calling malloc() + has been fixed. +03-06-02 +An option named globstar (set -G) has been added. When enabled, + during pathname expansion, any component that consists only of ** is + matches all files and any number of directory levels. +03-05-30 A bug in which the PATH search could give incorrect results when + run from directory foo and PATH contained .:foo:xxx has been fixed. +03-05-29 +Some changes were made to the code that displays the prompt in edit + mode to better handle escape sequences in the prompt. +03-05-27 I added = to the list of characters that mark the beginning of + a word for edit completion so that filenames in assignments + can be completed. +03-05-20 A bug in which read -N could hang on some systems when reading + from a terminal or a pipe has been fixed. +03-05-19 A bug in which the output of uname from a command substitution + would go to the standard output of the invoking command when + uname was invoked with a non-standard option has been fixed. +03-05-19 A job control bug which would cause the shell to exit because + it hadn't take back the terminal has been fixed. The bug + could occur when running a function that contained a pipeline + whose last element was a function. +03-05-19 A job control timing bug introduced in ksh93o on some systems + which could cause a pipeline to hang if the first component + completed quickly has been fixed. +03-05-13 +The read builtin has been modified so that the builtin editors + will not overwrite output from a previous incomplete line. +03-05-13 A bug in which the name of an identifier could have the string + .sh. prefixed to it after expanding a variable whose name begins + with .sh. has been fixed. +03-05-13 A bug in the expansion of $var for compound variables in which + some elements would not be output when the name was a prefix + of another name in the compound variable has been fixed. +03-05-08 The last item in the ksh93o release on 03-01-02 has been + altered slightly to preserve the leading 0's when the + preceding character is a digit. Thus, with typeset -LZ3 x=10, + $(( 1$x)) will be 1010 whereas $(( $x) will be 10. +03-04-25 A bug in which if x is a name reference, then nameref y=x.foo + did not follow x has been fixed. + +03-03-18 --- Release ksh93o --- +03-03-18 +A -N unary operator was added to test and [[...]] which returns + true if the file exists and the file has been modified since it + was last read. +03-03-18 +The TIMEFORMAT variable was added to control the format for + the time compound command. The formatting description is + described in the man page. +03-03-06 +A -N n option was added to read which causes exactly n bytes + to be read unlike -n n which causes at most n bytes to be read. +03-03-03 +Three new shell variables were added. The variable .sh.file + stores the full pathname of the file that the current command + was found in. The variable .sh.fun names the current function + that is running. The variable .sh.subshell contains the depth + of the current subshell or command substitution. +03-03-03 +When the DEBUG trap is executed, the current command line after + expansions is placed in the variable .sh.command. The trap + is also now triggered before each iteration of a for, select, + and case command and before each assignment and redirection. +03-02-28 +Function definitions are no longer stored in the history file so + that set -o nolog no longer has any meaning. +03-02-28 +All function definitions can be displayed with typeset -f not + just those stored in the history file. In addition, typeset +f + displays the function name followed by a comment containing the + line number and the path name for the file that defined this function. +03-02-28 A bug in which the value of $LINENO was not correct when executing + command contained inside mult-line command substitutions has been + fixed. +03-02-19 +Since some existing ksh88 scripts use the undocumented and + unintended ability to insert a : in front of the % and # parameter + expansion operators, ksh93 was modified to accept :% as equivalent + to % and :# as equivalent to # with ${name op word}. +03-02-14 A bug which could cause a core dump when reading from standard + error when standard error was a pty has been fixed. +03-02-14 +The shell arithmetic was modified to use long double on systems + that provide this data type. +03-02-09 A bug in which a function located in the first directory in FPATH + would not be found when the last component of PATH was . and the + current directory was one of the directories in PATH has been fixed. +03-02-07 +The trap and kill builtin commands now accept a leading SIG prefix + on the signal names as documented. +03-02-05 A bug in the expansion of ${var/$pattern}, when pattern contained + \[ has been fixed. +03-02-05 A bug in which .sh.match[n], n>0, was not being set for substring + matches with % and %% has been fixed. +03-01-15 A bug in which getopts did not work for numerical arguments specified + as n#var in the getopts string has been fixed. +03-01-09 A bug in which using ${.sh.match} multiple times could lead to + a memory exception has been fixed. +03-01-06 A bug in the expansion of ${var/pattern/$string} in the case that + $string contains \digit has been fixed. +03-01-02 +A -P option was added for systems such as Solaris 8 that support + profile shell. +03-01-02 For backward compatibility with ksh88, arithmetic expansion + with ((...)) and let has been modified so that if x is a zero-filled + variable, $x will not be treated as an octal constant. + +02-12-05 --- Release ksh93n+ --- +02-11-30 A bug that can show up in evaluating arithmetic statements that + are in an autoloaded function when the function is autoload from + another function has been fixed. +02-11-30 An optimization bug in which an expansion of the form ${!name.@}, + which occurred inside a for or a while loop, when name is a name + reference, has been fixed. +02-11-18 A bug in which modifying array variables in a subshell could leave + side effects in the parent shell environment has been fixed. +02-11-18 A memory leak when unsetting an associative array has been fixed. +02-11-14 +The code to display compound objects was rewritten to make + it easier for runtime extensions to reuse this code. +02-11-14 +A change was made to allow runtime builtins to be notified when + a signal is received so that cleanup can be performed. +02-10-31 +User applications can now trap the ALRM signal. Previously, + the ALRM signal was used internally and could not be used + by applications. +02-10-31 A bug in which signals received while reading from a coprocess + for which traps were set was not handled correctly has been fixed. +02-10-31 A bug in which a file opened with exec inside a subshell could + be closed before the subshell completed has been fixed. +02-10-21 A bug in which setting PATH or FPATH inside a function might not + take effect has been fixed. +02-10-21 A bug which could cause a core dump when a local SECONDS variable + is defined in a function has been fixed. +02-10-15 A bug in which the associate array name operator ${!array[@]} + could return the same name multiple times has been fixed. +02-10-15 A bug in which the zero'th element of an associative array was + not getting set when an assignment was made without a subscript + specified has been fixed. + +02-09-30 --- Release ksh93n --- +02-09-30 +The maximum indexed array size was increased to 16Megs. +02-09-30 A bug which could cause a core dump when changing attributes + of associative array has been fixed. +02-09-30 A bug in which exporting an array variable would not export the + 0-th element has been fixed. +02-09-30 A bug in which an array assignment of the form a=($a ...) would unset + 'a' before the right hand side was evaluated has been fixed. +02-09-27 A bug in which the error message for ${var?message} when var was + null or unset did not contain the variable name var has been fixed. +02-09-27 A bug in which closing file descriptors 0 through 2 could + cause a subsequent here document to fail has been fixed. +02-09-14 A bug in whence which occurs when the specified name contained + a / has been fixed. +02-09-14 A bug in the parser for strings of the form name$((expr))=value + has been fixed. +02-09-14 A for loop optimization bug in which the number of elements in + an array was treated as an invariant has been fixed. +02-09-09 A bug in which redirection or closing of a file descriptor between + 3 and 9 could cause a subsequent here document to fail has been + fixed. +02-09-09 A bug in which a background job was not removed from the job list + when a subshell completed has been fixed, for example (prog&). +02-09-03 A bug in which an assignment of the form name=(integer x=3) + could be interpreted as an array assignment rather than a + compound variable assignment has been fixed. +02-08-19 A command completion bug which occurred on file systems that + are case insensitive has been fixed. +02-08-19 A bug which could lead to an exception on some systems (for + example FREEBSD) which occurred when setting PATH has been fixed. +02-08-11 A bug in arithmetic rounding in which a value input as a decimal + string would output as a rounded version of the string has + been fixed. +02-08-11 A bug in which the last character could be deleted from shell + traces and from whence when called from a multibyte locale + has been fixed. +02-08-01 A bug which could cause a core dump to occur when a shell script + is executed while a coprocess is running that has closed the + output pipe has been fixed. +02-08-01 A bug in which command completion in multibyte mode could + corrupt memory for long command lines has been fixed. + +02-06-17 --- Release ksh93n- --- +02-06-17 A bug in which user defined macros could cause a core dump in + with MULTIBYTE mode has been fixed. +02-06-17 A bug in which printf format specifiers of the form %2$s were causing + a core dump has been fixed. +02-06-17 A bug in which setting stty to noecho mode did not prevent the + echoing of characters by ksh when emacs or viraw mode + was enabled has been fixed. +02-06-17 A bug in which background job completion could cause the sleep + builtin to terminate prematurely has been fixed. +02-06-17 A bug in which the shell could core dump if getopts was called + when the OPTIND variable contained a negative value has been fixed. +02-06-10 +The edit mode prompt has been modified to handle escape sequences. +02-06-10 A bug which occurred for interactive shells in which the builtin + cat command was used in command substitution on a file whose + size was larger than PIPE_BUF has been fixed. +02-06-10 A bug in which the trap on ERR was not being processed when + set inside a function has been fixed. +02-06-07 A bug in which function definitions could cause the history count + to be decremented by one (and even become negative) has been fixed. +02-06-05 A bug in read in which share mode could be enabled has been fixed. +02-05-28 A bug which could occur when the last command of a script was + a case statement and the action selected ended in ;& instead of ;; + has been fixed. +02-05-23 A bug with unary + introduced in ksh93k has been fixed. +02-05-07 A bug in substitutions of the form ${var/pattern/string} in which + a backslash was inserted in the replacement string when it contained + a special pattern character has been fixed. +02-05-01 A bug in the emacs edit mode which occurred in versions compiled + for multibyte character sets which occurred when a repeated search + was requested after a long line had been returned for the previous + search has been fixed. +02-04-02 +vi and emacs edit modes were modified so that tab completion is + disabled when invoked from the read built-in. + +02-03-26 --- Release ksh93m+ --- +02-03-26 A bug in which \ was not handled correctly when used in file + expansion has been fixed. +02-02-18 A bug in which lines beginning with a # were deleted from here + documents when the here-document delimiter was followed by + a comment has been fixed. +02-12-06 An optimization bug in which ${!x[@]) was treated as invariant in + a for loop has been fixed. +02-02-06 A bug in which the ERR trap is not cleared for a script invoked + by name from within a function has been fixed. +02-01-08 A bug in which a shell script executed from within a subshell + could cause this script to have an invalid pointer leading + to a memory fault has been fixed. +02-01-07 +Added here documents of the form <<< word (as per zsh) which + is equivalent to << delim\nword\ndelim. +02-01-07 A bug in which the first word of a compound assignment, + x=(word ...), was treated as a reserved word has been fixed. +02-01-07 A bug in the handling of \ when noglob was enabled and a + substitution of the form ${word op pattern} occurred in the + same word has been fixed. +02-01-07 +A compilation option, CMDLIB_BLTIN in the file OPTION, has + been added. When this options is set, all commands implemented + in libcmd become shell builtin commands by default. +02-01-07 A bug in which builtin foo, where foo is already a builtin + would result in the builtin foo getting removed has been fixed. +02-01-07 A bug which the shell executed a command found in the current + directory when PATH have no valid directories has been fixed. +01-11-28 The value of $? was not being set when called with exit. +01-11-28 If the last command was of the form (...) and a trap on EXIT or + ERR was set, and the command inside () modified the trap, then + the original trap wasn't executed. +01-11-26 +The value for 0 is now preceded by the base number when + the base was not 10. +01-11-26 +The default has compilation mode has been changes so that + viraw mode will always be on. + +01-10-31 --- Release ksh93m --- +01-10-31 A for loop optimizer bug for subshells contained withing for + loops has been fixed. +01-10-16 typeset without arguments no longer outputs variable names + that do not have any attributes that are set. +01-10-16 A bug introduced in ksh93l in which assignments specified with + the exec built-in were not being expanded properly has been + fixed. +01-10-11 An optimization bug in which ${!x) was treated as invariant in + a for loop has been fixed. +01-10-11 Unsigned integer variables in bases other than 10 are printed now + expand in that base with the base prefix. +01-10-10 A number of typos in the self generating man pages for shell + built-ins have been fixed. +01-10-04 The self generated man pages for hist and fc were not working + correctly and have been fixed. +01-10-03 Yet another optimizer bug in which shell patterns were + treated as invariants has been fixed. +01-09-27 Two bugs relating to multibyte history searches and to find + have been fixed. +01-09-27 A bug introduced in ksh93k in which the PATH searching was + not restored after running a command with an assignment list + has been fixed. +01-09-26 A bug in which a zero filled field was treated as octal when + converted to integer has been fixed. +01-09-26 Yet another bug in the optimization of for loops related to + recursive functions with break or continue statements has been fixed. +01-09-25 +The exponentiation operator ** was added to the shell arithmetic + evaluation. It has higher precedence than * and is left + associative. +01-09-25 The code was modified to use the ast multibyte macros + and functions for handing multibyte locales. +01-09-25 +The expansion ${parameter:offset:length} now handles negative + offsets which cause offsets to be measured from the end. +01-09-25 Some spelling errors in the documentation were corrected. +01-09-24 +The /dev/tcp/host/port and /dev/udp/host/port now allow + the ports to be specified by service name. +01-09-24 +The change staring with ksh93g in which the the appropriate + library path variable is prepended with a corresponding library + directory has been modified. With the new method, only the + library path defined in the file named .paths in the directory + where the executable is found will be modified. See the + man page for more details. +01-09-23 +The .fpath file (see ksh93h) is no longer looked for in each + directory on the path to locate function directories. The + file named .paths is used instead. +01-09-23 A bug in which IFS was not being restored after being changed in + a subshell has been fixed. +01-09-16 +With the vi and emacs edit modes, after a list of command + or functions is generated with = or M-= respectively, + any element from the list can be pasted on the command line + by preceding the = or M-= with a numeric parameter specifying + the position on the list. +01-09-16 A bug in ksh93l caused command completion not to find aliases + and functions. Command listing from the edit mode was presented + in reverse order. This has been fixed. +01-09-13 Another bug in the optimization of for loops related to subshells + when traps were set has been fixed. +01-09-07 A change in ksh93l caused brace expansion to stop working + and this has been fixed. +01-09-04 A bug introduced in ksh93k in which an arithmetic statement + within a function that used name references did not follow the + reference has been fixed. +01-09-04 A bug introduced in ksh93l in which export -p did not prefix + each export with the word export has been fixed. +01-08-29 A bug in multibyte input which occurred when a partial multibyte + character was received has been fixed. +01-08-29 A bug introduced in ksh93l which could cause a core dump + when an assignment list containing PATH is specified inside + command substitution has been fixed. +01-08-09 Another bug in the optimization of for loops in ksh93l caused + errors in recursive functions using local variables that + contained for loops has been fixed. +01-07-27 A bug in which IFS would be unset after a command substitution + inside a here document has been fixed. +01-07-26 To conform to the POSIX standard, if you invoked ksh name, + and name does not contain a /, it will first try to run + one in the current directory whether it is executable or not + before doing a path search for an executable script. Earlier + versions first checked for an executable script using the + PATH variable. +01-07-23 A bug in which unset -f invoked in a subshell could unset a + function defined in the parent has been fixed. +01-07-16 A bug in the optimization of for loops in ksh93l caused + name references to be treated as invariants has been fixed. +01-07-09 A bug in which a discipline function applied to a local variable + could cause a shell exception has been fixed. Discipline + functions can only be specified for global variables. + +01-06-18 --- Release ksh93l --- +01-06-18 A bug in assigning integers larger than can be represented as + long integers to floating point variables has been fixed. +01-06-18 A bug in the handling of unsigned integers (typeset -ui) has + been fixed. +01-06-04 The evaluation of the PS1 prompt no longer effects the value + of the $? variable. +01-06-01 A small memory leak from subshells has been fixed. +01-05-22 A bug in which attributes for variables that did not have + values would be lost after a subshell has been fixed. +01-05-22 +The %R format has been added to convert a shell pattern into + an extended regular expression. +01-05-22 +The escape sequences \e, \cX, \C[.collating-element.], and + \x{hex} have been added to ASCII-C strings and to printf format + strings. +01-05-20 +Patterns of the form {n}(pattern) and {m,n}(pattern) are now + recognized. The first form matches exactly n of pattern whereas, + the second form matches from m to n instances of pattern. +01-05-20 +The shell allows *-(pattern), +-(pattern), ?-(pattern), + {m,n}-(pattern}, and @-(pattern) to cause the minimal + match of pattern to be selected whenever possible rather + than the maximal (greedy) match. +01-05-20 +The character class [:word:] has been added to patterns. + The word class is the union of [:alnum:] and the character _. +01-05-20 +Inside (...) pattern groups, the \ character is now treated + specially even when in an enclosing character class. The + sequences, \w, \d, \s are equivalent to the character classes + word, digit, and space respectively. The sequences \W, \D, + and \S are their complement sets. +01-05-20 +The shell now recognizes pattern groups of the form + ~(options:pattern) where options or :pattern can be omitted. + Options use the letters + and - to enable and disable options + respectively. The option letters g (greedy), i (ignore case) + are used to cause maximal matching and to cause case + insensitive matching respectively. If :pattern is also + specified, these options are only in effect while this + pattern is being processed. Otherwise, these options remain + in effect until the end of the pattern group that they are contained + in or until another ~(...) is encountered. These pattern groups + are not counted with respect to group numbering. +01-05-14 When edit completion, expansion, or listing occurs in the + middle of a quoted string, the leading quote is ignored when + performing the completion, expansion, or listing. +01-05-14 A small memory leak from subshells has been fixed. +01-05-10 A bug in which open files were not restored after a subshell + that had used exec to replace a file has been fixed. +01-05-10 +Redirection to a null file name now generates an error message. +01-05-09 The shell now rejects some invalid parameter substitutions that + were previously processed in undefined ways. +01-05-09 A bug in which the output of select was not flushed before the + read when input did not come from the terminal has been fixed. +01-05-08 A bug in which job ids would not be freed for interactive shells + when subshells ran built-ins in the background has been fixed. +01-05-08 +The FPATH variable now requires an explicit . to cause the + current directory to be treated as a function directory. +01-05-08 A bug in read -n when echo mode was disabled has been fixed. +01-05-07 A bug in which function definitions could be listed as part + of the history has been fixed. +01-04-30 +This release uses a new and often much faster pattern matcher than + earlier releases. +01-04-30 +An optimizer now eliminates invariant parameter expansions from + for while and until loops. +01-04-30 +The variable .sh.match is set after each pattern match (# % or /) + in a variable substitution. The variable .sh.match is an + indexed array with element 0 being the complete match. + The array is only valid until the next subsequent pattern + match or until the value of the variable changes which ever + comes first. +01-04-30 +A self generating man page has been added to shcomp. Also, + shcomp now stops compiling when it finds an exit or exec + command and copies the remainder so that it can be used + for standard input. +01-04-30 +The shcomp command was modified so that it can work in an + EBCIDIC environment and that binary scripts are portable + across environments. +01-04-30 A bug in the handling of a trailing : in PATH has been fixed. +01-04-30 A bug in which the builtin version of a command would get invoked + even though the full pathname for the command was specified + has been fixed. +01-04-30 A bug in which read would loose the last character when + reading the last line of a file that did not contain a new-line + character has been fixed. +01-04-23 A bug on some systems in which in vi mode the end of file + character and end of line character could be swapped has + been fixed. +01-04-23 A bug on some systems in which invoking a shell script that + did not have execute permission could set the exit value to + 127 rather than 126 has been fixed. +01-04-20 A bug in which read -n from a pipe would block if fewer than + n characters was received has been fixed. +01-04-09 A bug in which invalid patterns, for example, ) by itself, + was not treated as a string has been fixed so that if i=')', + then [[ $i == $i ]] is true. +01-04-09 +The shell arithmetic now interprets C character constants. +01-04-09 A bug in which a non-zero return from a function defined + with the function reserved word did not trigger the ERR + trap or exit with set -e has been fixed. +01-04-02 A bug on some systems, in which characters above 127 were + not displayed correctly in vi or emacs edit mode has been fixed. +01-04-02 A bug on some systems, introduced in the 'k' point release, in + which the erase character in viraw mode was moving the cursor + to the left without erasing the character has been fixed. +01-04-02 On some systems the wcwith() function was returning a wrong + value for characters and caused characters to be displayed + incorrectly from the shell edit modes. A work around for + this problem has been added. +01-03-26 A bug in which valid scripts could produce syntax errors + when run with locales that considered characters such as "'" + to be space characters has been fixed. +01-03-20 A bug in which an syntax error in an arithmetic expression + entered interactively could cause the shell to go into + an infinite loop outputting the error message has been fixed. +01-03-10 +ksh93 accepts -l as a synonym for -L in test on systems for + which /bin/test -l tests for symbolic links. +01-03-10 A bug in parsing scripts in which { and } are used in place of + in and esac in case statements embedded in compound commands + has been fixed. Use of { and } for in and esac is obsolete. +01-03-06 A bug in which an argument of the form foo=bar was not + being passed correctly to a traced function whose name + was foo has been fixed. +01-03-02 Using $(trap -p name) did not print the name of the current + trap setting for trap name. +01-02-26 Exported floating point variables gave incorrect results + when passing them to ksh88. This has been fixed. +01-02-25 A race condition in which a coprocess which completed too quickly + would not allow subsequent coprocesses to start has been fixed. +01-02-25 The 'g' format specifier is now handled by printf. It had + inadvertently been omitted. +01-02-20 The + was not being displayed during an execution trace + with the += assignment operator. +01-02-19 The error message which occurs when the interpreter name + defined on the #! line does not exist is more informative. +01-02-19 A bug in which $0 would not be set correctly when a + script with #! was invoked by full pathname from the + directory of the script has been fixed. +01-02-19 A shell script did not always pick up tty mode changes + made by external commands such as stty which could + effect the behavior of read. +01-02-19 The -u, -g, and -k unary tests did not give the correct + results when used with negation and this has been fixed. + +01-02-05 --- Release ksh93k+ --- +01-02-05 The sequence \ inside $'...' was not incrementing + the line count and this has been fixed. +01-02-05 +Modified expansion of "${@-}" so that if no arguments are set + it results in null string rather than nothing. +01-02-02 memory leak problem with local variables in functions fixed. +01-01-25 +allow arithmetic expressions with float%int and treat them + as ((int)float)%int rather than as an error. +01-01-19 read -n1 was not working and has been fixed. +01-01-17 +ksh now handles the case in which a here document in command + substitution $() is terminated by the trailing ). Previously, + a new-line was needed at the end of the delimiter word. +01-01-02 A bug in which a KEYBD trap would cause a multi-line token + to be processed incorrectly has been fixed. +00-12-10 +Arithmetic integer constants can now have L and U suffices. +00-12-10 A bug in the processing of arithmetic expressions with compound + variables when the -n option is on has been fixed. +00-12-08 A bug in M-f and M-b from emacs mode has been fixed. This + bug only occurs when ksh93 is compiled without MULTIBYTE enabled. +00-11-29 A bug in which jobs -p would yield 0 for background + jobs run in a script has been fixed. +00-11-21 A bug in integer arrays in which the number of elements is + incorrect when the ++ operator is applied to a non-existing + element has been fixed. For example, integer x; ((x[3]++)). +00-11-20 A timing bug in which the shell could reset the terminal + group to the wrong value in the case that the a new process + changes the terminal group during startup has been fixed. + +00-10-27 --- Release ksh93k --- +00-10-27 Using tab for completion now works only when applied + after a non-blank character at the end of the current line. + In other case a tab is inserted. +00-10-27 A bug in the emacs edit mode for ^X^E has been fixed. + The ^X^E sequence is supposed to invoke the full editor + on the current command. +00-10-18 A bug in which expansions of the form ${var//pattern/string} + did not work correctly when pattern was '/' or "/" has + been fixed. +00-10-18 +The output format for indexed arrays in compound variables + has been modified so that it can be used as input. +00-10-18 Assignments with name references (typeset -n) will now + implicitly unreference an existing name reference. +00-10-17 A bug the += append operator when a single array element + is appended to a variable that is not an array has been fixed. +00-10-16 A bug in which the SIGCONT signal was being sent to + each process will kill -0 or kill -n 0 has been fixed. +00-10-12 +The arithmetic evaluation portion has been rewritten to + perform a number of optimizations. +00-10-10 A bug in which name prefix matching ${!name.*} was not + checking name to see if it was a name reference has been fixed. +00-09-26 A bug in the multibyte version in which the width of for + non-printing characters was not correct has been fixed. +00-09-12 +Made changes to get multibyte editing work on UWIN for windows +00-09-12 A bug in which multibyte characters would be displayed incorrectly + has been fixed. +00-08-08 Removed build dependency on iswprint() and iswalph(). +00-07-20 In some cases the read builtin would read more than a single + line from a pipe on standard input and therefore leave the seek + position in the wrong location. +00-07-05 +If the directory / is on the path, a / will not be inserted + between the directory and the file name during path searching + to avoid searching // for systems that treat this specially. +00-06-26 A bug in which on rare occasions wait could return before all + jobs have completed has been fixed. +00-06-21 A bug in which backspace did not work correctly during the + R replace directive in vi-mode has been fixed. +00-06-12 +Added variable name completion/expansion/listing to the set of + completions. Variable name completions begin with $ or "$ followed + by a letter. +00-05-09 --- Release ksh93j --- +00-05-09 Modified command substitution to avoid using /tmp files when + run on read-only file systems. +00-04-17 +Modified printf to handle '%..Xc' and '%..Xs' options where X + is not an alpha character. Previous versions core dumped with this. +00-04-10 +Changes to multibyte editing code were made to use standard + ISO C functions rather than methods devised before the standard. +00-04-09 Add %H options to printf to output strings with <"'&\t> properly + converted for use in HTML and XML documents. +00-04-07 +Modified getopts builtin to handle \f...\f in usage string + by invoking specified function. +00-04-04 Added self generating man pages for bg, fc, fg, disown, jobs, + hist, let, ., and ulimit. +00-03-30 +The append operator += has been added and can be used + for all assignments, strings, arrays, and compound variables. +00-03-30 +Code was modified in several places to support automatic + generation of C locale dictionaries. +00-03-28 A bug in which the set and trap commands invoked with --name + type arguments would terminate the invoking script has + been fixed. +00-03-27 A bug in which the library path variable was not updated + correctly on some systems as described in the 'g' point + release has been fixed. +00-03-07 printf now returns a non-zero exit status when one of + its arguments cannot be converted to the given type. +00-03-05 The return value and error message for a command that + was found on the path but was not executable was set + incorrectly. +00-03-05 A prototype for ioctl() was removed from the vi edit mode. + +00-01-28 --- Release ksh93i --- +00-01-28 +Most of the built-in commands and ksh itself are now + self documenting. Running command --man will produce + screen output. Running command --html produces the + man page in html format. +00-01-28 +The getopts builtin can process command description + strings to produce man pages. +00-01-28 A bug in which a script could terminate when getopts + encountered an error when invoked inside a function + has been fixed. +00-01-28 When a symbolic link was specified as the name of + the script to invoke by name, the value of $0 was + set to the real file name rather than the link name + in some cases and this has been fixed. +00-01-28 A bug in which the precision given as an argument + to printf was not working has been fixed. + +99-03-31 --- Release ksh93h --- +99-03-31 +The PATH search algorithm has been modified to look + for a file named .fpath in each bin directory and if + found, to search for functions in this directory if + it cannot find the command in that directory. +99-03-31 +When performing pathname expansion, the shell checks + to see whether each directory it reads is case sensitive + or not, and performs the matching accordingly. +99-03-31 +The %T format for printing formatted date/time. +99-03-31 +The emacs and vi modes now handle arrow keys when + they use standard ANSI escape sequences. +99-03-31 +The TAB key can be used for completion in emacs and viraw mode. +99-03-31 A bug in setting .sh.editchar during the KEYBD trap + for the MULTIBYTE option was fixed in release ksh93h. +99-03-31 A bug in shcomp for compilation of unary operators with [[...]] + has been fixed. +99-03-31 A bug in which the value of $? was changed when executing + a keyboard trap has been fixed. +99-03-31 The handling of SIGCHLD has been changed so that the + trap is not triggered while executing trap commands + to avoid recursive trap calls. +99-03-31 A bug in which a local variable in a function declared readonly + would generated an error when the function went out of + scope has been fixed. +99-03-31 A bug in which \ entered from the keyboard + with the KEYBD trap enabled has been fixed. +99-03-31 The error message for a misplaced ((, for example print ((3), + was often garbled and has been fixed. +99-03-31 A bug in the KEYBD trap in which escape sequences of the form + [#~ were not being handled as a unit has been fixed. +99-03-31 A bug in which ksh would consider expressions like [[ (a) ]] + as syntax errors has been fixed. +99-03-31 A function defined as foo() without a function body + was not reported as a syntax error. +99-03-31 A bug in which ksh could run out of file descriptors when + a stream was repeatedly opened with exec and read from + has been fixed. + +98-04-30 --- Release ksh93g --- +98-04-30 +The pipefail option has been added. With pipefail + enabled, a pipeline will not complete until all + commands are complete, and the return value will + be that of the last command to fail, or zero if + all complete successfully. +98-04-30 +The name-value pair library uses the cdt library rather + than the hash library. This change should be transparent + to applications. +98-04-30 +On the U/WIN version for Window 95 and Windows NT, + when a directory beginning with a letter followed by + a colon is given to cd, it is assumed to be an absolute + directory +98-04-30 +When an executable is found on a given path, + the appropriate library path variable is prepended + with a corresponding library directory. +98-04-30 A bug in which a name reference could be created to + itself and later cause the shell to get into an infinite + loop has been fixed. +98-04-30 A bug in shcomp relating to compound variables was fixed. +98-04-30 A bug introduced in ksh93e in which leading 0's in -Z + fields caused the value to be treated as octal for arithmetic + evaluation has been fixed. +98-04-30 A bug when a name reference with a shorter name than + the variable it references was the subject of a compound + assignment has been fixed. +98-04-30 A bug which in which assignment to array variables in + a subshell could effect the parent shell has been + fixed. +98-04-30 read name?prompt was putting a 0 byte at the end of the + prompt on standard error. +98-04-30 A bug in [[ string1 > string2 ]] when ksh was run with -x + has been fixed. +98-04-30 A bug in which the escape character was not processed + correctly inside {...} when brace expansion is enabled + has been fixed, for example {\$foo}. +98-04-30 A bug in line continuation in here-documents has been + fixed. +98-04-30 The default base when not specified with typeset -i is + 10 in accordance with the documentation. Previously, + the value was determined by the first assignment. +98-04-30 A parsing bug in which a # preceded alphanumeric + characters inside a command substitution caused + a syntax error to be reported has been fixed. +98-04-30 A bug in which a decimal constant represented as 10#ddd + where ddd was more than five digits generated a syntax + error has been fixed. +98-04-30 A bug in here document expansion in which ${...} expansions + were split across buffer boundaries has been fixed. +98-04-30 +The sh_fun() function now takes third argument which + is an argument list for the invoked discipline function + or built-in. +98-04-30 +A callback function can be installed which will give + notification of file duplications and file closes. +98-04-30 When ksh is compiled on systems that do not use fork() + current option settings where not propagated to sub-shells. + +97-06-30 --- Release ksh93f --- +97-06-30 +Hostnames in addition to host addresses can be given in + /dev/tcp/host/port virtual file names. +97-06-30 File name completion and expansion now quotes special + characters in file names from both emacs and vi edit modes. +97-06-30 An empty for list behave like a for list with null expansions. + It produces a warning message with sh -n. +97-06-30 +The code has been modified to work with EBCDIC as well as ASCII. +97-06-30 A bug which would cause the secondary prompt to be + displayed when a user entered a literal carriage + return has been fixed. +97-06-30 A bug which caused ksh read -s name to core dump was + fixed. +97-06-30 A bug with the expansion of \} and \] inside double + quoted strings that also contained variable expansions + has been fixed +97-06-30 Changes in the ksh93e point release caused autoload + functions invoked from within command substitution + to fail. This has been fixed. +97-06-30 A bug in the processing of here-documents that could + prevent variable substitution to occur after $(...) command + substitution for long here documents has been fixed. +97-06-30 A bug caused by a race condition that could cause SIGTERM + to be ignored by a child process has been fixed. +97-06-30 A bug which prevented the startup of a coprocess immediately + after killing a running coprocess has been fixed. +97-06-30 ulimit foobar, where foobar is not an arithmetic + expression, now gives an error message as it did with ksh88 + instead of setting the file size limit to 0. +97-06-30 A bug which could cause an interactive shell to terminate when + the last process of a pipeline was a POSIX function was fixed. +97-06-30 A bug which could cause command substitution of a shell script + to core dump has been fixed. +97-06-30 A security hole was fixed in suid_exec. +97-06-30 Arithmetic functions such as pow() that take more than + one argument, did not work if arguments other than the + first contained parenthesized sub-expression. +97-06-30 The error message from a script containing an incomplete + arithmetic expression has been corrected. +97-06-30 A bug which caused a core dump on some machines when + the value of a name reference contained a positional + parameter and the name reference was not defined inside + a function has been fixed. +97-06-30 Arithmetic expressions now correctly handle hexadecimal + constants. +97-06-30 A bug in which integer variables could be expanded + with a leading 10# when declared with typeset -i + multiple times has been corrected. +97-06-30 A bug in which IFS wasn't correctly restored when + set within command substitution has been fixed. +97-06-30 The _ character is now considered as part of a word + with the M-f and M-b emacs directives as it was in ksh88. +97-06-30 A bug in brace pattern expansions that caused expressions + such as {foo\,bar,bam} to expand incorrectly have been fixed. + + +96-07-31 --- Release ksh93e --- +96-07-31 +The math functions, atan2, hypot, fmod, and pow were added. +96-07-31 +When a shared library is loaded, if the function lib_init() + is defined in the library, it is invoked the first time that + the library is loaded with builtin -f library. +96-07-31 The k-shell information abstraction database option, KIA, + has been revamped. +96-07-31 Empty command substitutions of the form $() now work. + whence -v foo now gives the correct result after calling + builtin -d foo. +96-07-31 A bug in right to left arithmetic assignment for which + the arithmetic expression (( y = x = 1.5 )) did not + yield 1 for y when x was declared typeset -i was fixed. +96-07-31 printf has been fixed to handle format containing \0 + and/or \0145 correctly. In addition, characters following + %b in the format string are no longer displayed when + the operand contains \c. +96-07-31 A bug in printf that could cause the %E format to + produce unnormalized results has been fixed. +96-07-31 A bug which causes some arithmetic expressions to be + incorrectly evaluated as integer expressions rather + that floating point has been fixed. +96-07-31 Functions defined inside a subshell no longer remain + defined when the subshell completes. +96-07-31 The error message from sh -c ';echo foo' has been + corrected. +96-07-31 The format for umask -S has been changed to agree + with the specification in the POSIX standard. +96-07-31 A bug that caused side effects in subscript evaluation + when tracing was enabled for subscripts using ++ or -- + has been fixed. +96-07-31 To conform to the Posix standard getopts has been changed + so that the option char is set to ? when it returns with + a non-zero exit status. +96-07-31 The handling of \} inside ${name...} has been fixed so + that the \ quotes the }. +96-07-31 A bug that caused the read builtin to resume execution + after processing a trap has been fixed. +96-07-31 [[ -s file ]] has been fixed so that if file is open + by ksh, it is flushed first. +96-07-31 In some cases attributes and sizes for non exported + variables weren't being reset before running a script. +96-07-31 The value of TMOUT was affected by changes make to + it in a subshell. +96-07-31 The jobs command did not reflect changes make by + sending the CONT signal to a command. +96-07-31 The error message for ksh -o unknown was incorrect. +96-07-31 Functions invoked as name=value name, did not use + values from the calling scope when evaluating value. +96-07-31 A bug in which the shell would reexecute previously + executed code when a shell script or coprocess was + run in the background has been fixed. +96-07-31 A bug in which an empty here-document would leave + a file descriptor open has been fixed. +96-07-31 A bug in which $(set -A array ...) would leave a + side effect has been fixed. +96-07-31 A discipline function for a global variable defined + within a function defined with the function keyword, + incorrectly created a local variable of the same name + and applied the discipline to it. + +95-08-28 --- Release ksh93d --- +95-08-28 The \ character was not handled correctly in replacement + patterns with ${x/pattern/replace}. +95-08-28 A bug with read in which the line did not end with + a new-line has been fixed. +95-08-28 A bug in file name generation which sometimes + appended a . for filenames that ended in / has + been fixed. +95-08-28 +If a process is waited for after a status has + been returned by a previous wait, wait now + returns 127. +95-08-28 A bug with hist (fc) -e which prevented a command + to re-executed after it had been edited has been fixed. +95-08-28 A bug which prevented quoting from removing the meaning + of unary test operators has been fixed. +95-08-28 A bug with typeahead and KEYBOARD traps with the + MULTIBYTE option set has been fixed. +95-08-28 +Builtin functions can take a third argument which is + a void*. +95-08-28 The nv_scan() function can restrict the scope of a walk + to the top scope. + +95-04-31 --- Release ksh93c --- +95-04-31 The expansion of "$@" was incorrect when $1 was the null + string. +95-04-31 A bug which could incorrectly report a syntax error in + a backquoted expression when a $ was preceded by \\ + has been fixed. +95-04-31 A bug which prevented the shell from exiting after + reporting an error when failing to open a script + has been fixed. +95-04-31 A bug that could lead to memory corruption when a + large here document that required parameter or command + substitution was expanded has been fixed. +95-04-31 A bug that could cause a core dump on some systems + after ksh detected an error when reading a function + has been fixed. +95-04-31 A bug which could cause a coprocess to hang when + reading from a process that has terminated has been fixed. +95-04-31 A bug which caused a script to terminate when set -e + was on and the first command of and && or || list + failed has been fixed. +95-04-31 A bug with here documents inside $(...) when the delimiter + word is an identifier has been fixed. +95-04-31 A bug which caused $0 to display the wrong value when + a script was invoked as an argument to the . command + and the eval command has been fixed. +95-04-31 A bug that could cause the built-in sleep to hang + has been fixed. +95-04-31 A bug introduces in 12/28/93b which caused the backslash + to be removed when it was followed by digit inside double + quotes in some instances has been fixed. +95-04-31 A bug which could cause a core dump if ksh was invoked with + standard input closed has been fixed. +95-04-31 A bug which could cause a core dump if typeset -A was + specified for an existing variable has been fixed. +95-04-31 Variables that were unset but had attributes such as readonly + and export were not listed with readonly, export and typeset. +95-04-31 Several problems with signals have been fixed. +95-04-31 A bug which prevented ulimit -t from working has been fixed. + Also, a bug in which failed ulimits could cause a core dump + has also been fixed. +95-04-31 A bug in expansion of the form ${name/#pattern/string} and + ${name/%pattern/string} has been fixed. +95-04-31 A bug which caused read -r on a line that contained only + blanks to get a non-null value has been fixed. +95-04-31 A bug introduced in the 'a' point release in which + ${x='\\'} expanded to \ when x was unset has been fixed. +95-04-31 A bug which prevented a trap on EXIT from being executed + when the last command in a script was a function invocation + has been fixed. +95-04-31 A bug which caused an interactive shell ignore input when + standard error was redirected to a file with exec, + and then restored with exec 2>&1 has been fixed. +95-04-31 An interactive shell turns on monitor mode even when + standard error has been redirected to a file. +95-04-31 A bug which could cause standard input to be incorrectly + positioned for the last command of a script has been fixed. +95-04-31 A bug in the edit modes which allowed walking back in + the history file for more than HISTSIZE commands has + been fixed. +95-04-31 A bug which could cause a core dump if variable TMPDIR was + changed between two command substitutions has been fixed. +95-04-31. A bug which prevented a trap on EXIT from being cleared + has been fixed. +95-04-31 A bug fixed for the v directive in vi MULTIBYTE has been + fixed. +95-04-31 Code to for IFS handling of multibyte characters has + been added. +95-04-31 The displaying of multibyte strings in export, readonly, + typeset, and execution traces has been fixed. +95-04-31 Variables inside functions are now statically scoped. + The previous behavior was never documented. +95-04-31 Variables inside functions are now statically scoped. + The previous behavior was never documented. +95-04-31 A few changes have been made to the name-value library + that affect built-ins that use disciplines. The + changes allow disciplines to be shared by variables + and should make it possible to add new disciplines + without recompilation. +95-04-31 +The name-value library interface has undergone significant + change for this revision. See the new nval.3 man page. + +94-12-31 --- Release ksh93b --- +94-12-31 +Variables inside functions are now statically scoped. + The previous behavior was never documented. +94-12-31 +If IFS contains two consecutive identical characters belonging + to the [:space:] class, then this character is treated as + a non-space delimiter so that each instance will delimit + a field. For example, IFS=$'\t\t' will cause two consecutive + tabs to delimit a null field. +94-12-31 +The getopts command has a -a name option that specifies a + name that will be used for usage messages. +94-12-31 A bug which caused unset RANDOM to dump core has been + fixed. +94-12-31 A bug which prevented return for terminating a profile + or ENV file has been fixed. +94-12-31 A bug which prevented standard input from being + directed to /dev/null for background jobs when + monitor mode was turned off has been fixed. +94-12-31 Statements of the form typeset -options var[expr]=value + did not perform substitutions on expr as expected. +94-12-31 A bug which prevented the shell from sending a HUP + signal to some background jobs that were not disowned + has been fixed. +94-12-31 A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked by exec + has been fixed. +94-12-31 A bug which could cause a core dump when a discipline + function was unset within a discipline was fixed. +94-12-31 The typeset builtin now accepts a first argument of + + or - for compatibility with ksh88. +94-12-31 For compatibility with ksh88, the results of expansions + of command arguments will treat the extended character + match characters ()|& as ordinary characters. +94-12-31 A bug which caused read to fail on a file that was + open for read/write with <> when the first operation + was print or printf has been fixed. +94-12-31 When a job is suspended, it is put on the top of + the job list as required by the POSIX standard. +94-12-31 The value of OPTARG when an option that required + an argument but didn't have one was incorrect in the + case the the option string began with a :. +94-12-31 A bug which caused the terminal to get into a bad + state with some KEYBD traps in vi-mode has been fixed. +94-12-31 A bug which caused an invalid trap to cause a script + to terminate, rather than just return an error, has + been fixed. +94-12-31 Backreferencing sub-expressions in patterns and replacement + strings now works. +94-12-31 A bug in chmod which caused the -R option to fail has + been fixed. +94-12-31 +More signal names have been added for Solaris + +94-06-30 --- Release ksh93a --- +94-06-30 An expansion bug which causes portions of a word after + a $((...)) expansion that contains a nested $var expansion + to be lost has been fixed. +94-06-30 A bug that caused a core dump when a script that did not + have PWD set and did a cd inside command substitution + has been fixed. +94-06-30 A bug which caused a core dump on some machines when + the LANG variable was assigned to has been fixed. +94-06-30 A bug which incorrectly handled set disciplines that + performed arithmetic evaluation when the discipline + was called from the arithmetic evaluator has been fixed. +94-06-30 A bug caused by an EXIT trap inside a function that + was executed in a subshell was fixed. +94-06-30 If foo is a function, and not a program, then command foo + now reports that foo isn't found rather than invoking foo. +94-06-30 The previous version incorrectly listed -A as an + invocation option. The -A option is only for set. +94-06-30 A bug was fixed which caused ksh to loop when execution trace + was enabled and the PS4 prompt required command substitution. +94-06-30 A bug which could cause the job control switch character + to be disabled when a script that enabled monitor mode + terminated was fixed. +94-06-30 A bug in the macro expansion global replacement operator //, + when the pattern began with a [ or +( has been fixed. +94-06-30 A bug which prevented ~ expansion from occurring when + it was terminated with a colon inside an assignment + has been fixed. +94-06-30 A bug in the dot command which prevented autoload functions + from working has been fixed. +94-06-30 A bug which caused a variable to be unset if the + its value were expanded inside a set discipline has + been fixed. +94-06-30 Whence -a now longer reports that a defined function + is undefined. +94-06-30 A bug on some systems in which $0 would be incorrect + in scripts invoked by name has been fixed. +94-06-30 Here documents with an empty body now work. +94-06-30 A bug which disabled argument passing and resetting + of options for a script invoked by name inside a + function has been fixed. +94-06-30 A bug in which an EXIT trap set the caller of a function + would be executed if a command called inside a function + was not found has been fixed. +94-06-30 A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked has + been fixed. +94-06-30 A bug which caused 2<&1- when applied to a shell built-in + to leave standard input closed has been fixed. +94-06-30 A bug which caused the shell to incorrectly parse + $() command substitutions with nested case statements + has been fixed. + + +:::::::: libast :::::::: + +12-03-10 misc/optget.c: HELP_index for "PLUGIN" too +12-02-29 include/shcmd.h: PLUGIN_VERSION 20111111 for cdt disc/meth change +12-02-29 comp/spawnveg.c: fix sigcritical() to include waitpid() for internal child +12-02-29 malloc.c: make __malloc_hook initialization thread safe +12-02-24 comp/iconv.c: fix winix UTF-8 vs UCS-2 over-conversion +12-02-24 astsa/*.h: clean up header guards +12-02-24 astsa/astsa.omk: clean up standalone old make makefile interactions +12-02-21 misc/cmdarg.c: fix bug that set argv[0] +12-02-10 sfvprintf.c: fix 1 byte too long buffer access +12-02-07 malloc.c/features/vmalloc: add gnu __malloc_hook tests +12-02-06 vmmopen.c: fix ALIGN vs sys/param.h macro conflict +12-02-02 astlicense.c: add license.component for component-specific licenses +12-01-31 spawnveg.c: fix transient bug that made invalid setpgid() call +12-01-27 pathpath.c: fix buffer size math when internal allocation requested +12-01-24 malloc.c: fix _vmkeep() bug that did not return previous state +12-01-23 malloc.c: add VMALLOC_OPTIONS=break to try sbrk() block allocator first +12-01-21 astlicense.c: option style only overrides default license.type +12-01-18 malloc.c: disable multiple regions for tracing or !vmbest or ASO_SIGNAL +12-01-12 sfpkrd.c: add __sun I_PEEK+rsh runtime workaround +12-01-10 shcmd.h: void* => Shbltin_t* +12-01-10 tmxdate.c: handle { n>=1000 } TM_PARTS +11-12-21 plug up some meory links -- thanks mhlavink +11-12-21 vmprivate.c: enclose VM_NONMEM exception in CLRLOCK(vm,0) ... SETLOCK(vm,0) +11-12-13 aso: in -lposix for uwin, not -last -- just like vmalloc +11-12-13 sfpoll.c: all streams SF_IOINTR => don't ignore EINTR +11-12-13 sfdcslow.c: set SF_IOINTR +11-12-09 malloc.c: add _vmkeep() for setlocale() intercept _SYS_setlocale_free_OK +11-12-04 sfio: _Sfmaxr=0 (unlimited) by default; use ulimit -M|-d or SFIO_OPTIONS +11-12-01 aso: sync to new api +11-11-11 optget.c: move .TH to the top for --nroff to get our macros first +11-11-11 aso,cdt,vmalloc: resync with kpv +11-11-11 cdt: preserve bits and Dt_link_t for CDT_VERSION < 20111111 +11-10-24 sfvprintf.c: %.-ns truncate from left to n chars +11-10-21 sfvprintf.c: fix %0s (no width) core dump +11-10-10 aso: add _WIN32 support +11-09-26 vmalloc: sync with kpv +11-08-29 features/{dirent,wchar,wctype}: eliminate #include with no header +11-08-25 #pragma prototyped tweaks -- sun4 is dead, long live sun4 +11-08-25 ftwalk.c: FTS_SLNONE => FTW_SL +11-08-11 features/wchar: fix #include _nxt_wchar for K&R C +11-08-04 optget.c: tweak --html rendering +11-07-24 mime.c: add %(default)[st] default if arg == "" +11-07-21 setlocale.c: fix debug locale to treat "<<" as two single byte chars +11-06-14 spawnveg.c: pgid -1: new session -2: setpgrp()&&tcsetpgid() +11-06-14 pathprog.c: add darwin _NSGetExecutablePath +11-05-14 features/common,features/align.c: { _X86_ _X64_ } conditionals for generic uwin +11-05-13 tm/tminit.c: tweak tzname[] prototype +11-05-09 astlicense.c: add ". file" parent-relative include and depth 4 input stack +11-05-05 cmdarg: update to cmdopen_20110505 api +11-05-03 sfio/sfclose.c: make sure close() errors propagate to sfclose() return value +11-04-20 port/astlicense.c: add { id name } keys +11-04-15 fmtdev.c: fix to work for non-{blk,chr} special +11-04-12 stk: change size args to size_t and stseek() offset to ssize_t +11-04-12 sfio: sync with kpv to optimize large SF_STRING sfputr() buffer allocation +11-03-28 misc/fts.c: fix FTS_SLNONE logic to set it when it should! +11-03-17 misc/stk.c: fixed bug that could delete an active stack frame +11-03-10 sfio/sfvprintf.c: add %0s to preserve trailing chars in string arg +11-03-09 misc/magic.c: add %d...%s where if %d==1 then %s=="" else %s=="s" +11-03-09 misc/magic.tab: add windows ico +11-02-08 misc/stk.c: change STK_FSIZE to (1024*sizeof(char*)) for 64 bit normalization +11-02-02 sfio/sfmode.c: don't call sfsetbuf() on unbuffered stream to make it unbuffered +11-02-02 features/wchar: handle hp.ia64 va_list interactions +11-02-02 comp/omitted.c: fix mismatch between stat() vs _stat() +11-01-31 std/wctype,features/wctype: add to handle interactions +11-01-28 add -lw for ancient sunos +11-01-28 include/magic.h,misc/magic.c: add MAGIC_ALL +11-01-27 tm/tmxfmt.c,tmpoff.c: %_z for SHH:MM +11-01-25 features/wchar: change ordering +10-12-24 sfstrtof.h: fix thousand grouping bug that did not check last group +10-12-21 pathkey.c: add win32 { /32 /64 } preroot to hash +10-12-09 pathprog.c: handle intermediate path != '* and fix invalid pathpath() call +10-12-01 astconf.c: fix look.standard undefined variable reference +10-12-01 sfset.c: SF_LINE|SF_WCWIDTH => no need for sfsetbuf() to call isatty() +10-12-01 sfsetbuf.c: cache /dev/null to cut down /dev/null stat()'s +10-12-01 optget.c: delay dictionary initialization until needed +10-11-30 malloc.c: drop { VMDEBUG VMETHOD VMPROFILE VMTRACE } env checks +10-11-30 port/astconf.c: eliminate esaccess() calls for OP_universe checks +10-11-24 regcomp.c: [[=]=]] must at least match itself in non-C locales +10-11-23 glob.h,glob.c: add GLOB_GROUP => REG_SHELL_GROUP +10-11-20 glob.c: handle mode switches across / +10-11-19 regcomp.c: REG_SHELL => REG_CLASS_ESCAPE +10-11-16 vmalloc.h: add VMFL tracing to vmstrdup() +10-11-16 ast.h: simplify VMDEBUG _BLD_DEBUG and VMFL logic +10-11-12 tm/tmlocale.c: ast TM_* extensions default to C locale +10-11-10 regex/regnexec.c,vmalloc/vmstat.c: eliminate strict-aliasing puns +10-10-20 misc/translate.c: change debug translation to drop " in (a,b,c,"d") +10-10-10 misc/glob.c: drop ancient D_FILENO(d)!=0 test and trust readdir() +10-10-06 misc/translate.c: fix "debug" locale logic +10-10-04 misc/magic.c: fix magic() skip check to honor the continuation +10-10-04 regex/regcoll.c: add wchar_t* args to regcollate(), drop ucs name lookup +10-09-28 comp/setlocale.c: add utf8_wctomb() +10-09-28 string/chresc.c,regex/regcoll.c: fix \S[.X.] (\C[.X.] never worked!) +10-09-24 string/chresc.c: \Cc for control c, \S[.X.] for collating symbol X +10-09-24 string/chresc.c: { \cc \e } deprecated +10-09-22 regex/regcomp.c: fix off-by-one collation class allocation bug +10-09-20 regex/regclass.c: fix CTYPES off-by-one bug +10-09-14 comp/conf.sh: const int conf_elements, prefix_elements; +10-09-08 add features/sizeof => ast_sizeof.h +10-08-31 comp/getopt[l].c: export functions for dlls +10-08-25 port/lc.c: add features/locale check for canonical UTF-8 spelling +10-08-20 include/ast.h: add export plugin_version() prototype +10-08-20 comp/conf.tab: add SF_BUFSIZE +10-08-11 misc/conformance.c: conformance(0,0) => "standard" +10-08-11 misc/conformance.c: check ast_env_serial for dynamic astconf() changes +10-08-11 port/lcgen.c: remember to fudge Table_t.count for synthesized entries +10-08-04 include/ast.h,comp/setlocale.c: add { debug C.UTF-8 } mbalpha() mbwidth() +10-08-02 misc/translate.c: add NLSPATH message cache check +10-07-29 string/fmtint.c: fix nasty bug that rendered "1000" as "1" +10-07-27 setlocale,lsgen,localeconv: handle C vs C_EU decimal thousands sep +10-07-26 misc/optget.c: fix interaction with nested plugin/builtin calls +10-06-29 string/strtoi.h: strton() multiplier 1 => power of two suffix +10-06-28 features/wchar: handle systems that require __va_list => va_list +10-06-28 comp/conf.tab: another PID_MAX tweak -- default to 99999 for most +10-06-28 port/astconf.c: lone "CONFORMANCE = standard" => all defaults standard +10-06-25 misc/optget.c: avoid sfprints() call during initialization +10-06-01 features/api, ast_api.h: formalized forwards/backwards api compatibility +10-06-01 _AST_API=20100601: add size_t args for all path*() output buffers +10-06-01 comp/setlocale.c: handle C.UTF-8 test locale +10-06-01 include/mc.h: add size_t to mcfind() for result buffer (internal api) +10-06-01 use strlcpy() instead of strncpy() +10-05-28 include/ast_version.h: add AST_PLUGIN_VERSION for dllplugin() +10-05-28 include/shcmd.h: add SH_PLUGIN_VERSION for dllplugin() +10-05-28 misc/conformance.c: add conformance(3) +10-05-28 misc/optget.c: add [(id1|id2)...] conformance("id1|id2",0) conditionals +10-05-25 include/sfhdr.h: adjust SF_NMAP according to _ptr_bits +10-05-25 include/shcmd.h: add sh_builtin() macro for lib_init() table initialization +10-05-21 misc/optget.c: --html \bfoo::bar([[:digit:]][[:upper:]]*) => foo-bar.html +10-05-15 include/proc.h,misc/procopen.c: add PROC_ORPHAN +10-05-09 misc/optget.c: add --???MAN[section] --???SECTION +10-05-07 sfio,stdio: fix all snprintf() variants to handle buf==0 and/or n==0 +10-05-04 string/fmtesc.c: add mb iswsoace() and iswcntrl() quoting checks +10-05-03 fix LC_MESSAGES catalog lookup bugs, check for $set==3, accept $set==1 +10-04-30 string/chresc.c: add chrexp() for FMT_EXP_* +10-04-30 string/stresc.c: add strexp() for FMT_EXP_* +10-04-30 string/chresc.c: fix \uXXXXY bug that consumed Y +10-04-22 misc/optget.c: check for html entities in +10-04-22 misc/getcwd.c: add features/syscall check for SYSGETCWD() { linux solaris } +10-04-22 string/stresc.c: wide chars absent locale guidance default to UTF-8 +10-04-12 port/mnt.c: favor bsd getfsstat() over getmntinfo() +10-04-11 string/strtoi.h: k (1000) and ki (1024) now differentiated +10-04-10 misc/recstr.c: fix 'd[delimiter]' parse +10-04-08 include/vmalloc.h,vmalloc/vmstat.c: add Vmstat_t.mode region mode bits +10-04-05 misc/fts.c: drop 1997-01-07 fts_open()=0 is one file and stat() fails +10-04-05 misc/optget.c,optlib.h: add Optpass_t.release for --nroff .TH +10-04-02 misc/optget.c: fix $'[-n?\n...]' --version bug +10-04-02 regex/regcomp.c: ~(X) => REG_EXTENDED|REG_AUGMENTED, ~(PU) instead of ~(U) +10-03-24 misc/procopen.c: add PROC_FD_CTTY(fd) +10-03-24 path/pathtemp.c: fix pointer => int casts +10-03-15 regex/regcache.c: fix 1 byte buffer overflow (didn't count trailing \0) +10-03-08 features/tvlib: fix utimensat probe to include all macros/structs +10-03-07 features/lib: change stream_peek to test pipes only +10-03-07 string/strelapsed.c: fix next char return overrun +10-03-06 tm/tvtouch.c: use runtime fallback if utimensat() fails with ENOSYS +10-03-05 path/pathtemp.c: add pfx /seed for regression testing +10-03-04 vmalloc/vmwalk.c: add user supplied handle arg +10-03-04 path/pathtemp.c: properly handle mktemp()-style *+(X) templates +10-03-03 include/ast_getopt.h: remove NULL guard - _AST_GETOPT_H now handles it +10-02-24 comp/getopt.h: fix ast_std.h interactions +10-02-24 vmalloc/malloc.c: empty { VMALLOC_OPTION VMDEBUG ... } => no debug! +10-02-02 string/base64.c: fix corner case output buffer overflow +10-02-02 features/fs: sys/mnttab.h requires stdio.h on some systems!! +10-02-01 misc/optget.c: uppercase --html heading -- doh +10-01-29 misc/optget.c: [+NAME?...] overrides error_info.id for >= STYLE_man +10-01-25 vmalloc/vmprivate.c: fix seg ptr initialization bug (24 years old!!) +10-01-20 misc/optget.c: handle nested {...} rendering +10-01-20 misc/state.c: add ast.version for runtime api version +10-01-20 port/astconf.c: "_AST_VERSION" now returns ast.version +10-01-20 include/ast_std.h: add ast.version for runtime api version +10-01-19 astlicense.c: add epl +10-01-01 vmalloc: VMALLOC_OPTIONS env var for all runtime options +10-01-01 include: change some refs to less intrusive +10-01-01 setlocale.c,translate.c,fmterror.c: AST_LC_internal retains prev state +10-01-01 comp/setlocale.c: AST_LC_setenv defers to LC_ALL (for sh) +10-01-01 ast_std.h: add { AST_LC_internal AST_LC_setenv } +09-12-24 comp/setlocale.c: fix setlocale(LC_ALL,"") when already initialized +09-12-17 misc/optget.c: handle mixed solaris usage="x:f:(in)yo:(out)" +09-12-11 regex/regcomp.c: posix semantics for [z-a] +09-12-11 regex/regcomp.c: fix BRE/ERE ^^ logic +09-12-11 regex/regcomp.c: fix regcomb() for REG_LEFT|REG_RIGHT +09-12-11 regex/regcomp.c: bm complete=0 if REX_END +09-12-11 comp/sigflag.c: add with npt check in features/sig.sh +09-12-11 tm/tminit.c: fix _tzset_environ logic +09-12-09 tm/tmlocale.c: include "ast_nl_types.h" to pull nl_langinfo in! +09-12-04 features/options: add "opt map-libc" check +09-12-03 tm/tmxdate.c: fix 'next month final day' for dec -> jan +09-11-21 misc/magic.tab: add gimp XCF +09-11-20 vmalloc/vmtrace.c: add pid to assertion disgnostics +09-11-11 regex.h,regcomp.c: add REG_CLASS_ESCAPE, \ inside [...] literal by default +09-11-03 regex/regcache.c: change to variable length pattern strings +09-10-28 include/error.h: fix ERROR_translate() arg parens +09-10-26 port/lcgen.c,comp/setlocale.c: handle LANG init after LC_* already defined +09-10-05 _sfopen.c: add but ignore 'F' flags for stdio compatibility +09-09-28 fts.h,ftwalk.h,fts.c: promote { namelen pathlen level } to (s)size_t +09-09-28 locales: add AST_LC_LANG for $LANG +09-09-28 setlocale.c: fix logic for dynamic { LANG LC_ALL LC_* } changes +09-09-17 include/sfio.h,sfio/sfwalk.c: add sfwalk() +09-09-09 sfio/sfputr.c: add SIGPIPE hang fix +09-08-24 sfio/sfreserve.c: fix SF_UNBOUND logic with pushed streams +09-08-18 include/ast_std.h,ast.h: add ast.mb_sync to sync mbchar() after error +09-08-17 comp/setlocale.c: add AST_LC_utf8 and { utf8_mbtowc() utf8_mblen() } +09-08-11 comp/setlocale.c: treat "en"/"en_US" AST_LC_MESSAGES as "C"/"POSIX" +09-08-10 vmalloc/vmhdr.h: add user-defined _AST_PAGESIZE and computed VMHEAPINCR +09-08-09 comp/conf.tab: add NPROCESSORS_MAX +09-07-29 astlicense.c: fix first name=value logic error +09-07-22 string/fmtip6.c: don't drop trailing 0 in 44::1:0:0 +09-06-30 port/astconf.c: standard PATH_RESOLVE is "physical" (not "metaphysical") +09-06-19 vmalloc: sync with kpv +09-06-19 include/shcmd.h: add sh_context(p) cast +09-06-11 misc/magic.tab: differentiate pc 386 32/64 bit dll/exe/obj +09-06-06 port/astconf.c: fix look->name null pointer reference +09-06-05 port/astconf.c: fix 'UNIVERSE = value' synthesize logic +09-05-25 tm/tmxduration.c: add +09-05-08 comp/syslog.c: add _UWIN /var/log/syslog preference +09-05-01 comp/setlocale.c: fix _UWIN intercepts to return NiL on unknown locales +09-04-27 sfio/sfpool.c: fix bug that did not return pool on delete +09-04-22 include/regex.h,regex/regcomp.c: add REG_REGEXP compatibility +09-04-15 tm/tmxdate.c: handle "4th thursday in november" +09-03-31 string/strvcmp.c,string/strnvcmp.c: add version strcmp(3) +09-03-31 string/strpcmp.c,string/strnpcmp.c: add path prefix strcmp(3) +09-03-29 misc/optget.c: clean up num = number casts +09-03-04 tm/tmxmake.c: add tmxtm() with zone override +09-03-03 tm/tmxfmt.c: add %(...), specifically %(...)z for output zone +09-02-22 tm/tmxdate.c: add iso P... durations +09-02-02 path/pathprog.c: add +09-02-02 misc/opthdr.h,optget.c: fix flags mixup, handle old '-' as option +09-02-02 sfio/sfprints.c: fix sfvaprints() return value to not count trailing '\0' +09-02-02 misc/cmdarg.c: handle !defined(ARG_MAX) +09-02-02 port/astconf.c: fix UNIVERSE overwrite of null[] value! +09-01-31 features/sys: drop header sys/localedef.h +09-01-28 include/fs3d.h,misc/fs3d.c: mount() => fs3d_mount() for diff std prototypes +09-01-14 misc/fts_open.c: delay top list reorder until first fts_read() +09-01-14 include/ls.h: LS_W_INUMBER => 9 to accomodate large st_ino +09-01-14 misc/optget.c: expand STYLE_usage input text +09-01-09 features/uwin,stdio/_stdfun.c: iffe for _p__iob and __p__iob +09-01-09 misc/magic.tab: add ISO filesystem image entries +09-01-07 string/strtoi.c: strtol() etc. do not consume [lLuU] suffix -- thanks jkf +09-01-07 sfio/sfstrtof.h: strtod() etc. do not consume [fFlL] suffix -- thanks jkf +09-01-05 string/strlcat.c: fix logic to match docs (not that easy) +08-12-30 tm/tmxdate.c,include/tm.h: add TM_WORK { "workday" "working" "work" } +08-12-28 sfio/sfcvt.c: fix 'a' format rounding +08-12-21 tm/tmdata.c: add 2008-12-31+23:59:60-0000 leap second event +08-12-19 tm/tmxdate.c: check for dates near the epoch rolling back to the future +08-12-19 tm/tmxfmt.c: change %s for now==0 to be the epoch +08-12-07 include/ast_std.h,misc/getenv.c: no _ast_getenv for uwin ast54 compatibility +08-12-07 tm/tmxfmt.c: add %[_][EO]K for [space pad] [full|long] iso +08-12-07 sfio/sfvscanf.c: fix ok[] short by one allocation +08-12-07 comp/setlocale.c: fix off by one composite initialition loop test +08-12-07 path/pathkey.c: fix off by one loop test +08-12-04 vmalloc/vmbest.c: catch sbrk() wraparound +08-12-04 comp/spawnveg.c: clean up attrs on failure too +08-11-04 regex/regcomp.c: fix locale [!-...] and [^-...] re-initialization +08-11-04 stdio: add flockfile.c ftrylockfile.c funlockfile.c +08-10-24 port/astconf.c: handle multiple/trailing '/' in universe initialization +08-09-10 misc/magic.c: handle old vcodex() indices +08-09-10 sfio/sfvprintf.c: drop SF_WCWIDTH, use %Lc or %Ls instead +08-09-05 Makefile: ibm.risc joins the :NOOPTIMIZE: crowd +08-09-04 regex/regnexec.c: fix nested delimiter match beyond end of subject +08-08-20 misc/fts.c: fix st_nlink stat() optimization logic +08-08-19 sfio/sfpkrd.c: workaround macosx recv(PEEK) data consumption on non-socket +08-08-19 strn?tol?d: handle long double with smaller exponent range than double +08-08-18 sfio/sfcvt.c: eliminate excessive multiplies and integral overprecision +08-08-11 tm/tmxfmt.c: handle %10N and %010N +08-08-06 include/shcmd.h: add 'int invariant;' for builtin invariant arg count +08-08-05 features/ndbm: favor sleepycat ndbm compatibility +08-07-21 include/glob.h,misc/glob.c: GLOB_STARSTAR only forces lstat on chdir +08-07-17 sfio: sync with kpv +08-07-17 misc/optget.c: call astwinsize() each time terminal width required +08-07-16 sfio/sfvscanf.c: fix %% to skip leading space per posix +08-07-16 vmalloc/vmbest.c: add VMCHECK=m, VM_mmap to favor mmap() alloc +08-07-16 features/stdio,stdio/f(read|write).c: size_t return value!! ouch +08-06-24 tm/tmxfmt.c: fix %z to handle tm_isdst -- doh +08-06-24 misc/astintercept.c,misc/getenv.c: split from misc/setenviron.c +08-06-17 misc/setenviron.c: add { astintercept() getenv() } +08-06-09 tm/tmlocale.c: use _DATE_FMT if defined for TM_DEFAULT +08-06-06 misc/optget.c: handle sub-component about details +08-06-04 misc/optget.c: fix [-n?\n...\n] version parse +08-06-04 include/debug.h,misc/debug.c: merge with kpvdebug.h +08-06-02 features/ndbm: add to tame dbmlib.iffe replication +08-06-01 comp/resolvepath.c,realpath.c: fix resolvepath() return value type +08-05-22 tm/tmxdate.c: fix a few ordinal/last/this/next bugs +08-05-18 string/fmtre.c: fix omitted stack var initialization bug +08-05-14 regex/regcomp.c,regcoll.c: fix UTF-8 collation sequence logic +08-05-11 tm/tmxfmt.c: :NOOPTIMIZE:, otherwise %Q/../../ fails +08-05-01 tm/tmxdate.c: mon 1..12 => mon[13] -- doh +08-04-30 misc/glob.c,reegex/regcomp.c: ~(R) => ~(O) to avoid pcre clash +08-04-24 port/astconf.c: 'name = value' does assignment without system init +08-04-15 port/astconf.c: SC#N treated like 'SC(N)' +08-04-14 misc/optget.c: clean up nroff output +08-04-01 port/astconf.c: add RELEASE => /proc/version fallback +08-03-30 misc/optget.c: [-n]... to enable -number & +number options +08-03-06 misc/optget.c: ---* and +++* are now operands +08-03-06 misc/errorx.c: fix old error_info.translate workaround +08-02-05 regex/regcomp.c: allow REG_SHELL {,n}... => {0,n}... +08-02-27 misc/stk.c: top element during allocation relocated to top +08-02-18 include/ip6.h,string/strtoip6.c,fmtip6.c: add ipv6 addr support +08-02-14 regex/regsubexec.c: fix null match (tricky) +08-02-14 regex/regsubcomp.c: fix SRE to match ksh +08-02-11 comp/spawnveg.c: return proper errno on [v]fork() failure +08-02-11 tm/tmxdate.c,tmdata.c: handle more ISO 8601:2000 forms +08-02-02 regex/reglib.h: add REGMULTIREF to REG_COMP +08-02-02 string/strmatch.c: fix str="" pat="" sub values +08-01-31 comp/conf.sh,conf.tab: handle /bin/sh \ in read data, redir subshell +08-01-18 misc/magic.tab: amd-x68, 64-bit => x86-64 +08-01-18 string/strnton.c,strntonll.c: add +07-12-10 string/strelapsed.c: "0" is a valid elapsed time! +07-12-02 sfio/sfreserve.c: preserve SF_SHARE sfrd() via sfreserve(f,0,0) +07-11-21 comp/setlocale.c: add sjis_mbtowc() to work around [\~] translation +07-11-15 features/signal.c: RT(1) .. RT(MAX-1) => RTMIN+1 .. RTMAX-1 +07-11-14 features/float: favor sscanf() due to gnu strto[l]d() nan bugs +07-10-31 regex/regcomp.c: fix REX_COLL_CLASS node allocation size +07-10-31 sfio/sfcvt.c: use signbit() if available +07-10-31 features/isoc99: _ISOC99_SOURCE tests +07-10-31 port/astmath.c: add -DN=8 for signbit() +07-10-31 sfio/sfstrtod.h: don't forget about -0.0 +07-10-26 features/map.c: add { optopt optarg optind opterr } +07-10-26 features/stdio: add _filbuf => _ast__filbuf +07-10-26 comp/getsubopt.c: fix #undef that interfered with +07-10-26 regex/regcomp.c: fix bug that missed ')' in ~(F)... +07-10-12 port/astconf.c: fix CONF_ALLOC 16 bit overflow +07-10-12 misc/fts.c: fix fts_close() to free the handle -- doh +07-10-11 comp/setlocale.c: second and subsequent setlocale(*,"") reverts to previous +07-10-11 path/pathprobe.c: add vfs ST_NOSUID check +07-10-10 comp/conf.tab: add a few more xpg6 deferrals +07-09-28 astsa: update to share with mainline src via _PACKAGE_astsa +07-09-25 sfio/sfgetr.c: no limit on string stream line size +07-09-25 sfio/sfextern.c: increase _Sfmaxr to 256*1024 +07-09-18 misc/procopen.c: tighten up SIGCHLD logic between parent/child +07-09-18 misc/signal.c: unblock SIG_DFL after setting handler, sig<0 => don't unblock +07-09-13 misc/fs3d.c: no $LD_PRELOAD => no 3d and avoids invalid mount(2) call +07-09-11 vmalloc: vmstat(0,0)==1 => region in use, drop VM_primary|VM_secondary +07-09-05 misc/recstr.c: handle [lL] gobbled by strtol() -- ouch +07-08-17 path/pathprobe.c: handle '\r' in VERSION string +07-07-17 regex/regcache.c: regcache(0,n,0) extends cache to size n (no shrinking) +07-07-16 tm/tmdata.c: add 2005-12-31, drop 1999-12-31 (where did that come from?) +07-05-21 tm/tmxfmt.c,tmxscan.c: %F => %L (TM_DEFAULT); %F => %Y-%m-%d +07-05-15 sfio/sfvprintf.c: %h? and SFFMT_SHORT => raw bytes +07-05-09 features/signal.c,features/siglist: use kill -l & strsignal() +07-04-25 misc/optctx.c: add for opt_info switching +07-04-24 misc/cmdarg.c,include/cmdarg.h: add CMD_CHECKED, CMD_SILENT +07-04-24 misc/procopen.c,include/proc.h: add PROC_CHECK +07-04-24 misc/procrun.c: add flags arg (current use PROC_ARGMOD) +07-04-24 misc/cmdarg.c,include/cmdarg.h: move from src/cmd/tw +07-04-20 port/(lclang.h|lc.c|mc.c|lclib.h|lcgen.c): separate lctab.c +07-04-20 comp/conf.sh: defer to systems without 'grep -q' -- sigh +07-04-20 comp/conf.sh: probe for LL integer constant initializer suffix +07-04-20 include/syslog.h: => for win32 +07-04-20 ast_namval.h: add as copy of include/namval.h for win32 +07-04-19 comp/conf.tab: fix SVID SI entries to probe SI_* (not _SI_*) +07-04-13 tm/tmxdate.c,tm/tmzone.c: handle [-+]0000 UTC zone offset +07-04-11 sfio/sfvprintf.c: add %F, propagate SFFMT_UPPER +07-04-11 sfio/sfcvt.c: handle SFFMT_UPPER => nan/inf vs. NAN/INF +07-04-02 comp/conf.tab,comp/conf.sh: add C/POSIX symbols +07-03-28 misc/optget.c: fix l10n --?- +07-03-25 features/common: fix { ast_std.h ast_map.h stdint.h } logic +07-03-21 error.h: move from error_info to (*_error_data_) +07-03-21 misc/error.c: add errorctx() for error_info switching +07-03-21 option.h: move from opt_info to (*_opt_data_) +07-03-19 regex/regdecomp.c: fix REX_ONECHAR escapes and add REX_KMP +07-03-11 tm/tmxscan.c,regex/regnexec.c: fix strict-alias transgressions +07-02-27 comp/conf.sh: handle native getconf invalid numeric values +07-02-21 comp/conf.sh,comp/conf.tab: handle SSIZE_MAX vs _POSIX_SSIZE_MAX +07-02-20 sfio/sfvprintf.c: handle SF_WCWIDTH justification +07-02-14 features/common: cover , move to int_(bits)_t +07-02-14 include/int.h: drop +07-02-14 include/sfio.h: add SF_WCWIDTH +07-02-12 comp/conf.sh: fix CONF_LIMIT bug that missed ULONG_MAX etc. +07-02-12 comp/conf.tab: *LONGLONG* => *LLONG* to match posix +07-02-12 features/float: *LONGLONG* => *LLONG* to match posix +07-02-12 port/astconf.c: handle CONF_LIMITS_DEF with no deferral +07-02-12 stdio/vasprintf.c: add trailing '\0' -- doh +07-02-04 string/fmtelapsed.c: fix naive multi month/year logic +07-02-02 misc/optget.c: add --??posix for getopts(1)/getopt(3) +07-01-26 string/chresc.c: use mbchar() +07-01-26 misc/optget.c: handle "o:-:" usage for old-style long options +07-01-22 sfio/sfdisc.c,sfpool.c: handle push on streams with pending peek +07-01-22 include/sfio.h: mv Sfieee_t to sfio/sfhdr.h +07-01-17 tm/tmxfmt.c: fix terminating nil logic which clobbered size-1 +07-01-11 misc/stk.c: a 2 day marathon bug fix (can we release now dr ek?) +07-01-05 comp/spawnveg.c: posix_spawnattr_setflags(POSIX_SPAWN_SETPGROUP) +07-01-05 misc/error.c: fix multibyte vs. printable logic +07-01-01 comp/conf.sh: LC_ALL=C +06-12-26 tm/tmxdate.c: handle nn*.nnnn* == sec.ns +06-12-20 features/libpath.sh: generalize sol.* LIBPATH patterns +06-12-18 comp/setlocale.c: include ast_standards.h and ast_wchar.h ! +06-12-12 string/strperm.c: octal modes are absolute! +06-12-11 comp/conf.tab: always defer ARG_MAX +06-12-07 Makefile: fix conftab.c generation CCFLAGS to match build - doh +06-12-04 sfio/sfcvt.c: fix (int) vs. (long) cast mismatches +06-12-01 comp/conf.tab: add changes to cover solaris { bin xpg4 xpg6 } +06-12-01 regex/reginit.c: adjust { SRE KRE } escaped (){}*? inside [...] +06-12-01 sfio/sfcvt.c: add signbit/copysign tests +06-11-22 comp/spawnveg.c: fix _real_vfork logic to work with 3d +06-11-20 features/common: bias _ast_int8_t "long long" before "__int64" +06-11-20 string/strperm.c: fix X to work with all ops (not just +) +06-11-15 astconf.c,conf.tab: add CONF_DEFER_* for variable constants +06-11-11 port/astconf.c: validate path arg w.r.t. underlying calls +06-11-11 comp/conf.sh: fix S CONF_STANDARD bug, add D to defer to native +06-11-11 comp/conf.tab: add D to defer to native +06-11-01 include/vmalloc.h: avoid VM_FLAGS sys/v*.h clash +06-11-01 include/ast.h: add FMT_PARAM for fmtquote() +06-10-31 disc/sfdcseekable.c: add SFSK_DISCARD for seekable window control +06-10-31 comp/spawnveg.c,features/lib: handle posix_spawn exit status 127 +06-10-30 features/lib: fix posix_spawn() fork() prototype conflicts +06-10-30 string/fmtscale.c: fix 1024 rounding bugs +06-10-27 disc/sfkeyprintf.c: handle 'i' (=='d') -- oops +06-10-26 sfio/sfvprintf.c: %#d => fmtscale(1000), %#i => fmtscale(1024) +06-10-26 features/map.c: _map_libc cleanup +06-10-26 features/fcntl: add to the circle of trust +06-10-26 features/sys: add socklen_t +06-10-26 include/regex.h: handle include before +06-10-25 astconf "SHELL" => "SH" to avoid _POSIX_SHELL conflict +06-10-25 comp/conf.*: drop no-op duplicate conftab.c entries +06-10-18 string/fmtscale.c: 1000: n[.]n[n](kMGTPE), 1024: n[.]n[n](KMGTPE)i +06-10-11 ast_std.h: now implies (did on most before anyway) +06-10-11 strtoi.h: ignore sign for 0, validate scale shift +06-10-11 strdup.c,vmstrdup.c: handle 0 arg +06-10-11 add sfstruse()/sfstropen() error checks +06-10-10 misc/procopen.c: envv==environ => don't modify environ +06-10-10 misc/procclose.c: return valid exit(1) status +06-10-06 port/astconf.c,comp/conf.sh,comp/conf.tab: play nice with getconf(1) +06-10-01 comp/conf.tab: SHELL default checks { _CS_PATH } X { ksh ksh93 sh } +06-10-01 comp/conf.sh: export CONF_getconf to shell actions +06-10-01 comp/putenv.c: always enable setenv() for procopen() +06-10-01 misc/procopen.c: use pathshell() or astconf("SHELL",0,0) if PARANOID +06-10-01 path/pathshell.c: localize the shell path patterns and accept ksh93 +06-09-28 Makefile: avoid ast vix iffe -X ast -- doh +06-09-27 regex/regdecomp.c: add +06-09-26 regex/regcomp.c: handle KRE ~(...) +06-09-25 reorganize to avoid native header intercepts +06-09-15 uwin/crypt.c: _UWIN only! +06-09-14 Makefile: tweak the ast_common.h bootstrap again (finally?) +06-09-14 misc/optget.c: noncommercial => OPT_proprietary +06-09-12 string/strelapsed.c: fix multi-char qualifier parse +06-09-12 string/strtoi.h: drop [cClLqQwW] multipliers +06-09-11 misc/optget.c: add numeric arg validity check +06-09-07 misc/optget.c,tm/tmfix.c: fix uninitialzed var refs +06-09-05 path/pathprobe.c: add version header verification +06-08-01 Makefile: handle iffe vs FEATURE/common vs ast_common.h +06-08-31 Makefile: add ast_map.h to the bootstrap list +06-08-30 misc/glob.c: fix ~(E)re bug that stripped ~(E) before regcomp +06-08-30 include/ast.h: add { integralof(x) pointerof(x) } +06-08-27 string/strelapsed.c: fix off-by-one (too little) parse bug +06-08-25 misc/optget.c: 0*.* numeric option args => .* +06-08-22 misc/glob.c: handle ~(...) pattern options +06-08-16 string/strelapsed.c: fix off-by-one (too far) parse bug +06-08-16 regex/regcomp.c: accept but ignore ~(N) +06-08-14 features/libpath.sh: add solaris LD_LIBRARY_PATH_64 check +06-08-05 sfio/sfpool.c: pool SF_READ|SF_WRITE loop fix +06-08-02 misc/fts.c: fix FTS_NOSTAT optimization to check for .. +06-07-28 include/glob.h: add gl_extra for user globlist_t expansion +06-07-27 features/common: #include "ast_map.h" +06-07-26 comp/fnmatch.[ch]: allow to map fnmatch() +06-07-22 cdt: snarf from kpv +06-07-17 string/strperm.c: perm==-1 skips umask(1) +06-07-17 sfio/sfvprintf.c: handle format invalid mb seq +06-07-17 regex/regcomp.c: inline REG_SHELL => anchored, otherwise not +06-07-17 regex/regcomp.c: inline B|G:basic E:REG_EXTENDED F|L:REG_LITERAL +06-07-17 regex/regcomp.c: inline l:REG_LEFT r:REG_RIGHT +06-07-17 regex/regcomp.c: inline a:REG_LEFT|REG_RIGHT p:~REG_LENIENT +06-07-17 string/chresc.c: add \Uxxxxxxxx +06-07-17 sfio/sfstrtof.h: ignore thousands sep after decimal +06-07-17 string/tokline.c: splice() => spliceline() for bsd +06-06-27 features/float,sfio/sfcvt.c: fix Nan logic +06-06-27 port/astmath.c: fix long double isnan() test +06-06-27 features/map.c: _map_libc for std => _ast_std +06-06-25 string/strperm.c: handle posix = w.r.t. umask +06-06-19 port/mnt.c,features/fs: handle netbsd getmntent api change +06-06-18 regex/regstat.c: add REG_LITERAL check +06-06-11 cdt/dtview.c: update from kpv +06-05-31 sfio/sfhdr.h: fix _SFOPEN() typo +06-05-09 comp/conf.sh: add native getconf -a names to the mix +06-04-28 misc/optget.c: add solaris long option name compatibility +06-03-09 string/strmatch.c: add REG_ADVANCE => REG_* flags +06-02-14 comp/iconv.c: fix uwin iconv_list() /reg/ generator +06-02-10 port/astconf.c: relax standard prefix filter +06-02-08 sfrd.c,sfsync.c: lock logic bug fix +06-02-01 port/astlicense.c: add { parent incorporation } +06-01-26 port/astconf.c: fix { LIBPREFIX LIBSUFFIX } length +06-01-06 features/lib: change _UNIV_DEFAULT probe to use cross{...} +06-01-04 misc/stk.c: fix n**2 realloc behavior +06-01-01 include/sfio.h: export { _Sfi _Sfmaxr } +05-12-13 string/chresc.c: handle \C-X => control-X, \M- => ESC +05-11-22 regex/regcache.c: add, convert string/strmatch.c to regcache() +05-10-06 string/ccmap.c: update ebcdic-u to be idempotent +05-09-28 vmalloc: snarf from kpv; fixes large block brk() thrashing +05-09-26 misc/magic.c,misc/magic.tab: handle latest vcodex header +05-09-12 misc/optget.c: reset opt_info.offset on error + string/strtoi.h: strton() '.' multiplier only if m>1 + string/fmtesc.c: add unadvertized FMT_PARM for FMT_SHELL +05-09-09 string/fmtesc.c: fix FMT_SHELL logic w.r.t. [$`] +05-08-11 string/strerror.c: fix { sys_errlist sys_nerr } prototypes +05-08-03 sfio: snarf sfvaprints sfaprints +05-07-21 port/astconf.c: retain most recent synthesized lookup +05-07-20 sfio/sfsetbuf.c: default file io size now 64K on all systems +05-07-17 ccmap*: add microfocus cobol EBCDIC_U +05-06-29 regex/regcomp.c: fix the A & B inline flag logic +05-06-15 include/recfmt.h: add fs format flag to fmtrec() +05-06-14 error.c: add ERROR_OPTIONS { break count match } +05-06-07 features/stdio: drop FEATURE/limits to fix bootstrap circular dep +05-06-02 features/*,Makefile: drop vestigel iffeio.h bootstrap workaround +05-05-31 string/fmtbuf.c: unlock (spin) before each return -- doh +05-05-30 sfio/sfpkrd.c: work around macos 10.4 recv(MSG_PEEK) bug +05-05-27 regex: add REX_NEST (?%[S.][T.][OT]) + magic.tab: ammend bsd db magic +05-05-23 regex: REX_NEST (?%[D.][E.][L.][Q.][oc]...) +05-05-21 regex: state.fold[] is now locale specific -- doh +05-05-19 regex: add REX_NEST (?%\\()<>[]""...) %(...) nested match +05-05-15 recfmt.h: add recstr() reclen() fmtrec() +05-05-13 optget.c: allow boolean options to take numeric values +05-05-12 recfmt.c: add to recfmt.h, adjust Recfmt_t encodings +05-04-30 sfio: add sfmaxr(), default 64K +05-04-22 comp/omitted.c: fix magic() logic for files < 512 bytes +05-04-20 cdt: snarf update from kpv; void* Dt_t.user added + misc/error.c: library => ERROR_LIBRARY +05-04-19 regex/regcomp.c: handle REG_SHELL [^...] == [!...] +05-04-11 tm/tmxscan.c: handle yyy.mm.dd[-+.]hh.mm.ss.nnnnnn +05-04-07 regex/regnexec.c: fix out of bounds boundary check -- ouch + features/align.c: add jmp_buf to the alignment mix (ia64) + vmalloc/vmhdr.h: add jmp_buf to the alignment mix (ia64) +05-03-31 misc/optget.c: fix option { - _ } separator matching +05-03-30 misc/glob.c: eliminate superfluous GLOB_NOMATCH stat() calls +05-03-24 port/astwinsize.c: include if possible +05-03-23 string/ccmap.c: add ebcdic-m mvs cobol table +05-03-11 comp/omitted.c: handle utime[s](const,const) + comp/conf.tab: fix linux PID_MAX probe +05-03-10 comp/setlocale.c: LC_* value "" => unset -- doh + misc/optget.c: reorder _PACKAGE_astsa code for msgcc +05-03-08 misc/optget.c: delete leading space in STYLE_nroff output +05-03-07 sfio/sfhdr.h: drop extern _sfdscan -- clashes with sfvscanf.c static +05-03-01 tm/tminit.c: add tmlocaltime() for tzset() getenv() override workaround +05-02-20 features/tvlib: tmsettimeofday only for systems that have settimeofday + features/float: fix mvs.s390 NaN tests +05-02-18 tm/tmxmake.c: fix <0 west of GMT bug that warped to 1800's -- wow +05-02-11 port/mnt.c: handle lynxos MOUNTED=/etc/fstab +05-02-08 features/float,sfio.h,sfcvt.c,sftable.c: add INF and fix NAN +05-02-04 features/lib: add _std_strtol (for lynxos) + include/ast_std.h: add _std_strtol tests + comp/strtod.c: #define S2F_function strtod + misc/signal.c: fix ancient bsd SV_INTERRUPT vs. SV_ABORT clash +05-01-11 sfio/sfmove.c: try to seek(fr) when fw==0 + comp/omitted.c: intercept utimes() too + comp/omitted.c: add DOSPATHVARS env var path value conversions + features/tvlib,tm/tvtouch.c: check for utimets() + misc/optget.c: handle '-' or '_' option word separators + sfio/_sfopen.c: allow stream mode changes after initialization + sfio: sync with kpv: SF_SYNCED fix for ksh input loss bug +05-01-09 tm/tmxfmt.c: fix %6N for n<100000000 +05-01-08 regex/regcomp.c: conj() => con() to avoid C99 clash +05-01-05 tm/*: fix { %U %V %W } logic -- my head hurts +04-12-30 tm/tmxtime.c: fix tm_isdst<0 loop +04-12-23 vmalloc/vmbest.c: fix vmresize bug that didn't 0 new data +04-12-19 misc/optget.c: broaden - long option match +04-12-09 string/strtoi.h: fix terabyte 't' suffix math + string/strmatch.c: flush cache on locale change +04-12-01 tm/tmsleep.c: add + tv.h,tv*.c,tv.3: move from pax + tmx.h,tmx*.c,tmx.3: add high resolution tm(3) counterparts + features/lib: add *another* sgi linux.ia64 memccpy bug check +04-10-31 Makefile: __OBSOLETE__ now computed <6 months ago year>0101 + ccode.h,ccmapid.c: add ccmaplist(Ccmap_t*) iterator + option.h,optesc.c: add 3rd arg, 1 => quote '?' too + misc/magic.c: fix bug that terminated `string \0a' at \0 + misc/magic.c: handle vcodex() via decompose() + misc/magic.tab: add vcodex magic + features/stdio: handle _LARGEFILE64_SOURCE -- oops + stdio/(fseek|ftell|fseeko|fsetpos|fgetpos|ftello).c: oops^2 +04-10-28 string/swapop.c: size==-4 => size=4 and extend op=3 to op=7 + tm/tmfix.c: fix tm_mon<0 logic +04-10-22 tm/tmdate.c: handle 'final day feb 2004' + port/astlicense.c: add query=all|id|${...}${...} + port/astlicense.c: "free" => "mit" + comp/omitted.c: revert to the open source license + string/stropt.c: drop siz==0 => tab is hash table + include/sfio.h: incorporate + include/sfstr.h: drop + disc/sfstrtmp.c: drop -- use sfstrbuf() +04-10-20 misc/magic.tab: update tar magic +04-10-18 ufc-crypt.h,crypt_util.c: drop GPL code + crypt.c: add BSD code + pathpath.c: disable { $0 $_ $PWD } related root search +04-10-01 normalize ident stamps + port/astlicense.c: add type=cpl -- yeah +04-09-25 string/swapop.c: return op < size -- duh +04-09-23 comp/spawnveg.c: :NOOPTIMIZE: -- volatile sometimes ignored +04-09-21 comp/spawnveg.c: exec_errno_ptr is volatile -- duh +04-09-14 tm/tmscan.c: add %| alternation and %& => tmdate() +04-09-08 misc/optget.c: add :!value: omitted optional arg value + misc/optget.c: fix --noNAME ambiguous option logic +04-08-26 string/strperm.c: add who^mode to propagate least restrictive up + astmath.c: add { frexpl ldexpl } checks for ast.req + port/astlicense.c: ignore first option if non-assignment + include/ast_dir.h: move d_fileno map before struct defs -- duh +04-08-24 vmalloc/vmbest.c: add {VM_region} VMCHECK=+r for region segment checks + misc/recfmt.c,include/recfmt.h: add +04-08-23 vmalloc/vmbest.c: add {VM_primary VM_secondary} VMCHECK=-s for primary + features/common: punt to for unknown va_list +04-08-11 vmalloc: sync _UWIN libposix hooks +04-07-27 features/common,features/limits.c: ULL suffix for unsigned _ast_int8_t +04-07-22 include/ast.h,comp/eaccess.c: add eaccess() for effective access() +04-07-19 comp/open.c,sfio/_sfopen.c: { O_RDONLY O_WRONLY O_RDWR } are values +04-06-28 misc/error.c: check level after error_info.auxilliary +04-06-24 string/strmatch.c: strgrpmatch() match[] now variable size array +04-06-17 features/common: change _DLL null define to (the standard ast) 1 +04-06-11 misc/optget.c: allow optional [-|+|--|++] optstr() option prefix + misc/optget.c: reset optstr() state on 0 return + misc/optget.c: text()=>textout() linux.ppc symbol hijack workaround +04-05-31 sfio/sfreserve.c: no side buffer if user buffer is large enough +04-05-27 string/fmtbuf.c: handle one concurrent buf > sizeof(buf) +04-05-24 regcomp.c: fix no-advance initialization +04-05-05 conf.tab,conf.sh: update to align with standards + magic.tab: ms suffix update +04-05-04 port/lcgen.c: fix territory initialization +04-04-15 tm/tmdate.c,include/tm.h: fix specific and ordinal days +04-04-08 astconf: retain { HOSTTYPE LIBPATH LIBPREFIX LIBSUFFIX } strict vals +04-04-07 vmalloc/vmbest.c: fix alpha tiny block bug + vmalloc/malloc.c: re-enable on alpha +04-03-30 tm/tminit.c: GMT => UCT only if tz.daylight not defined +04-03-25 vmalloc/malloc.c: _AST_std_malloc=1 for __alpha + path/pathprobe.c: per-user probe dir => $HOME/.probe/$HOSTTYPE +04-03-23 regex/reglib.h: fix isw*() redefines +04-03-17 features/stdio: no __FILE override for __CYGWIN_ (sys/reent.h clash) + sfio/sfhdr.h,sfio/sfsetbuf.c: lower sfmove() default buf size 4x +04-02-29 comp/omitted.c: move env trace after PATH fixup + comp/omitted.c: cygwin spawn _P_DETACH => _P_NOWAIT+setpgid(pid,0) + misc/optget.c: fix html mailto: match + port/astlicense.c: add type=test for fixed 2001 date + features/float: check local NaNQ first + vmalloc/vmhdr.h: fix _vmextern_ vm_truncate return type + misc/magic.tab: add elf s390 index=22 +04-02-26 vmalloc: VMCHECK a:assertions c:arena-check w:warn-instead-of-abort + sfio/sfvscanf.c: fix extf arg selection +04-02-24 features/dirent: set nodefine to avoid ast_std.h _typ_off64_t undef + disc/sfkeyprintf.c: only case pattern must be ()[] balanced +04-02-14 include/sfio_t.h: add SF_DCDOWN, SFDCNEXT(), SFDCPREV() +04-02-13 string/strmatch.c: fix bug that didn't save one-time sub[] size + vmalloc: -g: export VMCHECK=1 enable malloc/free checks + vmalloc: -g: free(0) to check and disable malloc/free checks + vmalloc: -g: free(1) to check and enable malloc/free checks +04-02-11 Makefile: add :P=A: to conf and lcgen exec for cross-compile + regex: use MBSIZE() instead of mbsize() to grab 1 char on err + vmalloc/vmbest.c: updated to do more comprehensive DEBUG tests +04-02-04 sfio/sfraise.c: add sfraise(0,a,b) to iterate over all streams +04-02-01 vmalloc/vmbest.c: _BLD_DEBUG free(0) checks the arena +04-01-31 features/vmalloc: fix typo that missed _mmap_zero +04-01-23 string/strerror.c: handle real strerror() return value overwrite +04-01-11 path/pathpath.c: fix size vs. sizeof(buf) typo +03-12-22 misc/magic.tab: dos EXE tweaks +03-12-05 vmalloc: sync with kpv, adding exceptf announcements +03-12-04 port/astlicense.c: fix expand() loop sentinel bug +03-12-02 include/ast.h: mbchar() advances by 1 on mbtowc() error + misc/fts.c: increase MINNAME to 32 +03-11-21 vmalloc/vmbest.c: export VMCHECK=1 to enable $(CC.DEBUG) vmcheck() + vmalloc/vmbest.c: export VMCHECK=2 to disable KPVCOMPACT + misc/magic.c: add { cobol copybook pl1 } and suffix preference +03-11-12 features/stdio: drop cuserid,getopt for SUSV3 +03-11-11 vmalloc/*: merge kpv update -- this should stomp the compaction bug +03-10-23 comp/iconv.c: fix sfreserve lock fallback +03-10-20 sfio/_sfopen.c: add to allow user sfopen() intercept +03-10-17 regnexec.c: fix exec time REG_LEFT, \x.... => wctomb() +03-10-12 string/strtoi.h: fix strton '.' overconsumption +03-10-12 comp/iconv.c: identity is always (iconv_t)0 +03-10-09 string/fmtesc.c: fix FMT_SHELL to check for all shell magic chars +03-10-01 port/astlicense.c: unknown authors copied verbatim (instead of ignored) +03-09-30 string/chresc.c: handle \u..., \x... consumes all trailing hex digits + string/stresc.c: \u... and \x... > UCHAR_MAX => wctomb() +03-09-29 fnv.h: add +03-09-23 modedata.c: table is for external modes, so no arch specific hacks + optget.c: fix option prefix match translation bug + optget.c: add ` =\n' to optstr() + features/lib: add memcmp() test for sgi optimzation bug +03-09-22 regex.h,regcomp.c: add regncomp() + regclass.c: fix for loop dangling ; in regaddclass() +03-09-20 sftable.c,sfvprintf.c: fix SFFMT_CHAR handling to match extf api +03-09-19 sfmode.c: update release to kpv's +03-09-17 regcomp.c: add pedantic backref error checks +03-09-16 regnexec.c: exec time REG_LEFT => don't advance past initial position + regclass.c: add regaddclass() for user defined [:class:] + regexec.h: REG_VERSION_N2X, add redisc_t {re_map} ccode map + regstat.c: add regstat_t +03-09-11 optget.c: --n:=v sets opt_info.assign=':', opt_info.number enabled +03-09-09 disc/sfkeyprintf.c: *pn on lookup is arg separator; lookup "" arg too +03-09-05 optget.c: [f:l*?] preserves user long name past '*' in opt_info.name[] +03-09-03 sfstr.h: add sfstrpend() for #pending bytes in read buffer +03-08-25 regex: add REG_FIRST, optimize bm + features/lib: _AST_no_spawnveg==1 falls back to fork/exec +03-08-22 features/stdio,stdio/asprintf.c,stdio/vasprintf.c: add +03-08-21 path/pathnative.c,path/pathposix.c: interix updates + features/botched: add cygwin _stat => _stat64 +03-08-15 include/ast.h: map out bsd strmode() + features/common: add interix _ast_intmax_t workarounds + misc/fs3d.c: 3d mount test now uses "" instead of NiL (or cygwin dumps) +03-08-11 string/fmtesc.c: fix optional quoting checks + tm/tmdate.c: fix > 1 year of seconds arithmetic + tm/tmfix.c: fix leap year adjustments +03-08-01 features/lib: beef up sock_peek test for interix +03-07-29 features/float: add -lm to frexp... test + Makefile: fix -lm astmath test sense +03-07-26 features/mem.c: favor _mem_sbrk over _mem_mmap_* +03-07-22 vmalloc/vmbest.c: fall back to sbrk() if mmap() fails + features/mem.c: _mem_sbrk means sbrk() and brk() work +03-07-17 regex/regcomp.c: fix bug that treated KRE X{n,m} like {n,m}(X) + misc/magic.c: check MAGIC_VERBOSE for all load() messages +03-07-14 misc/optget.c: handle [...]{[...]\f...\f...} +03-06-21 misc/sigcrit.c: block SIGCHLD if _lib_sigprocmask || _lib_sigsetmask + comp/spawnveg.c,sfio/sfmode.c: use sigcritical() SIG_REG_* macros + comp/spawnveg.c: drop ENOEXEC logic + vmalloc/*: snarf kpv KPVCOMPACT() fix + vmalloc/vmbest.c: export VMCHECK=2 to disable KPVCOMPACT (just in case) + string/strdup.c: drop __strdup() etc. intercepts -- malloc gets it + features/mem: define _mem_method and _mem_* possible values + vmalloc/malloc.c: _AST_mem_method==_mem_* to force mem get method + sfio/sfputr.c: __ia64 memccpy is bogus -- how many tries do they get? + path/pathshell.c: verify abs path and access(path,X_OK) -- duh + vmalloc/vmhdr.h: add private _Vmessage() for non-sfio ASSERT() + port/astconf.c: fix bug that always returned the minmax value +03-06-11 comp/*.c: reorder macro hding for mvs.390 and + features/vmalloc: add _lib_brk and _lib_sbrk verification + include/ast_std.h,etc.: add _map_malloc for malloc => _ast_malloc + comp/conf.sh: fix SI_* and *_SI_* macro redefs + ast.h: VMDEBUG or _BLD_DEBUG enable and VMFL tracing + vmalloc/vmtrace.c: _PACKAGE_ast __FUNCTION__ is a string + vmalloc/vmtrace.c: set trace file fd FD_CLOEXEC + vmalloc/vmbest.c: set /dev/zero mmap fd FD_CLOEXEC + features/mmap: fix ancient read() vs. mmap() time arithmetic typo + vmalloc/malloc.c: _AST_std_malloc==1 to force standard malloc +03-06-09 comp/omitted.c: add _imp__FUNCTION sybols for __CYGWIN__ static link + vmalloc/vmbest.c: handle systems with sbrk() but no brk() +03-06-04 port/astconf.c: drop non-standard diagnostics +03-06-03 comp/conf.sh: rework symbol collision logic +03-05-30 conf.tab,conf.sh,astconf.c: add sysinfo() SI_* +03-05-29 ccode.h: rework for extensibility, drop obsolete mematoe(), memetoa() +03-05-28 regex/*: recode to use isw*() directly when needed, is*() otherwise +03-05-27 features/vmalloc: fix _std_malloc test +03-05-25 misc/optget.c: fix optstr() ???* internal options +03-05-24 misc/optget.c: fix (ancient) argv null dereference +03-05-23 comp/getcwd.c: don't intercept on _WINIX -- unreliable st_ino +03-05-22 sfio/sfsprintf.c: n<0 => don't append '\0' +03-05-18 misc/fts.c: re-stat FTS_DP to update nlink/times + misc/fts.c: add FTSENT.stack to eliminate getlist() recursion + regex/ucs_names.h: use "..." catenation to placate some cc's +03-05-11 string/strtoi.h: handle "-" "+" "0x" "11#" +03-05-09 vmalloc/vmbest.c: large memory allocation tweaks +03-05-06 misc/optget.c: fix getopt_long() prefix==1 bug that missed short flags +03-04-27 comp/system.c: handle +03-04-24 vmalloc/vmmopen.c: drop dup +03-04-21 tm/tmdate.c: fix next hour/min logic +03-04-15 vmalloc/malloc.c: intercept __malloc() along with __libc_malloc() + string/strdup.c: intercept __strdup() along with __libc_strdup() + features/mmap: consolidate from features/(lib|sfio|vmalloc) + add _NO_MMAP==1 to disable all mmap()/munmap() calls + path/pathposix.c: add +03-04-14 comp/setlocale.c: fix debug_mbtowc() return value for *s==0 || n < 1 + comp/iconv.c: fix error return errno values +03-04-11 misc/stk.c: fix stkgrow() realloc bug +03-04-05 string/tok.c: support readonly single token input strings + disc/sfdcdio.c: fix F_DIOINFO and FDIRECT #ifdef's + include/ast_std.h: allow _LARGEFILE64_SOURCE on __hppa + features/common: fix `tst _foo_' => `tst foo_' typo + features/float: fix `tst _foo_' => `tst foo_' typo + features/float: add FLTMAX_(UINTMAX_MAX,INTMAX_MAX,INTMAX_MIN) + comp/omitted.c: fix pathconf => _pathconf => _ast_pathconf loop +03-04-03 features/float: add _ast_no_um2fm: no usinged intmax => floatmax cast + vmalloc/vmbest.c: add getenv("VMCHECK") to initialize Vmcheck +03-03-28 include/ast_dir.h: add D_TYPE; { D_FILENO D_TYPE } must be #ifdef'd + misc/fts.c|getcwd.c|glob.c,preroot/getpreroot.c: add D_FILENO #ifdef's + Makefile: make sure _BLD_ast is defined for all compiles +03-03-27 ast_vfork.h: generate from features/vfork to pick up headers/pragmas +03-03-25 comp/omitted.c: drop free() of live environ + path/pathshell.c: allow trailing .exe -- pox on that + string/strtoi.h: fix bug leading 3 digits before thousands sep bug + string/(fmt|str)[gu]id.c: we know root when we see it +03-03-24 misc/optget.c: handle : and ? in := default value +03-03-21 ast_std.h: drop all spawn*() but spawnveg() + obsolete/spawn.c: add for dropped spawn*() + features/lib: _use_spawnveg if spawnveg() is a win over fork()/exec() + features/lib: drop NutForkExecve() and _map_spawnve + features/lib: fix memccpy test to clean up /tmp droppings + comp/spawnveg.c: call posix_spawn() if implemented + comp/omitted.c: add spawnve() intercept + comp/getoptl.c: set getopt_long() optind even if no options + tm/tmfmt.c: add %Qrecentdistant + misc/optget.c: fix trailing '*' for option and option args + sfio/sfmode.c: getenv("_AST_SFIO_OPTIONS") [,]SF_LINE[,] for fd {0,1,2} + vmalloc/*: kpv sync for uwin build independent of libast +03-03-18 port/astconf.c: switch to dynamic string values (saves 7K data/bss) + string/strmatch.c: switch to dynamic regex cache (saves 3K data/bss) + regex/regcoll.c,ucs_names.h: initialize rw tables from smaller ro data + features/lib: add vfork test for passing SIG_IGN across exec + features/lib: add spawn test for passing SIG_IGN across spawn +03-03-17 comp/omitted.c: unlink() renames to .deleted dir in case file open + sfio/sfpopen.c: handle mode "" for spawn with no pipe + features/float,comp/frexp.c,comp/frexpl.c: add pow2() table alternative +03-03-12 features/lib: fix linux.ia64 memccpy() tests -- now its their turn + features/vmalloc: fix /dev/zero test + features/align: _ast_intmax_t and _ast_fltmax_t join the union + misc/stk.c: fix struct frame size to align data + disc/sfdcdos.c: change sfslen() => sfvalue(f) +03-03-10 misc/optget.c: handle [f\f:x:lll\f?ddd] +03-03-07 port/astconf.c: uninitialized CONFORMANCE + POSIXLY_CORRECT => standard +03-03-05 comp/omitted.c: make sure at least /bin is in PATH to find cygwin dlls +03-03-02 path/pathshell.c: write access to /bin is effectively root +03-02-28 features/float: add (FLT|DBL|LDBL)_U?(LONG|LONGLONG|INTMAX)_(MIN|MAX) +03-02-25 features/lib: change vfork() test to use _exit() instead of exit() +03-02-23 include/error.h: update ERROR_VERSION for error_info.number space +03-02-22 comp/conf.sh: wrap ksh check in eval to avoid premature exit +03-02-21 misc/fts.c: verify chdir(..) to avoid malicious dir rename() +03-02-19 string/strtoip4.c: isspace() instead of ' '||'\t' +03-02-17 regex/regcomp.c: fix stats.l REX_REP logic that botched REX_BM +03-02-13 string/base64.c: handle catenated encodings +03-02-11 features/libpath.sh: change LIBPATH to [:[:]][,...] +03-02-07 path/pathfind.c: allow "/dev/null" to be PATH_REGULAR +03-02-06 include/ast.h,fmtquote.c: add FMT_ALWAYS|FMT_ESCAPED|FMT_SHELL|FMT_WIDE +03-02-05 tm/tmdate.c,tm/tmword.c,string/strelapsed.c: '_' treated like ' ' +03-02-01 string/strelapsed.c: handle ps style [day-][hour:]min:sec +03-01-31 port/astlicense.c: fix author=* match +03-01-30 include/tm.h: add tmisleapyear() macro +03-01-29 comp/getopt.h,comp/getoptl.c: add gnu getopt_long(), getopt_long_only() + include/ast_getopt.h: for non-gnu part of comp/getopt.h + include/ast_std.h: include instead of +03-01-28 ast.h,string/base64.c: add base64encode() and base64decode() + path/pathfind.c: verify S_ISREG() +03-01-24 path/pathexists.c: fix abs dir bug and deal with case ignorance +03-01-23 path/pathpath.c: honor PATH_ABSOLUTE for the easy case too +03-01-22 path/pathprobe.c: fix search to find both the probe script and command +03-01-17 misc/magic.tab: application/zip => appplication/(gzip|pzip|zip) +03-01-14 misc/optget.c: change href="" to href="." +03-01-10 include/ast_std.h: strtold() import hackery for static __CYGWIN__ +03-01-03 include/regex.h,regex/regcomp.h: add REG_SHELL_GROUP + include/ast.h,string/strmatch.c: add STR_GROUP for REG_SHELL_GROUP +02-12-15 include/error.h: errorcontext => Error_context_s (compatible til 2004) +02-12-06 misc/sigdata.c: add NoF(sigdadata) -- why nmake was uninterruptable! +02-12-03 comp/omitted.c,features/omitted: handle cygwin alarm() return botch +02-11-27 misc/swapop.c: op=3,size=4 => op=7 + string/strlcat.c,strlcpy.c: fix uwin decl clash +02-11-26 sfio/sfvprintf.c: fix sfsprintf() '\0' termination bug +02-11-22 misc/glob.c: move static struniq() to libast extern + string/fmtversion.c,include/ast.h: add fmtversion +02-11-18 string/strncopy.c: add + misc/magic.tab: list size for magicid.h magic +02-11-14 sfio/sfvprintf.c: add %#c for C escapes + include/error.h: add ERROR_NOTIFY context flag for builtin commands +02-11-11 string/strtoi.h: add S2I_size for strnto*() size_t 2nd arg + sfio/sfstrtof.h: add S2I_size for strnto*() size_t 2nd arg + comp/putenv.c: add setenv() and unsetenv() wrappers for setenviron() +02-10-31 path/pathfind.c: add dir of including file to the pathinclude() list + misc/optesc.c: add +02-10-30 string/strtoip4.c: set next char pointer even on error +02-10-29 comp/resolvepath.c: add (size_t version of realpath()) + misc/mime.c: fix mimehead() to ignore null content values +02-10-28 misc/glob.c: add GLOB_STARSTAR for /**/ and GLOB_NOTDIR optimization +02-10-27 string/struniq.c: add +02-10-23 features/common: fix off-by-one loop check +02-10-18 include/ast_std.h: avoid off_t,ftruncate,lseek,truncate redefinitions +02-10-17 misc/mime.c: handle type/* match, fix bogus header parse +02-10-04 sfio/sfstrtof.h: S2F_static <0:export =0:private >0:static +02-10-02 features/common: don't define _WIN32; define _WINIX => unix on windows + features/tty: finally stomp the bsd _POSIX_VDISABLE redefinition + misc/fastfind.c: add more specific findwrite() error messages + comp/omitted.c: fix cygwin utime() to update st_ctime + comp/strtol.c,strtoul.c: __CYGWIN__ static link workaround XXX + string/fmtls.c,fmttime.c: tmform() => tmfmt() +02-09-22 port/astconf.c: return values in fmtbuf() buffer instead of stack + port/mnt.c: don't set MNT_REMOTE for win32 ?:\* paths + sfio/sfvscanf.c: _sfdscan() is library global (not static) +02-09-21 path/pathkey.c: add tool arg for mamake compatible hash + features/fcntl.c: handle iffe _hdr_lcl_* => _lcl_* change +02-09-15 comp/conf.sh: fix enum vs. macro test + cdt: kpv sync +02-09-11 ast.h,features/common: move _WIN32 macro init to features/common + features/common: enable __EXTERN__ and __DEFINE__ for _WIN32&!_UWIN + features/float: add -lm to _ast_*_nan_init tests + vmalloc: kpv sync with vmresizef => vmgetmem + features/iconv: must have both and iconv_open()! + features/vmalloc: alloca test must compile *and* link + sfio/sfvscanf.c,sfstrtof.h: add flag arg to char get, fix NaN loop +02-09-10 vmalloc/vmhdr.h: enable getpagesize() and sbrk() prototypes + features/fcntl.c: enable mmap64() prototype + include/ast_windows.h: windows.h wrapper with ast namespace workarounds +02-09-07 misc/mime.c: fix quoted value parse bug that ate the whole line +02-09-05 features/vmalloc: add free() to _std_malloc test + include/ast.h: NoF(x) now defines _DATA_x for !_BLD_DLL too + tm/tmlocale.c: { C POSIX en } == unix dadgummit +02-08-29 path/pathfind.c: initialize Dir_t.next=0 +02-08-28 uwin/rint.c: update + features/libpath.sh: "bin" is now the default value +02-08-22 vmtrace.h: add for debugging +02-08-20 misc/magic.c: convert to use + vmalloc/vmresizef.c: add for generic discipline resizef default + string/strelapsed.c: allow long time component names +02-08-19 misc/optget.c: add `.fp 5 CW' to --nroff output + string/(fmtfs|fmtuid|fmtgid|strgid|struid).c: convert to use + include/dt.h,cdt/dtnew.c: add for dtopen() in specific vm region +02-08-13 comp/omitted.c: fix bzero logic for e.g. unixware.i386 + include/ast.h: add fmtbase->fmtbasell; swap in 2003-09-01 +02-08-12 regex/regnexec.c: fix REG_MINIMAL REX_DOT mb bug +02-08-08 features/iconv: instead of +02-08-07 regex/regcomp.c: recognize anchors in BRE subexpressions +02-08-06 comp/iconv.c: handle win32 cpNNNN == windows-NNNN aliases +02-08-05 cdt/*: sync with kpv src +02-08-02 features/iconv: include sys/types.h for ast_types.h +02-08-01 misc/magic.c: magic file "." names the default + misc/magic.c: handle addr type (from irix string) + features/lib: move malloc tests to features/vmalloc + features/vmalloc: snarf tests from features/lib + vmalloc/*: sync with kpv src + comp/libc.c: dropped -- __libc_* intercepts moved to vmalloc/malloc.c +02-07-30 features/lib: handle __libc_malloc() in _std_malloc test + vmalloc/malloc.c: add gnu pvalloc() + features/vmalloc: fix alloca check +02-07-29 features/limits.c: handle netbsd guards +02-07-27 sfio/sfpoll.c: handle rw pipes +02-07-25 features/iconv: include ast_types.h for size_t in ast_iconv.h +02-07-18 apply LARGEFILE64 header prototype clash patches + misc/optget.c: __EXTERN__ _opt_info_ instead of opt_info +02-07-17 ast_std.h: memzero() now defaults to memset() instead of bzero() +02-07-16 ast_std.h: add ast.env_serial + misc/setenviron.c: increment ast.env_serial + include/tm.h: tmset() now calls tminit() directly + tm/tminit.c: check ast.env_serial for env change + tm/tmfix.c: speed up for large values of tm_mday +02-07-15 comp/fnmatch.c: fix memory leak caused by missing regfree() + comp/strstr.c: fix broken interpretation and implementation + comp/iconv.c: intercept (but no-op) null to and from buffer pointers +02-06-27 ast_std.h: map _sysconf => _ast_sysconf for sun +02-06-26 cdt,sfio,vmalloc: kpv sync -- is this ever easy? +02-06-24 sfio: kpv sync, vfwscanf(),fputw() fix (wcslen(x)*sizeof(wchar_t)!!) + misc/fts.c: fix symlink chdir() optimzation bug +02-06-11 sfio/sfwrite.c: string to file fix + Makefile: __OBSOLETE__==20020101 +02-06-01 regex/regcomp.c: REG_DELIMITED now consumes the delimiter +02-05-31 regex/reglib.h,regcomp.c,regnexec.c: null subexpression fixes +02-05-24 misc/fts.c: disable dir link counts in 3d + misc/magic.c: fix "*(mkfile)" sh pattern to "*@(mkfile)" +02-05-20 regex.h,regex/regsubcomp.c,regex/regsubexec.c: add + regex/regsub.c: deprecate +02-05-16 tm/tmfix.c: fix '60+n min/sec ago' bug for n min/sec after the hour +02-05-14 regex/regsub.c: fix (^|x) null match early termination bug +02-05-13 dir/dirlib.h: drop errant extern==__EXPORT__ + features/uwin: add uwin lib tests + uwin/*.c: check features/uwin for stubs + features/float: add nan representation generation + sfio/sftable.h: used _ast_*_nan_init for huge values +02-05-09 misc/fts.c: fix virtual top to force ``child'' stat() + features/common: define va_copy() only if not in +02-05-01 string/strtoip4.c: cisco inverted quad mask must have 4 parts +02-04-30 misc/magic.tab: fix pzip version check +02-04-19 string/strtoip4.c: handle cisco inverted quad mask n.n.n.n/i.i.i.i +02-04-18 misc/fts.c: add chdir() verification stat() optimizations + path/pathkey.c: check PROBE_ATTRIBUTES for list of vars +02-04-12 port/astlicense.c: type=open tweak, fix author list spacing +02-04-11 regex/regcomp.c: check for pattern number overflow +02-04-05 tm/tmfmt.c: add %u +02-04-04 sfkeyprintf.c: fix %c numeric value + path/pathpath.c: check plain path first -- duh +02-04-03 misc/fts.c: fix (FTS_PHYSICAL|FTS_NOSTAT) stat optimizations + ftwalk.c: only clear FTW_DELAY if FTW_CHILDREN + ftwalk.h: add FTW_NSOK for FTW_DELAY +02-03-29 ast.h: drop strerror() prototype -- already in + features/stdio: check for _SFIO_H redundant _Sfstd* declarations +02-03-26 misc/glob.c: fix GLOB_LIST gl_flags values +02-03-24 port/mnt.c: update bsd fstype name and mount option logic +02-03-23 Makefile: add ast_wchar.h to the .check.hdr list (for mamake) +02-03-17 features/stdio: hack around g++ 3.* clashes + Makefile: add ast_nl_types.h to the .check.hdr list (for mamake) + string/strtoip4.c: fix validity check bug that only checked last part +02-03-14 misc/optget.c: fix --keys to not expand inline \f...\f +02-03-12 port/astlicense.c: add type=free + path/pathaccess.c: sibling ".." search ignores relative dirs + sfio/sfvscanf.c: sfstrtof get() must return 0 on eof +02-03-11 path/pathexists.c: check path by pairs checking {ENOTDIR,ENOENT} +02-02-14 features/float: copy local min/max macros to avoid printf roundoff + features/wchar: include , not + misc/magic.c: match[]=>matches[] to fix K&R match() macro conflict + include/vmalloc.h: include for !_PACKAGE_ast + uwin/mini.sym: add sprintf (now required by features/common) + regex/regnexec.c: truncate wide chars for functions + Makefile: fix MAM ast_common.h sequencing bug by making it first + cdt/dthash.c: fix DT_DELETE memory leak (DT_DETACH typo) + cdt/dthash.c: fix DT_DELETE double free (dt->data->here typo) + regex/regcomp.c: fix recomb() to reject RE with backref + features/iffeio: explicitly generate stdio.lcl + stdio: add {fcloseall,f(get|put)s_unlocked,fmemopen,getdelim,getline} + tmmake,tmtime: allow negative time_t if native localtime/gmtime do + tmdate: allow years before 1969 + fmtfmt: add + include/ast.h: add { PATH_TOUCH_CREATE PATH_TOUCH_VERBATIM } + Makefile: add std/*.h for std header iffe overrides + comp/iconv.c: fix non-C win32 sfreserve() loop +02-02-11 features/common: separate long long / long double tests + features/common: verify printf handles long long / long double +02-02-02 include/ast_std.h,sfio/sfhdr.h: drop _hdr_locale tests -- always on now + include/ast_std.h: trust _UWIN +02-01-31 port/mnt.c: add aix options field +02-01-30 comp/strstr.c: add for ancient s5 + stdio/_flsbuf.c: only on systems that transfer to native (e.g., uwin) + string/strtoi.h: cat min/max error return values +02-01-28 features/tty: add cf[gs]et[io]speed macros for + comp/rename.c: punt to (ancient) /usr/lib/mv_dir on EISDIR +02-01-24 sigcrit.c: fix SIGCLD!=SIGCHLD interrupt loop + sfvprintf.c: convert fast io macros to functions for uts.390 cc + string/strtoi.h: drop #pragma prototyped for standalone sfio + sfdcsubstr.c: rename from sfdcsubstream.c for 14 char fs +02-01-22 execlp,execvp,execvpe,spawnlp,spawnvp,spawnvpe: fix __EXPORT__ + spawnlp,spawnve,spawnvp,spawnvpe: handle ms mode arg -- barf + sftable.c: ifdef hacks for _WIN32&_ALPHA_ fp exception + _stdfun.c: add _UWIN&_ALPHA_ iob map +02-01-18 sfio/sfstrtof.h: drop #pragma prototyped for standalone sfio +02-01-17 features/hdr: don't include after it doesn't check out! +02-01-16 misc/magic.c: add version type for YYYYMMDD or [a.][b.]c.d + misc/magic.c: recode mime %s parse -- sensible and no buffer overflow +02-01-15 misc/magic.tab,magicid.h: add generic binary magic number and header +02-01-12 tm/tmlocale.c: override win32 default date for {C,POSIX,en} locales + comp/omitted.c: fix cygwin workaround logic bugs +02-01-09 stdio/fseeko.c,ftello.c: add from UNIX98 +02-01-08 comp/conf.sh: use $cc instead of cc +02-01-07 string/strlcat.c,string/strlcpy.c: add bsd api +01-12-18 comp/conf.tab: fix LFS_CFLAGS default for sun _CS_LFS_CFLAGS botch + features/common: add hdr stdarg test + tm/tmdate.c: handle YYYY/MM/DD +01-12-10 misc/magic.tab: add generic 0x00010203 binary magic +01-12-03 path/pathprobe.c: return HOME relative path if readonly/non-suid fs +01-11-30 misc/optget.c: add simple cache for repeat offenders (like ksh read) + sfio/sfhdr.h: preserve errno across SFMMSEQON-SFMMSEQOFF +01-11-29 magic.tab: fix GIF version number listing +01-11-28 string/fmtbase.c: p!=0 => base always included in output +01-11-26 misc/fts.c: empty path is an error +01-11-14 misc/optget.c: fix --?+SECTION queries to include paragraphs +01-11-20 regex/regnexec.c: fix REG_MINIMAL character class match bug +01-11-19 features/lib: retain _lib_confstr for all solaris releases +01-11-16 comp/setlocale.c: fix !_lib_setlocale typo +01-10-31 regex/ucs_names.h: add string catenation to keep line length low + misc/fastfind.c: handle gnu slocate db read + misc/optget.c: add --?+SECTION queries + comp/fnmatch.h: add FNM_NOSYS +01-10-30 tm/tmdate.c: fix cron specs when both wday and mday are specified +01-10-20 misc/glob.c: fix bug that called \ trim() twice on same path + misc/glob.c: fix \ trim() bug that restored / to wrong position + string/fmtre.c: fix { ^ . $ } translations + misc/optget.c: use original string if translation fails -- duh + sfio/sfhdr.h: assume assigns proper atttibutes to errno + comp/regcmp.c: __ia64 workaround fixed by proper CC.DLL probe + comp/getdate.c: __ia64 workaround fixed by proper CC.DLL probe + features/lib: add lib getdate +01-10-18 features/lib: check for strtod static link collision + features/float: add another signed cast for old bsd cc + features/wchar: add before for old bsd +01-10-17 sfio/sfcvt.c: limit max precision to { FLT_DIG DBL_DIG LDBL_DIG } + sfio/sfcvt.c: fix %[aA] format to always have leading 0[xX]1. + sfio/sfvprintf.c: handle %C %lc %S %ls for wchar_t args + sfio/sfvscanf.c: handle %C %lc %S %ls for wchar_t args + string/fmtmode.c: fix bug that omitted trailing '\0' +01-10-12 misc/optget.c: . => \&. for --??nroff + comp/wc.c: fix mbstate_t initialization typo + features/float: fix max integer / float loop termiation + features/float: fix LDBL_UINTMAX_MAX typo that did DBL_UINTMAX_MAX +01-10-11 include/sfio.h: fix _Sfstd* import/export + features/common: fix _UWIN __DYNAMIC__() definition +01-10-06 features/fcntl.c: { O_BINARY O_TEXT } default to 0 + features/omitted: add for comp/omitted.c + sfio/sfopen.c: O_BINARY default for _WIN32&&!_UWIN +01-10-05 misc/glob.c: fix `\(x/*' GLOB_NOMATCH bug that returned `(x' + misc/optget.c: fix localization lookup that didn't drop doubled : ? ] +01-10-04 comp/setlocale.c: handle sizeof(wchar_t)!=4 in debug locale + comp/conf.sh: handle sytems where _SC_* is both an enum and a macro +01-09-25 astconf: add LIBPREFIX +01-09-20 features/common: add __DYNAMIC__() for dll externs +01-09-19 cdt: kpv update + mb*() macros: update for ksh conversion, extend debug locale +01-09-16 tm/tmlocale.c: add compiled in defaults for C locale + misc/glob.c: add gl_nextdir callback for GLOB_COMPLETE +01-08-14 clarify _WIN32 vs. _UWIN vs. __CYGWIN__ + tminit: fix standard & daylight initialization +01-09-11 pathnative.c: add for native fs representation + regex.h: fix regerror_t prototype +01-09-04 regex/regnexec.c: fix REG_ICASE for multi-char collating elements + tm/tmlocale.c: fix old ascii LC_TIME load + locale*: add new LC_* categories + comp/omitted.c: add CYGWIN workarounds + features/lib: add CYGWIN workarounds +01-08-11 features/common: some compilers have long long but no LL constants! + features/lib: add mmap64 implementation test (for linux.s390) + regex/regcomp.c: fix \ in [...] parse + setlocale: retain user locale spelling in setlocale() return value + features/limits.c: don't include ./limits.h -- duh + fmtesc: don't escape multibyte chars + tm/tmlocale.c: fix native C locale default +01-08-08 features/float: some compilers (msdev) forget long long vs. double +01-07-31 misc/optget.c: handle suboptions +01-07-27 cdt.h: add DTDISC() +01-07-17 iffeio.h: move to include for stdio bootstrap iffe workarounds +01-06-25 regex: perl extensions added and tested +01-06-21 misc/error: add ERROR_OPTIONS=prefix=string for message processing +01-06-15 string/chresc: only 2 hex digits max for \xxx + regex/regsub: handle REG_SHELL ~(nnn) rhs backrefs +01-06-11 regex: handle embedded \0 in pattern and subject string + regex: add (?nnn) for backrefs > 9 + comp/fnmatch: add FNM_LEADING_DIR for gnu compatibility + features/float: _ast_flt_unsigned_max_t for bsd.i386 omission +01-06-06 misc/optget.c: add o option for old ps,ar,tar with optional leading - + regex/regcomp.c: REG_LENIENT|REG_DELIMITED \ => + regex/regcomp.c: REG_LENIENT \000 => NUL +01-06-04 features/dirent: replace Makefile hack with iffe semi-hack + regex/regnexec.c: negation must also check REG_SHELL_DOT +01-06-03 sprintf.c: change buf size from SF_BUFSIZE to INT_MAX +01-05-31 glob: fix gl_fignore to ignore leading . by default + features/lib: add botch_d_ino_dirent64 for linux botch +01-05-25 port/lc.tab: add a few missing language_territory's +01-05-23 string/chresc: \C[.collation-element.] + fmtmatch,fmtre: update for syntax extensions +01-05-21 regex: add perl extensions, unicode names for collation elements +01-05-11 string/chresc: \e == \E == escape, \cX == control X, \x{..} == \x.. +01-05-09 path/pathtemp.c: pathtemp(0,0,0,"/private",0) for mode S_IRUSR|S_IWUSR + port/touch.c: handle utime(2) EPERM to fix bug that truncated + regex: change REG_MINIMAL to avoid negation -- much faster now +01-05-08 *.h: add some off_t macro guards for suse linux +01-05-03 regcomp.c: optimize ((x)!)* to ((x)!) + wchar: add and stdio wchar routines +01-05-02 feaures/wchar: add intercept, add stdio wchar functions +01-05-01 string/strtoi.h: signed strtoi accepts qualified unsigned constants +01-04-30 comp/setlocale.c: fix code that relied on 2 simultaneous getenv()'s + tm/tmlocale.c: check for UTF-8 encoded LC_TIME files + misc/magic.tab: add utf-8 and utf-16 U+FEFF magic +01-04-26 features/common: some cc's have _ast_int8_t but not LL constants +01-04-24 features/lib: add _std_strtod for mac os X +01-04-23 ccode: add CC_sub for ms embedded EOF char on ebcdic -- no joke +01-04-20 iconv: handle ebcdic<=>utf + mc.h,mc.c: add mcindex() + ast_std.h: add AST_MESSAGE_SET +01-04-18 features/libpath.sh: fix mvs probe + *: sundry mvs fixes + glob: fix GLOB_NOCHECK to avoid stat() and properly trim patterns +01-04-01 strtod,strtold: add + strtol,strtoul,strtoll,strtoull,strton,strtonl: handle locale & ERANGE + sfvprintf,sfvscanf: handle locale decimal_point,thousands_sep + sfvprintf,sfvscanf: handle %a,%A + setlocale: add LC_NUMERIC decimal_point,thousands_sep init + ast_std.h: __OPTIMIZE_SIZE__==1 to disable non-std __GNUC__ inlines + pathexists: path cache to cut down pathpath() access(2) calls + features/stdio: __FILE_TAG == _sfio_s for solaris +01-03-23 iconv: fix iconv_move buffer boundary bug that stopped at 1 block +01-03-19 glob: add GLOB_AUGMENTED + regex: REG_SHELL syntax error implies REG_LITERAL match + strto[ln][ll]: add overflow checks +01-03-17 locale: reimplemented to provide canonical locale namespace + locale: add LC_ALL=local for local system user default + tm.h: TM_*_3 => TM_*_ABBREV + tmfmt: handle standard E and O format modifiers + tmlocale: consult nl_langinfo() if defined + fmtquote("\"",1) => shell quote +01-03-08 regex: handle multibyte chars and collation classes + strmatch,strgrpmatch: now a wrapper on regex + ast_std.h: add mb*() multibyte and collation support + sfvscanf: handle locale decimal and thousand + proc*,system: handle ignored SIGCHLD + sfkeyprintf: handle %*C +01-03-06 locale: add locale data cache for efficient multiple locale switching + optget: fix LC_MESSAGES!=C --man bug +01-03-01 Makefile: HEADEROPT is not optional for win32.* + comp/syslog.h: comply with the de factos + optget(): fix \f...\f stack bug that referenced data after pop +01-02-27 *locale*: a batch of fixes for native LC_MESSAGE&LC_TIME hooks +01-02-22 pathprobe: reprobe test now checks probe.ini too + sfio_s.h: advertize public Sfio_t members with _ prefix + sfio.h,features/stdio: add reference + sfhdr.h: map _foo to foo + sfio.h: SF_APPEND=>SF_APPENDWR, SF_CLOSE=>SF_CLOSING +01-02-14 comp/conf.sh: probe for _(CS|PC|SC)_* getconf symbols + stdio/*: update for uwin stdio.dll binary compatibility + sfread: finally fixed premature pipe read EOF bug + fmtscale: format tenths for number > 0 && number < 10 +01-02-09 _sfmode(),_sftype(),_Sfextern: UWIN binary stdio compatibility exports +01-02-08 sfgetm,sfputm,_sfputm: fix max clash with k&r max() macro + setlocale: undef valid for sun4 k&r valid() macro +01-02-07 catopen.c: don't do native catopen for the debug locale +01-02-06 sfraise.c: add SF_FINAL check to avoid (posibly) freed disciplines +01-01-01 features/common: fix uwin __DEFINE__ + sftable: initialize decimal and thousand + magic.tab: add corel wordperfect document + syslog: add LOG_LEVEL, add '\n' only if needed + include/tm.h: #undef daylight for _WIN32 + sfio.h: add _SF_APPEND and _SF_CLOSE for native namespace incursion + ast_std.h: add AST_LC_multibyte for MB_CUR_MAX>1 + setlocale: set AST_LC_multibyte + strmatch: check AST_LC_multibyte + features/limits.c: add _BITS_POSIX1_LIM_H guard for linux + features/libpath.sh: fix for aix LIBPATH + procopen,procclose: block SIGCHLD if PROC_FOREGROUND (e.g., system(3)) + optget.c: add enumerated option argument values + optget.c: add for private --html + optget.c: fix memory leak that hit shell builtins hard + sfio: drop sfread small chunk logic +00-12-25 mnt.c: handle " and ' quoting for fstab + sftmp.c: let pathtemp() open the fd O_EXCL +00-12-15 conf.sh: add -v for verbose trace + features/(limits|unistd).c: no FEATURE/types because of _POSIX_SOURCE + features/time: add default for CLOCKS_PER_SEC + features/lib: std_malloc now handles NeXT +00-12-13 strton: recognize qualifier only if preceded by a digit + features/lib: change return in vfork() test to exit() for linux sparc + fmtquote: fix $'...' quote logic +00-12-11 tmdate: fix cron format bug that mishandled months +00-12-01 optget: handle $Id: ... $ in --?-version + features/fcntl.c: fix _STDPP_ mmap munmap +00-11-27 magic: drop dup sfclose() in load() + optget: handle error_info.id==0 +00-11-22 features/stdio: add _FILEDEFED for sol9.sun4 + strton,stronll: handle [u|U][l|L][ll|LL] qualifiers +00-10-31 tmdate: add TM_DATESTYLE and mmddHHMM[cc]yy + astlicense.c: #include MAM workaround + astlicense.c: check for non-empty CONTRIBUTORS +00-10-26 features/stdio: add _FILE and __FILE for gnu + misc/stk.c: fix stack pointer check off-by-one (dgk does it too!) +00-10-23 syslog.h: sync with bsd values +00-10-18 _STUB_* now functions instead of common symbols + all extern data declared with definition to eliminate common symbols + fastfind: add mac/bsd /var/db/locate.database +00-10-17 features/lib: add apple osX (darwin.ppc) workarounds +00-10-12 add: fmtbuf(), fmtclock(), fmtip4(), strtoip4() + fmt*() now use fmtbuf() for tmp fmt buf allocation +00-10-05 regex: add REG_DISCIPLINE and regdisc_t for alloc/error disc +00-09-29 features/lib: pipe_rw==0 for sgi: boot rw == bin incompatibility +00-09-21 astlicense: handle \' and \" in license values +00-09-20 sfwrite: fix write() error in sfprintf() loop +00-08-11 hdr,vmhdr.h: check/hide { getpagesize sbrk } prototypes + astlicense: add noncommercial +00-07-31 fflush: don't seek on pipes + sfresize: add + setlocale: fix bad newof() call +00-06-01 strmatch: initialize match.current.beg[0] to avoid dump at line 670 + sfio/stdio: a few more errno tweaks + astquery: sfstdin/sfstderr by default +00-05-26 sfmode: errno=EBADF for invalid stream use +00-05-22 rewind: fix for xopen test +00-05-18 mcfind: returns absolute path +00-05-16 optget: --keys must catch \f...\f too + translate,mc: errno cleanup +00-05-09 magic: add netbsd binary magic + fts: PATH_RESOLVE!=logical => FTS_SEEDOTDIR + ftwflags: call fts_flags() + astconf: astconf(0,0,0) re-syncs with _AST_FEATURES +00-05-08 optget: --usage & --keys for last -catalog group only +00-05-02 iconv.c: add; use codes[] in ccmapid() and ccmapname(); "" for native +00-05-01 pathtmp: copy env values (libshell or putenv may change) +00-04-01 optget: drop bar from [-foo?bar] for --??keys + sfvscanf: add %X -- duh + features/common: fix va_listval() for power pc + findopen: fix FIND_GENERATE codes file search + magic: add ERROR_translate() and msgcat.key + tmlocale: add for LC_TIME locale info + tmlex: check tm_info.format and tm_data.format + tmfix: fix for tm_wday special case (via nl_langinfo on LC_TIME fields) + strftime: fix for nl_langinfo special case + ast_std.h: provide LC_* defauls if not defined + sfnew: check ${_AST_sfio_bufsize} -- don't tell kpv + catopen,nl_types.h: add intercept to mc* routines + magic.tab: add ast message catalog + strerror: add _ast_strerror intercept with ERROR_translate("errno") + fmtquote: escapes >0177 only if (flags&2) +00-03-17 feof: stdio macro functions only for _UWIN + optget: proper ERROR_translate() calls + astgetconf: add for thread safe error message control + astlicense: fix type=special but with non-null notice + errorx: add for ERROR_translate() support + ERROR_translate: add locale id args for alternate dictionary + option.h: move _OPT_PRIVATE_ to pointer to avoid dll size mismatch + ftwalk: fix FTW_CHILDREN bug that hit top level non-dirs twice + translate.c: default error_info.translate + astconf: fix dup loop thrash that never returns, add _AST_VERSION +00-03-10 ast_std.h: do _LARGEFILE_SOURCE initialization before std headers + fmtquote: handle $'...' quotes +00-03-07 optget: fix numeric option support test + sfkeyprintf: add %q for '...' quoting with ansi escapes +00-03-06 features/stdio: fix _sfflsbuf prototype (dingold@gte.net) +00-02-14 pathtmp: fix pid cache bug that sometimes repeated after ~10 attempts + optget: "..." attribute quote + pathfind: eliminate *: prefix in lib, not type + proc: PROC_FOREGROUND for system(3) semantics (wait status return) + pathtmp: fix mktemp() logic + fts: fix FTS_NOSEEDOTDIR bug that botched ./* in top list + include/ast/prototyped.h includes include/prototyped.h + pathpath: fix strdup(0) bug + optget: --html => ...mailto:foo@bar... + sscanf: fix sfsscanf => sfvsscanf typo + magic.tab: strengthen tar recognition +00-02-08 conf.sh: fix ifdef for systems that think sysconf(FOO) is const +00-02-04 glob: fix globlist_t.gl_flags +00-02-02 vm*: add NoF() for data only files +00-01-27 fts: fix top level .==.. statp bug (thanks to dr. ek) +00-01-25 conf.tab: fix LFS*_*LAGS typo +00-01-24 astlicense: handle type=verbose, license.notice, author=* +00-01-11 pathprobe: generate info for first probe script on PATH - duh + ast.h: add NoF(x) for files that define no functions + tmpfile: fix implementation + global change for string ERROR_translate() dictionary names + optget: fix new way but no long names off by one + optget: handle [--dictionary?name] +99-11-19 comp/conf.sh: `expr length XXX` is not universal + drop sfstdio; stdio via functions everywhere + drop Makefile conditionals (and follow our own advice for once) + sfio: new stream after atexit() bug fix + tm: Tm_zone_t.daylight=0 for standard time within zone + stdio: fopen => _ast_fopen: only way short of binary compatibility + Makefile: atmain.C falls back to atmain.c + optget: add --keys, s
option + stdio: _UWIN check for foreign stdio +99-11-11 astlicense: add +99-10-31 glob: fix regexec pattern; add PATH_ATTRIBUTES case check + pathpath: path==0 means malloc space +99-10-22 tmfmt: %C=2-digit-century, %k=date(1), %y=2-digit-year-in-century +99-10-18 fastfind: expanded default db lookup +99-08-11 magic: fix off by one registry malloc + features/fs: add __RENAME checks for stat familiy (netbsd) + features/fs: major()/minor() fixes for s5 + features/libpath.sh: netbsd fix -- ld.so not in std places + misc/fastfind: fix codes path generation bug + optget: beef up --?* description, fix ... nesting + pathprobe: check for override (writable key file) first + features/time: int tmtimeofday(struct timeval*); + optget: fix opt_info.num, even if opt_info.arg!=0 + fts: FTS_PHYSICAL => FTS_SEEDOTDIR, add FTS_CHOP + fastfind: init dir tab with logical and physical name + glob: add gnu GLOB_ALTDIRFUNC +99-07-17 sfio: kpv update and sfhdr.h sync! +99-06-24 stdio: fix fflush() to ignore sfseek(0) return value +99-06-23 magic: '\r' is text not control to placate m$ +99-06-08 stdio: fix fseek,ftell semantics + uwin stdio: fflush() => _doflsh() to avoid __cplusplus clash + getopt: call liberror() to avoid error() conflict + tmfmt,tmscan: %N zone type (nation code), %z zone minutes west offset + tmfmt: - no pad _ space pad 0 leading 0 pad +99-05-28 magic: fix 'x' == '*' for any number, magic.tab tweaks + features/lib: verify that stat64 really works +99-05-21 tm*: add TM_WINDOW==69 for consistent century windowing guard year +99-05-18 tmtime: add century leap year calc anticipating unsigned time_t +99-05-17 sfkeyprintf: handle %o and %x!! +99-05-09 pathprobe: $HOME/.probe if not suid and st_uid!=geteuid() +99-04-28 magic,magic.tab: add registry() +99-04-24 regcomp: fix ksh pattern +! parse + regfatalpat: add + optget: make : ? ] double escape consistent in all contexts +99-04-01 features: drop iffeio.h and stdio.h when only printf() used + regex: fix stats() .l and .k count + fmtquote: added; most general fmtesc() form +99-03-22 fmtesc.c,ast.h: add fmtnesq() + optget: --?x works for -x option flag +99-03-17 features/limits.c: workaround solaris __EXTENSIONS__ _timespec bug + workaround limits.h circular prereq with ignore stdio.h + sfvprintf: %04e left-pad zero fixed +99-03-03 fts: uncle already: add FTS_SEEDOTDIR to retain leading ./ + regex: REG_MULTIPLE, BM for fixed string alternation + optget: embedded `-' optional in long options, prefix={0,1,2} +99-02-14 fastfind: fix dir format bug that emitted wrong paths + astconf: fix redef off by one bug +99-02-11 pathcanon(): don't cache astconf("PATH_LEADING_SLASHES", NiL, NiL) +99-01-23 optget: move back into , no open-close + optget: add "[index:long-name:description]" for --long-name + comp/gross: add weak __libc_attr for irix < 6.5 compatibility + features/limits.c: tweak the guards again +99-01-11 fastfind: handle old format count byte order + magic.tab: fix elf to use real phdr offset + magic.c,magic.tab: fix | to act like switch/case + comp/fross.c,features/hack: for gross hacks + features/stdio: avoid sfio namespace pollution +98-12-25 tmdate: yyyy.mm.dd + pathprobe: fix procrun() cmd path bug + fmtesq: add + features/common: win32.alpha va_list + magic: add pc alpha object +98-11-11 strmatch: add STR_ICASE + pathprobe: punt to $HOME/.probe/ if not S_ISUID + tmzone,tmdate: handle +-minutes, nn/MMM/yyyy + stropt: fix nested quote pop + tmfmt: add %K => %Y-%m-%d/%H:%M:%S + sfio/stdio: fix fseek() SF_PUBLIC omissions + fmtesc: catch '\\' (duh) + vmalloc: vmbest round bug fix +98-11-01 fts.c: no pathcanon() if (fts_flags & FTS_PHYSICAL) +98-10-01 features/stdio prototype fixes + optget: strton() instead of strtol() for # +98-09-22 regcomp: add REG_DELIMITED and REG_ESCAPE delimited re support +98-09-15 fix _LARGEFILE64_SOURCE stuff + ast_std.h: provide mmap() prototype +98-08-11 fix sfpopen() to ignore SIGPIPE by ignoresig() for sfio but not stdio + fix procopen() to ignore SIGPIPE by ignoresig() for PROC_IGNORE + sfio sfpopen/popen update + magic.src: fix ustar entry +98-07-17 fix ftwalk() short by one malloc() + add fts_notify() +98-06-25 sfdcmore,sfdcprefix: add +98-06-19 tokscan: add %f %g +98-06-01 disc/sf*.c: memset(0) after disc malloc() +98-05-11 strelapsed: y==Y + fts: pathcanon() top list +98-04-01 error: error_info.time for all msgs, just after cmd id + error: no sfsync(sfstdin) + sfio: sfpool, Sffmt_t update + magic.tab: sgi core dumps -- why aren't these elf? + stropt: (v+n) for unknown option is option value if n!=0 + procopen: fix setsid() for spawnveg() only +98-03-19 malloc: add realloc foreign region check + sfdisc.h: rename to match kpv disciplines + fastfind: fix strcasecmp/strcmp directory prefix mixup +98-03-17 features/fcntl.c,pathtmp,sftmp: add O_TEMPORARY +98-03-01 pathcanon: fix PATH_LEADING_SLASHES to stat() both slashes + pathcanon: add PATH_VERIFIED + tmdate: add skip[] to expand separator char set + fastfind: FIND_OLD for old 7 bit db, FIND_TYPE for new 8 bit typed db + fastfind: default generates gnu LOCATE02 8 bit db + magic: handle %s in mime description + cdt: kpv update + sfio: kpv update + stdio: fpos64_t fseek64(), ftell64(), fgetpos64(), fsetpos64() + stdio: fseek() => sfseek(SF_PUBLIC) to avoid locking + fts: initialize parent stat[bp] from top level *after* statf done + astmath: add -lm requirement test + *: Astlong_t => _ast_*_t + regex: simplify regcollate() (from doug) + tmtime: preserve Tm_t*tm when calling tminit() + astconf: add readonly PATH_ATTRIBUTES=[cirw] +98-02-14 fastfind: add FIND_ICASE to ignore case + tmdate,tmgoff: handle (+|-)hh[[:]mm[[:]ss]] absolute timezone + tmdate: ` ' now assumes `next ' instead of `this' + tmfix: fix leap year bug that forgot to add 1900 + proc: add PROC_ZOMBIE +98-02-06 strmatch() char class range bug fix + regex char class range bug fix +98-01-23 _WIN32: changed the #if logic again to accomodate _GNUC_ + mnt: grab the mount options too + ast_std.h: hide getopt,getsubopt from stdlib.h + features/limits.c: add gnu guard macros to avoid limits.h recursion + features/mode.c: include "limits.h" instead of "FEATURE/limits.lcl" +98-01-11 sfio.h: use Astlong_t, move Sfio_t Sfdisc_t typedef to top for stdio.h + sfhdr.h: #undef SETLOCAL for hpux + sfvprintf,sfvscanf: %I*x for sizeof(int_arg) + handle ftruncate64 and truncate64 + dtopen.c: __hppa dll needs Dtset Dtlist Dttree refs here +97-12-18 fmtnum: add +97-12-11 magic: handle sgi 64 bit core dumps +97-12-07 pathtmp: add override for TMPPATH,TMPDIR and cycling +97-11-11 tm: handle 0 return from gmtime(),localtime() (dos negative time_t) + features/stdio: fix fflush() macro to do physical sync +97-10-31 astconf PATH_RESOLVE is logical if 3d&&!std, metaphysical otherwise + magic: fix #! mime bug + tm: tmtime() now calls tmfix() and adjusts tm_isdst too=>mtime() works +97-10-11 dllfind,dlfcn: move to separate -ldll so -last can link static, duh + Makefile,state.c: move forced header generation state.c => Makefile + sfio: update including SF_WHOLE +97-10-01 sfdostext: add \r\n => \n sfio discipline + stropt: NiL table => p=name for all name=value +97-08-11 pathtmp: check pid to note forks + procopen: FD_CLOEXEC rfd && wfd + fts: fts_close() after fts_children() with no fts_read() now works +97-07-17 error: sfsync(sfstdin,sfstdout,sfstderr) instead of sfsync(NiL) + _sfcvinit: add sfio internal interface to base conversion tables + strton: use _Sfcv* base conversion tables instead of sfsscanf() + sfvscanf: use _Sfcv* base conversion tables + mime: x- permutations now matched if exact fails + mime: original- stripped from content-* headers + tmdate: add yyyy-jjj, yyyy-mm-dd + dllfind: add + ccmapid: fix buf copy loop limit + ccmapname,ccmapcpy: add + sfstrtmp: add +97-05-09 streval: fix up casts for pseudo-ansi cc + features/types: use _ast_int_8 vars to verify support + string/modedata: check for mvs.390 S_IFMT + include/ast(_std).h: add #define __FILE_typedef + magic: add ccode text check + include/ftwalk.h: FTW_PATH=>FTS_NOCHDIR to avoid FTS_AGAIN (duh) + fts: clear status for FTS_AGAIN (fixes rm -r bug) + mnt: add mvs openedition w_getmntent() + sfhdr: _hdr_float && for correct MAXDOUBLE + vmalloc/vmbest: if _std_malloc then use malloc()/free() not sbrk() + remove: check _std_remove + procopen: handle pio[{0,1}]=={0,1} + setenviron,features/uinstd: test for mvs.390 dll environ hacks +96-12-25 -> + __EXTERN__(type,object) + __DEFINE__(type,object,value) + magic: check strings in !CC_NATIVE code set too + system: cmd==0 means check for shell access (xopen) + sfhdr.h: fix sfrsrv prototype + add __libc_malloc etc for gnu/linux + astconf(NiL,path,name) == astconf(name,path,NiL) + no liberror + fts_open: if toplist() stat fails return 0 + ftwalk: handle fts_open()==0 via one phony userf() call + sfmode: S_ISFIFO default is SF_SHARE=0 + features/lib: _WIN32 _lib_vfork=1 by default + unsigned<0 comparison and other fixes via sgi.mips4 cc + stk.c: use ALIGN_BOUND for stkalloc() + features/lib,vfork: uwin fix + ast_std.h: fix strto[u]ll prototypes with features/types _ast_int_8 + getsubopt: add for xopen 4.2 compatibility + drop function __IMPORT__ + magic: more magic + change #define FILE from Sfio_t to struct _sfio_s + state.c: add generated includes that may be hit by std for MAM + bytesex: forgot about sizeof(long)=>7; could we fix the name too? + vmalloc.h: fix vmnewof() definition + sfio.h,stdio.h,ast_common.h: pollution cleanup + magic.c: add | op for switch + Makefile: stdio.h was on both HEADERSRC and HEADERGEN -- don't do that + drop pp:notice to get ... to work + regex: add [[:<:]]==\< and [[:>:]]==\> for bsd compat + mime.c: ignore X-* headers while scanning for Content-* + magic.c: check for negative indirect offsets + magic.tab: fix dos entry that generated negative indirect offsets + vmalloc.h: add vmstrdup() prototype + hash.h: add hashgetbucket() macro + magic.c: MAGIFILE is now a : file list + mnt.c: another 4.4 bsd fix -- users must include + common: fix _WIN32 chicken&egg with va_copy + sfio: forgot to set f->val along with _Sfi in sfexcept() + Makefile: add mini target for uwin libmini.a + sfcvt.c: workaround for flaky long double optimizers + features/common: fix to work with va_list==void* + regexec.c: fix REG_STARTEND subexpression offsets + strmatch.c: don't forget + regrexec.c: fix REG_INVERT end boundary bug that missed last record + astconf.c: notify(0,0,"a=b") called for each setenviron("a=b") + pathcanon.c: check astconf(PATH_LEADING_SLASHES) to preserve //* +96-11-28 _LARGEFILE64_SOURCE by default if possible: NOTE: assumes xopen + regerror: fix for xopen + getopt: fix for xopen + magic: add ciao virtual database + astconf: posix/strict/xopen implies "standard" conformance + fs3d.h: hide mount prototype + ast_std.h,mnt.c,features/fs: ncr port tweaks +96-10-31 version 5.0 + add strtoll() strtoull() + sfkeyprintf: upgrade to int_max args + ast.h: add ssizeof() to work around unsigned botch + conf.sh: add shell actions to conf.tab + _DLL*: drop for _BLD_ + __EXPORT__ + __IMPORT__ + sfio,cdt,vmalloc: kpv update +96-10-11 : add character code map support + procclose: return shell style exit status + features/fs: pun statvfs.f_basetype to statvfs.f_reserved7 for mvs + uwin: add subdir for uwin additions + ast_std.h: swab() is from + sfio.h: if _PACKAGE_ast + magic.tab: add mips[1-4], 64-bit + port tweaks for sol.sun4 and sun4 +96-09-06 strerror: add + fmterror: uses strerror + str*search: use sfiso646() order + strpsearch: add + magic: add Magic_t.mime mime type return for magictype() + mime.h: add + strton: use sfsscanf() + strperm: factor in umask() if no who + pathtmp: add TMPPATH check + libevent: add + magic: add discipline to magicopen() + mime: add discipline to mimeopen() +96-08-31 regex: fix BM fail table generator +96-08-11 mntread: fix mnt.type for SCO variant + conf.tab: add SCO KERNEL_* sysconf() vars + fastfind: add findwrite(), fix findread() FF_OFF omission + ftwalk: reimplement on top of fts + fnmatch,re_comp,regexp: reimplement on top of regex + basename,dirname,fmtmsg,fts,ftw,getdate,getsubopt,glob: add + hsearch,nftw,realpath,strftime,strptime,swab,tempnam: add + tsearch,wordexp: add + getcwd: cache last path for easy test +96-07-17 error: sfsync(NiL) ... write ... sfsync(sfstderr) + astconf: handle readonly *(DEV|DIR) vars +96-04-01 swapop: fix stupid return value bug + features/int.c: fix int_swap generation bug + regnexec,regrexec: fix unsigned underflow init error + ls.h: fix iblocks() to be in units of LS_BLOCKSIZE +96-02-29 magic: space before function is definition with no call + hash: drop hash_info from public interface + hash: OBSOLETE hashlast() + hash: add Hash_root_t.Hash_last_t to public interface + add strsearch() and strnsearch() to complement strlook() + add hashkey.h for keyword->long hash + pathpath: pathpath(0,0,"",0) disables $0 $_ $PWD relative search + sfio: sfstrtod+sfhdr update + regex: fix REG_LENIENT to map BRE \[+?|] to ERE [+?|] + change _std_malloc iffe test so it doesn't hang on alpha + sfhdr.h: features/sfio generates _lib_cvt instead of _i386_cvt + ast_hdr.h: add va_copy(a,b) to copy va_list b to a + getopt: fix stupid getopt() -> optget() bug + sfvprintf: %h? now downcasts + regex: handle strto?l() errno in regcomp() + sfstrtod: _Sfstrtod_already_defined -> _STUB_sfstrtod + ast_std.h: hide valloc() and ignore + sfkeyprintf: pass phony va_list for '2' + regex: change HIT var type from int to size_t in special() + ast.h: add EXIT_STATUS(x) to convert wait() status to sh exit status +96-02-14 regex: add _ to \<...\> isalnum test + regex: fix BM inner loop breakout + features/types: size_t is signed on some systems! => _ast_size_t + sfio: sfrd discipline peek optimization + vmalloc: vmalloc.h malloc family macro upgrade + tokopen: fix newline bug for non-restore open + sfio: no inline for gcc until it emits for -g too +96-02-12 sfio: internal upgrade +96-02-09 regex: Boyer-Moore boundary fix + vmalloc: snarf latest +96-02-06 regex: add regrecord() and regrexec() for Boyer-Moore record filtering + regex: rearrange regnexec() args to match buffer,count arg style +96-01-31 stk: add STK_NULL to stk.h and stk.c + regex: privatize regex.h and fix min re length computation + workaround lazy strdup() implementations in features/lib _std_malloc + fix stkclose() to free(stream) -- purify missed because of sfio links + unused var cleanup + port/mnt.c must include to get + add SF_FINAL to sfio and stk + sfio reads now on natural block boundaries + add #!!! !!! to tokline() + add REX_BM pre-filter to regcomp/regnexec +96-01-22 add regcomp env.paren overflow checks +96-01-11 add Doug McIlroy's regex (converted to C from C++ by gsf) + AT&T Research now + sfgetr optimization + regex buglets +96-01-05 tweak magic.tab for win32 +95-12-25 add !(...) -> (...)! to fmtre() + nt tweaks -- functions with no header proto must be defined extern +95-11-24 version 4.1 + add mnt.h mntopen mntread mntclose + convert fmtfs to mnt.h + add RE_LEFTANCHOR and RE_RIGHTANCHOR + gcc inlines must also have global library function instantiation! + add hashview() + fix strtape() internal buffer flow + fix mntread() fs/dir transposition for uts mnttab +95-10-31 change features/unistd.c includes to break limits-param cycle + add cdt from kpv + sfio snarf from kpv + add [ht]search for _WIN32 +95-10-11 clarify PARANOID pathcheck() warning + fix procopen() LIB_SPAWN environ bug with setenviron() cache + fix setenviron() bug that forgot to reset environ if == 0 + add %Z '\0' output format to sfkeyprintf() + sfio snarf for sfvprintf fix + allow multiple hashscan() with scope caveat + add comp/fakelink.h to synthesize a few symlink text patterns + add ! magic to misc/magic.tab + add FTW_TOP to inhibit recursion (for ftw side effects on top level) + add memfatal() common malloc fatal exception message + add dos \r\n test to misc/magic.c/cklang() + sftmp() O_EXCL+random to avoid collisions + pathtemp() uses sftmp() randomizing + features/fs uses SF_APPENDWR + sftmp() uses pathtemp() -- don't worry, its not circular + a few more _WIN32 compatibility additions + realloc fixed to use VM_RSCOPY|VM_RSMOVE instead of obsolete 1 + add hashlook(tab, oldname, HASH_RENAME, newname) + a few more tweaks to satisfy port warnings + add _SFIO_INLINE_PRIVATE to provide real function too + fix installation test + oops object / shared library compat with _sfgetl2 _sfgetu2 +95-09-11 add getopt() compatibility + add fstat,lstat,mknod,stat fixes for _x versions in sys/stat.h + add getconf CONFORMANCE - posix for things that aren't ast default + sfio_t.h: #ifndef _SFIO_H #include "sfio.h" #endif + snarf vmalloc from kpv +95-08-11 fix malloc bug in magic + update linux and bsd 386 magic entries + error_info.auxilliary returns new level, |=ERROR_OUTPUT if msg done + drop fnmatch from strmatch for sparc (solaris) until it collates +95-07-17 fix port/astconf universe initialization + fix misc/optget opt_info.nopt initialization + drop tmset() TZ=... because it only worked when TZ=... was ignored +95-05-09 mongo namespace cleanup + drop > 2 year old obsolete interfaces + sfvprintf.c fix for (char:8 short:16 int:32 long:64) architectures + TMP_MAX back into conf.tab + pathbin() and pathshell() now use astconf() + fix pathtemp() to not cache getenv("TMPDIR") + fix ftwalk() metaphysical to handle non-dirs too + initialize *_info = { 0 }; for ancient ld semantics (NeXT) + fix magic() to do vmfree() + astconf(X_OK) must prefix lines with "getconf" + use and wctype in strmatch() if available + _lib_utime_now checks utime(path,0) + _lib_poll_notimer checks poll(x,0,timeout) + add another _lib_utime_now check to port/touch.c + fix dd_buf cast in dir/opendir.c + split getconf.h into conftab.h and conftab.c for :READONLY: + use mbtowc() only if MB_LEN_MAX>1 + sfio char* -> Void_t* cleanup + handle old syntax in misc/magic.c + sigdata.c holds readonly signal strings + pathcheck() does AT&T checks for tools matching PARANOID - yuk + unused var cleanup + deprecate hash_info in favor of hashlast() + fix bad conf.sh ksh integer interactions + dll cleanup + magic.c falls back to malloc for now + add environ to -- C library global data syms are *RESERVED* + sfhdr.h memccpy(1,2,3,size_t) prototype +95-04-01 version 4.0 + convert to vmalloc + allow sigcritical() nesting mismatch to work around vfork() bug + add strexpr() primitive for streval() with user handle (like ftwalk) + add and magic.c file command magic interface + update magic mail message entry + fix keyprintf() invisible char count nesting bug + add sfstrnew(SF_READ|SF_WRITE) for alternate sfstropen() modes + sfstrnew(SF_READ) but reading requires sfseek(), sfreserve() + add conf.tab and conf.sh to nail C/POSIX limits/unistd macros + add getconf() string interface to *conf* + _DLL_INTERMEDIATE_DATA for systems that require indirect globals + _DLL for building shared libraries with _DLL_INTERMEDIATE_DATA + vecfile() restricted to S_ISREG() + add spawnveg() for job control + convert procopen() PROC_PGRP(id) to spawnveg() + fmterror() returns error text given errno (strerror() does same) + fmtsignal() returns signal text given errno (strsignal() does same) + {sig_name,sig_text,SIG_MAX} -> sig_info.{name,text,sigmax} + liberror("",...) omits [%s library] prefix + update features/signal.c table + add vmdisc() and change vmnewof() to use vmresize() + fix conf.sh to allow refs to previously defined limits + fix undefined entries in getconf() + magic data in magic.tab + fix stropt() pointer cast + vmalloc() exception handler replaces nomalloc() + merge sigdata.c into fmtsignal.c -- sun link needs function w/ data! + sftmp() bug fix + drop local even with _POSIX_SOURCE + fix vmstrdup() macro arg miscount + fix conf.sh to handle enum'd symbolic constants in unistd.h + drop malloc() et.al. prototypes from vmalloc.h + fix sfvprintf() %d argument reference + add OSF/1 AES symbol(s) to conf.tab + determine standards prefix from conf.tab + add _CS_SHELL to conf.tab + getpath() default is confstr(_CS_PATH) + getshell() default is confstr(_CS_SHELL) + unify keyprintf user function args (should have learned by now!) + add quad type to magic + add astfeature() to unify universe style dynamic features + add ftwflags() to determine FTW_* flags from astfeature() +95-03-11 fix stropt() to not modify its *const* arg + handle "'\ quotes and chresc() in stropt() values + , treated like :space: between stropt() options + fix procopen() fd dup to ignore self-dups + add library id[] to misc/state.c + add ftwalk(FTW_METAPHYSICAL) for posix -H + sfvprintf() now handles balanced () in %() + add tmfmt() with buffer size check to replace tmform() + add fmttime() calling tmfmt() to fit fmt*() mold + add and keyprintf() to support %(...)? in commands + add Hash_table_t for size==0 in stropt() + add EXTTYPE extended header to tar.h +95-02-14 sfmove() buffer size overflow fix + add _SFSTDIO_H to sfio.h + rename setenv() to setenviron() -- posix finally decided + rename opt_* to opt_info.* + update features/unistd.c for _SC_* and _PC_* posix additions +95-01-19 (char*)uchar cast in fmtesc() + fix hash bucket memory leak in hashlook() [via John Mocenigo] + update strings/strtape() + fix optget()/optjoin() to handle leading + + add ALIGN_ prefix to identifiers +95-01-11 change tm/*.c tmset(0) to tmset(tm_info.zone) to keep user setting + fix tmform() %Z null pointer dereference +95-01-01 add this RELEASE file + fix strperm() to properly handle "644 file" + fix tokline() to return last '\0' terminated line in string + fix tokscan() to properly handle \\n splice + add fmtesc() to complement stresc() + add LS_NUMBER to fmtls() + drop spurious optusage() ' ' + +:::::::: libcmd :::::::: + +12-02-14 rm.c: --force ignores no file operands specified +12-01-10 b_* (int, char**, void*) => (int, char**, Shbltin_t*) +11-08-27 pids.c: add getsid() iffe test +10-08-16 chmod.c: add -l alias for { -h --symlink } +11-08-16 chgrp.c: change lchmod() ref to lchown() +11-05-03 cp.c: do not delete src if mv to dest fails -- doh +11-03-28 chmod.c,chgrp.c: fix --symlink logic +11-03-26 rm.c: don't eaccess() check symlinks! +11-01-27 date: add { -R, --rfc-2822, -T, --rfc-3339=type } +11-01-03 chgrp.c: --symlink => --physical +10-12-10 rm.c: fix not-writable logic +10-12-01 tee.c: add iterrupt logic for slow open(1) -- needs to be generalized +10-11-30 chgrp.c: add -N,--numeric to bypass name lookup +10-10-20 cp: add --timestamps (preserv timestamps and permissions) +10-10-20 ln: fix 'cannot replace existing file' logic +10-10-10 cp,mv: add --remove-destination +10-08-11 cp.c,expr.c: use conformance("standard",0) test +10-08-11 cut.c: use mbnsize() instead of mblen() (for ast C.UTF-8) +10-07-28 chgrp.c,chmod.c,cksum.c: fts_path for diagnostics, not fts_accpath! +10-06-14 rm.c: fix -rfu logic +10-06-12 paste.c: repeat after me: do not modify argv[i] +10-06-01 sync with ast api 20100601 +10-05-09 tail.c: fix -0f bug that inially listed the entire file +10-05-06 basename.c: add { -a,--all -s,--suffux=suffix } from BSD +10-04-12 cat.c: fix -v bug that dumped core and make consistent with cmp --print-chars +10-04-11 cmp.c: add --print-bytes, --count=n, --differences=n +10-04-08 vmstate.c: add { method flags } vars for Vmstat_t.mode +10-04-08 mkdir.c: fix check for { S_ISUID S_ISGID S_ISVTX } after successful mkdir(2) +10-04-01 stty.c: add --fd=fd option +10-03-23 tail.c: fix -f large initial offset bug that didn't copy all data +10-03-07 tail.c: sfsync(sfstdout) after all -f done, fix -f partial line +10-03-05 mktemp.c: add --regress=seed for testing +10-03-05 vmstate.c: add +10-01-26 tail.c: -f sleep(1) only if no progress from last round of checks +10-01-20 fts_fix.[ch]: use instead of (see fts_fix.c) +10-01-20 cp.c: free(state) if called from old shell +09-12-10 join.c: for iswspace()! +09-12-04 cmd.h: fix CMD_DYNAMIC logic +09-12-04 cut.c: handle -d mb +09-12-03 mkdir.c: add --verbose +09-11-30 cat.c,date.c,cksum.c: drop setlocale() call already done by optget() +09-11-30 join.c: handle -t mb +09-11-28 wclib.c: { -w -L } mb independent of -m +09-11-28 paste.c: handle -d mb +09-11-28 uniq.c: handle -s mb +09-11-28 cksum.c: FTS_SEEDOTDIR by default +09-09-09 fds.c: add --unit=fd +09-08-25 tail.c: initialize Tail_t.fifo=0 !! +09-08-15 tail.c: fix fifo logic +09-08-11 wc.c: add setlocale(LC_CTYPE,"C") cleanup, add utf8 optimzations +09-08-10 uniq.c: replace -c 1..9999 sfsprintf() with inline conversion +09-08-01 join.c: fix empty field null pointer deref +09-07-23 pathchk.c: add -P,--path and -a,--all +09-07-02 chgrp.c,chmod.c,cksum.c: fts_flags() default only if not --recursive +09-06-19 cmd.h,cmdinit.c: add ERROR_CALLBACK for ERROR_NOTIFY main() callback +09-06-19 mktemp.c: --unsafe now checks and prints path but does create +09-06-19 tee.c: add ERROR_CALLBACK for tee_cleanup() sfio discipline pop +09-06-18 rm.c: handle interrupts during interactive query +09-06-18 cp.c: handle interrupts during interactive query +09-05-25 tail.c: fix old style option logic to handle --invalid-long-option +09-05-24 tail.c: -r == +1r +09-05-01 mktemp.c: handle foo/prefix, add -p dir and -u +09-03-31 cat.c: handle --no* options +09-03-15 tail.c: fix --timeout termination logic +09-03-03 tee.c: clean up sfio disciplines on error +09-03-03 cat.c: fix -v|-e|-n|-B interaction bugs +09-02-14 tail.c: fix VSC failures +09-02-14 join.c: fix VSC failure +09-02-02 uniq.c: document -number == -fnumber, +number == -snumber +09-02-02 tail.c: fix usage[] for negative offsets, add sun -b +09-02-02 mktemp.c: add +09-02-02 features/utsname: UWIN _UNAME_os_DEFAULT => UWIN +09-01-31 dirname.c: add experimental { -f -r -x } for pathpath(3) +09-01-05 cmp.c: fix EOF diagnostic to conform to posix +09-01-03 mkfifo.c: fix --mode=mode logic +08-12-07 date.c: add %[_][EO]K for [space pad] [full|long] iso docs +08-11-10 stty.c: check for -t grouping so -tostop != -t -ostop +08-10-15 rm.c: handle 'rm -f x x' => exit 0 +08-09-08 stty.c: #ifdef guard TAB[012] -- freebsd: damn the posix, full speed ahead +08-06-17 shcmd.h: move to libast +08-04-24 uniq.c: add optget() 'n' option for -1 => -f1 +08-04-24 getconf.c: clarify diffs between "name - value" and "name = value" +08-04-01 cut.c: add write error check +08-04-01 paste.c: fix --noserial stream vector access bug +08-04-01 pids.c: add ls/ps style --format=format +08-04-01 stty.c: fix off2 unitialized reference +08-03-28 chgrp.c: add --before=file +08-03-14 pids.c: add +08-03-11 chgrp.c: fix -m to use uid:gid as lookup key +08-02-11 Makefile: add -lmd possibly required by sumlib.o -- hack alert +08-01-30 expr.c: fix <=0 type that broke substr * 1 * -- wow +07-12-13 cp.c: fix builtin state reinitialization +07-11-29 rev.c: honor multibyte locales +07-11-27 cp.c: open non-existent destination with O_EXCL +07-11-27 stty.c: add -t,--terminal-group to list tty pgrp +07-11-27 cksum.c: --silent -s => -S, -s == -x sys5 for gnu compatibility +07-11-11 tee.c: drop ancient bsd compatibility "-" operand => SIGINT +07-10-29 cksum.c: add SUM_LEGACY for -r +07-10-12 cp.c: plug usage string memory leak by using per-builtin state +07-09-21 cksum.c: add sumprint() default scale arg, --scale, --bsd for solaris +07-09-10 chmod.c: add --show,-n +07-07-27 wclib.c: bias checks for modern unix +07-07-17 cat.c: fix --squeeze-blank to reduce multiple blank lines to *one* +07-05-20 cmd.h: handle msvc's balk at if(0)0=0; +07-05-20 cksum.c: #include +07-05-11 cmd.h: add _CMD_CONTEXT_OK() to verify >= 20070511 context +07-05-09 fds.c: handle ipv6 sockets +07-05-09 cmd.h: : cmdquit() => sh_checksig(context) +07-04-25 mkdir.c: force (S_ISVTX|S_ISUID|S_ISGID) after mkdir(2) +07-04-24 procrun.c: add -last intercept => sh_run() and whence -q +07-04-19 uname.c: name operands first checked for CS_NAME, then NAME +07-03-28 date.c: add --unelapsed=scale, -U: fmtelapsed() => strelapsed() +07-03-25 wclib.h: iswspace() requires ! +07-03-11 tty.c: add sysV --line-number, -l +07-02-26 Makefile: sumlib.o: direct extract from +lsum (vcodex someday) +07-02-24 Makefile: tweak cmdext.h action for --mam bootstrap +07-02-09 Makefile: { cmdext.h cmdlist.h } depend on *.c list! +07-02-09 Makefile: +lsum to bring in static -lsum (no dynamic right now) +07-02-07 cksum.c: move from src/cmd/std with ftwalk => fts +07-02-07 getconf.c: handle /bin == /usr/bin in defer logic +07-01-26 chmod.c: don't FTS_FOLLOW if !FTS_PHYSICAL +07-01-23 cut.c: Cut_t variable dimension list[] must be last member +07-01-22 uname.c: fix -h typo that clobbered astconf() state -- ouch +07-01-02 fmt.c: fix buffer splice off by one bug -- what else +06-11-23 cmd.h: because of proto cmdinit cannot be a function like macro +06-11-21 cp.c: fix 06-10-31 const dot[] readonly assignment +06-11-15 cp.c: fix 06-10-31 ln -s enoent bug +06-11-11 getconf.c: let astconf() handle "undefined" vs. "" +06-11-11 getconf.c: fix deferred getconf path search +06-11-11 fmt.c: handle two char { \t \n } in --usage ouput +06-10-31 global edit to eliminate most non-const static data0 +06-10-31 use for all b_*() implementations; drop +06-10-31 cmd.h: add CMD_ prefix to { BUILTIN DYNAMIC STANDALONE } +06-10-31 join.c: tone down /tmp usage vi SFSK_DISCARD +06-10-31 cp.c,rm.c: update to to accomodate non-static data +06-10-29 date.c: "...%H%..." => "...%H" "%..." to avoid SCCS conflict +06-10-26 fds.c: handle sctp +06-10-18 tail.c: fix invalid suffix infinite loop +06-10-11 chgrp.c,cp.c: add sfstruse() error checks +06-10-10 tee.c: add --linebuffer, -l +06-10-06 getconf.c: preserve native getconf(1) known variable behavior +06-10-04 sync.c: add (thanks to Roland Mainz) +06-10-04 getconf.c: add -v specification => run native getconf(1) +06-09-28 stty.c: static setmode() => set() for darwin.i386 +06-09-27 head.c: handle -1c => -c1 +06-09-19 pathchk.c: pathconf() => astconf() +06-09-11 tail.c: handle compatibility corner cases +06-09-08 date.c: add output write error diagnostic +06-09-04 tail.c: fix initial position for -n0, no args => no -f +06-08-28 uniq.c: add -D,--all-repeated +06-08-25 wc.c,wclib.c: add -L,--longest-line,WC_LONGEST +06-08-24 wc.c,wclib.c: implement -m and WC_MBYTE +06-08-24 rmdir.c: -sp applies to every message, add gnu -e +06-08-23 rmdir.c: add solaris --suppress, -s +06-08-23 mkdir.c: don't add 0300 to -p final dir mode +06-07-17 cut.c: handle last line with no newline +06-07-17 cut.c: --output-delimiter == --line-delimiter +06-06-25 chmod.c: mask -c output with S_IPERM +06-05-09 uname.c: add -o; change -a to match linux +06-05-03 date.c: add --last -L to list last of multiple time args +06-02-14 tail.c: fix -f bug that lost fast stream data +06-02-11 getconf.c: exit 1 if name invalid -- duh +06-01-28 cp.c,rm.c: fix astquery() 'q' to return and not exit() +05-08-11 fmt.c: fix -o to handle raw --usage strings +05-05-17 cat.c,head.c: disable EPIPE error messages +05-04-14 chgrp.c: -f means all non-syntax error messages +05-04-11 fds.c: add from old internal open(1) +05-04-09 cmdext.h,cmdlist.h: generate from source -- about time +05-03-24 features/symlink: verify { lchmod lchown } implementations +05-03-07 date.c: add --listzones to list the time zone table +05-02-14 chmod.c: add --reference=file +05-01-11 cat.c: restore output stream to binary mode on exit +04-12-15 cp.c: add --preserve high resolution time support +04-12-08 date.c: add high resolution time support +04-12-01 cmp.c: fix %6I*ld => %6I*d -- doh + fmt.c: handle "\n\n operands \n\n" + head.c: handle -cN -nN, N > 4Gb +04-11-22 cmp.c: handle >2G chars/lines +04-11-18 fold.c: add --prepend=text, --append=text +04-10-31 tail.c: use SF_LOCKR macro +04-10-28 tail.c: use strtol() for old stype [+-]number[suffix] -- doh +04-10-22 cp.c: check rename() errno==ENOENT to retain destination +04-10-11 fmt.c: fix -o,--optget sublist bugs + tail.c: use strton() for number conversion +04-10-08 pathchk.c: add empty path and -p - first component char +04-10-01 fmt.c: add -o,--optget concatenated usage string format + stty.c: context is ERROR_INTERCATIVE + rm.c: restore 3d before exit +04-09-24 pathchk.c: fix docs +04-09-14 date.c: add %| and %& --parse docs +04-08-27 cp.c: add FTW_DC check -- duh +04-08-01 fmt.c: handle last char != '\n' +04-07-22 date.c,uname.c: access() => eaccess() +04-07-01 fmt.c: handle large input lines -- ouch +04-06-11 id.c: fix -r to output something! +04-05-27 expr.c: fix `:' op subexpression output +04-04-15 chmod.c: follow symlink for relative mode +04-04-12 Makefile: add STDCHMOD (for osf.alpha) +04-03-19 tail.c: handle -f sfreserve() large chunk failure +04-02-29 cp.c: decouple -f and -i for standard CONFORMANCE + cp.c: mv now attempts rename() before remove()+rename() + date.c: -f format or +format disables system clock set +04-02-14 cp.c: add -F --fsync to call fsync(2) for each copied file +04-01-05 head.c: -s now uses opt_info.number for >2Gb skip +03-09-18 tail.c: add --log +03-09-11 rm.c: add --unconditional +03-08-11 fold.c: add --delimiter=c to break at c +03-07-28 features/time: change settimeofday() test to 2nd arg of (void*)0 + expr.c: add {match,substr,index,length,quote} +03-07-15 fmt.c: fix trailing space bug +03-06-20 uname.c: fix -p constant string overwrite +03-06-04 stty.c: add undef to control assignment docs +03-05-31 uname.c: add -f and sysinfo()/confstr() compatibility via astconf() +03-05-27 rm.c: fix inappropriate "/.." append path overflow + cut.c: snarf from dgk +03-05-18 rm.c: check st_nlink to verify progress w.r.t. ftwalk/fts +03-05-15 join.c: fix stealth -v2 bug (thanks ahs) +03-05-04 wc.c: drop trailing space for `wc -l < file' +03-03-21 date.c: add %Q/recent/distant/ docs +03-02-19 date.c: fix %+|!flag docs +02-11-14 update for cmdinit() 4th arg and ERROR_NOTIFY for interrupt cleanup +02-10-02 date.c: tmform() => tmfmt() +02-09-30 date.c,uname.c: change execv() calls to procrun(): exec|exit => bad +02-09-06 wclib.c: fix 1 char-at-a-time miscount bug +02-08-19 chgrp.c: convert to use +02-07-23 join.c: fix comm snarf typo +02-04-05 date.c: add %u +02-01-24 stty.c: ifdef a few more macros for uts (yes, its still running) +01-12-14 date.c: clarify %z doc +01-10-31 mkdir.c: mkdir() on existing dir could fail with errno!=EEXIST + uname.c: add execve() loop check for unknown options +01-10-29 tail.c: SF_SHARE on only if not reading through EOF +01-10-11 getconf.c: fix usage typos +01-09-11 cp.c,cmd.h: handle . in argv[0] + cp.c: add O_BINARY to all open() calls +01-09-06 tail: input streams must be SF_SHARE -- duh +01-07-16 stty: fix cntl() macro for CC_NATIVE!=CC_ASCII +01-05-31 date: fix /bin/date fallback logic + stty: fix a few mismatched flags, -a and -g option logic + stty: tone down sane to modify current settings rather than from zero +01-05-01 uname: -i => -h, add sol.sun4 -i, add sgi -R, punt to /usr/bin/uname +01-04-17 date,rm: add +01-03-07 cp: fix readonly string mod on "." +01-01-23 cp: `cp foo' => `cp foo .' only for CONFORMANCE!=standard +00-12-01 cut: multibyte support +00-10-31 mkdir: handle races by checking EEXIST +00-09-20 cp: copy argv to stack before modifying in place +00-05-18 add setlocale(LC_ALL,"") +00-04-30 join: drop weird opt_info.argv reference +00-03-17 expr: add == operator -- duh + cp,ln,mv: delay pathcanon() on destination to verify `cp a b/.' + getconf: use astgetconf for proper message control + ERROR_translate: dictionary update +00-03-08 tail: handle multiple -f files +00-03-07 fmt: add +00-03-07 dirname: handle PATH_LEADING_SLASHES as documented + tail: accept + options +00-02-14 chmod: --ignore-umask to ignore umask(2) in symbolic expressions + chmod,chgrp,cp: use FTS_NOSEEDOTDIR for correct path construction + cat: fix -n (was ignored, wow) +00-01-27 getconf: add "-a" and "-v spec" for sol7.* compatibility +99-09-09 join: fix -j1 vs. -j 1, add --ignorecase +99-06-22 paste: defualt delim in writable string +99-06-16 cat: fix --dos-ouput typo +99-06-11 cp: tighten chown() diagnostics +99-06-08 expr: nothing for NULL string bug fix +99-05-21 paste: fix missing newline columnize bug +99-05-20 mv: do not check for `mv foo foo' since rename() handles it +99-05-01 cmp,comm,cp/mv/ln,expr,fold,getconf,head: long options + join,logname,paste,pathchk,tail,tee: long options +99-04-10 uname: long options, stdize -a + chmod,head,tail,rev: long options + cut: long options, pass regression test 02 +99-04-07 cat: long options, fix O_TEXT modes +99-01-11 tail: fix +n + join: another ggs/psm bug + join: all 1 and/or 2 to be unseekable +99-01-01 cp: fix -p + chmod: drop -l option because of clash with l (lock) mode +98-12-25 cat: add -T to sfopen(,,"rt") +98-11-11 chgrp,chmod: cannot open file stream => not found + join: fix another ggs/psm bug; thanks guys +98-10-20 cp: fix cp -rp to update dir times too +98-09-22 join: fix ggs null field bug +98-08-11 join: fix last regression test bug +98-05-29 join: add jp->common to handle boundary conditions +98-03-11 cat,cp,rev,tee: fix sfmove() error checks +98-03-01 join: fix bug that emitted records more than once after eof + cp: fix sfmove() error check +98-02-14 cp: -R physical, -[HLP], -r getconf(PATH_RESOLVE) +98-01-11 cp: check sfclose() return value +98-01-07 chown,chgrp,chmod: use fts for -R + mkdir: fix -p default mode +97-12-07 mkdir: fix umask() reset +97-11-11 chown,chgrp: proper interpretation of -h,-l for lchown() + chown,chgrp: only chown() if uid or gid change +97-10-31 mkdir: do umask right +97-08-11 cmdinit: clear opt_info.index to allow multiple calls + cp,ln,mv: add +97-07-17 join: fix a few more -a bugs +97-05-31 expr: optget() only if CONFORMANCE==standard +97-04-01 join: fix a few bugs that make it work! +96-12-25 head: sfset(sfstdin,SF_SHARE,1) + Makefile: add -last to cmd lib list + drop function __IMPORT__ +96-08-11 tail: check for truncated file and rewind for -f +96-04-08 update +96-02-29 uname: -a like std, -l for everything + id: add -a (default) +96-02-14 wc: speed up inner loop newline breakout +96-01-30 unused var cleanup +96-01-01 AT&T Research now + pathchk: handle getcwd(0,0) error + expr: switch to +95-11-11 add expr.c + fix cut exit code and -s optimization +95-10-11 add extern b_* to cmd.h + add void* context 3rd arg to b_main() +95-05-09 add getconf + cat -u avoids mmap + add chown|chgrp -m uid|gid map file + add chown|chgrp -P for systems with lchown(2) + chown|chgrp -P => lstat() too! + chmod|chown|chgrp -HLP +95-04-01 version 1.2 + add rmdir +95-02-14 fix mkdir -p symlink bug + fix mkdir '/' skip bug that went one too far + +:::::::: libcoshell :::::::: + +12-02-22 coinit.c: handle non-identifier export var names +11-12-13 cowait.c: handle sfpoll() error return on interrupt +11-11-21 cowait.c: poll before blocking read to weed out killed jobs (no 'x' message) +11-08-30 codata.c,coopen.c: drop macro "..." catenation for old cc +10-08-11 coinit.c: force _BLD_DLL for environ intercept +10-06-01 sync with ast api 20100601 +10-05-19 cokill.c: do cowait(co,co,0) to drain pending messages +10-05-15 coshell.h,coopen.c: add CO_ORPHAN for PROC_ORPHAN +10-05-11 coopen.c: add PROC_ORPHAN for CO_SHELL +10-05-10 coopen.c: no atexit() for CO_SHELL +10-04-15 first ksh93u local job pool tests work (service daemon tbd) +10-04-14 cowait.c: add 3rd cowait() arg timeout; 0 Coshell_t* operates on all open coshells +10-04-10 coshell.h: add CO_SHELL for shell using coshell! +09-12-09 coexport.c: add runtime CO_ENV_EXPORT hook that avoids changing environ +08-10-28 coopen.c: close write side of parent msgfd -- doh +08-04-28 coexec.c: check for fd 1,2 equivalence before CO_SERIALIZE 2>&1 +07-10-29 coshell.h,coexec.c: fix procrun()/system() intercept logic +07-08-15 add CO_SEPARATE,CO_MODE_SEPARATE for separate shell+wait per action +07-04-09 Makefile: $(CC.PIC) to allow archive to be pulled into other dlls +06-08-22 coshell.h: procrun => coprocrun, system => cosystem +06-08-09 coshell.h: export CO_ENV_MSGFD for COSHELL=coshell +06-08-02 coexec.c: Cojob_t.flags&CO_SERVICE for service requests +06-08-02 cokill.c: cokill() signal==0 => kill CO_SERVICE jobs +06-07-27 coexec.c: drop server cowait() that bypassed caller +06-06-21 coexec.c: add non-block cowait() to drain responses +06-06-11 fix service intercept cleanup +06-05-24 add service=name:init lightweight service intercepts +05-04-19 cowait.c: beef up invalid message tests and diagnostics +05-04-11 drop fixed CO_MSGFD for $_coshell_msgfd +05-04-07 coexec.c: fix !_lib_fork&&_map_spawnve close-on-exec redirection +04-09-22 cowait.c: remove CO_SERIALIZE temporaries after listing -- duh +04-09-01 co*: add CO_SERIALIZE +04-07-22 system.c: access() => eaccess() +04-02-11 coinit.c: fix CO_CROSS PATH initialization +02-10-30 coclose.c: fix reference-after-free bug in coclose() +02-01-31 codata.c,coopen.c: fix CO_MSGFD parameterization +02-01-24 coopen.c: fix small memory leak +01-10-26 coopen.c: hung sfclose(fp) -> close(sffileno(fp)) -- wow +01-09-11 coinit.c: fix coident[] for ancient bsh that die on `test == 1' + coinit.c: and fix coident[] to weed out buggy ksh88i trap on exit +01-05-31 co*: add CO_CROSS, expose CO_DEVFD +01-04-23 coquote: add state.type to avoid getenv() overwrite on some systems +01-01-01 cokill: killjob => cokilljob, killshell => cokillshell +00-12-18 coinit: CO_OSH ? "${!-$$}" : "${!:-$$}" +00-10-25 codata: $ZSH_VERSION is not ksh +00-02-14 procrun,system: system(3) returns wait() status (not shell status) +99-11-19 co*: add CO_OSH for bsdi lack of times(1) + coexec: CO_IGNORE for all but real ksh +98-06-22 coinit: quote cd path arg + +:::::::: libsum :::::::: + +12-02-29 sum-sha2.c: bitcount[] order reversed to allow a single noalias buffer copy +09-09-28 sumlib.c: use simple (faster) method name match function +08-06-05 sum-lmd.c: align context to largest int +08-05-01 sumlib.c: add some -lmd verification checks +08-02-11 sum-lmd.c,features/sum: add wrapper for solaris -lmd +07-10-29 sum.h,sumlib.c: add SUM_LEGACY for legacy output format +07-09-21 sum-sha1.c: reinstate Steve Reid's public domain implementation +07-07-26 sumlib.c: drop GPL sum-sha1.c +05-02-14 sumlib.c: split into sum-*.c +05-02-14 sum-sha2.c: add SHA { 256 384 512 } +04-02-29 Makefile: compile with $(CC.PIC) for codexlib/sum $(CC.DLL) +03-12-16 add { crc prng } generic methods and maps[] to these methods +03-12-16 sum.h,sumlib.c: add sumdata() +03-09-29 sumlib.c: fix FNV to use ^ instead of + +03-04-28 sumlib.c: drop md5 `zeroize' for performance + sumlib.c: add FIPS 180-1 SHA-1 + +:::::::: libdll :::::::: + +11-10-11 dll_lib.c: add { dllnames() dll_lib() } +10-10-20 dllscan.c: version arg "-" => 0 +10-10-19 dllplug.c: fix bug that wiped out dlopen() error message +10-10-19 dllplug.c: un-localize lookup names (happens with cut and paste) +10-10-19 dllscan.c: still no code for implicit libs missed by dlopen() +10-08-02 dllplug.c: fix local path dllcheck() call +10-05-28 dllplug.c: add dllplugin() with dllcheck() version check +10-05-28 dllcheck.c: add dllcheck() to do plugin_version() checks +10-05-28 dllerror.c: add dllerror(int retain) for dll*() and dl*() messages +09-11-17 dllscan.c: handle name[-.]version in dlsopen() +09-04-15 dllopen.c: add, use dllopen() internally to wrap dlopen() +08-05-12 dllscan.c: LIBSUFFIX==.dylib => default plugin version match 0.0 +06-10-11 dllscan.c: check sfstruse() return values -- doh +06-01-25 dllplug.c: add errorf() library message for dlopen() error +05-02-14 dllscan.c: "" || "-" => NiL +04-10-01 dllfind.c: drop ksh "builtin" workaround + dllscan.c: directory prefix in name limits search to dir and siblings +04-07-22 dllscan.c: access() => eaccess() +04-01-30 dllfind.c: dllplug(error_info.id) then dllplug(0) +04-01-28 dllscan.c: update for new plugin scheme: lib/foo/bar.xxx + dllplug.c: add dllplug() for plugin dllfind() +03-03-12 dllfind.c: dlopen() with RTLD_GLOBAL|RTLD_PARENT defaults +03-02-11 dllscan.c: change LIBPATH to [:[:]][,...] +03-01-08 dllscan.c: hack version logic again -- is consistency rocket science? +03-01-07 dlfcn.c: fix darwin.ppc dlopen/dlsym/dlclose +02-11-18 dllfind.c: add path,size args (with backwards compatibility checks) +02-11-15 dllfind.c: check for ./path if '.' in path but no '/' +02-08-30 dllfind.c: fix a bug that returned uninitialized value on not found +02-08-28 dllscan.c: handle and display bin as a sibling dir +02-07-31 dllscan.c: add dllsopen,dllsread,dllsclose + dllfind.c: use dllsopen,dllsread,dllsclose +02-07-26 dllfind.c: add dllinfo() +02-06-27 dllnext.c: define _GNU_SOURCE to enable RTLD_NEXT +02-03-17 dllfind.c: fix dll prefix search (for cygwin) +02-01-11 features/dll: include only if _hdr_dlfcn&&_lib_dlopen +01-10-31 dlfcn.c: change hp.pa dlopen() prototype ( but no -ldl!) +01-09-25 dllfind: add LIBSUFFIX +01-07-17 dllfind: do at least one dlopen() to prime dlerror() +01-05-29 dlopen: fix dlopen(0,0) for HP +01-04-20 dllfind: use getconf HOSTTYPE LIBPATH LIBSUFFIX +01-02-14 features/dll: fix unbalanced ' quote and ancient hostinfo reference +00-01-26 dlllook: add -- dlsym() with `_' weak prefix fallback +99-04-01 features/dll: drop -- iffe protos printf +99-03-19 static=1 for all but win32.* +98-06-01 dllfind: fix version search +98-03-11 features/dll: probe for _DLL_RLD_SYM +98-03-01 dllnext: fix to work! +98-01-23 -ldl test moved to lib0ast +98-01-11 update for astconf("LIBPATH") + add dllnext(flags) to uncover next layer + dllfind() and dllnext() in separate files (for 3d) +97-10-11 move from libast so libast can link static diff --git a/lib/package/ast-ksh.html b/lib/package/ast-ksh.html new file mode 100644 index 0000000..4bcc35d --- /dev/null +++ b/lib/package/ast-ksh.html @@ -0,0 +1,5346 @@ + + + + + + + ast-ksh package + + + + + +
+ +

+

ast-ksh package

+The AT&T Software Technology ast-ksh package from AT&T Research +contains ksh and support libraries. This is the minimal set of +components needed to build ksh. +Components in this package: +

+

+ + + +
+ksh93    libast    libcmd    libcoshell    libdll    libsum
+

+This package is a superset of the following package: ksh; you won't need this if you download ast-ksh. +The software is covered by this license: +

+Individual components may be covered by separate licenses; +refer to the component source and/or binaries for more information. +

+A recent +release change log +is also included. +

+


ksh93

+KSH-93 is the most recent version of the KornShell Language +described in +"The KornShell Command and Programming Language," +by Morris Bolsky and David Korn of AT&T Bell Laboratories, ISBN 0-13-182700-6. +The KornShell is a shell programming language, +which is upward compatible with "sh" (the Bourne Shell), +and is intended to conform to the IEEE P1003.2/ISO 9945.2 Shell and +Utilities standard. +KSH-93 provides an enhanced programming environment in +addition to the major command-entry features of the BSD +shell "csh". With KSH-93, medium-sized programming tasks can be +performed at shell-level without a significant loss in performance. +In addition, "sh" scripts can be run on KSH-93 without modification. +

+The code should conform to the IEEE POSIX 1003.1 standard and to the +proposed ANSI-C standard so that it should be portable to all +such systems. Like the previous version, KSH-88, +it is designed to accept eight bit character sets +transparently, thereby making it internationally compatible. +It can support multi-byte characters sets with some characteristics +of the character set given at run time. +

+KSH-93 provides the following features, many of which were also inherent +in KSH-88: +

    +
  • +Enhanced Command Re-entry Capability: The KSH-93 history +function records commands entered at any shell level and stores +them, up to a user-specified limit, even after you log off. +This allows you to re-enter long commands with a few keystrokes +- even those commands you entered yesterday. +The history file allows for eight bit characters in +commands and supports essentially unlimited size histories. +
  • +In-line Editing: In "sh", the only way to fix mistyped +commands is to backspace or retype the line. KSH-93 allows you +to edit a command line using a choice of EMACS-TC or "vi" +functions. +You can use the in-line editors to complete filenames as +you type them. +You may also use this editing feature when entering +command lines from your history file. +A user can capture keystrokes and rebind keys to customize the +editing interface. +
  • +Extended I/O Capabilities: KSH-93 provides several I/O +capabilities not available in "sh", including the ability to: +
      +
    • +specify a file descriptor for input and output +
    • +start up and run co-processes +
    • +produce a prompt at the terminal before a read +
    • +easily format and interpret responses to a menu +
    • +echo lines exactly as output without escape processing +
    • +format output using printf formats. +
    • +read and echo lines ending in "\". +
    +
  • +Improved performance: KSH-93 executes many scripts faster +than the System V Bourne shell. A major reason for this is +that many of the standard utilities are built-in. +To reduce the time to initiate a command, KSH-93 allows +commands to be added as built-ins at run time +on systems that support dynamic loading such as System V Release 4. +
  • +Arithmetic: KSH-93 allows you to do integer arithmetic in any +base from two to sixty-four. You can also do double +precision floating point arithmetic. +Almost the complete set of C language operators are available +with the same syntax and precedence. +Arithmetic expressions can be used to as an argument expansion +or as a separate command. +In addition there is an arithmetic for command that works +like the for statement in C. +
  • +Arrays: KSH-93 supports both indexed and associative arrays. +The subscript for an indexed array is an arithmetic expression, +whereas, the subscript for an associative array is a string. +
  • +Shell Functions and Aliases: Two mechanisms - functions and +aliases - can be used to assign a user-selected identifier to +an existing command or shell script. +Functions allow local variables and provide scoping +for exception handling. +Functions can be searched for and loaded on first reference the +way scripts are. +
  • +Substring Capabilities: KSH-93 allows you to create a +substring of any given string either by specifying the starting +offset and length, or by stripping off leading +or trailing substrings during parameter substitution. +You can also specify attributes, such as upper and lower case, +field width, and justification to shell variables. +
  • +More pattern matching capabilities: KSH-93 allows you to specify +extended regular expressions for file and string matches. +
  • +KSH-93 uses a hierarchal name space for variables. +Compound variables can be defined and variables can +be passed by reference. In addition, each variable +can have one or more disciplines associated with +it to intercept assignments and references. +
  • +Improved debugging: KSH-93 can generate line numbers on execution +traces. Also, I/O redirections are now traced. +There is a DEBUG trap that gets evaluated before each command +so that errors can be localized. +
  • +Job Control: On systems that support job control, including +System V Release 4, KSH-93 +provides a job-control mechanism almost identical to that of +the BSD "csh", version 4.1. +This feature allows you +to stop and restart programs, and to move programs between the +foreground and the background. +
  • +Added security: +KSH-93 can execute scripts which do not have read permission +and scripts which have the setuid and/or setgid set when +invoked by name, rather than as an argument to the shell. +It is possible to log or control the execution of setuid and/or +setgid scripts. +The noclobber option prevents you from accidentally erasing +a file by redirecting to an existing file. +
  • +KSH-93 can be extended by adding built-in commands at run time. +In addition, KSH-93 can be used as a library that can +be embedded into an application to allow scripting. +
+Documentation for KSH-93 consists of an "Introduction to KSH-93", +"Compatibility with the Bourne Shell" and a manual page and a +README file. In addition, the "New KornShell Command and Programming +Language," book is available from Prentice Hall. + +

+


release change log

+
+
+All recorded changes follow.
+
+
+

+


ksh93 changes

+
+
+12-02-29  --- Release ksh93u+ ---
+12-02-29  A bug which could lead to a core dump when more that four shared
+	  libraries were added with the builtin command has been fixed.
+12-02-29  Fixed a few bugs which caused SIGCHLD to be blocked preventing
+	  background jobs from being reaped until a foreground job was run.
+12-02-27  A bug in which sh -c for a simple command caused a fork() has been
+	  fixed.
+12-02-27  A timing bug on systems such as AIX that doesn't support vfork()
+	  that could cause the exist status to get lost has been fixed.
+12-02-22  A private file descriptor that was not close-on-exec for a command
+	  substitution and has been fixed.
+12-02-14  A bug in which ^Z did not stop a pipeline when the last component
+	  was a shell built-in has been fixed.
+12-02-14  getconf("PATH") used to initialize ed(1) path.
+12-02-13 +In earlier version read from standard input would fail when called
+	  from the KEYBD trap.  Now read options -N, -n, and -t should work
+	  when called from a KEYBD trap.
+12-02-13  If FCEDIT is not set and fc is invoked without the -e option,
+	  ed will be invoked if found instead of /bin/ed. 
+12-02-10  Another bug in the saving and restoring of IFS in a subshell
+	  that caused a core dump has been fixed.
+12-02-08  A bug in which .sh.fun disciplines could be cleared after a
+	  function completes has been fixed.
+12-02-08  A bug in job control in which the foregroup process group was not
+	  set correctly after restarting a stopped pipeline has been fixed.
+12-02-07  A bug in which numbers with leading zeros could be treated as
+	  octal constants outside of ((...)) has been fixed.
+12-02-06  A bug in arithmetic with compound variables containing multiple
+	  array elements has been fixed.
+12-02-02  A bug in the ulimit option table was fixed.
+12-01-26  A bug in which a set command that did not change monitor could
+	  effect the behavior of the monitor when monitor mode is on is fixed.
+12-01-21 +You can now test whether the shell implements a math function using
+	  typeset -f .sh.math.name, where name is the name of the function.
+12-01-21  A bug in which typeset -L and typeset -R did not handle multibyte
+	  characters correctly has been fixed.
+12-01-20  A bug that could cause the shell to hang waiting for an incorrect
+	  job pid has been fixed.
+12-01-19  A memory leak which occured for a nested command subtiution has been
+	  fixed.
+12-01-17  A bug in which typeset -u PS1 could enable the uppercase attribute
+	  for some other variables, for exampe, HISTFILE has been fixed.
+12-01-16  A bug in which .sh.match was not correct after a substring match when
+	  the replacement string contained a substring match has been fixed.
+12-01-12 +Files that are sourced from profile files are now read and executed
+	  one command at a time so that alias definitions take effect as they
+	  do for profile files.
+12-01-12  A bug in which whence -p would find a function if one existed and
+	  there was no command of that name on PATH.
+12-01-11  Change b_* prototype (int, char**, void*) => (int, char**, Shbltin_t*).
+12-01-05  A bug in which read was not terminating for a signal that had a trap
+	  set has been fixed.
+12-01-01  A timing problem with >; has been fixed.
+12-01-01  A macro expansion memory leak has been fixed.
+11-12-26  A bug in array assignments of the form arr=( $arr[i] ...) in which
+	  arr was not unset before the assignment has been fixed. 
+11-12-20  A number of code changes were made based on the results of errors
+	  indicated by static code analysis.
+11-12-13  In vi edit mode a lteral <TAB> can now be entered by preceding it
+	  with a backshash.
+11-12-13  When tab is entered for completion after a ' or ", the ' and "
+	  characters are no longer deleted.
+11-12-07  A bug in which a program in the current direcotry with a . in the
+	  name could fail to execute when both PATH and FPATH end with :. has
+	  been fixed.
+11-12-07  I fixed a bug in which a variable expansion in a large here-document
+	  could be expanded to a null string.
+11-12-06  An optimization to read was added in the case the the read command
+	  was redirected from a file.
+11-12-06  Changes were made to make the line limit for read unlimited by
+	  default.
+11-12-05  A bug in which unsetting an array variable did not completely clear
+	  the variable in some cases has been fixed.
+11-12-02 +The printf alternative character # when applied to the %q format will
+	  quote argument in a form suitable for a field in a .csv format file.
+11-12-02 +A -S option was added to read to be able to read .csv format files.
+11-11-28  A bug in which redirection of standard error in a function called from
+	  command substitution caused standard error to be lost has ben fixed.
+11-11-21  [[ (-n foo) ]] no longer requires a space before (.
+11-11-11  The readonly attribute for a variable now applies to compound
+	  assignments to that variable.
+11-11-07  Changes were made to reduce the stack size to allow deeper function
+	  recursion.
+11-10-10 +Added alternate flag to printf %H for encoding of URI's.
+11-10-10  A bug which could lead to a core dump when the shell was invoked
+	  with more than twenty five open files has been fixed.
+11-10-06  A bug in the scoping of name references in functions called by other
+	  functions has been fixed.
+11-10-05  A bug in which wait on a pid may return the exit status of an
+	  earlier background job with that pid instead has been fixed.
+11-09-22  A bug in which a read timed out with TMOUT did not always restore
+	  the terminal state has been fixed.
+11-09-21  An optimization that allowed the last command in a script to use
+	  the same process id as the script has been eliminated.
+11-09-21  Added letoctal option that enables the let command to recognize
+	  octal constants starting with 0.
+11-09-20  A bug in which ${var.} could cause a core dump has been fixed.
+11-09-20  A bug with SHOPT_EDPREDICT when neither vi or emacs was enabled for
+	  lines beginning with # when in a multibyte locale has been fixed.
+11-09-20  A bug in emacs edit mode with SHOPT_EDPREDICT that would cause
+	  history searches matching comments lines to generate predictions
+	  has been fixed.  Only user typed comment lines generate predictions.
+11-09-20  A bug in emacs edit mode with a search that matches a comment line
+	  that could cause a core dump has been fixed.
+11-09-16  A bug in which a command name ending in .. could cause the shell to
+	  abort has been fixed.
+11-09-16  The characters ! + - % and @ in file names are no longer escaped with
+	  file name completion.
+11-09-13  The let command no longer treats numbers starting with 0 as octal
+	  constants.  
+11-09-08  A bug in which printf "%R" could cause a core dump for invalid shell
+	  patterns has been fixed.
+11-08-09  With set -u, ${var#pattern} reported that var was unset for special
+	  variables.
+11-08-03  A bug in which the shell did not preserve the exit status for a
+	  coprocess has been fixed.
+11-08-02  A bug in the saving and restoring of IFS in command substitution that
+	  caused a core dump has been fixed.
+11-07-21  Modified the 10-08-27 bug fix so that background jobs started in for
+	  and while loops created interactively generate completion messages.
+11-07-20  I fixed a bug in here documents in which multi-byte characters that
+	  crossed buffer boundaries were not processed correctly.
+11-06-22  The shell compiler now supports process substitution.
+11-06-22 +Added code to support process substitution on systems that do
+	  not supply the /dev/fd directory.
+11-06-21  Fixed extraneous jobs Done messages when builtin is at the end of a
+	  pipeline.
+11-06-20  Fixed two regression tests.
+11-06-20  Fixed a bug introduced on last update.
+11-06-14  A bug with pipefail in which the shell would wait for background
+	  jobs to complete has been fixed.
+11-06-09  A bug which caused the options.sh regression test to fail on OS390
+	  Linux has been fixed.  The bug could also have affected other systems.
+11-06-07 +A number of changes to support the still undocuments namespace option
+	  have been added.
+11-06-06  A bug in which command substitution of eval would hang when it  had
+	  standard error redirected to standard output has been fixed.
+11-06-01  A bug in case statement fall through (;&) ignoring set -e was fixed.
+11-06-01  A bug in which creating a left or right justified upper or lowercase
+          variable with an empty string has been fixed.
+11-06-01  A bug in which the .paths directory wasn't read when a subshell was
+	  executed before any other command has been fixed.
+11-05-31  The shell now gives an error when a type variable is assigned to
+	  an array instance when the array has been declared a compound variable
+	  array.
+11-05-31  A bug in which typeset -m of an array instance did not remove the
+	  original instance has been fixed. 
+11-05-28  A bug in which typeset -m dest=src fails when src and are passed as
+	  name references was fixed.
+11-05-28  A bug in which typeset -m "c.board[1][i]=el", where el is a compound
+	  variable core dumps has been fixed.
+11-05-28  Two bugs in the display of arrays of compound variables with print -v
+	  have been fixed.
+11-05-27  A bug with command substitution with the shift jis locale has been
+	  fixed.
+11-05-25  A bug in which unset -f foo, called within function foo could cause
+	  the shell to core dump has been fixed.
+11-05-24  A bug in unsetting arrays of compound variables that could lead to
+	  a core dump has been fixed.
+11-05-24  A scoping bug in with typeset -m for variables passed as references
+	  has been fixed. 
+11-05-09  A bug in which 'typeset +p array[$i]' in a subshell could cause an
+	  exception has been fixed.
+11-05-03  Two more scoping bugs with name references and read -C were fixed.
+11-05-03  A potential race condition which occurs when here-documents are
+	  processed in asynchronous blocks has been eliminated.
+11-05-02  Another scoping bug with name references defined in a function has
+	  been fixed.
+11-05-02  A bug in which the shell discards saved exit status of a job if it is
+	  followed by a subshell execution has been fixed.
+11-04-28  The shell now checks for numerical overflows with process ids.
+11-04-28  Another scoping bug with compound variables defined by name references
+	  inside a function has been fixed.
+11-04-28  A bug which caused a core dump on 32 bit systems with the basic.sh
+	  regression test has been fixed.
+11-04-27  A scope binding error for name references has been fixed.
+11-04-27  Assignment of compound variable to compound array element by name
+	  is now working.
+11-04-26  I fixed a bug with SHOPT_FIXEDARRAY compilation that could cause
+	  an a core dump for not fixed arrays.
+11-04-25  A bug in the references to two dimensional compound arrays has
+	  been fixed.
+11-04-20  A bug in which a name reference to a multidimentional index array
+	  index, nameref x=foo[3][4], did not work correctly has been fixed.
+11-04-18  Changes were added to allow fixed size arrays of variable sized
+	  objects when the SHOPT_FIXEDARRAY compile option defined on 10-09-28.
+11-04-18  A bug in which name references to array elements could fail has
+	  been fixed.
+11-04-15 +A compile option, SHOPT_2DMATCH, has been added which causes
+	  .sh.match to be a two dimensional array after ${var//pat/str} 
+	  where the first dimension is the pattern number and the second is
+	  the match instance.
+11-04-11  A bug in which readonly var, where var is exported could cause var
+	  to be unset has been fixed.
+11-04-06  A tokenizer bug in which ${x/{3}(\d)/ } would cause in infinite
+	  loop has been fixed.
+11-04-05  A bug in which ${!x.} could cause a core dump has been fixed.
+11-04-04  A bug in which cleaning out the history file could terminate before
+	  keeping all the recent history events has been fixed.
+11-03-29  A bug in which ${#array[@]} was 1 rather than 0 after issuing
+	  typeset array[7] has been fixed.
+11-03-29  The subscript out or range message for fixed arrays has been fixed.
+11-03-29  A bug in which suspend could cause a core dump has been fixed.
+11-03-24  For the showme option added 09-09-09, commands beginning with a ;
+	  inside an arithmetic for loop, no longer produce syntax errors.
+11-03-18  A bug in _WINIX ~domain/user expansion has been fixed.
+11-03-16  A bug in the pipefail option which could cause a script to hang
+	  has been fixed.
+11-03-12  The shell no longer treats ${##pattern} as a syntax error.
+11-03-11  A bug in typeset -u on systems that don't supply the towctrans()
+	  function has been fixed.
+11-03-11  A bug in which a compound assignment of the form var[sub]=(...)
+	  would evaluate sub for each assignment has been fixed.
+11-03-07  A bug in which reassigning a compound variable to an associative
+	  array index could incorrectly increase the count of the number
+	  of elements has been fixed.
+11-03-04 +The tilde expansion on windows has been modified to handle user
+	  names of the form domain/user so that ~domain/user now expands
+	  to the home directory of that domain user.
+11-03-03  A bug in which the width of the prompt was calculated incorectly
+	  which cause the wrong line length for edit commands has been fixed.
+11-03-02  A bug in which a global variables set from within a function inside
+	  a subshell can leave side effects in parent shell has been fixed.
+11-03-01  A bug in which whence -a could dump core when the first match
+	  was due to : in PATH and the program was in the current directory.
+11-02-28  A bug in emacs mode with SHOPT_EDPREDICT (added on 10-05-20) which
+	  disabled prediction on a line starting with # when the cursor was not
+	  at the end of line has been fixed.
+11-02-28  The output format for compound variables with set has been fixed.
+11-02-25  A bug which could lead to a core dump occurred when a shell script
+	  without #! is invoked by name from a parent shell that has name
+	  references defined and the script creates name references of the
+	  same name.
+11-02-21  The shell now fails with a syntax error when a here-document in a
+	  command substition is not completed before the closing ), for
+	  example, $( foobar <<! )
+		here_doc
+	  !.
+11-02-18  A bug in which the value of $0 in a function defined by name()
+	  was changed to name has been fixed.
+11-02-17  A bug in which the declaration typeset var[100] did not work
+	  correctly has been fixed. 
+11-02-15  A bug in which [[ -v sh.match ]] did not work correctly has been
+	  fixed.
+
+11-02-08  --- Release ksh93u  ---
+11-02-08  A bug in which opening standard output after it has been closed with
+	  exec 1>&- doesn't work has been fixed.
+11-02-07  A bug on some systems for which a command subtitution could hang
+	  has been fixed.
+11-01-28  A bug in file name completion for files containing both multibyte
+	  characters shell special characters has been fixed.
+11-01-18  The .sh.match variable now shows elements that do not match as
+	  as not set rather than an empty string.
+11-01-18  A bug with typeset -m of an array into an element of an indexed
+	  array has been fixed.
+11-01-13  A bug in handling of arrays of compound variables inside ((...)) which
+	  reported a syntax error been fixed.
+11-01-10  A bug in arithmetic assignment operators of the form op= for array
+	  variables when the same array was referenced on the left and the
+	  right hand side with different indices has been fixed.
+11-01-10  A bug in which the output of time was lost when { time...;} 2>&1
+	  occurred inside command substition has been fixed.
+11-01-07  [[ -v sh.match[i] ]] was returning false when sh.match[i] was set.
+11-01-05  Added and modified warning messages with sh -n.
+11-01-02  Fixed bugs with typeset -l/-u/-M and arrays.
+10-12-28  Fixed a bug with typeset -l/-u/-M values in arithmetic expressions.
+10-12-26  Fixed a time parsing bug in sleep and localeconv() initialization.
+10-12-23  Prevented the shell from generating a core dump when it sends itself
+	  a termination signal because the last command terminated with that
+	  signal.  This prevents a core dump to be overwritten by the shell.
+10-12-22  A bug in the expansion of  ${A[@]} ${B[@]}, introduced in 10-12-01
+	   when A="" B=B has been fixed.
+10-12-21 +Use MS_3D in b_vpath() for setting win32 WoW mount defaults.
+10-12-17  A bug in the expansion of ${var:i:j} which caused a core dump when
+	  i > ${#var} has been fixed.
+10-12-16 +sleep now treats . as decimal point even in locales that use comma.
+10-12-16 +typeset -M mapname was added to generalize on toupper and tolowwer
+	  mapping as provided with wctrans(). 
+10-12-10  A bug in which typeset -l displayed namespaces as well as lower case
+	  variables has been fixed.
+10-12-06  A bug in which a pipeline could terminate prematurely for a pipeline
+	  whose right hand side is a builtin, and whose left hand side ends in
+	  a simple command that has standard output redirected has been fixed.
+10-12-06  A bug in hexfloat assignments when the right hand side is a string
+          variable starting with 0x has been fixed.
+10-12-01  A bug in the expansion of ${$1+"$@"} which causes the last positional
+	  parameter to disappear when it is empty has been fixed.
+10-12-01  A number of changes were made to reduce the startup time.
+10-11-29  When wait is interrupted by a signal that is caught, it now exits
+	  with a non-zero exit status.
+10-11-29  When a variable is used directly in an arithmetic expression,
+	  leading zeros no longer cause the value to be treated as an
+	  octal constant.  This was true in previous versions for justified
+	  variables.
+10-11-29  An incorrect warning message was eliminated with the -n option for
+	  arithmetic expressions with associative arrays.
+10-11-29  Some changes were made to slightly reduces startup time.
+10-11-24  A bug in which a name reference is make to arr[0] when arr is not
+	  an array has been fixed.
+10-11-23  If a type definition is made without a compound variable assignment it
+	  produces an error message and no longer shows up as a defined type. 
+10-11-22  The handling of  inside [...] for for shell and ~(E) patterns has
+	  been fixed.
+10-11-22  A patch was made to pfsh to handle an error case.
+10-11-22 +Modified types defined in namespace so that they do not clash with
+	  types in other namespaces.  Types can be referenced using
+	  .namespace.typename.
+10-11-22  A bug which caused functions addressed as .namespace.funct to not
+	  work has been fixed.
+10-11-22  A bug in which if nr was a name reference to an unset associative
+	  array subscript, then ${!nr} did not output the subscript correctly
+	  has been fixed.
+10-11-18  A bug in which shcomp -n was not processing double quotes correctly
+	  has been fixed.
+10-11-18  Fixed a bug in which typeset -T foo; typeset -T could cause a
+	  core dump.
+10-11-17  Fixed a bug in which the error message for set -u could come out
+	  garbelled.
+10-11-17  Modified the parser so that typeset -a var=(...) no longer checks
+	  the first index for aliases and reserved words.
+10-11-17  A bug in which a subshell command consisted of only a for or until
+	  command has been fixed.
+10-11-16  Fixed a bug in which typeset -u would display namespace variables
+	  as well as upper case variables.
+10-11-16  A bug which could cause a core dump when unsetting a type variable
+	  when there are references to type elements has been fixed.
+10-11-15  A bug which could cause a core dump when unsetting a compound
+	  array variable when there are references to array subscripts has
+	  been fixed.
+10-11-15  A bug in which using typeset -m to move an indexed array instance
+	  to another array could cause the array to display incorrectly has
+	  been fixed.
+10-11-12  A bug in which the unset discipline function for a type is called
+	  when the type is initialized has been fixed.
+10-11-12  The sequences \< and \> are now preserved after patterns containing
+	  ~(E) in ${var/pattern/string} expansions.
+10-11-11  A bug in typeset -m when the variables were compound arrary instances
+	  has been fixed.
+10-11-10  A bug in output of a compound variable with types containing types
+	  has been fixed.
+10-11-10  Fixed ``name=value export [-p]'' to list environment.
+10-11-09  shtests resets SIGPIPE to SIG_DFL for all tests.
+10-11-09  Fixed a bug in expansion of $"..." when used in assignments.
+10-11-09  Fixed a getaddrinfo() memory leak that didn't call freeaddrinfo()
+	  after an interrupt.
+10-11-08  Modified the behavior of set -u so that the shell terminates with
+	  error message when when var is unset with ${!var} and ${#var}.
+10-11-02  Fix a bug in which a signal received while in a subshell could be
+	  ignored.
+10-10-26  Fix a bug where terminal interrupt was ignored while in vi/emacs
+	  edit search mode.
+10-10-26  Fix $'a b'c to expand to 'ac'.
+10-10-26  Provide user defined round() if not in <math.h>.
+10-10-26  Fix bug where $((undefined_function(1))) dumped core.
+10-10-22  Provide user defined iszero() if not in <math.h>.
+10-10-22  Fixed a bug with BGX compile option that could cause the shell to
+	  hang.
+10-10-22  Fixed a bug with user define math function on systems for which
+	  char is unsigned.
+10-10-21  A bug in which function autoloaded in a function leaves a file open
+	  has been fixed.
+10-10-20  Modified the behavior of set -u so that the shell terminates when
+	  when var is unset with ${var op string} when op is #, % or /.
+10-10-20  Fixed a bug with the AUDIT option in which the audit file was not
+	  not close-on-exec.
+10-10-20 +Made a number of changes and fixes for the NAMESPACE compile option
+	  which as added on 10-06-09 but some problems still remain.
+10-10-15  Fixed a bug in which arithmetic functions (added on 10-03-24) did
+	  not work when the function definition was in the same compound
+	  command in which the function was referenced.
+10-10-13  A bug in which creating an associative array of compound variables
+	  with no members as an element of a compound variable did not work
+	  has been fixed.
+10-10-08  A bug in which killing the last command in a function defined
+	  with function name, terminated the calling script has been fixed. 
+10-10-08  A bug which could cause a core dump if IFS is unset inside a function
+	  has been fixed.
+10-10-07 +To reduce unwanted side effects, invoking typeset without the export
+	  option and without an assignment now causes the variables to be unset
+	  if the variable is inherited from the environment.
+10-10-06  The closing brace for ${ command } is now a token no matter what
+	  character follows it.
+10-10-04  The change for $'...' expansion on 10-08-09 did not expand parameters
+	  contained in the error message and this has been fixed.
+10-10-04  A bug in which a declaration of indexed array (-a_ in a type
+	  definition would be displayed as a compound indexed array (-C -a)
+	  has been fixed.
+10-09-30  The C99 math function ldexp has been added.
+10-09-30  A bug with two dimensional arrays with expansion of the form
+	  ${ref[0..5]} where ref is a nameref to array[i] has been fixed.
+10-09-29  A bug in which an eval with redirections invoked from a dot script
+	  would not restore the file has been fixed.
+10-09-29  A bug in which loading a function from FPATH could leave a file
+	  descriptor open has been fixed.
+10-09-28 +A new compile option SHOPT_FIXEDARRAY has been added and is being
+	  evaluation.  It allows fixed sized indexed arrays be to defined
+	  using "typeset array[dim1][dim2]...[dimn]".  Fixed sized arrays
+	  are used the same way indexed arrays are.  Currently, only fixed
+	  arrays of fixed objects (float, int, and justifies objects) are
+	  supported.
+10-09-22  A bug which could cause an exception when a function with static
+	  variables was redefined has been fixed.
+10-09-21  A bug in the processing of (command&) which created a job in the
+	  parent process has been fixed.
+10-09-21  A for loop optimization bug with arithmetic expression evaluation
+	  has been fixed.
+10-09-21  A bug in which a recursive function containing a pipeline could
+	  lead to an exception fixed after 8 levels of recursion has been
+	  fixed.
+10-09-18  A bug in which the count of elements in an array was wrong leading
+	  to an exception has been fixed.
+10-09-13  A bug which occurred when both xtrace and showme options where
+	  specified in which the xtrace option disabled showme has been fixed.
+10-09-13  A bug in which creating a reference to an array variable with any
+	  elements could cause subsequent array elements to be treated as
+	  compound variables has been fixed.
+10-09-09  A bug which caused ((c.ar[x][y])) to be treated as a syntax error
+	  has been fixed.
+10-09-08  A bug in the processing of references to multidimensional arrays
+	  in arithmetic expressions has been fixed.
+10-09-08  A bug in the handling of multi-dimensional arrays which caused
+	  the number of elements in each dimension to be incorrect has
+	  been fixed.
+10-09-07  The change for messages on 10-08-09 did not handle message in
+	  assignments and this has been fixed.
+10-09-07  A bug in the indentation of compound variables in arrays when
+	  output with print -v has been fixed.
+10-09-07  A rare bug with indexed arrays when assigned a null string that could
+	  cause a core dump has been fixed.
+10-09-03  A number of changes were made for jobs pools.
+10-08-31  typeset -p was modified to output name references after other
+	  variables so that the output could be used as input.
+10-08-31  A bug with typeset -p in which variables with attributes but
+	  without attributes were not displayed correctly has been fixed.
+10-08-27 +When running a subshell, the current pool is unset.
+10-08-27  A bug in which jobs started from within for or while lists in
+	  interactive shells could generate completion messages has been fixed.
+10-08-25  Fixed a couple of bugs related to job pools. 
+10-08-24 +[[ -e /dev/xxx/ ]] can be used to check whether special files of
+	  those names are handled by the shell.
+10-08-24  A bug in the running of a compiled dot script in which only the
+	  first command was executed has been fixed.
+10-08-23  A bug which sometimes caused a core dump with a configure script
+	  has been fixed.
+10-08-20  A bug in command substitution which caused a configure script to
+	  hang has been fixed.
+10-08-19  Eliminated unnecessary ; from output of compound variable with
+	  typeset -p.
+10-08-17  Fixed a bug in command substitution in which under certain
+	  circumstances a file whose size is a power of 2 plus one, and the last
+	  character was not a new-line, could cause memory corruption.
+10-08-13 +Added static discipline functions to type similar to C++ static
+	  class functions.
+10-08-11  A bug in time when applied to a pipeline in which the shell did
+	  not wait for all elements of the pipeline to complete has been fixed.
+10-08-11  Restored sh_fmtq() quoting to not quote NAME= in NAME=VALUE.
+10-08-09 +Modified the expansion of message strings, $"...", so that they
+	  are expanded each time they are referenced rather than expanding
+	  them when the script is compiled or read in.
+10-08-06 +The process id for jobs in job pools is now of the form poolname.n
+	  where n is the jobid in that pool.  Commands that accept job names
+	  or numbers now understand names in this format.
+10-08-05  A bug in which an assignment from within an arithmetic expression
+	  inside a function would create a local variable has been fixed.
+10-08-04  A bug in the expanding of variables whose names contain multibyte
+	  characters has been fixed.
+10-08-04  A bug which caused an exception when processing scripts compiled
+	  with shcomp -n has been fixed.
+10-08-02  Tests using very small buffer sizes uncovered a number of bug most
+	  connected with here documents which have been fixed.
+10-07-27  The format modifier , used for digit grouping with d and f formats
+	  has been documented.
+10-07-26  cd '' now produces and error rather than changing to the current
+	  directory.
+10-07-26  A bug in multi-byte locales which the last character of a
+	  multi-byte character is a  or pattern character which could occur
+	  when the character was the last character of a command substitution
+	  has been fixed.
+10-07-23  Another bug in the processing of ${var:offset;len} in multi-byte
+	  locales when len is larger than the number of characters has been
+	  fixed.
+10-07-23  Many coding changes have been made to eliminate most of the uses
+	  of global variables in the shell code.
+10-07-22  Fixed a bug in which discipline functions were not being invoked
+	  when it was invoked as ref.discipline where ref was a name reference
+	  to an array instance.
+10-07-22  Fixed a bug in which discipline functions were not being invoked it
+	  was invoked on a two dimensional array, i.e., arr[5][9].discipline.
+10-07-19  Fixed a buffering problem which occurred when running a script with
+	  ssh and the parent ssh process is killed.
+10-07-14  Modified the parser to treat ((...)) inside [[...]] as ( (...) ) to
+	  that it is a nested (...).
+10-07-09  A bug in the handling of process substitution inside command
+	  substitution as part of a pipeline has been fixed.
+10-07-07  A bug in the output for compound variables containing
+	  multi-dimensional arrays has been fixed.
+10-07-06  ksh now recovers from changes made by bash to the history file without
+	  loosing history commands.
+10-06-25  A bug in which a large here document containing command substitutions
+	  of a dynamically loaded function that contained a here document
+	  could get truncated has been fixed.
+10-06-24  If after executing a script found in FPATH, if a function, builtin,
+	  or type name corresponding to that script is not defined, the shell
+	  now outputs an error message and returns value 126.
+10-06-23  Floating point functions that happened to return integer values
+	  were being treated as if the function returned integers so that
+	  integer division could be used instead of floating point division.
+10-06-22  Fixed a bug in earlier ksh93u in which an arithmetic assignment to a
+	  variable in the global scope would instead create a local variable if
+	  the variable had an attribute but did not have a value.
+10-06-18  Modified trap handling so that if the same signal is received when
+	  executing the handler, it is deferred until the handler completes.
+10-06-16  Fixed a bug in which ulimit -v was setting the the cpu limit
+	  on Linux.
+10-06-14 +The command 'typeset -T' now generates the list of type definitions
+	  in a format that can be used as input to the shell.
+10-06-09  Put in patch from Solaris for output quoting with %q.
+10-06-09 +Made changes to the NAMESPACE compile option so that it now seems
+	  to work.  With this option, namespace <name> { command;} will
+	  run command in the namespace .name so that all variables and
+	  functions created by command are accessible outside the name
+	  space via .name.var and .name.fun.  Variables and functions that
+	  are not in the namespace are not modified when running command.
+10-06-07  Change most internal interfaces to take Sh_t* argument.
+10-06-03 +Types can be loaded on first reference by putting definitions in
+	  PFPATH.
+10-06-03 +The shell is now able to parse commands which use type statements
+	  before the typeset -T command to define the type executes.
+10-06-03  A bug in the quoting for name reference declarations which did
+	  not properly handle [ and ] in subscripts for associative arrays.
+10-06-02  A bug in which a discipline function defined by a type instance to
+	  override the default was not being registered has been fixed.
+10-06-02  A bug in which read -C of an associative array of compound variables
+	  was not working has been fixed.
+10-06-02  A bug in which the error message for an unset parameter with set -u
+	  did not contain the name of the variable has been fixed.
+10-06-01  A bug in typeset -m for moving an indexed array instance to a variable
+	  has been fixed.
+10-06-01  A bug in which caused memory to be freed twice when unset was called
+	  for an indexed array that had get or set disciplines has been fixed.
+10-06-01  A bug in which the %b format of printf was not preserving NUL bytes
+	  with   has been fixed.
+10-06-01  A bug in the handling of name references to array variables in
+	  arithmetic expressions has been fixed.
+10-05-28  Fixed bugs in changing attributes for two dimensional arrays.
+10-05-28  Eliminated a few unreferenced variables and a reference to
+	  uninitialized memory.
+10-05-27  Rewrote the subshell code to avoid using pipes an many cases.
+10-05-24  Fixed a bug which cause an exception when both -l and -s were
+	  specified with typeset -i.
+10-05-21  Inputting of three dimensional indexed arrays with ( ( (...)...)...) 
+          was not working and has been fixed.
+10-05-21  A bug in which adding the attributes -Ai to a variable via a name
+	  reference could cause the value to display incorrectly has been fixed.
+10-05-21  A bug in which using $var inside ((...)) did not work when var was
+	  a hex float variable.
+10-05-20 +The compile option SHOPT_EDPREDICT has been added.  When this option
+	  is on, as you type a line beginning with a # the following characters
+	  are treated as a shell pattern and cause matching lines from the
+	  history file to be displayed as a numbered list as you type.
+	  You can scroll up and down this list or you can use <ESC>nTAB
+	  to make this the current line (n defaults to 1 of omitted) or
+	  <ESC>n<cr> to execute.
+10-05-20  A bug which caused an exception when multiple levels of composite
+	  functions in arithemtic expressions has been fixed.
+10-05-19  <<< with an empty string no longer gives an error.
+10-05-19  A bug in arithmetic evaluation when a name reference to an array
+	  instance was used has been fixed. 
+10-05-14  A bug in which the shell treats a valid index array assignment,
+	  typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed.
+10-05-13  A bug in creating name references to associative array variable
+	  after a lookup of one of its elements has been fixed.
+10-05-12  Two bugs in the handling of function static type variables in
+	  subshells have been fixed.  One could cause an exception and the
+	  other would leave side effects in the parent shell.
+10-05-10  A bug in which static variables in functions were not being saved and
+	  restored properly when running subshells has been fixed.
+10-05-05  A bug in which print -v did not work correctly when an operand was an
+	  indexed array element referring to a compound variable has been fixed.
+10-05-05  A change to improve performance by special casing empty string
+	  assignments to avoid repeated malloc() and free().
+10-05-05  A bug in which creating a name reference to a non-existent associative
+	  array element would create the array element has been fixed.
+10-05-04  A bug in which name references to static variables in the static
+	  scope were not found has been fixed.
+10-04-30  Do not use socketpair() on systems that implement ioctl(I_PEEK)
+	  on pipes.
+10-04-29 +When the current job pool is set, coprocess are run in a job pool.
+10-04-28  A type defined with a member foo that is an associative array without
+	  elements followed by an expansion ${bar.foo[a]} and an assignment
+	  bar.foo[a]=b, no longer indicates that ${#bar.foo[@]} has 0 members.
+10-04-27  Another bug in which a nested command substitution could hang if it
+	  generated too much data has been fixed.
+10-04-26  A type defined with a member that is an indexed array without elements
+	  would behave as if the 0th element of each instance was defined after
+	  a non-zero element was specified and this has been fixed.
+10-04-26  A bug in which types defined in a subshell were not undefined when
+	  the subshell completed has been fixed.
+10-04-23  For file completion in commmand line editing, file names starting
+	  with # are now escaped so that they are not treated as comments.
+10-04-23  A bug in which ${t.var:=value}, where t is an instance of a type
+	  variable, could assign value to the type variable rather than to
+	  the type instance has been fixed.
+10-04-23 +Added &| which can be used in place of | to have portions of a
+	  pipeline executed in the pool.
+10-04-22 +The .sh.pool variable was added for use with job pools.
+10-04-22  A bug in which a nested command substitution could hang if it
+	  generated too much data has been fixed.
+10-04-20  A bug which corrupted one byte of memory when read was called with
+	  reads that did not use a delimiter has been fixed.
+10-04-19  The display of a compound variable with an embedded array with
+	  attributes was sometimes not working correctly and has been fixed.
+10-04-16  A bug in which attributes were not be propagated to elements in
+	  an associative array has been fixed.
+10-04-15  A bug which caused scripts containing user defined math functions to
+	  fail to compile with shcomp has been fixed.
+10-04-15 +Job pools have been added with the SHOPT_COSHELL compilation option.
+	  A job pool allows a collection of background jobs to run either locally 
+	  or remotely and to be managed as a unit.  The command '& name ...'
+	  creates or uses a named job pool for subsequent background jobs.
+	  kill, wait, and jobs allow the pool name as operands.
+10-04-14  A bug in which a coprocess connection could terminate prematurely
+	  when running a nested subshell has been fixed.
+10-04-12 +Enumeration constants can be used in arithmetic expressions with the
+	  ==, != and = operators when the left hand side is an enum variable
+	  and the right hand side is an enumeration constant.
+10-04-07  A bug in which setting the trap on CHLD to ignore could cause
+	  an incorrect exit status has been fixed.
+10-04-06  A bug in which LINENO was not incremented for a here-document when
+	  the here-document word was followed by a comment has been fixed.
+10-04-06  The optimization that execs the last process of a script rather
+	  than creating a new process has been removed when a trap on
+	  interrupt has been set.
+10-04-06  Unsetting the 'C', 'A' or 'a' typeset attribute now produces an
+	  error message rather than generating an exception.
+10-04-06  A bug in which .sh.name contained the subscript and .sh.subscript
+	  was empty in some cases with discipline functions on array instances
+	  has been fixed.
+10-04-05  A bug in the edit modes where preceding the interrupt character with
+	  the literal next character did not work has been fixed.
+10-04-05  A bug in the creation of type instances of arrays which could cause
+	  an exception has been fixed.
+10-03-30  A bug in the display of a compound variable containing an indexed
+	  array of compound variables has been fixed.
+10-03-24 +Arithmetic functions can be defined using the shell function syntax,
+	  'function .sh.math.name x y z{...}' , where name is the function name
+	  invoked within ((...)) and x y z are long double arguments passed
+	  as name references.  y and z are used for functions with two and
+	  three arguments respectively.  The value of the function is the value
+	  of the long double .sh.value variable when the function returns.
+10-03-24  A bug in which integer division was mistakenly used when the
+	  numerator was a binary operator with the first operand floating
+	  point and the second integer, e.g. (.1**3)/3, has been fixed.
+10-03-24  The >; file operator was modified so that the temporary file is
+	  created in the same physical directory as file.
+10-03-23  A warning message was added to sh -n when $var was used inside
+	  ((...)) instead of var.
+10-03-19  fmin was added to the list of math function on the man page.
+10-03-19  Fixed the return value for unalias when the alias did not
+	  exist.
+10-03-19  A bug in which the SHLVL variable exported the value it had on
+	  input rather than the incremented value has been fixed.
+10-03-19  A bug which causes whence -q to go into an infinite loop has been
+	  fixed.
+10-03-19  Removed space between Stopped message and (SIGTTIN) and (SIGTTOUT).
+10-03-17  Modified profile shell execution so that when builtins that
+	  correspond to executable have extended attributes, they are
+	  executed by pfksh instead of being treated as built-ins.
+10-03-16  A bug in whence -a which produced duplicate lines of output has
+	  been fixed.
+10-03-16  A bug in the handling of process groups in monitor mode for
+	  command substitutions has been fixed.
+10-03-15  Fixed a bug in which read -u[fd] could cause the shell to core
+	  dump when fd was greater than open_max.
+10-03-15 +Modified the shell I/O so that the shell will not fail if the
+	  ulimit for open_max is increased as part of the script.
+10-03-12  A bug in which a here-document containing command substitutions
+	  that contained here-documents did not process correctly has been
+	  fixed.
+10-03-12  A bug in which the terminal is not restored to canonical mode
+	  after read times out when in a multibyte locale with no edit mode
+	  enabled has been fixed.
+
+10-03-05  --- Release ksh93t+  ---
+10-03-05  A variable unset memory leak has been fixed and tests/leaks.sh
+	  has been added to verify the fix.
+10-03-04  Documentation, comment, and diagnostic spelling typos corrected.
+10-02-14  Fix sh_getenv() initialization to cooperate with the 3d fs.
+10-02-12  A bug in which the get discipline function was not invoked for
+	  associative array subscripts for unset array elements has been fixed.
+10-02-12  A bug which could occur if the last line of a script was an eval
+	  that executed multiple commands has been fixed.
+10-02-02  A buffer overflow in read and another in binary type base64
+	  encoding were fixed.
+10-01-20  A bug in the evaluation of arithmetic expression in which the
+	  subscript was evaluated twice for $((foo[x++]++)) has been fixed.
+10-01-19  A workaround for a double-free of a trap in both a subshell and its
+	  parent has been added.
+10-01-18  A bug in type handling of typeset -H has been fixed.
+10-01-15  The "adding empty subscript" warning now only emitted with -x set.
+10-01-01  A bug in the parser in which '$((case i in i):;esac);:))' was not
+	  parsed correctly was fixed.
+10-01-01  A bug in the parser in which '$(( 2 , 3.6 ))' dumped core for locales
+	  with radix char , and thousands separator . has been fixed.
+09-12-28  A bug in the handling of SIGCLD on systems that generated SIGCLD
+	  while blocked waiting for process to complete has been fixed.
+09-12-24  ast setlocale() reworked to differentiate env var changes from user
+	  override.
+09-12-18  A bug with the SHOPT_BGX option set which disabled traps for signals
+	  < SIGCHLD when a trap for a signal > SIGCHLD was set has been fixed.
+09-12-18  A bug where [[ -v var ]] was incorrect for some variables (including
+	  LC_* vars) has been fixed.
+09-12-15  A bug that produced a syntax error when a multibyte character
+	  straddled a buffer boundary has been fixed.
+09-12-11  A bug where the subscript of an unset variable was not evaluated has
+	  been fixed.
+09-12-09  A bug where shcomp dumped core on certain syntax errors has been fixed.
+09-12-07  A bug where a parent shell environment var reset in a subshell removed
+	  the value in subsequent children of the parent shell has been fixed.
+09-12-04  A bug in which in some cases a trap in a function executed in
+	  a subshell could trigger twice has been fixed.
+09-12-03  A bug in which SHLVL exported with some attributes could cause
+	  the shell to abort at startup has been fixed.
+09-12-02  A bug with pipefail in which the shell could hang waiting for the
+	  writer to complete before the last reader command has been fixed.
+09-11-30  A bug in which a trap could be inherited by the first element of
+	  a pipeline when the command had more than 63 arguments that did
+	  not contain any macro expansions has been fixed.
+09-11-19  When read from a terminal was called from with a while or for loop,
+	  and an edit mode was on, a backspace or erase no longer will
+	  overwrite the prompt.
+09-11-17 +Change .paths parse to handle BUILTIN_LIB=foo BUILTIN_LIB=foo-1.2.
+09-11-17  Inside a function, typeset foo.bar will bind foo to global variable
+	  foo if local variable foo does not exist, instead of creating a 
+	  local variable.
+09-11-17  "read -n1" from the terminal has been fixed to read exactly one character.
+09-11-11  Job control now works for subshell commands, (...).
+09-11-11  If set -e is on for an interactive shell errors in special builtins
+	  now cause the shell to exit.
+09-11-11  A bug in which an interrupt handler processed during the read builtin
+	  when IFS did not contain a new line has been fixed.
+09-11-09  A bug in which a variable that has been unset in a subshell and then
+	  exported from that subshell does not show up in the environment
+	  has been fixed.
+09-11-02  ``,2'' is now a valid numeric constant for locales with
+	  decimal_point=','.
+09-11-02  A bug where "return" in .profile did not restore the shell state
+	  has been fixed.
+09-10-31  A bug that corrupted saved exit status when pids wrapped around has
+	  been fixed.
+09-10-26  A bug in { LANG LC_ALL LC_category } ordering has been fixed in -last.
+09-10-16  A bug where notification to libast that the environment has changed
+          has been fixed.
+09-10-12  A bug in which a function loaded in a subshell could leave side
+	  effects in the parent shell has been fixed.
+09-10-12  A bug in converting a printf %d operand to a number when the operand
+	  contains multiple subscripts for the same variable has been fixed.
+09-10-09  A bug in the handling of the escape character  in directory prefixes
+	  in command completion has been fixed.
+09-10-09  $PATH processing has been changed to delay dir stat() and .paths
+	  lookup until the directory is needed in the path search.
+09-09-28  Call the ast setlocale() intercept on unset too.
+09-09-24  A bug in which LANG=foo; LC_ALL=foo; unset LC_ALL; did not revert
+	  LC_CTYPE etc. to the LANG value has been fixed.
+09-09-17  A bug in which unsetting SVLVL could cause a script invoked by
+	  name without #! to core dump has been fixed.
+09-09-16  A bug in which a pipeline in a here-document could hang when the
+	  pipefail option was on has been fixed. 
+09-09-09  A bug in the processing of line joining in here documents which
+	  occurred when a buffer began with <escape><new-line> has been fixed.
+09-09-09 +A leading ; with commands in a brace group or parenthesis group
+	  no longer causes an error.  It now is used for the "showme" option.
+09-09-09  A bug in which a subshell containing a background process could
+	  block until the background process completed has been fixed.
+09-09-04  A bug in handing ${var[sub]}, where var is a nameref has been fixed.
+09-09-03  A bug which caused an index array to have the wrong number of elements
+	  when it was converted from a compound variable by adding an another
+	  element has been fixed.
+09-09-03  Specifying export for a compound variable now generates an error.
+09-09-02  $"..." localizations strings are no longer recognized inside `...`.
+09-09-01  A bug in the for loop optimizer in the handling of type static
+	  variables has been fixed.
+09-09-01  An error message is not displayed when * and @ are used as subscripts.
+09-09-01  Several bugs in the processing for types that included an associative
+	  array of another type has been fixed.
+09-09-01  A bug in the tracing of [[ a < b ]] and [[ a > b ]] has been fixed.
+09-08-26  The .sh.file variable was not being set for a script that was run
+	  by name and didn't start with #! and this has been fixed.
+09-08-25  A bug in which a function called to deeply from command substitution
+	  did not display an error message has been fixed.
+09-08-24 +When processing profiles, ksh93 now violates the POSIX standard and
+	  treats &> as a redirection operator similar to bash.
+09-08-23  A bug in the handling of the trap on SIGPIPE that could lead to a
+	  memory fault has been fixed.
+09-08-21  A bug in the handling of the comma operator in arithmetic expressions
+	  that could cause a core dump on some systems has been fixed.
+09-08-20  A bug in which a compound variable containing an array of a type
+	  that doesn't have any elements now expands correctly.
+09-08-19  A bug which disabled function tracing inside a function after
+	  a call to another function has been fixed.
+09-08-19  A bug in which initializing a compound variable instance to another
+	  compound variable by name has been fixed.
+09-08-18  A bug in which compound variable instances could be lost after
+	  an instance that invoked a type method discipline has been fixed.
+09-08-18  A bug in which a discipline function for a type applied to an
+	  array instance when invoked in a function ignored the subscript
+	  has been fixed.
+09-08-18  A scoping error with variables in arithmetic expression with
+	  type variables when reference with a name reference has been fixed.
+09-08-10  Several memory leaks were fixed primarily related to subshells.
+09-08-06  A bug in which setting the trap on CHLD to ignore could cause
+	  a script to hang has been fixed. 
+09-07-08  A bug in the processing of name reference assignments when it
+	  contained pattern expansions with quoting has been fixed.
+09-06-22 +The default width for typeset -X has been changed so that there
+	  should be no loss of precision when converting to a string.
+09-06-19  A bug in the printing of array elements for binary variables with
+	  printf %B has been fixed.
+09-06-19  A bug which caused a core dump with trap DEBUG set with an array
+	  assignment with no elements has been fixed.
+09-06-19  A bug with read with typeset -b -Z<num> has been fixed.
+09-06-19  Two bugs related to read -b for array variables has been fixed.
+09-06-19  A bug with typeset for compound variables containing arrays of
+	  compound variables has been fixed.
+09-06-18  A bug in appending a compound variable to a an indexed array of
+	  compound variables has been fixed.
+09-06-18  A bug which occurs when appending a compound variable to an indexed
+	  array element has been fixed.
+09-06-18  Setting VISUAL to a value other than one ending in vi or emacs will
+	  no longer unset the edit mode.
+09-06-17  A bug in typeset -m when moving a local compound variable to a
+	  global compound variable via a name reference has been fixed.
+09-06-17  A bug in appending to nodes of an array of compound variables when
+	  addressing them via nameref has been fixed.
+09-06-17  A bug in typeset -p var, when var is an array of compound variables
+	  in which the output only contained on array element has been fixed.
+09-06-17  The prefix expansion ${!y.@} now works when y is a name
+	  reference to an element of an array.
+09-06-16  Traps on signals that are ignored when the shell is invoked
+	  no longer display.  Previously they were ignored as required but
+	  would be listed with trap -p.
+09-06-12  A bug in vi edit mode in which hitting the up arrow key at the
+	  end of a line longer than 40 characters which caused a core dump
+	  has been fixed. 
+09-06-11  A bug in which "eval non-builtin &" would create two processes,
+	  one for the & and another for non-builtin has been fixed.
+09-06-08  When var is an identifier and is unset, ${var} no longer tries to
+	  run command substitution on the command var.
+09-06-08 +Process substitution arguments of the form <(command) can now be
+	  used following the < redirection operator to redirect from command.
+09-05-13  A bug in which redirections of the form 2>&1 1>&5 inside command
+	  substitution could cause the command substitution to hang has been
+	  fixed.
+09-05-12  To conform with POSIX, the -u option only checks for unset variables
+	  and subscript elements rather than checking for all parameters.
+09-05-12  A bug which could cause a core dump when a variable whose name
+	  begins with a . was referenced as part of a name reference inside
+	  a function has been fixed.
+09-05-01  A bug that caused a core dump when SIGWINCH was received and
+	  both vi and emacs mode were off has been fixed.
+09-04-22 +Default alias compound='typeset -C' added.
+09-04-15  A bug that caused ${...;} to hang for large files has been fixed.
+09-04-08  A change was made in the -n option which printed out an incorrect
+	  warning with <>.
+09-04-07  The emacs edit command M-_ and M_. and the vi command _ was fixed
+	  to handle the case there there is no history file.
+09-04-05  A bug in handling new-lines with read -n has been fixed.
+09-04-05  The ENV variable defaults the the file named by $HOME/.kshrc rather
+	  then to the string $HOME/.kshrc.
+09-03-31  A bug in which a nested command substitution with redirections could
+	  leave a file descriptor open has been fixed.
+09-03-24 +ksh now only uses the value of the _ variable on startup if it can
+	  verify that it was set by the invoking process rather than being
+	  inherited by some other ancestor.
+09-03-24 +When ksh is invoked without -p and ruid!=euid, and the shell is
+	  compiled without SHOPT_P_UID or ruid<SHOPT_P_UID, the shell now
+	  enables the -p option.  The previous version instead set the
+	  euid to the ruid as it does for set +p.
+09-03-24 +When SHOPT_P_UID is defined at compile time and the shell is started
+	  without -p and ruid!=euid and ruid>=SHOPT_P_UID then euid is set
+	  to ruid. A bug that did the wrong test (ruid<SHOPT_P_UID) was fixed.
+09-03-17 +The sleep(1) builtin now accept and ISO 8601 PnYnMnDTnHnMnS
+	  duration or date(1) compatible date/time operand.
+09-03-10  If a variable that was left or right justified or zero-filled was
+	  changed with a typeset statement that was left or right justified
+	  or zero-filled, then the original justification no longer affects
+	  the result.
+09-03-10  A bug in the handling of traps when the last command in a script
+	  is a subshell grouping command has been fixed.
+09-03-03  A bug in which an expansion of the form ${!prefix@} could generate
+	  an exception after the return from a function has been fixed.
+09-02-02  A bug in restricted mode in which the value of ENV could be
+	  changed from within a function has been fixed.
+09-02-02  A bug in which an erroneous message indicating that a process
+	  terminated with a coredump has been fixed.
+09-02-02  The exit status when exit was called without an argument from
+	  a signal handler was incorrect and has been fixed.
+09-02-02  A bug in which a function autoloaded in a subshell could cause
+	  a core dump when the subshell completed has been fixed.
+09-02-02  A bug in which 2>&1 inside a command substitution wasn't working
+	  correctly has been fixed.
+09-02-02  A bug in the call stack of arithmetic function with 2 args
+	  returning int has been fixed.
+09-01-30  A bug in which 'eval print \$0' inside a function was giving the
+	  wrong value for $0 has been fixed.
+09-01-28  A bug in which a command substitution could return an exit status
+	  of 127 when the pipefail option is enabled has been fixed.
+09-01-26  ksh93 now generates an error message if you attempt to create
+	  a global name reference to a local variable.
+09-01-26 +The [[ -v var ]] operator was modified to test for array elements.
+09-01-23 +The redirection operator <>; was added.  It is similar to <>
+	  except that if the command it is applied to succeeds, the file
+	  is truncated to the offset at the command completion.
+09-01-23  The default file descriptor for <> was changed to 1.
+09-01-20  A bug in which the exit status specified in an exit trap was
+	  not used when a process terminated with a signal has been fixed.
+09-01-19  A bug in which a signal whose default action is to terminate
+	  a process could be ignored when the process is running a sub-shell
+	  has been fixed.
+09-01-19  A bug in which sending SIGWINCH to a process that reads from a pipe
+	  could cause a memory fault has been fixed.
+09-01-16 +The -R unary operator was added to [[...]] and test to check whether
+	  a variable is a  name reference.
+09-01-16 +The -v unary operator was added to [[...]] and test to check whether
+	  a variable is set.
+09-01-14  The unset built-in was modified to return 0 exit status when
+	  unsetting a variable that was unset to conform with the POSIX
+	  standard.
+09-01-14  The unset built-in was modified to continue to unset variables
+	  after encountering a variable that it could not unset to
+	  conform to the POSIX standard.
+09-01-14  The parameter expansion ${x+value} no longer expands the value of
+	  the variable x when determining whether x is set or not.
+09-01-13  A bug in which background jobs and pipelines that were not waited
+	  for could, in rare instances, cause the shell to go into an infinite
+	  loop or fail has been fixed.
+09-01-06  A bug in indexed arrays of compound variables in which referencing
+	  non-existent sub-variable in an arithmetic expression could cause
+	  the sub-variable to be created has been fixed.
+09-01-05  A bug in which the  character did not escape extended regular
+	  expression pattern characters has been fixed.
+08-12-24  A bug in which killing the last element of a pipe did not cause
+	  a write to the pipe to generate a SIGPIPE has been fixed.
+08-12-19  A bug which could cause command substitution to hang when the
+	  last element of a pipeline in a command substitution was a built-in
+	  and the output was more that PIPE_BUFF.
+08-12-18  A bug which occurs when a here documented marker embedded in a
+	  command substitution occurs on a buffer boundary has been fixed.
+08-12-17  A bug in the output of typeset -p for variables that had attributes
+	  but did not have a value has been fixed.
+08-12-16  A bug in which a name reference to a name reference variable that
+	  references an array element has been fixed.
+08-12-16  A bug in which a variable given both the -A and -C attribute along
+	  with an initial assignment didn't work correctly has been fixed.
+08-12-10  The [[ -t fd ]] test was fixed to handle fd>9.
+08-12-10  A bug where function stack misalignment could cause a bus error
+	  has been fixed.
+08-12-09  Command completion was changed to use  to quote special characters
+	  instead of quoting the argument in single quotes.
+08-12-07  A bug in typeset -m which occurred when the target node was an
+	  associative array element has been fixed.
+08-12-07  A timing bug on some systems (for example darwin), that could
+	  cause the last process of a pipeline entered interactively to fail
+	  with an "Exec format error" has been fixed.
+08-12-04 +SHOPT_BGX enables background job extensions. Noted by "J" in
+	  the version string when enabled. (1) JOBMAX=n limits the number
+	  of concurrent & jobs to n; the n+1 & job will block until a
+	  running background job completes. (2) SIGCHLD traps are queued
+	  so that each completing background job gets its own trap; $! is
+	  set to the job pid and $? is set to the job exit status at the
+	  beginning of the trap. (3) sleep -s added to sleep until the time
+	  expires or until a signal is delivered.
+08-12-04  The sign of floating point zero is preserved across arithmetic
+	  function calls.
+08-12-04  A bug that caused print(1) to produce garbled stdout/stderr
+	  output has been fixed.
+08-12-04  A bug in which printf "%d "'<euro>'" did not output the
+          numerical value of the EURO symbol, 8354, has been fixed.
+08-11-24 + /dev/fd* and /dev/std* redirections are first attempted with
+	  open() to preserve seek semantics; failing that the corresponding
+	  file descriptors are dup()'d.
+08-11-20  A bug which could cause a core dump if a function compiled with
+	  shcomp was found has been fixed.
+08-11-20  A bug in which jobs were not cleared from the jobs table for
+	  interactive shells when the pipefail option is on has been fixed.
+08-11-11  A bug in which a field that was unset in a type definition and later
+	  set for an instance could appear twice when displaying the variable
+	  has been fixed.
+08-11-11  A bug in which running a simple command & inside a function would
+	  not return the correct process id has been fixed.
+08-11-10  A bug in which the exit status of a command could be lost if the pid
+	  was that of the most recent command substitution that had completed
+	  has been fixed.
+08-11-10  The maximum depth for subshells has been increased from 256 to 65536.
+08-11-06  A bug which could cause a core dump when the _ reference variable was
+          used as an embedded type with a compound assignment has been fixed.
+
+08-10-31  --- Release ksh93t  ---
+08-10-31  Variable scoping/initialization bugs that could dump core were fixed.
+08-10-24  The lexer now accepts all RE characters for patterns prefixed
+	  with a ksh ~(...) option expression.
+08-10-24 +For ${var/pat/sub}   in sub expands to the text matched by pat.
+08-10-18  A bug in array scoping that could dump core has been fixed.
+08-10-10  read -n and -N fixed to count characters in multibyte locales.
+08-10-10  A bug that mishandled _.array[] type references has been fixed.
+08-10-09 +${.sh.version} now contains a concatenation of the following (after
+	  'Version') denoting compile time features:
+		A	SHOPT_AUDIT
+		B	SHOPT_BASH
+		L	SHOPT_ACCT
+		M	SHOPT_MULTIBYTE
+08-10-09  A bug that caused subshell command substitution with redirection
+	  to hang has been fixed.
+08-10-08  Output errors, other than to stderr, now result in a diagnostic.
+08-10-08  ksh93 now supports types that contain arrays of other types as
+	  members.  Earlier versions core dumped in this case.
+08-10-05  A bug which caused the shell to emit a syntax error for an arithmetic
+	  statement of the form (( var.name[sub] = value)) has been fixed.
+08-10-01  A bug that caused subshell command substitution to hang has
+	  been fixed.
+08-09-29  When the -p export option of typeset is used with other options,
+	  only those variables matching the specified options are displayed.
+08-09-29  When the shell reads the environment and finds variables that are
+	  not valid shell assignments, it now passes these on to subsequent
+	  commands rather than deleting them.
+08-09-29  A bug in the display of compound variables containing an indexed
+	  array of compound variables has been fixed.
+08-09-29  A bug in the display of compound variables containing an associative
+	  array with a subscript containing a . in the name has been fixed.
+08-09-26  A core dump in the subshell environment restore has been fixed.
+08-09-24  $(...) has been fixed to properly set the exit status in $?.
+08-09-23  $(<...) with IFS=$'n' has been fixed to retain all but the last
+	  of multiple trailing newlines.
+08-09-23  The -p option to typeset when used with other attributes, restricts
+	  the output to variables with the specified attributes.
+08-09-22  A bug that sometimes lost the exit status of a job has been fixed.
+08-09-21  A bug that retained trailing command substitution newlines in
+	  cases where the command caused the shell to fork has been fixed.
+08-09-19  type, whence -v, and command -v were fixed to comply with POSIX
+	  by writing 'not found' diagnostics to the standard error.
+08-09-18  test and [...] were fixed to comply with POSIX in the case
+	  of test '(' binop ')' where binop is a valid binary test operator.
+08-09-16 +If a method discipline named create is specified when defining a
+	  type, this function will be called when an instance is created.
+08-09-15 +The variable _ is now set as a reference to the compound variable
+	  when defining a compound variable or a type.
+08-09-10  The shell now prints an error message when the type name specified
+	  for an indexed array subscript is not an enumeration type.
+08-09-10  A bug in which a subshell that spawned a background process could
+	  loose output that was produced after the foreground completed
+	  has been fixed.
+08-09-10  A timing bug on some systems that could cause coprocesses started by a
+	  subshell to not clean up and prevent other coprocesses has been fixed.
+08-09-09  The typeset -m option is now able to rename array elements from
+	  the same array.
+08-09-09  The exit status of 2 from the DEBUG trap causes the next command
+	  to be skipped.  An exit value of 255 from a DEBUG trap called from
+	  a function causes the function to return. 
+08-09-08  A bug in which a coprocess created in a subshell that did not
+	  complete when the subshell terminated could prevent a coprocess
+	  from being created in the parent shell has been fixed.
+08-09-05  An assignment of the form name1=name2 where name1 and name2
+	  are both compound variables causes name1 to get a copy of name2.
+	  name1+=name2 causes name2 sub-variables to be appended to name1.
+08-09-05  A bug in which unsetting a compound variable did not unset all
+	  the sub-variables has been fixed.
+08-09-01  A bug in the subshell cleanup code that could cause SIGSEGV has
+	  been fixed.
+06-08-26 +The SHLVL variable which is an environment variable used by bash
+          and zsh that gets incremented when the shell starts.
+08-08-25 +For an indexed array, a negative subscript now refers to offsets
+	  from the end so that -1 refers to the last element.
+08-08-24  An alignment error for shorts on 64 bit architectures has been fixed.
+08-08-22  If oldvar is a compound variable, typeset -C newvar=oldvar creates 
+	  newvar as a copy of oldvar.
+08-08-19 +The ALRM signal no longer cause the sleep builtin to terminate.
+08-08-13  When used in an arithmetic expression, the .sh.version variable  
+	  now produces a number that will be increasing for each release.
+08-08-11  A bug in which type instantiation with a compound assignment in
+	  a dot script in which the type is defined has been fixed. 
+08-08-07 +The -m option has been added to typeset to move or rename a
+	  variable.  Not documented yet.
+08-08-06  A bug in read when used in a loop when a prompt was specified
+	  when reading from a terminal has been fixed.
+08-08-01  A bug with the pipefail option in which a nested pipeline could
+	  cause an asynchronous command to block has been fixed.
+08-08-01  A for loop optimizer bug that treats .sh.lineno as an invariant
+	  has been fixed.
+08-07-30  A bug in which expanding compound variable that had a get discipline
+	  from with a here document could cause a syntax error has been fixed.
+08-07-18  A bug in which a nameref caused a local variable to be created
+	  rather than binding to an existing variable in the global scope
+	  has been fixed.
+08-07-17  A bug which occurred when a nameref was created from within a
+	  function that was  part of a pipeline has been fixed.
+08-07-14 +The compile option SHOPT_STATS was added. With this option the
+	  compound variable .sh.stats keeps usage statistics that could help
+	  with performance tuning.
+08-07-10 +The output of set now always uses a single line for each variable.
+	  For array variables, the complete set of values is now displayed.
+08-07-09 +The typeset -C option can be used with arrays to indicate that
+	  each element should default to a compound variable.
+08-07-08 +The %B format now outputs compound variables and arrays.  The
+	  alternate flag # can be used to cause output into a single line.
+08-07-03  When the window change signal, WINCH, is received, the current
+	  edit line is redrawn in place. 
+08-07-01  A bug in the handling of shared variables when inside an embedded
+	  type has been fixed.
+08-06-29  A bug in multiline edit mode which occurred when the prompt length
+	  was three characters or less has been fixed.
+08-06-23  A bug in which the SIGCLD was not be triggered when background
+	  jobs completed has been fixed.
+08-06-23  _KSH_VERSION added as a name reference to .sh.version.
+08-06-20  type now outputs 'special builtin' for special builtins.
+08-06-19  A couple of bugs in multi-dimensional arrays have been fixed.
+08-06-19  A bug in which a syntax error in a dot script could generated
+	  a syntax error in the next subsequent command has been fixed.
+08-06-17  Reduced the maximum function call depth to 2048 to avoid exceptions
+	  on some architectures.
+08-06-16  A bug in which printf "%B" could generate an exception when the
+	  specified variable was not set has been fixed.
+08-06-16 +When typeset -p is followed by variable names, it now displays
+	  the attributes names and values for the specific names.
+08-06-14  A bug that could effect the drawing of the screen from multiline
+	  emacs or gmacs mode when walking up the history file has been fixed.
+08-06-13  A bug in which a compound variable defined in a subshell could
+	  have side effects into the parent shell has been fixed.
+08-06-13  A number of bugs related to using .sh.level to set the stack from
+	  for DEBUG traps have been fixed.
+08-06-13 +The .sh.lineno variable has been added.  When .sh.level is changed
+	  inside a DEBUG trap, the .sh.lineno contains the calling line number
+	  for the specified stack frame.
+08-06-13  The .sh.level variable has been documented and now works.
+08-06-11 +The -C option has been added to read for reading compound command
+	  definitions from a file.
+08-06-11 +The . command is now permitted inside a compound command definition.
+	  The dot script can contain declaration commands and dot commands.
+08-06-09 +Add -C option to typeset so that typeset -C foo, is equivalent
+	  to foo=().
+08-06-09  Added -n warning message for typeset option orderings that are valid
+	  with ksh88 but not valid with ksh93, for example Lx5.
+08-06-09  A bug in which the return value for an assignment command containing
+	  a command substitution with that failed was zero when the assignment
+	  contained redirections has been fixed.
+08-06-09  A bug in the quoting of $ inside a ERE pattern ~(E)(pattern)
+	  has been fixed.
+08-06-06  A bug when processing `` command substitution with the character
+	  sequence \$' has been fixed.
+08-06-02 +When defining a type, the typeset -r attribute causes this field
+	  to be required to be specified for each instance of the type and
+	  does not allow a default value.
+08-06-02  Several bugs in which compound variables were modified by
+	  subshells have been fixed.
+08-05-22 +The ceil function has been added to the math functions.
+08-05-21  A bug in which a name reference defined in a function and passed
+	  as an argument to another function could cause an incorrect binding.
+08-05-21  A bug in freeing compound variables that are local to functions
+	  has been fixed.
+08-05-19 +The array expansions ${array[sub1..sub2]} and ${!array[sub1..sub2]}
+	  to expand to the value (or subscripts) for array between sub1 and
+	  sub2 inclusive.  For associative arrays, the range is based on
+	  location in the POSIX locale.  The .. must be explicit and cannot
+	  result from an expansion.
+08-05-15  The trap on SIGCLD is no longer triggered by the completion of
+	  the foreground job as with ksh88.
+08-05-14  A bug in the implementation of the editing feature added on 
+	  07-09-19 in emacs mode has been fixed.
+08-05-12  A bug in processing the test built-in with parenthesis has been
+	  fixed.
+08-05-12  The unset built-in now returns non-zero when deleting an array
+	  subscript that is not set.
+08-05-08 +Changing the value of HISTFILE or HISTSIZE will cause the old
+	  history file to be close and reopened with the new name or size.
+08-05-08  When FPATH is changed functions that were found via a path search
+	  will be searched for again.
+08-05-08  A parser bug in which reserved words and labels were recognized
+	  inside compound indexed array assignment after a new-line has
+	  been fixed.
+08-05-07  A bug in getopts when handling numerical option arguments has
+	  been fixed.
+08-05-07 +The typeset -S option was added for variables outside type
+	  definitions to provide a storage class similar to C static
+	  inside a function defined with function name.  When outside
+	  type definitions and outside a function, the -S option cause
+	  the specified variable so be unset before the assignment and
+	  before the remaining attributes are supplied.
+08-05-07  A bug that affected the cursor movement in multiline mode when
+	  a character was deleted from near the beginning of the any
+	  line other than the first.
+08-05-01  In multiline edit mode, the refresh operation will now clear
+	  the remaining portion of the last line.
+08-05-01  A bug in computing prompt widths for the edit modes for prompts
+	  with multibyte characters has been fixed.
+08-05-01  A bug in the multiline edit mode which could cause the current
+	  line to be displayed incorrectly when moving backwards from third
+	  or higher line to the previous line has been fixed.
+08-05-01  A bug in which options set in functions declared with the function
+	  name syntax were carried across into functions invoked by these
+	  functions has been fixed.
+08-04-30  A bug which could cause a coprocess to hang when the read end
+	  is a builtin command has been fixed.
+08-04-30 +The emacs and vi editors have been modified to handle window
+	  change commands as soon as they happen rather than waiting for
+	  the next command.
+08-04-28  A bug in which ${!x} did not expand to x when x was unset has been
+	  fixed.
+08-04-27  A bug in which the assignment x=(typeset -a foo=([0]=abc)) created
+	  x.foo as an associative array has been fixed.
+08-04-25  A bug in which $# did not report correctly when there were more
+	  than 32K positional parameters has been fixed.
+08-04-04  Choose the name _ as the sub-variable that holds type or instance
+	  specific data used by discipline functions.
+08-03-27  A bug in which the terminal group was not given back to the parent
+	  shell when the last part of a pipeline was handled by the parent shell
+	  and the other parts of the pipeline complete has been fixed. 
+	  The symptom was that the pipeline became uninterruptable.
+08-03-25  A bug in restricted mode introduced in ksh93s that caused scripts
+	  that did not use #! to executed in restricted mode has been fixed.
+08-03-25  A bug in which the pipefail option did not work for a pipeline
+	  within a pipeline has been fixed.
+08-03-24  A bug in which OPTIND was not set correctly in subshells has
+	  been fixed.
+08-03-24  A bug which could cause a memory exception when a compound variable
+	  containing an indexed array with only element 0 defined was expanded.
+08-03-20  A bug in which ${!var[sub].*} was treated as an error has been fixed.
+08-03-20  Associative array assignments of the form ([name]=value ...)
+	  now allow ; as well as space tab and new line to separate elements.
+08-03-18  A buffering problem in which standard error was sometimes
+	  not flushed before sleep has been fixed.
+08-03-17  A bug in which a signal sent to $$ while in a subshell would be
+	  sent to the subshell rather than the parent has been fixed.
+08-03-17 + A --default option added to set(1) to handle set +o POSIX semantics.
+	  set --state added as a long name alias for set +o.
+08-03-14  A bug in which using monitor mode from within a script could
+	  cause the terminal group to change has been fixed.
+08-03-10  The new ${...} command substitution will treat the trailing }
+	  as a reserved word even if it is not at the beginning of a command,
+	  for example, ${ date }.
+08-03-10  If the name of the ENV begins with /./ or ././ then the
+	  /etc/ksh.kshrc file will not be executed on systems that support
+	  this interactive initialization file.
+08-03-07  A bug in which ksh -i did not run the ENV file has been fixed.
+08-03-07  A bug in which ulimit did not always produce the same output as
+	  ulimit -fS has been fixed.
+08-03-04  A bug in multiline mode in emacs and vi mode which could cause the
+	  cursor to be on the wrong line when interrupt was hit has been fixed.
+08-03-03  The change made in ksh93s+ on 07-06-18 in which braces became
+	  optional for ${a[i]} inside  [[...]] was restored in the case
+	  where the argument can be a pattern.
+08-03-03  A bug in which creating a name reference to an associative array
+	  instance would fail when the subscript contained characters [ or
+	  ] has been fixed.
+08-02-29 +The redirection operator >; has been added which for non-special
+	  files, generates the output in a temporary file and writes the
+	  specified file only of the command has completed successfully.
+08-02-15  A bug in ${var/pattern/string} for patterns of the form ?(*) and +(*)
+	  has bee fixed.
+08-02-07  A bug in which test \( ! -e \) produced an error has been fixed.
+08-02-14 +The typeset -a option can now optionally be followed by the name
+	  of an enumeration type which allows subscripts to be enumerations.
+08-02-14 +The enum builtin which creates enumeration types has been added.
+08-02-12  The backoff logic when there are no more processes has been fixed.
+08-02-07  The -X option has been added to typeset.  The -X option creates
+	  a double precision number that gets displayed using the C99 %a
+	  format.  It can be used along with -l for long double.
+08-01-31  The -T option to typeset has been added for creating typed
+	  variables.  Also the -h and -S options have been added to
+	  typeset that are only applicable when defining a type.
+08-01-31  The prefix expansion operator @ has been added.  ${@name}
+	  expands to the type of name or yields the attributes.
+07-11-15  A bug in the macro expander for multibyte characters in which
+	  part of the character contains a file pattern byte has been fixed. 
+07-10-03  A bug in which : was not allowed as part of an alias name has been
+	  fixed.
+07-09-26  A bug in which appending a compound variable to a compound variable
+	  or to an index array didn't work has been fixed.
+07-09-19  In both emacs and vi edit mode, the escape sequence \E[A (usually
+	  cursor up, when the cursor is at the end of the line will fetch
+	  the most recent line starting with the current line.
+07-09-18  The value of ${!var} was correct when var was a reference to an
+	  array instance.
+07-09-18  The value of ${!var[sub]} was not expanding to var[sub] and this
+	  was fixed.  It also fixed ${name} where name is a name reference
+	  to var[sub].
+07-09-18 +It is now legal to create a name reference without an initialization.
+	  It will be bound to a variable on the first assignment.
+07-08-30 +A discipline function can be invoked as ${x.foo} and is equivalent
+	  to ${ x.foo;} and can be invoked as x.foo inside ((...)).
+07-07-09  A bug in which typeset -a did not list indexed arrays has been
+	  fixed.
+07-07-03 +The command substitution ${ command;} has been added.  It behaves
+	  like $(command) except that command is executed in the current
+	  shell environment.  The ${ must be followed by a blank or an
+	  operator.
+
+08-04-17  --- Release ksh93s+  ---
+08-04-17  A bug in which umask was not being restored correctly after a
+          subshell has been fixed.
+08-04-15  A bug in which sending a STOP signal to a job control shell started
+	  from within a shell function caused cause the invoking shell to
+	  terminate has been fixed.
+08-04-11  A bug which caused $(exec > /dev/null) to go into an infinite loop
+	  has been fixed.
+08-03-27  A bug in which typeset -LZ was being treated as -RZ has been fixed.
+08-03-06  A bug with ksh -P on systems that support the the profile shell,
+          in which it would exit after running a non-builtin has been fixed.
+08-01-31  A bug in which command substitution inside ((...)) could cause
+	  syntax errors or lead to core dumps has been fixed.
+08-01-17  A bug in which discipline functions could be deleted when invoked
+	  from a subshell has been fixed.
+08-01-17  A bug in which a command substitution consisting only of
+	  assignments was treated as a noop has been fixed.
+08-01-17  A bug in which discipline functions invoked from withing a
+	  compound assignment could fail has been fixed.
+08-01-16  Incomplete arithmetic assignments, for example ((x += )), now
+	  generate an error message.
+08-01-16  A bug in which a set discipline defined for a variable before
+	  an array assignment could cause a core dump has been fixed. 
+08-01-03  A bug in on some systems in which exit status 0 is incorrectly
+	  returned by a process that catches the SIGCONT signal is stopped 
+	  and then continued.
+07-12-13  A race condition in which a program that has been stopped and then
+	  continued could loose the exit status has been fixed.
+07-12-12  Code to check for file system out of space write errors for all
+	  writes has been added.
+07-12-11  A bug in the macro expander for multibyte characters in which
+	  part of the character contains a file pattern byte has been fixed. 
+07-12-06  A bug in the emacs edit mode when multiline was set that output
+	  a backspace before the newline to the screen has been fixed.
+07-12-04  A bug in which using <n>TAB after a variable name listing expansion
+	  in the edit modes would cause the $ to disappear has been fixed.
+07-11-28  A bug in which setting IFS to readonly could cause a subsequent
+	  command substitution to fail has been fixed.
+07-11-27  A work around for a gcc 4.* C99 "feature" that could cause a job
+	  control shell to go into an infinite loop by adding the volatile
+	  attribute to some auto vars in functions that call setjmp().
+07-11-27  A bug in which the shell could read ahead on a pipe causing the
+	  standard input to be incorrectly positioned has been fixed.
+07-11-27  A bug in which compound variable UTF-8 multibyte values were not
+	  expanded or traced properly has been fixed.
+07-11-21  A bug where an unbalanced '[' in a command argument was not treated
+	  properly has been fixed.
+07-11-15  A bug in which compatibility mode (no long option names) getopts(1)
+	  incorrectly set the value of OPTARG for flag options has been fixed.
+07-11-15  A bug in which "hash -- name" treated "--" as an invalid name operand
+	  has been fixed.
+07-11-15  typeset now handles "-t -- [-r] [--]" for s5r4 hash(1) compatibility.
+07-11-15  A bug in which the umask builtin mis-handled symbolic mode operands
+	  has been fixed.
+07-11-15  Bugs in which shell arithmetic and the printf builtin mis-handled the
+	  signs of { -NaN -Inf -0.0 } have been fixed.
+07-11-15 +The full { SIGRTMIN SIGRTMIN+1 ... SIGRTMAX-1 SIGRTMAX } range
+	  of signals, determined at runtime, are now supported.
+07-11-15  A bug in which creating an index array with only subscript 0 created
+	  only a simple variable has been fixed.
+07-11-14  A bug in which appending to an indexed array using the form
+	  name+=([sub]=value) could cause the array to become an associative
+	  array has been fixed.
+07-11-14  A bug in which typeset without arguments could coredump if a
+	  variable is declared as in indexed array and  has no elements has
+	  been fixed.
+07-11-14  A bug in which creating a local SECONDS variable with typeset in
+	  a function could corrupt memory has been fixed.
+07-11-14  A bug which could cause a core dump when a script invoked by name
+	  from a function used compound variables has been fixed.
+07-11-05  A bug in which printf %d "'AB" did not diagnose unconverted characters
+	  has been fixed.
+07-11-05  printf %g "'A" support added for all floating point formats.
+07-11-01  A bug in which typeset -f fun did not display the function definition
+          when invoked in a subshell has been fixed.
+07-10-29  The sleep builtin was fixed so that all floating point constants
+	  are valid operands.
+07-10-10  A bug in which the locale was not being restored after
+          LANG=value command has been fixed.
+07-09-20  A bug in which a nameref to a compound variable that was local
+	  to the calling function would not expand correctly when displaying
+	  is value has been fixed.
+07-09-19  A bug which cause cause a core dump if .sh.edchar returned
+	  80 characters or more from a keyboard trap has been fixed.
+07-09-14  A bug in which could cause a core dump when more than 8 file
+	  descriptors were in use has been fixed.
+07-09-10  A bug in which creating a name reference to an instance of
+	  an array when the array name is itself a reference has been fixed.
+07-09-10  The file completion code has been modified so that after an = in
+	  any word, each : will be considered a path delimiter.
+07-09-06  A bug in which subprocess cleanup could corrupt the malloc() heap
+          has been fixed.
+07-08-26  A bug in which a name reference to an associative array instance
+	  could cause the subscript to be evaluated as an arithmetic expression
+	  has been fixed.
+07-08-22  A bug in which the value of an array instance was of a compound
+	  variable was not expanded correctly has been fixed.
+07-08-14  A bug which could cause a core dump when a compound assignment was
+	  made to a compound variable element with a typeset -a attribute
+	  has been fixed.
+07-08-08  A bug in which a trap ignored in a subshell caused it to be
+	  ignored by the parent has been fixed.
+07-08-07  A bug in which the set command would generated erroneous output
+	  for a variable with the -RZ attribute if the variable name had been
+	  passed to a function has been fixed.
+07-08-02  A bug in which read x[1] could core dump has been fixed.
+07-08-02  A second bug in which after read x[sub] into an associative array
+	  of an element that hasn't been assigned could lead to a core dump
+	  has been fixed.
+07-07-31  A bug in which a pipeline that completed correctly could have
+	  an exit status of 127 when pipefail was enabled has been fixed.
+07-07-09 +The SHOPT_AUDIT compile option has been added for keyboard logging.
+07-06-25  In vi insert mode, ksh no longer emits a backspace character
+	  before the carriage return when the newline is entered. 
+07-06-25  A bug in which pipefail would cause a command to return 0
+	  when the pipeline was the last command and the failure happened
+	  on a component other than the last has been fixed.
+07-06-25  A bug in the expansion of ${var/pattern/rep} when pattern or rep
+	  contained a left parenthesis in single quotes has been fixed.
+07-06-18  The braces for a subscripted variable with ${var[sub]} are now
+	  optional when inside [[...]], ((...)) or as a subscript.
+07-05-28  A bug in brace expansion in which single and double quotes did
+          not treat the comma as a literal character has been fixed.
+07-05-24  The -p option of whence now disables -v.
+07-05-23  Several bug fixes in compound variables and arrays of arrays
+	  have been made.
+07-05-15  A bug in which the %B format of printf was affected  by the
+	  locale has been fixed.
+07-05-14  A bug in which  was not removed in the replacement pattern with
+	  ${var/pattern/rep} when it was not followed by  or a digit has
+	  been fixed.
+07-05-10  A bug in which ksh -R file core dumped if no script was specified
+	  has been fixed.  it not displays an error message.
+07-05-07  Added additional Solaris signals to signal table.
+07-04-30  A bug in which a pipeline with command substitution inside a
+	  function could cause a pipeline that invokes this function to
+	  hang when the pipefail option is on has been fixed.
+07-04-30 +Added -q to whence.
+07-04-18  A small memory leak with each redirection of a non-builtin has
+	  been fixed.
+07-03-08  A bug in which set +o output command line options has been fixed.
+07-03-08  A bug in which an error in read (for example, an invalid variable
+	  name), could leave the terminal in raw mode has been fixed.
+07-03-06  A bug in which read could core dump when specified with an array
+	  variable with a subscript that is an arithmetic expression has
+	  been fixed.
+07-03-06  Several serious bugs with the restricted shell were reported and
+	  fixed.
+07-03-02  If a job is stopped, and subsequently restarted with a CONT
+	  signal and exits normally, ksh93 was incorrectly exiting with
+	  the exit status of the stop signal number.
+07-02-26 +M-^L added to emacs mode to clear the screen.
+07-02-26  A bug in which setting a variable readonly in a subshell would
+	  cause an unset error when the subshell completed has been fixed. 
+07-02-19 +The format with printf uses the new = flag to center the output.
+07-02-19  A bug in which ksh93 did not allow multibyte characters in
+	  identifier names has been fixed.
+07-02-19  A bug introduced in ksh93 that causes global compound variable
+	  definitions inside functions to exit with "no parent" has been fixed.
+07-02-19  A bug in which using compound commands in process redirection
+	  arguments would give syntax errors <(...) and >(...) has been fixed.
+07-01-29  A bug which caused the shell to core dump which can occur when a
+	  built-in exits without closing files that it opens has been fixed.
+07-01-26  A bug in which ~(E) in patterns containing  that are not inside ()
+	  has been fixed.
+
+06-12-29  --- Release ksh93s  ---
+06-12-29  A bug in which the value of IFS could be changed after a command
+	  substitution has been fixed. 
+06-12-22 +/dev/(tcp|udp|sctp)/HOST/SEVRICE now handles IPv6 addresses on
+	  systems that provide getaddrinfo(3).
+06-12-19 +A -v option was added to read.  With this option the value of
+	  the first variable name argument will become the default value
+	  when read from a terminal device. 
+06-11-20  A bug in which "${foo[@]:1}}" expands a null argument (instead of
+	  no argument), when foo[0] is not empty has been fixed. 
+06-11-16  The discipline functions have been modified to allow each subscript
+	  to act independently.  Currently the discipline function will not
+	  be called when called from a discipline function of the same variable.
+06-11-14  A bug which could cause a core dump if a file descriptor for
+	  an internal file was closed from with a subshell has been fixed.
+06-10-30 +The redirections <# pattern, and <## pattern have been added.
+	  Both seek forward to the beginning of the next line that contains
+	  the pattern.  The <## form copies the skipped portion to standard
+	  output.
+06-10-26 +On systems that support stream control transport, the virtual file
+	  name /dev/sctp/host/port can now be used to establish connections.
+06-10-26 +The printf modifier # when used with d produces units in thousands
+	  with a single letter suffix added.  The modifier # when used with
+	  the i specification provides units of 1024 with a two letter suffix.
+06-10-24  The value of $! is now set to the process id of a job put
+	  into the background with the bg command as required by POSIX.
+06-10-23  A bug in which the value of $! was affected by a background
+	  job started from a subshell has been fixed.
+06-10-23  A bug in ${var:offset:len} in multibyte locales has been fixed.
+06-10-15 +The remaining math functions from C99 were added for any system
+	  that supports them.
+06-10-13  The klockwork.com software detected a few coding errors that
+	  have been fixed.
+06-10-12  A bug when skipping over `...` with ${x:=`...`} when x is set
+	  has been fixed.
+06-10-11  A bug in process floating constants produced by the %a format
+	  of printf has been fixed.
+06-10-06  A bug in which IFS was not being restored correctly in some
+	  cases after a subshell has been fixed.
+06-10-06  A bug in which pipefail was not detecting some failures in
+	  pipelines with 3 or more states has been fixed.
+06-10-03  A bug in the processing of >(...) with builtins which could
+	  cause the builtin to hang has been fixed.
+06-10-03  A bug in the for loop optimizer which causes >(...) process
+	  substitution to be ignored has been fixed.
+06-09-17 +The -a option was added to typeset for indexed arrays.  This
+	  is only needed when using the ([subscript]=value ...) form.
+06-09-06 +The showme option was added.  Each simple command not beginning
+	  with a redirection and not occurring with in the while, until, if,
+	  select condition can be preceded by a semi-colon which will
+	  be ignored when showme is off.  When showme is on, any command
+	  preceded by a colon will be traced but not executed.
+06-08-16 +As a new feature, a leading ~(N) on a pattern has no effect 
+	  except when used for file expansion.  In this case if not
+	  matches are found, the pattern is replaced by nothing rather
+	  than itself.
+06-08-11  A bug in the expansion of ${.sh.match[i]:${#.shmatch[i]}} has
+	  been fixed.
+06-08-10 +The read builtin options -n and -N have been modified to treat
+          the size as characters rather than bytes unless storing into a
+	  binary (typeset -B) variable.
+06-07-27 +When the here document operator << is followed directly by a #
+	  rather than a -, the first line of the here-document determines
+	  how much whitespace is removed for each line.
+06-07-26  A bug in the C-shell history (enabled with set -H) in which the
+	  history event !$ was not processed has been fixed.
+06-07-21  A bug on some systems in which assigning PATH on a command line
+	  would not take effect has been fixed.
+06-07-20  Add ksh93 and rksh93 as allowable names for ksh binaries.
+06-07-20  Removed the SHOPT_OO compilation option which was only partially
+	  implemented.
+06-07-20  The ability to use egrep, grep, and fgrep expressions within
+	  shell patterns has been documented.
+06-07-17  A bug with arithmetic command expressions for locales in which
+	  the comma is a thousands separator has been fixed. 
+06-07-13 +The default HISTSIZE was increased from 128 to 512.
+06-07-13  A multibyte problem with locales that use shift codes has been fixed.
+06-06-23  A number of bug fixes for command, file, and variable completion
+	  have been mode.
+06-06-20 +Floating point division by zero now yields the constant Inf or -Inf
+	  and floating functions with invalid arguments yield NaN. 
+06-06-20 +The floating point constants Inf and NaN can be used in arithmetic
+	  expressions.
+06-06-20 +The functions isinf(), isnan(), tanhl() have been added for
+	  arithmetic expressions.
+06-06-13  Internal change to use ordering for variables instead of hashing
+	  to speed up prefix matching.
+06-06-13  A window between fork/exec in which a signal could get lost
+	  and cause a program to hang has been eliminated
+06-06-13  A bug in edit completion with quoted strings has been fixed.
+06-06-07  The restricted options can now be enabled by set as well as on
+	  the command line.  Once set, it can not be disabled.
+06-06-04  Modified built-in binding so that for systems for which /bin
+          and /usr/bin are the same, a builtin bound to /bin will get
+	  selected when either /bin or /usr/bin is scanned.
+06-06-04 +Added literal-next character processing for emacs/gmacs mode. 
+	  This change is not compatible with earlier versions of ksh93
+          and ksh88 when the stty lnext is control-v.  The sequence
+	  escape-control-v will display the shell version.
+06-05-31 +Modified emacs and vi mode so that entering a TAB after a partial
+	  TAB completion, generates a listing of possible completions.
+	  After the second TAB, a number followed by a TAB will perform
+	  the completion with the corresponding item.
+06-05-19 +Modified arithmetic so that conversions to strings default to
+	  the maximum number of precision digits.
+06-05-16  Bug fixes for multibyte locales. 
+06-05-10  The =~ operator was added to [[...]] and  [[ string ~= ERE ]]
+	  is equivalent to [[ string == ~(E)ERE ]].
+06-04-25  A bug in the vi edit mode which could cause the shell to core dump
+	  when switching from emacs mode.
+06-04-17  A bug in which using LANG or LC_ in assignment lists with builtins
+	  did not restore the localed correctly has been fixed.
+06-04-04  A bug in which discipline functions could not be added to variables
+	  whose names started with .sh has been fixed.
+06-03-28 +The -s option to typeset was added to modify -i to indicate short
+	  integers.
+06-03-28  A bug in which variables assignment lists before functions
+	  defined with function name were not passed on the functions
+	  invoked by this function has been fixed. 
+06-03-28  A bug in which name references defined within a function defined
+	  with function  name could not be used with compound variables has
+	  been fixed.
+06-03-27  A bug in which read <&p (print >&p) would cause the coprocess input
+	  (output) pipe to close before reading from (after writing to)
+          it has been fixed.
+06-02-28  A bug in which stopping a job created with the hist builtin command
+	  would create a job that could not be restarted has been fixed.  
+
+06-01-24  --- Release ksh93r  ---
+06-01-24  A bug in which running commands with standard output closed would
+	  not work as expected has been fixed.
+06-01-23  A bug in which print -u<n> could fail when file descriptor <n> was
+	  open for writing has been fixed.
+06-01-19  The ?: arithmetic operator fixed to work when the operation after
+	  the colon was an assignment.
+05-12-24  A bug which could lead to a core dump when elements of a compound
+	  variable were array elements, i.e. foo=(bar=(1 2)), has been fixed.
+05-12-13  An arithmetic bug in which x+=y+=z was not working has been fixed. 
+05-12-13  An arithmetic bug in which x||y was returning x when x was non-zero
+	  rather than 1 has been fixed.
+05-12-07 +The aliases for integer and float have been changed to use attributes
+	  -li and -lE to handle long long and long double types.
+05-12-07 +The histexpand (-H) option has been added which allows C-shell
+	  style history expansions using the history character !.
+05-12-07 +The multiline option was added which changes that way the edit
+	  modes handle lines longer than the window width.  Instead of
+	  horizontal scrolling, multiple lines on the screen are used.
+05-12-05  The whence builtin now returns an absolute pathname when the
+          command is found in the current directory.
+05-11-29  A bug which caused ksh -c '[[ ! ((' to core dump rather than
+	  report a syntax error has been fixed.
+05-11-29  A bug when reading fixed length records into typeset -b variables
+	  which caused a zero byte to terminate the value has been fixed.
+05-11-22 +The ability to seek to an offset within a file has been added
+	  with the new I/O redirection operators, <#  and >#.  Currently,
+	  these redirection operators must be followed by ((expr))
+	  but in a future release, it should be able to used to seek forward
+	  to the specified shell pattern.  In addition $(n<#) expands to the
+	  current byte offset for file descriptor n.
+05-11-22 +The .sh.match array variable is now set after each [[ ... ]]
+	  pattern match.  Previously it was only set for substring matches.
+05-10-17  A bug in which the library path variable could be prefixed
+          with a directory when a .path file was not encountered in
+	  the directory of the executable has been fixed.
+05-09-15  A for/while loop optimizer bug in which $OPTIND was not
+	  correctly expanded has been fixed.
+05-09-05  A bug in which a history command that invoked a history
+	  command could go into an infinite loop has been fixed.
+05-08-31 +In the case that IFS contains to adjacent new-lines so that
+	  new-line is not treated as a space delimiter, only a single
+	  new-line is deleted at the end of a command substitution.
+05-08-19 +When a tilde substitution expands to the / directory and is
+	  followed by a /, it is replaced by the empty string.
+05-08-16  A bug in which n<&m did not synchronize m has been fixed.
+05-08-16  A bug in which process substitution  ( <() and >() ) was not
+	  working within for and while loops has been fixed.
+05-07-24  A bug in which the pattern ~(E)(foo|bar) was treated as a syntax
+	  error has been fixed.
+05-07-24  A bug in completion with <n>=, where n was the one of the
+	  previous selection choices has been fixed.
+05-07-21  A bug with multibyte input when no edit mode was specified which
+	  caused the input line to shift left/right has been fixed.
+05-06-24  A race condition which could cause the exit status to get lost
+	  on some fast systems has been fixed.
+05-06-21  A bug in which nested patterns of the form {m,n}(pat) would cause
+	  syntax errors has been fixed.
+05-06-21  A bug in the macro expander has been fixed which could cause a
+          syntax error for an expansion of the form ${x-$(...)} when
+	  x is set and the command substitution contained certain strings.
+05-06-08 +On systems for which echo does not do System V style  expansions,
+	  the -e option was added to enable these expansion.
+05-06-08  A bug in which ${var op pattern} to not work when inside an
+	  arithmetic expression has been fixed.
+05-05-23 +An extension to shell patterns that allows matching of nested
+	  groups while skipping over quoted strings has been added.
+05-05-18  A bug in which the line number for errors was not correct for
+          functions loaded from FPATH has been fixed.
+05-04-18  A bug in which the exit status $? is not set when a trap triggered
+	  by the [[...]] command is executed has been fixed.
+05-04-08 +Redirection operators can be directly preceded with {varname}
+	  with no intervening space, where varname is a variable name which
+	  allows the shell to select a file descriptor > 10 and store it
+	  into varname.
+05-04-08 +SHOPT_CMDLIB_BLTIN=1 now includes <cmdlist.h> generated table.
+05-04-07 +[[ -o ?option ]] is true if "option" is a supported option.
+05-04-05  A bug in handling file completion with spaces in the names
+          has been fixed.
+05-03-25 +The SIGWINCH signal is caught by default to keeps the LINES and
+	  COLUMNS variables in sync with the actual window size.
+05-03-25 +Building ksh with SHOPT_REMOTE=1 causes ksh to set --rc if stdin is
+	  a socket (presumably part of a remote shell invocation.)
+05-03-25 +Building ksh with SHOPT_SYSRC=1 causes interactive ksh to source
+	  /etc/ksh.kshrc (if it exists) before sourcing the $ENV file.
+05-03-25 +{first..last[..incr][%fmt]} sequences added to brace expansions
+	  when braceexpand is enabled.
+05-03-03  A bug where a SIGCHLD interrupt could cause a fifo open to fail has
+	  been fixed.
+05-02-25  A bug in which a builtin command run in the background could
+	  keep a file descriptor open which could cause a foreground
+	  process to hang has been fixed.
+05-02-24  A bug where builtin library commands (e.g., date and TZ) failed to
+	  detect environment variable changes has been fixed.
+05-02-22 +The read builtin and word splitting are now consistent with respect
+	  to IFS -- both treat IFS as field delimiters.
+05-02-22 +The read builtin no longer strips off trailing delimiters that
+	  are not space characters when there are fewer variables than fields.
+05-02-17  A builtin bug on systems where dlsym(libcmd) returns link-time
+	  bindings has been fixed.
+05-02-12  A bug in which the lib_init() function for .paths BUILTIN_LIB
+	  libraries was not called has been fixed.
+05-02-06  A bug on some systems in which moving the write end of a co-process
+	  to a numbered file descriptor could cause it to close has been fixed. 
+05-02-06  A bug in the vi-edit mode in which the character under the cursor
+	  was not deleted in some cases with the d% directive has been fixed.
+05-02-06  A bug where external builtin stdout/stderr redirection corrupted
+          stdout has been fixed.
+05-02-04  A bug where times formatting assumed CLK_TCK==60 has been fixed.
+
+05-01-11  --- Release ksh93q  ---
+05-01-11  A bug in the integral divide by zero check has been fixed.
+05-01-11 +The -l option has been added to read /etc/profile and
+	  $HOME/.profile, if they exist, before the first command.
+05-01-11  An argument parsing bug that caused `kill -s x -- n' to fail has
+	  been fixed.
+05-01-11 +The .paths file, introduced in ksh93m, which can appear in
+	  any directory in PATH, now allows a line of the form 'BUILTIN_LIB=.'
+	  When a command is searched for this directory, and the full path
+	  matches the path of the built-in version of the command (listed
+	  by the 'builtin' command) then the built-in version of the command
+	  is used.  When ksh is built with SHOPT_CMDLIB_DIR=1 then all libcmd
+	  functions become builtins with the '/opt/ast/bin/' directory prefix.
+05-01-10  A bug in which a nameref to a compound name caused a core dump has
+	  been fixed.
+05-01-09  A bug in which some SIGCHLD interrupts (from child processes exiting)
+	  caused a fatal print/echo error diagnostic has been fixed.
+04-12-24  A bug in which some SIGCHLD interrupts (from child processes exiting)
+          corrupted the internal process/job list, sometimes causing the shell
+	  to hang, has been fixed.
+04-12-01  A bug in which typeset -Fn truncated less than n digits for large
+	  numbers has been fixed.
+04-11-25  A bug in which standard error could be closed after a redirection
+	  to /dev/stderr has been fixed.
+04-11-17  A bug in which an expansion of the form ${array[@]:3} could expand
+          to ${array[0]} when ${array[3]} was not set has been fixed.
+04-10-22 +The -E or -orc command line option reads ${ENV-$HOME/.kshrc} file.
+04-10-22 +`-o foo' equivalent to `+o nofoo', `-o nobar' equivalent to `+o bar'.
+          `--foo' equivalent to `-o foo', `--nofoo' equivalent to `+o foo'
+04-10-05 +The .paths file, introduced in ksh93m, which can appear in
+	  any directory in PATH, now allows a line of the form
+	  'BUILTIN_LIB=libname'.  When a command is searched for this directory,
+	  the shared library named by libname will first be searched for a
+	  built-in version of the command.
+04-09-03  <<< here documents now handle quotes in the word token correctly. 
+04-08-08 +The maximum size for read -n and and read -N was increased from
+	  4095 to 32M.
+04-08-04 +printf %q was modified so that if an no operand was supplied, no
+	  no output would be generated rather than a quoted empty string.
+04-08-01 +The -n and -N options of the read builtin has been modified
+	  when reading variables with the binary attribute so that the
+	  data is stored directly rather than through assignment.
+04-08-01 +The shcomp command has been modified to process alias commands
+	  under some conditions.
+04-07-31 +The .sh.match variable added in ksh93l, now works like other
+	  indexed arrays.
+04-07-08  A loop optimizer bug which occurs when typeset is used in
+	  a for or while loop inside a function has been fixed.
+04-06-24 +The number of subexpressions in a pattern was increased to 64
+	  from the current number of 20.
+04-06-17 +The -t option to read was modified to allow seconds to be
+	  specified as any arithmetic expression rather than just
+	  an integral number of seconds, for example even -t 'sin(.5)'
+	  is now valid.
+04-06-16  Two small memory leak problems were fixed.
+04-06-15  A bug in ${var/pattern/"string"} which occurred when string
+	  contained pattern matching characters has been fixed.
+04-05-08  printf $'%d produced an erroneous error message and has
+	  been fixed.
+04-05-24  A bug in which an associative array without any elements could
+	  cause a core dump when a script with an associative array with
+	  the same name was declared in a script invoked by name has
+	  been fixed.
+04-05-11  A bug in which an exec statement could close the script that
+	  is being processed in a script that is run by name causing
+	  a failure has been fixed.
+04-04-28 +If the first character of assignment to an integer variable was 0,
+          the variable had been treated as unsigned.  This behavior was
+          undocumented and has been removed.
+04-04-05  A bug in which the positioning of standard input could be incorrect
+	  after reading from standard input from a subshell has been fixed.
+04-03-30  A bug in the for loop optimizer which in rare cases could cause
+	  memory corruption has been fixed.
+04-03-29 +The preset alias source='command .' has been added.
+04-03-29  A bug introduced in ksh93p on some systems in which invoked by
+	  name with #! on the first line would not get the signals handling
+	  initialized correctly has been fixed. 
+04-03-29  A bug introduced in ksh93p in which a HUP signal received by
+	  a shell that is a session group leader was not passed down to
+	  its children has been fixed.
+
+04-02-28  --- Release ksh93p  ---
+04-02-28 +The ability to apply an append discipline to any variable has
+	  been added.
+04-02-14  A bug in which the exportall option (set -a) would cause incorrect
+	  results for arrays has been fixed.
+04-02-02  A bug in which an exported array would pass more than
+	  the first element to a script invoked by name has been fixed.
+04-02-02  A bug on some systems in which name=value pairs preceding a script
+	  invoked by name was not getting passed to the script has been fixed.
+04-01-20  A bug in which an unset discipline function could cause a core
+	  dump on some systems has been fixed.
+04-01-12  A bug in which a continue or break called outside a loop from
+	  inside a function defined with name() syntax could affect 
+	  the invoking function has been fixed.
+04-01-08  If a command name begins with ~, only filename completion will be
+	  attempted rather than pathname completion using the builtin editors. 
+04-01-08  A bug in the vi edit mode in which the wrong repeat count on
+	  multiple word replacements with the . directive has been fixed.
+04-01-06  Backspace characters are now handled correctly in prompt strings.
+04-01-06 +The getopts builtin has been modified to accept numerical
+	  arguments of size long long on systems that support this.
+04-01-06  A bug in which unsetting all elements of an associative array
+	  would cause it to be treated as an indexed array has been fixed.
+03-12-15  A bug in which a quoted string ending with an unescaped $ would
+	  delete the ending $ in certain cases has been fixed.
+03-12-05  A bug in which the shell could hang when set -x tracing a command
+	  when an invalid multibyte character is encountered has been fixed. 
+03-12-05  On some systems, if the KEYBD trap is set, then commands that use
+	  the meta key were not processed until return was hit.  This
+	  has been fixed.
+03-12-05  A problem which occurred when the login shell was not a group
+	  leader that could cause it to fail has been fixed.
+03-12-05  A problem in which a shell could core dump after receiving a signal
+	  that should cause it to terminate while it was in the process
+	  of acquiring more space has been fixed.
+03-12-05 +If ENV is not specified, the shell will default to $HOME/.kshrc
+	  for interactive shells.
+03-11-21  A bug introduced in ksh93o in which the DEBUG trap could get
+	  disabled after it triggered has been fixed. 
+03-11-04  A bug in which using arithmetic prefix operators ++ or -- on a
+	  non-lvalue could cause a core dump has been fixed.
+03-11-04  A bug in which leading zeros were stripped from variable
+	  expansions within arithmetic computation to avoid being treated
+	  as octal constants when they should not have, has been fixed.
+03-10-08  A bug introduced in ksh93o in which a large here document inside
+	  a function definition could get corrupted has been fixed.
+03-09-22  A bug in which the .get discipline function was not being
+	  called when a string variable was implicitly referenced from
+	  within a numerical expression has been fixed.
+03-09-22  A bug in which a script without a leading #! could get executed
+	  by /bin/sh rather than the current shell on some systems has
+	  been fixed.
+03-09-12 +To improve conformance with ksh88, leading zeros will be ignored
+	  when getting the numerical value of a string variable so that
+	  they will not be treated as octal constants.
+03-09-03 +The builtin kill command now processes obsolete invocations
+	  such as kill -1 -pid.
+03-09-02  The restriction on modifying FPATH in a restricted shell (sh -r)
+	  has been documented.
+03-09-02 +The restricted shell (sh -r) has been modified to disallow
+	  executing command -p.
+03-08-07  A bug in which the KEYBD trap was not being invoked when
+	  characters with the 8th bit set has been fixed.
+03-08-02  A parser bug introduced in ksh93o which caused the character
+	  after () in a Posix function definition to be skipped 
+	  when reading from standard input has been fixed.
+03-08-01  A bug in which "${foo#pattern}(x)" treated (x) as if it were
+	  part of the pattern has been fixed.
+03-08-01 +The command -x option has been modified so that any trailing
+	  arguments that do expand to a single word will be included
+	  on each invocation, so that commands like command -x mv * dir
+	  work as expected.
+
+03-07-20  --- Release ksh93o+  ---
+03-07-20  A bug in which could cause memory corruption when a posix
+	  function invoked another one has been fixed.
+03-07-15  A bug in which a file descriptor>2 could be closed before
+	  executing a script has been fixed.
+03-07-15  A parsing error for <() and >() process substitutions inside
+	  command substitution has been fixed.
+03-07-15  A parsing error for patterns of the form {...}(...) when
+	  used inside ${...} has been fixed.
+03-07-15  An error in which expanding an indexed array inside a compound
+	  variable could cause a core dump has been fixed.
+03-07-15  A bug in which on rare occasions a job completion interrupt
+	  could cause to core dump has been fixed.
+03-06-26  A bug in which process substitution embedded within command
+	  substitution would generate a syntax error has been fixed.
+03-96-23  A bug in which ${@:offset:len} could core dump when there
+	  were no arguments has been fixed.
+03-96-23  A bug in which ${X[@]:offset:len} could core dump when X
+	  was unset has been fixed.
+03-06-22 +The -x option was added to the command builtin.  If this
+	  option is on, and the number of arguments would exceed ARG_MAX,
+	  the command will be invoked multiple times with a subset of
+	  the arguments.  For example, with alias grep='command -x grep,
+	  any number of arguments can be specified.
+03-06-14  A bug in which could cause a core dump on some systems with
+	  vi and emacs editors with the MULTIBYTE option has been fixed.
+03-06-06  A bug in which the shell could core dump when a script was
+	  run from its directory, and the script name a symlink to a file
+	  beginning with .., has been fixed.
+03-06-05  A bug in which the shell could core dump when a child process
+	  that it is unaware of terminates while it is calling malloc()
+	  has been fixed.
+03-06-02 +An option named globstar (set -G) has been added.  When enabled,
+	  during pathname expansion, any component that consists only of ** is
+	  matches all files and any number of directory levels.
+03-05-30  A bug in which the PATH search could give incorrect results when
+	  run from directory foo and PATH contained .:foo:xxx has been fixed.
+03-05-29 +Some changes were made to the code that displays the prompt in edit 
+	  mode to better handle escape sequences in the prompt.
+03-05-27  I added = to the list of characters that mark the beginning of
+	  a word for edit completion so that filenames in assignments
+	  can be completed.
+03-05-20  A bug in which read -N could hang on some systems when reading
+	  from a terminal or a pipe has been fixed.
+03-05-19  A bug in which the output of uname from a command substitution
+	  would go to the standard output of the invoking command when
+	  uname was invoked with a non-standard option has been fixed.
+03-05-19  A job control bug which would cause the shell to exit because 
+	  it hadn't take back the terminal has been fixed.  The bug
+	  could occur when running a function that contained a pipeline
+	  whose last element was a function.
+03-05-19  A job control timing bug introduced in ksh93o on some systems
+	  which could cause a pipeline to hang if the first component
+	  completed quickly has been fixed.
+03-05-13 +The read builtin has been modified so that the builtin editors
+	  will not overwrite output from a previous incomplete line. 
+03-05-13  A bug in which the name of an identifier could have the string
+	  .sh. prefixed to it after expanding a variable whose name begins
+	  with .sh. has been fixed.
+03-05-13  A bug in the expansion of $var for compound variables in which
+	  some elements would not be output when the name was a prefix
+	  of another name in the compound variable has been fixed.
+03-05-08  The last item in the ksh93o release on 03-01-02 has been
+	  altered slightly to preserve the leading 0's when the
+	  preceding character is a digit.  Thus, with typeset -LZ3 x=10,
+	  $(( 1$x)) will be 1010 whereas $(( $x) will be 10.
+03-04-25  A bug in which if x is a name reference, then nameref y=x.foo
+	  did not follow x has been fixed.
+
+03-03-18  --- Release ksh93o  ---
+03-03-18 +A -N unary operator was added to test and [[...]] which returns
+	  true if the file exists and the file has been modified since it
+	  was last read.
+03-03-18 +The TIMEFORMAT variable was added to control the format for
+	  the time compound command.  The formatting description is
+	  described in the man page.
+03-03-06 +A -N n option was added to read which causes exactly n bytes
+	  to be read unlike -n n which causes at most n bytes to be read.
+03-03-03 +Three new shell variables were added.  The variable .sh.file
+	  stores the full pathname of the file that the current command
+	  was found in.  The variable .sh.fun names the current function
+	  that is running.  The variable .sh.subshell contains the depth
+	  of the current subshell or command substitution.
+03-03-03 +When the DEBUG trap is executed, the current command line after
+	  expansions is placed in the variable .sh.command.  The trap
+	  is also now triggered before each iteration of a for, select,
+	  and case command and before each assignment and redirection.
+03-02-28 +Function definitions are no longer stored in the history file so
+	  that set -o nolog no longer has any meaning.
+03-02-28 +All function definitions can be displayed with typeset -f not
+	  just those stored in the history file.  In addition, typeset +f
+	  displays the function name followed by a comment containing the
+	  line number and the path name for the file that defined this function.
+03-02-28  A bug in which the value of $LINENO was not correct when executing
+	  command contained inside mult-line command substitutions has been
+	  fixed.
+03-02-19 +Since some existing ksh88 scripts use the undocumented and
+	  unintended ability to insert a : in front of the % and # parameter
+	  expansion operators, ksh93 was modified to accept :% as equivalent
+	  to % and :# as equivalent to # with ${name op word}.
+03-02-14  A bug which could cause a core dump when reading from standard
+	  error when standard error was a pty has been fixed.
+03-02-14 +The shell arithmetic was modified to use long double on systems
+	  that provide this data type.
+03-02-09  A bug in which a function located in the first directory in FPATH
+	  would not be found when the last component of PATH was . and the
+	  current directory was one of the directories in PATH has been fixed.
+03-02-07 +The trap and kill builtin commands now accept a leading SIG prefix
+	  on the signal names as documented.
+03-02-05  A bug in the expansion of ${var/$pattern}, when pattern contained
+	  \[ has been fixed.
+03-02-05  A bug in which .sh.match[n], n>0, was not being set for substring
+	  matches with % and %% has been fixed.
+03-01-15  A bug in which getopts did not work for numerical arguments specified
+	  as n#var in the getopts string has been fixed.
+03-01-09  A bug in which using ${.sh.match} multiple times could lead to
+	  a memory exception has been fixed.
+03-01-06  A bug in the expansion of ${var/pattern/$string} in the case that
+	  $string contains \digit has been fixed. 
+03-01-02 +A -P option was added for systems such as Solaris 8 that support
+	  profile shell.
+03-01-02  For backward compatibility with ksh88, arithmetic expansion
+	  with ((...)) and let has been modified so that if x is a zero-filled
+	  variable, $x will not be treated as an octal constant.
+
+02-12-05  --- Release ksh93n+  ---
+02-11-30  A bug that can show up in evaluating arithmetic statements that
+	  are in an autoloaded function when the function is autoload from
+	  another function has been fixed.
+02-11-30  An optimization bug in which an expansion of the form ${!name.@},
+	  which occurred inside a for or a while loop, when name is a name
+	  reference, has been fixed.
+02-11-18  A bug in which modifying array variables in a subshell could leave
+	  side effects in the parent shell environment has been fixed.
+02-11-18  A memory leak when unsetting an associative array has been fixed.
+02-11-14 +The code to display compound objects was rewritten to make
+	  it easier for runtime extensions to reuse this code.
+02-11-14 +A change was made to allow runtime builtins to be notified when
+	  a signal is received so that cleanup can be performed.
+02-10-31 +User applications can now trap the ALRM signal.  Previously,
+	  the ALRM signal was used internally and could not be used
+	  by applications. 
+02-10-31  A bug in which signals received while reading from a coprocess
+	  for which traps were set was not handled correctly has been fixed.
+02-10-31  A bug in which a file opened with exec inside a subshell could
+	  be closed before the subshell completed has been fixed.
+02-10-21  A bug in which setting PATH or FPATH inside a function might not
+	  take effect has been fixed.
+02-10-21  A bug which could cause a core dump when a local SECONDS variable
+	  is defined in a function has been fixed.
+02-10-15  A bug in which the associate array name operator ${!array[@]}
+	  could return the same name multiple times has been fixed.
+02-10-15  A bug in which the zero'th element of an associative array was
+	  not getting set when an assignment was made without a subscript
+	  specified has been fixed.
+
+02-09-30  --- Release ksh93n  ---
+02-09-30 +The maximum indexed array size was increased to 16Megs.
+02-09-30  A bug which could cause a core dump when changing attributes
+	  of associative array has been fixed.
+02-09-30  A bug in which exporting an array variable would not export the
+	  0-th element has been fixed.
+02-09-30  A bug in which an array assignment of the form a=($a ...) would unset
+	  'a' before the right hand side was evaluated has been fixed.
+02-09-27  A bug in which the error message for ${var?message} when var was
+	  null or unset did not contain the variable name var has been fixed.
+02-09-27  A bug in which closing file descriptors 0 through 2 could
+	  cause a subsequent here document to fail has been fixed. 
+02-09-14  A bug in whence which occurs when the specified name contained
+	  a / has been fixed.
+02-09-14  A bug in the parser for strings of the form name$((expr))=value
+	  has been fixed.
+02-09-14  A for loop optimization bug in which the number of elements in
+	  an array was treated as an invariant has been fixed.
+02-09-09  A bug in which redirection or closing of a file descriptor between
+	  3 and 9 could cause a subsequent here document to fail has been
+	  fixed. 
+02-09-09  A bug in which a background job was not removed from the job list
+	  when a subshell completed has been fixed, for example (prog&). 
+02-09-03  A bug in which an assignment of the form name=(integer x=3)
+	  could be interpreted as an array assignment rather than a
+	  compound variable assignment has been fixed.
+02-08-19  A command completion bug which occurred on file systems that
+	  are case insensitive has been fixed.
+02-08-19  A bug which could lead to an exception on some systems (for
+	  example FREEBSD) which occurred when setting PATH has been fixed.
+02-08-11  A bug in arithmetic rounding in which a value input as a decimal
+	  string would output as a rounded version of the string has
+	  been fixed.
+02-08-11  A bug in which the last character could be deleted from shell
+	  traces and from whence when called from a multibyte locale
+	  has been fixed.
+02-08-01  A bug which could cause a core dump to occur when a shell script
+	  is executed while a coprocess is running that has closed the
+	  output pipe has been fixed.
+02-08-01  A bug in which command completion in multibyte mode could
+	  corrupt memory for long command lines has been fixed.
+
+02-06-17  --- Release ksh93n-  ---
+02-06-17  A bug in which user defined macros could cause a core dump in
+	  with MULTIBYTE mode has been fixed.
+02-06-17  A bug in which printf format specifiers of the form %2$s were causing
+	  a core dump has been fixed.
+02-06-17  A bug in which setting stty to noecho mode did not prevent the
+	  echoing of characters by ksh when emacs or viraw mode
+	  was enabled has been fixed.
+02-06-17  A bug in which background job completion could cause the sleep
+	  builtin to terminate prematurely has been fixed.
+02-06-17  A bug in which the shell could core dump if getopts was called
+	  when the OPTIND variable contained a negative value has been fixed. 
+02-06-10 +The edit mode prompt has been modified to handle escape sequences.  
+02-06-10  A bug which occurred for interactive shells in which the builtin
+	  cat command was used in command substitution on a file whose
+	  size was larger than PIPE_BUF has been fixed.
+02-06-10  A bug in which the trap on ERR was not being processed when
+	  set inside a function has been fixed.
+02-06-07  A bug in which function definitions could cause the history count
+	  to be decremented by one (and even become negative) has been fixed.
+02-06-05  A bug in read in which share mode could be enabled has been fixed.
+02-05-28  A bug which could occur when the last command of a script was
+	  a case statement and the action selected ended in ;& instead of ;;
+	  has been fixed.
+02-05-23  A bug with unary + introduced in ksh93k has been fixed.
+02-05-07  A bug in substitutions of the form ${var/pattern/string} in which
+	  a backslash was inserted in the replacement string when it contained
+	  a special pattern character has been fixed.
+02-05-01  A bug in the emacs edit mode which occurred in versions compiled
+	  for multibyte character sets which occurred when a repeated search
+	  was requested after a long line had been returned for the previous
+	  search has been fixed.
+02-04-02 +vi and emacs edit modes were modified so that tab completion is
+	  disabled when invoked from the read built-in.
+
+02-03-26  --- Release ksh93m+  ---
+02-03-26  A bug in which  was not handled correctly when used in file
+	  expansion has been fixed.
+02-02-18  A bug in which lines beginning with a # were deleted from here
+	  documents when the here-document delimiter was followed by
+	  a comment has been fixed.
+02-12-06  An optimization bug in which ${!x[@]) was treated as invariant in
+	  a for loop has been fixed.
+02-02-06  A bug in which the ERR trap is not cleared for a script invoked
+	  by name from within a function has been fixed.
+02-01-08  A bug in which a shell script executed from within a subshell
+	  could cause this script to have an invalid pointer leading
+	  to a memory fault has been fixed. 
+02-01-07 +Added here documents of the form <<< word (as per zsh) which
+	  is equivalent to << delimordelim.
+02-01-07  A bug in which the first word of a compound assignment,
+	  x=(word ...), was treated as a reserved word has been fixed.
+02-01-07  A bug in the handling of  when noglob was enabled and a
+	  substitution of the form ${word op pattern} occurred in the
+	  same word has been fixed.
+02-01-07 +A compilation option, CMDLIB_BLTIN in the file OPTION, has
+	  been added.  When this options is set, all commands implemented
+	  in libcmd become shell builtin commands by default.
+02-01-07  A bug in which builtin foo, where foo is already a builtin
+	  would result in the builtin foo getting removed has been fixed. 
+02-01-07  A bug which the shell executed a command found in the current
+	  directory when PATH have no valid directories has been fixed.
+01-11-28  The value of $? was not being set when called with exit.
+01-11-28  If the last command was of the form (...) and a trap on EXIT or
+	  ERR was set, and the command inside () modified the trap, then
+	  the original trap wasn't executed.
+01-11-26 +The value for 0 is now preceded by the base number when
+	  the base was not 10.
+01-11-26 +The default has compilation mode has been changes so that
+	  viraw mode will always be on.
+
+01-10-31  --- Release ksh93m  ---
+01-10-31  A for loop optimizer bug for subshells contained withing for
+	  loops has been fixed.
+01-10-16  typeset without arguments no longer outputs variable names
+	  that do not have any attributes that are set.
+01-10-16  A bug introduced in ksh93l in which assignments specified with
+	  the exec built-in were not being expanded properly has been
+	  fixed.
+01-10-11  An optimization bug in which ${!x) was treated as invariant in
+	  a for loop has been fixed.
+01-10-11  Unsigned integer variables in bases other than 10 are printed now
+	  expand in that base with the base prefix.
+01-10-10  A number of typos in the self generating man pages for shell
+	  built-ins have been fixed.
+01-10-04  The self generated man pages for hist and fc were not working
+	  correctly and have been fixed.
+01-10-03  Yet another optimizer bug in which shell patterns were
+	  treated as invariants has been fixed.
+01-09-27  Two bugs relating to multibyte history searches and to find
+	  have been fixed.
+01-09-27  A bug introduced in ksh93k in which the PATH searching was
+	  not restored after running a command with an assignment list 
+	  has been fixed.
+01-09-26  A bug in which a zero filled field was treated as octal when
+	  converted to integer has been fixed.
+01-09-26  Yet another bug in the optimization of for loops related to
+	  recursive functions with break or continue statements has been fixed.
+01-09-25 +The exponentiation operator ** was added to the shell arithmetic
+	  evaluation.  It has higher precedence than * and is left
+	  associative.
+01-09-25  The code was modified to use the ast multibyte macros
+	  and functions for handing multibyte locales.
+01-09-25 +The expansion ${parameter:offset:length} now handles negative
+	  offsets which cause offsets to be measured from the end.
+01-09-25  Some spelling errors in the documentation were corrected.
+01-09-24 +The /dev/tcp/host/port and /dev/udp/host/port now allow
+	  the ports to be specified by service name. 
+01-09-24 +The change staring with ksh93g in which the the appropriate
+	  library path variable is prepended with a corresponding library
+	  directory has been modified.  With the new method, only the
+	  library path defined in the file named .paths in the directory
+	  where the executable is found will be modified.  See the
+	  man page for more details.
+01-09-23 +The .fpath file (see ksh93h) is no longer looked for in each
+	  directory on the path to locate function directories.  The
+	  file named .paths is used instead.
+01-09-23  A bug in which IFS was not being restored after being changed in
+	  a subshell has been fixed.
+01-09-16 +With the vi and emacs edit modes, after a list of command
+	  or functions is generated with = or M-= respectively,
+	  any element from the list can be pasted on the command line
+	  by preceding the = or M-= with a numeric parameter specifying
+	  the position on the list.
+01-09-16  A bug in ksh93l caused command completion not to find aliases
+	  and functions.  Command listing from the edit mode was presented
+	  in reverse order.  This has been fixed.
+01-09-13  Another bug in the optimization of for loops related to subshells
+	  when traps were set has been fixed.
+01-09-07  A change in ksh93l caused brace expansion to stop working
+	  and this has been fixed.
+01-09-04  A bug introduced in ksh93k in which an arithmetic statement
+	  within a function that used name references did not follow the
+	  reference has been fixed.
+01-09-04  A bug introduced in ksh93l in which export -p did not prefix
+	  each export with the word export has been fixed.
+01-08-29  A bug in multibyte input which occurred when a partial multibyte
+	  character was received has been fixed.
+01-08-29  A bug introduced in ksh93l which could cause a core dump
+	  when an assignment list containing PATH is specified inside
+	  command substitution has been fixed.
+01-08-09  Another bug in the optimization of for loops in ksh93l caused
+	  errors in recursive functions using local variables that
+	  contained for loops has been fixed.
+01-07-27  A bug in which IFS would be unset after a command substitution
+	  inside a here document has been fixed.
+01-07-26  To conform to the POSIX standard, if you invoked ksh name,
+	  and name does not contain a /,  it will first try to run
+	  one in the current directory whether it is executable or not
+	  before doing a path search for an executable script.  Earlier
+	  versions first checked for an executable script using the
+	  PATH variable.
+01-07-23  A bug in which unset -f invoked in a subshell could unset a
+	  function defined in the parent has been fixed.
+01-07-16  A bug in the optimization of for loops in ksh93l caused
+	  name references to be treated as invariants has been fixed.
+01-07-09  A bug in which a discipline function applied to a local variable
+	  could cause a shell exception has been fixed.  Discipline
+	  functions can only be specified for global variables. 
+
+01-06-18  --- Release ksh93l  ---
+01-06-18  A bug in assigning integers larger than can be represented as
+	  long integers to floating point variables has been fixed.
+01-06-18  A bug in the handling of unsigned integers (typeset -ui) has
+	  been fixed.
+01-06-04  The evaluation of the PS1 prompt no longer effects the value
+	  of the $? variable.
+01-06-01  A small memory leak from subshells has been fixed.
+01-05-22  A bug in which attributes for variables that did not have
+	  values would be lost after a subshell has been fixed.
+01-05-22 +The %R format has been added to convert a shell pattern into
+	  an extended regular expression.
+01-05-22 +The escape sequences \, X, \C[.collating-element.], and
+	  \x{hex} have been added to ASCII-C strings and to printf format
+	  strings.
+01-05-20 +Patterns of the form {n}(pattern) and {m,n}(pattern) are now
+	  recognized.  The first form matches exactly n of pattern whereas,
+	  the second form matches from m to n instances of pattern.
+01-05-20 +The shell allows *-(pattern), +-(pattern),  ?-(pattern),
+	  {m,n}-(pattern}, and @-(pattern) to cause the minimal
+	  match of pattern to be selected whenever possible rather
+	  than the maximal (greedy) match. 
+01-05-20 +The character class [:word:] has been added to patterns.
+	  The word class is the union of [:alnum:] and the character _.
+01-05-20 +Inside (...) pattern groups, the  character is now treated
+	  specially even when in an enclosing character class.  The
+	  sequences, \w, \d, \s are equivalent to the character classes
+	  word, digit, and space respectively.  The sequences \W, \D,
+	  and \S are their complement sets. 
+01-05-20 +The shell now recognizes pattern groups of the form
+	  ~(options:pattern) where options or :pattern can be omitted.
+	  Options use the letters + and - to enable and disable options
+	  respectively.  The option letters g (greedy), i (ignore case)
+	  are used to cause maximal matching and to cause case
+	  insensitive matching respectively.  If :pattern is also
+	  specified, these options are only in effect while this
+	  pattern is being processed.  Otherwise, these options remain
+	  in effect until the end of the pattern group that they are contained
+	  in or until another ~(...) is encountered.  These pattern groups
+	  are not counted with respect to group numbering.
+01-05-14  When edit completion, expansion, or listing occurs in the
+	  middle of a quoted string, the leading quote is ignored when
+	  performing the completion, expansion, or listing.
+01-05-14  A small memory leak from subshells has been fixed.
+01-05-10  A bug in which open files were not restored after a subshell
+	  that had used exec to replace a file has been fixed. 
+01-05-10 +Redirection to a null file name now generates an error message. 
+01-05-09  The shell now rejects some invalid parameter substitutions that
+	  were previously processed in undefined ways.
+01-05-09  A bug in which the output of select was not flushed before the
+	  read when input did not come from the terminal has been fixed. 
+01-05-08  A bug in which job ids would not be freed for interactive shells
+	  when subshells ran built-ins in the background has been fixed.
+01-05-08 +The FPATH variable now requires an explicit . to cause the
+	  current directory to be treated as a function directory. 
+01-05-08  A bug in read -n when echo mode was disabled has been fixed.
+01-05-07  A bug in which function definitions could be listed as part
+	  of the history has been fixed.
+01-04-30 +This release uses a new and often much faster pattern matcher than
+	  earlier releases.
+01-04-30 +An optimizer now eliminates invariant parameter expansions from
+	  for while and until loops.
+01-04-30 +The variable .sh.match is set after each pattern match (# % or /)
+	  in a variable substitution.  The variable .sh.match is an
+	  indexed array with element 0 being the complete match. 
+	  The array is only valid until the next subsequent pattern
+	  match or until the value of the variable changes which ever
+	  comes first.
+01-04-30 +A self generating man page has been added to shcomp.  Also,
+	  shcomp now stops compiling when it finds an exit or exec
+	  command and copies the remainder so that it can be used
+	  for standard input.
+01-04-30 +The shcomp command was modified so that it can work in an
+	  EBCIDIC environment and that binary scripts are portable
+	  across environments.
+01-04-30  A bug in the handling of a trailing : in PATH has been fixed.
+01-04-30  A bug in which the builtin version of a command would get invoked
+	  even though the full pathname for the command was specified
+	  has been fixed.
+01-04-30  A bug in which read would loose the last character when
+	  reading the last line of a file that did not contain a new-line
+	  character has been fixed.
+01-04-23  A bug on some systems in which in vi mode the end of file
+	  character and end of line character could be swapped has
+	  been fixed.
+01-04-23  A bug on some systems in which invoking a shell script that
+	  did not have execute permission could set the exit value to
+	  127 rather than 126 has been fixed.
+01-04-20  A bug in which read -n from a pipe would block if fewer than
+	  n characters was received has been fixed.
+01-04-09  A bug in which invalid patterns, for example, ) by itself,
+	  was not treated as a string has been fixed so that if i=')',
+	  then [[ $i == $i ]] is true.
+01-04-09 +The shell arithmetic now interprets C character constants.
+01-04-09  A bug in which a non-zero return from a function defined
+	  with the function reserved word did not trigger the ERR
+	  trap or exit with set -e has been fixed.
+01-04-02  A bug on some systems, in which characters above 127 were
+	  not displayed correctly in vi or emacs edit mode has been fixed.
+01-04-02  A bug on some systems, introduced in the 'k' point release, in
+	  which the erase character in viraw mode was moving the cursor
+	  to the left without erasing the character has been fixed.
+01-04-02  On some systems the wcwith() function was returning a wrong
+	  value for characters and caused characters to be displayed
+	  incorrectly from the shell edit modes.  A work around for
+	  this problem has been added. 
+01-03-26  A bug in which valid scripts could produce syntax errors
+	  when run with locales that considered characters such as "'"
+	  to be space characters has been fixed.
+01-03-20  A bug in which an syntax error in an arithmetic expression
+	  entered interactively could cause the shell to go into
+	  an infinite loop outputting the error message has been fixed.
+01-03-10 +ksh93 accepts -l as a synonym for -L in test on systems for
+	  which /bin/test -l tests for symbolic links.
+01-03-10  A bug in parsing scripts in which { and } are used in place of
+	  in and esac in case statements embedded in compound commands
+	  has been fixed.  Use of { and } for in and esac is obsolete.
+01-03-06  A bug in which an argument of the form foo=bar was not
+	  being passed correctly to a traced function whose name
+	  was foo has been fixed.
+01-03-02  Using $(trap -p name) did not print the name of the current
+	  trap setting for trap name.
+01-02-26  Exported floating point variables gave incorrect results
+	  when passing them to ksh88.  This has been fixed.
+01-02-25  A race condition in which a coprocess which completed too quickly
+	  would not allow subsequent coprocesses to start has been fixed.
+01-02-25  The 'g' format specifier is now handled by printf.  It had
+	  inadvertently been omitted.
+01-02-20  The + was not being displayed during an execution trace
+	  with the += assignment operator.
+01-02-19  The error message which occurs when the interpreter name
+	  defined on the #! line does not exist is more informative.
+01-02-19  A bug in which $0 would not be set correctly when a
+	  script with #! was invoked by full pathname from the
+	  directory of the script has been fixed.
+01-02-19  A shell script did not always pick up tty mode changes
+	  made by external commands such as stty which could
+	  effect the behavior of read.
+01-02-19  The -u, -g, and -k unary tests did not give the correct
+	  results when used with negation and this has been fixed.
+
+01-02-05  --- Release ksh93k+  ---
+01-02-05  The sequence \<newline> inside $'...' was not incrementing
+	  the line count and this has been fixed.
+01-02-05 +Modified expansion of "${@-}" so that if no arguments are set
+	  it results in null string rather than nothing.
+01-02-02  memory leak problem with local variables in functions fixed.
+01-01-25 +allow arithmetic expressions with float%int and treat them
+	  as ((int)float)%int rather than as an error. 
+01-01-19  read -n1 was not working and has been fixed.
+01-01-17 +ksh now handles the case in which a here document in command
+	  substitution $() is terminated by the trailing ).  Previously,
+	  a new-line was needed at the end of the delimiter word. 
+01-01-02  A bug in which a KEYBD trap would cause a multi-line token
+	  to be processed incorrectly has been fixed.
+00-12-10 +Arithmetic integer constants can now have L and U suffices. 
+00-12-10  A bug in the processing of arithmetic expressions with compound
+	  variables when the -n option is on has been fixed.
+00-12-08  A bug in M-f and M-b from emacs mode has been fixed.  This
+	  bug only occurs when ksh93 is compiled without MULTIBYTE enabled.
+00-11-29  A bug in which jobs -p would yield 0 for background
+	  jobs run in a script has been fixed.
+00-11-21  A bug in integer arrays in which the number of elements is
+	  incorrect when the ++ operator is applied to a non-existing
+	  element has been fixed.  For example, integer x; ((x[3]++)).
+00-11-20  A timing bug in which the shell could reset the terminal
+	  group to the wrong value in the case that the a new process
+	  changes the terminal group during startup has been fixed.
+
+00-10-27  --- Release ksh93k  ---
+00-10-27  Using tab for completion now works only when applied
+	  after a non-blank character at the end of the current line.
+	  In other case a tab is inserted.
+00-10-27  A bug in the emacs edit mode for ^X^E has been fixed.
+	  The ^X^E sequence is supposed to invoke the full editor
+	  on the current command.
+00-10-18  A bug in which expansions of the form ${var//pattern/string}
+	  did not work correctly when pattern was '/' or "/" has
+	  been fixed.
+00-10-18 +The output format for indexed arrays in compound variables
+	  has been modified so that it can be used as input.
+00-10-18  Assignments with name references (typeset -n) will now
+	  implicitly unreference an existing name reference.
+00-10-17  A bug the += append operator when a single array element
+	  is appended to a variable that is not an array has been fixed.
+00-10-16  A bug in which the SIGCONT signal was being sent to
+	  each process will kill -0 or kill -n 0 has been fixed.
+00-10-12 +The arithmetic evaluation portion has been rewritten to
+	  perform a number of optimizations.
+00-10-10  A bug in which name prefix matching ${!name.*} was not
+	  checking name to see if it was a name reference has been fixed.
+00-09-26  A bug in the multibyte version in which the width of for
+	  non-printing characters was not correct has been fixed.
+00-09-12 +Made changes to get multibyte editing work on UWIN for windows
+00-09-12  A bug in which multibyte characters would be displayed incorrectly
+	  has been fixed.
+00-08-08  Removed build dependency on iswprint() and iswalph().
+00-07-20  In some cases the read builtin would read more than a single
+	  line from a pipe on standard input and therefore leave the seek
+	  position in the wrong location.
+00-07-05 +If the directory / is on the path, a / will not be inserted
+	  between the directory and the file name during path searching
+	  to avoid searching // for systems that treat this specially.
+00-06-26  A bug in which on rare occasions wait could return before all
+	  jobs have completed has been fixed.
+00-06-21  A bug in which backspace did not work correctly during the
+	  R replace directive in vi-mode has been fixed.
+00-06-12 +Added variable name completion/expansion/listing  to the set of
+	  completions.  Variable name completions begin with $ or "$ followed
+	  by a letter. 
+00-05-09  --- Release ksh93j  ---
+00-05-09  Modified command substitution to avoid using /tmp files when
+          run on read-only file systems. 
+00-04-17 +Modified printf to handle '%..Xc' and '%..Xs' options where X
+	  is not an alpha character.  Previous versions core dumped with this.
+00-04-10 +Changes to multibyte editing code were made to use standard
+	  ISO C functions rather than methods devised before the standard.
+00-04-09  Add %H options to printf to output strings with <"'&\t> properly
+	  converted for use in HTML and XML documents.
+00-04-07 +Modified getopts builtin to handle <.>..< >in usage string
+	  by invoking specified function.
+00-04-04  Added self generating man pages for bg, fc, fg, disown, jobs,
+	  hist, let, ., and ulimit.
+00-03-30 +The append operator += has been added and can be used
+	  for all assignments, strings, arrays, and compound variables.
+00-03-30 +Code was modified in several places to support automatic
+	  generation of C locale dictionaries.
+00-03-28  A bug in which the set and trap commands invoked with --name
+	  type arguments would terminate the invoking script  has
+	  been fixed.
+00-03-27  A bug in which the library path variable was not updated  
+	  correctly on some systems as described in the 'g' point
+	  release has been fixed. 
+00-03-07  printf now returns a non-zero exit status when one of
+          its arguments cannot be converted to the given type. 
+00-03-05  The return value and error message for a command that
+          was found on the path but was not executable was set
+          incorrectly.
+00-03-05  A prototype for ioctl() was removed from the vi edit mode.
+
+00-01-28  --- Release ksh93i  ---
+00-01-28 +Most of the built-in commands and ksh itself are now
+          self documenting.  Running command --man will produce
+          screen output.  Running command --html produces the
+          man page in html format.
+00-01-28 +The getopts builtin can process command description
+          strings to produce man pages.
+00-01-28  A bug in which a script could terminate when getopts
+          encountered an error when invoked inside a function
+          has been fixed.
+00-01-28  When a symbolic link was specified as the name of
+          the script to invoke by name, the value of $0 was
+          set to the real file name rather than the link name
+          in some cases and this has been fixed.
+00-01-28  A bug in which the precision given as an argument
+	  to printf was not working has been fixed.
+
+99-03-31  --- Release ksh93h  ---
+99-03-31 +The PATH search algorithm has been modified to look
+	  for a file named .fpath in each bin directory and if
+	  found, to search for functions in this directory if
+	  it cannot find the command in that directory.
+99-03-31 +When performing pathname expansion, the shell checks
+	  to see whether each directory it reads is case sensitive
+	  or not, and performs the matching accordingly.
+99-03-31 +The %T format for printing formatted date/time.
+99-03-31 +The emacs and vi modes now handle arrow keys when
+          they use standard ANSI escape sequences.
+99-03-31 +The TAB key can be used for completion in emacs and viraw mode.
+99-03-31  A bug in setting .sh.editchar during the KEYBD trap
+	  for the MULTIBYTE option was fixed in release ksh93h.
+99-03-31  A bug in shcomp for compilation of unary operators with [[...]]
+	  has been fixed.
+99-03-31  A bug in which the value of $? was changed when executing
+	  a keyboard trap has been fixed. 
+99-03-31  The handling of SIGCHLD has been changed so that the
+	  trap is not triggered while executing trap commands
+	  to avoid recursive trap calls.
+99-03-31  A bug in which a local variable in a function declared readonly
+	  would generated an error when the function went out of
+	  scope has been fixed.
+99-03-31  A bug in which \<new_line> entered from the keyboard
+	  with the KEYBD trap enabled has been fixed.
+99-03-31  The error message for a misplaced ((, for example print ((3),
+	  was often garbled and has been fixed.
+99-03-31  A bug in the KEYBD trap in which escape sequences of the form
+	  <ESC>[#~ were not being handled as a unit has been fixed.
+99-03-31  A bug in which ksh would consider expressions like [[ (a) ]]
+	  as syntax errors has been fixed.
+99-03-31  A function defined as foo() without a function body
+	  was not reported as a syntax error.
+99-03-31  A bug in which ksh could run out of file descriptors when
+	  a stream was repeatedly opened with exec and read from
+	  has been fixed.
+
+98-04-30  --- Release ksh93g  ---
+98-04-30 +The pipefail option has been added.  With pipefail
+	  enabled, a pipeline will not complete until all
+	  commands are complete, and the return value will
+	  be that of the last command to fail, or zero if
+	  all complete successfully.
+98-04-30 +The name-value pair library uses the cdt library rather
+	  than the hash library.  This change should be transparent
+	  to applications.
+98-04-30 +On the U/WIN version for Window 95 and Windows NT,
+          when a directory beginning with a letter followed by
+          a colon is given to cd, it is assumed to be an absolute
+          directory
+98-04-30 +When an executable is found on a given path,
+	  the appropriate library path variable is prepended
+	  with a corresponding library directory.
+98-04-30  A bug in which a name reference could be created to
+	  itself and later cause the shell to get into an infinite
+	  loop has been fixed.
+98-04-30  A bug in shcomp relating to compound variables was fixed.
+98-04-30  A bug introduced in ksh93e in which leading 0's in -Z
+	  fields caused the value to be treated as octal for arithmetic
+	  evaluation has been fixed.
+98-04-30  A bug when a name reference with a shorter name than
+          the variable it references was the subject of a compound
+	  assignment has been fixed. 
+98-04-30  A bug which in which assignment to array variables in
+	  a subshell could effect the parent shell has been
+	  fixed.
+98-04-30  read name?prompt was putting a 0 byte at the end of the
+	  prompt on standard error.
+98-04-30  A bug in [[ string1 > string2 ]] when ksh was run with -x
+	  has been fixed.
+98-04-30  A bug in which the escape character was not processed
+	  correctly inside {...} when brace expansion is enabled
+	  has been fixed, for example {\$foo}.
+98-04-30  A bug in line continuation in here-documents has been
+	  fixed.
+98-04-30  The default base when not specified with typeset -i is
+	  10 in accordance with the documentation.  Previously,
+	  the value was determined by the first assignment.   
+98-04-30  A parsing bug in which a # preceded alphanumeric
+	  characters inside a command substitution caused
+	  a syntax error to be reported has been fixed.
+98-04-30  A bug in which a decimal constant represented as 10#ddd
+	  where ddd was more than five digits generated a syntax
+	  error has been fixed.
+98-04-30  A bug in here document expansion in which ${...} expansions
+	  were split across buffer boundaries has been fixed.
+98-04-30 +The sh_fun() function now takes third argument which
+	  is an argument list for the invoked discipline function
+	  or built-in.
+98-04-30 +A callback function can be installed which will give
+          notification of file duplications and file closes.
+98-04-30  When ksh is compiled on systems that do not use fork()
+	  current option settings where not propagated to sub-shells.
+
+97-06-30  --- Release ksh93f  ---
+97-06-30 +Hostnames in addition to host addresses can be given in
+	  /dev/tcp/host/port virtual file names.
+97-06-30  File name completion and expansion now quotes special
+	  characters in file names from both emacs and vi edit modes.
+97-06-30  An empty for list behave like a for list with null expansions.
+	  It produces a warning message with sh -n.
+97-06-30 +The code has been modified to work with EBCDIC as well as ASCII.
+97-06-30  A bug which would cause the secondary prompt to be
+	  displayed when a user entered a literal carriage
+	  return has been fixed.
+97-06-30  A bug which caused ksh read -s name to core dump was
+	  fixed.
+97-06-30  A bug with the expansion of \} and \] inside double
+	  quoted strings that also contained variable expansions
+	  has been fixed
+97-06-30  Changes in the ksh93e point release caused autoload
+	  functions invoked from within command substitution
+	  to fail.  This has been fixed.
+97-06-30  A bug in the processing of here-documents that could
+	  prevent variable substitution to occur after $(...) command
+	  substitution for long here documents has been fixed.
+97-06-30  A bug caused by a race condition that could cause SIGTERM
+	  to be ignored by a child process has been fixed.
+97-06-30  A bug which prevented the startup of a coprocess immediately
+	  after killing a running coprocess has been fixed.
+97-06-30  ulimit foobar, where foobar is not an arithmetic
+	  expression, now gives an error message as it did with ksh88
+	  instead of setting the file size limit to 0.
+97-06-30  A bug which could cause an interactive shell to terminate when
+	  the last process of a pipeline was a POSIX function was fixed.
+97-06-30  A bug which could cause command substitution of a shell script
+	  to core dump has been fixed.
+97-06-30  A security hole was fixed in suid_exec.
+97-06-30  Arithmetic functions such as pow() that take more than
+	  one argument, did not work if arguments other than the
+	  first contained parenthesized sub-expression.
+97-06-30  The error message from a script containing an incomplete
+	  arithmetic expression has been corrected.
+97-06-30  A bug which caused a core dump on some machines when
+	  the value of a name reference contained a positional
+	  parameter and the name reference was not defined inside
+	  a function has been fixed.
+97-06-30  Arithmetic expressions now correctly handle hexadecimal
+	  constants.
+97-06-30  A bug in which integer variables could be expanded
+	  with a leading 10# when declared with typeset -i
+	  multiple times has been corrected.
+97-06-30  A bug in which IFS wasn't correctly restored when
+	  set within command substitution has been fixed.
+97-06-30  The _ character is now considered as part of a word
+	  with the M-f and M-b emacs directives as it was in ksh88.
+97-06-30  A bug in brace pattern expansions that caused expressions
+          such as {foo\,bar,bam} to expand incorrectly have been fixed.
+
+
+96-07-31  --- Release ksh93e  ---
+96-07-31 +The math functions, atan2, hypot, fmod, and pow were added.
+96-07-31 +When a shared library is loaded, if the function lib_init()
+	  is defined in the library, it is invoked the first time that
+	  the library is loaded with builtin -f library.
+96-07-31  The k-shell information abstraction database option, KIA,
+          has been revamped.
+96-07-31  Empty command substitutions of the form $() now work.
+	  whence -v foo now gives the correct result after calling
+	  builtin -d foo. 
+96-07-31  A bug in right to left arithmetic assignment for which
+	  the arithmetic expression (( y = x = 1.5 )) did not
+	  yield 1 for y when x was declared typeset -i was fixed.
+96-07-31  printf has been fixed to handle format  containing  
+	  and/or  145 correctly.  In addition, characters following
+	  %b in the format string are no longer displayed when
+	  the operand contains .
+96-07-31  A bug in printf that could cause the %E format to
+	  produce unnormalized results has been fixed.
+96-07-31  A bug which causes some arithmetic expressions to be
+	  incorrectly evaluated as integer expressions rather
+	  that floating point has been fixed.
+96-07-31  Functions defined inside a subshell no longer remain
+	  defined when the subshell completes.
+96-07-31  The error message from sh -c ';echo foo' has been
+	  corrected.
+96-07-31  The format for umask -S has been changed to agree
+	  with the specification in the POSIX standard.
+96-07-31  A bug that caused side effects in subscript evaluation
+	  when tracing was enabled for subscripts using ++ or --
+	  has been fixed.
+96-07-31  To conform to the Posix standard getopts has been changed
+	  so that the option char is set to ? when it returns with
+	  a non-zero exit status.
+96-07-31  The handling of \} inside ${name...} has been fixed so
+	  that the  quotes the }.
+96-07-31  A bug that caused the read builtin to resume execution
+	  after processing a trap has been fixed.
+96-07-31  [[ -s file ]] has been fixed so that if file is open
+	  by ksh, it is flushed first.
+96-07-31  In some cases attributes and sizes for non exported
+	  variables weren't being reset before running a script.
+96-07-31  The value of TMOUT was affected by changes make to
+	  it in a subshell.
+96-07-31  The jobs command did not reflect changes make by
+	  sending the CONT signal to a command.
+96-07-31  The error message for ksh -o unknown was incorrect.
+96-07-31  Functions invoked as name=value name, did not use
+	  values from the calling scope when evaluating value.
+96-07-31  A bug in which the shell would reexecute previously
+	  executed code when a shell script or coprocess was
+	  run in the background has been fixed.
+96-07-31  A bug in which an empty here-document would leave
+	  a file descriptor open has been fixed.
+96-07-31  A bug in which $(set -A array ...) would leave a
+	  side effect has been fixed.
+96-07-31  A discipline function for a global variable defined
+	  within a function defined with the function keyword,
+	  incorrectly created a local variable of the same name
+	  and applied the discipline to it.
+
+95-08-28  --- Release ksh93d  ---
+95-08-28  The  character was not handled correctly in replacement
+	  patterns with ${x/pattern/replace}.
+95-08-28  A bug with read in which the line did not end with
+	  a new-line has been fixed.
+95-08-28  A bug in file name generation which sometimes
+	  appended a . for filenames that ended in / has
+	  been fixed.
+95-08-28 +If a process is waited for after a status has
+	  been returned by a previous wait, wait now
+	  returns 127.
+95-08-28  A bug with hist (fc) -e which prevented a command
+	  to re-executed after it had been edited has been fixed.
+95-08-28  A bug which prevented quoting from removing the meaning
+	  of unary test operators has been fixed.
+95-08-28  A bug with typeahead and KEYBOARD traps with the
+          MULTIBYTE option set has been fixed.
+95-08-28 +Builtin functions can take a third argument which is
+          a void*.
+95-08-28  The nv_scan() function can restrict the scope of a walk
+          to the top scope.
+
+95-04-31  --- Release ksh93c  ---
+95-04-31  The expansion of "$@" was incorrect when $1 was the null
+	  string.
+95-04-31  A bug which could incorrectly report a syntax error in
+	  a backquoted expression when a $ was preceded by \\
+	  has been fixed.
+95-04-31  A bug which prevented the shell from exiting after
+	  reporting an error when failing to open a script
+	  has been fixed.
+95-04-31  A bug that could lead to memory corruption when a
+	  large here document that required parameter or command
+	  substitution was expanded has been fixed.
+95-04-31  A bug that could cause a core dump on some systems
+	  after ksh detected an error when reading a function
+	  has been fixed.
+95-04-31  A bug which could cause a coprocess to hang when
+	  reading from a process that has terminated has been fixed.
+95-04-31  A bug which caused a script to terminate when set -e
+	  was on and the first command of and && or || list
+	  failed has been fixed.
+95-04-31  A bug with here documents inside $(...) when the delimiter
+	  word is an identifier has been fixed.
+95-04-31  A bug which caused $0 to display the wrong value when
+	  a script was invoked as an argument to the . command
+	  and the eval command has been fixed.
+95-04-31  A bug that could cause the built-in sleep to hang
+	  has been fixed.
+95-04-31  A bug introduces in 12/28/93b which caused the backslash
+	  to be removed when it was followed by digit inside double
+	  quotes in some instances has been fixed.
+95-04-31  A bug which could cause a core dump if ksh was invoked with
+	  standard input closed has been fixed.
+95-04-31  A bug which could cause a core dump if typeset -A was
+	  specified for an existing variable has been fixed.
+95-04-31  Variables that were unset but had attributes such as readonly
+	  and export were not listed with readonly, export and typeset.
+95-04-31  Several problems with signals have been fixed.
+95-04-31  A bug which prevented ulimit -t from working has been fixed. 
+	  Also, a bug in which failed ulimits could cause a core dump
+	  has also been fixed.
+95-04-31  A bug in expansion of the form ${name/#pattern/string} and
+	  ${name/%pattern/string} has been fixed.
+95-04-31  A bug which caused read -r on a line that contained only
+	  blanks to get a non-null value has been fixed.
+95-04-31  A bug introduced in the 'a' point release in which
+	  ${x='\'} expanded to  when x was unset has been fixed.
+95-04-31  A bug which prevented a trap on EXIT from being executed
+	  when the last command in a script was a function invocation
+	  has been fixed.
+95-04-31  A bug which caused an interactive shell ignore input when
+	  standard error was redirected to a file with exec,
+	  and then restored with exec 2>&1 has been fixed.
+95-04-31  An interactive shell turns on monitor mode even when
+	  standard error has been redirected to a file.
+95-04-31  A bug which could cause standard input to be incorrectly
+	  positioned for the last command of a script has been fixed.
+95-04-31  A bug in the edit modes which allowed walking back in
+	  the history file for more than HISTSIZE commands has
+	  been fixed.
+95-04-31  A bug which could cause a core dump if variable TMPDIR was
+	  changed between two command substitutions has been fixed.
+95-04-31. A bug which prevented a trap on EXIT from being cleared
+	  has been fixed.
+95-04-31  A bug fixed for the v directive in vi MULTIBYTE has been
+          fixed.
+95-04-31  Code to for IFS handling of multibyte characters has
+          been added.
+95-04-31  The displaying of multibyte strings in export, readonly,
+          typeset, and execution traces has been fixed.
+95-04-31  Variables inside functions are now statically scoped.
+	  The previous behavior was never documented.
+95-04-31  Variables inside functions are now statically scoped.
+          The previous behavior was never documented.
+95-04-31  A few changes have been made to the name-value library
+          that affect built-ins that use disciplines.  The
+          changes allow disciplines to be shared by variables
+          and should make it possible to add new disciplines
+          without recompilation.
+95-04-31 +The name-value library interface has undergone significant
+          change for this revision.  See the new nval.3 man page.
+
+94-12-31  --- Release ksh93b  ---
+94-12-31 +Variables inside functions are now statically scoped.
+          The previous behavior was never documented.
+94-12-31 +If IFS contains two consecutive identical characters belonging
+	  to the [:space:] class, then this character is treated as
+	  a non-space delimiter so that each instance will delimit
+	  a field.  For example, IFS=$'\t\t' will cause two consecutive
+	  tabs to delimit a null field.
+94-12-31 +The getopts command has a -a name option that specifies a
+	  name that will be used for usage messages.
+94-12-31  A bug which caused unset RANDOM to dump core has been
+	  fixed.
+94-12-31  A bug which prevented return for terminating a profile
+	  or ENV file has been fixed.
+94-12-31  A bug which prevented standard input from being
+	  directed to /dev/null for background jobs when
+	  monitor mode was turned off has been fixed.
+94-12-31  Statements of the form typeset -options var[expr]=value
+	  did not perform substitutions on expr as expected.
+94-12-31  A bug which prevented the shell from sending a HUP
+	  signal to some background jobs that were not disowned
+	  has been fixed.
+94-12-31  A bug which allowed a script to trap signals that are
+	  ignored at the time that the shell was invoked by exec
+	  has been fixed.
+94-12-31  A bug which could cause a core dump when a discipline
+	  function was unset within a discipline was fixed.
+94-12-31  The typeset builtin now accepts a first argument of
+	 + or - for compatibility with ksh88.
+94-12-31  For compatibility with ksh88, the results of expansions
+	  of command arguments will treat the extended character
+	  match characters ()|& as ordinary characters.
+94-12-31  A bug which caused read to fail on a file that was
+	  open for read/write with <> when the first operation
+	  was print or printf has been fixed.
+94-12-31  When a job is suspended, it is put on the top of
+	  the job list as required by the POSIX standard.
+94-12-31  The value of OPTARG when an option that required
+	  an argument but didn't have one was incorrect in the
+	  case the the option string began with a :.
+94-12-31  A bug which caused the terminal to get into a bad
+	  state with some KEYBD traps in vi-mode has been fixed.
+94-12-31  A bug which caused an invalid trap to cause a script
+	  to terminate, rather than just return an error, has
+	  been fixed.
+94-12-31  Backreferencing sub-expressions in patterns and replacement
+	  strings now works.
+94-12-31  A bug in chmod which caused the -R option to fail has
+	  been fixed.
+94-12-31 +More signal names have been added for Solaris
+
+94-06-30  --- Release ksh93a  ---
+94-06-30  An expansion bug which causes portions of a word after
+	  a $((...)) expansion that contains a nested $var expansion
+	  to be lost has been fixed.
+94-06-30  A bug that caused a core dump when a script that did not
+	  have PWD set and did a cd inside command substitution
+	  has been fixed.
+94-06-30  A bug which caused a core dump on some machines when
+	  the LANG variable was assigned to has been fixed.
+94-06-30  A bug which incorrectly handled set disciplines that
+	  performed arithmetic evaluation when the discipline
+	  was called from the arithmetic evaluator has been fixed.
+94-06-30  A bug caused by an EXIT trap inside a function that
+	  was executed in a subshell was fixed.
+94-06-30  If foo is a function, and not a program, then command foo
+	  now reports that foo isn't found rather than invoking foo.
+94-06-30  The previous version incorrectly listed -A as an
+	  invocation option.  The -A option is only for set. 
+94-06-30  A bug was fixed which caused ksh to loop when execution trace
+	  was enabled and the PS4 prompt required command substitution.
+94-06-30  A bug which could cause the job control switch character
+	  to be disabled when a script that enabled monitor mode
+	  terminated was fixed.
+94-06-30  A bug in the macro expansion global replacement operator //,
+	  when the pattern began with a [ or +( has been fixed.
+94-06-30  A bug which prevented ~ expansion from occurring when
+	  it was terminated with a colon inside an assignment
+	  has been fixed.
+94-06-30  A bug in the dot command which prevented autoload functions
+	  from working has been fixed.
+94-06-30  A bug which caused a variable to be unset if the
+	  its value were expanded inside a set discipline has
+	  been fixed.
+94-06-30  Whence -a now longer reports that a defined function
+	  is undefined.
+94-06-30  A bug on some systems in which $0 would be incorrect
+	  in scripts invoked by name has been fixed.
+94-06-30  Here documents with an empty body now work.
+94-06-30  A bug which disabled argument passing and resetting
+	  of options for a script invoked by name inside a
+	  function has been fixed.
+94-06-30  A bug in which an EXIT trap set the caller of a function
+	  would be executed if a command called inside a function
+	  was not found has been fixed.
+94-06-30  A bug which allowed a script to trap signals that are
+	  ignored at the time that the shell was invoked has
+	  been fixed.
+94-06-30  A bug which caused 2<&1- when applied to a shell built-in
+	  to leave standard input closed has been fixed.
+94-06-30  A bug which caused the shell to incorrectly parse
+	  $() command substitutions with nested case statements
+	  has been fixed.
+
+
+
+

+


libast changes

+
+
+12-03-10 misc/optget.c: HELP_index for "PLUGIN" too
+12-02-29 include/shcmd.h: PLUGIN_VERSION 20111111 for cdt disc/meth change
+12-02-29 comp/spawnveg.c: fix sigcritical() to include waitpid() for internal child
+12-02-29 malloc.c: make __malloc_hook initialization thread safe
+12-02-24 comp/iconv.c: fix winix UTF-8 vs UCS-2 over-conversion
+12-02-24 astsa/*.h: clean up header guards
+12-02-24 astsa/astsa.omk: clean up standalone old make makefile interactions
+12-02-21 misc/cmdarg.c: fix bug that set argv[0]
+12-02-10 sfvprintf.c: fix 1 byte too long buffer access
+12-02-07 malloc.c/features/vmalloc: add gnu __malloc_hook tests
+12-02-06 vmmopen.c: fix ALIGN vs sys/param.h macro conflict
+12-02-02 astlicense.c: add license.component for component-specific licenses
+12-01-31 spawnveg.c: fix transient bug that made invalid setpgid() call
+12-01-27 pathpath.c: fix buffer size math when internal allocation requested
+12-01-24 malloc.c: fix _vmkeep() bug that did not return previous state
+12-01-23 malloc.c: add VMALLOC_OPTIONS=break to try sbrk() block allocator first
+12-01-21 astlicense.c: option style only overrides default license.type
+12-01-18 malloc.c: disable multiple regions for tracing or !vmbest or ASO_SIGNAL
+12-01-12 sfpkrd.c: add __sun I_PEEK+rsh runtime workaround
+12-01-10 shcmd.h: void* => Shbltin_t*
+12-01-10 tmxdate.c: handle { n>=1000 } TM_PARTS
+11-12-21 plug up some meory links -- thanks mhlavink
+11-12-21 vmprivate.c: enclose VM_NONMEM exception in CLRLOCK(vm,0) ... SETLOCK(vm,0)
+11-12-13 aso: in -lposix for uwin, not -last -- just like vmalloc
+11-12-13 sfpoll.c: all streams SF_IOINTR => don't ignore EINTR
+11-12-13 sfdcslow.c: set SF_IOINTR
+11-12-09 malloc.c: add _vmkeep() for setlocale() intercept _SYS_setlocale_free_OK
+11-12-04 sfio: _Sfmaxr=0 (unlimited) by default; use ulimit -M|-d or SFIO_OPTIONS
+11-12-01 aso: sync to new api
+11-11-11 optget.c: move .TH to the top for --nroff to get our macros first
+11-11-11 aso,cdt,vmalloc: resync with kpv
+11-11-11 cdt: preserve bits and Dt_link_t for CDT_VERSION < 20111111
+11-10-24 sfvprintf.c: %.-ns truncate from left to n chars
+11-10-21 sfvprintf.c: fix %0s (no width) core dump
+11-10-10 aso: add _WIN32 support
+11-09-26 vmalloc: sync with kpv
+11-08-29 features/{dirent,wchar,wctype}: eliminate #include with no header
+11-08-25 #pragma prototyped tweaks -- sun4 is dead, long live sun4
+11-08-25 ftwalk.c: FTS_SLNONE => FTW_SL
+11-08-11 features/wchar: fix #include _nxt_wchar for K&R C
+11-08-04 optget.c: tweak --html rendering
+11-07-24 mime.c: add %(default)[st] default if arg == ""
+11-07-21 setlocale.c: fix debug locale to treat "<<" as two single byte chars
+11-06-14 spawnveg.c: pgid -1: new session -2: setpgrp()&&tcsetpgid()
+11-06-14 pathprog.c: add darwin _NSGetExecutablePath
+11-05-14 features/common,features/align.c: { _X86_ _X64_ } conditionals for generic uwin
+11-05-13 tm/tminit.c: tweak tzname[] prototype
+11-05-09 astlicense.c: add ". file" parent-relative include and depth 4 input stack
+11-05-05 cmdarg: update to cmdopen_20110505 api
+11-05-03 sfio/sfclose.c: make sure close() errors propagate to sfclose() return value
+11-04-20 port/astlicense.c: add { id name } keys
+11-04-15 fmtdev.c: fix to work for non-{blk,chr} special
+11-04-12 stk: change size args to size_t and stseek() offset to ssize_t
+11-04-12 sfio: sync with kpv to optimize large SF_STRING sfputr() buffer allocation
+11-03-28 misc/fts.c: fix FTS_SLNONE logic to set it when it should!
+11-03-17 misc/stk.c: fixed bug that could delete an active stack frame
+11-03-10 sfio/sfvprintf.c: add %0<width>s to preserve <width> trailing chars in string arg
+11-03-09 misc/magic.c: add %d...%s where if %d==1 then %s=="" else %s=="s"
+11-03-09 misc/magic.tab: add windows ico
+11-02-08 misc/stk.c: change STK_FSIZE to (1024*sizeof(char*)) for 64 bit normalization
+11-02-02 sfio/sfmode.c: don't call sfsetbuf() on unbuffered stream to make it unbuffered
+11-02-02 features/wchar: handle hp.ia64 va_list interactions
+11-02-02 comp/omitted.c: fix mismatch between stat() vs _stat()
+11-01-31 std/wctype,features/wctype: add to handle <wchar.h> interactions
+11-01-28 add -lw for ancient sunos
+11-01-28 include/magic.h,misc/magic.c: add MAGIC_ALL
+11-01-27 tm/tmxfmt.c,tmpoff.c: %_z for SHH:MM
+11-01-25 features/wchar: change <wctype.h> <wchar.h> ordering
+10-12-24 sfstrtof.h: fix thousand grouping bug that did not check last group
+10-12-21 pathkey.c: add win32 { /32 /64 } preroot to hash
+10-12-09 pathprog.c: handle intermediate path != '* and fix invalid pathpath() call
+10-12-01 astconf.c: fix look.standard undefined variable reference
+10-12-01 sfset.c: SF_LINE|SF_WCWIDTH => no need for sfsetbuf() to call isatty()
+10-12-01 sfsetbuf.c: cache /dev/null <dev,ino> to cut down /dev/null stat()'s
+10-12-01 optget.c: delay dictionary initialization until needed
+10-11-30 malloc.c: drop { VMDEBUG VMETHOD VMPROFILE VMTRACE } env checks
+10-11-30 port/astconf.c: eliminate esaccess() calls for OP_universe checks
+10-11-24 regcomp.c: [[=]=]] must at least match itself in non-C locales
+10-11-23 glob.h,glob.c: add GLOB_GROUP => REG_SHELL_GROUP
+10-11-20 glob.c: handle mode switches across /
+10-11-19 regcomp.c: REG_SHELL => REG_CLASS_ESCAPE
+10-11-16 vmalloc.h: add VMFL tracing to vmstrdup()
+10-11-16 ast.h: simplify VMDEBUG _BLD_DEBUG and VMFL logic
+10-11-12 tm/tmlocale.c: ast TM_* extensions default to C locale
+10-11-10 regex/regnexec.c,vmalloc/vmstat.c: eliminate strict-aliasing puns
+10-10-20 misc/translate.c: change debug translation to drop " in (a,b,c,"d")
+10-10-10 misc/glob.c: drop ancient D_FILENO(d)!=0 test and trust readdir()
+10-10-06 misc/translate.c: fix "debug" locale logic
+10-10-04 misc/magic.c: fix magic() skip check to honor the continuation
+10-10-04 regex/regcoll.c: add wchar_t* args to regcollate(), drop ucs name lookup
+10-09-28 comp/setlocale.c: add utf8_wctomb()
+10-09-28 string/chresc.c,regex/regcoll.c: fix \S[.X.] (\C[.X.] never worked!)
+10-09-24 string/chresc.c: \Cc for control c, \S[.X.] for collating symbol X
+10-09-24 string/chresc.c: { c \ } deprecated
+10-09-22 regex/regcomp.c: fix off-by-one collation class allocation bug
+10-09-20 regex/regclass.c: fix CTYPES off-by-one bug
+10-09-14 comp/conf.sh: const int conf_elements, prefix_elements;
+10-09-08 add features/sizeof => ast_sizeof.h
+10-08-31 comp/getopt[l].c: export functions for dlls
+10-08-25 port/lc.c: add features/locale check for canonical UTF-8 spelling
+10-08-20 include/ast.h: add export plugin_version() prototype
+10-08-20 comp/conf.tab: add SF_BUFSIZE
+10-08-11 misc/conformance.c: conformance(0,0) => "standard"
+10-08-11 misc/conformance.c: check ast_env_serial for dynamic astconf() changes
+10-08-11 port/lcgen.c: remember to fudge Table_t.count for synthesized entries
+10-08-04 include/ast.h,comp/setlocale.c: add { debug C.UTF-8 } mbalpha() mbwidth()
+10-08-02 misc/translate.c: add NLSPATH message cache check 
+10-07-29 string/fmtint.c: fix nasty bug that rendered "1000" as "1"
+10-07-27 setlocale,lsgen,localeconv: handle C vs C_EU decimal thousands sep
+10-07-26 misc/optget.c: fix interaction with nested plugin/builtin calls
+10-06-29 string/strtoi.h: strton() multiplier 1 => power of two suffix
+10-06-28 features/wchar: handle systems that require __va_list => va_list
+10-06-28 comp/conf.tab: another PID_MAX tweak -- default to 99999 for most
+10-06-28 port/astconf.c: lone "CONFORMANCE = standard" => all defaults standard
+10-06-25 misc/optget.c: avoid sfprints() call during initialization
+10-06-01 features/api, ast_api.h: formalized forwards/backwards api compatibility
+10-06-01 _AST_API=20100601: add size_t args for all path*() output buffers
+10-06-01 comp/setlocale.c: handle C.UTF-8 test locale
+10-06-01 include/mc.h: add size_t to mcfind() for result buffer (internal api)
+10-06-01 use strlcpy() instead of strncpy()
+10-05-28 include/ast_version.h: add AST_PLUGIN_VERSION for dllplugin()
+10-05-28 include/shcmd.h: add SH_PLUGIN_VERSION for dllplugin()
+10-05-28 misc/conformance.c: add conformance(3)
+10-05-28 misc/optget.c: add [(id1|id2)...] conformance("id1|id2",0) conditionals
+10-05-25 include/sfhdr.h: adjust SF_NMAP according to _ptr_bits
+10-05-25 include/shcmd.h: add sh_builtin() macro for lib_init() table initialization
+10-05-21 misc/optget.c: --html \bfoo::bar([[:digit:]][[:upper:]]*) => foo-bar.html
+10-05-15 include/proc.h,misc/procopen.c: add PROC_ORPHAN
+10-05-09 misc/optget.c: add --???MAN[section] --???SECTION
+10-05-07 sfio,stdio: fix all snprintf() variants to handle buf==0 and/or n==0
+10-05-04 string/fmtesc.c: add mb iswsoace() and iswcntrl() quoting checks
+10-05-03 fix LC_MESSAGES catalog lookup bugs, check for $set==3, accept $set==1
+10-04-30 string/chresc.c: add chrexp() for FMT_EXP_*
+10-04-30 string/stresc.c: add strexp() for FMT_EXP_*
+10-04-30 string/chresc.c: fix \uXXXXY bug that consumed Y
+10-04-22 misc/optget.c: check for html entities in <A name="...">
+10-04-22 misc/getcwd.c: add features/syscall check for SYSGETCWD() { linux solaris }
+10-04-22 string/stresc.c: wide chars absent locale guidance default to UTF-8
+10-04-12 port/mnt.c: favor bsd getfsstat() over getmntinfo()
+10-04-11 string/strtoi.h: k (1000) and ki (1024) now differentiated
+10-04-10 misc/recstr.c: fix 'd[delimiter]' parse
+10-04-08 include/vmalloc.h,vmalloc/vmstat.c: add Vmstat_t.mode region mode bits
+10-04-05 misc/fts.c: drop 1997-01-07 fts_open()=0 is one file and stat() fails
+10-04-05 misc/optget.c,optlib.h: add Optpass_t.release for --nroff .TH
+10-04-02 misc/optget.c: fix $'[-n?..]' --version bug
+10-04-02 regex/regcomp.c: ~(X) => REG_EXTENDED|REG_AUGMENTED, ~(PU) instead of ~(U)
+10-03-24 misc/procopen.c: add PROC_FD_CTTY(fd)
+10-03-24 path/pathtemp.c: fix pointer => int casts
+10-03-15 regex/regcache.c: fix 1 byte buffer overflow (didn't count trailing  )
+10-03-08 features/tvlib: fix utimensat probe to include all macros/structs
+10-03-07 features/lib: change stream_peek to test pipes only
+10-03-07 string/strelapsed.c: fix next char return overrun
+10-03-06 tm/tvtouch.c: use runtime fallback if utimensat() fails with ENOSYS
+10-03-05 path/pathtemp.c: add pfx /seed for regression testing
+10-03-04 vmalloc/vmwalk.c: add user supplied handle arg
+10-03-04 path/pathtemp.c: properly handle mktemp()-style *+(X) templates
+10-03-03 include/ast_getopt.h: remove NULL guard - _AST_GETOPT_H now handles it
+10-02-24 comp/getopt.h: fix ast_std.h interactions
+10-02-24 vmalloc/malloc.c: empty { VMALLOC_OPTION VMDEBUG ... } => no debug!
+10-02-02 string/base64.c: fix corner case output buffer overflow
+10-02-02 features/fs: sys/mnttab.h requires stdio.h on some systems!!
+10-02-01 misc/optget.c: uppercase --html heading -- doh
+10-01-29 misc/optget.c: [+NAME?...] overrides error_info.id for >= STYLE_man
+10-01-25 vmalloc/vmprivate.c: fix seg ptr initialization bug (24 years old!!)
+10-01-20 misc/optget.c: handle nested {...} rendering
+10-01-20 misc/state.c: add ast.version for runtime api version
+10-01-20 port/astconf.c: "_AST_VERSION" now returns ast.version
+10-01-20 include/ast_std.h: add ast.version for runtime api version
+10-01-19 astlicense.c: add epl
+10-01-01 vmalloc: VMALLOC_OPTIONS env var for all runtime options
+10-01-01 include: change some <ast.h> refs to less intrusive <ast_*.h>
+10-01-01 setlocale.c,translate.c,fmterror.c: AST_LC_internal retains prev state
+10-01-01 comp/setlocale.c: AST_LC_setenv defers to LC_ALL (for sh)
+10-01-01 ast_std.h: add { AST_LC_internal AST_LC_setenv }
+09-12-24 comp/setlocale.c: fix setlocale(LC_ALL,"") when already initialized
+09-12-17 misc/optget.c: handle mixed solaris usage="x:f:(in)yo:(out)"
+09-12-11 regex/regcomp.c: posix semantics for [z-a]
+09-12-11 regex/regcomp.c: fix BRE/ERE ^^ logic
+09-12-11 regex/regcomp.c: fix regcomb() for REG_LEFT|REG_RIGHT
+09-12-11 regex/regcomp.c: bm complete=0 if REX_END
+09-12-11 comp/sigflag.c: add with npt check in features/sig.sh
+09-12-11 tm/tminit.c: fix _tzset_environ logic
+09-12-09 tm/tmlocale.c: include "ast_nl_types.h" to pull nl_langinfo in!
+09-12-04 features/options: add "opt map-libc" check
+09-12-03 tm/tmxdate.c: fix 'next month final day' for dec -> jan
+09-11-21 misc/magic.tab: add gimp XCF
+09-11-20 vmalloc/vmtrace.c: add pid to assertion disgnostics
+09-11-11 regex.h,regcomp.c: add REG_CLASS_ESCAPE,  inside [...] literal by default
+09-11-03 regex/regcache.c: change to variable length pattern strings
+09-10-28 include/error.h: fix ERROR_translate() arg parens
+09-10-26 port/lcgen.c,comp/setlocale.c: handle LANG init after LC_* already defined
+09-10-05 _sfopen.c: add but ignore 'F' flags for stdio compatibility
+09-09-28 fts.h,ftwalk.h,fts.c: promote { namelen pathlen level } to (s)size_t
+09-09-28 locales: add AST_LC_LANG for $LANG
+09-09-28 setlocale.c: fix logic for dynamic { LANG LC_ALL LC_* } changes
+09-09-17 include/sfio.h,sfio/sfwalk.c: add sfwalk()
+09-09-09 sfio/sfputr.c: add SIGPIPE hang fix
+09-08-24 sfio/sfreserve.c: fix SF_UNBOUND logic with pushed streams
+09-08-18 include/ast_std.h,ast.h: add ast.mb_sync to sync mbchar() after error
+09-08-17 comp/setlocale.c: add AST_LC_utf8 and { utf8_mbtowc() utf8_mblen() }
+09-08-11 comp/setlocale.c: treat "en"/"en_US" AST_LC_MESSAGES as "C"/"POSIX"
+09-08-10 vmalloc/vmhdr.h: add user-defined _AST_PAGESIZE and computed VMHEAPINCR
+09-08-09 comp/conf.tab: add NPROCESSORS_MAX
+09-07-29 astlicense.c: fix first name=value logic error
+09-07-22 string/fmtip6.c: don't drop trailing 0 in 44::1:0:0
+09-06-30 port/astconf.c: standard PATH_RESOLVE is "physical" (not "metaphysical")
+09-06-19 vmalloc: sync with kpv
+09-06-19 include/shcmd.h: add sh_context(p) cast
+09-06-11 misc/magic.tab: differentiate pc 386 32/64 bit dll/exe/obj
+09-06-06 port/astconf.c: fix look->name null pointer reference
+09-06-05 port/astconf.c: fix 'UNIVERSE = value' synthesize logic
+09-05-25 tm/tmxduration.c: add
+09-05-08 comp/syslog.c: add _UWIN /var/log/syslog preference
+09-05-01 comp/setlocale.c: fix _UWIN intercepts to return NiL on unknown locales
+09-04-27 sfio/sfpool.c: fix bug that did not return pool on delete
+09-04-22 include/regex.h,regex/regcomp.c: add REG_REGEXP <regexp.h> compatibility
+09-04-15 tm/tmxdate.c: handle "4th thursday in november"
+09-03-31 string/strvcmp.c,string/strnvcmp.c: add version strcmp(3)
+09-03-31 string/strpcmp.c,string/strnpcmp.c: add path prefix strcmp(3)
+09-03-29 misc/optget.c: clean up num = number casts
+09-03-04 tm/tmxmake.c: add tmxtm() with zone override
+09-03-03 tm/tmxfmt.c: add %(...)<c>, specifically %(...)z for output zone
+09-02-22 tm/tmxdate.c: add iso P... durations
+09-02-02 path/pathprog.c: add
+09-02-02 misc/opthdr.h,optget.c: fix flags mixup, handle old '-' as option
+09-02-02 sfio/sfprints.c: fix sfvaprints() return value to not count trailing ' '
+09-02-02 misc/cmdarg.c: handle !defined(ARG_MAX)
+09-02-02 port/astconf.c: fix UNIVERSE overwrite of null[] value!
+09-01-31 features/sys: drop header sys/localedef.h
+09-01-28 include/fs3d.h,misc/fs3d.c: mount() => fs3d_mount() for diff std prototypes
+09-01-14 misc/fts_open.c: delay top list reorder until first fts_read()
+09-01-14 include/ls.h: LS_W_INUMBER => 9 to accomodate large st_ino
+09-01-14 misc/optget.c: expand STYLE_usage input text
+09-01-09 features/uwin,stdio/_stdfun.c: iffe for _p__iob and __p__iob
+09-01-09 misc/magic.tab: add ISO filesystem image entries
+09-01-07 string/strtoi.c: strtol() etc. do not consume [lLuU] suffix -- thanks jkf
+09-01-07 sfio/sfstrtof.h: strtod() etc. do not consume [fFlL] suffix -- thanks jkf
+09-01-05 string/strlcat.c: fix logic to match docs (not that easy)
+08-12-30 tm/tmxdate.c,include/tm.h: add TM_WORK { "workday" "working" "work" }
+08-12-28 sfio/sfcvt.c: fix 'a' format rounding
+08-12-21 tm/tmdata.c: add 2008-12-31+23:59:60-0000 leap second event
+08-12-19 tm/tmxdate.c: check for dates near the epoch rolling back to the future
+08-12-19 tm/tmxfmt.c: change %s for now==0 to be the epoch
+08-12-07 include/ast_std.h,misc/getenv.c: no _ast_getenv for uwin ast54 compatibility
+08-12-07 tm/tmxfmt.c: add %[_][EO]K for [space pad] [full|long] iso
+08-12-07 sfio/sfvscanf.c: fix ok[] short by one allocation
+08-12-07 comp/setlocale.c: fix off by one composite initialition loop test
+08-12-07 path/pathkey.c: fix off by one loop test
+08-12-04 vmalloc/vmbest.c: catch sbrk() wraparound
+08-12-04 comp/spawnveg.c: clean up attrs on failure too
+08-11-04 regex/regcomp.c: fix locale [!-...] and [^-...] re-initialization
+08-11-04 stdio: add flockfile.c ftrylockfile.c funlockfile.c
+08-10-24 port/astconf.c: handle multiple/trailing '/' in universe initialization
+08-09-10 misc/magic.c: handle old vcodex() indices
+08-09-10 sfio/sfvprintf.c: drop SF_WCWIDTH, use %Lc or %Ls instead
+08-09-05 Makefile: ibm.risc joins the :NOOPTIMIZE: crowd
+08-09-04 regex/regnexec.c: fix nested delimiter match beyond end of subject
+08-08-20 misc/fts.c: fix st_nlink stat() optimization logic
+08-08-19 sfio/sfpkrd.c: workaround macosx recv(PEEK) data consumption on non-socket
+08-08-19 strn?tol?d: handle long double with smaller exponent range than double
+08-08-18 sfio/sfcvt.c: eliminate excessive multiplies and integral overprecision
+08-08-11 tm/tmxfmt.c: handle %10N and %010N
+08-08-06 include/shcmd.h: add 'int invariant;' for builtin invariant arg count
+08-08-05 features/ndbm: favor sleepycat ndbm compatibility
+08-07-21 include/glob.h,misc/glob.c: GLOB_STARSTAR only forces lstat on chdir
+08-07-17 sfio: sync with kpv
+08-07-17 misc/optget.c: call astwinsize() each time terminal width required
+08-07-16 sfio/sfvscanf.c: fix %% to skip leading space per posix
+08-07-16 vmalloc/vmbest.c: add VMCHECK=m, VM_mmap to favor mmap() alloc
+08-07-16 features/stdio,stdio/f(read|write).c: size_t return value!! ouch
+08-06-24 tm/tmxfmt.c: fix %z to handle tm_isdst -- doh
+08-06-24 misc/astintercept.c,misc/getenv.c: split from misc/setenviron.c
+08-06-17 misc/setenviron.c: add { astintercept() getenv() }
+08-06-09 tm/tmlocale.c: use _DATE_FMT if defined for TM_DEFAULT
+08-06-06 misc/optget.c: handle sub-component about details
+08-06-04 misc/optget.c: fix [-n?..#0093; version parse
+08-06-04 include/debug.h,misc/debug.c: merge with kpvdebug.h
+08-06-02 features/ndbm: add to tame dbmlib.iffe replication
+08-06-01 comp/resolvepath.c,realpath.c: fix resolvepath() return value type
+08-05-22 tm/tmxdate.c: fix a few ordinal/last/this/next bugs
+08-05-18 string/fmtre.c: fix omitted stack var initialization bug
+08-05-14 regex/regcomp.c,regcoll.c: fix UTF-8 collation sequence logic
+08-05-11 tm/tmxfmt.c: :NOOPTIMIZE:, otherwise %Q/../../ fails
+08-05-01 tm/tmxdate.c: mon 1..12 => mon[13] -- doh
+08-04-30 misc/glob.c,reegex/regcomp.c: ~(R) => ~(O) to avoid pcre clash
+08-04-24 port/astconf.c: 'name = value' does assignment without system init
+08-04-15 port/astconf.c: SC#N treated like 'SC(N)'
+08-04-14 misc/optget.c: clean up nroff output
+08-04-01 port/astconf.c: add RELEASE => /proc/version fallback
+08-03-30 misc/optget.c: [-n]... to enable -number & +number options
+08-03-06 misc/optget.c: ---* and +++* are now operands
+08-03-06 misc/errorx.c: fix old error_info.translate workaround
+08-02-05 regex/regcomp.c: allow REG_SHELL {,n}... => {0,n}...
+08-02-27 misc/stk.c: top element during allocation relocated to top 
+08-02-18 include/ip6.h,string/strtoip6.c,fmtip6.c: add ipv6 addr support
+08-02-14 regex/regsubexec.c: fix null match (tricky)
+08-02-14 regex/regsubcomp.c: fix SRE to match ksh
+08-02-11 comp/spawnveg.c: return proper errno on [v]fork() failure
+08-02-11 tm/tmxdate.c,tmdata.c: handle more ISO 8601:2000 forms
+08-02-02 regex/reglib.h: add REGMULTIREF to REG_COMP
+08-02-02 string/strmatch.c: fix str="" pat="" sub values
+08-01-31 comp/conf.sh,conf.tab: handle /bin/sh  in read data, redir subshell
+08-01-18 misc/magic.tab: amd-x68, 64-bit => x86-64
+08-01-18 string/strnton.c,strntonll.c: add
+07-12-10 string/strelapsed.c: "0" is a valid elapsed time!
+07-12-02 sfio/sfreserve.c: preserve SF_SHARE sfrd() via sfreserve(f,0,0)
+07-11-21 comp/setlocale.c: add sjis_mbtowc() to work around [\~] translation
+07-11-15 features/signal.c: RT(1) .. RT(MAX-1) => RTMIN+1 .. RTMAX-1
+07-11-14 features/float: favor sscanf() due to gnu strto[l]d() nan bugs
+07-10-31 regex/regcomp.c: fix REX_COLL_CLASS node allocation size
+07-10-31 sfio/sfcvt.c: use signbit() if available
+07-10-31 features/isoc99: _ISOC99_SOURCE tests
+07-10-31 port/astmath.c: add -DN=8 for signbit()
+07-10-31 sfio/sfstrtod.h: don't forget about -0.0
+07-10-26 features/map.c: add { optopt optarg optind opterr }
+07-10-26 features/stdio: add _filbuf => _ast__filbuf
+07-10-26 comp/getsubopt.c: fix #undef that interfered with <ast_map.h>
+07-10-26 regex/regcomp.c: fix bug that missed ')' in ~(F)...
+07-10-12 port/astconf.c: fix CONF_ALLOC 16 bit overflow
+07-10-12 misc/fts.c: fix fts_close() to free the handle -- doh
+07-10-11 comp/setlocale.c: second and subsequent setlocale(*,"") reverts to previous
+07-10-11 path/pathprobe.c: add vfs ST_NOSUID check
+07-10-10 comp/conf.tab: add a few more xpg6 deferrals
+07-09-28 astsa: update to share with mainline src via _PACKAGE_astsa
+07-09-25 sfio/sfgetr.c: no limit on string stream line size
+07-09-25 sfio/sfextern.c: increase _Sfmaxr to 256*1024
+07-09-18 misc/procopen.c: tighten up SIGCHLD logic between parent/child
+07-09-18 misc/signal.c: unblock SIG_DFL after setting handler, sig<0 => don't unblock
+07-09-13 misc/fs3d.c: no $LD_PRELOAD => no 3d and avoids invalid mount(2) call
+07-09-11 vmalloc: vmstat(0,0)==1 => region in use, drop VM_primary|VM_secondary
+07-09-05 misc/recstr.c: handle [lL] gobbled by strtol() -- ouch
+07-08-17 path/pathprobe.c: handle '\r' in VERSION string
+07-07-17 regex/regcache.c: regcache(0,n,0) extends cache to size n (no shrinking)
+07-07-16 tm/tmdata.c: add 2005-12-31, drop 1999-12-31 (where did that come from?)
+07-05-21 tm/tmxfmt.c,tmxscan.c: %F => %L (TM_DEFAULT); %F => %Y-%m-%d
+07-05-15 sfio/sfvprintf.c: %h? and SFFMT_SHORT => raw bytes
+07-05-09 features/signal.c,features/siglist: use kill -l & strsignal()
+07-04-25 misc/optctx.c: add for opt_info switching
+07-04-24 misc/cmdarg.c,include/cmdarg.h: add CMD_CHECKED, CMD_SILENT
+07-04-24 misc/procopen.c,include/proc.h: add PROC_CHECK
+07-04-24 misc/procrun.c: add flags arg (current use PROC_ARGMOD)
+07-04-24 misc/cmdarg.c,include/cmdarg.h: move from src/cmd/tw
+07-04-20 port/(lclang.h|lc.c|mc.c|lclib.h|lcgen.c): separate lctab.c
+07-04-20 comp/conf.sh: defer to systems without 'grep -q' -- sigh
+07-04-20 comp/conf.sh: probe for LL integer constant initializer suffix
+07-04-20 include/syslog.h: <namval.h> => <ast_namval.h> for win32
+07-04-20 ast_namval.h: add as copy of include/namval.h for win32
+07-04-19 comp/conf.tab: fix SVID SI entries to probe SI_* (not _SI_*)
+07-04-13 tm/tmxdate.c,tm/tmzone.c: handle [-+]0000 UTC zone offset
+07-04-11 sfio/sfvprintf.c: add %F, propagate SFFMT_UPPER
+07-04-11 sfio/sfcvt.c: handle SFFMT_UPPER => nan/inf vs. NAN/INF
+07-04-02 comp/conf.tab,comp/conf.sh: add C/POSIX <stdint.h> symbols
+07-03-28 misc/optget.c: fix l10n --?-
+07-03-25 features/common: fix { ast_std.h ast_map.h stdint.h } logic
+07-03-21 error.h: move from error_info to (*_error_data_)
+07-03-21 misc/error.c: add errorctx() for error_info switching
+07-03-21 option.h: move from opt_info to (*_opt_data_)
+07-03-19 regex/regdecomp.c: fix REX_ONECHAR escapes and add REX_KMP
+07-03-11 tm/tmxscan.c,regex/regnexec.c: fix strict-alias transgressions
+07-02-27 comp/conf.sh: handle native getconf invalid numeric values
+07-02-21 comp/conf.sh,comp/conf.tab: handle SSIZE_MAX vs _POSIX_SSIZE_MAX
+07-02-20 sfio/sfvprintf.c: handle SF_WCWIDTH justification
+07-02-14 features/common: cover <stdint.h>, move to int_(bits)_t
+07-02-14 include/int.h: drop
+07-02-14 include/sfio.h: add SF_WCWIDTH
+07-02-12 comp/conf.sh: fix CONF_LIMIT bug that missed ULONG_MAX etc.
+07-02-12 comp/conf.tab: *LONGLONG* => *LLONG* to match posix
+07-02-12 features/float: *LONGLONG* => *LLONG* to match posix
+07-02-12 port/astconf.c: handle CONF_LIMITS_DEF with no deferral
+07-02-12 stdio/vasprintf.c: add trailing ' ' -- doh
+07-02-04 string/fmtelapsed.c: fix naive multi month/year logic
+07-02-02 misc/optget.c: add --??posix for getopts(1)/getopt(3)
+07-01-26 string/chresc.c: use mbchar()
+07-01-26 misc/optget.c: handle "o:-:" usage for old-style long options
+07-01-22 sfio/sfdisc.c,sfpool.c: handle push on streams with pending peek
+07-01-22 include/sfio.h: mv Sfieee_t to sfio/sfhdr.h
+07-01-17 tm/tmxfmt.c: fix terminating nil logic which clobbered size-1
+07-01-11 misc/stk.c: a 2 day marathon bug fix (can we release now dr ek?)
+07-01-05 comp/spawnveg.c: posix_spawnattr_setflags(POSIX_SPAWN_SETPGROUP)
+07-01-05 misc/error.c: fix multibyte vs. printable logic
+07-01-01 comp/conf.sh: LC_ALL=C
+06-12-26 tm/tmxdate.c: handle nn*.nnnn* == sec.ns
+06-12-20 features/libpath.sh: generalize sol.* LIBPATH patterns
+06-12-18 comp/setlocale.c: include ast_standards.h and ast_wchar.h !
+06-12-12 string/strperm.c: octal modes are absolute!
+06-12-11 comp/conf.tab: always defer ARG_MAX
+06-12-07 Makefile: fix conftab.c generation CCFLAGS to match build - doh
+06-12-04 sfio/sfcvt.c: fix (int) vs. (long) cast mismatches
+06-12-01 comp/conf.tab: add changes to cover solaris { bin xpg4 xpg6 }
+06-12-01 regex/reginit.c: adjust { SRE KRE } escaped (){}*? inside [...]
+06-12-01 sfio/sfcvt.c: add signbit/copysign tests
+06-11-22 comp/spawnveg.c: fix _real_vfork logic to work with 3d
+06-11-20 features/common: bias _ast_int8_t "long long" before "__int64"
+06-11-20 string/strperm.c: fix X to work with all ops (not just +)
+06-11-15 astconf.c,conf.tab: add CONF_DEFER_* for variable constants
+06-11-11 port/astconf.c: validate path arg w.r.t. underlying calls
+06-11-11 comp/conf.sh: fix S CONF_STANDARD bug, add D to defer to native
+06-11-11 comp/conf.tab: add D to defer to native
+06-11-01 include/vmalloc.h: avoid VM_FLAGS sys/v*.h clash
+06-11-01 include/ast.h: add FMT_PARAM for fmtquote()
+06-10-31 disc/sfdcseekable.c: add SFSK_DISCARD for seekable window control
+06-10-31 comp/spawnveg.c,features/lib: handle posix_spawn exit status 127
+06-10-30 features/lib: fix posix_spawn() fork() prototype conflicts
+06-10-30 string/fmtscale.c: fix 1024 rounding bugs
+06-10-27 disc/sfkeyprintf.c: handle 'i' (=='d') -- oops
+06-10-26 sfio/sfvprintf.c: %#d => fmtscale(1000), %#i => fmtscale(1024)
+06-10-26 features/map.c: _map_libc cleanup
+06-10-26 features/fcntl: add to the circle of trust
+06-10-26 features/sys: add <sys/socket.h> socklen_t
+06-10-26 include/regex.h: handle include before <ast_map.h>
+06-10-25 astconf "SHELL" => "SH" to avoid _POSIX_SHELL conflict
+06-10-25 comp/conf.*: drop no-op duplicate conftab.c entries
+06-10-18 string/fmtscale.c: 1000: n[.]n[n](kMGTPE), 1024: n[.]n[n](KMGTPE)i
+06-10-11 ast_std.h: now implies <sys/stat.h> (did on most before anyway)
+06-10-11 strtoi.h: ignore sign for 0, validate scale shift
+06-10-11 strdup.c,vmstrdup.c: handle 0 arg
+06-10-11 add sfstruse()/sfstropen() error checks
+06-10-10 misc/procopen.c: envv==environ => don't modify environ
+06-10-10 misc/procclose.c: return valid exit(1) status
+06-10-06 port/astconf.c,comp/conf.sh,comp/conf.tab: play nice with getconf(1)
+06-10-01 comp/conf.tab: SHELL default checks { _CS_PATH } X { ksh ksh93 sh }
+06-10-01 comp/conf.sh: export CONF_getconf to shell actions
+06-10-01 comp/putenv.c: always enable setenv() for procopen()
+06-10-01 misc/procopen.c: use pathshell() or astconf("SHELL",0,0) if PARANOID
+06-10-01 path/pathshell.c: localize the shell path patterns and accept ksh93
+06-09-28 Makefile: avoid ast <stdio.h> vix iffe -X ast -- doh
+06-09-27 regex/regdecomp.c: add
+06-09-26 regex/regcomp.c: handle KRE ~(...)<invalid-kre>
+06-09-25 reorganize to avoid native header intercepts
+06-09-15 uwin/crypt.c: _UWIN only!
+06-09-14 Makefile: tweak the ast_common.h bootstrap again (finally?)
+06-09-14 misc/optget.c: noncommercial => OPT_proprietary
+06-09-12 string/strelapsed.c: fix multi-char qualifier parse
+06-09-12 string/strtoi.h: drop [cClLqQwW] multipliers
+06-09-11 misc/optget.c: add numeric arg validity check
+06-09-07 misc/optget.c,tm/tmfix.c: fix uninitialzed var refs
+06-09-05 path/pathprobe.c: add version header verification
+06-08-01 Makefile: handle iffe vs FEATURE/common vs ast_common.h
+06-08-31 Makefile: add ast_map.h to the bootstrap list
+06-08-30 misc/glob.c: fix ~(E)re bug that stripped ~(E) before regcomp
+06-08-30 include/ast.h: add { integralof(x) pointerof(x) }
+06-08-27 string/strelapsed.c: fix off-by-one (too little) parse bug
+06-08-25 misc/optget.c: 0*<n>.* numeric option args => <n>.*
+06-08-22 misc/glob.c: handle ~(...) pattern options
+06-08-16 string/strelapsed.c: fix off-by-one (too far) parse bug
+06-08-16 regex/regcomp.c: accept but ignore ~(N)
+06-08-14 features/libpath.sh: add solaris LD_LIBRARY_PATH_64 check
+06-08-05 sfio/sfpool.c: pool SF_READ|SF_WRITE loop fix
+06-08-02 misc/fts.c: fix FTS_NOSTAT optimization to check for ..
+06-07-28 include/glob.h: add gl_extra for user globlist_t expansion
+06-07-27 features/common: #include "ast_map.h"
+06-07-26 comp/fnmatch.[ch]: allow <ast_map.h> to map fnmatch()
+06-07-22 cdt: snarf from kpv
+06-07-17 string/strperm.c: perm==-1 skips umask(1)
+06-07-17 sfio/sfvprintf.c: handle format invalid mb seq
+06-07-17 regex/regcomp.c: inline REG_SHELL => anchored, otherwise not
+06-07-17 regex/regcomp.c: inline B|G:basic E:REG_EXTENDED F|L:REG_LITERAL
+06-07-17 regex/regcomp.c: inline l:REG_LEFT r:REG_RIGHT
+06-07-17 regex/regcomp.c: inline a:REG_LEFT|REG_RIGHT p:~REG_LENIENT
+06-07-17 string/chresc.c: add \Uxxxxxxxx
+06-07-17 sfio/sfstrtof.h: ignore thousands sep after decimal
+06-07-17 string/tokline.c: splice() => spliceline() for bsd
+06-06-27 features/float,sfio/sfcvt.c: fix Nan logic
+06-06-27 port/astmath.c: fix long double isnan() test
+06-06-27 features/map.c: _map_libc for std => _ast_std
+06-06-25 string/strperm.c: handle posix = w.r.t. umask
+06-06-19 port/mnt.c,features/fs: handle netbsd getmntent api change
+06-06-18 regex/regstat.c: add REG_LITERAL check
+06-06-11 cdt/dtview.c: update from kpv
+06-05-31 sfio/sfhdr.h: fix _SFOPEN() typo
+06-05-09 comp/conf.sh: add native getconf -a names to the mix
+06-04-28 misc/optget.c: add solaris long option name compatibility
+06-03-09 string/strmatch.c: add REG_ADVANCE => REG_* flags
+06-02-14 comp/iconv.c: fix uwin iconv_list() /reg/ generator
+06-02-10 port/astconf.c: relax standard prefix filter
+06-02-08 sfrd.c,sfsync.c: lock logic bug fix
+06-02-01 port/astlicense.c: add { parent incorporation }
+06-01-26 port/astconf.c: fix { LIBPREFIX LIBSUFFIX } length
+06-01-06 features/lib: change _UNIV_DEFAULT probe to use cross{...}
+06-01-04 misc/stk.c: fix n**2 realloc behavior
+06-01-01 include/sfio.h: export { _Sfi _Sfmaxr }
+05-12-13 string/chresc.c: handle \C-X => control-X, \M- => ESC
+05-11-22 regex/regcache.c: add, convert string/strmatch.c to regcache()
+05-10-06 string/ccmap.c: update ebcdic-u to be idempotent
+05-09-28 vmalloc: snarf from kpv; fixes large block brk() thrashing
+05-09-26 misc/magic.c,misc/magic.tab: handle latest vcodex header
+05-09-12 misc/optget.c: reset opt_info.offset on error
+	 string/strtoi.h: strton() '.' multiplier only if m>1
+	 string/fmtesc.c: add unadvertized FMT_PARM for FMT_SHELL
+05-09-09 string/fmtesc.c: fix FMT_SHELL logic w.r.t. [$`]
+05-08-11 string/strerror.c: fix { sys_errlist sys_nerr } prototypes
+05-08-03 sfio: snarf sfvaprints sfaprints
+05-07-21 port/astconf.c: retain most recent synthesized lookup
+05-07-20 sfio/sfsetbuf.c: default file io size now 64K on all systems
+05-07-17 ccmap*: add microfocus cobol EBCDIC_U
+05-06-29 regex/regcomp.c: fix the A & B inline flag logic
+05-06-15 include/recfmt.h: add fs format flag to fmtrec()
+05-06-14 error.c: add ERROR_OPTIONS { break count match }
+05-06-07 features/stdio: drop FEATURE/limits to fix bootstrap circular dep
+05-06-02 features/*,Makefile: drop vestigel iffeio.h bootstrap workaround
+05-05-31 string/fmtbuf.c: unlock (spin) before each return -- doh
+05-05-30 sfio/sfpkrd.c: work around macos 10.4 recv(MSG_PEEK) bug
+05-05-27 regex: add REX_NEST (?%[S.][T.][OT])
+	 magic.tab: ammend bsd db magic
+05-05-23 regex: REX_NEST (?%[D.][E.][L.][Q.][oc]...)
+05-05-21 regex: state.fold[] is now locale specific -- doh
+05-05-19 regex: add REX_NEST (?%\\()<>[]""...) %(...) nested match
+05-05-15 recfmt.h: add recstr() reclen() fmtrec()
+05-05-13 optget.c: allow boolean options to take numeric values
+05-05-12 recfmt.c: add to recfmt.h, adjust Recfmt_t encodings
+05-04-30 sfio: add sfmaxr(), default 64K
+05-04-22 comp/omitted.c: fix magic() logic for files < 512 bytes
+05-04-20 cdt: snarf update from kpv; void* Dt_t.user added
+	 misc/error.c: library => ERROR_LIBRARY
+05-04-19 regex/regcomp.c: handle REG_SHELL [^...] == [!...]
+05-04-11 tm/tmxscan.c: handle yyy.mm.dd[-+.]hh.mm.ss.nnnnnn
+05-04-07 regex/regnexec.c: fix out of bounds boundary check -- ouch
+	 features/align.c: add jmp_buf to the alignment mix (ia64)
+	 vmalloc/vmhdr.h: add jmp_buf to the alignment mix (ia64)
+05-03-31 misc/optget.c: fix option { - _ } separator matching
+05-03-30 misc/glob.c: eliminate superfluous GLOB_NOMATCH stat() calls
+05-03-24 port/astwinsize.c: include <sys/ioctl.h> if possible
+05-03-23 string/ccmap.c: add ebcdic-m mvs cobol table
+05-03-11 comp/omitted.c: handle utime[s](const,const)
+	 comp/conf.tab: fix linux PID_MAX probe
+05-03-10 comp/setlocale.c: LC_* value "" => unset -- doh
+	 misc/optget.c: reorder _PACKAGE_astsa code for msgcc
+05-03-08 misc/optget.c: delete leading space in STYLE_nroff output
+05-03-07 sfio/sfhdr.h: drop extern _sfdscan -- clashes with sfvscanf.c static
+05-03-01 tm/tminit.c: add tmlocaltime() for tzset() getenv() override workaround
+05-02-20 features/tvlib: tmsettimeofday only for systems that have settimeofday
+	 features/float: fix mvs.s390 NaN tests
+05-02-18 tm/tmxmake.c: fix <0 west of GMT bug that warped to 1800's -- wow
+05-02-11 port/mnt.c: handle lynxos MOUNTED=/etc/fstab
+05-02-08 features/float,sfio.h,sfcvt.c,sftable.c: add INF and fix NAN
+05-02-04 features/lib: add _std_strtol (for lynxos)
+	 include/ast_std.h: add _std_strtol tests
+	 comp/strtod.c: #define S2F_function strtod
+	 misc/signal.c: fix ancient bsd SV_INTERRUPT vs. SV_ABORT clash
+05-01-11 sfio/sfmove.c: try to seek(fr) when fw==0
+	 comp/omitted.c: intercept utimes() too
+	 comp/omitted.c: add DOSPATHVARS env var path value conversions
+	 features/tvlib,tm/tvtouch.c: check for utimets()
+	 misc/optget.c: handle '-' or '_' option word separators
+	 sfio/_sfopen.c: allow stream mode changes after initialization
+	 sfio: sync with kpv: SF_SYNCED fix for ksh input loss bug
+05-01-09 tm/tmxfmt.c: fix %6N for n<100000000
+05-01-08 regex/regcomp.c: conj() => con() to avoid C99 clash
+05-01-05 tm/*: fix { %U %V %W } logic -- my head hurts
+04-12-30 tm/tmxtime.c: fix tm_isdst<0 loop
+04-12-23 vmalloc/vmbest.c: fix vmresize bug that didn't 0 new data
+04-12-19 misc/optget.c: broaden - long option match
+04-12-09 string/strtoi.h: fix terabyte 't' suffix math
+	 string/strmatch.c: flush cache on locale change
+04-12-01 tm/tmsleep.c: add
+	 tv.h,tv*.c,tv.3: move from pax
+	 tmx.h,tmx*.c,tmx.3: add high resolution tm(3) counterparts
+	 features/lib: add *another* sgi linux.ia64 memccpy bug check
+04-10-31 Makefile: __OBSOLETE__ now computed <6 months ago year>0101
+	 ccode.h,ccmapid.c: add ccmaplist(Ccmap_t*) iterator
+	 option.h,optesc.c: add 3rd arg, 1 => quote '?' too
+	 misc/magic.c: fix bug that terminated `string  a' at  
+	 misc/magic.c: handle vcodex() via decompose()
+	 misc/magic.tab: add vcodex magic
+	 features/stdio: handle _LARGEFILE64_SOURCE -- oops
+	 stdio/(fseek|ftell|fseeko|fsetpos|fgetpos|ftello).c: oops^2
+04-10-28 string/swapop.c: size==-4 => size=4 and extend op=3 to op=7
+	 tm/tmfix.c: fix tm_mon<0 logic
+04-10-22 tm/tmdate.c: handle 'final day feb 2004'
+	 port/astlicense.c: add query=all|id|${...}${...}
+	 port/astlicense.c: "free" => "mit"
+	 comp/omitted.c: revert to the open source license
+	 string/stropt.c: drop siz==0 => tab is hash table
+	 include/sfio.h: incorporate <sfstr.h>
+	 include/sfstr.h: drop
+	 disc/sfstrtmp.c: drop -- use sfstrbuf()
+04-10-20 misc/magic.tab: update tar magic
+04-10-18 ufc-crypt.h,crypt_util.c: drop GPL code
+	 crypt.c: add BSD code
+	 pathpath.c: disable { $0 $_ $PWD } related root search
+04-10-01 normalize ident stamps
+	 port/astlicense.c: add type=cpl -- yeah
+04-09-25 string/swapop.c: return op < size -- duh
+04-09-23 comp/spawnveg.c: :NOOPTIMIZE: -- volatile sometimes ignored
+04-09-21 comp/spawnveg.c: exec_errno_ptr is volatile -- duh
+04-09-14 tm/tmscan.c: add %| alternation and %& => tmdate()
+04-09-08 misc/optget.c: add :!value: omitted optional arg value
+	 misc/optget.c: fix --noNAME ambiguous option logic
+04-08-26 string/strperm.c: add who^mode to propagate least restrictive up
+	 astmath.c: add { frexpl ldexpl } checks for ast.req
+	 port/astlicense.c: ignore first option if non-assignment
+	 include/ast_dir.h: move d_fileno map before struct defs -- duh
+04-08-24 vmalloc/vmbest.c: add {VM_region} VMCHECK=+r for region segment checks
+	 misc/recfmt.c,include/recfmt.h: add
+04-08-23 vmalloc/vmbest.c: add {VM_primary VM_secondary} VMCHECK=-s for primary
+	 features/common: punt to <stdarg.h> for unknown va_list
+04-08-11 vmalloc: sync _UWIN libposix hooks
+04-07-27 features/common,features/limits.c: ULL suffix for unsigned _ast_int8_t
+04-07-22 include/ast.h,comp/eaccess.c: add eaccess() for effective access()
+04-07-19 comp/open.c,sfio/_sfopen.c: { O_RDONLY O_WRONLY O_RDWR } are values
+04-06-28 misc/error.c: check level after error_info.auxilliary
+04-06-24 string/strmatch.c: strgrpmatch() match[] now variable size array
+04-06-17 features/common: change _DLL null define to (the standard ast) 1
+04-06-11 misc/optget.c: allow optional [-|+|--|++] optstr() option prefix
+	 misc/optget.c: reset optstr() state on 0 return
+	 misc/optget.c: text()=>textout() linux.ppc symbol hijack workaround
+04-05-31 sfio/sfreserve.c: no side buffer if user buffer is large enough
+04-05-27 string/fmtbuf.c: handle one concurrent buf > sizeof(buf)
+04-05-24 regcomp.c: fix no-advance initialization
+04-05-05 conf.tab,conf.sh: update to align with standards
+	 magic.tab: ms suffix update
+04-05-04 port/lcgen.c: fix territory initialization
+04-04-15 tm/tmdate.c,include/tm.h: fix specific and ordinal days
+04-04-08 astconf: retain { HOSTTYPE LIBPATH LIBPREFIX LIBSUFFIX } strict vals
+04-04-07 vmalloc/vmbest.c: fix alpha tiny block bug
+	 vmalloc/malloc.c: re-enable on alpha
+04-03-30 tm/tminit.c: GMT => UCT only if tz.daylight not defined
+04-03-25 vmalloc/malloc.c: _AST_std_malloc=1 for __alpha
+	 path/pathprobe.c: per-user probe dir => $HOME/.probe/$HOSTTYPE
+04-03-23 regex/reglib.h: fix isw*() redefines
+04-03-17 features/stdio: no __FILE override for __CYGWIN_ (sys/reent.h clash)
+	 sfio/sfhdr.h,sfio/sfsetbuf.c: lower sfmove() default buf size 4x
+04-02-29 comp/omitted.c: move env trace after PATH fixup
+	 comp/omitted.c: cygwin spawn _P_DETACH => _P_NOWAIT+setpgid(pid,0)
+	 misc/optget.c: fix html mailto: match
+	 port/astlicense.c: add type=test for fixed 2001 date
+	 features/float: check local NaNQ first
+	 vmalloc/vmhdr.h: fix _vmextern_ vm_truncate return type
+	 misc/magic.tab: add elf s390 index=22
+04-02-26 vmalloc: VMCHECK a:assertions c:arena-check w:warn-instead-of-abort
+	 sfio/sfvscanf.c: fix extf arg selection
+04-02-24 features/dirent: set nodefine to avoid ast_std.h _typ_off64_t undef
+	 disc/sfkeyprintf.c: only case pattern must be ()[] balanced
+04-02-14 include/sfio_t.h: add SF_DCDOWN, SFDCNEXT(), SFDCPREV()
+04-02-13 string/strmatch.c: fix bug that didn't save one-time sub[] size
+	 vmalloc: -g: export VMCHECK=1 enable malloc/free checks
+	 vmalloc: -g: free(0) to check and disable malloc/free checks
+	 vmalloc: -g: free(1) to check and enable malloc/free checks
+04-02-11 Makefile: add :P=A: to conf and lcgen exec for cross-compile
+	 regex: use MBSIZE() instead of mbsize() to grab 1 char on err
+	 vmalloc/vmbest.c: updated to do more comprehensive DEBUG tests
+04-02-04 sfio/sfraise.c: add sfraise(0,a,b) to iterate over all streams
+04-02-01 vmalloc/vmbest.c: _BLD_DEBUG free(0) checks the arena
+04-01-31 features/vmalloc: fix typo that missed _mmap_zero
+04-01-23 string/strerror.c: handle real strerror() return value overwrite
+04-01-11 path/pathpath.c: fix size vs. sizeof(buf) typo
+03-12-22 misc/magic.tab: dos EXE tweaks
+03-12-05 vmalloc: sync with kpv, adding exceptf announcements
+03-12-04 port/astlicense.c: fix expand() loop sentinel bug
+03-12-02 include/ast.h: mbchar() advances by 1 on mbtowc() error
+	 misc/fts.c: increase MINNAME to 32
+03-11-21 vmalloc/vmbest.c: export VMCHECK=1 to enable $(CC.DEBUG) vmcheck()
+         vmalloc/vmbest.c: export VMCHECK=2 to disable KPVCOMPACT
+	 misc/magic.c: add { cobol copybook pl1 } and suffix preference
+03-11-12 features/stdio: drop cuserid,getopt for SUSV3
+03-11-11 vmalloc/*: merge kpv update -- this should stomp the compaction bug
+03-10-23 comp/iconv.c: fix sfreserve lock fallback
+03-10-20 sfio/_sfopen.c: add to allow user sfopen() intercept
+03-10-17 regnexec.c: fix exec time REG_LEFT, \x.... => wctomb()
+03-10-12 string/strtoi.h: fix strton '.' overconsumption
+03-10-12 comp/iconv.c: identity is always (iconv_t)0
+03-10-09 string/fmtesc.c: fix FMT_SHELL to check for all shell magic chars
+03-10-01 port/astlicense.c: unknown authors copied verbatim (instead of ignored)
+03-09-30 string/chresc.c: handle \u..., \x... consumes all trailing hex digits
+	 string/stresc.c: \u... and \x... > UCHAR_MAX => wctomb()
+03-09-29 fnv.h: add
+03-09-23 modedata.c: table is for external modes, so no arch specific hacks
+	 optget.c: fix option prefix match translation bug
+	 optget.c: add `<length> <name>=<value> to optstr()
+	 features/lib: add memcmp() test for sgi optimzation bug
+03-09-22 regex.h,regcomp.c: add regncomp()
+	 regclass.c: fix for loop dangling ; in regaddclass()
+03-09-20 sftable.c,sfvprintf.c: fix SFFMT_CHAR handling to match extf api
+03-09-19 sfmode.c: update release to kpv's
+03-09-17 regcomp.c: add pedantic backref error checks
+03-09-16 regnexec.c: exec time REG_LEFT => don't advance past initial position
+	 regclass.c: add regaddclass() for user defined [:class:]
+	 regexec.h: REG_VERSION_N2X, add redisc_t {re_map} ccode map
+	 regstat.c: add regstat_t
+03-09-11 optget.c: --n:=v sets opt_info.assign=':', opt_info.number enabled
+03-09-09 disc/sfkeyprintf.c: *pn on lookup is arg separator; lookup "" arg too
+03-09-05 optget.c: [f:l*?] preserves user long name past '*' in opt_info.name[]
+03-09-03 sfstr.h: add sfstrpend() for #pending bytes in read buffer
+03-08-25 regex: add REG_FIRST, optimize bm
+	 features/lib: _AST_no_spawnveg==1 falls back to fork/exec
+03-08-22 features/stdio,stdio/asprintf.c,stdio/vasprintf.c: add
+03-08-21 path/pathnative.c,path/pathposix.c: interix updates
+	 features/botched: add cygwin _stat => _stat64
+03-08-15 include/ast.h: map out bsd strmode()
+	 features/common: add interix _ast_intmax_t workarounds
+	 misc/fs3d.c: 3d mount test now uses "" instead of NiL (or cygwin dumps)
+03-08-11 string/fmtesc.c: fix optional quoting checks
+	 tm/tmdate.c: fix > 1 year of seconds arithmetic
+	 tm/tmfix.c: fix leap year adjustments
+03-08-01 features/lib: beef up sock_peek test for interix
+03-07-29 features/float: add -lm to frexp... test
+	 Makefile: fix -lm astmath test sense
+03-07-26 features/mem.c: favor _mem_sbrk over _mem_mmap_*
+03-07-22 vmalloc/vmbest.c: fall back to sbrk() if mmap() fails
+	 features/mem.c: _mem_sbrk means sbrk() and brk() work
+03-07-17 regex/regcomp.c: fix bug that treated KRE X{n,m} like {n,m}(X)
+	 misc/magic.c: check MAGIC_VERBOSE for all load() messages
+03-07-14 misc/optget.c: handle [...]{[...]<.>..<.>..}
+03-06-21 misc/sigcrit.c: block SIGCHLD if _lib_sigprocmask || _lib_sigsetmask
+	 comp/spawnveg.c,sfio/sfmode.c: use sigcritical() SIG_REG_* macros
+	 comp/spawnveg.c: drop ENOEXEC logic
+	 vmalloc/*: snarf kpv KPVCOMPACT() fix
+	 vmalloc/vmbest.c: export VMCHECK=2 to disable KPVCOMPACT (just in case)
+	 string/strdup.c: drop __strdup() etc. intercepts -- malloc gets it
+	 features/mem: define _mem_method and _mem_* possible values
+	 vmalloc/malloc.c: _AST_mem_method==_mem_* to force mem get method
+	 sfio/sfputr.c: __ia64 memccpy is bogus -- how many tries do they get?
+	 path/pathshell.c: verify abs path and access(path,X_OK) -- duh
+	 vmalloc/vmhdr.h: add private _Vmessage() for non-sfio ASSERT() 
+	 port/astconf.c: fix bug that always returned the minmax value
+03-06-11 comp/*.c: reorder macro hding for mvs.390 and <ast_map.h> 
+	 features/vmalloc: add _lib_brk and _lib_sbrk verification
+	 include/ast_std.h,etc.: add _map_malloc for malloc => _ast_malloc
+	 comp/conf.sh: fix SI_* and *_SI_* macro redefs
+	 ast.h: VMDEBUG or _BLD_DEBUG enable <vmalloc.h> and VMFL tracing
+	 vmalloc/vmtrace.c: _PACKAGE_ast __FUNCTION__ is a string
+	 vmalloc/vmtrace.c: set trace file fd FD_CLOEXEC
+	 vmalloc/vmbest.c: set /dev/zero mmap fd FD_CLOEXEC
+	 features/mmap: fix ancient read() vs. mmap() time arithmetic typo
+	 vmalloc/malloc.c: _AST_std_malloc==1 to force standard malloc
+03-06-09 comp/omitted.c: add _imp__FUNCTION sybols for __CYGWIN__ static link
+	 vmalloc/vmbest.c: handle systems with sbrk() but no brk()
+03-06-04 port/astconf.c: drop non-standard diagnostics
+03-06-03 comp/conf.sh: rework symbol collision logic
+03-05-30 conf.tab,conf.sh,astconf.c: add <sys/systeminfo.h> sysinfo() SI_*
+03-05-29 ccode.h: rework for extensibility, drop obsolete mematoe(), memetoa()
+03-05-28 regex/*: recode to use isw*() directly when needed, is*() otherwise
+03-05-27 features/vmalloc: fix _std_malloc test
+03-05-25 misc/optget.c: fix optstr() ???* internal options
+03-05-24 misc/optget.c: fix (ancient) argv null dereference
+03-05-23 comp/getcwd.c: don't intercept on _WINIX -- unreliable st_ino
+03-05-22 sfio/sfsprintf.c: n<0 => don't append ' '
+03-05-18 misc/fts.c: re-stat FTS_DP to update nlink/times 
+	 misc/fts.c: add FTSENT.stack to eliminate getlist() recursion
+	 regex/ucs_names.h: use "..." catenation to placate some cc's
+03-05-11 string/strtoi.h: handle "-" "+" "0x" "11#"
+03-05-09 vmalloc/vmbest.c: large memory allocation tweaks
+03-05-06 misc/optget.c: fix getopt_long() prefix==1 bug that missed short flags
+03-04-27 comp/system.c: handle <ast_map.h>
+03-04-24 vmalloc/vmmopen.c: drop dup <unistd.h>
+03-04-21 tm/tmdate.c: fix next hour/min logic
+03-04-15 vmalloc/malloc.c: intercept __malloc() along with __libc_malloc()
+	 string/strdup.c: intercept __strdup() along with __libc_strdup()
+	 features/mmap: consolidate from features/(lib|sfio|vmalloc)
+	 add _NO_MMAP==1 to disable all mmap()/munmap() calls
+	 path/pathposix.c: add
+03-04-14 comp/setlocale.c: fix debug_mbtowc() return value for *s==0 || n < 1
+	 comp/iconv.c: fix error return errno values
+03-04-11 misc/stk.c: fix stkgrow() realloc bug
+03-04-05 string/tok.c: support readonly single token input strings
+	 disc/sfdcdio.c: fix F_DIOINFO and FDIRECT #ifdef's
+	 include/ast_std.h: allow _LARGEFILE64_SOURCE on __hppa
+	 features/common: fix `tst _foo_' => `tst foo_' typo
+	 features/float: fix `tst _foo_' => `tst foo_' typo
+	 features/float: add FLTMAX_(UINTMAX_MAX,INTMAX_MAX,INTMAX_MIN)
+	 comp/omitted.c: fix pathconf => _pathconf => _ast_pathconf loop
+03-04-03 features/float: add _ast_no_um2fm: no usinged intmax => floatmax cast
+	 vmalloc/vmbest.c: add getenv("VMCHECK") to initialize Vmcheck
+03-03-28 include/ast_dir.h: add D_TYPE; { D_FILENO D_TYPE } must be #ifdef'd
+	 misc/fts.c|getcwd.c|glob.c,preroot/getpreroot.c: add D_FILENO #ifdef's
+	 Makefile: make sure _BLD_ast is defined for all compiles
+03-03-27 ast_vfork.h: generate from features/vfork to pick up headers/pragmas
+03-03-25 comp/omitted.c: drop free() of live environ
+	 path/pathshell.c: allow trailing .exe -- pox on that
+	 string/strtoi.h: fix bug leading 3 digits before thousands sep bug
+	 string/(fmt|str)[gu]id.c: we know root when we see it
+03-03-24 misc/optget.c: handle : and ? in := default value
+03-03-21 ast_std.h: drop all spawn*() but spawnveg()
+	 obsolete/spawn.c: add for dropped spawn*()
+	 features/lib: _use_spawnveg if spawnveg() is a win over fork()/exec()
+	 features/lib: drop NutForkExecve() and _map_spawnve
+	 features/lib: fix memccpy test to clean up /tmp droppings
+	 comp/spawnveg.c: call posix_spawn() if implemented
+	 comp/omitted.c: add spawnve() intercept
+	 comp/getoptl.c: set getopt_long() optind even if no options
+	 tm/tmfmt.c: add %Q<delim>recent<delim>distant<delim>
+	 misc/optget.c: fix trailing '*' for option and option args
+	 sfio/sfmode.c: getenv("_AST_SFIO_OPTIONS") [,]SF_LINE[,] for fd {0,1,2}
+	 vmalloc/*: kpv sync for uwin build independent of libast
+03-03-18 port/astconf.c: switch to dynamic string values (saves 7K data/bss)
+	 string/strmatch.c: switch to dynamic regex cache (saves 3K data/bss)
+	 regex/regcoll.c,ucs_names.h: initialize rw tables from smaller ro data
+	 features/lib: add vfork test for passing SIG_IGN across exec
+	 features/lib: add spawn test for passing SIG_IGN across spawn
+03-03-17 comp/omitted.c: unlink() renames to .deleted dir in case file open
+	 sfio/sfpopen.c: handle mode "" for spawn with no pipe
+	 features/float,comp/frexp.c,comp/frexpl.c: add pow2() table alternative
+03-03-12 features/lib: fix linux.ia64 memccpy() tests -- now its their turn
+	 features/vmalloc: fix /dev/zero test
+	 features/align: _ast_intmax_t and _ast_fltmax_t join the union
+	 misc/stk.c: fix struct frame size to align data
+	 disc/sfdcdos.c: change sfslen() => sfvalue(f)
+03-03-10 misc/optget.c: handle [f<:>x:lllddd]
+03-03-07 port/astconf.c: uninitialized CONFORMANCE + POSIXLY_CORRECT => standard
+03-03-05 comp/omitted.c: make sure at least /bin is in PATH to find cygwin dlls
+03-03-02 path/pathshell.c: write access to /bin is effectively root
+03-02-28 features/float: add (FLT|DBL|LDBL)_U?(LONG|LONGLONG|INTMAX)_(MIN|MAX)
+03-02-25 features/lib: change vfork() test to use _exit() instead of exit()
+03-02-23 include/error.h: update ERROR_VERSION for error_info.number space
+03-02-22 comp/conf.sh: wrap ksh check in eval to avoid premature exit
+03-02-21 misc/fts.c: verify chdir(..) to avoid malicious dir rename()
+03-02-19 string/strtoip4.c: isspace() instead of ' '||'\t'
+03-02-17 regex/regcomp.c: fix stats.l REX_REP logic that botched REX_BM
+03-02-13 string/base64.c: handle catenated encodings
+03-02-11 features/libpath.sh: change LIBPATH to <dir>[:<env>[:<pat>]][,...]
+03-02-07 path/pathfind.c: allow "/dev/null" to be PATH_REGULAR
+03-02-06 include/ast.h,fmtquote.c: add FMT_ALWAYS|FMT_ESCAPED|FMT_SHELL|FMT_WIDE
+03-02-05 tm/tmdate.c,tm/tmword.c,string/strelapsed.c: '_' treated like ' '
+03-02-01 string/strelapsed.c: handle ps style [day-][hour:]min:sec
+03-01-31 port/astlicense.c: fix author=* match
+03-01-30 include/tm.h: add tmisleapyear() macro
+03-01-29 comp/getopt.h,comp/getoptl.c: add gnu getopt_long(), getopt_long_only()
+	 include/ast_getopt.h: for non-gnu part of comp/getopt.h
+	 include/ast_std.h: include <ast_getopt.h> instead of <getopt.h>
+03-01-28 ast.h,string/base64.c: add base64encode() and base64decode()
+	 path/pathfind.c: verify S_ISREG()
+03-01-24 path/pathexists.c: fix abs dir bug and deal with case ignorance
+03-01-23 path/pathpath.c: honor PATH_ABSOLUTE for the easy case too
+03-01-22 path/pathprobe.c: fix search to find both the probe script and command
+03-01-17 misc/magic.tab: application/zip => appplication/(gzip|pzip|zip)
+03-01-14 misc/optget.c: change href="" to href="."
+03-01-10 include/ast_std.h: strtold() import hackery for static __CYGWIN__
+03-01-03 include/regex.h,regex/regcomp.h: add REG_SHELL_GROUP
+	 include/ast.h,string/strmatch.c: add STR_GROUP for REG_SHELL_GROUP
+02-12-15 include/error.h: errorcontext => Error_context_s (compatible til 2004)
+02-12-06 misc/sigdata.c: add NoF(sigdadata) -- why nmake was uninterruptable!
+02-12-03 comp/omitted.c,features/omitted: handle cygwin alarm() return botch
+02-11-27 misc/swapop.c: op=3,size=4 => op=7
+	 string/strlcat.c,strlcpy.c: fix uwin decl clash
+02-11-26 sfio/sfvprintf.c: fix sfsprintf() ' ' termination bug
+02-11-22 misc/glob.c: move static struniq() to libast extern
+	 string/fmtversion.c,include/ast.h: add fmtversion
+02-11-18 string/strncopy.c: add
+	 misc/magic.tab: list size for magicid.h magic
+02-11-14 sfio/sfvprintf.c: add %#c for C escapes
+	 include/error.h: add ERROR_NOTIFY context flag for builtin commands
+02-11-11 string/strtoi.h: add S2I_size for strnto*() size_t 2nd arg
+	 sfio/sfstrtof.h: add S2I_size for strnto*() size_t 2nd arg
+	 comp/putenv.c: add setenv() and unsetenv() wrappers for setenviron()
+02-10-31 path/pathfind.c: add dir of including file to the pathinclude() list
+	 misc/optesc.c: add
+02-10-30 string/strtoip4.c: set next char pointer even on error
+02-10-29 comp/resolvepath.c: add (size_t version of realpath())
+	 misc/mime.c: fix mimehead() to ignore null content values
+02-10-28 misc/glob.c: add GLOB_STARSTAR for /**/ and GLOB_NOTDIR optimization
+02-10-27 string/struniq.c: add
+02-10-23 features/common: fix off-by-one loop check
+02-10-18 include/ast_std.h: avoid off_t,ftruncate,lseek,truncate redefinitions
+02-10-17 misc/mime.c: handle type/* match, fix bogus header parse
+02-10-04 sfio/sfstrtof.h: S2F_static <0:export =0:private >0:static
+02-10-02 features/common: don't define _WIN32; define _WINIX => unix on windows
+	 features/tty: finally stomp the bsd _POSIX_VDISABLE redefinition
+	 misc/fastfind.c: add more specific findwrite() error messages
+	 comp/omitted.c: fix cygwin utime() to update st_ctime
+	 comp/strtol.c,strtoul.c: __CYGWIN__ static link workaround XXX
+	 string/fmtls.c,fmttime.c: tmform() => tmfmt()
+02-09-22 port/astconf.c: return values in fmtbuf() buffer instead of stack
+	 port/mnt.c: don't set MNT_REMOTE for win32 ?:paths
+	 sfio/sfvscanf.c: _sfdscan() is library global (not static)
+02-09-21 path/pathkey.c: add tool arg for mamake compatible hash
+	 features/fcntl.c: handle iffe _hdr_lcl_* => _lcl_* change
+02-09-15 comp/conf.sh: fix enum vs. macro test
+	 cdt: kpv sync
+02-09-11 ast.h,features/common: move _WIN32 macro init to features/common
+	 features/common: enable __EXTERN__ and __DEFINE__ for _WIN32&!_UWIN
+	 features/float: add -lm to _ast_*_nan_init tests
+	 vmalloc: kpv sync with vmresizef => vmgetmem
+	 features/iconv: must have both <iconv.h> and iconv_open()!
+	 features/vmalloc: alloca test must compile *and* link
+	 sfio/sfvscanf.c,sfstrtof.h: add flag arg to char get, fix NaN loop
+02-09-10 vmalloc/vmhdr.h: enable getpagesize() and sbrk() prototypes
+	 features/fcntl.c: enable mmap64() prototype
+	 include/ast_windows.h: windows.h wrapper with ast namespace workarounds
+02-09-07 misc/mime.c: fix quoted value parse bug that ate the whole line
+02-09-05 features/vmalloc: add free() to _std_malloc test
+	 include/ast.h: NoF(x) now defines _DATA_x for !_BLD_DLL too
+	 tm/tmlocale.c: { C POSIX en } == unix dadgummit
+02-08-29 path/pathfind.c: initialize Dir_t.next=0
+02-08-28 uwin/rint.c: update
+	 features/libpath.sh: "bin" is now the default value
+02-08-22 vmtrace.h: add for debugging
+02-08-20 misc/magic.c: convert to use <cdt.h>
+	 vmalloc/vmresizef.c: add for generic discipline resizef default
+	 string/strelapsed.c: allow long time component names
+02-08-19 misc/optget.c: add `.fp 5 CW' to --nroff output
+	 string/(fmtfs|fmtuid|fmtgid|strgid|struid).c: convert to use <cdt.h>
+	 include/dt.h,cdt/dtnew.c: add for dtopen() in specific vm region
+02-08-13 comp/omitted.c: fix bzero logic for e.g. unixware.i386
+	 include/ast.h: add fmtbase->fmtbasell; swap in 2003-09-01
+02-08-12 regex/regnexec.c: fix REG_MINIMAL REX_DOT mb bug
+02-08-08 features/iconv: <ast_common.h> instead of <sys/types.h> <ast_common.h>
+02-08-07 regex/regcomp.c: recognize anchors in BRE subexpressions
+02-08-06 comp/iconv.c: handle win32 cpNNNN == windows-NNNN aliases
+02-08-05 cdt/*: sync with kpv src
+02-08-02 features/iconv: include sys/types.h for ast_types.h
+02-08-01 misc/magic.c: magic file "." names the default
+	 misc/magic.c: handle addr type (from irix string)
+	 features/lib: move malloc tests to features/vmalloc
+	 features/vmalloc: snarf tests from features/lib
+	 vmalloc/*: sync with kpv src
+	 comp/libc.c: dropped -- __libc_* intercepts moved to vmalloc/malloc.c
+02-07-30 features/lib: handle __libc_malloc() in _std_malloc test
+	 vmalloc/malloc.c: add gnu pvalloc()
+	 features/vmalloc: fix alloca check
+02-07-29 features/limits.c: handle netbsd guards
+02-07-27 sfio/sfpoll.c: handle rw pipes
+02-07-25 features/iconv: include ast_types.h for size_t in ast_iconv.h
+02-07-18 apply LARGEFILE64 header prototype clash patches
+	 misc/optget.c: __EXTERN__ _opt_info_ instead of opt_info
+02-07-17 ast_std.h: memzero() now defaults to memset() instead of bzero()
+02-07-16 ast_std.h: add ast.env_serial
+	 misc/setenviron.c: increment ast.env_serial
+	 include/tm.h: tmset() now calls tminit() directly
+	 tm/tminit.c: check ast.env_serial for env change
+	 tm/tmfix.c: speed up for large values of tm_mday
+02-07-15 comp/fnmatch.c: fix memory leak caused by missing regfree()
+	 comp/strstr.c: fix broken interpretation and implementation
+	 comp/iconv.c: intercept (but no-op) null to and from buffer pointers
+02-06-27 ast_std.h: map _sysconf => _ast_sysconf for sun
+02-06-26 cdt,sfio,vmalloc: kpv sync -- is this ever easy?
+02-06-24 sfio: kpv sync, vfwscanf(),fputw() fix (wcslen(x)*sizeof(wchar_t)!!)
+	 misc/fts.c: fix symlink chdir() optimzation bug
+02-06-11 sfio/sfwrite.c: string to file fix
+	 Makefile: __OBSOLETE__==20020101
+02-06-01 regex/regcomp.c: REG_DELIMITED now consumes the delimiter
+02-05-31 regex/reglib.h,regcomp.c,regnexec.c: null subexpression fixes
+02-05-24 misc/fts.c: disable dir link counts in 3d
+	 misc/magic.c: fix "*(mkfile)" sh pattern to "*@(mkfile)"
+02-05-20 regex.h,regex/regsubcomp.c,regex/regsubexec.c: add
+	 regex/regsub.c: deprecate
+02-05-16 tm/tmfix.c: fix '60+n min/sec ago' bug for n min/sec after the hour
+02-05-14 regex/regsub.c: fix (^|x) null match early termination bug
+02-05-13 dir/dirlib.h: drop errant extern==__EXPORT__
+	 features/uwin: add uwin lib tests
+	 uwin/*.c: check features/uwin for stubs
+	 features/float: add nan representation generation
+	 sfio/sftable.h: used _ast_*_nan_init for huge values
+02-05-09 misc/fts.c: fix virtual top to force ``child'' stat()
+	 features/common: define va_copy() only if not in <stdarg.h>
+02-05-01 string/strtoip4.c: cisco inverted quad mask must have 4 parts
+02-04-30 misc/magic.tab: fix pzip version check
+02-04-19 string/strtoip4.c: handle cisco inverted quad mask n.n.n.n/i.i.i.i
+02-04-18 misc/fts.c: add chdir() verification stat() optimizations
+	 path/pathkey.c: check PROBE_ATTRIBUTES for list of vars
+02-04-12 port/astlicense.c: type=open tweak, fix author list spacing
+02-04-11 regex/regcomp.c: check for pattern number overflow
+02-04-05 tm/tmfmt.c: add %u
+02-04-04 sfkeyprintf.c: fix %c numeric value
+	 path/pathpath.c: check plain path first -- duh
+02-04-03 misc/fts.c: fix (FTS_PHYSICAL|FTS_NOSTAT) stat optimizations
+	 ftwalk.c: only clear FTW_DELAY if FTW_CHILDREN
+	 ftwalk.h: add FTW_NSOK for FTW_DELAY
+02-03-29 ast.h: drop strerror() prototype -- already in <ast_std.h>
+	 features/stdio: check for _SFIO_H redundant _Sfstd* declarations
+02-03-26 misc/glob.c: fix GLOB_LIST gl_flags values
+02-03-24 port/mnt.c: update bsd fstype name and mount option logic
+02-03-23 Makefile: add ast_wchar.h to the .check.hdr list (for mamake)
+02-03-17 features/stdio: hack around g++ 3.* clashes
+	 Makefile: add ast_nl_types.h to the .check.hdr list (for mamake)
+	 string/strtoip4.c: fix validity check bug that only checked last part
+02-03-14 misc/optget.c: fix --keys to not expand inline <.>..\f
+02-03-12 port/astlicense.c: add type=free
+	 path/pathaccess.c: sibling ".." search ignores relative dirs
+	 sfio/sfvscanf.c: sfstrtof get() must return 0 on eof
+02-03-11 path/pathexists.c: check path by pairs checking {ENOTDIR,ENOENT}
+02-02-14 features/float: copy local min/max macros to avoid printf roundoff
+	 features/wchar: include <ast_common.h>, not <ast_std.h>
+	 misc/magic.c: match[]=>matches[] to fix K&R match() macro conflict
+	 include/vmalloc.h: include <stdlib.h> for !_PACKAGE_ast
+	 uwin/mini.sym: add sprintf (now required by features/common)
+	 regex/regnexec.c: truncate wide chars for <ctype.h> functions
+	 Makefile: fix MAM ast_common.h sequencing bug by making it first
+	 cdt/dthash.c: fix DT_DELETE memory leak (DT_DETACH typo)
+	 cdt/dthash.c: fix DT_DELETE double free (dt->data->here typo)
+	 regex/regcomp.c: fix recomb() to reject RE with backref
+	 features/iffeio: explicitly generate stdio.lcl
+	 stdio: add {fcloseall,f(get|put)s_unlocked,fmemopen,getdelim,getline}
+	 tmmake,tmtime: allow negative time_t if native localtime/gmtime do
+	 tmdate: allow years before 1969
+	 fmtfmt: add
+	 include/ast.h: add { PATH_TOUCH_CREATE PATH_TOUCH_VERBATIM }
+	 Makefile: add std/*.h for std header iffe overrides
+	 comp/iconv.c: fix non-C win32 sfreserve() loop
+02-02-11 features/common: separate long long / long double tests
+	 features/common: verify printf handles long long / long double
+02-02-02 include/ast_std.h,sfio/sfhdr.h: drop _hdr_locale tests -- always on now
+	 include/ast_std.h: trust _UWIN <unistd.h>
+02-01-31 port/mnt.c: add aix options field
+02-01-30 comp/strstr.c: add for ancient s5
+	 stdio/_flsbuf.c: only on systems that transfer to native (e.g., uwin)
+	 string/strtoi.h: cat min/max error return values
+02-01-28 features/tty: add cf[gs]et[io]speed macros for <termio.h>
+	 comp/rename.c: punt to (ancient) /usr/lib/mv_dir on EISDIR
+02-01-24 sigcrit.c: fix SIGCLD!=SIGCHLD interrupt loop
+	 sfvprintf.c: convert fast io macros to functions for uts.390 cc
+	 string/strtoi.h: drop #pragma prototyped for standalone sfio
+	 sfdcsubstr.c: rename from sfdcsubstream.c for 14 char fs
+02-01-22 execlp,execvp,execvpe,spawnlp,spawnvp,spawnvpe: fix __EXPORT__
+	 spawnlp,spawnve,spawnvp,spawnvpe: handle ms mode arg -- barf
+	 sftable.c: ifdef hacks for _WIN32&_ALPHA_ fp exception
+	 _stdfun.c: add _UWIN&_ALPHA_ iob map
+02-01-18 sfio/sfstrtof.h: drop #pragma prototyped for standalone sfio
+02-01-17 features/hdr: don't include <stddef.h> after it doesn't check out!
+02-01-16 misc/magic.c: add version type for YYYYMMDD or [a.][b.]c.d
+	 misc/magic.c: recode mime %s parse -- sensible and no buffer overflow
+02-01-15 misc/magic.tab,magicid.h: add generic binary magic number and header
+02-01-12 tm/tmlocale.c: override win32 default date for {C,POSIX,en} locales
+	 comp/omitted.c: fix cygwin workaround logic bugs
+02-01-09 stdio/fseeko.c,ftello.c: add from UNIX98
+02-01-08 comp/conf.sh: use $cc instead of cc
+02-01-07 string/strlcat.c,string/strlcpy.c: add bsd api
+01-12-18 comp/conf.tab: fix LFS_CFLAGS default for sun _CS_LFS_CFLAGS botch
+	 features/common: add hdr stdarg test
+	 tm/tmdate.c: handle YYYY/MM/DD
+01-12-10 misc/magic.tab: add generic 0x00010203 binary magic
+01-12-03 path/pathprobe.c: return HOME relative path if readonly/non-suid fs
+01-11-30 misc/optget.c: add simple cache for repeat offenders (like ksh read)
+	 sfio/sfhdr.h: preserve errno across SFMMSEQON-SFMMSEQOFF
+01-11-29 magic.tab: fix GIF version number listing
+01-11-28 string/fmtbase.c: p!=0 => base always included in output
+01-11-26 misc/fts.c: empty path is an error
+01-11-14 misc/optget.c: fix --?+SECTION queries to include paragraphs
+01-11-20 regex/regnexec.c: fix REG_MINIMAL character class match bug
+01-11-19 features/lib: retain _lib_confstr for all solaris releases
+01-11-16 comp/setlocale.c: fix !_lib_setlocale typo
+01-10-31 regex/ucs_names.h: add string catenation to keep line length low
+	 misc/fastfind.c: handle gnu slocate db read
+	 misc/optget.c: add --?+SECTION queries
+	 comp/fnmatch.h: add FNM_NOSYS
+01-10-30 tm/tmdate.c: fix cron specs when both wday and mday are specified
+01-10-20 misc/glob.c: fix bug that called  trim() twice on same path
+	 misc/glob.c: fix  trim() bug that restored / to wrong position
+	 string/fmtre.c: fix { ^ . $ } translations
+	 misc/optget.c: use original string if translation fails -- duh
+	 sfio/sfhdr.h: assume <errno.h> assigns proper atttibutes to errno
+	 comp/regcmp.c: __ia64 workaround fixed by proper CC.DLL probe
+	 comp/getdate.c: __ia64 workaround fixed by proper CC.DLL probe
+	 features/lib: add lib getdate
+01-10-18 features/lib: check for strtod static link collision
+	 features/float: add another signed cast for old bsd cc
+	 features/wchar: add <stdlib.h> <stdio.h> before <wchar.h> for old bsd
+01-10-17 sfio/sfcvt.c: limit max precision to { FLT_DIG DBL_DIG LDBL_DIG }
+	 sfio/sfcvt.c: fix %[aA] format to always have leading 0[xX]1.
+	 sfio/sfvprintf.c: handle %C %lc %S %ls for wchar_t args
+	 sfio/sfvscanf.c: handle %C %lc %S %ls for wchar_t args
+	 string/fmtmode.c: fix bug that omitted trailing ' '
+01-10-12 misc/optget.c: . => . for --??nroff
+	 comp/wc.c: fix mbstate_t initialization typo
+	 features/float: fix max integer / float loop termiation
+	 features/float: fix LDBL_UINTMAX_MAX typo that did DBL_UINTMAX_MAX
+01-10-11 include/sfio.h: fix _Sfstd* import/export
+	 features/common: fix _UWIN __DYNAMIC__() definition
+01-10-06 features/fcntl.c: { O_BINARY O_TEXT } default to 0
+	 features/omitted: add for comp/omitted.c
+	 sfio/sfopen.c: O_BINARY default for _WIN32&&!_UWIN
+01-10-05 misc/glob.c: fix `\(x/*' GLOB_NOMATCH bug that returned `(x'
+	 misc/optget.c: fix localization lookup that didn't drop doubled : ? ]
+01-10-04 comp/setlocale.c: handle sizeof(wchar_t)!=4 in debug locale
+	 comp/conf.sh: handle sytems where _SC_* is both an enum and a macro
+01-09-25 astconf: add LIBPREFIX
+01-09-20 features/common: add __DYNAMIC__() for dll externs
+01-09-19 cdt: kpv update
+	 mb*() macros: update for ksh conversion, extend debug locale
+01-09-16 tm/tmlocale.c: add compiled in defaults for C locale
+	 misc/glob.c: add gl_nextdir callback for GLOB_COMPLETE
+01-08-14 clarify _WIN32 vs. _UWIN vs. __CYGWIN__
+	 tminit: fix standard & daylight initialization
+01-09-11 pathnative.c: add for native fs representation
+	 regex.h: fix regerror_t prototype
+01-09-04 regex/regnexec.c: fix REG_ICASE for multi-char collating elements
+	 tm/tmlocale.c: fix old ascii LC_TIME load
+	 locale*: add new LC_* categories
+	 comp/omitted.c: add CYGWIN workarounds
+	 features/lib: add CYGWIN workarounds
+01-08-11 features/common: some compilers have long long but no LL constants!
+	 features/lib: add mmap64 implementation test (for linux.s390)
+	 regex/regcomp.c: fix  in [...] parse
+	 setlocale: retain user locale spelling in setlocale() return value
+	 features/limits.c: don't include ./limits.h -- duh
+	 fmtesc: don't escape multibyte chars
+	 tm/tmlocale.c: fix native C locale default
+01-08-08 features/float: some compilers (msdev) forget long long vs. double
+01-07-31 misc/optget.c: handle suboptions
+01-07-27 cdt.h: add DTDISC()
+01-07-17 iffeio.h: move to include for stdio bootstrap iffe workarounds
+01-06-25 regex: perl extensions added and tested
+01-06-21 misc/error: add ERROR_OPTIONS=prefix=string for message processing
+01-06-15 string/chresc: only 2 hex digits max for \xxx
+	 regex/regsub: handle REG_SHELL ~(nnn) rhs backrefs
+01-06-11 regex: handle embedded   in pattern and subject string
+	 regex: add (?nnn) for backrefs > 9
+	 comp/fnmatch: add FNM_LEADING_DIR for gnu compatibility
+	 features/float: _ast_flt_unsigned_max_t for bsd.i386 omission
+01-06-06 misc/optget.c: add o option for old ps,ar,tar with optional leading -
+	 regex/regcomp.c: REG_LENIENT|REG_DELIMITED \<newline> => <newline>
+	 regex/regcomp.c: REG_LENIENT  00 => NUL
+01-06-04 features/dirent: replace Makefile hack with iffe semi-hack
+	 regex/regnexec.c: negation must also check REG_SHELL_DOT
+01-06-03 sprintf.c: change buf size from SF_BUFSIZE to INT_MAX
+01-05-31 glob: fix gl_fignore to ignore leading . by default
+	 features/lib: add botch_d_ino_dirent64 for linux botch
+01-05-25 port/lc.tab: add a few missing language_territory's
+01-05-23 string/chresc: \C[.collation-element.]
+	 fmtmatch,fmtre: update for <regex.h> syntax extensions
+01-05-21 regex: add perl extensions, unicode names for collation elements
+01-05-11 string/chresc: \ == \E == escape, X == control X, \x{..} == \x..
+01-05-09 path/pathtemp.c: pathtemp(0,0,0,"/private",0) for mode S_IRUSR|S_IWUSR
+	 port/touch.c: handle utime(2) EPERM to fix bug that truncated
+	 regex: change REG_MINIMAL to avoid negation -- much faster now
+01-05-08 *.h: add some off_t macro guards for suse linux
+01-05-03 regcomp.c: optimize ((x)!)* to ((x)!)
+	 wchar: add <wchar.h> and stdio wchar routines
+01-05-02 feaures/wchar: add <wchar.h> intercept, add stdio wchar functions
+01-05-01 string/strtoi.h: signed strtoi accepts qualified unsigned constants
+01-04-30 comp/setlocale.c: fix code that relied on 2 simultaneous getenv()'s
+	 tm/tmlocale.c: check for UTF-8 encoded LC_TIME files
+	 misc/magic.tab: add utf-8 and utf-16 U+FEFF magic
+01-04-26 features/common: some cc's have _ast_int8_t but not LL constants
+01-04-24 features/lib: add _std_strtod for mac os X
+01-04-23 ccode: add CC_sub for ms embedded EOF char on ebcdic -- no joke
+01-04-20 iconv: handle ebcdic<=>utf
+	 mc.h,mc.c: add mcindex()
+	 ast_std.h: add AST_MESSAGE_SET
+01-04-18 features/libpath.sh: fix mvs probe
+	 *: sundry mvs fixes
+	 glob: fix GLOB_NOCHECK to avoid stat() and properly trim patterns
+01-04-01 strtod,strtold: add
+	 strtol,strtoul,strtoll,strtoull,strton,strtonl: handle locale & ERANGE
+	 sfvprintf,sfvscanf: handle locale decimal_point,thousands_sep
+	 sfvprintf,sfvscanf: handle %a,%A
+	 setlocale: add LC_NUMERIC decimal_point,thousands_sep init
+	 ast_std.h: __OPTIMIZE_SIZE__==1 to disable non-std __GNUC__ inlines
+	 pathexists: path cache to cut down pathpath() access(2) calls
+	 features/stdio: __FILE_TAG == _sfio_s for solaris
+01-03-23 iconv: fix iconv_move buffer boundary bug that stopped at 1 block
+01-03-19 glob: add GLOB_AUGMENTED
+	 regex: REG_SHELL syntax error implies REG_LITERAL match
+	 strto[ln][ll]: add overflow checks
+01-03-17 locale: reimplemented to provide canonical locale namespace
+	 locale: add LC_ALL=local for local system user default
+	 tm.h: TM_*_3 => TM_*_ABBREV
+	 tmfmt: handle standard E and O format modifiers
+	 tmlocale: consult nl_langinfo() if defined
+	 fmtquote("
+01-03-08 regex: handle multibyte chars and collation classes
+	 strmatch,strgrpmatch: now a wrapper on regex
+	 ast_std.h: add mb*() multibyte and collation support
+	 sfvscanf: handle locale decimal and thousand
+	 proc*,system: handle ignored SIGCHLD
+	 sfkeyprintf: handle %*C
+01-03-06 locale: add locale data cache for efficient multiple locale switching
+	 optget: fix LC_MESSAGES!=C --man bug
+01-03-01 Makefile: HEADEROPT is not optional for win32.*
+	 comp/syslog.h: comply with the de factos
+	 optget(): fix <.>..< >stack bug that referenced data after pop
+01-02-27 *locale*: a batch of fixes for native LC_MESSAGE&LC_TIME hooks
+01-02-22 pathprobe: reprobe test now checks probe.ini too
+	 sfio_s.h: advertize public Sfio_t members with _ prefix
+	 sfio.h,features/stdio: add <sfio_s.h> reference
+	 sfhdr.h: map <sfio_s.h> _foo to foo
+	 sfio.h: SF_APPEND=>SF_APPENDWR, SF_CLOSE=>SF_CLOSING
+01-02-14 comp/conf.sh: probe <unistd.h> for _(CS|PC|SC)_* getconf symbols
+	 stdio/*: update for uwin stdio.dll binary compatibility
+	 sfread: finally fixed premature pipe read EOF bug
+	 fmtscale: format tenths for number > 0 && number < 10
+01-02-09 _sfmode(),_sftype(),_Sfextern: UWIN binary stdio compatibility exports
+01-02-08 sfgetm,sfputm,_sfputm: fix max clash with k&r max() macro
+	 setlocale: undef valid for sun4 k&r valid() macro
+01-02-07 catopen.c: don't do native catopen for the debug locale
+01-02-06 sfraise.c: add SF_FINAL check to avoid (posibly) freed disciplines
+01-01-01 features/common: fix uwin __DEFINE__
+	 sftable: initialize decimal and thousand
+	 magic.tab: add corel wordperfect document
+	 syslog: add LOG_LEVEL, add ' only if needed
+	 include/tm.h: #undef daylight for _WIN32
+	 sfio.h: add _SF_APPEND and _SF_CLOSE for native namespace incursion
+	 ast_std.h: add AST_LC_multibyte for MB_CUR_MAX>1
+	 setlocale: set AST_LC_multibyte
+	 strmatch: check AST_LC_multibyte
+	 features/limits.c: add _BITS_POSIX1_LIM_H guard for linux
+	 features/libpath.sh: fix for aix LIBPATH
+	 procopen,procclose: block SIGCHLD if PROC_FOREGROUND (e.g., system(3))
+	 optget.c: add enumerated option argument values
+	 optget.c: add <!--INTERNAL--> for private --html
+	 optget.c: fix memory leak that hit shell builtins hard
+	 sfio: drop sfread small chunk logic
+00-12-25 mnt.c: handle " and ' quoting for fstab
+	 sftmp.c: let pathtemp() open the fd O_EXCL
+00-12-15 conf.sh: add -v for verbose trace
+	 features/(limits|unistd).c: no FEATURE/types because of _POSIX_SOURCE
+	 features/time: add default for CLOCKS_PER_SEC
+	 features/lib: std_malloc now handles NeXT
+00-12-13 strton: recognize qualifier only if preceded by a digit
+	 features/lib: change return in vfork() test to exit() for linux sparc
+	 fmtquote: fix $'...' quote logic
+00-12-11 tmdate: fix cron format bug that mishandled months
+00-12-01 optget: handle $Id: ... $ in --?-version
+	 features/fcntl.c: fix _STDPP_ mmap munmap
+00-11-27 magic: drop dup sfclose() in load()
+	 optget: handle error_info.id==0
+00-11-22 features/stdio: add _FILEDEFED for sol9.sun4
+	 strton,stronll: handle [u|U][l|L][ll|LL] qualifiers
+00-10-31 tmdate: add TM_DATESTYLE and mmddHHMM[cc]yy
+	 astlicense.c: #include <hashkey.h> MAM workaround
+	 astlicense.c: check for non-empty CONTRIBUTORS
+00-10-26 features/stdio: add _FILE and __FILE for gnu
+	 misc/stk.c: fix stack pointer check off-by-one (dgk does it too!)
+00-10-23 syslog.h: sync with bsd values
+00-10-18 _STUB_* now functions instead of common symbols
+	 all extern data declared with definition to eliminate common symbols
+	 fastfind: add mac/bsd /var/db/locate.database
+00-10-17 features/lib: add apple osX (darwin.ppc) workarounds
+00-10-12 add: fmtbuf(), fmtclock(), fmtip4(), strtoip4()
+	 fmt*() now use fmtbuf() for tmp fmt buf allocation
+00-10-05 regex: add REG_DISCIPLINE and regdisc_t for alloc/error disc
+00-09-29 features/lib: pipe_rw==0 for sgi: boot rw == bin incompatibility
+00-09-21 astlicense: handle ' and 
+00-09-20 sfwrite: fix write() error in sfprintf() loop
+00-08-11 hdr,vmhdr.h: check/hide { getpagesize sbrk } prototypes
+	 astlicense: add noncommercial
+00-07-31 fflush: don't seek on pipes
+	 sfresize: add
+	 setlocale: fix bad newof() call
+00-06-01 strmatch: initialize match.current.beg[0] to avoid dump at line 670
+	 sfio/stdio: a few more errno tweaks
+	 astquery: sfstdin/sfstderr by default
+00-05-26 sfmode: errno=EBADF for invalid stream use
+00-05-22 rewind: fix for xopen test
+00-05-18 mcfind: returns absolute path
+00-05-16 optget: --keys must catch <.>..< >too
+	 translate,mc: errno cleanup
+00-05-09 magic: add netbsd binary magic
+	 fts: PATH_RESOLVE!=logical => FTS_SEEDOTDIR
+	 ftwflags: call fts_flags()
+	 astconf: astconf(0,0,0) re-syncs with _AST_FEATURES
+00-05-08 optget: --usage & --keys for last -catalog group only
+00-05-02 iconv.c: add; use codes[] in ccmapid() and ccmapname(); "" for native
+00-05-01 pathtmp: copy env values (libshell or putenv may change)
+00-04-01 optget: drop bar from [-foo?bar] for --??keys
+	 sfvscanf: add %X -- duh
+	 features/common: fix va_listval() for power pc
+	 findopen: fix FIND_GENERATE codes file search
+	 magic: add ERROR_translate() and msgcat.key
+	 tmlocale: add for LC_TIME locale info
+	 tmlex: check tm_info.format and tm_data.format
+	 tmfix: fix for tm_wday special case (via nl_langinfo on LC_TIME fields)
+	 strftime: fix for nl_langinfo special case
+	 ast_std.h: provide LC_* defauls if not defined
+	 sfnew: check ${_AST_sfio_bufsize} -- don't tell kpv
+	 catopen,nl_types.h: add intercept to mc* routines
+	 magic.tab: add ast message catalog
+	 strerror: add _ast_strerror intercept with ERROR_translate("errno")
+	 fmtquote: escapes >0177 only if (flags&2)
+00-03-17 feof: stdio macro functions only for _UWIN
+	 optget: proper ERROR_translate() calls
+	 astgetconf: add for thread safe error message control
+	 astlicense: fix type=special but with non-null notice
+	 errorx: add for ERROR_translate() support
+	 ERROR_translate: add locale id args for alternate dictionary
+	 option.h: move _OPT_PRIVATE_ to pointer to avoid dll size mismatch
+	 ftwalk: fix FTW_CHILDREN bug that hit top level non-dirs twice
+	 translate.c: default error_info.translate
+	 astconf: fix dup loop thrash that never returns, add _AST_VERSION
+00-03-10 ast_std.h: do _LARGEFILE_SOURCE initialization before std headers
+	 fmtquote: handle $'...' quotes
+00-03-07 optget: fix numeric option support test
+	 sfkeyprintf: add %q for '...' quoting with ansi escapes
+00-03-06 features/stdio: fix _sfflsbuf prototype (dingold@gte.net)
+00-02-14 pathtmp: fix pid cache bug that sometimes repeated after ~10 attempts
+	 optget: "..." attribute quote
+	 pathfind: eliminate *: prefix in lib, not type
+	 proc: PROC_FOREGROUND for system(3) semantics (wait status return)
+	 pathtmp: fix mktemp() logic
+	 fts: fix FTS_NOSEEDOTDIR bug that botched ./* in top list
+	 include/ast/prototyped.h includes include/prototyped.h
+	 pathpath: fix strdup(0) bug
+	 optget: --html <foo@bar> => ...mailto:foo@bar...
+	 sscanf: fix sfsscanf => sfvsscanf typo
+	 magic.tab: strengthen tar recognition
+00-02-08 conf.sh: fix ifdef for systems that think sysconf(FOO) is const
+00-02-04 glob: fix globlist_t.gl_flags
+00-02-02 vm*: add NoF() for data only files
+00-01-27 fts: fix top level .==.. statp bug (thanks to dr. ek)
+00-01-25 conf.tab: fix LFS*_*LAGS typo
+00-01-24 astlicense: handle type=verbose, license.notice, author=*
+00-01-11 pathprobe: generate info for first probe script on PATH - duh
+	 ast.h: add NoF(x) for files that define no functions
+	 tmpfile: fix implementation
+	 global change for string ERROR_translate() dictionary names
+	 optget: fix new way but no long names off by one
+	 optget: handle [--dictionary?name]
+99-11-19 comp/conf.sh: `expr length XXX` is not universal
+	 drop sfstdio; stdio via functions everywhere
+	 drop Makefile conditionals (and follow our own advice for once)
+	 sfio: new stream after atexit() bug fix
+	 tm: Tm_zone_t.daylight=0 for standard time within zone
+	 stdio: fopen => _ast_fopen: only way short of binary compatibility
+	 Makefile: atmain.C falls back to atmain.c
+	 optget: add --keys, s<section> option
+	 stdio: _UWIN check for foreign stdio
+99-11-11 astlicense: add
+99-10-31 glob: fix regexec pattern; add PATH_ATTRIBUTES case check
+	 pathpath: path==0 means malloc space
+99-10-22 tmfmt: %C=2-digit-century, %k=date(1), %y=2-digit-year-in-century
+99-10-18 fastfind: expanded default db lookup
+99-08-11 magic: fix off by one registry malloc
+	 features/fs: add __RENAME checks for stat familiy (netbsd)
+	 features/fs: major()/minor() fixes for s5
+	 features/libpath.sh: netbsd fix -- ld.so not in std places
+	 misc/fastfind: fix codes path generation bug
+	 optget: beef up --?* description, fix <TR>...</TR> nesting
+	 pathprobe: check for override (writable key file) first
+	 features/time: int tmtimeofday(struct timeval*);
+	 optget: fix opt_info.num, even if opt_info.arg!=0
+	 fts: FTS_PHYSICAL => FTS_SEEDOTDIR, add FTS_CHOP
+	 fastfind: init dir tab with logical and physical name
+	 glob: add gnu GLOB_ALTDIRFUNC
+99-07-17 sfio: kpv update and sfhdr.h sync!
+99-06-24 stdio: fix fflush() to ignore sfseek(0) return value
+99-06-23 magic: '\r' is text not control to placate m$
+99-06-08 stdio: fix fseek,ftell semantics
+	 uwin stdio: fflush() => _doflsh() to avoid __cplusplus clash
+	 getopt: call liberror() to avoid error() conflict
+	 tmfmt,tmscan: %N zone type (nation code), %z zone minutes west offset
+	 tmfmt: - no pad _ space pad 0 leading 0 pad
+99-05-28 magic: fix 'x' == '*' for any number, magic.tab tweaks
+	 features/lib: verify that stat64 really works
+99-05-21 tm*: add TM_WINDOW==69 for consistent century windowing guard year
+99-05-18 tmtime: add century leap year calc anticipating unsigned time_t
+99-05-17 sfkeyprintf: handle %o and %x!!
+99-05-09 pathprobe: $HOME/.probe if not suid and st_uid!=geteuid()
+99-04-28 magic,magic.tab: add registry()
+99-04-24 regcomp: fix ksh pattern +! parse
+	 regfatalpat: add
+	 optget: make : ? ] double escape consistent in all contexts
+99-04-01 features: drop iffeio.h and stdio.h when only printf() used
+	 regex: fix stats() .l and .k count
+	 fmtquote: added; most general fmtesc() form
+99-03-22 fmtesc.c,ast.h: add fmtnesq()
+	 optget: --?x works for -x option flag
+99-03-17 features/limits.c: workaround solaris __EXTENSIONS__ _timespec bug
+	 workaround limits.h circular prereq with ignore stdio.h
+	 sfvprintf: %04e left-pad zero fixed
+99-03-03 fts: uncle already: add FTS_SEEDOTDIR to retain leading ./
+	 regex: REG_MULTIPLE, BM for fixed string alternation
+	 optget: embedded `-' optional in long options, prefix={0,1,2}
+99-02-14 fastfind: fix dir format bug that emitted wrong paths
+	 astconf: fix redef off by one bug
+99-02-11 pathcanon(): don't cache astconf("PATH_LEADING_SLASHES", NiL, NiL)
+99-01-23 optget: move <old_opt.h> back into <option.h>, no open-close
+	 optget: add "[index:long-name:description]" for --long-name
+	 comp/gross: add weak __libc_attr for irix < 6.5 compatibility
+	 features/limits.c: tweak the guards again
+99-01-11 fastfind: handle old format count byte order
+	 magic.tab: fix elf to use real phdr offset
+	 magic.c,magic.tab: fix | to act like switch/case
+	 comp/fross.c,features/hack: for gross hacks
+	 features/stdio: avoid sfio namespace pollution
+98-12-25 tmdate: yyyy.mm.dd
+	 pathprobe: fix procrun() cmd path bug
+	 fmtesq: add
+	 features/common: win32.alpha va_list
+	 magic: add pc alpha object
+98-11-11 strmatch: add STR_ICASE
+	 pathprobe: punt to $HOME/.probe/<key+HOSTTYPE> if not S_ISUID
+	 tmzone,tmdate: handle +-minutes, nn/MMM/yyyy
+	 stropt: fix nested quote pop
+	 tmfmt: add %K => %Y-%m-%d/%H:%M:%S
+	 sfio/stdio: fix fseek() SF_PUBLIC omissions
+	 fmtesc: catch '\' (duh)
+	 vmalloc: vmbest round bug fix
+98-11-01 fts.c: no pathcanon() if (fts_flags & FTS_PHYSICAL)
+98-10-01 features/stdio prototype fixes
+	 optget: strton() instead of strtol() for #
+98-09-22 regcomp: add REG_DELIMITED and REG_ESCAPE delimited re support
+98-09-15 fix _LARGEFILE64_SOURCE stuff
+	 ast_std.h: provide mmap() prototype
+98-08-11 fix sfpopen() to ignore SIGPIPE by ignoresig() for sfio but not stdio
+	 fix procopen() to ignore SIGPIPE by ignoresig() for PROC_IGNORE
+	 sfio sfpopen/popen update
+	 magic.src: fix ustar entry
+98-07-17 fix ftwalk() short by one malloc()
+	 add fts_notify()
+98-06-25 sfdcmore,sfdcprefix: add
+98-06-19 tokscan: add %f %g
+98-06-01 disc/sf*.c: memset(0) after disc malloc()
+98-05-11 strelapsed: y==Y
+	 fts: pathcanon() top list 
+98-04-01 error: error_info.time for all msgs, just after cmd id
+	 error: no sfsync(sfstdin)
+	 sfio: sfpool, Sffmt_t update
+	 magic.tab: sgi core dumps -- why aren't these elf?
+	 stropt: (v+n) for unknown option is option value if n!=0
+	 procopen: fix setsid() for spawnveg() only
+98-03-19 malloc: add realloc foreign region check
+	 sfdisc.h: rename to match kpv disciplines
+	 fastfind: fix strcasecmp/strcmp directory prefix mixup
+98-03-17 features/fcntl.c,pathtmp,sftmp: add O_TEMPORARY
+98-03-01 pathcanon: fix PATH_LEADING_SLASHES to stat() both slashes
+	 pathcanon: add PATH_VERIFIED
+	 tmdate: add skip[] to expand separator char set
+	 fastfind: FIND_OLD for old 7 bit db, FIND_TYPE for new 8 bit typed db
+	 fastfind: default generates gnu LOCATE02 8 bit db
+	 magic: handle %s in mime description
+	 cdt: kpv update
+	 sfio: kpv update
+	 stdio: fpos64_t fseek64(), ftell64(), fgetpos64(), fsetpos64()
+	 stdio: fseek() => sfseek(SF_PUBLIC) to avoid locking
+	 fts: initialize parent stat[bp] from top level *after* statf done
+	 astmath: add -lm requirement test
+	 *: Astlong_t => _ast_*_t
+	 regex: simplify regcollate() (from doug)
+	 tmtime: preserve Tm_t*tm when calling tminit()
+	 astconf: add readonly PATH_ATTRIBUTES=[cirw]
+98-02-14 fastfind: add FIND_ICASE to ignore case
+	 tmdate,tmgoff: handle (+|-)hh[[:]mm[[:]ss]] absolute timezone
+	 tmdate: `<n> <part>' now assumes `next <n> <part>' instead of `this'
+	 tmfix: fix leap year bug that forgot to add 1900
+	 proc: add PROC_ZOMBIE
+98-02-06 strmatch() char class range bug fix
+	 regex char class range bug fix
+98-01-23 _WIN32: changed the #if logic again to accomodate _GNUC_
+	 mnt: grab the mount options too
+	 ast_std.h: hide getopt,getsubopt from stdlib.h
+	 features/limits.c: add gnu guard macros to avoid limits.h recursion
+	 features/mode.c: include "limits.h" instead of "FEATURE/limits.lcl"
+98-01-11 sfio.h: use Astlong_t, move Sfio_t Sfdisc_t typedef to top for stdio.h
+	 sfhdr.h: #undef SETLOCAL for hpux
+	 sfvprintf,sfvscanf: %I*x for sizeof(int_arg)
+	 handle ftruncate64 and truncate64
+	 dtopen.c: __hppa dll needs Dtset Dtlist Dttree refs here
+97-12-18 fmtnum: add
+97-12-11 magic: handle sgi 64 bit core dumps
+97-12-07 pathtmp: add override for TMPPATH,TMPDIR and cycling
+97-11-11 tm: handle 0 return from gmtime(),localtime() (dos negative time_t)
+	 features/stdio: fix fflush() macro to do physical sync
+97-10-31 astconf PATH_RESOLVE is logical if 3d&&!std, metaphysical otherwise
+	 magic: fix #! mime bug
+	 tm: tmtime() now calls tmfix() and adjusts tm_isdst too=>mtime() works
+97-10-11 dllfind,dlfcn: move to separate -ldll so -last can link static, duh
+	 Makefile,state.c: move forced header generation state.c => Makefile
+	 sfio: update including SF_WHOLE
+97-10-01 sfdostext: add \r=> sfio discipline
+	 stropt: NiL table => p=name for all name=value
+97-08-11 pathtmp: check pid to note forks
+	 procopen: FD_CLOEXEC rfd && wfd
+	 fts: fts_close() after fts_children() with no fts_read() now works
+97-07-17 error: sfsync(sfstdin,sfstdout,sfstderr) instead of sfsync(NiL)
+	 _sfcvinit: add sfio internal interface to base conversion tables
+	 strton: use _Sfcv* base conversion tables instead of sfsscanf()
+	 sfvscanf: use _Sfcv* base conversion tables
+	 mime: x- permutations now matched if exact fails
+	 mime: original- stripped from content-* headers
+	 tmdate: add yyyy-jjj, yyyy-mm-dd
+	 dllfind: add
+	 ccmapid: fix buf copy loop limit
+	 ccmapname,ccmapcpy: add
+	 sfstrtmp: add
+97-05-09 streval: fix up casts for pseudo-ansi cc
+	 features/types: use _ast_int_8 vars to verify support
+	 string/modedata: check for mvs.390 S_IFMT
+	 include/ast(_std).h: add #define __FILE_typedef
+	 magic: add ccode text check
+	 include/ftwalk.h: FTW_PATH=>FTS_NOCHDIR to avoid FTS_AGAIN (duh)
+	 fts: clear status for FTS_AGAIN (fixes rm -r bug)
+	 mnt: add mvs openedition w_getmntent()
+	 sfhdr: _hdr_float && <float.h> for correct MAXDOUBLE
+	 vmalloc/vmbest: if _std_malloc then use malloc()/free() not sbrk()
+	 remove: check _std_remove
+	 procopen: handle pio[{0,1}]=={0,1}
+	 setenviron,features/uinstd: test for mvs.390 dll environ hacks
+96-12-25 <sfio_p.h> -> <ast_common.h>
+	 __EXTERN__(type,object)
+	 __DEFINE__(type,object,value)
+	 magic: check strings in !CC_NATIVE code set too
+	 system: cmd==0 means check for shell access (xopen)
+	 sfhdr.h: fix sfrsrv prototype
+	 add __libc_malloc etc for gnu/linux
+	 astconf(NiL,path,name) == astconf(name,path,NiL) + no liberror
+	 fts_open: if toplist() stat fails return 0
+	 ftwalk: handle fts_open()==0 via one phony userf() call
+	 sfmode: S_ISFIFO default is SF_SHARE=0
+	 features/lib: _WIN32 _lib_vfork=1 by default
+	 unsigned<0 comparison and other fixes via sgi.mips4 cc
+	 stk.c: use <align.h> ALIGN_BOUND for stkalloc()
+	 features/lib,vfork: uwin fix
+	 ast_std.h: fix strto[u]ll prototypes with features/types _ast_int_8
+	 getsubopt: add for xopen 4.2 compatibility
+	 drop function __IMPORT__
+	 magic: more magic
+	 change #define FILE from Sfio_t to struct _sfio_s
+	 state.c: add generated includes that may be hit by std for MAM
+	 bytesex: forgot about sizeof(long)=>7; could we fix the name too?
+	 vmalloc.h: fix vmnewof() definition
+	 sfio.h,stdio.h,ast_common.h: pollution cleanup
+	 magic.c: add | op for switch
+	 Makefile: stdio.h was on both HEADERSRC and HEADERGEN -- don't do that
+	 drop pp:notice to get <sfio.h> ... <ast.h> to work 
+	 regex: add [[:<:]]==\< and [[:>:]]==\> for bsd compat
+	 mime.c: ignore X-* headers while scanning for Content-*
+	 magic.c: check for negative indirect offsets
+	 magic.tab: fix dos entry that generated negative indirect offsets
+	 vmalloc.h: add vmstrdup() prototype
+	 hash.h: add hashgetbucket() macro
+	 magic.c: MAGIFILE is now a : file list
+	 mnt.c: another 4.4 bsd fix -- users must include <sys/crap.h>
+	 common: fix _WIN32 chicken&egg with va_copy
+	 sfio: forgot to set f->val along with _Sfi in sfexcept() 
+	 Makefile: add mini target for uwin libmini.a
+	 sfcvt.c: workaround for flaky long double optimizers
+	 features/common: fix to work with va_list==void*
+	 regexec.c: fix REG_STARTEND subexpression offsets
+	 strmatch.c: don't forget <wctype.h>
+	 regrexec.c: fix REG_INVERT end boundary bug that missed last record
+	 astconf.c: notify(0,0,"a=b") called for each setenviron("a=b")
+	 pathcanon.c: check astconf(PATH_LEADING_SLASHES) to preserve //*
+96-11-28 _LARGEFILE64_SOURCE by default if possible: NOTE: assumes xopen
+	 regerror: fix for xopen
+	 getopt: fix for xopen
+	 magic: add ciao virtual database
+	 astconf: posix/strict/xopen implies "standard" conformance
+	 fs3d.h: hide mount prototype
+	 ast_std.h,mnt.c,features/fs: ncr port tweaks
+96-10-31 version 5.0
+	 add strtoll() strtoull()
+	 sfkeyprintf: upgrade to int_max args
+	 ast.h: add ssizeof() to work around unsigned botch
+	 conf.sh: add shell actions to conf.tab
+	 _DLL*: drop for _BLD_<lib> + __EXPORT__ + __IMPORT__
+	 sfio,cdt,vmalloc: kpv update
+96-10-11 <ccode.h>: add character code map support
+	 procclose: return shell style exit status
+	 features/fs: pun statvfs.f_basetype to statvfs.f_reserved7 for mvs
+	 uwin: add subdir for uwin additions
+	 ast_std.h: swab() is from <stdlib.h>
+	 sfio.h: <ast_std.h> if _PACKAGE_ast
+	 magic.tab: add mips[1-4], 64-bit
+	 port tweaks for sol.sun4 and sun4
+96-09-06 strerror: add
+	 fmterror: uses strerror
+	 str*search: use sfiso646() order
+	 strpsearch: add
+	 magic: add Magic_t.mime mime type return for magictype()
+	 mime.h: add
+	 strton: use sfsscanf()
+	 strperm: factor in umask() if no who
+	 pathtmp: add TMPPATH check
+	 libevent: add
+	 magic: add discipline to magicopen()
+	 mime: add discipline to mimeopen()
+96-08-31 regex: fix BM fail table generator
+96-08-11 mntread: fix mnt.type for SCO variant
+	 conf.tab: add SCO KERNEL_* sysconf() vars
+	 fastfind: add findwrite(), fix findread() FF_OFF omission
+	 ftwalk: reimplement on top of fts
+	 fnmatch,re_comp,regexp: reimplement on top of regex
+	 basename,dirname,fmtmsg,fts,ftw,getdate,getsubopt,glob: add
+	 hsearch,nftw,realpath,strftime,strptime,swab,tempnam: add
+	 tsearch,wordexp: add
+	 getcwd: cache last path for easy test
+96-07-17 error: sfsync(NiL) ... write ... sfsync(sfstderr)
+	 astconf: handle readonly *(DEV|DIR) vars
+96-04-01 swapop: fix stupid return value bug
+	 features/int.c: fix int_swap generation bug
+	 regnexec,regrexec: fix unsigned underflow init error
+	 ls.h: fix iblocks() to be in units of LS_BLOCKSIZE
+96-02-29 magic: space before function is definition with no call
+	 hash: drop hash_info from public interface
+	 hash: OBSOLETE hashlast()
+	 hash: add Hash_root_t.Hash_last_t to public interface
+	 add strsearch() and strnsearch() to complement strlook()
+	 add hashkey.h for keyword->long hash
+	 pathpath: pathpath(0,0,"",0) disables $0 $_ $PWD relative search
+	 sfio: sfstrtod+sfhdr update
+	 regex: fix REG_LENIENT to map BRE \[+?|] to ERE [+?|]
+	 change _std_malloc iffe test so it doesn't hang on alpha
+	 sfhdr.h: features/sfio generates _lib_cvt instead of _i386_cvt
+	 ast_hdr.h: add va_copy(a,b) to copy va_list b to a
+	 getopt: fix stupid getopt() -> optget() bug
+	 sfvprintf: %h? now downcasts
+	 regex: handle strto?l() errno in regcomp()
+	 sfstrtod: _Sfstrtod_already_defined -> _STUB_sfstrtod
+	 ast_std.h: hide valloc() and ignore <strings.h>
+	 sfkeyprintf: pass phony va_list for '2'
+	 regex: change HIT var type from int to size_t in special()
+	 ast.h: add EXIT_STATUS(x) to convert wait() status to sh exit status
+96-02-14 regex: add _ to \<...\> isalnum test
+	 regex: fix BM inner loop breakout
+	 features/types: size_t is signed on some systems! => _ast_size_t
+	 sfio: sfrd discipline peek optimization
+	 vmalloc: vmalloc.h malloc family macro upgrade
+	 tokopen: fix newline bug for non-restore open
+	 sfio: no inline for gcc until it emits for -g too
+96-02-12 sfio: internal upgrade
+96-02-09 regex: Boyer-Moore boundary fix
+	 vmalloc: snarf latest
+96-02-06 regex: add regrecord() and regrexec() for Boyer-Moore record filtering
+	 regex: rearrange regnexec() args to match buffer,count arg style
+96-01-31 stk: add STK_NULL to stk.h and stk.c
+	 regex: privatize regex.h and fix min re length computation
+	 workaround lazy strdup() implementations in features/lib _std_malloc
+	 fix stkclose() to free(stream) -- purify missed because of sfio links
+	 unused var cleanup
+	 port/mnt.c must include <ls.h> to get <ast_fs.h>
+	 add SF_FINAL to sfio and stk
+	 sfio reads now on natural block boundaries
+	 add #!!! <level> <message> !!! to tokline()
+	 add REX_BM pre-filter to regcomp/regnexec
+96-01-22 add regcomp env.paren overflow checks
+96-01-11 add Doug McIlroy's regex (converted to C from C++ by gsf)
+	 AT&T Research now
+	 sfgetr optimization
+	 regex buglets
+96-01-05 tweak magic.tab for win32
+95-12-25 add !(...) -> (...)! to fmtre()
+	 nt tweaks -- functions with no header proto must be defined extern
+95-11-24 version 4.1
+	 add mnt.h mntopen mntread mntclose
+	 convert fmtfs to mnt.h
+	 add RE_LEFTANCHOR and RE_RIGHTANCHOR
+	 gcc inlines must also have global library function instantiation!
+	 add hashview()
+	 fix strtape() internal buffer flow
+	 fix mntread() fs/dir transposition for uts mnttab
+95-10-31 change features/unistd.c includes to break limits-param cycle
+	 add cdt from kpv
+	 sfio snarf from kpv
+	 add [ht]search for _WIN32
+95-10-11 clarify PARANOID pathcheck() warning
+	 fix procopen() LIB_SPAWN environ bug with setenviron() cache
+	 fix setenviron() bug that forgot to reset environ if == 0
+	 add %Z ' ' output format to sfkeyprintf()
+	 sfio snarf for sfvprintf fix
+	 allow multiple hashscan() with scope caveat
+	 add comp/fakelink.h to synthesize a few symlink text patterns
+	 add !<xxx> magic to misc/magic.tab
+	 add FTW_TOP to inhibit recursion (for ftw side effects on top level)
+	 add memfatal() common malloc fatal exception message
+	 add dos \rtest to misc/magic.c/cklang()
+	 sftmp() O_EXCL+random to avoid collisions
+	 pathtemp() uses sftmp() randomizing
+	 features/fs uses SF_APPENDWR
+	 sftmp() uses pathtemp() -- don't worry, its not circular
+	 a few more _WIN32 compatibility additions
+	 realloc fixed to use VM_RSCOPY|VM_RSMOVE instead of obsolete 1
+	 add hashlook(tab, oldname, HASH_RENAME, newname)
+	 a few more tweaks to satisfy port warnings
+	 add _SFIO_INLINE_PRIVATE to provide real function too
+	 fix <dirent.h> installation test
+	 oops object / shared library compat with _sfgetl2 _sfgetu2
+95-09-11 add getopt() compatibility
+	 add fstat,lstat,mknod,stat fixes for _x versions in sys/stat.h
+	 add getconf CONFORMANCE - posix for things that aren't ast default
+	 sfio_t.h: #ifndef _SFIO_H #include "sfio.h" #endif
+	 snarf vmalloc from kpv
+95-08-11 fix malloc bug in magic
+	 update linux and bsd 386 magic entries
+	 error_info.auxilliary returns new level, |=ERROR_OUTPUT if msg done
+	 drop fnmatch from strmatch for sparc (solaris) until it collates
+95-07-17 fix port/astconf universe initialization
+	 fix misc/optget opt_info.nopt initialization
+	 drop tmset() TZ=... because it only worked when TZ=... was ignored
+95-05-09 mongo <ast.h> namespace cleanup
+	 drop > 2 year old obsolete interfaces
+	 sfvprintf.c fix for (char:8 short:16 int:32 long:64) architectures
+	 TMP_MAX back into conf.tab
+	 pathbin() and pathshell() now use astconf()
+	 fix pathtemp() to not cache getenv("TMPDIR")
+	 fix ftwalk() metaphysical to handle non-dirs too
+	 initialize *_info = { 0 }; for ancient ld semantics (NeXT)
+	 fix magic() to do vmfree()
+	 astconf(X_OK) must prefix lines with "getconf"
+	 use <wchar.h> and wctype in strmatch() if available
+	 _lib_utime_now checks utime(path,0)
+	 _lib_poll_notimer checks poll(x,0,timeout)
+	 add another _lib_utime_now check to port/touch.c
+	 fix dd_buf cast in dir/opendir.c
+	 split getconf.h into conftab.h and conftab.c for :READONLY:
+	 use mbtowc() only if MB_LEN_MAX>1
+	 sfio char* -> Void_t* cleanup
+	 handle old syntax in misc/magic.c
+	 sigdata.c holds readonly signal strings
+	 pathcheck() does AT&T checks for tools matching PARANOID - yuk
+	 unused var cleanup
+	 deprecate hash_info in favor of hashlast()
+	 fix bad conf.sh ksh integer interactions
+	 dll cleanup
+	 magic.c falls back to malloc for now
+	 add environ to <ast.h> -- C library global data syms are *RESERVED*
+	 sfhdr.h memccpy(1,2,3,size_t) prototype
+95-04-01 version 4.0
+	 convert to vmalloc
+	 allow sigcritical() nesting mismatch to work around vfork() bug
+	 add strexpr() primitive for streval() with user handle (like ftwalk)
+	 add <magic.h> and magic.c file command magic interface
+	 update magic mail message entry
+	 fix keyprintf() invisible char count nesting bug
+	 add sfstrnew(SF_READ|SF_WRITE) for alternate sfstropen() modes
+	 sfstrnew(SF_READ) but reading requires sfseek(), sfreserve()
+	 add conf.tab and conf.sh to nail C/POSIX limits/unistd macros
+	 add getconf() string interface to *conf*
+	 _DLL_INTERMEDIATE_DATA for systems that require indirect globals
+	 _DLL for building shared libraries with _DLL_INTERMEDIATE_DATA
+	 vecfile() restricted to S_ISREG()
+	 add spawnveg() for job control
+	 convert procopen() PROC_PGRP(id) to spawnveg()
+	 fmterror() returns error text given errno (strerror() does same)
+	 fmtsignal() returns signal text given errno (strsignal() does same)
+	 {sig_name,sig_text,SIG_MAX} -> sig_info.{name,text,sigmax}
+	 liberror("",...) omits [%s library] prefix
+	 update features/signal.c table
+	 add vmdisc() and change vmnewof() to use vmresize()
+	 fix conf.sh to allow refs to previously defined limits
+	 fix undefined entries in getconf()
+	 magic data in magic.tab
+	 fix stropt() pointer cast
+	 vmalloc() exception handler replaces nomalloc()
+	 merge sigdata.c into fmtsignal.c -- sun link needs function w/ data!
+	 sftmp() bug fix
+	 drop local <unistd.h> even with _POSIX_SOURCE
+	 fix vmstrdup() macro arg miscount
+	 fix conf.sh to handle enum'd symbolic constants in unistd.h
+	 drop malloc() et.al. prototypes from vmalloc.h
+	 fix sfvprintf() %d argument reference
+	 add OSF/1 AES symbol(s) to conf.tab
+	 determine standards prefix from conf.tab
+	 add _CS_SHELL to conf.tab
+	 getpath() default is confstr(_CS_PATH)
+	 getshell() default is confstr(_CS_SHELL)
+	 unify keyprintf user function args (should have learned by now!)
+	 add quad type to magic
+	 add astfeature() to unify universe style dynamic features
+	 add ftwflags() to determine FTW_* flags from astfeature()
+95-03-11 fix stropt() to not modify its *const* arg
+	 handle "' quotes and chresc() in stropt() values
+	 , treated like :space: between stropt() options
+	 fix procopen() fd dup to ignore self-dups
+	 add library id[] to misc/state.c
+	 add ftwalk(FTW_METAPHYSICAL) for posix -H
+	 sfvprintf() now handles balanced () in %()
+	 add tmfmt() with buffer size check to replace tmform()
+	 add fmttime() calling tmfmt() to fit fmt*() mold
+	 add <keyprintf.h> and keyprintf() to support %(...)? in commands
+	 add Hash_table_t for size==0 in stropt()
+	 add EXTTYPE extended header to tar.h
+95-02-14 sfmove() buffer size overflow fix
+	 add _SFSTDIO_H to sfio.h
+	 rename setenv() to setenviron() -- posix finally decided
+	 rename <option.h> opt_* to opt_info.*
+	 update features/unistd.c for _SC_* and _PC_* posix additions
+95-01-19 (char*)uchar cast in fmtesc()
+	 fix hash bucket memory leak in hashlook() [via John Mocenigo]
+	 update strings/strtape()
+	 fix optget()/optjoin() to handle leading +
+	 add ALIGN_ prefix to <align.h> identifiers
+95-01-11 change tm/*.c tmset(0) to tmset(tm_info.zone) to keep user setting
+	 fix tmform() %Z null pointer dereference
+95-01-01 add this RELEASE file
+	 fix strperm() to properly handle "644 file"
+	 fix tokline() to return last ' ' terminated line in string
+	 fix tokscan() to properly handle \\n splice
+	 add fmtesc() to complement stresc()
+	 add LS_NUMBER to fmtls()
+	 drop spurious optusage() ' '
+
+
+

+


libcmd changes

+
+
+12-02-14 rm.c: --force ignores no file operands specified
+12-01-10 b_* (int, char**, void*) => (int, char**, Shbltin_t*)
+11-08-27 pids.c: add getsid() iffe test
+10-08-16 chmod.c: add -l alias for { -h --symlink }
+11-08-16 chgrp.c: change lchmod() ref to lchown()
+11-05-03 cp.c: do not delete src if mv to dest fails -- doh
+11-03-28 chmod.c,chgrp.c: fix --symlink logic
+11-03-26 rm.c: don't eaccess() check symlinks!
+11-01-27 date: add { -R, --rfc-2822, -T, --rfc-3339=type }
+11-01-03 chgrp.c: --symlink => --physical
+10-12-10 rm.c: fix not-writable logic
+10-12-01 tee.c: add iterrupt logic for slow open(1) -- needs to be generalized
+10-11-30 chgrp.c: add -N,--numeric to bypass name lookup
+10-10-20 cp: add --timestamps (preserv timestamps and permissions)
+10-10-20 ln: fix 'cannot replace existing file' logic
+10-10-10 cp,mv: add --remove-destination
+10-08-11 cp.c,expr.c: use conformance("standard",0) test
+10-08-11 cut.c: use mbnsize() instead of mblen() (for ast C.UTF-8)
+10-07-28 chgrp.c,chmod.c,cksum.c: fts_path for diagnostics, not fts_accpath!
+10-06-14 rm.c: fix -rfu logic
+10-06-12 paste.c: repeat after me: do not modify argv[i]
+10-06-01 sync with ast api 20100601
+10-05-09 tail.c: fix -0f bug that inially listed the entire file
+10-05-06 basename.c: add { -a,--all -s,--suffux=suffix } from BSD
+10-04-12 cat.c: fix -v bug that dumped core and make consistent with cmp --print-chars
+10-04-11 cmp.c: add --print-bytes, --count=n, --differences=n
+10-04-08 vmstate.c: add { method flags } vars for Vmstat_t.mode
+10-04-08 mkdir.c: fix check for { S_ISUID S_ISGID S_ISVTX } after successful mkdir(2)
+10-04-01 stty.c: add --fd=fd option
+10-03-23 tail.c: fix -f large initial offset bug that didn't copy all data
+10-03-07 tail.c: sfsync(sfstdout) after all -f done, fix -f partial line
+10-03-05 mktemp.c: add --regress=seed for testing
+10-03-05 vmstate.c: add
+10-01-26 tail.c: -f sleep(1) only if no progress from last round of checks
+10-01-20 fts_fix.[ch]: use <fts_fix.h> instead of <fts.h> (see fts_fix.c)
+10-01-20 cp.c: free(state) if called from old shell
+09-12-10 join.c: <wctype.h> for iswspace()!
+09-12-04 cmd.h: fix CMD_DYNAMIC logic
+09-12-04 cut.c: handle -d mb
+09-12-03 mkdir.c: add --verbose
+09-11-30 cat.c,date.c,cksum.c: drop setlocale() call already done by optget()
+09-11-30 join.c: handle -t mb
+09-11-28 wclib.c: { -w -L } mb independent of -m
+09-11-28 paste.c: handle -d mb
+09-11-28 uniq.c: handle -s mb
+09-11-28 cksum.c: FTS_SEEDOTDIR by default
+09-09-09 fds.c: add --unit=fd
+09-08-25 tail.c: initialize Tail_t.fifo=0 !!
+09-08-15 tail.c: fix fifo logic
+09-08-11 wc.c: add setlocale(LC_CTYPE,"C") cleanup, add utf8 optimzations
+09-08-10 uniq.c: replace -c 1..9999 sfsprintf() with inline conversion
+09-08-01 join.c: fix empty field null pointer deref
+09-07-23 pathchk.c: add -P,--path and -a,--all
+09-07-02 chgrp.c,chmod.c,cksum.c: fts_flags() default only if not --recursive
+09-06-19 cmd.h,cmdinit.c: add ERROR_CALLBACK for ERROR_NOTIFY main() callback
+09-06-19 mktemp.c: --unsafe now checks and prints path but does create
+09-06-19 tee.c: add ERROR_CALLBACK for tee_cleanup() sfio discipline pop
+09-06-18 rm.c: handle interrupts during interactive query
+09-06-18 cp.c: handle interrupts during interactive query
+09-05-25 tail.c: fix old style option logic to handle --invalid-long-option
+09-05-24 tail.c: -r == +1r
+09-05-01 mktemp.c: handle foo/prefix, add -p dir and -u
+09-03-31 cat.c: handle --no* options
+09-03-15 tail.c: fix --timeout termination logic
+09-03-03 tee.c: clean up sfio disciplines on error
+09-03-03 cat.c: fix -v|-e|-n|-B interaction bugs
+09-02-14 tail.c: fix VSC failures
+09-02-14 join.c: fix VSC failure
+09-02-02 uniq.c: document -number == -fnumber, +number == -snumber
+09-02-02 tail.c: fix usage[] for negative offsets, add sun -b
+09-02-02 mktemp.c: add
+09-02-02 features/utsname: UWIN _UNAME_os_DEFAULT => UWIN
+09-01-31 dirname.c: add experimental { -f -r -x } for pathpath(3)
+09-01-05 cmp.c: fix EOF diagnostic to conform to posix
+09-01-03 mkfifo.c: fix --mode=mode logic
+08-12-07 date.c: add %[_][EO]K for [space pad] [full|long] iso docs
+08-11-10 stty.c: check for -t grouping so -tostop != -t -ostop
+08-10-15 rm.c: handle 'rm -f x x' => exit 0
+08-09-08 stty.c: #ifdef guard TAB[012] -- freebsd: damn the posix, full speed ahead
+08-06-17 shcmd.h: move to libast
+08-04-24 uniq.c: add optget() 'n' option for -1 => -f1
+08-04-24 getconf.c: clarify diffs between "name - value" and "name = value"
+08-04-01 cut.c: add write error check
+08-04-01 paste.c: fix --noserial stream vector access bug
+08-04-01 pids.c: add ls/ps style --format=format
+08-04-01 stty.c: fix off2 unitialized reference
+08-03-28 chgrp.c: add --before=file
+08-03-14 pids.c: add
+08-03-11 chgrp.c: fix -m to use uid:gid as lookup key
+08-02-11 Makefile: add -lmd possibly required by sumlib.o -- hack alert
+08-01-30 expr.c: fix <=0 type that broke substr * 1 * -- wow
+07-12-13 cp.c: fix builtin state reinitialization
+07-11-29 rev.c: honor multibyte locales
+07-11-27 cp.c: open non-existent destination with O_EXCL
+07-11-27 stty.c: add -t,--terminal-group to list tty pgrp
+07-11-27 cksum.c: --silent -s => -S, -s == -x sys5 for gnu compatibility
+07-11-11 tee.c: drop ancient bsd compatibility "-" operand => SIGINT
+07-10-29 cksum.c: add SUM_LEGACY for -r
+07-10-12 cp.c: plug usage string memory leak by using per-builtin state
+07-09-21 cksum.c: add sumprint() default scale arg, --scale, --bsd for solaris
+07-09-10 chmod.c: add --show,-n
+07-07-27 wclib.c: bias <wchar.h> checks for modern unix
+07-07-17 cat.c: fix --squeeze-blank to reduce multiple blank lines to *one*
+07-05-20 cmd.h: handle msvc's balk at if(0)0=0;
+07-05-20 cksum.c: #include <modex.h>
+07-05-11 cmd.h: add _CMD_CONTEXT_OK() to verify >= 20070511 context
+07-05-09 fds.c: handle ipv6 sockets
+07-05-09 cmd.h: <shbltin.h> : cmdquit() => sh_checksig(context)
+07-04-25 mkdir.c: force (S_ISVTX|S_ISUID|S_ISGID) after mkdir(2)
+07-04-24 procrun.c: add -last intercept => sh_run() and whence -q
+07-04-19 uname.c: name operands first checked for CS_NAME, then NAME
+07-03-28 date.c: add --unelapsed=scale, -U: fmtelapsed() => strelapsed()
+07-03-25 wclib.h: iswspace() requires <wctype.h>!
+07-03-11 tty.c: add sysV --line-number, -l
+07-02-26 Makefile: sumlib.o: direct extract from +lsum (vcodex someday)
+07-02-24 Makefile: tweak cmdext.h action for --mam bootstrap
+07-02-09 Makefile: { cmdext.h cmdlist.h } depend on *.c list!
+07-02-09 Makefile: +lsum to bring in static -lsum (no dynamic right now)
+07-02-07 cksum.c: move from src/cmd/std with ftwalk => fts
+07-02-07 getconf.c: handle /bin == /usr/bin in defer logic
+07-01-26 chmod.c: don't FTS_FOLLOW if !FTS_PHYSICAL
+07-01-23 cut.c: Cut_t variable dimension list[] must be last member
+07-01-22 uname.c: fix -h typo that clobbered astconf() state -- ouch
+07-01-02 fmt.c: fix buffer splice off by one bug -- what else
+06-11-23 cmd.h: because of proto cmdinit cannot be a function like macro
+06-11-21 cp.c: fix 06-10-31 const dot[] readonly assignment
+06-11-15 cp.c: fix 06-10-31 ln -s enoent bug
+06-11-11 getconf.c: let astconf() handle "undefined" vs. ""
+06-11-11 getconf.c: fix deferred getconf path search
+06-11-11 fmt.c: handle two char { \t } in --usage ouput
+06-10-31 global edit to eliminate most non-const static data0
+06-10-31 use <cmd.h> for all b_*() implementations; drop <cmdlib.h> 
+06-10-31 cmd.h: add CMD_ prefix to { BUILTIN DYNAMIC STANDALONE } 
+06-10-31 join.c: tone down /tmp usage vi SFSK_DISCARD
+06-10-31 cp.c,rm.c: update to <fts.h> to accomodate non-static data
+06-10-29 date.c: "...%H%..." => "...%H" "%..." to avoid SCCS conflict
+06-10-26 fds.c: handle sctp
+06-10-18 tail.c: fix invalid suffix infinite loop
+06-10-11 chgrp.c,cp.c: add sfstruse() error checks
+06-10-10 tee.c: add --linebuffer, -l
+06-10-06 getconf.c: preserve native getconf(1) known variable behavior
+06-10-04 sync.c: add (thanks to Roland Mainz)
+06-10-04 getconf.c: add -v specification => run native getconf(1)
+06-09-28 stty.c: static setmode() => set() for darwin.i386
+06-09-27 head.c: handle -1c => -c1
+06-09-19 pathchk.c: pathconf() => astconf()
+06-09-11 tail.c: handle compatibility corner cases
+06-09-08 date.c: add output write error diagnostic
+06-09-04 tail.c: fix initial position for -n0, no args => no -f
+06-08-28 uniq.c: add -D,--all-repeated
+06-08-25 wc.c,wclib.c: add -L,--longest-line,WC_LONGEST
+06-08-24 wc.c,wclib.c: implement -m and WC_MBYTE
+06-08-24 rmdir.c: -sp applies to every message, add gnu -e
+06-08-23 rmdir.c: add solaris --suppress, -s
+06-08-23 mkdir.c: don't add 0300 to -p final dir mode
+06-07-17 cut.c: handle last line with no newline
+06-07-17 cut.c: --output-delimiter == --line-delimiter
+06-06-25 chmod.c: mask -c output with S_IPERM
+06-05-09 uname.c: add -o; change -a to match linux
+06-05-03 date.c: add --last -L to list last of multiple time args
+06-02-14 tail.c: fix -f bug that lost fast stream data
+06-02-11 getconf.c: exit 1 if name invalid -- duh
+06-01-28 cp.c,rm.c: fix astquery() 'q' to return and not exit()
+05-08-11 fmt.c: fix -o to handle raw --usage strings
+05-05-17 cat.c,head.c: disable EPIPE error messages
+05-04-14 chgrp.c: -f means all non-syntax error messages
+05-04-11 fds.c: add from old internal open(1)
+05-04-09 cmdext.h,cmdlist.h: generate from source -- about time
+05-03-24 features/symlink: verify { lchmod lchown } implementations
+05-03-07 date.c: add --listzones to list the time zone table
+05-02-14 chmod.c: add --reference=file
+05-01-11 cat.c: restore output stream to binary mode on exit
+04-12-15 cp.c: add --preserve high resolution time support
+04-12-08 date.c: add high resolution time support
+04-12-01 cmp.c: fix %6I*ld => %6I*d -- doh
+	 fmt.c: handle "n operands n"
+	 head.c: handle -cN -nN, N > 4Gb
+04-11-22 cmp.c: handle >2G chars/lines
+04-11-18 fold.c: add --prepend=text, --append=text
+04-10-31 tail.c: use SF_LOCKR macro
+04-10-28 tail.c: use strtol() for old stype [+-]number[suffix] -- doh
+04-10-22 cp.c: check rename() errno==ENOENT to retain destination
+04-10-11 fmt.c: fix -o,--optget sublist bugs
+	 tail.c: use strton() for number conversion
+04-10-08 pathchk.c: add empty path and -p - first component char
+04-10-01 fmt.c: add -o,--optget concatenated usage string format
+	 stty.c: context is ERROR_INTERCATIVE
+	 rm.c: restore 3d before exit
+04-09-24 pathchk.c: fix docs
+04-09-14 date.c: add %| and %& --parse docs
+04-08-27 cp.c: add FTW_DC check -- duh
+04-08-01 fmt.c: handle last char != '
+04-07-22 date.c,uname.c: access() => eaccess()
+04-07-01 fmt.c: handle large input lines -- ouch
+04-06-11 id.c: fix -r to output something!
+04-05-27 expr.c: fix `:' op subexpression output
+04-04-15 chmod.c: follow symlink for relative mode
+04-04-12 Makefile: add STDCHMOD (for osf.alpha)
+04-03-19 tail.c: handle -f sfreserve() large chunk failure
+04-02-29 cp.c: decouple -f and -i for standard CONFORMANCE
+	 cp.c: mv now attempts rename() before remove()+rename()
+	 date.c: -f format or +format disables system clock set
+04-02-14 cp.c: add -F --fsync to call fsync(2) for each copied file
+04-01-05 head.c: -s now uses opt_info.number for >2Gb skip
+03-09-18 tail.c: add --log
+03-09-11 rm.c: add --unconditional
+03-08-11 fold.c: add --delimiter=c to break at c
+03-07-28 features/time: change settimeofday() test to 2nd arg of (void*)0
+	 expr.c: add {match,substr,index,length,quote}
+03-07-15 fmt.c: fix trailing space bug
+03-06-20 uname.c: fix -p constant string overwrite
+03-06-04 stty.c: add undef to control assignment docs
+03-05-31 uname.c: add -f and sysinfo()/confstr() compatibility via astconf()
+03-05-27 rm.c: fix inappropriate "/.." append path overflow
+	 cut.c: snarf from dgk
+03-05-18 rm.c: check st_nlink to verify progress w.r.t. ftwalk/fts
+03-05-15 join.c: fix stealth -v2 bug (thanks ahs)
+03-05-04 wc.c: drop trailing space for `wc -l < file'
+03-03-21 date.c: add %Q/recent/distant/ docs
+03-02-19 date.c: fix %+|!flag docs
+02-11-14 update for cmdinit() 4th arg and ERROR_NOTIFY for interrupt cleanup
+02-10-02 date.c: tmform() => tmfmt()
+02-09-30 date.c,uname.c: change execv() calls to procrun(): exec|exit => bad
+02-09-06 wclib.c: fix 1 char-at-a-time miscount bug
+02-08-19 chgrp.c: convert to use <cdt.h>
+02-07-23 join.c: fix comm snarf typo
+02-04-05 date.c: add %u
+02-01-24 stty.c: ifdef a few more macros for uts (yes, its still running)
+01-12-14 date.c: clarify %z doc
+01-10-31 mkdir.c: mkdir() on existing dir could fail with errno!=EEXIST
+	 uname.c: add execve() loop check for unknown options
+01-10-29 tail.c: SF_SHARE on only if not reading through EOF
+01-10-11 getconf.c: fix usage typos
+01-09-11 cp.c,cmd.h: handle . in argv[0]
+	 cp.c: add O_BINARY to all open() calls
+01-09-06 tail: input streams must be SF_SHARE -- duh
+01-07-16 stty: fix cntl() macro for CC_NATIVE!=CC_ASCII
+01-05-31 date: fix /bin/date fallback logic
+	 stty: fix a few mismatched flags, -a and -g option logic
+	 stty: tone down sane to modify current settings rather than from zero
+01-05-01 uname: -i => -h, add sol.sun4 -i, add sgi -R, punt to /usr/bin/uname
+01-04-17 date,rm: add
+01-03-07 cp: fix readonly string mod on "."
+01-01-23 cp: `cp foo' => `cp foo .' only for CONFORMANCE!=standard
+00-12-01 cut: multibyte support
+00-10-31 mkdir: handle races by checking EEXIST
+00-09-20 cp: copy argv to stack before modifying in place
+00-05-18 add setlocale(LC_ALL,"")
+00-04-30 join: drop weird opt_info.argv reference
+00-03-17 expr: add == operator -- duh
+	 cp,ln,mv: delay pathcanon() on destination to verify `cp a b/.'
+	 getconf: use astgetconf for proper message control
+	 ERROR_translate: dictionary update
+00-03-08 tail: handle multiple -f files
+00-03-07 fmt: add
+00-03-07 dirname: handle PATH_LEADING_SLASHES as documented
+	 tail: accept + options
+00-02-14 chmod: --ignore-umask to ignore umask(2) in symbolic expressions
+	 chmod,chgrp,cp: use FTS_NOSEEDOTDIR for correct path construction
+	 cat: fix -n (was ignored, wow)
+00-01-27 getconf: add "-a" and "-v spec" for sol7.* compatibility
+99-09-09 join: fix -j1 vs. -j 1, add --ignorecase
+99-06-22 paste: defualt delim in writable string
+99-06-16 cat: fix --dos-ouput typo
+99-06-11 cp: tighten chown() diagnostics
+99-06-08 expr: nothing for NULL string bug fix
+99-05-21 paste: fix missing newline columnize bug
+99-05-20 mv: do not check for `mv foo foo' since rename() handles it
+99-05-01 cmp,comm,cp/mv/ln,expr,fold,getconf,head: long options
+	 join,logname,paste,pathchk,tail,tee: long options
+99-04-10 uname: long options, stdize -a
+	 chmod,head,tail,rev: long options
+	 cut: long options, pass regression test 02
+99-04-07 cat: long options, fix O_TEXT modes
+99-01-11 tail: fix +n
+	 join: another ggs/psm bug
+	 join: all 1 and/or 2 to be unseekable
+99-01-01 cp: fix -p
+	 chmod: drop -l option because of clash with l (lock) mode
+98-12-25 cat: add -T to sfopen(,,"rt")
+98-11-11 chgrp,chmod: cannot open file stream => not found
+	 join: fix another ggs/psm bug; thanks guys
+98-10-20 cp: fix cp -rp to update dir times too
+98-09-22 join: fix ggs null field bug
+98-08-11 join: fix last regression test bug
+98-05-29 join: add jp->common to handle boundary conditions
+98-03-11 cat,cp,rev,tee: fix sfmove() error checks
+98-03-01 join: fix bug that emitted records more than once after eof
+	 cp: fix sfmove() error check
+98-02-14 cp: -R physical, -[HLP], -r getconf(PATH_RESOLVE)
+98-01-11 cp: check sfclose() return value
+98-01-07 chown,chgrp,chmod: use fts for -R
+	 mkdir: fix -p default mode
+97-12-07 mkdir: fix umask() reset
+97-11-11 chown,chgrp: proper interpretation of -h,-l for lchown()
+	 chown,chgrp: only chown() if uid or gid change
+97-10-31 mkdir: do umask right
+97-08-11 cmdinit: clear opt_info.index to allow multiple calls
+	 cp,ln,mv: add
+97-07-17 join: fix a few more -a bugs
+97-05-31 expr: optget() only if CONFORMANCE==standard
+97-04-01 join: fix a few bugs that make it work!
+96-12-25 head: sfset(sfstdin,SF_SHARE,1)
+	 Makefile: add -last to cmd lib list
+	 drop function __IMPORT__
+96-08-11 tail: check for truncated file and rewind for -f
+96-04-08 update <cmd.h>
+96-02-29 uname: -a like std, -l for everything
+	 id: add -a (default)
+96-02-14 wc: speed up inner loop newline breakout
+96-01-30 unused var cleanup
+96-01-01 AT&T Research now
+	 pathchk: handle getcwd(0,0) error
+	 expr: switch to <regex.h>
+95-11-11 add expr.c
+	 fix cut exit code and -s optimization
+95-10-11 add extern b_* to cmd.h
+	 add void* context 3rd arg to b_main()
+95-05-09 add getconf
+	 cat -u avoids mmap
+	 add chown|chgrp -m uid|gid map file
+	 add chown|chgrp -P for systems with lchown(2)
+	 chown|chgrp -P => lstat() too!
+	 chmod|chown|chgrp -HLP
+95-04-01 version 1.2
+	 add rmdir
+95-02-14 fix mkdir -p symlink bug
+	 fix mkdir '/' skip bug that went one too far
+
+
+

+


libcoshell changes

+
+
+12-02-22 coinit.c: handle non-identifier export var names
+11-12-13 cowait.c: handle sfpoll() error return on interrupt
+11-11-21 cowait.c: poll before blocking read to weed out killed jobs (no 'x' message)
+11-08-30 codata.c,coopen.c: drop macro "..." catenation for old cc
+10-08-11 coinit.c: force _BLD_DLL for environ intercept
+10-06-01 sync with ast api 20100601
+10-05-19 cokill.c: do cowait(co,co,0) to drain pending messages
+10-05-15 coshell.h,coopen.c: add CO_ORPHAN for PROC_ORPHAN
+10-05-11 coopen.c: add PROC_ORPHAN for CO_SHELL
+10-05-10 coopen.c: no atexit() for CO_SHELL
+10-04-15 first ksh93u local job pool tests work (service daemon tbd)
+10-04-14 cowait.c: add 3rd cowait() arg timeout; 0 Coshell_t* operates on all open coshells
+10-04-10 coshell.h: add CO_SHELL for shell using coshell!
+09-12-09 coexport.c: add runtime CO_ENV_EXPORT hook that avoids changing environ
+08-10-28 coopen.c: close write side of parent msgfd -- doh
+08-04-28 coexec.c: check for fd 1,2 equivalence before CO_SERIALIZE 2>&1
+07-10-29 coshell.h,coexec.c: fix procrun()/system() intercept logic
+07-08-15 add CO_SEPARATE,CO_MODE_SEPARATE for separate shell+wait per action
+07-04-09 Makefile: $(CC.PIC) to allow archive to be pulled into other dlls
+06-08-22 coshell.h: procrun => coprocrun, system => cosystem
+06-08-09 coshell.h: export CO_ENV_MSGFD for COSHELL=coshell
+06-08-02 coexec.c: Cojob_t.flags&CO_SERVICE for service requests
+06-08-02 cokill.c: cokill() signal==0 => kill CO_SERVICE jobs
+06-07-27 coexec.c: drop server cowait() that bypassed caller
+06-06-21 coexec.c: add non-block cowait() to drain responses
+06-06-11 fix service intercept cleanup
+06-05-24 add service=name:init lightweight service intercepts
+05-04-19 cowait.c: beef up invalid message tests and diagnostics
+05-04-11 drop fixed CO_MSGFD for $_coshell_msgfd
+05-04-07 coexec.c: fix !_lib_fork&&_map_spawnve close-on-exec redirection
+04-09-22 cowait.c: remove CO_SERIALIZE temporaries after listing -- duh
+04-09-01 co*: add CO_SERIALIZE
+04-07-22 system.c: access() => eaccess()
+04-02-11 coinit.c: fix CO_CROSS PATH initialization
+02-10-30 coclose.c: fix reference-after-free bug in coclose()
+02-01-31 codata.c,coopen.c: fix CO_MSGFD parameterization
+02-01-24 coopen.c: fix small memory leak
+01-10-26 coopen.c: hung sfclose(fp) -> close(sffileno(fp)) -- wow
+01-09-11 coinit.c: fix coident[] for ancient bsh that die on `test == 1'
+	 coinit.c: and fix coident[] to weed out buggy ksh88i trap on exit
+01-05-31 co*: add CO_CROSS, expose CO_DEVFD
+01-04-23 coquote: add state.type to avoid getenv() overwrite on some systems
+01-01-01 cokill: killjob => cokilljob, killshell => cokillshell
+00-12-18 coinit: CO_OSH ? "${!-$$}" : "${!:-$$}"
+00-10-25 codata: $ZSH_VERSION is not ksh
+00-02-14 procrun,system: system(3) returns wait() status (not shell status)
+99-11-19 co*: add CO_OSH for bsdi lack of times(1)
+	 coexec: CO_IGNORE for all but real ksh
+98-06-22 coinit: quote cd path arg
+
+
+

+


libsum changes

+
+
+12-02-29 sum-sha2.c: bitcount[] order reversed to allow a single noalias buffer copy
+09-09-28 sumlib.c: use simple (faster) method name match function
+08-06-05 sum-lmd.c: align context to largest int
+08-05-01 sumlib.c: add some -lmd verification checks
+08-02-11 sum-lmd.c,features/sum: add wrapper for solaris -lmd
+07-10-29 sum.h,sumlib.c: add SUM_LEGACY for legacy output format
+07-09-21 sum-sha1.c: reinstate Steve Reid's public domain implementation
+07-07-26 sumlib.c: drop GPL sum-sha1.c
+05-02-14 sumlib.c: split into sum-*.c
+05-02-14 sum-sha2.c: add SHA { 256 384 512 }
+04-02-29 Makefile: compile with $(CC.PIC) for codexlib/sum $(CC.DLL)
+03-12-16 add { crc prng } generic methods and maps[] to these methods
+03-12-16 sum.h,sumlib.c: add sumdata()
+03-09-29 sumlib.c: fix FNV to use ^ instead of +
+03-04-28 sumlib.c: drop md5 `zeroize' for performance
+	 sumlib.c: add FIPS 180-1 SHA-1
+
+
+

+


libdll changes

+
+
+11-10-11 dll_lib.c: add { dllnames() dll_lib() }
+10-10-20 dllscan.c: version arg "-" => 0
+10-10-19 dllplug.c: fix bug that wiped out dlopen() error message
+10-10-19 dllplug.c: un-localize lookup names (happens with cut and paste)
+10-10-19 dllscan.c: still no code for implicit libs missed by dlopen()
+10-08-02 dllplug.c: fix local path dllcheck() call
+10-05-28 dllplug.c: add dllplugin() with dllcheck() version check
+10-05-28 dllcheck.c: add dllcheck() to do plugin_version() checks
+10-05-28 dllerror.c: add dllerror(int retain) for dll*() and dl*() messages
+09-11-17 dllscan.c: handle name[-.]version in dlsopen()
+09-04-15 dllopen.c: add, use dllopen() internally to wrap dlopen()
+08-05-12 dllscan.c: LIBSUFFIX==.dylib => default plugin version match 0.0
+06-10-11 dllscan.c: check sfstruse() return values -- doh
+06-01-25 dllplug.c: add errorf() library message for dlopen() error
+05-02-14 dllscan.c: "" || "-" => NiL
+04-10-01 dllfind.c: drop ksh "builtin" workaround
+	 dllscan.c: directory prefix in name limits search to dir and siblings
+04-07-22 dllscan.c: access() => eaccess()
+04-01-30 dllfind.c: dllplug(error_info.id) then dllplug(0)
+04-01-28 dllscan.c: update for new plugin scheme: lib/foo/bar.xxx
+	 dllplug.c: add dllplug() for plugin dllfind()
+03-03-12 dllfind.c: dlopen() with RTLD_GLOBAL|RTLD_PARENT defaults
+03-02-11 dllscan.c: change LIBPATH to <dir>[:<env>[:<pat>]][,...]
+03-01-08 dllscan.c: hack version logic again -- is consistency rocket science?
+03-01-07 dlfcn.c: fix darwin.ppc dlopen/dlsym/dlclose
+02-11-18 dllfind.c: add path,size args (with backwards compatibility checks)
+02-11-15 dllfind.c: check for ./path if '.' in path but no '/'
+02-08-30 dllfind.c: fix a bug that returned uninitialized value on not found
+02-08-28 dllscan.c: handle and display bin as a sibling dir
+02-07-31 dllscan.c: add dllsopen,dllsread,dllsclose
+	 dllfind.c: use dllsopen,dllsread,dllsclose
+02-07-26 dllfind.c: add dllinfo()
+02-06-27 dllnext.c: define _GNU_SOURCE to enable RTLD_NEXT
+02-03-17 dllfind.c: fix dll prefix search (for cygwin)
+02-01-11 features/dll: include <dlfcn.h> only if _hdr_dlfcn&&_lib_dlopen
+01-10-31 dlfcn.c: change hp.pa dlopen() prototype (<dlfcn.h> but no -ldl!)
+01-09-25 dllfind: add LIBSUFFIX
+01-07-17 dllfind: do at least one dlopen() to prime dlerror()
+01-05-29 dlopen: fix dlopen(0,0) for HP
+01-04-20 dllfind: use getconf HOSTTYPE LIBPATH LIBSUFFIX
+01-02-14 features/dll: fix unbalanced ' quote and ancient hostinfo reference
+00-01-26 dlllook: add -- dlsym() with `_' weak prefix fallback
+99-04-01 features/dll: drop <stdio.h> -- iffe protos printf
+99-03-19 static=1 for all but win32.*
+98-06-01 dllfind: fix version search
+98-03-11 features/dll: probe for _DLL_RLD_SYM
+98-03-01 dllnext: fix to work!
+98-01-23 -ldl test moved to lib0ast
+98-01-11 update for astconf("LIBPATH")
+	 add dllnext(flags) to uncover next layer
+	 dllfind() and dllnext() in separate files (for 3d)
+97-10-11 move from libast so libast can link static
+
+

+


+ + + + + + +
March 13, 2012
+

+ +

+ + + diff --git a/lib/package/ast-ksh.pkg b/lib/package/ast-ksh.pkg new file mode 100644 index 0000000..6f2fec8 --- /dev/null +++ b/lib/package/ast-ksh.pkg @@ -0,0 +1,89 @@ +ast-ksh :PACKAGE: ksh93 libast libcmd libcoshell libsum libdll + +:COVERS: ksh + +:LICENSE: *.open + +:CATEGORY: shells + +:INDEX: ksh and support libraries + +:DESCRIPTION: + The AT&T Software Technology ast-ksh package from AT&T Research + contains ksh and support libraries. This is the minimal set of + components needed to build ksh. + +:DETAILS: cyg + :README: + This package installs a standalone ksh93 executable ksh93.exe + and its man page ksh93.1. If /bin/ksh.exe does not exist then + these symlinks + /bin/ksh.exe => ksh93.exe + /usr/share/man/man1/ksh93.1 => ksh.1 + are created. This allows alternative ksh impelementations, + e.g., /bin/pdksh.exe, to be selected by changing the ksh.exe + and ksh.1 symbolic links. In addition, ksh and ksh93 paths are + added to /etc/shells if not already present. + $() + Each builtin or special command accepts the --man and --html + options to list the man page on the standard error. The --??? + option describes the self documenting options available to all + builtin and special commands. + $() + The stanadlone ksh is statically linked with the ast libcmd + library which provides several builtin versions of /bin + commands. "builtin | grep /opt/ast/bin" lists the libcmd + builtins on the standard output. /opt/ast/bin/FOO accesses + the FOO builtin, whether the /opt/ast/bin directory exists + or not. "builtin FOO" allows /opt/ast/bin/FOO to be accessed + as FOO, bypassing the $PATH setting. To enable all libcmd + builtins do one of the following: + (a) create the directory /opt/ast/bin and the file + /opt/ast/bin/.paths with this line + BUILTIN_LIB=. + and place /opt/ast/bin before /bin and /usr/bin in $PATH + (this will affect all ksh subshells and scripts) + (b) run "builtin $( builtin | sed -e '/\//!d' -e 's,.*/,,' )" + (this will affect only the current shell) + Some scripts may run significantly faster with libcmd builtins + enabled. + $() + The ast library checks the DOSPATHVARS environment variable + for variable path values to convert to and from native windows + format when cross-executing between cygwin and non-cygwin + programs. The value is a space separated list of environment + variables to convert. PATH is handled by cygwin so it is not + converted by the ast library. + $() + The astksh cygwin source package provides a bootstrap build + environment that is not suited for an edit/build/debug cycle. + If you want to explore and modify the source then you should + install the (non-cygwinized) ast-base package which includes + AT&T nmake. With ast-base you will also be able to regenerate + the astksh cygwin source and binary packages. + $() + For more information on ksh and other AT&T ast tools see + http://www.research.att.com/sw/download/ + :EXPORT: + SHOPT_CMDLIB_DIR=1 + bin/ksh93.exe :INSTALL: bin/ksh.exe + share/man/man1/ksh93.1 :INSTALL: man/man1/sh.1 + :POSTINSTALL: + if [ ! -e /bin/ksh.exe ] + then ln -fs ksh93.exe /bin/ksh.exe + ln -fs ksh93.1 /usr/share/man/man1/ksh.1 + else echo "/bin/ksh.exe already exists" + fi + if [ -f /etc/shells ] + then for i in /bin/ksh93 /bin/ksh /usr/bin/ksh93 /usr/bin/ksh + do if grep $i /etc/shells >/dev/null 2>&1 + then echo "$i already in /etc/shells" + else echo $i >> /etc/shells + echo "$i added to /etc/shells" + fi + done + else echo "no /etc/shells file" + fi + exit 0 + :TEST: bin/ksh + KSH=$<; cd src/cmd/ksh93/tests; CYGWIN="$$CYGWIN ntsec binmode" SHELL=$$KSH $$KSH shtests diff --git a/lib/package/ast-ksh.req b/lib/package/ast-ksh.req new file mode 100644 index 0000000..e69de29 diff --git a/lib/package/ast-ksh.ver b/lib/package/ast-ksh.ver new file mode 100644 index 0000000..eb5fa10 --- /dev/null +++ b/lib/package/ast-ksh.ver @@ -0,0 +1 @@ +ast-ksh 2012-02-29 2012-02-29 1 diff --git a/lib/package/ast.def b/lib/package/ast.def new file mode 100644 index 0000000..57a7796 --- /dev/null +++ b/lib/package/ast.def @@ -0,0 +1,47 @@ +# +# ast default license info +# + +message_set=3 + +contributor+=( + [gsf]="Glenn Fowler " + [dgk]="David Korn " + [kpv]="Phong Vo " + + [aedgar]="Adam Edgar " + [alb]="Adam Buchsbaum " + [ashaikh]="Aman Shaikh " + [bala]="Bala Krishnamurthy " + [chen]="Robin Chen " + [dfwc]="Don Caldwell " + [ek]="Lefty Koutsofios " + [gruber]="Bob Gruber " + [jiawang]="Jia Wang " + [jlk]="Jeff Korn <@google.com>" + [kfisher]="Kathleen Fisher " + [kwc]="Ken Church <@microsoft.com>" + + [bwk]="Brian Kernigham " + [dmr]="Dennis Ritchie " + [doug]="Doug McIlroy " + [ekrell]="Eduardo Krell " + [jjs]="John Snyder " + [rao]="Herman Rao " + + [ast-users]="AST users mailgroup " + [ast-developers]="AST developers mailgroup " +) + +license+=( + organization="Information and Software Systems Research" + domain=research.att.com + parent="AT&T" + corporation="Intellectual Property" + company="Research" + location="Florham Park NJ" + + package=ast + since=1986 + author=gsf+dgk+kpv +) diff --git a/lib/package/ast.lic b/lib/package/ast.lic new file mode 100644 index 0000000..225faa6 --- /dev/null +++ b/lib/package/ast.lic @@ -0,0 +1,5 @@ +. ast.def +. epl.def +license+=( + start=2011 +) diff --git a/lib/package/epl.def b/lib/package/epl.def new file mode 100644 index 0000000..60eea6b --- /dev/null +++ b/lib/package/epl.def @@ -0,0 +1,8 @@ +license+=( + type=epl + id=eclipse + name="Eclipse Public License" + version=1.0 + url=http://www.eclipse.org/org/documents/${license.type}-v${license.version//./}.html + urlmd5=b35adb5213ca9657e911e9befb180842 +) diff --git a/lib/package/ksh.pkg b/lib/package/ksh.pkg new file mode 100644 index 0000000..4783527 --- /dev/null +++ b/lib/package/ksh.pkg @@ -0,0 +1,14 @@ +ksh :PACKAGE: + +:LICENSE: *.open + +:CATEGORY: shells + +:INDEX: standalone AT&T ksh executable + +:DESCRIPTION: + The AT&T Software Technology ksh package from AT&T Research + contains the AT&T ksh executable implemented by David Korn. + The download file is a gzipped ksh executable. If you want + to build ksh from the source then download one of the ast-ksh, + ast-base or ast-open packages. diff --git a/lib/package/ksh.req b/lib/package/ksh.req new file mode 100644 index 0000000..e69de29 diff --git a/lib/package/ksh.ver b/lib/package/ksh.ver new file mode 100644 index 0000000..5efe0a9 --- /dev/null +++ b/lib/package/ksh.ver @@ -0,0 +1 @@ +ksh 2012-02-29 2012-02-29 1 diff --git a/lib/package/package.mk b/lib/package/package.mk new file mode 100644 index 0000000..921fa2d --- /dev/null +++ b/lib/package/package.mk @@ -0,0 +1,1537 @@ +/* + * source and binary package support + * + * @(#)package.mk (AT&T Research) 2012-02-14 + * + * usage: + * + * cd $INSTALLROOT/lib/package + * nmake -f name [closure] [cyg|exp|lcl|pkg|rpm|tgz] [base|delta] type + * + * where: + * + * name package description file or component + * + * type source build source archive, generates + * $(PACKAGEDIR)/name.version.release.suffix + * binary build binary archive, generates + * $(PACKAGEDIR)/name.version.hosttype.release.suffix + * runtime build binary archive, generates + * $(PACKAGEDIR)/name-run.version.hosttype.release.suffix + * + * NOTE: $(PACKAGEDIR) is in the lowest view and is shared among all views + * + * generated archive member files are $(PACKAGEROOT) relative + * + * main assertions: + * + * NAME [ name=value ] :PACKAGE: component ... + * :OMIT: component ... + * :LICENSE: license-class-pattern + * :CATEGORY: category-id ... + * :COVERS: package ... + * :REQURES: package ... + * :INDEX: index description line + * :DESCRIPTION: + * [ verbose description ] + * :DETAILS: style + * :README: + * readme lines + * :EXPORT: + * name=value + * target :INSTALL: [ source ] + * + * option variables, shown with default values + * + * format=tgz + * archive format + * + * version=YYYY-MM-DD + * package base version (overrides current date) + * + * release=YYYY-MM-DD + * package delta release (overrides current date) + * + * license=type.class + * :LICENSE: type.class pattern override + * + * notice=1 + * include the conspicuous empty notice file + * + * copyright=0 + * do not prepend source file copyright notice + * + * strip=0 + * don't strip non-lcl binary package members + * + * variants=pattern + * include variants matching pattern in binary packages + * + * incremental=[source:1 binary:0] + * if a base archive is generated then also generate an + * incremental delta archive from the previous base + * + * NOTE: the Makerules.mk :PACKAGE: operator defers to :package: when + * a target is specified + */ + +/* these are ast centric -- we'll parameterize another day */ + +org = ast +url = http://www.research.att.com/sw/download + +/* generic defaults */ + +base = +category = utils +checksum = md5 +closure = +copyright = 1 +delta = +format = tgz +incremental = +index = +init = INIT +license = +licenses = $(org) +mamfile = 1 +opt = +name = +notice = +release = +strip = 0 +style = tgz +suffix = tgz +type = +variants = !(cc-g) +vendor = +version = $("":T=R%Y-%m-%d) + +SUM = sum + +package.notice = ------------ NOTICE -- LICENSED SOFTWARE -- SEE README FOR DETAILS ------------ + +package.readme = $(@.package.readme.) + +.package.readme. : + This is a package root directory $PACKAGEROOT. Source and binary + packages in this directory tree are controlled by the command + $() + bin/package + $() + Binary files may be in this directory or in the install root directory + $() + INSTALLROOT=$PACKAGEROOT/arch/`bin/package` + $() + For more information run + $() + bin/package help + $() + Many of the packaged commands self-document via the --man and --html + options; those that do have no separate man page. + $() + Each package is covered by one of the license files + $() + $(PACKAGELIB)/LICENSES/ + $() + where is the license type for the package. At the top + of each license file is a URL; the license covers all software that + refers to this URL. For details run + $() + bin/package license [] + $() + Any archives, distributions or packages made from source or + binaries covered by license(s) must contain the corresponding + license file(s)$(notice:?, this README file, and the empty file$$("\n")$$(package.notice)?.?) + +.package.licenses. : .FUNCTION + local I F L R T all save text + L := $(%) + while L == "--*" + I := $(L:O=1) + if I == "--all" + all = 1 + elif I == "--save" + save = 1 + elif I == "--text" + text = 1 + end + L := $(L:O>1) + end + if "$(L)" == "*-*" + L += $(L:/[^-]*-//) $(L:/-.*//) + end + L += $(licenses) + for I $(L:U) + if I == "gpl" + I = gnu + all = + end + if F = "$(I:D=$(PACKAGESRC):B:S=.lic:T=F)" + R += $(F) + if save || text + T := $(.FIND. lib/package .lic $(F):P=W,query=type) + R += $(T:D=$(PACKAGESRC)/LICENSES:B) + end + if save + R += $(F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F) + elif ! all + break + end + end + end + return $(R) + +/* + * glob(3) doesn't handle / in alternation -- should it? + */ + +.package.glob. : .FUNCTION + local A D I P S + for I $(%) + if I == "*/*" + D := $(I:C,/.*,,) + if ! "$(A:N=$(D))" + local S.$(D) + A += $(D) + end + S.$(D) += $(I:C,[^/]*/,,) + else + P := $(P)$(S)$(I) + end + S = | + end + if P == "*\|*" + P := ($(P)) + end + for I $(A) + P += $(I)/$(.package.glob. $(S.$(I))) + end + return $(P) + + +.MAKEINIT : .package.init + +.package.init : .MAKE .VIRTUAL .FORCE + local V + V := $(VROOT:T=F:P=L*) + if ! PACKAGEROOT + PACKAGEROOT := $(V:N!=*/arch/+([!/]):O=1) + end + if V == "$(PACKAGEROOT)" + V := + end + V += $(INSTALLROOT) $(PACKAGEROOT) + PACKAGEVIEW := $(V:H=RU) + INSTALLOFFSET := $(INSTALLROOT:C%$(PACKAGEROOT)/%%) + if license + license := $(license)|none.none + end + +PACKAGELIB = lib/package +PACKAGESRC = $(PACKAGEROOT)/$(PACKAGELIB) +PACKAGEBIN = $(INSTALLROOT)/$(PACKAGELIB) +PACKAGEDIR = $(PACKAGESRC)/$(style) +INSTALLOFFSET = $(INSTALLROOT:C%$(PACKAGEROOT)/%%) + +package.omit = -|*/$(init) +package.glob.all = $(INSTALLROOT)/src/*/*/($(MAKEFILES:/:/|/G)) +package.all = $(package.glob.all:P=G:W=O=$(?$(name):A=.VIRTUAL):N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) +package.glob.pkg = $(.package.glob. $(~$(name):P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%) $(~$(name):P=U:N=$(name):?$$(INSTALLROOT)/src/$$(name)/($$(MAKEFILES:/:/|/G))??) +package.pkg = $(package.glob.pkg:P=G:D:N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) +package.closure = $(closure:?$$(package.all)?$$(package.pkg)?) + +package.init = $(.package.glob. $("$(init)$(name)":P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%:P=G:T=F:D::B) +package.ini = ignore mamprobe manmake package silent +package.src.pat = $(PACKAGESRC)/($(name).(ini|pkg)) +package.src = $(package.src.pat:P=G) $(.package.licenses. --save $(name)) +package.bin = $(PACKAGEBIN)/$(name).ini + +package.mam = --never --force --mam=static --corrupt=accept --clobber --compare --link='lib*.a*' CC=$(CC.DIALECT:N=C++:?CC?cc?) package.license.class=$(license:Q) $(=) 'dontcare test' install test + +op = current +stamp = [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] +source = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(suffix) +binary = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) +runtime = $(PACKAGEDIR)/$(name)-run.$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) +old.new.source = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(suffix) +old.new.binary = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) +old.new.runtime = $(PACKAGEDIR)/$(name)-run.$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) + +source.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(suffix)":P=G:H=R) +binary.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H=R) +runtime.list = $("$(PACKAGEDIR)/$(name)-run.*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H>) + +source.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz.c":T=F) +binary.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz":T=F) + +$(init) : .VIRTUAL $(init) + +package.requires = 0 + +":package:" : .MAKE .OPERATOR + local P I R V + P := $(<:O=1) + $(P) : $(>:V) + if ! package.requires + if ! name + name := $(P) + .PACKAGE. := $(P) + if name == "$(init)" + package.omit = - + package.src += $(package.ini:C,^,$(PACKAGEROOT)/bin/,) $(PACKAGESRC)/package.mk + else + $(P) : $(package.init) + end + for I $(<:O>1) + if I == "*=*" + eval + $(I) + end + else + version := $(I) + end + end + LICENSEFILEDEFAULT := $(.package.licenses. $(name):@/ /:/G) + export LICENSEFILEDEFAULT + end + if "$(>)" + for I $(>:V) + $(I) : .VIRTUAL + if I == "/*" + package.dir += $(I:V) + end + end + end + if "$(@)" + $(P).README := $(@) + else + $(P).README := This is the $(P) package. + end + end + +":AUXILIARY:" : .MAKE .OPERATOR + package.auxiliary.$(style) += $(>:N=/*:T=F) $(>:N!=/*:C%^%$(INSTALLROOT)/%:T=F) + +":CATEGORY:" : .MAKE .OPERATOR + if ! package.requires + category := $(>) + end + +.covers. : .FUNCTION + local I C D F K=0 L + for I $(%) + if ! "$(~covers:N=$(I:B))" + if F = "$(I:D:B:S=.pkg:T=F)" + if D = "$(F:T=I)" + covers : $(I:B) + for L $(D) + if L == ":COVERS:" + K = 1 + elif L == ":*:" + if K + break + end + elif K + : $(.covers. $(L)) + end + end + end + else + error $(--exec:?3?1?) $(I): unknown package $(I) + end + end + end + +":COVERS:" : .MAKE .OPERATOR + if ! package.requires + : $(.covers. $(>)) + end + +":DESCRIPTION:" : .MAKE .OPERATOR + if ! package.requires + $(name).README := $(@:V) + end + +":DETAILS:" : .MAKE .OPERATOR + if ! package.requires + details.$(>:O=1) := $(@:V) + end + +":EXPORT:" : .MAKE .OPERATOR + if ! package.requires + export.$(style) := $(@:/$$("\n")/ /G) + end + +":INDEX:" : .MAKE .OPERATOR + if ! package.requires + index := $(>) + end + +":INSTALL:" : .MAKE .OPERATOR + if ! package.requires + local T S F X + S := $(>) + T := $(<) + if "$(exe.$(style))" && "$(T)" == "bin/*([!./])" + T := $(T).exe + end + if ! "$(S)" + S := $(T) + elif "$(exe.$(style))" && "$(S)" == "bin/*([!./])" + S := $(S).exe + end + install.$(style) := $(install.$(style):V)$("\n")install : $$(ROOT)/$(T)$("\n")$$(ROOT)/$(T) : $$(ARCH)/$(S)$("\n\t")cp $< $@ + if strip && "$(T:N=*.exe)" + install.$(style) := $(install.$(style):V)$("\n\t")strip $@ 2>/dev/null + end + X := $(PACKAGEROOT)/arch/$(CC.HOSTTYPE)/$(S) + if strip && "$(X:T=Y)" == "*/?(x-)(dll|exe)" + F := filter $(STRIP) $(STRIPFLAGS) $(X) + end + if "$(filter.$(style):V)" + filter.$(style) := $(filter.$(style):V)$$("\n") + end + filter.$(style) := $(filter.$(style):V);;$(F);$(X);usr/$(T) + end + +":LICENSE:" : .MAKE .OPERATOR + if ! package.requires && ! license + license := $(>) + end + +":OMIT:" : .MAKE .OPERATOR + if ! package.requires + package.omit := $(package.omit)|$(>:C,^,*/,:/ /|/G) + end + +":POSTINSTALL:" : .MAKE .OPERATOR + if ! package.requires + postinstall.$(style) := $(@:V) + end + +":README:" : .MAKE .OPERATOR + if ! package.requires + readme.$(style) := $(@:V) + end + +.requires. : .FUNCTION + local I C D F K=0 L V T M=0 + for I $(%) + if ! "$(~requires:N=$(I:B))" + if F = "$(I:D:B:S=.pkg:T=F)" + if I == "$(init)" + package.omit = - + else + requires : $(I:B) + end + if V = "$(I:D:B=gen/$(I:B):S=.ver:T=F)" + req : $(I:B) + else + error 1 $(I): package should be written before $(P) + end + let package.requires = package.requires + 1 + include "$(F)" + let package.requires = package.requires - 1 + else + error 1 $(I): package not found + end + end + end + +":REQUIRES:" : .MAKE .OPERATOR + : $(.requires. $(>)) + +":TEST:" : .MAKE .OPERATOR + if ! package.requires + local T + T := $(>) + if "$(T)" == "bin/*([!./])" + if "$(exe.$(style))" + T := $(T).exe + end + T := $$(PWD)/$$(ARCH)/$(T) + end + test.$(style) := $(test.$(style):V)$("\n")test : $(T:V)$("\n\t")$(@) + end + +base delta : .MAKE .VIRTUAL .FORCE + op := $(<) + +closure : .MAKE .VIRTUAL .FORCE + $(<) := 1 + +cyg exp lcl pkg rpm tgz : .MAKE .VIRTUAL .FORCE + style := $(<) + +source : .source.init .source.gen .source.$$(style) + +.source.init : .MAKE + local A B D P V I + type := source + if ! "$(incremental)" + incremental = 1 + end + if "$(source.$(name))" + suffix = c + end + : $(.init.$(style)) + : $(details.$(style):V:R) : + A := $(source.list) + B := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + deltaversion := $(B:B:/$(name).//) + let deltasince = $(deltaversion:/.*-//) + 1 + deltasince := $(deltaversion:/[^-]*$/$(deltasince:F=%02d)/) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + source := $(B:D:B:S=.$(release).$(suffix)) + version := $(source:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)\.\([^.]*\).*/\1/) + if V == "$(stamp)" && V != "$(version)" + old.version := $(V) + old.source := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + source := $(B) + end + if B == "$(source)" + if "$(B:D:B:B)" == "$(D:D:B:B)" && "$(B:B::S)" != "$(D:B::S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(source:B:S:/^$(name).\(.*\).$(suffix)$/\1/) + end + PACKAGEGEN := $(PACKAGESRC)/gen + +.source.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) $$(PACKAGEGEN)/SOURCE.html $$(PACKAGEGEN)/BINARY.html $$(PACKAGEGEN)/DETAILS.html + +BINPACKAGE := $(PATH:/:/ /G:X=package:T=F:O=1) + +$$(PACKAGEDIR) $$(PACKAGEGEN) : .IGNORE + [[ -d $(<) ]] || mkdir $(<) + +$$(PACKAGEGEN)/SOURCE.html : $(BINPACKAGE) + $(*) html source > $(<) + +$$(PACKAGEGEN)/BINARY.html : $(BINPACKAGE) + $(*) html binary > $(<) + +$$(PACKAGEGEN)/DETAILS.html : $(BINPACKAGE) + $(*) html intro > $(<) + +.source.exp .source.pkg .source.rpm : .MAKE + error 3 $(style): source package style not supported yet + +exe.cyg = .exe +vendor.cyg = gnu + +.name.cyg : .FUNCTION + local N + N := $(%) + if N == "*-*" + vendor := $(N:/-.*//) + if vendor == "$(vendor.cyg)" + vendor := + N := $(N:/[^-]*-//) + end + N := $(N:/-//G) + end + return $(N) + +.init.cyg : .FUNCTION + local N O + closure = 1 + init = . + strip = 1 + suffix = tar.bz2 + format = tbz + vendor := $(licenses:N!=$(vendor.cyg):O=1) + package.ini := $(package.ini) + package.src.pat := $(package.src.pat) + package.src := $(package.src) + package.bin := $(package.bin) + .source.gen : .CLEAR $(*.source.gen:V:N!=*.html) + name.original := $(name) + name := $(.name.cyg $(name)) + if name != "$(name.original)" + $(name) : $(~$(name.original)) + O := $(~covers) + covers : .CLEAR + for N $(O) + covers : $(.name.cyg $(N)) + end + end + stamp = [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9] + version.original := $(version) + version := $(version:/-//G)-1 + if opt + opt := $(opt)/$(vendor)/ + else + opt := $(name)-$(version)/ + end + if type == "source" + version := $(version)-src + source = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) + else + binary = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) + end + +.source.cyg : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + cat > $tmp/configure <<'!' + echo "you didn't have to do that" + ! + chmod +x $tmp/configure + echo ";;;$tmp/configure;configure" + cat > $tmp/Makefile0 <<'!' + HOSTTYPE := $$(shell bin/package) + ROOT = ../.. + ARCH = arch/$$(HOSTTYPE) + all : + PACKAGEROOT= CYGWIN="$$CYGWIN ntsec binmode" bin/package make $(export.$(style)) + install : all + $(install.$(style):V) + $(test.$(style):V) + ! + echo ";;;$tmp/Makefile0;Makefile" + cat > $tmp/CYGWIN-README <<'!' + $(readme.$(style):@?$$(readme.$$(style))$$("\n\n")??)To build binaries from source into the ./arch/`bin/package` tree run: + $() + make + $() + $(test.$(style):@?To test the binaries after building/installing run:$$("\n\n\t")make test$$("\n\n")??)To build and/or install the binaries run: + $() + make install + $() + The bin/package command provides a command line interface for all package + operations. The $(opt:/.$//) source and binary packages were generated by: + $() + package write cyg base source version=$(version.original) $(name.original) + package write cyg base binary version=$(version.original) $(name.original) + $() + using the $(org)-base package. To download and install the latest + $(org)-base source package in /opt/$(org) run: + $() + PATH=/opt/$(org)/bin:$PATH + cd /opt/$(org) + package authorize "NAME" password "PASSWORD" setup flat source $("\\") + $(url) $("\\") + $(org)-base + package make + $() + and export /opt/$(org)/bin in PATH to use. The NAME and PASSWORD signify your + agreement to the software license(s). All users get the same NAME and PASSWORD. + See $(url) for details. If multiple architectures may be built under + /opt/$(org) then drop "flat" and export /opt/$(org)/arch/`package`/bin in PATH + to use. To update previously downloaded packages from the same url simply run: + $() + cd /opt/$(org) + package setup + package make + $() + To download and install the latest $(org)-base binary package in + /opt/$(org) change "source" to "binary" and omit "package make". + ! + echo ";;;$tmp/CYGWIN-README;CYGWIN-PATCHES/README" + cat > $(source:/-src.$(suffix)//).setup.hint <<'!' + category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) + requires: cygwin + sdesc: "$(index)" + ldesc: "$($(name.original).README)" + ! + echo ";;;$(source:/-src.$(suffix)//).setup.hint;CYGWIN-PATCHES/setup.hint" + echo ";;;$(BINPACKAGE);bin/package" + cat > $tmp/Makefile <<'!' + :MAKE: + ! + echo ";;;$tmp/Makefile;src/Makefile" + echo ";;;$tmp/Makefile;src/cmd/Makefile" + echo ";;;$tmp/Makefile;src/lib/Makefile" + if [[ '$(mamfile)' == 1 ]] + then cat > $tmp/Mamfile1 <<'!' + info mam static + note source level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/Mamfile1;src/Mamfile" + cat > $tmp/Mamfile2 <<'!' + info mam static + note component level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" + echo ";;;$tmp/Mamfile2;src/lib/Mamfile" + fi + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + echo ";;;$(PACKAGEGEN)/$(name.original).req" + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then if [[ '$(mamfile)' == 1 ]] + then (( o=m )) + s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) + if [[ $s ]] + then for j in $s + do if [[ -d $j ]] + then cd $j + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then (( m++ )) + $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/$j/Mamfile" + fi + cd $(INSTALLROOT)/$i + fi + done + if (( o != m )) + then (( m++ )) + cat > $tmp/$m.mam <<'!' + info mam static + note subcomponent level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + else (( m++ )) + $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + fi + $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) + fi + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + { + : > $tmp/HEAD + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + --format=$(format) \ + --local \ + -wvf $(source) $(base) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) \ + $(vendor:?-s",^[^/],$(opt)&,"??) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + rm -rf $tmp + fi + +.source.lcl : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) $(=) .FILES.+=Mamfile recurse list.package.local + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + sort -t';' -k5,5 -u | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + -wvf $(source) $(base) \ + $(op:N=delta:?--format=gzip??) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) + rm -rf $tmp + fi + +.source.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + if [[ '$(init)' == '$(name)' ]] + then cat > $tmp/Makefile <<'!' + :MAKE: + ! + $(CMP) $(CMPFLAGS) $tmp/Makefile $(PACKAGEROOT)/src/Makefile && touch -r $(PACKAGEROOT)/src/Makefile $tmp/Makefile + echo ";;;$tmp/Makefile;src/Makefile" + cp $tmp/Makefile $tmp/Makefile1 + $(CMP) $(CMPFLAGS) $tmp/Makefile1 $(PACKAGEROOT)/src/cmd/Makefile && touch -r $(PACKAGEROOT)/src/cmd/Makefile $tmp/Makefile1 + echo ";;;$tmp/Makefile1;src/cmd/Makefile" + cp $tmp/Makefile $tmp/Makefile2 + $(CMP) $(CMPFLAGS) $tmp/Makefile2 $(PACKAGEROOT)/src/lib/Makefile && touch -r $(PACKAGEROOT)/src/lib/Makefile $tmp/Makefile2 + echo ";;;$tmp/Makefile2;src/lib/Makefile" + if [[ '$(mamfile)' == 1 ]] + then cat > $tmp/Mamfile1 <<'!' + info mam static + note source level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/Mamfile1 $(PACKAGEROOT)/src/Mamfile && touch -r $(PACKAGEROOT)/src/Mamfile $tmp/Mamfile1 + echo ";;;$tmp/Mamfile1;src/Mamfile" + cat > $tmp/Mamfile2 <<'!' + info mam static + note component level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/Mamfile2 $(PACKAGEROOT)/src/cmd/Mamfile && touch -r $(PACKAGEROOT)/src/cmd/Mamfile $tmp/Mamfile2 + echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" + cp $tmp/Mamfile2 $tmp/Mamfile3 + $(CMP) $(CMPFLAGS) $tmp/Mamfile3 $(PACKAGEROOT)/src/lib/Mamfile && touch -r $(PACKAGEROOT)/src/lib/Mamfile $tmp/Mamfile3 + echo ";;;$tmp/Mamfile3;src/lib/Mamfile" + fi + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lib pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] + then echo $(name) $(version) $(release|version) 1 > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).ver || cp $tmp/t $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).req || cp $tmp/t $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).inx || cp $tmp/t $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + } | fmt + package help source + package release $(name) + } > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).README || cp $tmp/t $(PACKAGEGEN)/$(name).README + echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" + { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package"' + echo '.xx meta.keywords="software, package"' + echo '.MT 4' + echo '.TL' + echo '$(name) package' + echo '.H 1 "$(name) package"' + echo '$($(name).README)' + set -- $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F:D::B) + hot= + for i + do hot="$hot -e s/\\(\\<$i\\>\\)/\\\\h'0*1'\\1\\\\h'0'/" + done + set -- $(package.closure:B) + if (( $# )) + then echo 'Components in this package:' + echo '.P' + echo '.TS' + echo 'center expand;' + echo 'l l l l l l.' + if [[ $hot ]] + then hot="sed $hot" + else hot=cat + fi + for i + do echo $i + done | + pr -6 -t -s' ' | + $hot + echo '.TE' + fi + echo '.P' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + set -- $(.package.licenses. --all $(name)) + case $# in + 0) ;; + *) case $# in + 1) echo 'The software is covered by this license:' ;; + *) echo 'The software is covered by these licenses:' ;; + esac + echo .BL + for j + do i=$( $(PROTO) -l $j -p -h -o type=usage /dev/null | sed -e 's,.*\[-license?\([^]]*\).*,\1,' ) + echo .LI + echo ".xx link=\"$i\"" + done + echo .LE + echo 'Individual components may be covered by separate licenses;' + echo 'refer to the component source and/or binaries for more information.' + echo .P + ;; + esac + echo 'A recent' + echo '.xx link="release change log"' + echo 'is also included.' + cat $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F) < /dev/null + echo '.H 1 "release change log"' + echo '.xx index' + echo '.nf' + package release $(name) | + sed -e 's/:::::::: \(.*\) ::::::::/.fi\$("\n").H 1 "\1 changes"\$("\n").nf/' + echo '.fi' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t + $(STDED) $(STDEDFLAGS) $tmp/t <<'!' + /^$/,/^$/s/ changes$/,/^$/m/
/ + w + q + ! + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).html || cp $tmp/t $(PACKAGEGEN)/$(name).html + echo ";;;$(PACKAGEGEN)/$(name).html;$(PACKAGELIB)/$(name).html" + if [[ '$(deltasince)' ]] + then { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package $(version) delta $(release)"' + echo '.xx meta.keywords="software, package, delta"' + echo '.MT 4' + echo '.TL' + echo '$(name) package $(deltaversion) delta $(release)' + echo '.H 1 "$(name) package $(deltaversion) delta $(release) changes"' + echo '.nf' + package release $(deltasince) $(name) | + sed -e 's/:::::::: \(.*\) ::::::::/.H 2 \1/' + echo '.fi' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).$(release).html || cp $tmp/t $(PACKAGEGEN)/$(name).$(release).html + echo ";;;$(PACKAGEGEN)/$(name).$(release).html;$(PACKAGELIB)/$(name).$(release).html" + fi + fi + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then if [[ '$(mamfile)' == 1 ]] + then (( o=m )) + s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) + if [[ $s ]] + then for j in $s + do if [[ -d $j ]] + then cd $j + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then (( m++ )) + $(MAKE) $(package.mam) > $tmp/$m.mam + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/$j/Mamfile && touch -r $(PACKAGEROOT)/$i/$j/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/$j/Mamfile" + fi + cd $(INSTALLROOT)/$i + fi + done + if (( o != m )) + then (( m++ )) + cat > $tmp/$m.mam <<'!' + info mam static + note subcomponent level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + else (( m++ )) + $(MAKE) $(package.mam) > $tmp/$m.mam + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + fi + $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) $(copyright:N=1:??LICENSE=?) + fi + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + $(CMP) $(CMPFLAGS) $tmp/README $(PACKAGEROOT)/README && touch -r $(PACKAGEROOT)/README $tmp/README + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + -wvf $(source) $(base) \ + $(op:N=delta:?--format=gzip??) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + echo local > $(source:D:B=$(name):S=.tim) + if [[ '$(incremental)' == 1 && '$(old.source)' ]] + then $(PAX) -rf $(source) -wvf $(old.new.source) -z $(old.source) + $(SUM) -x $(checksum) < $(old.new.source) > $(old.new.source:D:B:S=.$(checksum)) + fi + rm -rf $tmp + else if [[ '$(old.source)' ]] && $(CMP) $(CMPFLAGS) $(source.$(name)) $(source) + then : $(name) is up to date + else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + : > $(PACKAGEGEN)/$(name).req + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package"' + echo '.xx meta.keywords="software, package"' + echo '.MT 4' + echo '.TL' + echo '$(name) package' + echo '.H 1' + echo '$($(name).README)' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $(PACKAGEGEN)/$(name).html + if [[ '$(source.$(name))' ]] + then { + echo '$($(name).README)' + package help source + } > $(PACKAGEGEN)/$(name).README + cp $(source.$(name)) $(source) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + fi + echo local > $(source:D:B=$(name):S=.tim) + fi + fi + +binary : .binary.init .binary.gen .binary.$$(style) + +.binary.init : .MAKE + local A B D I P V + type := binary + if ! "$(incremental)" + incremental = 0 + end + if ! "$(~$(name))" + if name == "ratz" + suffix = exe + else + suffix = gz + end + end + : $(.init.$(style)) : + : $(details.$(style):V:R) : + A := $(binary.list) + B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + binary := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) + version := $(binary:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)\.\([^.]*\).*/\1/) + if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" + old.version := $(V) + old.binary := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + binary := $(B) + end + if B == "$(binary)" + if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(binary:B:/$(name).//:/\..*//) + end + PACKAGEGEN := $(PACKAGEBIN)/gen + +.binary.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) + +.binary.exp .binary.pkg .binary.rpm : .MAKE + error 3 $(style): binary package style not supported yet + +.binary.cyg : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + { + echo '$($(name.original).README)' | fmt + cat <<'!' + $(readme.$(style):@?$$("\n")$$(readme.$$(style))??) + ! + } > $tmp/README1 + echo ";;;$tmp/README1;usr/share/doc/Cygwin/$(opt:/.$//).README" + { + echo '$($(name.original).README)' | fmt + cat <<'!' + $() + The remainder of this file is the README from the source package + that was used to generate this binary package. It describes + the source build hierarchy, not the current directory. + $() + $(package.readme) + ! + } > $tmp/README2 + echo ";;;$tmp/README2;usr/share/doc/$(opt)README" + package release $(name.original) > $tmp/RELEASE + echo ";;;$tmp/RELEASE;usr/share/doc/$(opt)RELEASE" + cat > $(binary:/.$(suffix)//).setup.hint <<'!' + category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) + requires: cygwin + sdesc: "$(index)" + ldesc: "$($(name.original).README)" + ! + set -- $(.package.licenses. --text $(name.original):N!=*.lic) + for i + do echo ";;;${i};usr/share/doc/$(opt)LICENSE-${i##*/}" + done + cat <<'!' + $(filter.$(style)) + ! + if [[ '$(postinstall.$(style):V:O=1:?1??)' ]] + then cat >$tmp/postinstall <<'!' + $("#")!/bin/sh + $(postinstall.$(style)) + ! + echo ";;;$tmp/postinstall;etc/postinstall/$(name).sh" + fi + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + --format=$(format) \ + --local \ + -wvf $(binary) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + rm -rf $tmp + fi + +.binary.lcl : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + $(package.bin:U:T=F:/.*/echo ";;;&"$("\n")/) + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name).sum \ + --install=$(PACKAGEGEN)/$(name).ins \ + -wvf $(binary) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + rm -rf $tmp + fi + +.binary.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + if [[ '$(init)' == '$(name)' ]] + then for i in lib32 lib64 + do if [[ -d $(INSTALLROOT)/$i ]] + then echo ";physical;;$(INSTALLROOT)/$i" + fi + done + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] + then echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lic pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + } | fmt + package help binary + package release $(name) + } > $(PACKAGEGEN)/$(name).README + echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" + fi + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name).sum \ + --install=$(PACKAGEGEN)/$(name).ins \ + -wvf $(binary) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + if [[ '$(incremental)' == 1 && '$(old.binary)' ]] + then $(PAX) -rf $(binary) -wvf $(old.new.binary) -z $(old.binary) + echo $(old.new.binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(old.new.binary) > $(old.new.binary:D:B:S=.$(checksum)) + echo $(old.new.binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + rm -rf $tmp + else if [[ '$(binary.$(name))' ]] + then exe=$(binary.$(name)) + else exe=$(INSTALLROOT)/bin/$(name) + fi + if [[ '$(old.binary)' ]] && $(CMP) $(CMPFLAGS) $exe $(binary) + then : $(name) is up to date + else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + : > $(PACKAGEGEN)/$(name).req + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + echo '$($(name).README)' + package help binary + } > $(PACKAGEGEN)/$(name).README + case "$(binary)" in + *.gz) gzip < $exe > $(binary) ;; + *) cp $exe $(binary) ;; + esac + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + fi + echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + +runtime : .runtime.init .runtime.gen .runtime.$$(style) + +.runtime.init : .MAKE + local A B D I P V + type := runtime + if ! "$(incremental)" + incremental = 0 + end + if ! "$(~$(name))" + if name == "ratz" + suffix = exe + else + suffix = gz + end + end + : $(.init.$(style)) : + : $(details.$(style):V:R) : + A := $(runtime.list) + B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + runtime := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) + version := $(runtime:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)-run\.\([^.]*\).*/\1/) + if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" + old.version := $(V) + old.runtime := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + runtime := $(B) + end + if B == "$(runtime)" + if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(runtime:B:/$(name)-run.//:/\..*//) + end + PACKAGEGEN := $(PACKAGESRC)/gen + +.runtime.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) + +.runtime.cyg .runtime.exp .runtime.lcl .runtime.pkg .runtime.rpm : .MAKE + error 3 $(style): runtime package style not supported yet + +.runtime.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + if [[ '$(init)' == '$(name)' ]] + then for i in lib32 lib64 + do if [[ -d $(INSTALLROOT)/$i ]] + then echo ";physical;;$(INSTALLROOT)/$i" + fi + done + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lic pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo + echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo + echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + echo + echo "To install this $(type) package read the tarball into a directory" + echo "suitable for containing bin and lib subdirectories, and run the" + echo "$(PACKAGELIB)/gen/$(name)-run.ins script to fix up permissions." + echo + echo "To use the package export the bin directory in PATH. The commands and" + echo "libraries use \$PATH to locate dynamic libraries and related data files." + echo + } | fmt + } > $(PACKAGEGEN)/$(name)-run.README + echo ";;;$(PACKAGEGEN)/$(name)-run.README;$(PACKAGELIB)/$(name)-run.README" + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name)-run.sum \ + --install=$(PACKAGEGEN)/$(name)-run.ins \ + -wvf $(runtime) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + echo $(runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(runtime) > $(runtime:D:B:S=.$(checksum)) + echo $(runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo local > $(runtime:D:B=$(name)-run:S=.$(CC.HOSTTYPE).tim) + if [[ '$(incremental)' == 1 && '$(old.runtime)' ]] + then $(PAX) -rf $(runtime) -wvf $(old.new.runtime) -z $(old.runtime) + echo $(old.new.runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(old.new.runtime) > $(old.new.runtime:D:B:S=.$(checksum)) + echo $(old.new.runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + rm -rf $tmp + fi + +list.installed list.manifest : + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + ignore $(MAKE) --noexec $(-) $(=) $(<) + done diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..a046f68 --- /dev/null +++ b/src/Makefile @@ -0,0 +1 @@ +:MAKE: diff --git a/src/Mamfile b/src/Mamfile new file mode 100644 index 0000000..013f5dd --- /dev/null +++ b/src/Mamfile @@ -0,0 +1,7 @@ +info mam static +note source level :MAKE: equivalent +make install +make all +exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} +done all virtual +done install virtual diff --git a/src/cmd/INIT/C+probe b/src/cmd/INIT/C+probe new file mode 100644 index 0000000..f427742 --- /dev/null +++ b/src/cmd/INIT/C+probe @@ -0,0 +1,870 @@ +: +### this script contains archaic constructs that work with all sh variants ### +# Glenn Fowler +# AT&T Research +# +# @(#)C probe (AT&T Research) 2012-02-29 +# +# probe [ -d ] c-compiler-path [ attributes ] +# +# common C probe preamble for the tool specific probes +# +# NOTE: some cc -E's do syntax analysis! + +# +# probe_* are first eval'd and then attempted from left to right +# + +probe_binding="-dy -dn -Bdynamic -Bstatic '-Wl,-ashared -Wl,+s' -Wl,-aarchive -call_shared -non_shared -dynamic -static -bshared -bstatic '' -static" +probe_env="CC_OPTIONS CCOPTS LD_OPTIONS LDOPTS LIBPATH LPATH" +probe_include="stdio.h iostream.h complex.h ctype.h plot.h stdarg.h varargs.h ranlib.h hash.h sys/types.h stab.h cmath cstdio iostream string" +probe_longlong="long 'long long'" +probe_longlong_t="__int64_t _int64_t __int64 _int64 int64" +probe_l="l yyreject m sin mopt sin" +probe_lxx="C exit ++ exit g++ exit" +probe_ppprefix="a n" +probe_size="size" +probe_src="cxx C cc c" +probe_sa=".sa" +probe_sd=".dll .lib .dll .x" +probe_sdb=".pdb" +probe_so=".dylib .so .sl" +probe_symprefix="_" +probe_verbose="'-v -v' '-# -#' '-d -d' -dryrun '-V -V'" +probe_version="--version -V -version -v" + +# +# the following are set by the preamble for the tool specific probe +# + +cc=cc +debug= +dir=. +dll=.dll +dynamic= +exe=exe +executable="test -x" +hosted= +ifs=${IFS-' + '} +obj=o +ppenv= +ppopt= +predef= +prepred= +sa= +sd= +sdb= +so= +sov= +static= +stdlib= +stdpp= +suffix_command= +if test "" != "$TMPDIR" -a -d "$TMPDIR" +then tmpdir=$TMPDIR +else tmpdir=/tmp +fi +tmpdir=$tmpdir/probe$$ +undef="define defined elif else endif error if ifdef ifndef include line pragma undef __STDC__ __STDPP__ __ARGC__ __BASE__ __BASE_FILE__ __DATE__ __FILE__ __FUNCTION__ __INCLUDE_LEVEL__ __LINE__ __PATH__ __TIME__ __TIMESTAMP__ __VERSION__" +version_flags= +version_stamp= +version_string= + +# +# constrain the environment +# + +DISPLAY= +LC_ALL=C +export DISPLAY LC_ALL + +# +# now the common probes +# + +while : +do case $1 in + -d) debug=1 ;; + -*) set ''; break ;; + *) break ;; + esac + shift +done + +cc=$1 +case $cc in +[\\/]*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\*) + ;; +*) echo "Usage: $0 [ -d ] c-compiler-path [ attributes ]" >&2 + exit 1 + ;; +esac +ATTRIBUTES= +eval $2 +_probe_PATH=$PATH +PATH=/usr/bin:/bin:$PATH + +case $0 in +*[\\/]*) dir=`echo $0 | sed -e 's,[\\/][\\/]*[^\\/]*\$,,'` ;; +esac + +$executable . 2>/dev/null || executable='test -r' + +case $SHELL in +[\\/]*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\*) + sh=$SHELL + ;; +*) sh=/bin/sh + ;; +esac + +trap 'code=$?; cd ..; rm -rf $tmpdir; exit $code' 0 1 2 3 +mkdir $tmpdir +cd $tmpdir + +exec 3>&1 4>&2 /dev/null 2>&1 + (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0 + ;; +*) PS4='+$LINENO+ ' + set -x + ;; +esac + +if (xxx=xxx; unset xxx) +then UNSET=1 +else UNSET= +fi +eval set x $probe_env +while : +do shift + case $# in + 0) break ;; + esac + eval x='$'$1 + case $x in + '') continue ;; + esac + case $1 in + *PATH) _probe_export="$_probe_export $1='$x'" ;; + esac + case $UNSET in + '') eval $1= + export $1 + ;; + *) unset $1 + ;; + esac +done + +if test -f "$dir/probe.ini" +then . "$dir/probe.ini" + IFS=$ifs +fi + +mkdir suffix +cd suffix +for src in $probe_src +do echo "int main(){return 0;}" > ../test.$src + rm -f test* + if $cc -c ../test.$src + then set test.* + if test -f "$1" + then o="$*" + mv $* .. + for i in $o + do if $cc -o test.exe ../$i + then obj=`echo "$i" | sed -e 's,test.,,'` + $executable test.exe || executable="test -r" + set test* + rm * + if $cc -o test ../$i + then rm $* + set test.* + if $executable "$1" + then exe=`echo "$1" | sed -e 's,test.,,'` + suffix_command=.$exe + fi + fi + break 2 + fi + done + fi + fi +done +cd .. + +case $src in +c) ;; +*) echo '// ( +int +main() +{ + class { public: int i; } j; + j.i = 0; + int k = j.i + 1; + return k; +}' > dialect.$src + if $cc -c dialect.$src && $cc -o dialect.$exe dialect.$obj && $executable dialect.$exe + then mv dialect.$src dialect.c + rm -f dialect.$obj dialect.$exe + if $cc -c dialect.c && $cc -o dialect.$exe dialect.$obj && $executable dialect.$exe + then src=c + else set x $cc + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + *=*) continue ;; + esac + case `echo $1 | sed -e 's,.*/,,'` in + *CC*|*++*|*[xX][xX]*|*[pP][lL][uU][sS]*) ;; + *) src=c ;; + esac + break + done + fi + else src=c + fi + ;; +esac + +set x x '(' 1 'int x;' 0 +while : +do shift + shift + case $# in + [01]) break ;; + esac + rm -f test.$obj + echo "$1" > test.$src + $cc -c test.$src + r=$? + case $r in + 0) test -f test.$obj || r=1 ;; + *) r=1 ;; + esac + case $2:$r in + 0:0) ;; + 0:1) echo "$cc: not a C compiler: failed to compile \`\`$1''" >&4 + exit 1 + ;; + 1:0) echo "$cc: not a C compiler: successfully compiled \`\`$1''" >&4 + exit 1 + ;; + esac +done + +hosttype=`package CC="$cc" || $SHELL -c "package CC='$cc'"` +case $hosttype in +*[Uu][Ss][Aa][Gg][Ee]:*) + hosttype=`PATH=$_probe_PATH; export PATH; package CC="$cc" || $SHELL -c "package CC='$cc'"` + ;; +esac + +echo '#include +int main(){printf("hello");return 0;}' > dynamic.$src +echo 'extern int sfclose() { return 0; }' > fun.$src +if $cc -c dynamic.$src && $cc -c fun.$src +then eval set x $probe_so + while : + do shift + case $# in + 0) break ;; + esac + for i in foo junk + do rm -f dynamic.$exe + if $cc -L. -o dynamic.$exe dynamic.$obj -l$i + then : "there's really a -l$i"? + else rm -f dynamic.$exe + cat fun.$obj > lib$i$1 + $cc -L. -o dynamic.$exe dynamic.$obj -l$i && $executable dynamic.$exe + x=$? + rm lib$i$1 + case $x in + 0) so=$1 + rm -f dynamic.$exe > lib$i$1.1 + $cc -L. -o dynamic.$exe dynamic.$obj -l$i && $executable dynamic.$exe + x=$? + rm lib$i$1.1 + case $x in + 0) sov=1 ;; + esac + break 2 + ;; + *) break + ;; + esac + fi + done + k= + for i in "" .1 .2 .3 .4 .5 .6 .7 .8 .9 + do rm -f dynamic.$exe > libc$1$i + $cc -L. -o dynamic.$exe dynamic.$obj && $executable dynamic.$exe + x=$? + (cd ..; rm $tmpdir/libc$1$i) + case $x in + 0) ;; + *) k=X$k + case $k in + XXX) break ;; + esac + ;; + esac + done + case $k in + XXX) so=$1 + sov=1 + break + ;; + ?*) so=$1 + break + ;; + esac + done + rm -f dynamic.$exe + if $cc -o dynamic.$exe dynamic.$obj 2>e && $executable dynamic.$exe + then e=`wc -l e` + maybe= + eval set x x $probe_binding + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f dynamic.$exe + $cc -o dynamic.$exe $1 dynamic.$obj 2>e && $executable dynamic.$exe || continue + case $1 in + ?*) case $maybe in + "") maybe=$1 ;; + *) maybe=-- ;; + esac + ;; + esac + case `wc -l e` in + $e) ;; + *) continue ;; + esac + d=`ls -s dynamic.$exe` + rm -f dynamic.$exe + $cc -o dynamic.$exe $2 dynamic.$obj 2>e && $executable dynamic.$exe || continue + case `wc -l e` in + $e) ;; + *) continue ;; + esac + case `ls -s dynamic.$exe` in + $d) ;; + *) dynamic=$1 + static=$2 + maybe= + break + ;; + esac + done + case $maybe in + ""|--) ;; + *) rm -f dynamic.$exe + if $cc -o dynamic.$exe $maybe dynamic.$obj 2>e && $executable dynamic.$exe + then e=`wc -l e` + if $cc -o dynamic.$exe $maybe-bogus-bogus-bogus dynamic.$obj 2>e && $executable dynamic.$exe + then case `wc -l e` in + $e) ;; + *) dynamic=$maybe ;; + esac + else dynamic=$maybe + fi + fi + ;; + esac + fi +fi + +eval set x $probe_version +shift +for o in "$@" +do if $cc $o > version.out 2>&1 + then version_string=`sed -e '/ is /d' -e 's/;/ /g' version.out | sed -e 1q` + case $version_string in + ''|*[Ee][Rr][Rr][Oo][Rr]*|*[Ff][Aa][Tt][Aa][Ll]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*) + ;; + *) version_flags=$o + version_stamp=";VERSION;$o;$version_string;PATH;$cc" + break + ;; + esac + fi +done +case $version_stamp in +'') eval set x $probe_version + shift + echo 'int main() { return 0; }' > version.i + for o in "$@" + do if $cc -c $o version.i > version.out 2>&1 + then version_string=`sed -e '/ is /d' -e 's/;/ /g' version.out | sed -e 1q` + case $version_string in + ''|*[Ee][Rr][Rr][Oo][Rr]*|*[Ff][Aa][Tt][Aa][Ll]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*) + ;; + *) version_flags=$o + break + ;; + esac + fi + done + ;; +esac + +echo 'int main(){return 0;}' > hosted.$src +$cc -o hosted.$exe hosted.$src && ./hosted.$exe && hosted=1 + +echo '#!'$sh' +echo "" $@' > cpp +chmod +x cpp +case `./cpp -Dprobe` in +*-Dprobe*) + ;; +*) cp /bin/echo cpp + chmod u+w cpp + ;; +esac +for prefix in $probe_ppprefix `echo $cc | sed -e '/cc\$/!d' -e 's,cc\$,,' -e 's,.*/,,'` +do cp cpp ${prefix}cpp +done + +echo "" > flags.$src +echo '#pragma pp:version' > libpp.$src + +if test `realcppC=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppenv='realcppC=${ppcmd}' +elif test `cppC=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppenv='cppC=${ppcmd}' +elif test `_CPPNAME=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppenv='_CPPNAME=${ppcmd}' +elif test `_CPP=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppenv='_CPP=${ppcmd}' +elif test `$cc -Dprobe -E -%p+. flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 && test `$cc -Dprobe -E -%p+. flags.$src | wc -l` -eq 1 +then ppopt='-%p+${ppdir}' +elif test `$cc -Dprobe -E -Yp,. flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-Yp,${ppdir}' +elif test `$cc -Dprobe -E -Qpath $tmpdir flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-Qpath ${ppdir}' +elif test `$cc -Dprobe -E -tp -B./ flags.$src 2>err.out | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 -a ! -s err.out +then ppopt='-tp -B${ppdir}/' +elif test `$cc -Dprobe -E -B./ flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-B${ppdir}/' +elif test `$cc -Dprobe -E -tp -h./ -B flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-tp -h${ppdir}/ -B' +elif test `$cc -Dprobe -E -t p,./cpp flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 +then ppopt='-t p,${ppcmd}' +else { + eval set x $probe_verbose + shift + for o in "$@" + do $cc -E $o flags.$src + done + } 2>&1 | sed -e "s/['\"]//g" > cpp.out +fi + +set x `sed -e 's,[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\\\,/,g' -e 's,\\\\,/,g' cpp.out` +def= +definclude="-I+C -I-H" +stdinclude=$definclude +case $hosted in +"") usrinclude= ;; +esac +cmdinclude= +while : +do case $# in + 0|1) break ;; + esac + shift + case $1 in + -A) case $2 in + *\(*\)) shift + prepred="$prepred `echo $1 | sed 's/\(.*\)(\(.*\))/\1 \2/'`" + ;; + esac + ;; + -A\(*\)) + prepred="$prepred `echo $1 | sed 's/-A\(.*\)(\(.*\))/\1 \2/'`" + ;; + -[DI][-+][ABCDEFGHIJKLMNOPQRSTUVWXYZ]*) + stdpp=1 + case $1 in + -I?[CH]) case $def in + ?*) definclude="$definclude $1" ;; + *) stdinclude="$stdinclude $1" ;; + esac + ;; + -I-S*|-YI,*) usrinclude="`echo $1 | sed 's/....//'`" ;; + -Y?,*) ;; + -Y*) usrinclude="`echo $1 | sed 's/..//'`" ;; + esac + ;; + -D) shift + case $1 in + [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*=*) + predef="$predef +`echo $1 | sed -e 's/=.*//'`" + ;; + [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*) + predef="$predef +$1" + ;; + esac + ;; + -Dprobe);; + -D*) case $1 in + -D[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*=*) + predef="$predef +`echo $1 | sed -e 's/^-D//' -e 's/=.*//'`" + ;; + -D[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*) + predef="$predef +`echo $1 | sed -e 's/^-D//'`" + ;; + esac + ;; + -I) shift + case $1 in + /*) case $def in + ?*) definclude="$definclude $1" ;; + *) stdinclude="$stdinclude $1" ;; + esac + cmdinclude="$cmdinclude $1" + ;; + esac + ;; + -I/*) f=`echo X$1 | sed 's/X-I//'` + case $def in + ?*) definclude="$definclude $f" ;; + *) stdinclude="$stdinclude $f" ;; + esac + cmdinclude="$cmdinclude $f" + ;; + -U) shift + undef="$undef $1" + ;; + -U*) undef="$undef `echo $1 | sed 's/^-U//'`" + ;; + flags.$src)def= + ;; + esac +done +stdinclude="$stdinclude $definclude" +case " $stdinclude " in +*\ $usrinclude\ *) + case $usrinclude in + /usr/include) + usrinclude= + ;; + *) case " $stdinclude " in + *\ /usr/include\ *) + usrinclude= + ;; + *) usrinclude=/usr/include + ;; + esac + ;; + esac + ;; +esac + +tstinclude=`$cc -v -E flags.$src 2>&1 | sed -e '1,/[iI][nN][cC][lL][uU][dD][eE][ ]*<[.][.][.]>/d' -e '/^[eE][nN][dD] [oO][fF] [sS][eE][aA][rR][cC][hH]/,\$d'` +j=$tstinclude +case $j in +*/*) ;; +*) j=$cmdinclude ;; +esac +tstinclude= +good= +nogood= +c_hdr="stdio.h ctype.h" +C_hdr="libc.h" +for i in $j +do if test -d "$i" + then tstinclude="$tstinclude $i" + h= + for f in $c_hdr + do if test -f "$i/$f" + then case $i in + */CC) nogood=1 ;; + *) good=1 ;; + esac + else h="$h $f" + fi + done + c_hdr=$h + h= + for f in $C_hdr + do if test -f "$i/$f" + then case $i in + */CC) nogood=1 ;; + *) good=1 ;; + esac + else h="$h $f" + fi + done + C_hdr=$h + fi +done +case $nogood in +1) good=0 ;; +esac +case $good in +1) case $c_hdr in + ?*) bad=1 + usrinclude=/usr/include + set '' $tstinclude /usr/include + ;; + *) set '' $tstinclude + ;; + esac + shift + stdinclude=$* + echo "#include " > include.$src + $cc -E include.$src | sed -e '/# 1 "[\\/]/!d' -e 's,[^"]*",,' -e 's,[\\/][^\\/]*".*,,' -e 's,[\\/]sys,,' > include.out + for f in `cat include.out` + do if test -d "$f" + then g=`echo $f | sed -e 's,[\\/][\\/]*[^\\/]*$,,'` + case " $stdinclude " in + *\ $f\ *|*\ $g\ *) + ;; + *) stdinclude="$stdinclude $f" + case $f in + /usr/include) usrinclude=$f ;; + esac + bad=1 + ;; + esac + fi + done + ;; +*) case $ppopt$ppenv in + ?*) echo '#!'$sh' + echo $VIRTUAL_ROOT | sed "s/:.*//"' > cpp + chmod +x cpp + ppcmd=cpp + ppdir=. + eval x='`'$ppenv '$'cc -E $ppopt flags.$src'`' + case $x in + ?*) tstinclude=$x/usr/include + ;; + esac + cp /bin/echo cpp + chmod u+w cpp + ;; + esac + + eval set x $probe_include + while : + do shift + case $# in + 0) break ;; + esac + echo "#include <$1>" > include.$src + $cc -E include.$src + done > include.out + + ccinclude= + x=$stdinclude + stdinclude= + subinclude= + for f in $x $tstinclude `sed -e 's,\\\\,/,g' -e 's,///*,/,g' -e 's,"[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:/,"/,g' -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[\\/]/!d' -e 's/^#[line ]*[0123456789][0123456789]*[ ][ ]*"\(.*\)[\\/].*".*/\1/' include.out | sort -u` + do case $f in + -*) ;; + */) f=`echo $f | sed -e 's,//*\$,,'` ;; + */.) f=`echo $f | sed -e 's,//*.\$,,'` ;; + esac + case $f in + -I*) ;; + */cc) ccinclude=1 + ;; + */sys) continue + ;; + */include/*/*) + ;; + */include/*) + subinclude="$subinclude $f" + continue + ;; + esac + if test -d "$f" + then case " $stdinclude " in + *\ $f\ *) ;; + *) stdinclude="$stdinclude $f" ;; + esac + fi + done + rm include.out + case $ccinclude in + ?*) eval set x $probe_include + while : + do shift + case $# in + 0) break ;; + esac + echo "#include " > include.$src + if $cc -E include.$src > /dev/null + then break + fi + done + case $# in + 0) ;; + *) x=$stdinclude + stdinclude= + for f in $x + do case $f in + */cc) ;; + *) stdinclude="$stdinclude $f" ;; + esac + done + ;; + esac + ;; + esac + case $subinclude in + ?*) for i in $subinclude + do for j in $stdinclude + do case $i in + $j/*/*) ;; + $j/*) both= + eval set x $probe_include + while : + do shift + case $# in + 0) for k in $both + do echo "#include <$k>" > include.$src + $cc -E include.$src > include.out + I=`grep -c $i/$k < include.out` + J=`grep -c $j/$k < include.out` + case $I:$J in + 0:*) ;; + *:0) stdinclude="$i $stdinclude" + break + ;; + esac + done + continue 3 + ;; + esac + if test -f $i/$1 + then if test ! -f $j/$1 + then break 2 + fi + both="$both $1" + fi + done + ;; + $j) continue 2 + ;; + esac + done + stdinclude="$i $stdinclude" + done + ;; + esac + + { + + for i in $stdinclude + do + case $i in + $usrinclude) ;; + *) echo $i $i ;; + esac + done + + eval set x $probe_include + while : + do shift + case $# in + 0) break ;; + esac + echo "#include <$1>" > t.c + p= + for j in `$cc -E t.c | grep "$1" | sed -e 's,\\\\,/,g' -e 's,"[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:/,"/,g' -e '/^#[line ]*1[ ][ ]*"[\\/]/!d' -e 's/^#[line ]*1[ ][ ]*"\(.*\)[\\/].*".*/\1/'` + do j=`echo $j | sed -e 's,///*,/,g' -e 's,/$,,'` + case $p in + ?*) echo $p $j ;; + esac + p=$j + done + done + + case $usrinclude in + ?*) echo $usrinclude $usrinclude ;; + esac + + } | tsort > tmp.tmp + tstinclude=`cat tmp.tmp` + bad= + for i in $stdinclude + do case " +$tstinclude +" in + *" +$i +"*) ;; + *) bad=1 + break + ;; + esac + done + ;; +esac + +case $bad in +"") x=$stdinclude + stdinclude= + z= + for i in $tstinclude + do case " $x " in + *" $i "*) + stdinclude="$stdinclude $i" + z=$i + ;; + esac + done + case $usrinclude in + '') usrinclude=$z ;; + esac + ;; +esac +case $hosted in +"") case $usrinclude in + /usr/include) usrinclude= ;; + esac + ;; +esac + +case $usrinclude in +?*) case " $stdinclude " in + *\ $usrinclude\ *) + x=$stdinclude + stdinclude= + for f in $x + do case $f in + $usrinclude) ;; + *) stdinclude="$stdinclude $f" ;; + esac + done + ;; + esac + ;; +esac + +# drop dups -- they creep in somehow + +x=$stdinclude +stdinclude= +for f in $x +do case " $stdinclude $usrinclude " in + *" $f "*) ;; + *) stdinclude="$stdinclude $f" ;; + esac +done diff --git a/src/cmd/INIT/CONVERT.mk b/src/cmd/INIT/CONVERT.mk new file mode 100644 index 0000000..63a60ef --- /dev/null +++ b/src/cmd/INIT/CONVERT.mk @@ -0,0 +1,260 @@ +/* + * {automake|configure} => {nmake|iffe} conversion support + * + * The first command line target overrides the default original source + * directory name $(MAKEFILE:D). The hard work is in the makefile using + * these assertions, since it must (manually) provide the nmake makefiles + * and config equivalent iffe scripts. The conversion makefile is typically + * named lib/package/PACKAGE.cvt in an ast package $PACKAGEROOT directory, + * and the conversion is run from the $PACKAGEROOT directory, e.g.: + * + * nmake -I lib/package -f PACKAGE-VERSION/PACKAGE.cvt + * + * The conversion requires the ast nmake, pax and tw commands. + * + * After the conversion you will be liberated from ./configure, *.in, + * *.am, automake, autom4te, libtool, make depend, and makefile + * recursion ordering. You can build from $PACKAGEROOT using the ast + * package(1) (which sets up the { HOSTTYPE PATH VPATH } environment): + * + * package make + * + * or cd into any arch/$HOSTTYPE/src subdirectory and rebuild that portion + * of the hierarchy with the ast nmake(1) (after setting PATH and VPATH): + * + * nmake + * + * The conversion assertions are: + * + * package :CONVERT: file ... + * + * files in the original source directory are copied + * and converted into the ./src and ./lib subdirectories + * the default original source directory is ./original + * + * package package name + * file original source file that must exist + * + * :OMIT: pattern + * + * files matching pattern are not copied into the converted + * directory + * + * pattern ksh pattern of files to omit + * + * :COPY: from to [ file ... ] + * + * files in the from directory are copied to the to directory + * the action may contain :MOVE: exceptions to the copy + * + * from original directory subdirectory + * . names the original directory + * .. names the + * to converted subdirectory + * libNAME => src/lib/libNAME + * NAME => src/cmd/NAME + * file files or files in subdirectories to be copied; + * explicit files are copied to the to directory; + * if no files are specified then the from hierarchy + * is recursively copied to the converted directory + * + * :MOVE: to file ... + * + * :COPY: assertion exceptions placed in the assertion's action + * + * to files or subdirectory files are copied to this directory + * file file or files in subdirectories to be copied + * + * :FILE: to file <FD)" + original := $(D) + .ARGS : .CLEAR $(~.ARGS:O>1) + end + end + +.cvt.filter = +.cvt.package = + +.cvt.atom : .FUNCTION + local N V + V := $(%:O=1) + let .cvt.$(V) = .cvt.$(V) + 1 + return .cvt.$(V).$(.cvt.$(V)) + +.cvt.omit : .FUNCTION + return -s',^\(\(?K)?(*/)($(omit))?(/*))$,,$(showedit)' + +.cvt.to : .FUNCTION + if "$(%)" == "." + return src + end + if "$(%)" == "*/*" + return src/$(%) + end + if "$(%)" == "lib*" + return src/lib/$(%) + end + return src/cmd/$(%) + +":CONVERT:" : .MAKE .OPERATOR + local I + package := $(<) + I := $(hierarchy:C,$,/Makefile) + init : .cvt.verify $(I) + $(I) : .ACCEPT + test -d $(<:D) || $(MKDIR) -p $(<:D) + echo :MAKE: > $(<) + .cvt.verify : .MAKE .FORCE .REPEAT + local I + if I = "$(.cvt.package:T!=F)" + error 3 $(original): not a $(package) source directory: missing $(I) + end + .cvt.package := $(>:C,^,$$(original)/,) + +":COPY:" : .MAKE .OPERATOR + local F T I A + F := $(>:O=1) + T := $(.cvt.to $(>:O=2)) + A := $(.cvt.atom copy) + copy : $(A) + $(A) : .VIRTUAL + if F == "." + $(A) : $(T) + $(T) : + test -d $(<) || $(MKDIR) -p $(<) + for I $(>:O>2) + eval + $$(A) : $(I:D=$(T):B:S) + $(I:D=$(T):B:S) : $$(original)/$(I) + $$(CP) $$(CPFLAGS) $$(*) $$(<) + end + end + elif "$(F:T=FF)" || "$(F:N=*.(pax|t[bg]z))" + eval + $$(A) : $$(F) + test -d $(T) || $$(MKDIR) -p $(T) + cd $(T) + $$(PAX) $$(PAXFLAGS) -rf $$(*:P=A) -s ',^$(>:O=2)/*,,' $(.cvt.omit) $(.cvt.filter) + end + else + F := $$(original)/$(F) + if ! "$(@:V)" + eval + $$(A) : .FORCE + test -d $(T) || $$(MKDIR) -p $(T) + cd $(F:V) + $$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.filter) $(T:P=A) + end + else + .cvt.move = + : $(@:V:@R) + eval + $$(A) : .FORCE + test -d $(T) || $$(MKDIR) -p $(T) + cd $(F:V) + $$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.move) $(.cvt.filter) $(T:P=A) + end + end + end + +":EDIT:" : .MAKE .OPERATOR + local A D F + D := $(>:O=1) + if D == "-" + A := ^$(>:O=2)^$$(SED) -e $(@:Q:/'\n'/ -e /G) + .cvt.filter += --action=$(A:@Q) + else + D := $(.cvt.to $(D)) + F := $(>:O>1:C,^,$(D)/,) + edit : $(F) + eval + $$(F) : + $$(STDED) $$(STDEDFLAGS) $$(<) <<'$(here)' + $(@:V) + w + q + $(here) + end + end + +":FILE:" : .MAKE .OPERATOR + local ( D F ) $(>) + local A + A := $(.cvt.atom file) + $(A) := $(@:V) + D := $(.cvt.to $(D)) + file : $(D)/$(F) + eval + $$(D)/$$(F) : + test -d $$(<:D) || $$(MKDIR) -p $$(<:D) + cat > $$(<) <<'$(here)' + $$($(A):V) + $(here) + end + +":MOVE:" : .MAKE .OPERATOR + local T I + T := ../../../$(.cvt.to $(>:O=1)) + for I $(>:O>1) + if I == "*/" + .cvt.move += -s',^\(\(?K)$(I)),$(T)/,$(showedit)' + .cvt.move += -s',^\(\(?K)$(I:C%/$%%))$,,$(showedit)' + else + .cvt.move += -s',^\(\(?K)$(I))$,$(T)/$(I:B:S),$(showedit)' + end + end + +":OMIT:" : .MAKE .OPERATOR + local P + for P $(>) + omit := $(omit)|$(P) + end diff --git a/src/cmd/INIT/MAPLIB.mk b/src/cmd/INIT/MAPLIB.mk new file mode 100644 index 0000000..5761035 --- /dev/null +++ b/src/cmd/INIT/MAPLIB.mk @@ -0,0 +1,45 @@ +/* + * normalize local -l* library conventions + * + * L [ [ G11 ... G1n ] ... [ Gg1 ... Ggn ] ] :MAPLIB: T1.c ... Tn.c + * + * if Giji not specified then G11 == L + * the first Ti.c that compiles/links with group -lGi1 ... -lGin + * but does not compile/link with no libraries maps + * -lL to to require -lGi1 ... -lGin + * otherwise -lL is not required and maps to "no library required" + */ + +":MAPLIB:" : .MAKE .OPERATOR + local L P + L := $(<:B:O=1) + if ! ( P = "$(<:B:O>1)" ) + P := $(L) + end + $(LIBDIR)/lib/$(L) :INSTALL: $(L).req + eval + $(L).req : (CC) $$(>) + set - + r='-' + for i in $$(*) + do if $$(CC) -c $i > /dev/null + then g= + for p in $(P) - + do case $p in + -) if $$(CC) -o $$(<:B:S=.exe) $i $g > /dev/null 2>&1 + then $$(CC) -o $$(<:B:S=.exe) $i > /dev/null 2>&1 || { + r="$g" + break 2 + } + fi + g= + ;; + *) g="$g -l$p" + ;; + esac + done + fi + done 2>/dev/null + echo " $r" > $$(<) + rm -f $$(<:B:S=.exe) $$(*:B:S=$$(CC.SUFFIX.OBJECT)) + end diff --git a/src/cmd/INIT/MSGFUN.mk b/src/cmd/INIT/MSGFUN.mk new file mode 100644 index 0000000..0888d00 --- /dev/null +++ b/src/cmd/INIT/MSGFUN.mk @@ -0,0 +1,2 @@ +/* stub for pre-2000-05-01 nmake */ +":MSGFUN:" : .MAKE .OPERATOR diff --git a/src/cmd/INIT/MSGKEY.mk b/src/cmd/INIT/MSGKEY.mk new file mode 100644 index 0000000..db18559 --- /dev/null +++ b/src/cmd/INIT/MSGKEY.mk @@ -0,0 +1,2 @@ +/* stub for pre-2000-05-01 nmake */ +":MSGKEY:" : .MAKE .OPERATOR diff --git a/src/cmd/INIT/Makefile b/src/cmd/INIT/Makefile new file mode 100644 index 0000000..b1af6aa --- /dev/null +++ b/src/cmd/INIT/Makefile @@ -0,0 +1,293 @@ +/* + * initialization for all packages + */ + +:PACKAGE: license=ast + +LICENSE = since=1994,author=gsf + +PACKAGEROOT = $(INSTALLROOT:T=F:P=L*:O=n) + +hurl :: hurl.sh LICENSE=since=2003,author=gsf + +iffe :: iffe.sh LICENSE=since=1994,author=gsf+kpv + +mktest :: mktest.sh LICENSE=since=2005,author=gsf + +package :: package.sh + +regress :: regress.sh LICENSE=since=1995,author=gsf + +rt :: rt.sh LICENSE=since=2005,author=gsf + +$(PACKAGEROOT)/bin :INSTALLDIR: execrate ignore mamprobe package silent + +crossexec :: crossexec.sh + +ditto :: ditto.sh LICENSE=since=2001,author=gsf+ek + +execrate :: execrate.sh LICENSE=since=2002,author=gsf + +filter :: filter.sh + +ignore :: ignore.sh + +silent :: silent.sh + +$(PACKAGEROOT)/lib/package :INSTALLDIR: package.mk CONVERT.mk + +$(LIBDIR)/make :INSTALLDIR: package.mk PROBE.mk TEST.mk WWW.mk \ + MSGFUN.mk MSGKEY.mk MAPLIB.mk + +:TEST: iffe mamake + +cc ld ldd :PACKAGE_INIT: mamake.c proto.c ratz.c release.c + +:: RELEASE hosttype.tst p.c hello.c \ + ar.ibm.risc \ + cc.specialize cc.pentium4 \ + ldd.cygwin.i386 \ + cc.darwin.i386 cc.darwin.i386-64 cc.darwin ldd.darwin \ + cc.hp.ia64 cc.hp.pa cc.hp.pa64 ld.hp.pa ldd.hp.pa \ + cc.ibm.risc cc.ibm.risc.gcc ldd.ibm.risc \ + cc.linux.ia64-icc cc.linux.i386-icc cc.linux.i386-64-icc \ + cc.lynxos.i386 cc.lynxos.ppc ldd.lynxos \ + cc.mvs.390 cc.next.i386 cc.next.m68k ldd.mvs.390 \ + cc.osf.alpha \ + cc.sco.i386 \ + cc.sgi.mips2 cc.sgi.mips3 cc.sgi.mips3-o32 cc.sgi.mips4 \ + cc.sgi.mips4-n32 ldd.sgi \ + cc.unix.mc68k + +LICENSE : .DONTCARE + +if ! CC.HOSTTYPE + CC.HOSTTYPE := $(_hosttype_|HOSTTYPE) +end + +$(BINDIR)/mkdir :INSTALL: mkdir.sh + if test ! -x $(<) -a -x /bin/mkdir + then mkdir -p 2>/dev/null || : + if test -d ./-p + then rmdir ./-p + cp $(*) $(<) + chmod +x $(<) + fi + fi + +/* + * ksh93 function search on PATH + * ksh93 builtin command library -lcmd + * ksh93 ld library path search on PATH + */ + +$(BINDIR)/.paths :INSTALL: (CC.DIALECT) + if test ! -f $(<) -o -w $(<) + then nl=" +" + o=`cat $(<) 2>/dev/null` || : + v= + n= + case $nl$o in + *${nl}FPATH=*|*#FPATH=*|*[Nn][Oo]FPATH=*) + ;; + *) case $n in + '') ;; + *) n="$n$nl" v="$v|" ;; + esac + n="${n}FPATH=../fun" + v="${v}FPATH" + ;; + esac + case $nl$o in + *${nl}BUILTIN_LIB=*|*#BUILTIN_LIB=*|*[Nn][Oo]BUILTIN_LIB=*) + ;; + *) case $n in + '') ;; + *) n="$n$nl" v="$v|" ;; + esac + case '$(CC.DIALECT:N=*EXPORT=[AD]LL*)' in + ?*) p= c= ;; + *) p='XX' ;; + esac + n="${n}${p}BUILTIN_LIB=cmd" + v="${v}BUILTIN_LIB" + ;; + esac + set x x : $(-mam:??$(.GETCONF LIBPATH:/:/ /G:/,/ : /G:Q)?) + p= + while : + do while : + do case $# in + 0) break ;; + esac + x=$1 + shift + case $x in + :) break ;; + esac + done + case $# in + 0|1) break + ;; + 2) p=$2 + ;; + *) case "$(CC.HOSTTYPE)" in + $3) p=$2; break ;; + esac + ;; + esac + done + case $p in + '') if test -x /lib/dld.sl + then p=SHLIB_PATH + elif test -x /usr/lib/dyld + then p=DYLD_LIBRARY_PATH + else case "$(CC.HOSTTYPE)" in + ibm.*|mvs.*) + p=LIBPATH + ;; + sgi.mips3) + p=LD_LIBRARYN32_PATH + ;; + sgi.mips4) + p=LD_LIBRARYN64_PATH + ;; + *) p=LD_LIBRARY_PATH + ;; + esac + fi + ;; + esac + case $nl$o in + *${nl}${p}=*|*#${p}=*|*[Nn][Oo]${p}=*) + ;; + *) case $n in + '') ;; + *) n="$n$nl" v="$v|" ;; + esac + n="${n}${p}=../lib" + v="${v}${p}" + ;; + esac + case $n in + ?*) case $o in + ?*) o=`egrep -v "($v)=" $(<)`$nl ;; + esac + echo "# use { # no NO } prefix instead of XX to permanently disable #$nl$o$n" > $(<) + ;; + esac + fi + +/* + * probe initialization + */ + +for T C+probe C+make+probe.lcl C+pp+probe.lcl + if T == "*.lcl" + $(T) : .DONTCARE + end + $(LIBDIR)/probe/$(T:C,+,/,G) :INSTALL: $(T) +end + +$(LIBDIR)/probe/C/mam/probe :INSTALL: mprobe + +mprobe :: mprobe.sh + +$(LIBDIR)/probe/C/make :INSTALLDIR: probe probe.ini + +probe.sh : C+probe make.probe + cat $(*) > $(<) + +probe :: probe.sh + +probe.ini : (CC.HOSTTYPE) probe.win32 + t=$(CC.HOSTTYPE) + ifs=$IFS + IFS=. + set x $t + IFS=$ifs + t=$2 + set x $(*) + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + *probe.$t) + break + esac + done + case $1 in + ?*) cmp -s $1 $(<) || cp $1 $(<) ;; + *) : > $(<) + esac + +/* + * proto initialization + */ + +$(INCLUDEDIR) :INSTALLDIR: prototyped.h + +prototyped.h : $(BINDIR)/proto + proto -f /dev/null > h.$(tmp).h + if $(CMP) -s h.$(tmp).h $(<) + then $(RM) -f h.$(tmp).h + else $(MV) h.$(tmp).h $(<) + fi + +/* + * check if -ldl is required + * this allows makefiles to use -ldl on all systems + * + * NOTE: this works around the sgi botch: + * (1) irix 5.* made -ldl optional but warned + * (2) irix 6.* has no -ldl + * (3) dynamic progs built on irix 5.* and using -ldl fail + * at runtime on irix 6.* because -ldl is not there + */ + +dl :MAPLIB: dl.c + +/* + * requiring these is a botch + */ + +iconv :MAPLIB: iconv.c + +w :MAPLIB: w.c w2.c + +/* + * miscellaneous -l* checks + */ + +intl :MAPLIB: intl.c + +m :MAPLIB: m.c m2.c m3.c m4.c m5.c m6.c + +nsl :MAPLIB: nsl.c + +/* + * what was sco smoking + * almost all of gethost* are in -lnsl except gethostbyname which + * is in -lsocket which isn't needed to resolve socket() but seems + * to do the -lnsl job + */ + +socket :MAPLIB: socket.c nsl.c + +/* + * more substance abuse + * gdbm's ndbm "compatibility" doesn't supply , instead supplies + * which provides K&R prototypes *and* it requires -lgdbm + * some implementations use -lndbm, others -ldbm, still others -lc + * this is why unix is starting to look like windows + * this map allows makefiles to use -ldbm on all systems + * + * and this just in: sometimes its and possibly -lgdbm_compat + * + * at least the -l* buck stops here + */ + +dbm db - gdbm_compat - gdbm - ndbm - dbm :MAPLIB: db.c gdbm.c gdbm1.c gdbm2.c diff --git a/src/cmd/INIT/Mamfile b/src/cmd/INIT/Mamfile new file mode 100644 index 0000000..e5826d2 --- /dev/null +++ b/src/cmd/INIT/Mamfile @@ -0,0 +1,1332 @@ +info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-02-29 +setv INSTALLROOT ../../.. +setv PACKAGEROOT ../../../../.. +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv ARFLAGS rc +setv AS as +setv ASFLAGS +setv CC cc +setv mam_cc_FLAGS +setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} +setv COTEMP $$ +setv CPIO cpio +setv CPIOFLAGS +setv CPP "${CC} -E" +setv F77 f77 +setv HOSTCC ${CC} +setv IGNORE +setv LD ld +setv LDFLAGS +setv LEX lex +setv LEXFLAGS +setv LPR lpr +setv LPRFLAGS +setv M4FLAGS +setv NMAKE nmake +setv NMAKEFLAGS +setv PR pr +setv PRFLAGS +setv SHELL /bin/sh +setv SILENT +setv TAR tar +setv YACC yacc +setv YACCFLAGS -d +make ${PACKAGEROOT}/lib/package/ast.lic +done ${PACKAGEROOT}/lib/package/ast.lic +make install +make hurl +make hurl.sh +done hurl.sh +meta hurl %.sh>% hurl.sh hurl +prev hurl.sh +setv LICENSE -DLICENSE="since=2003,author=gsf" +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : hurl contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n hurl.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 200 in +exec - 0) cp hurl.sh hurl +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < hurl.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - hurl.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2003-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > hurl +exec - ;; +exec - esac +exec - ;; +exec - *) cat - hurl.sh > hurl <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2003-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w hurl -a -x hurl || chmod u+w,+x hurl +done hurl generated +make iffe +make iffe.sh +done iffe.sh +meta iffe %.sh>% iffe.sh iffe +prev iffe.sh +setv LICENSE -DLICENSE="since=1994,author=gsf+kpv" +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : iffe contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n iffe.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 241 in +exec - 0) cp iffe.sh iffe +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < iffe.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - iffe.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-author?Phong Vo ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > iffe +exec - ;; +exec - esac +exec - ;; +exec - *) cat - iffe.sh > iffe <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-author?Phong Vo ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w iffe -a -x iffe || chmod u+w,+x iffe +done iffe generated +make mktest +make mktest.sh +done mktest.sh +meta mktest %.sh>% mktest.sh mktest +prev mktest.sh +setv LICENSE -DLICENSE="since=2005,author=gsf" +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : mktest contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n mktest.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 200 in +exec - 0) cp mktest.sh mktest +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < mktest.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - mktest.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > mktest +exec - ;; +exec - esac +exec - ;; +exec - *) cat - mktest.sh > mktest <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w mktest -a -x mktest || chmod u+w,+x mktest +done mktest generated +make package +make package.sh +done package.sh +meta package %.sh>% package.sh package +prev package.sh +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : package contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n package.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 200 in +exec - 0) cp package.sh package +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < package.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - package.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > package +exec - ;; +exec - esac +exec - ;; +exec - *) cat - package.sh > package <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w package -a -x package || chmod u+w,+x package +done package generated +make regress +make regress.sh +done regress.sh +meta regress %.sh>% regress.sh regress +prev regress.sh +setv LICENSE -DLICENSE="since=1995,author=gsf" +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : regress contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n regress.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 200 in +exec - 0) cp regress.sh regress +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < regress.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - regress.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > regress +exec - ;; +exec - esac +exec - ;; +exec - *) cat - regress.sh > regress <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w regress -a -x regress || chmod u+w,+x regress +done regress generated +make rt +make rt.sh +done rt.sh +meta rt %.sh>% rt.sh rt +prev rt.sh +setv LICENSE -DLICENSE="since=2005,author=gsf" +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : rt contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n rt.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 200 in +exec - 0) cp rt.sh rt +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < rt.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - rt.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > rt +exec - ;; +exec - esac +exec - ;; +exec - *) cat - rt.sh > rt <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w rt -a -x rt || chmod u+w,+x rt +done rt generated +make crossexec +make crossexec.sh +done crossexec.sh +meta crossexec %.sh>% crossexec.sh crossexec +prev crossexec.sh +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : crossexec contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n crossexec.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 200 in +exec - 0) cp crossexec.sh crossexec +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < crossexec.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - crossexec.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > crossexec +exec - ;; +exec - esac +exec - ;; +exec - *) cat - crossexec.sh > crossexec <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w crossexec -a -x crossexec || chmod u+w,+x crossexec +done crossexec generated +make ditto +make ditto.sh +done ditto.sh +meta ditto %.sh>% ditto.sh ditto +prev ditto.sh +setv LICENSE -DLICENSE="since=2001,author=gsf+ek" +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : ditto contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n ditto.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 248 in +exec - 0) cp ditto.sh ditto +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < ditto.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - ditto.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-author?Lefty Koutsofios ][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > ditto +exec - ;; +exec - esac +exec - ;; +exec - *) cat - ditto.sh > ditto <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-author?Lefty Koutsofios ][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w ditto -a -x ditto || chmod u+w,+x ditto +done ditto generated +make execrate +make execrate.sh +done execrate.sh +meta execrate %.sh>% execrate.sh execrate +prev execrate.sh +setv LICENSE -DLICENSE="since=2002,author=gsf" +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : execrate contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n execrate.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 200 in +exec - 0) cp execrate.sh execrate +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < execrate.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - execrate.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > execrate +exec - ;; +exec - esac +exec - ;; +exec - *) cat - execrate.sh > execrate <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w execrate -a -x execrate || chmod u+w,+x execrate +done execrate generated +make filter +make filter.sh +done filter.sh +meta filter %.sh>% filter.sh filter +prev filter.sh +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : filter contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n filter.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 200 in +exec - 0) cp filter.sh filter +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < filter.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - filter.sh <<'!' +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - } > filter +exec - ;; +exec - esac +exec - ;; +exec - *) cat - filter.sh > filter <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]" +exec - ! +exec - ;; +exec - esac +exec - silent test -w filter -a -x filter || chmod u+w,+x filter +done filter generated +make ignore +make ignore.sh +done ignore.sh +meta ignore %.sh>% ignore.sh ignore +prev ignore.sh +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : ignore contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n ignore.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 0 in +exec - 0) cp ignore.sh ignore +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < ignore.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - ignore.sh <<'!' +exec - +exec - ! +exec - } > ignore +exec - ;; +exec - esac +exec - ;; +exec - *) cat - ignore.sh > ignore <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - +exec - ! +exec - ;; +exec - esac +exec - silent test -w ignore -a -x ignore || chmod u+w,+x ignore +done ignore generated +make silent +make silent.sh +done silent.sh +meta silent %.sh>% silent.sh silent +prev silent.sh +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : silent contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n silent.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 0 in +exec - 0) cp silent.sh silent +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < silent.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - silent.sh <<'!' +exec - +exec - ! +exec - } > silent +exec - ;; +exec - esac +exec - ;; +exec - *) cat - silent.sh > silent <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - +exec - ! +exec - ;; +exec - esac +exec - silent test -w silent -a -x silent || chmod u+w,+x silent +done silent generated +make mamake +make mamake.o +make mamake.c +make shlib-compat.h implicit +done shlib-compat.h dontcare virtual +make ast.h implicit +done ast.h dontcare virtual +done mamake.c +meta mamake.o %.c>%.o mamake.c mamake +prev mamake.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]"\" -c mamake.c +done mamake.o generated +exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o mamake mamake.o +done mamake generated +make proto +make proto.o +make proto.c +done proto.c +meta proto.o %.c>%.o proto.c proto +prev proto.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c proto.c +done proto.o generated +exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o proto proto.o +done proto generated +make ratz +make ratz.o +make ratz.c +make unix.h implicit +done unix.h dontcare virtual +make alloc.h implicit +done alloc.h dontcare virtual +make unixio.h implicit +done unixio.h dontcare virtual +make ast_std.h implicit +done ast_std.h dontcare virtual +make windows.h implicit +done windows.h dontcare virtual +make io.h implicit +done io.h dontcare virtual +make direct.h implicit +done direct.h dontcare virtual +prev ast.h implicit +done ratz.c +meta ratz.o %.c>%.o ratz.c ratz +prev ratz.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c ratz.c +done ratz.o generated +exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o ratz ratz.o +done ratz generated +make release +make release.o +make release.c +prev ast.h implicit +done release.c +meta release.o %.c>%.o release.c release +prev release.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?INIT]"\" -c release.c +done release.o generated +exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o release release.o +done release generated +make mprobe +make mprobe.sh +done mprobe.sh +meta mprobe %.sh>% mprobe.sh mprobe +prev mprobe.sh +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : mprobe contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n mprobe.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 0 in +exec - 0) cp mprobe.sh mprobe +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < mprobe.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - mprobe.sh <<'!' +exec - +exec - ! +exec - } > mprobe +exec - ;; +exec - esac +exec - ;; +exec - *) cat - mprobe.sh > mprobe <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - +exec - ! +exec - ;; +exec - esac +exec - silent test -w mprobe -a -x mprobe || chmod u+w,+x mprobe +done mprobe generated +make probe +make probe.sh +make C+probe +done C+probe +make make.probe +done make.probe +exec - cat C+probe make.probe > probe.sh +done probe.sh generated +meta probe %.sh>% probe.sh probe +prev probe.sh +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : probe contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n probe.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 0 in +exec - 0) cp probe.sh probe +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < probe.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - probe.sh <<'!' +exec - +exec - ! +exec - } > probe +exec - ;; +exec - esac +exec - ;; +exec - *) cat - probe.sh > probe <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - +exec - ! +exec - ;; +exec - esac +exec - silent test -w probe -a -x probe || chmod u+w,+x probe +done probe generated +make ${INSTALLROOT}/bin +exec - if silent test ! -d ${INSTALLROOT}/bin +exec - then mkdir -p ${INSTALLROOT}/bin +exec - fi +done ${INSTALLROOT}/bin generated +make ${INSTALLROOT}/bin/hurl +prev ${INSTALLROOT}/bin +prev hurl +exec - test '' = 'hurl' || ${STDCMP} 2>/dev/null -s hurl ${INSTALLROOT}/bin/hurl || { ${STDMV} ${INSTALLROOT}/bin/hurl ${INSTALLROOT}/bin/hurl.old 2>/dev/null || true; ${STDCP} hurl ${INSTALLROOT}/bin/hurl ;} +done ${INSTALLROOT}/bin/hurl generated +make ${INSTALLROOT}/bin/iffe +prev iffe +exec - test '' = 'iffe' || ${STDCMP} 2>/dev/null -s iffe ${INSTALLROOT}/bin/iffe || { ${STDMV} ${INSTALLROOT}/bin/iffe ${INSTALLROOT}/bin/iffe.old 2>/dev/null || true; ${STDCP} iffe ${INSTALLROOT}/bin/iffe ;} +done ${INSTALLROOT}/bin/iffe generated +make ${INSTALLROOT}/bin/mktest +prev mktest +exec - test '' = 'mktest' || ${STDCMP} 2>/dev/null -s mktest ${INSTALLROOT}/bin/mktest || { ${STDMV} ${INSTALLROOT}/bin/mktest ${INSTALLROOT}/bin/mktest.old 2>/dev/null || true; ${STDCP} mktest ${INSTALLROOT}/bin/mktest ;} +done ${INSTALLROOT}/bin/mktest generated +make ${INSTALLROOT}/bin/package +prev package +exec - test '' = 'package' || ${STDCMP} 2>/dev/null -s package ${INSTALLROOT}/bin/package || { ${STDMV} ${INSTALLROOT}/bin/package ${INSTALLROOT}/bin/package.old 2>/dev/null || true; ${STDCP} package ${INSTALLROOT}/bin/package ;} +done ${INSTALLROOT}/bin/package generated +make ${INSTALLROOT}/bin/regress +prev regress +exec - test '' = 'regress' || ${STDCMP} 2>/dev/null -s regress ${INSTALLROOT}/bin/regress || { ${STDMV} ${INSTALLROOT}/bin/regress ${INSTALLROOT}/bin/regress.old 2>/dev/null || true; ${STDCP} regress ${INSTALLROOT}/bin/regress ;} +done ${INSTALLROOT}/bin/regress generated +make ${INSTALLROOT}/bin/rt +prev rt +exec - test '' = 'rt' || ${STDCMP} 2>/dev/null -s rt ${INSTALLROOT}/bin/rt || { ${STDMV} ${INSTALLROOT}/bin/rt ${INSTALLROOT}/bin/rt.old 2>/dev/null || true; ${STDCP} rt ${INSTALLROOT}/bin/rt ;} +done ${INSTALLROOT}/bin/rt generated +make ${PACKAGEROOT}/bin +exec - if silent test ! -d ${PACKAGEROOT}/bin +exec - then mkdir -p ${PACKAGEROOT}/bin +exec - fi +done ${PACKAGEROOT}/bin generated +make ${PACKAGEROOT}/bin/execrate +prev ${PACKAGEROOT}/bin +prev execrate +exec - test '' = 'execrate' || ${STDCMP} 2>/dev/null -s execrate ${PACKAGEROOT}/bin/execrate || { ${STDMV} ${PACKAGEROOT}/bin/execrate ${PACKAGEROOT}/bin/execrate.old 2>/dev/null || true; ${STDCP} execrate ${PACKAGEROOT}/bin/execrate ;} +done ${PACKAGEROOT}/bin/execrate generated +make ${PACKAGEROOT}/bin/ignore +prev ignore +exec - test '' = 'ignore' || ${STDCMP} 2>/dev/null -s ignore ${PACKAGEROOT}/bin/ignore || { ${STDMV} ${PACKAGEROOT}/bin/ignore ${PACKAGEROOT}/bin/ignore.old 2>/dev/null || true; ${STDCP} ignore ${PACKAGEROOT}/bin/ignore ;} +done ${PACKAGEROOT}/bin/ignore generated +make ${PACKAGEROOT}/bin/mamprobe +make mamprobe +meta mamprobe %.sh>% mamprobe.sh mamprobe +make mamprobe.sh +done mamprobe.sh +exec - case static,port:$OPTIND:$RANDOM in +exec - ?*:*:*|*::*|*:*:$RANDOM) +exec - ;; +exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null +exec - then if grep -q '### .*archaic.* ###' +exec - then : mamprobe contains archaic constructs : +exec - else ENV= LC_ALL=C $SHELL -n mamprobe.sh +exec - fi +exec - fi +exec - ;; +exec - esac +exec - case '${mam_cc_SHELLMAGIC}' in +exec - "") case 0 in +exec - 0) cp mamprobe.sh mamprobe +exec - ;; +exec - *) { +exec - i=`(read x; echo $x) < mamprobe.sh` +exec - case $i in +exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; +exec - esac +exec - cat - mamprobe.sh <<'!' +exec - +exec - ! +exec - } > mamprobe +exec - ;; +exec - esac +exec - ;; +exec - *) cat - mamprobe.sh > mamprobe <<'!' +exec - ${mam_cc_SHELLMAGIC} +exec - +exec - ! +exec - ;; +exec - esac +exec - silent test -w mamprobe -a -x mamprobe || chmod u+w,+x mamprobe +done mamprobe generated +exec - test '' = 'mamprobe' || ${STDCMP} 2>/dev/null -s mamprobe ${PACKAGEROOT}/bin/mamprobe || { ${STDMV} ${PACKAGEROOT}/bin/mamprobe ${PACKAGEROOT}/bin/mamprobe.old 2>/dev/null || true; ${STDCP} mamprobe ${PACKAGEROOT}/bin/mamprobe ;} +done ${PACKAGEROOT}/bin/mamprobe generated +make ${PACKAGEROOT}/bin/package +prev package +exec - test '' = 'package' || ${STDCMP} 2>/dev/null -s package ${PACKAGEROOT}/bin/package || { ${STDMV} ${PACKAGEROOT}/bin/package ${PACKAGEROOT}/bin/package.old 2>/dev/null || true; ${STDCP} package ${PACKAGEROOT}/bin/package ;} +done ${PACKAGEROOT}/bin/package generated +make ${PACKAGEROOT}/bin/silent +prev silent +exec - test '' = 'silent' || ${STDCMP} 2>/dev/null -s silent ${PACKAGEROOT}/bin/silent || { ${STDMV} ${PACKAGEROOT}/bin/silent ${PACKAGEROOT}/bin/silent.old 2>/dev/null || true; ${STDCP} silent ${PACKAGEROOT}/bin/silent ;} +done ${PACKAGEROOT}/bin/silent generated +make ${INSTALLROOT}/bin/crossexec +prev crossexec +exec - test '' = 'crossexec' || ${STDCMP} 2>/dev/null -s crossexec ${INSTALLROOT}/bin/crossexec || { ${STDMV} ${INSTALLROOT}/bin/crossexec ${INSTALLROOT}/bin/crossexec.old 2>/dev/null || true; ${STDCP} crossexec ${INSTALLROOT}/bin/crossexec ;} +done ${INSTALLROOT}/bin/crossexec generated +make ${INSTALLROOT}/bin/ditto +prev ditto +exec - test '' = 'ditto' || ${STDCMP} 2>/dev/null -s ditto ${INSTALLROOT}/bin/ditto || { ${STDMV} ${INSTALLROOT}/bin/ditto ${INSTALLROOT}/bin/ditto.old 2>/dev/null || true; ${STDCP} ditto ${INSTALLROOT}/bin/ditto ;} +done ${INSTALLROOT}/bin/ditto generated +make ${INSTALLROOT}/bin/filter +prev filter +exec - test '' = 'filter' || ${STDCMP} 2>/dev/null -s filter ${INSTALLROOT}/bin/filter || { ${STDMV} ${INSTALLROOT}/bin/filter ${INSTALLROOT}/bin/filter.old 2>/dev/null || true; ${STDCP} filter ${INSTALLROOT}/bin/filter ;} +done ${INSTALLROOT}/bin/filter generated +make ${PACKAGEROOT}/lib/package +exec - if silent test ! -d ${PACKAGEROOT}/lib/package +exec - then mkdir -p ${PACKAGEROOT}/lib/package +exec - fi +done ${PACKAGEROOT}/lib/package generated +make ${PACKAGEROOT}/lib/package/package.mk +prev ${PACKAGEROOT}/lib/package +make package.mk +done package.mk +exec - test '' = 'package.mk' || ${STDCMP} 2>/dev/null -s package.mk ${PACKAGEROOT}/lib/package/package.mk || { ${STDMV} ${PACKAGEROOT}/lib/package/package.mk ${PACKAGEROOT}/lib/package/package.mk.old 2>/dev/null || true; ${STDCP} package.mk ${PACKAGEROOT}/lib/package/package.mk ;} +done ${PACKAGEROOT}/lib/package/package.mk generated +make ${PACKAGEROOT}/lib/package/CONVERT.mk +make CONVERT.mk +done CONVERT.mk +exec - test '' = 'CONVERT.mk' || ${STDCMP} 2>/dev/null -s CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk || { ${STDMV} ${PACKAGEROOT}/lib/package/CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk.old 2>/dev/null || true; ${STDCP} CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk ;} +done ${PACKAGEROOT}/lib/package/CONVERT.mk generated +make ${INSTALLROOT}/lib/make +exec - if silent test ! -d ${INSTALLROOT}/lib/make +exec - then mkdir -p ${INSTALLROOT}/lib/make +exec - fi +done ${INSTALLROOT}/lib/make generated +make ${INSTALLROOT}/lib/make/package.mk +prev ${INSTALLROOT}/lib/make +prev package.mk +exec - test '' = 'package.mk' || ${STDCMP} 2>/dev/null -s package.mk ${INSTALLROOT}/lib/make/package.mk || { ${STDMV} ${INSTALLROOT}/lib/make/package.mk ${INSTALLROOT}/lib/make/package.mk.old 2>/dev/null || true; ${STDCP} package.mk ${INSTALLROOT}/lib/make/package.mk ;} +done ${INSTALLROOT}/lib/make/package.mk generated +make ${INSTALLROOT}/lib/make/PROBE.mk +make PROBE.mk +done PROBE.mk +exec - test '' = 'PROBE.mk' || ${STDCMP} 2>/dev/null -s PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk || { ${STDMV} ${INSTALLROOT}/lib/make/PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk.old 2>/dev/null || true; ${STDCP} PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk ;} +done ${INSTALLROOT}/lib/make/PROBE.mk generated +make ${INSTALLROOT}/lib/make/TEST.mk +make TEST.mk +done TEST.mk +exec - test '' = 'TEST.mk' || ${STDCMP} 2>/dev/null -s TEST.mk ${INSTALLROOT}/lib/make/TEST.mk || { ${STDMV} ${INSTALLROOT}/lib/make/TEST.mk ${INSTALLROOT}/lib/make/TEST.mk.old 2>/dev/null || true; ${STDCP} TEST.mk ${INSTALLROOT}/lib/make/TEST.mk ;} +done ${INSTALLROOT}/lib/make/TEST.mk generated +make ${INSTALLROOT}/lib/make/WWW.mk +make WWW.mk +done WWW.mk +exec - test '' = 'WWW.mk' || ${STDCMP} 2>/dev/null -s WWW.mk ${INSTALLROOT}/lib/make/WWW.mk || { ${STDMV} ${INSTALLROOT}/lib/make/WWW.mk ${INSTALLROOT}/lib/make/WWW.mk.old 2>/dev/null || true; ${STDCP} WWW.mk ${INSTALLROOT}/lib/make/WWW.mk ;} +done ${INSTALLROOT}/lib/make/WWW.mk generated +make ${INSTALLROOT}/lib/make/MSGFUN.mk +make MSGFUN.mk +done MSGFUN.mk +exec - test '' = 'MSGFUN.mk' || ${STDCMP} 2>/dev/null -s MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk.old 2>/dev/null || true; ${STDCP} MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk ;} +done ${INSTALLROOT}/lib/make/MSGFUN.mk generated +make ${INSTALLROOT}/lib/make/MSGKEY.mk +make MSGKEY.mk +done MSGKEY.mk +exec - test '' = 'MSGKEY.mk' || ${STDCMP} 2>/dev/null -s MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk.old 2>/dev/null || true; ${STDCP} MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk ;} +done ${INSTALLROOT}/lib/make/MSGKEY.mk generated +make ${INSTALLROOT}/lib/make/MAPLIB.mk +make MAPLIB.mk +done MAPLIB.mk +exec - test '' = 'MAPLIB.mk' || ${STDCMP} 2>/dev/null -s MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk.old 2>/dev/null || true; ${STDCP} MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk ;} +done ${INSTALLROOT}/lib/make/MAPLIB.mk generated +make ${INSTALLROOT}/bin/mamake +prev mamake +exec - test '' = 'mamake' || ${STDCMP} 2>/dev/null -s mamake ${INSTALLROOT}/bin/mamake || { ${STDMV} ${INSTALLROOT}/bin/mamake ${INSTALLROOT}/bin/mamake.old 2>/dev/null || true; ${STDCP} mamake ${INSTALLROOT}/bin/mamake ;} +done ${INSTALLROOT}/bin/mamake generated +make ${INSTALLROOT}/bin/proto +prev proto +exec - test '' = 'proto' || ${STDCMP} 2>/dev/null -s proto ${INSTALLROOT}/bin/proto || { ${STDMV} ${INSTALLROOT}/bin/proto ${INSTALLROOT}/bin/proto.old 2>/dev/null || true; ${STDCP} proto ${INSTALLROOT}/bin/proto ;} +done ${INSTALLROOT}/bin/proto generated +make ${INSTALLROOT}/bin/ratz +prev ratz +exec - test '' = 'ratz' || ${STDCMP} 2>/dev/null -s ratz ${INSTALLROOT}/bin/ratz || { ${STDMV} ${INSTALLROOT}/bin/ratz ${INSTALLROOT}/bin/ratz.old 2>/dev/null || true; ${STDCP} ratz ${INSTALLROOT}/bin/ratz ;} +done ${INSTALLROOT}/bin/ratz generated +make ${INSTALLROOT}/bin/release +prev release +exec - test '' = 'release' || ${STDCMP} 2>/dev/null -s release ${INSTALLROOT}/bin/release || { ${STDMV} ${INSTALLROOT}/bin/release ${INSTALLROOT}/bin/release.old 2>/dev/null || true; ${STDCP} release ${INSTALLROOT}/bin/release ;} +done ${INSTALLROOT}/bin/release generated +make ${INSTALLROOT}/bin/mkdir +make mkdir.sh +done mkdir.sh +exec - if test ! -x ${INSTALLROOT}/bin/mkdir -a -x /bin/mkdir +exec - then mkdir -p 2>/dev/null || : +exec - if test -d ./-p +exec - then rmdir ./-p +exec - cp mkdir.sh ${INSTALLROOT}/bin/mkdir +exec - chmod +x ${INSTALLROOT}/bin/mkdir +exec - fi +exec - fi +done ${INSTALLROOT}/bin/mkdir generated +make ${INSTALLROOT}/bin/.paths +exec - if test ! -f ${INSTALLROOT}/bin/.paths -o -w ${INSTALLROOT}/bin/.paths +exec - then nl=" +exec - " +exec - o=`cat ${INSTALLROOT}/bin/.paths 2>/dev/null` || : +exec - v= +exec - n= +exec - case $nl$o in +exec - *${nl}FPATH=*|*#FPATH=*|*[Nn][Oo]FPATH=*) +exec - ;; +exec - *) case $n in +exec - '') ;; +exec - *) n="$n$nl" v="$v|" ;; +exec - esac +exec - n="${n}FPATH=../fun" +exec - v="${v}FPATH" +exec - ;; +exec - esac +exec - case $nl$o in +exec - *${nl}BUILTIN_LIB=*|*#BUILTIN_LIB=*|*[Nn][Oo]BUILTIN_LIB=*) +exec - ;; +exec - *) case $n in +exec - '') ;; +exec - *) n="$n$nl" v="$v|" ;; +exec - esac +exec - case '' in +exec - ?*) p= c= ;; +exec - *) p='XX' ;; +exec - esac +exec - n="${n}${p}BUILTIN_LIB=cmd" +exec - v="${v}BUILTIN_LIB" +exec - ;; +exec - esac +exec - set x x : +exec - p= +exec - while : +exec - do while : +exec - do case $# in +exec - 0) break ;; +exec - esac +exec - x=$1 +exec - shift +exec - case $x in +exec - :) break ;; +exec - esac +exec - done +exec - case $# in +exec - 0|1) break +exec - ;; +exec - 2) p=$2 +exec - ;; +exec - *) case "${mam_cc_HOSTTYPE}" in +exec - $3) p=$2; break ;; +exec - esac +exec - ;; +exec - esac +exec - done +exec - case $p in +exec - '') if test -x /lib/dld.sl +exec - then p=SHLIB_PATH +exec - elif test -x /usr/lib/dyld +exec - then p=DYLD_LIBRARY_PATH +exec - else case "${mam_cc_HOSTTYPE}" in +exec - ibm.*|mvs.*) +exec - p=LIBPATH +exec - ;; +exec - sgi.mips3) +exec - p=LD_LIBRARYN32_PATH +exec - ;; +exec - sgi.mips4) +exec - p=LD_LIBRARYN64_PATH +exec - ;; +exec - *) p=LD_LIBRARY_PATH +exec - ;; +exec - esac +exec - fi +exec - ;; +exec - esac +exec - case $nl$o in +exec - *${nl}${p}=*|*#${p}=*|*[Nn][Oo]${p}=*) +exec - ;; +exec - *) case $n in +exec - '') ;; +exec - *) n="$n$nl" v="$v|" ;; +exec - esac +exec - n="${n}${p}=../lib" +exec - v="${v}${p}" +exec - ;; +exec - esac +exec - case $n in +exec - ?*) case $o in +exec - ?*) o=`egrep -v "($v)=" ${INSTALLROOT}/bin/.paths`$nl ;; +exec - esac +exec - echo "# use { # no NO } prefix instead of XX to permanently disable #$nl$o$n" > ${INSTALLROOT}/bin/.paths +exec - ;; +exec - esac +exec - fi +done ${INSTALLROOT}/bin/.paths generated +make ${INSTALLROOT}/lib/probe/C +exec - if silent test ! -d ${INSTALLROOT}/lib/probe/C +exec - then mkdir -p ${INSTALLROOT}/lib/probe/C +exec - fi +done ${INSTALLROOT}/lib/probe/C generated +make ${INSTALLROOT}/lib/probe/C/probe +prev ${INSTALLROOT}/lib/probe/C +prev C+probe +exec - test '' = 'C+probe' || ${STDCMP} 2>/dev/null -s C+probe ${INSTALLROOT}/lib/probe/C/probe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/probe ${INSTALLROOT}/lib/probe/C/probe.old 2>/dev/null || true; ${STDCP} C+probe ${INSTALLROOT}/lib/probe/C/probe ;} +done ${INSTALLROOT}/lib/probe/C/probe generated +make ${INSTALLROOT}/lib/probe/C/make +exec - if silent test ! -d ${INSTALLROOT}/lib/probe/C/make +exec - then mkdir -p ${INSTALLROOT}/lib/probe/C/make +exec - fi +done ${INSTALLROOT}/lib/probe/C/make generated +prev ${INSTALLROOT}/lib/probe/C/make +make ${INSTALLROOT}/lib/probe/C/pp +exec - if silent test ! -d ${INSTALLROOT}/lib/probe/C/pp +exec - then mkdir -p ${INSTALLROOT}/lib/probe/C/pp +exec - fi +done ${INSTALLROOT}/lib/probe/C/pp generated +prev ${INSTALLROOT}/lib/probe/C/pp +make ${INSTALLROOT}/lib/probe/C/mam +exec - if silent test ! -d ${INSTALLROOT}/lib/probe/C/mam +exec - then mkdir -p ${INSTALLROOT}/lib/probe/C/mam +exec - fi +done ${INSTALLROOT}/lib/probe/C/mam generated +make ${INSTALLROOT}/lib/probe/C/mam/probe +prev ${INSTALLROOT}/lib/probe/C/mam +prev mprobe +exec - test '' = 'mprobe' || ${STDCMP} 2>/dev/null -s mprobe ${INSTALLROOT}/lib/probe/C/mam/probe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/mam/probe ${INSTALLROOT}/lib/probe/C/mam/probe.old 2>/dev/null || true; ${STDCP} mprobe ${INSTALLROOT}/lib/probe/C/mam/probe ;} +done ${INSTALLROOT}/lib/probe/C/mam/probe generated +make ${INSTALLROOT}/lib/probe/C/mam/mprobe +prev mprobe +exec - test '' = 'mprobe' || ${STDCMP} 2>/dev/null -s mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/mam/mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe.old 2>/dev/null || true; ${STDCP} mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe ;} +done ${INSTALLROOT}/lib/probe/C/mam/mprobe generated +make ${INSTALLROOT}/lib/probe/C/make/probe +prev probe +exec - test '' = 'probe' || ${STDCMP} 2>/dev/null -s probe ${INSTALLROOT}/lib/probe/C/make/probe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/make/probe ${INSTALLROOT}/lib/probe/C/make/probe.old 2>/dev/null || true; ${STDCP} probe ${INSTALLROOT}/lib/probe/C/make/probe ;} +done ${INSTALLROOT}/lib/probe/C/make/probe generated +make ${INSTALLROOT}/lib/probe/C/make/probe.ini +make probe.ini +make probe.win32 +done probe.win32 +exec - t=${mam_cc_HOSTTYPE} +exec - ifs=$IFS +exec - IFS=. +exec - set x $t +exec - IFS=$ifs +exec - t=$2 +exec - set x probe.win32 +exec - while : +exec - do shift +exec - case $# in +exec - 0) break ;; +exec - esac +exec - case $1 in +exec - *probe.$t) +exec - break +exec - esac +exec - done +exec - case $1 in +exec - ?*) cmp -s $1 probe.ini || cp $1 probe.ini ;; +exec - *) : > probe.ini +exec - esac +done probe.ini generated +exec - test '' = 'probe.ini' || ${STDCMP} 2>/dev/null -s probe.ini ${INSTALLROOT}/lib/probe/C/make/probe.ini || { ${STDMV} ${INSTALLROOT}/lib/probe/C/make/probe.ini ${INSTALLROOT}/lib/probe/C/make/probe.ini.old 2>/dev/null || true; ${STDCP} probe.ini ${INSTALLROOT}/lib/probe/C/make/probe.ini ;} +done ${INSTALLROOT}/lib/probe/C/make/probe.ini generated +make ${INSTALLROOT}/include +exec - if silent test ! -d ${INSTALLROOT}/include +exec - then mkdir -p ${INSTALLROOT}/include +exec - fi +done ${INSTALLROOT}/include generated +make ${INSTALLROOT}/include/prototyped.h +prev ${INSTALLROOT}/include +make prototyped.h +prev ${INSTALLROOT}/bin/proto +exec - proto -f /dev/null > h.${COTEMP}.h +exec - if cmp 2>/dev/null -s h.${COTEMP}.h prototyped.h +exec - then rm -f h.${COTEMP}.h +exec - else mv h.${COTEMP}.h prototyped.h +exec - fi +done prototyped.h generated +exec - test '' = 'prototyped.h' || ${STDCMP} 2>/dev/null -s prototyped.h ${INSTALLROOT}/include/prototyped.h || { ${STDMV} ${INSTALLROOT}/include/prototyped.h ${INSTALLROOT}/include/prototyped.h.old 2>/dev/null || true; ${STDCP} prototyped.h ${INSTALLROOT}/include/prototyped.h ;} +done ${INSTALLROOT}/include/prototyped.h generated +make ${INSTALLROOT}/lib/lib +exec - if silent test ! -d ${INSTALLROOT}/lib/lib +exec - then mkdir -p ${INSTALLROOT}/lib/lib +exec - fi +done ${INSTALLROOT}/lib/lib generated +make ${INSTALLROOT}/lib/lib/dl +prev ${INSTALLROOT}/lib/lib +make dl.req +make dl.c +done dl.c +exec - set - +exec - r='-' +exec - for i in dl.c +exec - do if ${CC} -c $i > /dev/null +exec - then g= +exec - for p in dl - +exec - do case $p in +exec - -) if ${CC} -o dl.exe $i $g > /dev/null 2>&1 +exec - then ${CC} -o dl.exe $i > /dev/null 2>&1 || { +exec - r="$g" +exec - break 2 +exec - } +exec - fi +exec - g= +exec - ;; +exec - *) g="$g -l$p" +exec - ;; +exec - esac +exec - done +exec - fi +exec - done 2>/dev/null +exec - echo " $r" > dl.req +exec - rm -f dl.exe dl +done dl.req generated +exec - test '' = 'dl.req' || ${STDCMP} 2>/dev/null -s dl.req ${INSTALLROOT}/lib/lib/dl || { ${STDMV} ${INSTALLROOT}/lib/lib/dl ${INSTALLROOT}/lib/lib/dl.old 2>/dev/null || true; ${STDCP} dl.req ${INSTALLROOT}/lib/lib/dl ;} +done ${INSTALLROOT}/lib/lib/dl generated +make ${INSTALLROOT}/lib/lib/iconv +make iconv.req +make iconv.c +done iconv.c +exec - set - +exec - r='-' +exec - for i in iconv.c +exec - do if ${CC} -c $i > /dev/null +exec - then g= +exec - for p in iconv - +exec - do case $p in +exec - -) if ${CC} -o iconv.exe $i $g > /dev/null 2>&1 +exec - then ${CC} -o iconv.exe $i > /dev/null 2>&1 || { +exec - r="$g" +exec - break 2 +exec - } +exec - fi +exec - g= +exec - ;; +exec - *) g="$g -l$p" +exec - ;; +exec - esac +exec - done +exec - fi +exec - done 2>/dev/null +exec - echo " $r" > iconv.req +exec - rm -f iconv.exe iconv +done iconv.req generated +exec - test '' = 'iconv.req' || ${STDCMP} 2>/dev/null -s iconv.req ${INSTALLROOT}/lib/lib/iconv || { ${STDMV} ${INSTALLROOT}/lib/lib/iconv ${INSTALLROOT}/lib/lib/iconv.old 2>/dev/null || true; ${STDCP} iconv.req ${INSTALLROOT}/lib/lib/iconv ;} +done ${INSTALLROOT}/lib/lib/iconv generated +make ${INSTALLROOT}/lib/lib/w +make w.req +make w.c +done w.c +make w2.c +done w2.c +exec - set - +exec - r='-' +exec - for i in w.c w2.c +exec - do if ${CC} -c $i > /dev/null +exec - then g= +exec - for p in w - +exec - do case $p in +exec - -) if ${CC} -o w.exe $i $g > /dev/null 2>&1 +exec - then ${CC} -o w.exe $i > /dev/null 2>&1 || { +exec - r="$g" +exec - break 2 +exec - } +exec - fi +exec - g= +exec - ;; +exec - *) g="$g -l$p" +exec - ;; +exec - esac +exec - done +exec - fi +exec - done 2>/dev/null +exec - echo " $r" > w.req +exec - rm -f w.exe w w2 +done w.req generated +exec - test '' = 'w.req' || ${STDCMP} 2>/dev/null -s w.req ${INSTALLROOT}/lib/lib/w || { ${STDMV} ${INSTALLROOT}/lib/lib/w ${INSTALLROOT}/lib/lib/w.old 2>/dev/null || true; ${STDCP} w.req ${INSTALLROOT}/lib/lib/w ;} +done ${INSTALLROOT}/lib/lib/w generated +make ${INSTALLROOT}/lib/lib/intl +make intl.req +make intl.c +done intl.c +exec - set - +exec - r='-' +exec - for i in intl.c +exec - do if ${CC} -c $i > /dev/null +exec - then g= +exec - for p in intl - +exec - do case $p in +exec - -) if ${CC} -o intl.exe $i $g > /dev/null 2>&1 +exec - then ${CC} -o intl.exe $i > /dev/null 2>&1 || { +exec - r="$g" +exec - break 2 +exec - } +exec - fi +exec - g= +exec - ;; +exec - *) g="$g -l$p" +exec - ;; +exec - esac +exec - done +exec - fi +exec - done 2>/dev/null +exec - echo " $r" > intl.req +exec - rm -f intl.exe intl +done intl.req generated +exec - test '' = 'intl.req' || ${STDCMP} 2>/dev/null -s intl.req ${INSTALLROOT}/lib/lib/intl || { ${STDMV} ${INSTALLROOT}/lib/lib/intl ${INSTALLROOT}/lib/lib/intl.old 2>/dev/null || true; ${STDCP} intl.req ${INSTALLROOT}/lib/lib/intl ;} +done ${INSTALLROOT}/lib/lib/intl generated +make ${INSTALLROOT}/lib/lib/m +make m.req +make m.c +done m.c +make m2.c +done m2.c +make m3.c +done m3.c +make m4.c +done m4.c +make m5.c +done m5.c +make m6.c +done m6.c +exec - set - +exec - r='-' +exec - for i in m.c m2.c m3.c m4.c m5.c m6.c +exec - do if ${CC} -c $i > /dev/null +exec - then g= +exec - for p in m - +exec - do case $p in +exec - -) if ${CC} -o m.exe $i $g > /dev/null 2>&1 +exec - then ${CC} -o m.exe $i > /dev/null 2>&1 || { +exec - r="$g" +exec - break 2 +exec - } +exec - fi +exec - g= +exec - ;; +exec - *) g="$g -l$p" +exec - ;; +exec - esac +exec - done +exec - fi +exec - done 2>/dev/null +exec - echo " $r" > m.req +exec - rm -f m.exe m m2 m3 m4 m5 m6 +done m.req generated +exec - test '' = 'm.req' || ${STDCMP} 2>/dev/null -s m.req ${INSTALLROOT}/lib/lib/m || { ${STDMV} ${INSTALLROOT}/lib/lib/m ${INSTALLROOT}/lib/lib/m.old 2>/dev/null || true; ${STDCP} m.req ${INSTALLROOT}/lib/lib/m ;} +done ${INSTALLROOT}/lib/lib/m generated +make ${INSTALLROOT}/lib/lib/nsl +make nsl.req +make nsl.c +done nsl.c +exec - set - +exec - r='-' +exec - for i in nsl.c +exec - do if ${CC} -c $i > /dev/null +exec - then g= +exec - for p in nsl - +exec - do case $p in +exec - -) if ${CC} -o nsl.exe $i $g > /dev/null 2>&1 +exec - then ${CC} -o nsl.exe $i > /dev/null 2>&1 || { +exec - r="$g" +exec - break 2 +exec - } +exec - fi +exec - g= +exec - ;; +exec - *) g="$g -l$p" +exec - ;; +exec - esac +exec - done +exec - fi +exec - done 2>/dev/null +exec - echo " $r" > nsl.req +exec - rm -f nsl.exe nsl +done nsl.req generated +exec - test '' = 'nsl.req' || ${STDCMP} 2>/dev/null -s nsl.req ${INSTALLROOT}/lib/lib/nsl || { ${STDMV} ${INSTALLROOT}/lib/lib/nsl ${INSTALLROOT}/lib/lib/nsl.old 2>/dev/null || true; ${STDCP} nsl.req ${INSTALLROOT}/lib/lib/nsl ;} +done ${INSTALLROOT}/lib/lib/nsl generated +make ${INSTALLROOT}/lib/lib/socket +make socket.req +make socket.c +done socket.c +prev nsl.c +exec - set - +exec - r='-' +exec - for i in socket.c nsl.c +exec - do if ${CC} -c $i > /dev/null +exec - then g= +exec - for p in socket - +exec - do case $p in +exec - -) if ${CC} -o socket.exe $i $g > /dev/null 2>&1 +exec - then ${CC} -o socket.exe $i > /dev/null 2>&1 || { +exec - r="$g" +exec - break 2 +exec - } +exec - fi +exec - g= +exec - ;; +exec - *) g="$g -l$p" +exec - ;; +exec - esac +exec - done +exec - fi +exec - done 2>/dev/null +exec - echo " $r" > socket.req +exec - rm -f socket.exe socket nsl +done socket.req generated +exec - test '' = 'socket.req' || ${STDCMP} 2>/dev/null -s socket.req ${INSTALLROOT}/lib/lib/socket || { ${STDMV} ${INSTALLROOT}/lib/lib/socket ${INSTALLROOT}/lib/lib/socket.old 2>/dev/null || true; ${STDCP} socket.req ${INSTALLROOT}/lib/lib/socket ;} +done ${INSTALLROOT}/lib/lib/socket generated +make ${INSTALLROOT}/lib/lib/dbm +make dbm.req +make db.c +done db.c +make gdbm.c +done gdbm.c +make gdbm1.c +make gdbm-ndbm.h implicit +done gdbm-ndbm.h dontcare virtual +done gdbm1.c +make gdbm2.c +make ndbm.h implicit +done ndbm.h dontcare virtual +done gdbm2.c +exec - set - +exec - r='-' +exec - for i in db.c gdbm.c gdbm1.c gdbm2.c +exec - do if ${CC} -c $i > /dev/null +exec - then g= +exec - for p in db - gdbm_compat - gdbm - ndbm - dbm - +exec - do case $p in +exec - -) if ${CC} -o dbm.exe $i $g > /dev/null 2>&1 +exec - then ${CC} -o dbm.exe $i > /dev/null 2>&1 || { +exec - r="$g" +exec - break 2 +exec - } +exec - fi +exec - g= +exec - ;; +exec - *) g="$g -l$p" +exec - ;; +exec - esac +exec - done +exec - fi +exec - done 2>/dev/null +exec - echo " $r" > dbm.req +exec - rm -f dbm.exe db gdbm gdbm1 gdbm2 +done dbm.req generated +exec - test '' = 'dbm.req' || ${STDCMP} 2>/dev/null -s dbm.req ${INSTALLROOT}/lib/lib/dbm || { ${STDMV} ${INSTALLROOT}/lib/lib/dbm ${INSTALLROOT}/lib/lib/dbm.old 2>/dev/null || true; ${STDCP} dbm.req ${INSTALLROOT}/lib/lib/dbm ;} +done ${INSTALLROOT}/lib/lib/dbm generated +done install virtual +make test +make test.iffe +prev iffe +make iffe.tst +done iffe.tst +exec - regress iffe.tst iffe +done test.iffe virtual +make test.mamake +prev mamake +make mamake.tst +meta mamake.tst %.rt>%.tst mamake.rt mamake +make mamake.rt +done mamake.rt +exec - if [[ "1" || "mamake.rt" -nt "mamake.tst" ]] +exec - then mktest --style=regress mamake.rt > mamake.tst +exec - fi +done mamake.tst generated +exec - regress mamake.tst mamake +done test.mamake virtual +done test dontcare virtual diff --git a/src/cmd/INIT/PROBE.mk b/src/cmd/INIT/PROBE.mk new file mode 100644 index 0000000..9a8553f --- /dev/null +++ b/src/cmd/INIT/PROBE.mk @@ -0,0 +1,13 @@ +/* + * @(#)probe (AT&T Bell Laboratories) 11/11/91 + * + * :PROBE: *.probe *.sh * + * + * common probe script installation + * generates probe.sh and probe in . + */ + +":PROBE:" : .MAKE .OPERATOR + probe.sh : $(LIBDIR)/probe/$(<:O=1)/probe $(>:N=*.(probe|sh)) + cat $(*) > $(<) + $(LIBDIR)/probe/$(<:O=1)/$(<:O=2) :INSTALLDIR: probe $(>:N!=*.(probe|sh)) diff --git a/src/cmd/INIT/RELEASE b/src/cmd/INIT/RELEASE new file mode 100644 index 0000000..ebed09f --- /dev/null +++ b/src/cmd/INIT/RELEASE @@ -0,0 +1,918 @@ +12-02-29 cc.darwin.i386*: handle default cc vs kernel bittedness +12-02-29 C+probe: add __TIMESTAMP__ to the nopredefined list +12-02-29 package.sh: don't assume grep -q or /usr/local/lib in LD_LIBRARY_PATH +12-02-29 package.sh: fix ksh vs -lcmd compatibility checks +12-02-23 iffe.sh: checkcc() before checkread() for sensible diagnostics +12-02-14 package.mk: { --clobber --compare --link=lib*.a* } for --mam=static +12-02-14 package.mk: export LICENSEFILEDEFAULT instead of LICENSEFILE +12-02-14 package.sh: handle @(cc|ld).${HOSTTYPE}* intercepts +12-02-07 package.sh: add { clean clobber } actions +12-02-02 regress.sh: fix ulimit -c defaults for --nokeep +12-01-18 regress.sh: add INPUT|OUTPUT|ERROR -e 'filter' to filter before comparison +12-01-21 package.sh: fix `admin make' bug that created unused $INSTALLROOT/lib +12-01-21 Makefile: :PACKAGE: license=ast -- oops +12-01-20 cc.darwin,cc.mvs.390: tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err +12-01-12 package.sh: add admin make share closure to handle alternate HOSTTYPEs +11-12-13 iffe.sh: add /**/ test code comment to disable default #include +11-11-11 C+probe: test for .so before .sl +11-10-26 package.sh: don't forget about *.pkg for admin update +11-10-18 cc.*-icc: update and add more +11-10-11 package.sh: handle package make|view when no source installed +11-09-11 package.sh: count admin '*** termination code' errors +11-08-31 mamake.c: add -e, ignore use recursive prereq timestamps +11-08-29 iffe.sh: add ``set stdio try1.h - try2.h ...'' +11-08-29 iffe.sh: trap EXIT => trap 0 for ancient sh +11-08-11 iffe.sh: handle ancient sort that doesn't have -k +11-06-01 make.probe: add more /lib64 logic +11-05-01 package.sh: fix admin ditto to sync LICENSES too +11-03-25 package.sh: initialize { $SED $TR } before first use! +11-03-21 package.sh: fix vpath probes +11-03-17 iffe.sh: fix cleanup to rm $tmp* instead of $tmp*.* +11-02-24 package.sh: change curl usage to "curl -L ..." +11-02-11 package.sh,C+probe,make.probe,mamprobe.sh: add ###.*archiac.*### +11-02-02 Makefile: add :MAPLIB: check for ancient -lw +11-02-02 make.probe: handle -print-multi-directory => 64 => /usr/lib64 /lib64 +11-02-02 package.sh: HOSTTYPE=*,*cc*[,-*,...] sets CC [ and CCFLAGS ] +11-02-02 make.probe: handle gcc $ORIGIN link but exec failure -- gee thanks +11-01-25 cc.hp.ia64: bundled cc is a pile of shaving cream +11-01-07 iffe.sh: check debug==3 for is_hdr() failure +10-11-22 ditto.sh: fix timing problem between |& and exec &p +10-11-10 package.sh: fix cc cross compile check to use checkcc absolute path +10-10-10 package.sh: list main env vars at start of make action +10-10-10 ratz.c: tweak widnows delays +10-09-10 ratz.c: add _SEAR_ARGS for _SEAR_EXEC +10-09-01 package.sh: fix ratz from source logic +10-08-25 package.mk: consolidate license file search in .package.licenses. +10-08-22 ratz.c: run sear bootstrap command detached +10-08-20 C+probe: version_stamp only if version_flags works +10-08-17 package.sh: unset makerules *DIR variables in env +10-08-15 package.sh: "make" action now lists some env values +10-08-11 mktest.sh: add "DO command ..." +10-07-27 rt.sh: handle "rt X=Y ..." +10-06-29 ratz.c: non-option sear args passed to sear_exec() +10-06-25 iffe.sh: "api" op chanegd to not do "map-libc" type mappings +10-06-25 package.sh: "force admin ditto" => no ditto --update option +10-06-22 C+probe: handle cc that require .[ci] input for version info +10-06-21 ditto.sh: change default remote access to ssh (about time) +10-06-12 regress.sh: DISGNOSTICS [ 1 | 0 | pattern ] and fix EXIT for all +10-06-09 package.sh: add AT&T to usable nmake check +10-06-06 iffe.sh,iffe.tst: add { api ver } ops +10-04-22 package.sh: update "html binary|source" NAME/PASSWORD info +10-04-15 iffe.sh: don't forget candidate headers for hdr|sys! +10-04-11 WWW.mk: disable man page metarule -- now done by admin-man(1) +10-02-14 package.sh: $CC verification needs $INSTALLROOT/bin in PATH +10-02-11 package.sh: fix package admin make report error count +10-02-02 package.sh: fix write binary bug that did scp on local fs +10-02-02 package.mk: up to date binary targets must still be in PACKAGE.*.lst +10-01-01 package.sh: fix premature $INSTALLROOT/bin during cross compile check +10-01-01 make.probe: handle ['"] in CC.VERSION.STRING +09-12-04 iffe.sh: add "opt name" to check for name in $PACKAGE_OPTIONS +09-11-30 mktest.sh: change RESET to STATE.RESET to make it global +09-11-14 make.probe: use gcc { -print-multi-directory -print-search-dirs } +09-11-11 package.sh: re-order and combine cc checks +09-10-27 C+probe,make.probe,probe.win32: add CC.SUFFIX.DEBUG +09-10-21 iffe.sh,Makefile: test -e is not in ksh88! +09-10-06 iffe.sh: handle cc -E #error with 0 exit status (sgi) +09-10-06 package.sh: stub in ar intercept checks -- not used yet +09-10-06 ar.ibm.risc: add ar intercept because some aix require -Xfoo first!! +09-09-24 regress.sh: fix UMASK logic to create test support files before umask +09-08-28 release.c: change docs to mention stdin if no file operands +09-08-24 package.sh: fix isascii() bug that failed on od(1) trailing space +09-08-20 make.probe: add CC.SHARED.NAME +09-08-20 regress.sh: add { JOB CONTINUE EXITED KILL FIFO } +09-08-11 package.sh: filter lines containing : for package results +09-07-31 make.probe: add CC.AR.ARFLAGS (for aix ar -xany) +09-07-31 package.sh,cc.*: fix -dumpmachine to handle 32/64/* bit options +09-06-24 package.sh: fix admin.db output formatting +09-05-05 package.sh: export dll hackery environment vars +09-05-05 package.sh: handle non-identifier hostnames +09-05-05 mamake.c: pass undefined ${...} identifiers to the shell +09-05-05 mamake.rt: add macro expansion regression tests +09-05-01 iffe.sh: fix output initialization *again* +09-04-28 package.sh: handle admin.db contact field $9 +09-04-15 iffe.sh: add implicit "ini" op to initialize io for subsequent ops +09-03-31 regress.sh: EXPORT before test => global ENVIRON[] +09-03-26 package.sh: test fail pattern is 'fail[es]' +09-03-26 UNIT - ... appends (options) to command line +09-03-19 TEST.mk: x.tst => x only if x is command target +09-03-15 regress.sh: add ${MAIN} for base name of main unit +09-03-10 TEST.mk: add .SOURCE:tests if tests is a dir +09-03-03 regress.sh: allow command line unit to override UNIT +09-03-03 mktest.sh: handle IO == $'\n' +09-02-02 package.sh: delay $INSTALLROOT/bin/.paths generation until mamprobe runs +09-01-30 cc.mvs.390: c89 balks at [ ()] in -Dname="..."! +09-01-27 package.sh: add isascii() to use ratz instead of tar +09-01-20 hurl.sh: add --size=bytes option +09-01-08 TEST.mk: add test.* prereqs, multiple arg lists with :T=*: binding +09-01-03 regress.sh: fix UNIT to allow command line override +09-01-03 mktest.sh: handle TWD +08-12-24 package.sh: fix cross-compile HOSTTYPE logic +08-12-15 package.sh,hurl.sh: handle http codes { 301 302 303 } +08-10-16 make.probe '-fno-stack-protector -fno-stack-protector-all' to cop out!! +08-09-30 rt.sh: fix ksh93 regression test signal count +08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input +08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo +08-09-20 make.probe: handle another /usr/bin/file shared lib description +08-09-20 regress.sh: add --pipefail for SET pipe-input ... +08-09-17 Makefile: add gdbm1.c for +08-09-10 make.probe: add CC.NOPROTECT +08-08-08 mktest.sh: add --width=width +08-08-05 dbm.req: favor sleepycat ndbm compatibility +08-08-04 C+probe: fix stdlib initialization logic +08-06-24 package.sh: fix $INSTALLROOT/bin/cc intercept time stamp file typo +08-06-20 TEST.mk: make the localyunit before *.rt => *.tst -- doh +08-06-20 mktest.sh: prepend $PWD onto PATH for local units -- doh^2 +08-06-11 regress.sh: fix bug that skipped the last test +08-05-20 regress.sh: add --local to put *.tmp dir in local fs +08-05-05 regress.sh: add IF command ... ELIF command ... ELSE ... FI +08-05-01 package.sh: package test => ulimit -c 0 +08-04-28 regress.sh: fix EXPORT quoting +08-04-28 regress.sh: fix UNIT set check args too +08-04-24 rt.sh: exit code > 256 => signal termination +08-04-10 C+probe: change probe_so order to check .so last (macos ld workaround) +08-04-01 package.sh: handle multiple admin HOSTTYPEs per HOST +08-03-28 C+probe: add C++ #include (no extension) dir probes +08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally +08-02-28 make.probe: fix probe_warn to include ld! +08-02-02 make.probe: add CC.RUNPATH to match default -L order +08-01-31 package.sh: check lib64 for LD_LIBRARY_PATH +08-01-31 iffe.sh: tweak ancient /bin/sh workarounds +08-01-28 make.probe: darwin ld export dynamic is -force_flat_namespace +08-01-28 C+probe: handle sgi cc error message but exit 0 botch(es) +08-01-23 package.sh: fix checksum doc typo +08-01-09 C+probe: add __FUNCTION__ to the undef (don't check) list +07-12-14 iffe.sh: add set nooptimize +07-12-03 package.sh: add LC_ALL=C +07-11-27 package.sh: fix overaggressive *.md5 cleanup +07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal +07-11-05 package.sh: fix write op error count pattern +07-11-05 package.mk: fix $(~req) .ver binding +07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING] +07-08-01 package.sh: handle 'package read lcl|tgz' +07-05-08 regress.sh: execute basename instead of absolute path for short $0 +07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer +07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh +07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...} +07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG +07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe +07-03-28 package.sh: fix binary tgz architecture type duplication +07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst +07-03-28 iffe.sh: add -F header to mac test +07-03-23 make.probe: handle file(1) that returns 'archive' for .so +07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF +07-03-11 package.sh: add nocopyright and tst => nocopyright +07-03-11 package.mk: add copyright=0 +07-03-08 C+probe: restore IFS after probe.ini +07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR} +07-01-05 package.sh: fix "admin write binary" logic +07-01-01 iffe.sh: add "cmd" --verbose trace +07-01-01 iffe.sh: sort => LC_ALL=C sort +07-01-01 C+probe: LC_ALL=C +06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local! +06-11-23 package.sh: *.md5 are not tarballs -- doh +06-11-23 iffe.sh: add -F, --features=feature-test-header +06-11-11 make.probe: favor lib64 over lib for hosttype==*64 +06-10-31 make.probe: add "-ignore-source-dir -iquote" test +06-10-31 iffe.sh: add status{...} code block +06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?) +06-10-11 package.sh: handle already gunzip'd *.tgz +06-10-06 iffe.sh: add reference for header content tests +06-09-27 regress.sh: fix UMASK to do DO too (duh) +06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics) +06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together +06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too +06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io +06-09-05 C+probe: add { probe_version version_stamp version_string } +06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING] +06-08-27 regress.sh,mktest.sh: add UMASK +06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE +06-08-25 mktest.sh: add IGNORESPACE +06-08-24 mktest.sh: handle \000 in data +06-08-24 regress.sh: handle -f* for INPUT|OUTPUT|ERROR +06-08-16 package.sh: fix 'install flat' logic +06-08-11 rt.sh: handle style=shell %K date format +06-07-17 ratz.c: fix __MVS__ FAR definition +06-07-17 iffe.sh: "header x.h" -- deprecate "include x.h" for .SCAN.iffe +06-07-17 package.sh: differentiate urls vs. assignments +06-06-27 rt.sh: add --failed, --heading +06-06-27 C+probe,TEST.mk,make.probe,mktest.sh,regress.sh: 'ulimit -c 0' +06-06-26 cc.darwin.ppc: handle -lcc_dynamic disappearance +06-06-25 mktest.sh: implement PROG +06-06-11 Makefile: add -ldbm :MAPLIB:, provide public MAPLIB.mk +06-05-06 package.sh: add PACKAGE_admin_tail_timeout +06-05-22 ratz.c: upgrade to zlib-1.2.3 +06-05-09 package.sh: fix admin.db docs +06-03-11 package.sh: fix `package use - command ...' +06-03-05 make.probe: work around pedantic bash 3.1 mismatched " in `.` +06-02-14 package.sh: "results failed test" == "results test failed" + cc.sgi.*: add _AST_cc_OPTIONS parameterization, -OPT:Olimit=0 + cc.linux.ia64-icc: add for intel cc +06-02-02 package.sh: freebsd stuck with os version for all arch +06-02-01 package.mk: fix locale logic (tw -d requires dir arg) +06-01-31 package.sh: require $CC only for make|test +06-01-30 package.sh,hurl.sh: use the backwards-compatible --http-passwd + package.sh: add more pdksh => /bin/sh checks +06-01-26 package.sh: wget --http-pass => --http-password + package.sh: fix wget error logic + hurl.sh: wget --http-pass => --http-password +06-01-11 package.mk: pass package.license.class to make --mam too + package.mk: variants=pattern => --variants=pattern + package.sh: darwin rel<=7 => darwin7.ppc + package.sh: freebsd rel<=4 => freebsd4 + package.sh: freebsd rel<=5 => freebsd5 +05-12-07 iffe.sh: don't emit if | (XXX) +05-12-05 make.probe: disable readonly.exe core dump via ulimit -c 0 +05-09-22 mktest.sh: add EXEC [ ++NOOUTPUT ++NOERROR ++NOEXIT ] +05-09-21 mktest.sh: fix --style=shell compare to ignore \r +05-09-12 TEST.mk: all --force to force %.rt regeneration +05-09-05 TEST.mk: regenerate from %.rt only if newer, :SAVE: %.tst +05-08-25 mktest.sh: add + TEST.mk: add %.rt=>%.tst for mktest +05-08-18 package.sh: 'package host cpu' now checks $NPROC first +05-07-17 iffe.sh: add { define extern include print } ops + iffe.sh: accept output{...}end output on success only -- doh +05-07-01 package.sh: add TARPROBE for tar B flag probe +05-06-24 package.sh: fix binary read chmod via *.sum +05-06-06 package.sh: fix KEEP_HOSTTYPE logic to handle synthesized types +05-06-01 make.probe: verify that cc_pic works for hosted cc + cc.lynxos.ppc: make -mshared the default + package.sh: note $INSTALLROOT/bin/@(cc|ld|ldd) installation +05-05-25 make.probe: add CC.INCLUDE.LOCAL instead of -I- in CC.DIALECT +05-05-24 iffe.sh: really fix grouping logic -- with tests this time + package.sh: pipe/socket configuration mismatches => use /bin/sh +05-04-28 TEST.mk: add $(TESTS) +05-04-19 package.sh: package results test uses rt if possible + iffe.sh: fix 'op var - ... - ...' grouping logic +05-04-15 rt.sh: handle autom4ate style +05-04-11 regress.sh: fix unit name when command line unit also specified + rt.sh: handle all ast package test output formats + package.sh: fix make docs for options passed to underlying make +05-04-08 package.sh: cp -p makerules.mo to $OK to preserve mtime + regress.sh: add "TITLE name" to change TEST output title +05-04-01 rt.sh: add pretty make test + regress.sh wrapper +05-03-29 package.sh: test -e path => test -f path -o -d path +05-03-24 make.probe: fix CC.PICBIG probe to prefer -fPIC over -fpic -- doh +05-03-19 mamake.c: command line name=var also defines name.FORCE=var +05-03-11 regress.sh: unset LC_ALL when LC_* EXPORT'd + package.sh: old make.out saved in circular make.out.[1-9] + mamake.c: sync with nmake :W=O: +05-03-01 package.sh: fix flat hierarchy initialization + package.sh: admin action now properly resets sibling remote logs + package.mk: relax unknown/unwritten package messages to warnings + package.sh: handle space in command line name=value + make.probe: add mvs -Wc,dll,exportall,longname,rent to CC.DLL probe +05-02-24 package.sh: hosttype *.powerpc => *.ppc + cc.lynxos.ppc,ldd.lynxos.ppc: add +05-02-22 mamake.c: fix { -G --debug-symbols -S --strip-symbols } MAMAKEFLAGS bug +05-02-20 probe.win32: handle /platformsdk mount +05-02-19 package.sh,package.mk: add write tst for tgz in tst subdir +05-02-18 package.sh: accept cc -dumpmachine with 0 or 1 - +05-02-14 package.sh: handle mutiple architectures per host in admin.db + Makefile,package.sh: honor $INSTALLROOT/bin/.paths overrides + package.sh: normalize trailing [-_]bits in host type + iffe.sh: some ksh-compatible shells don't do *(pattern) +05-02-11 iffe.sh: back out 05-01-11 child process stdin hijack + cc.lynxos.i386: -dynamic instead of -static default +05-02-10 package.sh: cyg usr/doc => usr/share/doc +05-02-08 package.sh: drop -m with pax -- delta bug fixed 2005-02-08 + iffe.sh: work around old bash 0<... redirection bug +05-02-06 package.mk: source.tgz: update generated files only when they change +05-02-02 *.sh,*probe: IFS may be unset and { ash bsh } don't on startup -- wow +05-01-11 package.sh: update setup docs to include authorize+password + package.mk: fix .source.cyg final directory edit + package.mk: notice=1 for conspicuous empty NOTICE file + WWW.mk: fix *-index.html installation + filter.sh: retain input file suffix in tmp copy + mamexec.c: fix non-contiguous "exec" bug that skipped lines + iffe.sh: fix candidate lib test to try grouping subsequent libs + iffe.sh: fix child process stdin hijack that skipped input lines + iffe.sh: --shell=osh to force read -r compatibility command + iffe.sh: chop iffe input leading space before # for KnR compatibility +05-01-05 package.sh: add ${TAR} ${TARFLAGS} and tar B flag for pipes + mamake.c: fix makefile scan to ignore lib*.[hH] + iffe.sh: immunize function/symbol tests from aggressive -O +04-12-28 WWW.mk: add :WWWPAGE: faq.*.mm index generator +04-12-21 ratz.c: make sure tmp dir is writable -- doh +04-12-08 iffe.sh: fix dat test for aggressive -O +04-12-01 iffe.sh: add `include file' to pull in #define's for `exp' +04-11-11 package.sh: default MAKESKIP is "*[-.]*" +04-10-22 ratz.c: change docs to note zlib license + mamake.c: handle --debug-symbols and --strip-symbols + package.sh: make (debug|strip)=1 => --(debug|strip)-symbols + package.mk: add :LICENSE: => package.license.class + mamake.c: fix recursive order logic +04-10-18 package.mk: add :LICENSE:, :OMIT: to omit package subdirs +04-10-11 package.sh: add 'authorize name' and 'password password' +04-10-01 iffe.sh: double check $static link with ! $static + Makefile: add BUILTIN_LIB to $INSTALLROOT/bin/.paths + make.probe: add CC.DIALECT EXPORT={ALL,REF,EXT,DLL} + package.sh: add BUILTIN_LIB to $INSTALLROOT/bin/.paths +04-09-21 package.mk: $(init)$(name) is now an implicit prereq +04-09-09 package.sh: copy makerules.mo to $INSTALLROOT/bin/ok +04-09-01 package.mk,package.sh: rename *.txt => *.README + package.mk: add the runtime package type (no *.[ah]) + iffe.sh: fix key test reports +04-08-26 Makefile: { add m2.c m3.c } -lm tests for { frexp[l] ldexp[l] } +04-08-11 package.mk: handle HOSTTYPE for solaris > 9 + package.sh: add `checkaout proto' for { make view } + package.sh: check for { md5sum md5 } + iffe.sh: add {if|elif|else|endif} test ... + iffe.sh: add 'exp - expression' and '( expression )' + iffe.sh: add 'name = test ...' user defined macros + iffe.sh: add '! test ...' negation + TEST.mk: add implied { .c .sh } generated prereq + cc.darwin.ppc: handle 10.3 -dylib mess +04-08-01 package.mk: let include handle nested requirements -- duh +04-07-31 package.sh: attempt a second ping before admin assumes host down +04-07-26 package.sh: fix hp.ia64 HOSTTYPE +04-07-23 probe.win32: generalize #include dir order search +04-07-17 regress.sh: add INPUT -x for chmod +x +04-07-01 regress.sh: TMP => TWD +04-06-29 regress.sh: put COMMAND in $TWD too +04-06-21 regress.sh: mkdir -p INPUT and OUTPUT intermediate dirs + TEST.mk: add :TEST: -- to disable .c .sh search +04-06-18 TEST.mk: add .SCAN.tst +04-06-17 regress.sh: TEST returns true if active, false otherwise + regress.sh: add CD to change test pwd from $TWD +04-06-16 regress.sh: add TWD for ./unit.tmp override + regress.sh: DO now flushes previous test + regress.sh: INPUT and OUTPUT handle -f for printf instead of print +04-06-11 package.sh: make sure $INSTALLROOT/bin is in front of $PATH + package.sh: skip nmake if older than 2000-10-31 +04-05-20 package.sh: fix arg vs. package parse with - or '' to disambuguate +04-05-11 package.sh: package verbose update lists closure for package setup + package.sh: add src/lib/libardir to nmake proto bootstrap + regress.sh: probe for rm -u vs. chmod -R u+rwx +04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH +04-04-15 make.probe: check probe_libdir false positives + package.sh: add lib/package/*.lic src package subdirs + package.mk: add mamfile=0 to inhibit Mamfile generation + iffe.sh: config name_DECLARED => HAVE_name_DECL + iffe.sh: fix mac to handle default value +04-04-11 iffe.sh: normalize sed [\\\\/] quoting +04-04-04 package.mk: only checksum generated tarballs + mamprobe.sh: add STDCHMOD +04-04-01 C+probe: set export LANG=C for uniform error messages + make.probe: another CC.STDLIB tweak + package.sh: fix regress core dump pattern, expand [a-z] match ranges +04-03-31 Makefile: add intl :MAPLIB: test + make.probe: fix CC.STDLIB search; drop CC.* path duplicates +04-03-28 iffe.sh: drop unused exec $stdin<&0 dup +04-03-25 Makefile: add iconv :MAPLIB: + package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override +04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz) + package.sh: update base change on md5 sum instead of size + iffe.sh: adjust case label \ and keyword quoting for ancient /bin/sh +04-03-22 probe.win32: ncc => nld +04-03-19 CONVERT.mk: change the instructions and old source dir default + package.mk: fix recurse=list check + package.mk: add *.md5 checksum for each *.(c|exe|tgz) + package.sh: fix update base/delta/sync existence check +04-03-18 iffe.sh: -d2 does not remove core dumps on exit +04-03-17 package.sh: fix make recurse arg/action order +04-02-29 package.sh: add regress action to compare current and previous tests + package.sh: fix sgi.mips[23] HOSTTYPE test for old irix cc + package.sh: add `export variable ...' + package.sh: admin action now handles host name with non-id chars + package.sh: non-numeric M T W in admin.db disables that action + package.sh: fix admin write binary local vs. shared clash + cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable + cc.hp.pa64: sync with cc.hp.pa + cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib + probe.win32: sync with make.probe + make.probe: fix last chance dynamic test + make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E + make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall + make.probe: move probe_dll_def to the end of probe_dll + package.mk: capture subcomponent mamfile recursion +04-02-24 make.probe: strip "..." from cc/ld traces + iffe.sh: add ``set [no]define'' to disable macro #define/#undef +04-02-23 make.probe: rework CC.LD search +04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export + make.probe: resurrect CC.PIC with separate semantics from CC.DLL + make.probe: add CC.SHARED.LD for CC.SHARED linker + C+probe: clear DISPLAY to stifle interactive windows +04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end + make.probe: add { CC.AR CC.SIZE }, fix cross command search + cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug +04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++ +04-02-04 package.sh: fix cross compilation bug that mixed binary formats +04-02-02 package.sh: package admin now ditto's bin/package too +04-01-30 cc.sgi.mips3: drop warning 3421 +04-01-11 regress.sh: output label#count for tests in loops +04-01-05 regress.sh: fix bug that ignored the first SAME +04-01-04 crossexec.sh: fix typo that did not recognize rcp +03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse() +03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency +03-09-23 ratz.c: fix tar header number parse bug that skipped to next number + regress.sh: rm cleanup now handles files matching -* +03-09-11 iffe.sh: add unnamed { ... } blocks + regress.sh: add COPY from to, like MOVE but comprison still done + regress.sh: rm -rfu to handle test dirs w/o u+rwx +03-08-14 Makfile: add hello.c to the manifest +03-08-11 package.sh: fix `html binary' generation +03-06-21 package.sh: fix INITROOT initialization bug + package.sh: make sure admin logs exists before tail'ing +03-06-11 probe.win32: fix $(BINDIR) typo that expanded in sh instead of make + cc.mvs.390: return code 4 yields exit code 3 but its *really* ok + package.sh: fix onpath function global var conflict + make.probe: add CC.DIALECT { GNU -dD } + package.mk: add Mamfile to lcl manifest +03-06-10 package.sh: fix setup action typo that only checked the INIT package + package.sh: *.s390x => *.s390-64 +03-06-09 package.mk: add cyg :POSTINSTALL: +03-06-08 make.probe: fix CC.STDLIB logic + hurl.sh: add User-Agent identification + package.sh: tweak source and binary installation instructions + cc.hp.pa,ld.hp.pa: +-Wl,+cdp,${INSTALLROOT}/lib/: drops abs lib paths + ldd.hp.pa: add +03-06-06 package.sh: fix $INSTALLROOT/bin/ldd check + make.probe: add CC.STDLIB verification +03-06-04 make.probe: add +forceread +noforceread +03-05-11 hurl.sh: handle http://host:port/path +03-05-06 package.sh: fix setup action PACKAGEROOT and INIT logic +03-05-05 package.mk: fix cygwin tarball names +03-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile +03-04-27 make.probe: fix mvs CC.PREFIX.SHARED "lib" => "" + make.probe: add CC.DLL.DIR = $(BINDIR) or $(LIBDIR) + make.probe: add { CC.LD.LAZY CC.LD.NOLAZY CC.LD.RECORD CC.LD.NORECORD } + probe.win32: sync with latest CC.* +03-04-25 mamprobe.sh: add args to `. $makeprobe' for ancient sh +03-04-23 package.mk: fix dup "covered by" licenses +03-04-22 probe.win32: CC.DIALECT += "LIBPP -I-" for all cc's + package.sh: fix admin write binary tarball snarf +03-04-21 package.mk: package covered *.@(pkg|lic) too +03-04-15 package.mk: don't generate incremental archives for lcl + package.mk: add incremental=[source:1 binary:0] archive control + package.sh: generate $INSTALLROOT/bin/cc wrapper for CC != cc + package.sh: admin must ditto lib/package/*.@(pkg|lic) too + mamake.c: ignore time of ignore prereqs + mamake.c: -D2 lists propagated times +03-04-11 package.mk: tidy up cyg tarballs + package.sh: fix old shell clash between get() and $get +03-04-05 package.mk: restore *.inx generation somehow lost during cyg additions + package.sh: add pthread_num_processors_np() last resort for cpu count + package.sh: use `make believe' to accept mamake generated files + package.sh: handle `make [make-flags] [target ...]' + mamake.c: ignore -e +03-03-21 package.mk: fix cyg old make typo + package.sh: switch to `package setup' instructions +03-03-19 package.sh: add registry checks for `host cpu' + package.sh: `results failed' now lists core dump messages +03-03-17 package.sh: on cygwin verify 'ntsec binmode' in $CYGWIN or die + Makefile: install gcc wrapper if no cc + package.mk: add :DETAILS: { :README: :EXPORT: :INSTALL: :TEST: } ops +03-03-12 package.mk: add :DETAILS: for style-specific details +03-03-11 package.sh: add beta setup/update support + TEST.mk: add (TESTCC) prereq for .sh tests +03-03-07 hurl.sh: add +03-03-06 iffe.sh: fix lib win32 test cygwin vs native incompatibility + iffe.sh: change internal stdio.h guard to handle C++ inline vs. macro +03-03-03 package.sh: check for curl or wget for update + package.sh: add setup action == update read make + package.sh: fix packageroot() typo that showed up in non ~user shells + mamake.c: treat name+=value args like name=value + mamake.c: add ${var?*|value?match?no-match?} + mamake.c: fix archive vs. dynamic bind logic +03-02-28 package.sh: add the "cyg" (cygwin) package type + package.mk: add "cyg" stubs, :CATEGORY: for category name(s) +03-02-25 mamake.c: add -D4 system(3) debug trace +03-02-24 package.mk: change --mismatch to --corrupt=accept +03-02-14 ratz.c: add _WIN32 setmode([01],O_BINARY) and fopen "rb"/"wb" +03-02-12 Makefile: handle getconf LIBPATH with host pattern +03-01-31 package.mk: fix .lic search +03-01-30 package.sh: handle { INIT ksh nmake } already installed elsewhere + package.sh: admin handles command outside of $PACKAGEROOT/bin + Makefile: install $(INSTALLROOT)/lib/make/package.mk +03-01-28 package.sh: admin remote commands on one line to please syslog +03-01-23 probe.win32: borland and mingw32 tweaks +03-01-22 package.sh: fix $CC test to ignore set -x trace -- duh +03-01-16 ditto.sh: tw --chop on by default +03-01-14 package.sh: use /bin/cp to copy previous binaries to bin/ok/ + package.sh: admin now initiates remote exec and copy from local host +03-01-12 package.sh: handle admin "xxx:" default root +03-01-03 probe.win32: add /usr/include/borland path truncation workaround +02-12-10 iffe.sh: add <&$nullin >&$nullout to checkread() $cc +02-12-06 probe.win32: fix inlcude => include typo, add lcc lib + probe.win32: CC.MAKE.OPTIONS = nativepp=0 +02-12-04 mamake.c: fix ${foo-bar} to expand foo if defined +02-11-28 probe.win32: add C++ and -I- CC.DIALECT checks +02-11-26 package.sh: package release now checks for second level files +02-11-22 package.sh: update action now uses HTTP/1.0 +02-11-21 probe.win32: update the vc include dir test +02-11-20 make.probe: fix CC.LD.ORIGIN typo that expanded make var +02-11-13 packahe.mk: fix list.install => list.installed typo +02-11-12 make.probe: add CC.LD.ORIGIN for a.out origin dir relative dll search + make.probe: add CC.LD.STRIP for link time a.out strip + package.sh: fix package_use vs. PACKAGE_USE check +02-10-24 WWW.mk: fix bug that required a :WWWBIN: assertion to post +02-10-23 mamake.c: fix unuinitialized time in make() + ratz.c: fix meter buffer overflow +02-10-20 package.sh: fix lib/probe/C/make/probe update test +02-10-18 probe.win32: update for mingw + make.probe: add bash workaround to SHELLMAGIC test + package.sh: work around yet another cygwin hassle +02-10-17 iffe.sh: short circuit id check for *[-+/\\]* +02-10-08 regress.sh: unset FIGNORE to avoid rm . errors + package.sh: unset FIGNORE to avoid rm . errors + package.sh: $CC must at least compile and executable hello world +02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz + package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS) + iffe.sh: add identifier checks for tests that (implicitly) require them + iffe.sh: disambiguate a few --config macros +02-10-02 iffe.sh: fix shell=bsh `hdr a/b' +02-09-30 package.sh: handle chmod of -* files + package.sh: verify that $SHELL is Bourne compatible + package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation + iffe.sh: fix bug that didn't define mac variable on success +02-09-22 package.sh: handle admin_action=ditto + iffe.sh: --config sizeof(foo) macro is SIZEOF_foo + iffe.sh: fix long.long test so it doesn't defeat uwin "typ long.long" + mamprobe.sh: convert $("foo") nmake string constants +02-09-21 mamprobe.sh: "-" info-path writes probe info to stdout +02-09-11 make.probe: move from nmake src to be part of mamprobe.sh + mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end + mamake.c: pass cc absolute path to mamprobe + package.sh: generate mamprobe -- yuk (at least its confined to INIT) + iffe.sh: lcl,nxt: drop default sys/ check + ditto.sh: tw --logical by default; add --physical +02-09-10 package.sh: SHELLMAGIC creeps into package too -- duh and fooey +02-09-09 ditto.sh: test that remote .profile exists before sourcing +02-09-06 package.sh: don't ditto nfs junk + ditto.sh: --show now lists directory ops instead of enumerating all +02-09-05 ditto.sh: add --remote={rsh|ssh} + package.sh: add admin [[{rsh|ssh|-}]:]directory +02-09-02 iffe.sh: change 'print -r --' to 'print -r -' for ksh86 compatibility +02-09-01 cc.unix.mc68k: add for ancient 3b1 +02-08-22 package.sh: fix component() to test for components -- duh + Makefile: add LICENSE:.DONTCARE to workaround mam +02-08-11 iffe.sh: provide defaults for LD_* additions +02-08-07 ratz.c: change -m to use * instead of non-portable inverse video +02-07-17 mamprobe.sh: close tmp file in trap before rm for cygwin + package.sh: fix "type" to handle i1586 (P4) + package.sh: add the view action +02-06-28 package.sh: handle multiple packages for release action +02-06-27 package.sh: catch sol*.sparc=>sol*.sun4 when CC=gcc +02-06-14 package.sh: fix admin_action to not include qualifiers + package.sh: fix help/html doc typo +02-06-11 package.sh: fix ditto update doc to `PACKAGEROOT field matching *:*' +02-06-07 WWW.mk: change substitute $("\n") to \n +02-06-06 package.sh: clarify output streams for help/html +02-05-22 mamake.c: fix executable file check to use (S_IXUSR|S_IXGRP|S_IXOTH) +02-04-04 package.sh: fix update to differentiate *.sun4 and sun4 +02-03-27 package.sh: yacc/bison warning only if both missing +02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems +02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package + package.sh: precheck $CC, not `cc' + package.sh: fix install to use pax -ps to preserve set-uid/gid + package.sh: fix install to use list.installed for existing files only +02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read + package.sh: fix update delta sync fetch +02-02-14 iffe.sh: fix macro{ }end docs to include " + iffe.sh: add dfn to extract #define from headers + iffe.sh: handle nxt #include ok but no line sync + iffe.sh: drop local header clash logic + iffe.sh: add -X, --exclude=dir to exclude -I dirs + iffe.sh: lcl,nxt now generate <...> headers instead of "..." + package.sh: admin.db root dir matching -* disables host + package.mk: fix package.src.pat typo -- too many ) + package.mk: add { :COVERS: :DESCRIPTION: :REQUIRES: } + package.sh: handle { :COVERS: :DESCRIPTION: :REQUIRES: } + Makefile: move proto.c generation to the proto component dir +02-02-02 execrate.sh: add for .exe challenged win32 systems/commands + mamprobe.sh: add STD* commands/flags + mamake.c: update mamprobe info when older than mamprobe executable + package.sh: move ed/ex workaround to mamprobe.sh + package.sh: fix `host type' bug that incorrectly assumed sun4 for sol + package.sh: add execrate(1) hooks for challenged systems + package.sh: add check for { cc ar nm yacc/bison } before make + ratz.c: fix "rb" vs. "r" macro tests + iffe.sh: add nxt, similar to lcl but defines _nxt_foo for #include + iffe.sh,package.sh: remove vaibale from sccs,cvs ident strings -- duh +02-01-24 C+probe: check CC.DYNAMIC to handle cc that accept but ignore -B* + iffe.sh: handle 'mem struct.a.b' +02-01-22 iffe.sh: cache (internal) `foo vs. struct foo' test results + package.sh: uts.370 => uts.390 +02-01-18 package.sh: fix uts hosttype +02-01-17 package.sh: add 'results failed ...' to list failures only + package.sh: change ARCH internal var to all_types to avoid env conflict + iffe.sh: fix hdr/lib precheck that missed some -- ouch + iffe.sh: fix noexecute test that forgot to check compile first! +02-01-15 ratz.c: fix path[] type typo +02-01-01 package.mk: tighten license search +02-01-08 package.sh: `pwd` => ${PWD:-`pwd`} + package.mk: expand license file pattern match +02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value" + iffe.sh: fix initial check to honor --config +01-12-25 iffe.sh: fix bug where -o file restored old file +01-12-23 package.mk: uniq the closure lists +01-12-07 ratz.c: fix --meter to retain paths containing " -- " +01-11-30 ratz.c: use sear_system() to execute; should work on all windows +01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status +01-11-26 ditto.sh: drop n+=v for ksh compatibility +01-11-21 ditto.sh: add rsync script replacement [hey, it works!] + package.sh: add [ditto]:directory notation to admin.db +01-10-31 package.sh: handle *.sum paths with embedded space + package.sh: change executable() to onpath() + package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack) + package.sh: add os2 fix to `host type' + mamake.c: add .exe hack + iffe.sh: fix intrinsic function lib test + mamprobe.sh: update pic probe to match make.probe for linux.ia64 +01-10-30 package.sh: make action skeleton view now checks subdirs +01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP + package.mk: tarball package.notice replaces `license accepted' prompt + package.sh: eliminate `license accepted' prompt + package.sh: add update to download latest from a url + package.sh: use builtin arithmetic when we know its ksh + iffe.sh: unkown -> unknown +01-10-18 package.sh: convert to YYYY-MM-DD delta releases instead of NNNN + package.mk: convert to YYYY-MM-DD delta releases instead of NNNN + ratz.c: fix -m for paths containing \f\n\r\v +01-10-16 ratz.c: _SEA_* => SEAR_* + ratz.c: preserve stdin for sear_exec() + ratz.c: add recursive sear_rm_r() to sear_exec() tmp dir cleanup +01-10-10 mamprobe.sh: add mam_cc_SHELLMAGIC + package.sh: add nfs wakeup call to admin to avoid stale file handles +01-10-04 cc.darwin.ppc: -flat_namespace is not longer the default (huh) +01-10-01 package make: prepend $INSTALLROOT/bin/ok to PATH + package read: save cpy of bin/package when reading the INIT package + mamprobe.sh: allow cc path with optional arguments +01-09-24 Makefile,package.sh: add $INSTALLROOT/bin/.paths initialization +01-09-19 package.mk: add recurse to list.package.* + package.sh: bootstrap build nmake with _BLD_STATIC for _WIN32 +01-09-11 ratz.c: add _SEA_SKIP & _SEA_COMMAND for self extracting archives +01-09-07 package.mk: fix output capture to not generate files names with spaces +01-09-07 package.mk: fix delta release number search +01-08-11 package.mk: handle single gz executable packages (e.g., for ksh) + package.sh: fix package install to require nmake only if no *.sum + iffe.sh: drop ancient menu and prompt actions; check ./hdr.h clash +01-07-17 package: fix use cross compile test to generate files in /tmp +01-06-27 ratz: handle hard and soft links if possible +01-06-07 Makefile: fix :MAPLIB: for sco +01-05-31 crossexec.sh: add + iffe.sh: add -x crosstype to run crossexec + iffe.sh: exp test now handles pass{}end fail{}end yes{}end no{}end + package.sh: add package host canon external-host-type-name + package.sh: fix `use USER' lookup for shells that support ~USER + cc.*: add -dumpmachine to dump target HOSTTYPE +01-05-18 iffe.sh: drop $HOME/tmp/t.sh debug trace -- oops +01-05-01 mamake.c: scan() now handles :PACKAGE: foo:command +01-04-26 *.sh: expand [a-z][A-Z][0-9] for non-contiguous character codes + iffe.sh: fix run *.sh for shells that don't $* across . command + cc.mvs.390: recode for /bin/sh +01-04-25 package.mk: include non cc-g variants by default + package.sh: *[._]* => *?[_.]* for mvs.390 /bin/sh +01-04-24 TEST.mk: no tests for VARIANT=="DLL" +01-04-22 package.mk,package.sh: tarball text members are ascii encoded +01-04-18 package.mk: allow package name to be the same as one of its components + cc.mvs.390: handle .C .cpp .cxx + cc.mvs.390: compensate for -o that does not overwrite +01-04-01 regress: fix SAME that just skipped it -- we should regress regress! + iffe: fix bug that didn't emit _hdr_foo for internal hdr tests + iffe: fix lcl bug for cc -E that doesn't emit line syncs + ratz: add ascii=>ebcdic conversion for text archive members + mamake: fix buffer overlap bug that clobbered the probe file path +01-03-17 iffe: handle : separator as first arg +01-03-15 mamake.c,ratz.c,release.c: add and +01-02-26 iffe.sh: fix bug that omitted runtime #define for `mac' op +01-02-22 cc.ibm.risc: handle SF_CLOSE clash in +01-02-14 cc.sgi.mips3,cc.sgi.mips4: handle -mips2 -mips3 -mips4 for cross cc + C+probe: quote "$cc" when its an argument! + mamake: execute actions with $SHELL, ignored signals back to default + package.sh: nmake check error output to /dev/null + package.sh: fix INIT a.out updates for knr cc + package.sh: package list now handles large tgz dirs + package.sh: *-ok executables moved to ok/* for *.dll systems + iffe.sh: change "exec >&-" to "exec >/dev/null" else linux mkdir fails! + mamake: handle `bind -lx [dontcare]' +01-02-12 ratz.c: fix _PACKAGE_ast includes + package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/ + package.sh: $CC ^HOSTTYPE=[A-Za-z_0-9.]*$ overrides HOSTTYPE + iffe.sh: fix dat code that used previous $tmp.exe + iffe.sh: fix dat code for _DLL imports +01-02-09 iffe.sh: add copy() for shells with the dissappearing here doc bug +01-02-08 Makefile: guard against null $(CC.HOSTTYPE) +01-02-06 Makefile: separate out cc,ld,ldd workarounds (so they will be packaged) +01-02-02 package.sh: fix package use for $INSTALLROOT != */$HOSTTYPE + package.sh: create intermediate recursion makefiles when needed + package.sh: add $SECONDS to the DEBUG trace prompt +01-01-01 ratz.c: #ifdef for uwin ncc + iffe.sh,package.sh: check PACKAGE_PATH for local installations + package.sh: add psrinfo for osf.alpha host cpu + package.sh: change pax --meter probe; some hang on /dev/tty + package.sh: fix `install flat ARCH' + mamake: eliminate loops from scan order + C+probe: add probe_verbose -V for aix cc=xlc + cc.ibm.risc,ldd.ibm.risc: add + package.mk: list refs to top-level licenses only + package.mk: add local link table to change log html +00-12-25 package.sh: `no package archives' is a hard error, duh + package.sh: reorder host type logic for lame shells + mamake.c: getcwd => getwd for NeXT -- how about posix==default guys + iffe.sh: really gross workaround for NeXT -lposix stdout null's + iffe.sh: handle cc -E that insists on compiling +00-12-15 iffe.sh: ancient sh function call blows $*; call only when $# == 0 + *.sh: `getopts 2>/dev/null` => `(getopts)2>/dev/null` for ancient sh + package.sh: fix LD_LIBRARY*_PATH initialization + cc.next.m68k: add for _POSIX_SOURCE and linker multiply defined syms +00-12-12 ratz: add --meter + package.sh: a few VPATH fixes + Makefile: don't override *.mips* cc if -version not accepted +00-12-11 package.mk: *.inx now contains name=value +00-12-07 package.sh: handle PC netscape . => _ pathname mangle + WWW.mk: .tar.gz => .tgz +00-11-27 package.sh: add checklicense() to do license checks at read time + package.mk: change component list from preformat to table +00-10-31 package.mk: *.pkg must assert closure + package.mk: add cc- variants to list.package.binary + package.sh: omit dups from package list + package.sh: invalid arg gives one line Usage + package.sh: relax checkaout checks for non-owners + package.sh: package use sets NPROC if not already set or [01] + proto.c: add $(INSTALLROOT)/include/ast hack +00-10-26 WWW.mk: add .SOURCE rhs to :WWWPAGE: +00-10-25 package: fix install + package.mk: add list.install +00-10-22 regress: fix VIEW to skip empty dirs +00-10-19 package.mk: $(PACKAGEROOT)/bin/nmake => $(PACKAGEROOT)/bin/manmake + iffe: validate #define identifiers +00-10-18 C+probe: mac os10 additions + package: add DYLD_LIBRARY_PATH initialization + add ldd.$(CC.HOSTTYPE) +00-10-01 iffe: handle -I* -L* options +00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs +00-09-19 C+probe: add probe_longlong +00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake +00-09-08 iffe: verfiy that $cc is a C compiler +00-06-14 mamprobe: fix win32.* probe + mamake: fix bug that used lower view path for generation + package: don't clobber $PACKAGEROOT/bin/nmake +00-06-01 C+probe: fix stdinclude *again* + package: fix write delta source to use default pax format + package: add disambiguating bias for sgi.mips3 over sgi.mips4 + package.mk: fix for directory content packages lib ast-locale +00-05-01 iffe: fix invalid _LIB_ macro identifier +00-04-11 C+probe: uniq stdinclude and stdlib, fix usrinclude +00-04-01 regress: fix explicit OUTPUT bug that didn't compare with expected +00-03-17 package: all archives are .tgz for binary download + package: $(PACKAGEROOT)/LICENSES/* in source and binary archives + package: implement install and verify actions + iffe: add exp, pth file dir ..., fix lib - -lfoo, fix lib - - -la -lb + iffe: -L* must affect LD_LIBRARY* hacks for .exe tests -- yuk + package.mk: add *.pkg :INDEX: +00-03-07 package: add admin action +00-03-06 makefile: install optional make probe override script C+make+probe.lcl +00-02-14 --- release 1.0 --- + ratz: treat "foo/" as a dir, not a regular file + package: clarify source and binary installation instructions + package: fix so binary packages can install without cc + package: "ratz" now a non-archive package (the only one) for bootstrap + package: handle VPATH=a:b arg + package.mk: "ratz" package adjustments + Makefile: use :PACKAGE_INIT: to support binary INIT packages + WWW.mk: add :WWWALL: + C.probe: fix .so check that let .dll slip through + iffe: fix config sh var assignment for HAVE_member_IN_struct + iffe: fix config sh var assignment for symbol_DECLARED + package: delay PATH export until dll hack exports complete + package: don't forget binary package $(INSTALLROOT)/lib(32|64) + package: add delta change log for source packages +00-02-10 mamprobe: add mam_cc_DLLBIG + package: fix spelling typos + package: add html help output + package.mk: beef up source and binary help => html +00-02-08 package: mkdir man/man[138] in the new arch to cover MAM bug +00-01-28 package,release: add -rcount to release + package: fix linux "host cpu" and "host rating" + package: copy *.lic to $PACKAGEBIN for "make" and "write binary" + package: fix 'release change log' case match +00-01-24 package: add copyright action + mamprobe: add -D_BLD_DLL to mam_cc_DLL +00-01-11 package: tsort for package write + package: early verification that $CC works + package: add non-interactive command arg for use action + proto: fix -C intermediate mkdir() + mamprobe: unixware.i386 ksh workaround + C.probe: move hosttype to C.probe (with unixware.i386 workaround) + WWW.mk: fix mm2html option quoting + WWW.mk: add .SCAN.mm + WWW.mk: don't force static=1; grab dll's instead + *.sh: fix getopts test to handle botched implementations like osf.alpha + iffe.sh: fix read -r test +99-12-25 iffe: tweak verbose messages + iffe: hand code non-optget getopts parse + iffe: fix bash quoting bug again + iffe: do test -w . after option parse + package: fix PACKAGEROOT search +99-11-19 --- release 0.2 --- +99-11-19 first working package & friends +99-10-31 change from lib0ast to INIT; add MAM and package bootstrap + hostinfo: gobbled by package +99-10-01 iffe: add --config, yes{...}end no{...}end, fix read -r workaround +99-09-27 iffe: add --all --verbose, --* set options +99-09-22 regress: -v disables long line truncation +99-09-11 WWW.mk: WWWDIR and MM2HTMLINFO are now lists searched in $(HOME) +99-08-11 hostinfo: fix type sgi.mips4 +99-06-24 WWW.mk: add +99-06-08 hostinfo.sh: ${TMPDIR:-/tmp} +99-06-07 TEST.mk: add +99-06-01 iffe: add `siz type' for _siz_type == sizeof(type) +99-05-11 hostinfo,iffe,regress,use: long options +99-05-01 C.probe: fix over aggressive stdinclude, e.g., /usr/include/machine +99-04-01 hostinfo: sgi.mips? -o32 and -n32 checks + iffe: check that . is writable +99-03-17 hostinfo: fix for cc not found + dl.c,hello.c,m.c: headers in conditionals to force .DONTCARE + C.probe: extra check for include dirs pulled in by +99-03-03 regress: add `UNIT - ...' for extra args + Makefile: add (_hosttype_) prereq for cc +99-01-23 hostinfo: tweak rating, use /proc/cpuinfo if there +99-01-11 C.probe: shlib before lib, /usr before / +98-12-25 iffe: work around win32.alpha intrinsic clash with -O +98-11-11 regress: fix UNIT PATH lookup +98-11-01 regress: add PROG +98-10-01 hostinfo: add unixware.* + use: export PACKAGE_* +98-08-11 C.probe: add /usr/include check (for sco CC) + hostinfo: handle uwin uname update +98-05-01 regress: fix bug sometimes didn't list last test +98-04-01 hostinfo: add cc path arg + hostinfo: now works with /bin/sh + Makefile: strengthed -lm probe +98-01-23 Makefile: check for -ldl -lm + C.probe: handle gcc -v -E phony include dirs + iffe: fix lcl by dropping sort -u -- we need the real first + iffe: `mem x' to test if x is a non-opaque struct +98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3 + $(INSTALLROOT)/lib64 for sgi.mips4 + add cc.hp.pa +98-01-01 cc.sgi.mips*: turn off ld library multiply defined +97-10-11 regress: add VIEW function for locating data +97-10-01 Makefile: -ldl test moved to libdll Makefile +97-08-11 regress: add MOVE + regress: add SAME + regress: use getopts + regress: `EXEC' repeats previous test +97-07-17 use: tweak PATH and LIBPATH bootstrap order + iffe: fix lcl bug that botched pathnames with embedded spaces +97-06-12 iffe: add npt `needs prototype' test +97-05-09 hostinfo: mvs.* => mvs.390 + Makefile: cc.$(_hosttype_) workaround installed here + iffe: fix nolink{ ... }end + iffe: add [no]static{ ... }end for static link test + C.probe: _probe_PATH => _probe_export which must be eval'd +97-04-01 use: _RLD_ROOT set too +97-03-17 mm2html: changed inner loop + mm2html: handle .if|.ie|.el, .so + mm2html: handle different man styles + mm2html: differentiate mm/man in some non-obvious cases + hostinfo: r5000 is not mips4 +97-02-14 hostinfo: validate type with cc +96-12-25 C.probe: uwin tweaks + iffe: use `...` instead of $(...) for alpha /bin/sh + iffe: fix `typ' divide by 0 + iffe: `lcl' now drops X: prefix + iffe: +l* -> -l* + iffe: eval around ${...#%...} for bsd /bin/sh + use: add sgi.mips LD_LIBRARY_PATH variants + use: add -e to list exports + iffe: lcl leaves leading [a-zA-Z]: for dos + iffe: fix no{link|output|execute} logic + C.probe: don't automatically add /usr/include for non-hosted compilers + C.probe: don't automatically place /usr/include last + C.probe: check gcc style -v -E for stdinclude usrinclude +96-11-28 iffe: check BASH_VERSION for IFS botch + iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx) + hostinfo: fix sgi.mips[234] tests + hostinfo: fix ncr.i386 tests +96-10-31 iffe: work around old bsh here doc bug by running separate sh +96-10-11 iffe: *.iffe and *.iff for iffe src files + hostinfo: tighten sgi.mips cpu type check +96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib +96-09-17 iffe: fix typ bug that failed for single id types! +96-08-31 hostinfo: handle recent sgi hinv cpu changes +96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx +96-05-09 C.probe: drop multiple / in stdinclude +96-02-29 use: package root must have bin and lib subdir + mm2html: add + C.probe: probe_members += -whole-archive for gcc + iffe: add + fix the blasted `...'...\\...'...` +96-01-31 use: add pkg dir + hostinfo: add tandem +96-01-01 hostinfo: windows_nt|windows[0-9][0-9] -> win32 +95-11-24 hostinfo: linux-aout.* for non-elf linux +95-11-11 use: add aix LIBPATH +95-10-11 hostinfo: no args prints type +95-08-11 use: add +95-05-09 save original PATH in _probe_PATH + beef up library dir probe +95-04-01 use c source suffix if it still preserves the dialect + add hostinfo + add lib/hostinfo/typemap user type map + add sol.sun4 cpu count + fix C.probe to properly handle C/C++ combined compiler drivers + add NeXT to hostinfo + bummer: mach has /usr/bin/hostinfo +95-03-19 fix dialect executable test +95-03-19 --- release 0.0 --- diff --git a/src/cmd/INIT/TEST.mk b/src/cmd/INIT/TEST.mk new file mode 100644 index 0000000..adc4390 --- /dev/null +++ b/src/cmd/INIT/TEST.mk @@ -0,0 +1,197 @@ +/* + * regression test support + * + * @(#)TEST.mk (AT&T Research) 2010-05-19 + * + * test management is still in the design phase + */ + +/* + * three forms for :TEST: + * + * :TEST: xxx yyy ... + * + * $(REGRESS) $(REGRESSFLAGS) xxx.tst + * $(REGRESS) $(REGRESSFLAGS) yyy.tst + * + * :TEST: xxx.tst yyy ... + * + * $(REGRESS) $(REGRESSFLAGS) xxx.tst yyy ... + * + * :TEST: xxx.c [ :: test-prereq ... :: ] [ args [ : args ... ] ] + * + * :TEST: xxx.sh [ :: test-prereq ... :: ] [ args [ : args ... ] ] + * + * xxx :TEST: prereq ... + * [ action ] + * + * $(*) if no action + */ + +":TEST:" : .MAKE .OPERATOR + local B G P S T + test : .INSERT .TESTINIT + if "$("tests":T=FD)" + .SOURCE : tests + end + P := $(>:O=1) + if "$(P:N=*.tst)" && ! "$(@:V)" + B := $(P:B) + if ! ( T = "$(<:V)" ) + T := $(B) + end + test : - test.$(T) + eval + test.$$(T) : $$(B).tst + $$(REGRESS) $$(REGRESSFLAGS) $$(*) $(>:V:O>1) + :SAVE: $$(B).tst + end + elif "$(P:N=*@(.sh|$(.SUFFIX.c:/ /|/G)|$(.SUFFIX.C:/ /|/G)))" + B := $(P:B) + if ! ( T = "$(<:V)" ) + T := $(B) + end + :INSTALLDIR: $(B) + $(B) :: $(P) $(*:-l*|*$(CC.SUFFIX.ARCHIVE)) + if "$(P:N=*.sh)" + TESTCC == $(CC) + $(B) : (TESTCC) + end + test : - test.$(T) + if "$(@:V)" + eval + test.$$(T) : $$(B) $(>:V:O>1) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $(@:V) + end + elif "$(>:V:O>1)" + local I A V X S R=0 + for A $(>:V:O>1) + if A == "::" + let R = !R + elif A == ":" + let I = I + 1 + test.$(T).$(I) := $(V:V) + V = + X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*) + S = $("\n") + elif A != "-l*|*$(CC.SUFFIX.ARCHIVE)" + if R + test.$(A) : .VIRTUAL .FORCE + test.$(T) : test.$(A) + else + V += $(A:V) + end + end + end + if V + let I = I + 1 + test.$(T).$(I) := $(V:V) + X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*) + end + eval + test.$$(T) : $$(B) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $(X:V) + end + else + eval + test.$$(T) : $$(B) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $$(*) + end + end + elif ! "$(<:V)" + G = 1 + for B $(>) + if B == "-|--" + let G = !G + else + if ! G + T = + elif ! ( T = "$(B:A=.COMMAND)" ) && ! "$(B:A=.TARGET)" + for S .c .sh + if "$(B:B:S=$(S):T=F)" + :INSTALLDIR: $(B) + $(B) :: $(B:B:S=$(S)) + T := $(B) + break + end + end + end + test : - test.$(B) + test.$(B) : $(T) - $(B).tst + $(REGRESS) $(REGRESSFLAGS) $(*:N=*.tst) $(*:N!=*.tst) + :SAVE: $(B).tst + end + end + else + if "$(>:V)" || "$(@:V)" + P := $(>) + T := $(P:O=1) + B := $(T:B) + if "$(T)" != "$(B)" && "$(T:G=$(B))" + :INSTALLDIR: $(B) + $(B) :: $(T) $(P:O>1:N=-*) + T := $(B) + P := $(B) $(P:O>1:N!=-*) + end + if "$(<:V)" + T := $(<:V) + end + test : - test.$(T) + if "$(@:V)" + eval + test.$$(T) : $$(P) $(>:V:O>1) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $(@:V) + end + else + test.$(T) : $(P) + set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x + $(*) + end + else + test : - test.$(<) + test.$(<) : $(<).tst $(<:A=.COMMAND) + $(REGRESS) $(REGRESSFLAGS) $(*) + end + end + +.TESTINIT : .MAKE .VIRTUAL .FORCE .REPEAT + if VARIANT == "DLL" + error 1 :DLL: tests skipped + exit 0 + end + set keepgoing + REGRESSFLAGS &= $(TESTS:@/ /|/G:/.*/--test=&/:@Q) + +.SCAN.tst : .SCAN + $(@.SCAN.sh) + I| INCLUDE@ % | + +.ATTRIBUTE.%.tst : .SCAN.tst + +MKTEST = mktest +MKTESTFLAGS = --style=regress + +/* + * test scripts are only regenerated from *.rt when --force + * is specified or the .rt file is newer than the script + * otherwise the script is accepted if it exists + * + * this avoids the case where a fresh build with no state + * would regenerate the test script and capture current + * behavior instead of expected behavior + */ + +%.tst : %.rt + if [[ "$(-force)" || "$(>)" -nt "$(^|<)" ]] + then $(MKTEST) $(MKTESTFLAGS) $(>) > $(<) + fi + +test%.sh test%.out : %.rt + if [[ "$(-force)" || "$(>)" -nt "$(^|<:O=1)" ]] + then $(MKTEST) --style=shell $(>) > $(<:N=*.sh) + $(SHELL) $(<:N=*.sh) --accept > $(<:N=*.out) + fi diff --git a/src/cmd/INIT/WWW.mk b/src/cmd/INIT/WWW.mk new file mode 100644 index 0000000..4542dae --- /dev/null +++ b/src/cmd/INIT/WWW.mk @@ -0,0 +1,450 @@ +/* + * post stuff to WWWDIR for web access + * index generated from *.mm + */ + +WWWDIR = wwwfiles public_html +WWWSAVE = +WWWSTYLE = +WWWTYPES = + +.WWW.semaphore : .SEMAPHORE + +.EXPORT : WWWSTYLE WWWTYPES + +/* + * item :WWW: [style=frame] [save=pattern] file ... + * + * `item'.mm generates index.html + * other files copied to $(WWWDIR)/`item' + * sets up www.bin + */ + +":WWW:" : .MAKE .OPERATOR + local A B D I J L X E P R M + .WWW.LOCAL .WWW.REMOTE : .DO.NOTHING + WWWDIR := $(HOME:X=$(WWWDIR):T=F:O=1) + B := $(*:N=*.mm::O=1:B) + D := $(WWWDIR)/$(B) + M := $(WWWDIR)/man/man1 + R := $(>:N!=*=*) + for I $(>:N=*=*) + A := WWW$(I:/=.*//:F=%(upper)s) + $(A) := $(I:/.*=//) + end + (html_info) : $$(MM2HTMLINFO) $$(MM2HTMLINIT) + if WWWSTYLE == "frame" + %.html %-index.html : %.mm (html_info) + $(MM2HTML) $(MM2HTMLFLAGS) $(%:N=faq.*:?> $(<:O=1)?-f $(%) -x?) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(WWWSOURCE.$(%)) $(>) + else + %.html : %.mm (html_info) + $(MM2HTML) $(MM2HTMLFLAGS) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(>) $(WWWSOURCE.$(%)) > $(<) + end + %.html : %.1 (html_info) + $(MM2HTML) $(MM2HTMLFLAGS) $(>) $(WWWSOURCE.$(%)) > $(<) + %-man.html : $(BINDIR)/% (html_info) + ignore $(>) --html 2> $(<) + .DO.WWW.MAN : .USE + if { test '' = '$(*)' || { strings $(*) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.' ;} ;} && [[ "$( $(<:B) '--???html' -- 2>&1 )" == version=[1-9]* ]] + then ( $(<:B) '--??html' -- 2>$(<) ) || true + fi + if 0 + $(M)/%.html : .DONTCARE $(INSTALLROOT)/bin/% + $(@.DO.WWW.MAN) + end + if "$(<)" + D := $(<) + elif ! "$(R)" + return + end + .WWW .WWW.BIN : $(D) $(M) - + $(D) $(M) : + $(SILENT) test -d $(<) || mkdir $(<) + if ( J = "$(R:N=*.mm)" ) + for I $(J:G=%.html) + if I == "*-index.html" + O := $(D)/index.html + else + O := $(I:D=$(D):B:S) + end + .WWW : $(O) + $(O) :COPY: $(I) + end + end + .WWW.req : .FUNCTION + return $(*$(%:T=SR):N=-l*:T=F:P=B:N!=-l*|/*) + A = 0 + for I $(R:N!=*.mm) + if I == "-" + let A = ! A + elif I == "-l*" + L := $(I:/-l//) + if J = "$(.DLL.NAME. $(L) $($(L).VERSION):T=F)" + X += $(J) + end + elif A || "$(I:A=.COMMAND|.ARCHIVE)" || "$(I:D:D:N=$(INSTALLROOT))" || "$(I:N=*-www)" + X += $(I) + if "$(I:A=.COMMAND)" + X += $$(.WWW.req $(I)) + J := $(I:/-www$//) + eval + .WWW : $(J:D=$(M):B:S=.html) + $(J:D=$(M):B:S=.html) : $(I) $(I:B:S=.1:T=F:?$(I:B:S=.1)??) + if strings $$(*:O=1) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.' + then $$(IGNORE) $$(*:O=1) '--??html' -- 2>&1 + elif test '' != '$$(*:N=*.1)' + then $$(MM2HTML) $$(*:N=*.1) + fi > $$(<) + end + end + else + if I == "*.html" + $(I) : .TERMINAL + end + .WWW : $(D)/$(I) + $(D)/$(I) :COPY: $(I) + end + end + if "$(X:V)" + .WWW.EDIT. : .FUNCTION + local E I J + for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*) + for J $(%) + if "$(I:B:S)" == "$(J:B:S)" + E += -s ',^$(J)$,$(I),' + end + end + end + return $(E) + .WWW.LIST. : .FUNCTION + local E I J + for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*) + for J $(%) + if "$(I:B:S)" == "$(J:B:S)" + E += $(I) + end + end + end + return $(E) + .WWW .WWW.BIN : $(D)/$(B)-$(CC.HOSTTYPE).tgz + $(D)/$(B)-$(CC.HOSTTYPE).tgz : $(X:V) + cat > X.$(tmp).X <) + TYPE := $(HOST:/.*://) + HOST := $(HOST:/:.*//) + WWWTYPES += $(TYPE) + ARCH := $(PWD:D:C,/$(CC.HOSTTYPE)/,/$(TYPE)/) + BINS := + DIRS := + for ITEM $(<) + if TYPE == "$(CC.HOSTTYPE)" + G := $("index.mm":G=%.html:D=$(WWWDIR)/$(ITEM):B:S) + .WWW.LOCAL : $(G) + eval + $(G) : .JOINT $(ARCH)/$(ITEM)/$(ITEM).mm (html_info) .WWW.semaphore .FORCE + cd $$(*:D) + $$(MAKE) $$(-) $$(=) www + end + else + BINS += $(WWWDIR)/$(ITEM)/$(ITEM)-$(TYPE).tgz + DIRS += $(ARCH)/$(ITEM) + end + end + .WWW.REMOTE : $(BINS) + ARCH := $(ARCH:C,/src/.*,,) + eval + $(BINS) :JOINT: .FORCE .WWW.semaphore + rsh $(HOST) " + eval \"\`bin/package debug use\`\" + PATH=\$PATH:$(PATH):/usr/ccs/bin + umask 022 + for dir in $(DIRS) + do cd \$dir + $(MAKE) $(-) $(=) --errorid=\$dir www.bin + done + " + end + end + +/* + * :WWWPOST: [ host [ dir [ tmp ] ] ] + * + * post local $(WWWDIR) to host:dir putting archives in host:tmp/www-*.pax + * defaults: host=www dir=$(WWWDIR) tmp=tmp + */ + +":WWWPOST:" : .MAKE .OPERATOR + local ( host dir tmp ignore ... ) $(>) www $(WWWDIR:B:S) tmp ignore + :ALL: delta.pax + .WWW.ALL : .WWW.REMOTE - .WWW.LOCAL + eval + .POST : .VIRTUAL base.pax delta.pax + case "$$(>)" in + '') ;; + *) $$(>:C,.*,rcp & $(host):$(tmp)/$(dir)-&;,) + rsh $(host) ' + umask 022 + PATH=$HOME/bin:$PATH + cd $(dir) + pax -rvf $HOME/$(tmp)/$(dir)-delta.pax -z $HOME/$(tmp)/$(dir)-base.pax + ' + ;; + esac + end + base.pax : + cd $(WWWDIR) + pax -wvf $(<:P=A) . + .base.list. : .FUNCTION + local X + X := $(sh pax -f $(%:N=*.pax):C,\n, ,G:C,^,$$(WWWDIR)/,) + $(X) : .DONTCARE + return $(X) + delta.pax : .WWW.ALL base.pax $$(.base.list. $$(*)) + cd $(WWWDIR) + pax -wvf $(<:P=A) -z $(*:N=*.pax:P=A) . + +.WWW.FAQ : .USE + { + set -o noglob + print .xx title=\"$(<:B:/\..*//) FAQ index\" + print .MT 4 + print .TL + print + print .H 1 \"$(<:B:/\..*//) FAQ index\" + print .BL + for i in $(*) + do exec < $i || exit 1 + e=0 l=0 x=y + while read -r op a1 a2 + do case $op in + .H) case $e in + 0) e=1 ;; + 1) print .LE ;; + esac + print .sp + print .LI + a2=${a2//\"/} + a2=${a2%\ [Ff][Aa][Qq]} + f=${i%.*}.html + f=${f#*/} + print .xx link=\"$f' '$a2\" + print .sp + print .NL + ;; + .AL|.BL|.NL) + case $x in + y) x=x ;; + *) x=xx$x ;; + esac + ;; + .LE) x=${x%xx} + ;; + .LI) case $x in + x) x= + print .LI + ;; + esac + ;; + .sp) case $x in + '') x=x ;; + esac + ;; + *) case $x in + '') print -r -- $op $a1 $a2 ;; + esac + ;; + esac + done + case $e in + 1) print .LE ;; + esac + done + print .LE + } > $(<) + +/* + * [ dir ] :WWWPAGE: [ source ... ] file.mm file + * + * *.mm generates *.html + * faq.*.mm generates faq.mm + * other files copied to $(WWWDIR)[/dir] + * files after - (toggle) are just asserted on :: + */ + +":WWWPAGE:" : .MAKE .OPERATOR + local B D I J O P Q S X G A + A = 0 + D := $(<:O=1) + P := $(>:N!=*=*) + S := $(>:N=*=*) + if X = "$(P:B:S:N=faq.*.mm)" + Q := $(D:+$(D).)faq.mm + $(Q) : .WWW.FAQ $(X) + P += $(Q) + end + if D + B := $(D:B) + if D != "/*" + D := $(WWWDIR)/$(D) + $(D) :INSTALLDIR: + .WWW.LOCAL : $(D) + end + for I $(<:B) + .WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html + $(WWWDIR)/man/man1/$(I).html : .DONTCARE + end + for I $(P) + if I == "-" + let A = !A + continue + end + if A || I == "$(WWWSAVE)" + :: $(I) + continue + end + if "$(I:T=FD)" + .SOURCE : $(I) + if "$(<)" + WWWSOURCE.$(<:O=1) += $(I:T=F:P=L=*) + end + continue + end + if I == "*.html" + $(I) : .TERMINAL + O := $(I) + X := $(I) + elif ( G = "$(I:G=%.html)" ) + $(G) : .IMPLICIT $(S) $(I) + if $(G:O) > 1 + for J $(G) + if J == "*-index.html" + if J == "faq.*.*" + continue + end + O := index.html + else + O := $(J) + end + .WWW.LOCAL : $(D)/$(O) + $(D)/$(O) :INSTALL: $(J) + end + continue + end + if X + X := $(I) + else + X := index + end + I := $(I:B:S=.html) + O := $(X:B:S=.html) + else + O := $(I) + end + $(D)/$(O) :INSTALL: $(I) + .WWW.LOCAL : $(D)/$(O) + end + else + for I $(P) + if I == "-" + let A = !A + continue + end + if A || I == "$(WWWSAVE)" + :: $(I) + continue + end + if "$(I:T=FD)" + .SOURCE : $(I) + continue + end + if I == "*.html" + $(I) : .TERMINAL + O := $(I) + elif ( O = "$(I:G=%.html)" ) + $(O) : $(S) .IMPLICIT $(I) + end + for J $(O) + if J == "*-index.html" + X := index.html + else + X := $(J) + end + X := $(WWWDIR)/$(X) + .WWW.LOCAL : $(X) + $(X) :COPY: $(J) + end + end + end + +/* + * rhs done by default + */ + +":WWWALL:" : .MAKE .OPERATOR + .WWW.ALL : $(>) + +":WWWMAN:" : .MAKE .OPERATOR + .INIT : .WWW.MAN + .WWW.MAN. := $(>) + .WWW.MAN : .MAKE .FORCE + local H I + for I $(.WWW.MAN.) + .WWW.LOCAL : $(WWWDIR)/man/man1/$(I:B).html + $(WWWDIR)/man/man1/$(I:B).html : .DO.WWW.MAN $(I) + end + for I $(sh builtin:B) + .WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html + $(WWWDIR)/man/man1/$(I).html : .DO.WWW.MAN - + end + for I $("$(BINDIR)/*([!-.])":P=G:B) + if I != "*_*" + H := $(WWWDIR)/man/man1/$(I).html + if ! "$(*$(H))" && I != "$(.WWW.NOMAN.:/ /|/G)" + .WWW.LOCAL : $(H) + end + elif "$(PATH:/:/ /G:X=$(I:/.*_//):T=F:O=1)" + H := $(WWWDIR)/man/man1/$(I:/.*_//).html + .WWW.LOCAL : $(H) + $(H) : .DO.WWW.MAN $(BINDIR)/$(I) + end + end + +.WWW.SED. : .FUNCTION + local E T + E = s/^\(\.xx.link=.*\)%HOSTTYPE%\(.*\)%HOSTTYPE%\(.*\)/ + for T $(%) + E := $(E:V)\$$("\n").LI\$$("\n")\1$(T)\2$(T)\3 + end + return $(E:V)/ + +/* + * mm scan support + */ + +.SCAN.mm : .SCAN + O|S| + I|.sn %|A.DONTCARE|M$$(%)| + I|.so %|A.DONTCARE|M$$(%)| + +.ATTRIBUTE.%.mm : .SCAN.mm diff --git a/src/cmd/INIT/ar.ibm.risc b/src/cmd/INIT/ar.ibm.risc new file mode 100755 index 0000000..0247643 --- /dev/null +++ b/src/cmd/INIT/ar.ibm.risc @@ -0,0 +1,9 @@ +: stupid stupid stupid to require a non-standard option for ar to work : 2009-10-06 : + +op=$1 +shift +case $op in +-*) ;; +*) op=-$op ;; +esac +/usr/bin/ar -Xany "$op" "$@" diff --git a/src/cmd/INIT/cc.darwin b/src/cmd/INIT/cc.darwin new file mode 100755 index 0000000..081bd43 --- /dev/null +++ b/src/cmd/INIT/cc.darwin @@ -0,0 +1,73 @@ +: unix wrapper for mac osx cc : 2012-01-20 : + +HOSTTYPE=darwin.generic + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +CC=/usr/bin/cc +op=init +for arg +do case $op in + init) op=ld + set '' + ;; + esac + case $arg in + -c) op=cc + ;; + -E) op=cpp + continue + ;; + -G) op=dll + continue + ;; + -lc) continue + ;; + -lm) continue + ;; + -O) continue + ;; + esac + set "$@" "$arg" +done +case $# in +0) ;; +*) shift ;; +esac +case $* in +-v) $CC "$@"; exit ;; +esac +case $op in +init) echo "cc: arguments expected" >&2 + exit 1 + ;; +cpp) $CC -E "$@" + ;; +cc) $CC -DCLK_TCK=100 "$@" + ;; +dll) # what a compatibility mess -- surely they can get the apis to play nice + tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + case `MACOSX_DEPLOYMENT_TARGET=10.3 ld -undefined dynamic_lookup 2>&1` in + *undefined*dynamic_lookup*) + ld -m -flat_namespace -undefined suppress -dylib -dynamic \ + -ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1 + status=$? + ;; + *) MACOSX_DEPLOYMENT_TARGET=10.3 $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" >$tmp 2>&1 + status=$? + ;; + esac + egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2 + exit $status + ;; +ld) tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + $CC -Wl,-m -DCLK_TCK=100 "$@" >$tmp 2>&1 + status=$? + egrep -v ' (warning .*multiple definitions of|definition of|as lazy binding|not from earlier dynamic) ' $tmp >&2 + exit $status + ;; +esac diff --git a/src/cmd/INIT/cc.darwin.i386 b/src/cmd/INIT/cc.darwin.i386 new file mode 100755 index 0000000..9afde8d --- /dev/null +++ b/src/cmd/INIT/cc.darwin.i386 @@ -0,0 +1,73 @@ +: unix wrapper for mac osx cc : 2012-02-29 : + +HOSTTYPE=darwin.i386 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +CC='/usr/bin/cc -m32' +op=init +for arg +do case $op in + init) op=ld + set '' + ;; + esac + case $arg in + -c) op=cc + ;; + -E) op=cpp + continue + ;; + -G) op=dll + continue + ;; + -lc) continue + ;; + -lm) continue + ;; + -O) continue + ;; + esac + set "$@" "$arg" +done +case $# in +0) ;; +*) shift ;; +esac +case $* in +-v) $CC "$@"; exit ;; +esac +case $op in +init) echo "cc: arguments expected" >&2 + exit 1 + ;; +cpp) $CC -E "$@" + ;; +cc) $CC -DCLK_TCK=100 "$@" + ;; +dll) # what a compatibility mess -- surely they can get the apis to play nice + tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + case `MACOSX_DEPLOYMENT_TARGET=10.3 ld -undefined dynamic_lookup 2>&1` in + *undefined*dynamic_lookup*) + ld -m -flat_namespace -undefined suppress -dylib -dynamic \ + -ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1 + status=$? + ;; + *) MACOSX_DEPLOYMENT_TARGET=10.3 $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" >$tmp 2>&1 + status=$? + ;; + esac + egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2 + exit $status + ;; +ld) tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + $CC -Wl,-m -DCLK_TCK=100 "$@" >$tmp 2>&1 + status=$? + egrep -v ' (warning .*multiple definitions of|definition of|as lazy binding|not from earlier dynamic) ' $tmp >&2 + exit $status + ;; +esac diff --git a/src/cmd/INIT/cc.darwin.i386-64 b/src/cmd/INIT/cc.darwin.i386-64 new file mode 100755 index 0000000..9010d96 --- /dev/null +++ b/src/cmd/INIT/cc.darwin.i386-64 @@ -0,0 +1,73 @@ +: unix wrapper for mac osx cc : 2012-02-29 : + +HOSTTYPE=darwin.i386-64 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +CC=/usr/bin/cc +op=init +for arg +do case $op in + init) op=ld + set '' + ;; + esac + case $arg in + -c) op=cc + ;; + -E) op=cpp + continue + ;; + -G) op=dll + continue + ;; + -lc) continue + ;; + -lm) continue + ;; + -O) continue + ;; + esac + set "$@" "$arg" +done +case $# in +0) ;; +*) shift ;; +esac +case $* in +-v) $CC "$@"; exit ;; +esac +case $op in +init) echo "cc: arguments expected" >&2 + exit 1 + ;; +cpp) $CC -E "$@" + ;; +cc) $CC -DCLK_TCK=100 "$@" + ;; +dll) # what a compatibility mess -- surely they can get the apis to play nice + tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + case `MACOSX_DEPLOYMENT_TARGET=10.3 ld -undefined dynamic_lookup 2>&1` in + *undefined*dynamic_lookup*) + ld -m -flat_namespace -undefined suppress -dylib -dynamic \ + -ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1 + status=$? + ;; + *) MACOSX_DEPLOYMENT_TARGET=10.3 $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" >$tmp 2>&1 + status=$? + ;; + esac + egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2 + exit $status + ;; +ld) tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err + trap "rm -f $tmp" EXIT + $CC -Wl,-m -DCLK_TCK=100 "$@" >$tmp 2>&1 + status=$? + egrep -v ' (warning .*multiple definitions of|definition of|as lazy binding|not from earlier dynamic) ' $tmp >&2 + exit $status + ;; +esac diff --git a/src/cmd/INIT/cc.hp.ia64 b/src/cmd/INIT/cc.hp.ia64 new file mode 100755 index 0000000..204bd0e --- /dev/null +++ b/src/cmd/INIT/cc.hp.ia64 @@ -0,0 +1,13 @@ +: hp.ia64 cc wrapper for reasonable ansi C defaults : 2011-01-25 : + +[ /usr/bin/cc -ef /usr/ccs/bin/cc ] || exit 1 + +: bundled cc -- really, in the face of gcc you ship a sub-par /usr/bin/cc? : + +HOSTTYPE=hp.ia64 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/usr/bin/cc -D_HPUX_SOURCE -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE_XOPEN_SOURCE_500 "$@" diff --git a/src/cmd/INIT/cc.hp.pa b/src/cmd/INIT/cc.hp.pa new file mode 100755 index 0000000..cd5f576 --- /dev/null +++ b/src/cmd/INIT/cc.hp.pa @@ -0,0 +1,13 @@ +: hp.pa cc wrapper for reasonable ansi C defaults : 2004-02-29 : + +HOSTTYPE=hp.pa + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +_AST_CC_hp_pa_DEFAULT=${_AST_CC_hp_pa_DEFAULT-"+DAportable"} + +/opt/ansic/bin/cc -Ae +e -Wl,+s $_AST_CC_hp_pa_DEFAULT \ + ${INSTALLROOT:+-Wl,+cdp,${INSTALLROOT}/lib/:} \ + -Wl,+vnocompatwarnings "$@" diff --git a/src/cmd/INIT/cc.hp.pa64 b/src/cmd/INIT/cc.hp.pa64 new file mode 100755 index 0000000..49f2395 --- /dev/null +++ b/src/cmd/INIT/cc.hp.pa64 @@ -0,0 +1,11 @@ +: hp.pa64 cc wrapper for reasonable ansi C defaults : 2001-02-11 : + +HOSTTYPE=hp.pa64 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/opt/ansic/bin/cc +D2.0W -Ae +e -Wl,+s \ + ${INSTALLROOT:+-Wl,+cdp,${INSTALLROOT}/lib/:} \ + -Wl,+vnocompatwarnings "$@" diff --git a/src/cmd/INIT/cc.ibm.risc b/src/cmd/INIT/cc.ibm.risc new file mode 100755 index 0000000..17a8f70 --- /dev/null +++ b/src/cmd/INIT/cc.ibm.risc @@ -0,0 +1,63 @@ +: cc wrapper for aix risc xlc : 2009-09-28 : + +hosttype=ibm.risc + +case $HOSTTYPE in +$hosttype-64) + case " $* " in + *" -q64 "*) ;; + *) set -- -q64 "$@" ;; + esac + ;; +*) case " $* " in + *" -q64 "*) HOSTTYPE=$hosttype-64 ;; + *) HOSTTYPE=$hosttype ;; + esac + ;; +esac + +case " $* " in +*" -dumpmachine "*) + echo $HOSTTYPE + exit + ;; +esac + +bin=/usr/vac/bin +cc=$bin/xlc + +ccflags="-brtl -qhalt=e -qsuppress=1506-224:1506-507" +case " $@ " in +*" -G "*) + ccflags="$ccflags -berok" + ;; +esac +if test -x $bin/c99 +then # the xlc optimizer vintage that supports c99 is flawed and causes the ast build to fail # + case " $* " in + *" -O "*) + set '' "$@" '' + shift + while : + do a=$1 + shift + case $a in + '') break ;; + -O) ;; + *) set '' "$@" $a ;; + esac + shift + done + ;; + esac + $cc $ccflags "$@" + code=$? +else export PATH=/bin:$PATH LIBPATH=/usr/lib:/lib + ccflags="$ccflags -blibpath:$LIBPATH" +fi +$cc $ccflags "$@" +code=$? +case $code in +127|255) code=1 ;; +esac +exit $code diff --git a/src/cmd/INIT/cc.ibm.risc.gcc b/src/cmd/INIT/cc.ibm.risc.gcc new file mode 100755 index 0000000..5d4d16b --- /dev/null +++ b/src/cmd/INIT/cc.ibm.risc.gcc @@ -0,0 +1,36 @@ +: cc wrapper for aix risc gcc : 2012-02-14 : + +hosttype=ibm.risc + +case $HOSTTYPE in +$hosttype-64) + case " $* " in + *" -maix64 "*) ;; + *) set -- -maix64 "$@" ;; + esac + ;; +*) case " $* " in + *" -maix64 "*) HOSTTYPE=$hosttype-64 ;; + *) HOSTTYPE=$hosttype ;; + esac + ;; +esac + +case " $* " in +*" -dumpmachine "*) + echo $HOSTTYPE + exit + ;; +esac + +cc=gcc +ccflags= + +case " $@ " in +*" -shared "*) + ccflags="$ccflags -shared -Wl,-G -Wl,-berok" + ;; +*) ccflags="-Wl,-brtl" + ;; +esac +$cc $ccflags "$@" diff --git a/src/cmd/INIT/cc.linux.i386-64-icc b/src/cmd/INIT/cc.linux.i386-64-icc new file mode 100755 index 0000000..4d945bf --- /dev/null +++ b/src/cmd/INIT/cc.linux.i386-64-icc @@ -0,0 +1,22 @@ +: linux.i386-64 icc wrapper : 2011-10-18 : + +HOSTTYPE=linux.i386-64-icc + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +icc=$(which icc 2>/dev/null) +case $icc in +"") if test -f /etc/profile.d/icc.sh + then . /etc/profile.d/icc.sh + fi + icc=$(which icc 2>/dev/null) + case $icc in + "") echo icc: not found >&2 + exit 127 + ;; + esac + ;; +esac +$icc "$@" diff --git a/src/cmd/INIT/cc.linux.i386-icc b/src/cmd/INIT/cc.linux.i386-icc new file mode 100755 index 0000000..09dc25c --- /dev/null +++ b/src/cmd/INIT/cc.linux.i386-icc @@ -0,0 +1,22 @@ +: linux.ia64 icc wrapper : 2011-10-18 : + +HOSTTYPE=linux.ia64-icc + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +icc=$(which icc 2>/dev/null) +case $icc in +"") if test -f /etc/profile.d/icc.sh + then . /etc/profile.d/icc.sh + fi + icc=$(which icc 2>/dev/null) + case $icc in + "") echo icc: not found >&2 + exit 127 + ;; + esac + ;; +esac +$icc "$@" diff --git a/src/cmd/INIT/cc.linux.ia64-icc b/src/cmd/INIT/cc.linux.ia64-icc new file mode 100755 index 0000000..09dc25c --- /dev/null +++ b/src/cmd/INIT/cc.linux.ia64-icc @@ -0,0 +1,22 @@ +: linux.ia64 icc wrapper : 2011-10-18 : + +HOSTTYPE=linux.ia64-icc + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +icc=$(which icc 2>/dev/null) +case $icc in +"") if test -f /etc/profile.d/icc.sh + then . /etc/profile.d/icc.sh + fi + icc=$(which icc 2>/dev/null) + case $icc in + "") echo icc: not found >&2 + exit 127 + ;; + esac + ;; +esac +$icc "$@" diff --git a/src/cmd/INIT/cc.lynxos.i386 b/src/cmd/INIT/cc.lynxos.i386 new file mode 100755 index 0000000..acd0d02 --- /dev/null +++ b/src/cmd/INIT/cc.lynxos.i386 @@ -0,0 +1,81 @@ +: lynxos.i386 cc wrapper with -dynamic default : 2005-02-14 : + +HOSTTYPE=lynxos.i386 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=gcc + +link=1 +static=0 +set . "$@" /../ +while : +do shift + case $1 in + /../) break ;; + esac + case $1 in + *.[cChHiI]|*.[cChHiI][pPxX][pPxX]) + set . -D__NO_INCLUDE_WARN__ -I/sys/include/kernel -I/sys/include/family/x86 "$@" + shift + break + ;; + -o) case $2 in + /../) ;; + *) x=$1 + shift + set . "$@" "$x" + shift + ;; + esac + ;; + -static)static=1 + ;; + -l*) case $static in + 0) static=n + set . -L/lib/shlib "$@" + shift + ;; + esac + ;; + -[cE]) link=0 + ;; + esac + x=$1 + shift + set . "$@" "$x" +done +while : +do case $1 in + /../) shift + break + ;; + -l*) case $static in + 0) static=n + set . -L/lib/shlib "$@" + shift + ;; + esac + ;; + -[cE]) link=0 + ;; + esac + x=$1 + shift + set . "$@" "$x" + shift +done +case $link:$static in +1:0) static=n ;; +esac +case $static in +n) specs=/tmp/cc$$.specs + trap 'status=$?; rm -f $specs; exit $status' 0 1 2 + echo '*link: %{shared:-shared} %{static:-static} %{mshared|shared: %{static: %eerror: -shared and -static may not be combined. }}' > $specs + $cc -specs=$specs "$@" + ;; +*) $cc "$@" + ;; +esac diff --git a/src/cmd/INIT/cc.lynxos.ppc b/src/cmd/INIT/cc.lynxos.ppc new file mode 100755 index 0000000..32738f2 --- /dev/null +++ b/src/cmd/INIT/cc.lynxos.ppc @@ -0,0 +1,85 @@ +: lynxos.ppc cc wrapper with -mshared default : 2005-06-01 : + +HOSTTYPE=lynxos.ppc + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=gcc + +link=1 +static=0 +set . "$@" /../ +while : +do shift + case $1 in + /../) break ;; + esac + case $1 in + *.[cChHiI]|*.[cChHiI][pPxX][pPxX]) + set . -D__NO_INCLUDE_WARN__ -I/sys/include/kernel -I/sys/include/family/ppc "$@" + shift + break + ;; + -o) case $2 in + /../) ;; + *) x=$1 + shift + set . "$@" "$x" + shift + ;; + esac + ;; + -static)static=1 + ;; + -mshared) + static=n + continue + ;; + -l*) case $static in + 0) static=n + set . -L/lib/shlib "$@" + shift + ;; + esac + ;; + -[cE]) link=0 + ;; + esac + x=$1 + shift + set . "$@" "$x" +done +while : +do case $1 in + /../) shift + break + ;; + -l*) case $static in + 0) static=n + set . -L/lib/shlib "$@" + shift + ;; + esac + ;; + -[cE]) link=0 + ;; + esac + x=$1 + shift + set . "$@" "$x" + shift +done +case $link:$static in +1:0) static=n ;; +esac +case $static in +n) specs=/tmp/cc$$.specs + trap 'status=$?; rm -f $specs; exit $status' 0 1 2 + echo '*link: %{shared:-shared} %{static:-static} %{mshared|shared: %{static: %eerror: -shared and -static may not be combined. }}' > $specs + $cc -specs=$specs -mshared "$@" + ;; +*) $cc "$@" + ;; +esac diff --git a/src/cmd/INIT/cc.mvs.390 b/src/cmd/INIT/cc.mvs.390 new file mode 100755 index 0000000..50bc7d5 --- /dev/null +++ b/src/cmd/INIT/cc.mvs.390 @@ -0,0 +1,279 @@ +: mvs.390 cc wrapper for unix message and exit code semantics : 2012-01-20 : + +HOSTTYPE=mvs.390 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +ar=ar +cc=/bin/c89 +CC=/bin/c++ +ccflags="-D_ALL_SOURCE -Wc,dll" +objmax=60 +tmpfiles= +unbotch= + +# -n as *first* arg shows but does not do +# -Wc,exportall => -Wl,dll +# -Bdynamic => .c,.o dynamic +# -Bstatic => .c,.o static +# *.C => cc=$CC +# *.cpp => cc=$CC +# *.cxx => cc=$CC +# no optimization until the optimizer is fixed: +# -O dropped (no optimization) +# -0 dropped (no optimization) +# -1 -O (default level 1 optimization) +# -2 -2 (maximal level 2 optimization) + +let argc=0 cmp=0 dll=0 libc=0 dynamic=1 dynamic_objc=0 static_objc=0 relc=0 botched=0 +case $1 in +-n) exec=print + shift + ;; +*) exec= + ;; +esac +export _CC_ACCEPTABLE_RC=1 +export _C89_ACCEPTABLE_RC=$_CC_ACCEPTABLE_RC +export _CXX_ACCEPTABLE_RC=$_CC_ACCEPTABLE_RC +case " $* " in +*.C" "*)let dll=2 + cc=$CC + export _CXXSUFFIX=C + ;; +*.cpp" "*)let dll=2 + cc=$CC + export _CXXSUFFIX=cpp + ;; +*.cxx" "*)let dll=2 + cc=$CC + export _CXXSUFFIX=cxx + ;; +esac +exe= +xxx= +while : +do case $# in + 0) break ;; + esac + arg=$1 + case $arg in + -1) arg=-O + ;; + -Bdynamic) + let dynamic=1 + ;; + -Bstatic) + let dynamic=0 + ;; + -c) let cmp=1 + ;; + -D_ALL_SOURCE|-D_ALL_SOURCE=*) + arg= + ;; + -D*[\ \(\)]*) + arg=${arg#-D} + botch_macro[botched]=${arg%%=*} + botch_value[botched]=${arg#*=} + let botched=botched+1 + arg= + ;; + -o) argv[argc]=$arg + let argc=argc+1 + shift + arg=$1 + exe=$arg + rm -f "$exe" + ;; + -[O0]) arg= + ;; + -Wc,dll)arg= + ;; + -Wc,exportall) + let dll=1 + ;; + -Wl,dll)arg= + let dll=1 + ;; + *.c) if [[ $botched != 0 ]] + then src=$arg + arg=${arg##*/} + unbotch="$unbotch ${arg%.c}.o" + arg=__$arg + tmpfiles="$tmpfiles $arg" + { + while [[ $botched != 0 ]] + do let botched=botched-1 + print -r -- "#define ${botch_macro[botched]} ${botch_value[botched]}" + done + cat $src + } > $arg + fi + ;; + *.o) if test 0 != $dynamic + then let dynamic_objc=dynamic_objc+1 + else let static_objc=static_objc+1 + fi + ;; + *.x) a=${arg%.x}.a + if test -f $a + then argv[argc]=$a + let argc=argc+1 + xxx=-Wl,dll + case $a in + ast.a|*/ast.a) + cc="$CC -u_ast_init" + ;; + esac + fi + ;; + esac + case $arg in + ?*) argv[argc]=$arg + let argc=argc+1 + ;; + esac + shift +done + +tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err +tmpfiles="$tmp $tmpfiles" + +# if any dll .o's are in .a then a .x gets generated +# but the native cc doesn't jcl for the .x +# -Wl,dll does that, so we nuke the .x and keep the exe + +test 0 != $dll && xxx= +case $xxx in +?*) case $exe in + ?*) a=${exe##*/} + a=${a%.*} + case $exe in + */*) tmpfiles="$tmpfiles ${exe%/*}/${a}.x" ;; + *) tmpfiles="$tmpfiles ${a}.x" ;; + esac + ;; + esac + ;; +esac +if test 0 != $dll +then if test 0 != $cmp + then xxx="-D_SHARE_EXT_VARS $xxx" + else xxx="-Wl,dll $xxx" + fi +fi +set -- $xxx "${argv[@]}" + +# can't handle more than objmax .o's +# -r into intermediates doesn't work, but the cat trick does +# also, the runtime dll file must be executable but cc -Wl,dll forgets + +if test 0 != $dll -a \( $dynamic_objc -ge $objmax -o 0 != $static_objc \) +then unset argv + argc=0 libc=0 dynamic=1 dynamic_objc=0 static_objc=0 endc=0 + while : + do case $# in + 0) break ;; + esac + case $1 in + -Bdynamic) + let dynamic=1 + ;; + -Bstatic) + let dynamic=0 + ;; + *.o) if test 0 != $dynamic + then dynamic_objv[dynamic_objc]=$1 + let dynamic_objc=dynamic_objc+1 + else static_objv[static_objc]=$1 + let static_objc=static_objc+1 + fi + ;; + -l*) libv[libc]=$1 + let libc=libc+1 + ;; + -o) argv[argc]=$1 + let argc=argc+1 + shift + argv[argc]=$1 + let argc=argc+1 + exe=$1 + ;; + *) argv[argc]=$1 + let argc=argc+1 + ;; + esac + shift + done + if test 0 != $static_objc + then case $exe in + ?*) $exec $ar cr ${exe%.*}.a "${static_objv[@]}" ;; + esac + fi + if test 0 != $dynamic_objc + then cat=0.0.o + tmpfiles="$tmpfiles $cat" + cat "${dynamic_objv[@]}" > $cat || exit + else cat= + fi + set -- "${argv[@]}" $cat "${libv[@]}" +fi + +# grep through the warning/error messages to get the true exit code +# some annoying messages are dropped while we're at it + +trap 'rm -f $tmpfiles' 0 1 2 15 +$exec $cc $ccflags "$@" 2> $tmp +code=$? +for i in $unbotch +do test -f __$i && mv __$i $i +done +typeset -l lc +while : +do if read line + then lc=$line + case $lc in + *'#include file'*'not found'*) + code=1 + ;; + *'#pragma ignored'*) + continue + ;; + *'definition side file is not defined'*) + continue + ;; + *'step ended with return code 4'*) + code=0 + continue + ;; + *'step ended with return code'*) + code=1 + continue + ;; + *'try again'*) + code=1 + continue + ;; + *'unknown preprocessing directive'*) + code=1 + case $lc in + 'warning '*) + set -- $line + shift + line=$* + ;; + esac + ;; + *'unresolved writable static references are detected'*) + test 0 != $dll && continue + ;; + esac + else case $code:$exe in + 0:?*) $exec chmod +x $exe ;; + esac + exit $code + fi + echo "$line" >&2 +done < $tmp diff --git a/src/cmd/INIT/cc.next.i386 b/src/cmd/INIT/cc.next.i386 new file mode 100755 index 0000000..16df709 --- /dev/null +++ b/src/cmd/INIT/cc.next.i386 @@ -0,0 +1,158 @@ +: next.i386 cc wrapper for unix message and exit code semantics : 1995-05-09 : + +HOSTTYPE=next.i386 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# 1995-05-09 -lposix termios.o waitpid.o setpgid.o *do* work +# 1994-11-04 -posix has old redirection hole bug +# -D_POSIX_SOURCE requires manual fixes +# libexpr/exeval.c bombs -O, no -O ok + +command=cc +cc="/bin/cc -D_POSIX_SOURCE" +nooptimize="exeval" + +# first check $INSTALLROOT/botch + +case $INSTALLROOT in +"") echo "$command: INSTALLROOT: must be defined and exported" >&2; exit 1 ;; +esac +if test ! -d $INSTALLROOT/botch -a -dryrun != "$1" +then if mkdir $INSTALLROOT/botch + then : ok to initialize + else echo "$command: $INSTALLROOT/botch must be initialized by the owner of $INSTALLROOT" 2>&1 + exit 1 + fi + ( + cd $INSTALLROOT/botch + dir=. + for i in lib . include sys + do case $i in + .) dir=. + ;; + *) case $i in + /*) dir=$i ;; + *) dir=$dir/$i ;; + esac + test -d $dir || mkdir $dir + ;; + esac + done + if test ! -f include/sys/dirent.h + then echo "#include " > tmp.c + header=`$cc -E tmp.c | sed -e '/^#[ ]*1[ ].*\/sys\/dirent\.h"/!d' -e 's/.*"\(.*\)".*/\1/'` + sed -e 's/[ ]off_t[ ][ ]*d_off[ ]*;//' $header > include/sys/dirent.h + fi + if test ! -f lib/libbotch.a + then lipo /usr/lib/libposix.a -thin i386 -output tmp.a + ar x tmp.a termios.o waitpid.o setpgid.o + ar cr lib/libbotch.a *.o + ranlib lib/libbotch.a + fi + rm -f *.[aco] + ) +fi + +# now slip in our args + +case $nooptimize in +"") nooptimize=. + ;; +*) optimize= + for arg in $nooptimize + do case $optimize in + ?*) optimize="$optimize|" ;; + esac + optimize="$optimize$arg.[ci]|*/$arg.[ci]" + done + nooptimize=$optimize + ;; +esac +set . "$@" . +noexec= +library= +local= +optimize= +verbose= +while : +do shift + arg=$1 + shift + case $arg in + .) break + ;; + -[cES]) library=1 + ;; + -O) optimize=1 + ;; + -v) verbose=1 + ;; + -dryrun)noexec=1 + verbose=1 + ;; + -I-) case $local in + "") local=1 + set . "$@" -I$INSTALLROOT/botch/include -I- -I$INSTALLROOT/botch/include + ;; + *) set . "$@" -I- -I$INSTALLROOT/botch/include + ;; + esac + continue + ;; + -I*|*.[cChHiI]|*.[cChHiI][pPxX][pPxX]) + case $optimize in + 1) eval " + case \$arg in + $nooptimize) + optimize=0 + ;; + esac + " + ;; + esac + case $local in + "") local=1 + set . "$@" -I$INSTALLROOT/botch/include "$arg" + continue + ;; + esac + ;; + -last|*/libast.a) + case $library in + "") library=1 + set . "$@" $INSTALLROOT/botch/lib/libbotch.a "$arg" $INSTALLROOT/botch/lib/libbotch.a + continue + ;; + esac + ;; + esac + set . "$@" "$arg" +done +case $library in +"") set . "$@" $INSTALLROOT/botch/lib/libbotch.a + shift + ;; +esac +case $optimize in +0) set . "$@" . + while : + do shift + arg=$1 + shift + case $arg in + .) break ;; + -O) set . "$@" ;; + *) set . "$@" "$arg" ;; + esac + done + ;; +esac +case $verbose in +?*) echo $cc "$@" ;; +esac +case $noexec in +"") $cc "$@" ;; +esac diff --git a/src/cmd/INIT/cc.next.m68k b/src/cmd/INIT/cc.next.m68k new file mode 100755 index 0000000..1c2f8b5 --- /dev/null +++ b/src/cmd/INIT/cc.next.m68k @@ -0,0 +1,9 @@ +: next.m68k cc wrapper that enables posix : 2000-12-15 : + +HOSTTYPE=next.m68k + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/bin/cc -posix -Xlinker -m "$@" diff --git a/src/cmd/INIT/cc.osf.alpha b/src/cmd/INIT/cc.osf.alpha new file mode 100755 index 0000000..fe19bb4 --- /dev/null +++ b/src/cmd/INIT/cc.osf.alpha @@ -0,0 +1,9 @@ +: osf.alpha cc wrapper with reasonable namespace defaults : 1998-02-04 : + +HOSTTYPE=osf.alpha + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/usr/bin/cc -std -Dnoshare=_noshare_ -Dreadonly=_readonly_ "$@" diff --git a/src/cmd/INIT/cc.pentium4 b/src/cmd/INIT/cc.pentium4 new file mode 100755 index 0000000..8794cda --- /dev/null +++ b/src/cmd/INIT/cc.pentium4 @@ -0,0 +1,26 @@ +: linux.pentium4 gcc wrapper : 2005-10-24 : + +HOSTTYPE=linux.pentium4 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +case " $* " in +*" -O "*) + set -A argv -- "$@" + set -A nargv + integer i j + for ((i = j = 0; i < ${#argv[@]}; i++)) + do if [[ ${argv[i]} == -O ]] + then nargv[j++]=-O3 + nargv[j++]=-march=pentium4 + else nargv[j++]=${argv[i]} + fi + done + gcc "${nargv[@]}" + exit + ;; +esac + +gcc "$@" diff --git a/src/cmd/INIT/cc.sco.i386 b/src/cmd/INIT/cc.sco.i386 new file mode 100755 index 0000000..d0cba57 --- /dev/null +++ b/src/cmd/INIT/cc.sco.i386 @@ -0,0 +1,9 @@ +: sco.i386 cc wrapper with reasonable binary and namespace : 1998-02-04 : + +HOSTTYPE=sco.i386 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +/bin/cc -b elf -D_SVID3 "$@" diff --git a/src/cmd/INIT/cc.sgi.mips2 b/src/cmd/INIT/cc.sgi.mips2 new file mode 100755 index 0000000..a0e5d33 --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips2 @@ -0,0 +1,68 @@ +: sgi.mips2 cc wrapper that generates mips2 binaries : 2006-02-14 : + +HOSTTYPE=sgi.mips2 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags=-OPT:Olimit=0 +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +if test -d /usr/lib32 +then LD_LIBRARYN32_PATH=/lib32 $cc -32 -mips2 $flags $dynamic $ldignore $ignore "$@" +else $cc -mips2 $flags $ignore "$@" +fi diff --git a/src/cmd/INIT/cc.sgi.mips3 b/src/cmd/INIT/cc.sgi.mips3 new file mode 100755 index 0000000..426317a --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips3 @@ -0,0 +1,110 @@ +: sgi.mips3 cc wrapper that generates mips3 binaries : 2007-04-27 : + +HOSTTYPE=sgi.mips3 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# ld: +# 15 +# 84 +# 85 +# 134 +# cc: +# 1685 (first!!) Invalid error number: X. +# 1035 cpp #error -- 0 exit status by default - botch botch botch +# 1048 +# 1155 +# 1171 The indicated expression has no effect. +# 1184 "=" is used where where "==" may have been intended. +# 1209 The controlling expression is constant. +# 1343 +# 3169 X not marked as intrinsic because it is not yet declared +# 3170 X not marked as intrinsic because it is not yet declared +# 3421 expecting function name #pragma intrinsic (X) +# 3433 X not marked as intrinsic because it is not yet declared +# 3434 X not marked as intrinsic because it is not yet declared + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags=-OPT:Olimit=0 +fatal=1035 +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3421,3433,3434 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $fatal in +?*) fatal="-diag_error $fatal" ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +case $1 in +-mips2) if test -d /usr/lib32 + then LD_LIBRARYN32_PATH=/lib32 $cc -32 -mips2 $flags $dynamic $ldignore $ignore "$@" + else $cc -mips2 $flags $ignore "$@" + fi + ;; +-mips4) case " $* " in + *" -ldl "*) + integer n=0 + for i + do case $i in + -ldl) ;; + *) a[n++]=$i ;; + esac + done + set -- ${a[@]} + esac + $cc -64 -mips4 $flags $dynamic $fatal $ldignore $ignore "$@" + ;; +*) $cc -n32 -mips3 $flags $dynamic $fatal $ldignore $ignore "$@" + ;; +esac diff --git a/src/cmd/INIT/cc.sgi.mips3-o32 b/src/cmd/INIT/cc.sgi.mips3-o32 new file mode 100755 index 0000000..a9c6c9c --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips3-o32 @@ -0,0 +1,65 @@ +: sgi.mips3-o32 cc wrapper that generates mips3 o32 binaries : 2006-02-14 : + +HOSTTYPE=sgi.mips3-o32 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags= +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +$cc -o32 -mips3 $flags $dynamic $ldignore $ignore "$@" diff --git a/src/cmd/INIT/cc.sgi.mips4 b/src/cmd/INIT/cc.sgi.mips4 new file mode 100755 index 0000000..1300cd2 --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips4 @@ -0,0 +1,90 @@ +: sgi.mips4 cc wrapper that generates mips4 binaries : 2007-04-27 : + +HOSTTYPE=sgi.mips4 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags=-OPT:Olimit=0 +fatal=1035 +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $fatal in +?*) fatal="-diag_error $fatal" ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +case $1 in +-mips2) if test -d /usr/lib32 + then LD_LIBRARYN32_PATH=/lib32 $cc -32 -mips2 $flags $dynamic $ldignore $ignore "$@" + else $cc -mips2 $flags $ignore "$@" + fi + ;; +-mips3) $cc -n32 -mips3 $flags $dynamic $fatal $ldignore $ignore "$@" + ;; +*) case " $* " in + *" -ldl "*) + integer n=0 + for i + do case $i in + -ldl) ;; + *) a[n++]=$i ;; + esac + done + set -- ${a[@]} + esac + $cc -64 -mips4 $flags $dynamic $fatal $ldignore $ignore "$@" + ;; +esac diff --git a/src/cmd/INIT/cc.sgi.mips4-n32 b/src/cmd/INIT/cc.sgi.mips4-n32 new file mode 100755 index 0000000..0e1b562 --- /dev/null +++ b/src/cmd/INIT/cc.sgi.mips4-n32 @@ -0,0 +1,65 @@ +: sgi.mips4-n32 cc wrapper that generates mips4 n32 binaries : 2006-02-14 : + +HOSTTYPE=sgi.mips4-n32 + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=/usr/bin/cc +debug= +dynamic=-G0 +flags= +ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433 +ldignore=15,84,85,13 +optimize= + +case $_AST_cc_OPTIONS in +?*) eval $_AST_cc_OPTIONS ;; +esac +case $ignore in +?*) ignore="-woff $ignore" ;; +esac +case $ldignore in +?*) ifs=$IFS + IFS=, + v=$ldignore + ldignore= + for i in $v + do ldignore="$ldignore -Wl,-woff,$i" + done + IFS=$ifs + ;; +esac +case $debug in +?*) integer n=0 + for i + do case $i in + -g*) case $debug in + -) continue ;; + esac + i=$debug + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac +case $optimize in +?*) integer n=0 + for i + do case $i in + -O*) case $optimize in + -) continue ;; + esac + i=$optimize + ;; + esac + a[n++]=$i + done + set -- ${a[@]} + ;; +esac + +$cc -n32 -mips4 $flags $dynamic $ldignore $ignore "$@" diff --git a/src/cmd/INIT/cc.specialize b/src/cmd/INIT/cc.specialize new file mode 100755 index 0000000..87077b5 --- /dev/null +++ b/src/cmd/INIT/cc.specialize @@ -0,0 +1,35 @@ +: -O* specialization cc wrapper : 2011-11-11 : + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +cc=cc + +CCREPLACE='' # these (possibly empty) options replace -O* +CCALWAYS='' # these (possibly empty) options always set + +case $CCREPLACE in +'') ;; +*) case " $* " in + *" -O"*) + set '' "$@" '' + shift + while : + do a=$1 + shift + case $a in + '') break + ;; + -O*) set '' "$@" $CCREPLACE + ;; + *) set '' "$@" "$a" + ;; + esac + shift + done + ;; + esac + ;; +esac +$cc $CCALWAYS "$@" diff --git a/src/cmd/INIT/cc.unix.mc68k b/src/cmd/INIT/cc.unix.mc68k new file mode 100755 index 0000000..ebdfa0d --- /dev/null +++ b/src/cmd/INIT/cc.unix.mc68k @@ -0,0 +1,76 @@ +: 3B1/PC7300 unix.mc68k cc wrapper for ANSI C : 2002-09-01 : + +HOSTTYPE=unix.mc68k + +case " $* " in +*" -dumpmachine "*) echo $HOSTTYPE; exit ;; +esac + +# /bin/cc predates ANSI C; use gcc +# some headers depend on SYSTEM5 or mc68k being defined +# headers for Ethernet software are under /usr/ethernet/include +# both /usr/lib/libnet.a and /usr/lib/libcurses.a define select() +# -lcurses uses a version of select for napms(), but that +# implementation always returns an error if given file +# descriptors to watch +# the one in -lnet must be used if fds (instead of or in addition to +# a timeout) are of interest therefore, -lnet should be +# specified before -lcurses +# rename(old, new) in /usr/lib/libnet.a fails if new exists +# (permitted by ANSI/ISO C-1990 7.9.4.2) +# gcc -fpic doesn't work as there's no _GLOBAL_OFFSET_TABLE symbol + +cc="gcc" + +exec= +show=: +inc=0 +lib=0 +set '' -DSYSTEM5 -Dmc68k "$@" '' +shift +while : +do a=$1 + shift + case $a in + '') break + ;; + -lcurses|libcurses.a|*/libcurses.a) + lib=1 + set '' "$@" -lnet + shift + ;; + -lnet|libnet.a|*/libnet.a) + lib=1 + ;; + -o) a=$1 + shift + set '' "$@" -o + shift + ;; + -fpic) continue + ;; + -n) exec=: + continue + ;; + -v) show=echo + continue + ;; + -*) ;; + *) case $inc in + 0) inc=1 + set '' "$@" -I/usr/ethernet/include + shift + ;; + esac + ;; + esac + set '' "$@" "$a" + shift +done +case $lib in +0) set '' "$@" -lnet + shift + ;; +esac +$show $cc "$@" +$exec $cc "$@" diff --git a/src/cmd/INIT/crossexec.sh b/src/cmd/INIT/crossexec.sh new file mode 100644 index 0000000..9d73ee2 --- /dev/null +++ b/src/cmd/INIT/crossexec.sh @@ -0,0 +1,139 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: cross compiler a.out execution + +command=crossexec + +tmp=/tmp/cross$$ + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: crossexec (AT&T Labs Research) 2004-01-04 $ +] +'$USAGE_LICENSE$' +[+NAME?crossexec - cross compiler a.out execution] +[+DESCRIPTION?\bcrossexec\b runs a cross-compiled \acommand\a in an environment + that supports a cross-compilation architecture different from the + current host. The cross environment is determined by \acrosstype\a, + usually a host type name produced by \bpackage\b(1). \acrosstype\a + is used to find an entry in \b$HOME/.crossexec\b that specifies + the cross compiler host and access details.] +[+?The exit status of \bcrossexec\b is the exit status of \acommand\a.] +[+CROSS ENVIRONMENT FILE?\b$HOME/.crossexec\b contains one line for each + supported \acrosstype\a. Each line contains 5 tab separated fields. + Field default values are specified as \b-\b. The fields are:]{ + [+crosstype?The host type produced by \bpackage\b(1).] + [+host?The host name.] + [+user?The user name on \ahost\a. The default is the current user.] + [+dir?The directory to copy \acommand\a and execute it. The default + is the \auser\a \b$HOME\b on \ahost\a.] + [+shell?The command used to get shell access to \ahost\a. Currently + only \brsh\b and \bssh\b are supported.] + [+copy?The command used to copy \acommand\a to \ahost\a. Currently + only \brcp\b and \bscp\b are supported.] +} +[n:show?Show the underlying commands but do not execute.] + +crosstype command [ option ... ] [ file ... ] + +[+SEE ALSO?\brcp\b(1), \brsh\b(1), \bscp\b(1), \bssh\b(1)] +' + ;; +*) ARGV0="" + USAGE="crosstype command [ option ... ] [ file ... ]" + ;; +esac + +usage() +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +exec= + +# get the options and operands + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + n) exec=echo ;; + *) usage ;; + esac +done +shift $OPTIND-1 +case $# in +[01]) usage ;; +esac + +type=$1 +shift +cmd=$1 +shift + +# get the host info + +info=$HOME/.$command +if test ! -r $info +then echo "$command: $info: not found" >&2 + exit 1 +fi +ifs=${IFS-' + '} +while : +do IFS=' ' + read hosttype hostname usr dir sh cp + code=$? + IFS=$ifs + case $code in + 0) ;; + *) echo "$command: $type: unknown cross compiler host type" >&2 + exit 1 + ;; + esac + case $hosttype in + $type) break ;; + esac +done < $info + +# fill in the defaults + +case $usr in +-) cpu= shu= ;; +*) cpu=${usr}@ shu="-l $usr" ;; +esac +case $dir in +-) dir= ;; +esac +case $sh in +''|-) sh=ssh ;; +esac +case $cp in +''|-) cp=scp ;; +scp) cp="$cp -q" ;; +esac + +trap "rm -f $tmp" 0 1 2 3 15 +$exec $cp $cmd $cpu$hostname:$dir /dev/null; code=\$?; rm -f $cmd; echo $command: exit \$code >&2" $tmp +exit `sed -e '/^'$command': exit [0-9][0-9]*$/!d' -e 's/.* //' $tmp` diff --git a/src/cmd/INIT/db.c b/src/cmd/INIT/db.c new file mode 100644 index 0000000..5a3a7c1 --- /dev/null +++ b/src/cmd/INIT/db.c @@ -0,0 +1,37 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for sleepycat dbm compatibility + */ + +#define DB_DBM_HSEARCH 1 + +#if DB_DBM_HSEARCH +#include +#endif + +int +main() +{ + DBM* dbm = 0; + + dbm_close(dbm); + return 0; +} diff --git a/src/cmd/INIT/ditto.sh b/src/cmd/INIT/ditto.sh new file mode 100644 index 0000000..1141a0d --- /dev/null +++ b/src/cmd/INIT/ditto.sh @@ -0,0 +1,460 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: replicate directory hierarchies + +COMMAND=ditto +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $COMMAND" + USAGE=$' +[-? +@(#)$Id: ditto (AT&T Labs Research) 2010-11-22 $ +] +'$USAGE_LICENSE$' +[+NAME?ditto - replicate directory hierarchies] +[+DESCRIPTION?\bditto\b replicates the \asource\a directory hierarchy + to the \adestination\a directory hierarchy. Both \asource\a and + \adestination\a may be of the form + [\auser\a@]][\ahost\a:]][\adirectory\a]]. At least one of + \ahost\a: or \adirectory\a must be specified. The current user is used + if \auser@\a is omitted, the local host is used if \ahost\a: is + omitted, and the user home directory is used if \adirectory\a is + omitted.] +[+?Remote hosts and files are accessed via \bssh\b(1) or \brsh\b(1). \bksh\b(1), + \bpax\b(1), and \btw\b(1) must be installed on the local and remote hosts.] +[+?For each source file \bditto\b does one of these actions:]{ + [+chmod|chown?change the mode and/or ownership of the destination + file to match the source] + [+copy?copy the source file to the destination] + [+delete?delete the destination file] + [+skip?the destination file is not changed] +} +[+?The source and destination hierarchies are generated by \btw\b(1) with + the \b--logical\b option. An \b--expr\b option may + be specified to prune the search. The \btw\b searches are relative to + the \asource\a and \adestination\a directories.] +[c:checksum?Copy if the \btw\b(1) 32x4 checksum mismatches.] +[d:delete?Delete \adestination\a files that are not in the \asource\a.] +[e:expr?\btw\b(1) select expression.]:[tw-expression] +[m!:mode?Preserve file mode.] +[n:show?Show the operations but do not exectute.] +[o:owner?Preserve file user and group ownership.] +[p:physical?Generate source and destination hierarchies by \btw\b(1) with + the \b--physical\b option.] +[r:remote?The remote access protocol; either \bssh\b or + \brsh\b.]:[protocol:=ssh] +[u:update?Copy only if the \asource\a file is newer than the + \adestination\a file.] +[v:verbose?Trace the operations as they are executed.] +[D:debug?Enable the debug trace.] + +source destination + +[+SEE ALSO?\brdist\b(1), \brsync\b(1), \brsh\b(1), \bssh\b(1), \btw\b(1)] +' + ;; +*) ARGV0="" + USAGE="de:[tw-expression]mnouvD source destination" + ;; +esac + +usage() +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +parse() # id user@host:dir +{ + typeset id dir user host + id=$1 + dir=$2 + (( debug || ! exec )) && print -r $id $dir + if [[ $dir == *@* ]] + then + user=${dir%%@*} + dir=${dir#${user}@} + else + user= + fi + if [[ $dir == *:* ]] + then + host=${dir%%:*} + dir=${dir#${host}:} + else + host= + fi + if [[ $user ]] + then + user="-l $user" + if [[ ! $host ]] + then + host=$(hostname) + fi + fi + eval ${id}_user='$user' + eval ${id}_host='$host' + eval ${id}_dir='$dir' +} + +# initialize + +typeset -A chown chmod +typeset tw cp rm link +integer ntw=0 ncp=0 nrm=0 nlink=0 n + +typeset src_user src_host src_path src_type src_uid src_gid src_perm src_sum +typeset dst_user dst_host dst_path dst_type dst_uid dst_gid dst_perm dst_sum +integer src_size src_mtime src_eof +integer dst_size dst_mtime dst_eof + +integer debug=0 delete=0 exec=1 mode=1 owner=0 update=0 verbose=0 logical + +typeset remote=ssh trace +typeset checksum='"-"' pax="pax" +typeset paxreadflags="" paxwriteflags="--write --format=tgz --nosummary" + +tw[ntw++]=tw +(( logical=ntw )) +tw[ntw++]=--logical +tw[ntw++]=--chop +tw[ntw++]=--ignore-errors +tw[ntw++]=--expr=sort:name + +# grab the options + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + c) checksum=checksum ;; + d) delete=1 ;; + e) tw[ntw++]=--expr=\"$OPTARG\" ;; + m) mode=0 ;; + n) exec=0 verbose=1 ;; + o) owner=1 ;; + p) tw[logical]=--physical ;; + r) remote=$OPTARG ;; + u) update=1 ;; + v) verbose=1 ;; + D) debug=1 ;; + *) usage ;; + esac +done +shift $OPTIND-1 +if (( $# != 2 )) +then usage +fi +tw[ntw++]=--expr=\''action:printf("%d\t%d\t%s\t%s\t%s\t%-.1s\t%o\t%s\t%s\n", size, mtime, '$checksum', uid, gid, mode, perm, path, symlink);'\' +if (( exec )) +then + paxreadflags="$paxreadflags --read" +fi +if (( verbose )) +then + paxreadflags="$paxreadflags --verbose" +fi + +# start the source and destination path list generators + +parse src "$1" +parse dst "$2" + +# the |& command may exit before the exec &p +# the print sync + read delays the |& until the exec &p finishes + +if [[ $src_host ]] +then ($remote $src_user $src_host "{ test ! -f .profile || . ./.profile ;} && cd $src_dir && read && ${tw[*]}") 2>&1 |& +else (cd $src_dir && read && eval "${tw[@]}") 2>&1 |& +fi +exec 5<&p 7>&p +print -u7 sync +exec 7>&- + +if [[ $dst_host ]] +then ($remote $dst_user $dst_host "{ test ! -f .profile || . ./.profile ;} && cd $dst_dir && read && ${tw[*]}") 2>&1 |& +else (cd $dst_dir && read && eval "${tw[@]}") 2>&1 |& +fi +exec 6<&p 7>&p +print -u7 sync +exec 7>&- + +# scan through the sorted path lists + +if (( exec )) +then + src_skip=* + dst_skip=* +else + src_skip= + dst_skip= +fi +src_path='' src_eof=0 +dst_path='' dst_eof=0 +ifs=${IFS-$' \t\n'} +IFS=$'\t' +while : +do + # get the next source path + + if [[ ! $src_path ]] && (( ! src_eof )) + then + if read -r -u5 text src_mtime src_sum src_uid src_gid src_type src_perm src_path src_link + then + if [[ $text != +([[:digit:]]) ]] + then + print -u2 $COMMAND: source: "'$text'" + src_path= + continue + fi + src_size=$text + elif (( dst_eof )) + then + break + elif (( src_size==0 )) + then + exit 1 + else + src_path= + src_eof=1 + fi + fi + + # get the next destination path + + if [[ ! $dst_path ]] && (( ! dst_eof )) + then + if read -r -u6 text dst_mtime dst_sum dst_uid dst_gid dst_type dst_perm dst_path dst_link + then + if [[ $text != +([[:digit:]]) ]] + then + print -u2 $COMMAND: destination: $text + dst_path= + continue + fi + dst_size=$text + elif (( src_eof )) + then + break + elif (( dst_size==0 )) + then + exit 1 + else + dst_path= + dst_eof=1 + fi + fi + + # determine the { cp rm chmod chown } ops + + if (( debug )) + then + [[ $src_path ]] && print -r -u2 -f $': src %8s %10s %s %s %s %s %3s %s\n' $src_size $src_mtime $src_sum $src_uid $src_gid $src_type $src_perm "$src_path" + [[ $dst_path ]] && print -r -u2 -f $': dst %8s %10s %s %s %s %s %3s %s\n' $dst_size $dst_mtime $dst_sum $dst_uid $dst_gid $dst_type $dst_perm "$dst_path" + fi + if [[ $src_path == $dst_path ]] + then + if [[ $src_type != $dst_type ]] + then + rm[nrm++]=$dst_path + if [[ $dst_path != $dst_skip ]] + then + if [[ $dst_type == d ]] + then + dst_skip="$dst_path/*" + print -r rm -r "'$dst_path'" + else + dst_skip= + print -r rm "'$dst_path'" + fi + fi + fi + if [[ $src_type == l ]] + then if [[ $src_link != $dst_link ]] + then + cp[ncp++]=$src_path + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r cp "'$src_path'" + fi + fi + elif [[ $src_type != d ]] && { (( update && src_mtime > dst_mtime )) || (( ! update )) && { (( src_size != dst_size )) || [[ $src_sum != $dst_sum ]] ;} ;} + then + if [[ $src_path != . ]] + then + cp[ncp++]=$src_path + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r cp "'$src_path'" + fi + fi + else + if (( owner )) && [[ $src_uid != $dst_uid || $src_gid != $dst_gid ]] + then + chown[$src_uid.$src_gid]="${chown[$src_uid.$src_gid]} '$src_path'" + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r chown $src_uid.$src_gid "'$src_path'" + fi + if (( (src_perm & 07000) || mode && src_perm != dst_perm )) + then + chmod[$src_perm]="${chmod[$src_perm]} '$src_path'" + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r chmod $src_perm "'$src_path'" + fi + fi + elif (( mode && src_perm != dst_perm )) + then + chmod[$src_perm]="${chmod[$src_perm]} '$src_path'" + if [[ $src_path != $src_skip ]] + then + src_skip= + print -r chmod $src_perm "'$src_path'" + fi + fi + fi + src_path= + dst_path= + elif [[ ! $dst_path || $src_path && $src_path < $dst_path ]] + then + if [[ $src_path != . ]] + then + cp[ncp++]=$src_path + if [[ $src_path != $src_skip ]] + then + if [[ $src_type == d ]] + then + src_skip="$src_path/*" + print -r cp -r "'$src_path'" + else + src_skip= + print -r cp "'$src_path'" + fi + fi + fi + src_path= + elif [[ $dst_path ]] + then + if (( delete )) + then + rm[nrm++]=$dst_path + if [[ $dst_path != $dst_skip ]] + then + if [[ $dst_type == d ]] + then + dst_skip="$dst_path/*" + print -r rm -r "'$dst_path'" + else + dst_skip= + print -r rm "'$dst_path'" + fi + fi + fi + dst_path= + fi +done +IFS=$ifs + +(( exec )) || exit 0 + +# generate, transfer and execute the { rm chown chmod } script + +if (( ${#rm[@]} || ${#chmod[@]} || ${#chown[@]} )) +then + { + if (( verbose )) + then + print -r -- set -x + fi + print -nr -- cd "'$dst_dir'" + n=0 + for i in ${rm[@]} + do + if (( --n <= 0 )) + then + n=32 + print + print -nr -- rm -rf + fi + print -nr -- " '$i'" + done + for i in ${!chown[@]} + do + n=0 + for j in ${chown[$i]} + do + if (( --n <= 0 )) + then + n=32 + print + print -nr -- chown $i + fi + print -nr -- " $j" + done + done + for i in ${!chmod[@]} + do + n=0 + for j in ${chmod[$i]} + do + if (( --n <= 0 )) + then + n=32 + print + print -nr -- chmod $i + fi + print -nr -- " $j" + done + done + print + } | { + if (( ! exec )) + then + cat + elif [[ $dst_host ]] + then + $remote $dst_user $dst_host sh + else + $SHELL + fi + } +fi + +# generate, transfer and read back the { cp } tarball + +if (( ${#cp[@]} )) +then + { + cd $src_dir && + print -r -f $'%s\n' "${cp[@]}" | + $pax $paxwriteflags + } | { + if [[ $dst_host ]] + then + $remote $dst_user $dst_host "{ test ! -f .profile || . ./.profile ;} && { test -d \"$dst_dir\" || mkdir -p \"$dst_dir\" ;} && cd \"$dst_dir\" && gunzip | $pax $paxreadflags" + else + ( { test -d "$dst_dir" || mkdir -p "$dst_dir" ;} && cd "$dst_dir" && gunzip | $pax $paxreadflags ) + fi + } + wait +fi diff --git a/src/cmd/INIT/dl.c b/src/cmd/INIT/dl.c new file mode 100644 index 0000000..c710ad6 --- /dev/null +++ b/src/cmd/INIT/dl.c @@ -0,0 +1,33 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -ldl + */ + +#ifndef dlopen +#include +#endif + +int +main() +{ + dlopen("libdl.so",0); + return 0; +} diff --git a/src/cmd/INIT/execrate.sh b/src/cmd/INIT/execrate.sh new file mode 100644 index 0000000..71ba78d --- /dev/null +++ b/src/cmd/INIT/execrate.sh @@ -0,0 +1,179 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: wrapper for .exe challenged win32 systems/commands + +command=execrate + +bins='/bin /usr/bin /usr/sbin' + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: execrate (AT&T Labs Research) 2002-02-02 $ +] +'$USAGE_LICENSE$' +[+NAME?execrate - wrapper for .exe challenged commands] +[+DESCRIPTION?\bexecrate\b runs \acommand\a after checking the \afile\a + operands for standard semantics with respect to \bwin32\b \b.exe\b + suffix conventions. This command is only needed on \bwin32\b + systems that inconsistently handle \b.exe\b across library and + command interfaces. \acommand\a may be one of \bcat\b(1), \bchmod\b(1), + \bcmp\b(1), \bcp\b(1), \bln\b(1), \bmv\b(1), or \brm\b(1). + Only the 2 argument forms of \bcp\b, \bln\b and \bmv\b are handled. + Unsupported commands and commands requiring no change are + silently executed.] +[+?With no arguments \bexecrate\b exits with status 0 if the current system + is \b.exe\b challenged, 1 if the current system is normal.] +[n:show?Show the underlying commands but do not execute.] + +command [ option ... ] file ... + +[+SEE ALSO?\bwebster\b(1)] +' + usage() + { + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 + } + exec=1 + while getopts $ARGV0 "$USAGE" OPT + do case $OPT in + n) exec=0 ;; + *) usage ;; + esac + done + shift `expr $OPTIND - 1` + ;; +*) usage() + { + echo "Usage: execrate [ -n ] [ command [ option ... ] file ... ]" >&2 + exit 2 + } + exec=1 + while : + do case $1 in + -n) exec=0 ;; + -*) usage ;; + *) break ;; + esac + shift + done + ;; +esac +case $# in +0) if test ! -x /bin/cat.exe + then exit 1 # normal + fi + if /bin/cat /bin/cat >/dev/null 2>&1 + then exit 1 # normal + fi + exit 0 # challenged + ;; +1) usage + ;; +esac +case $1 in +*cat|*rm) + NUM=0 + ;; +*chgrp|*chmod) + NUM=1 + ;; +*cmp|*cp|*ln|*mv) + NUM=2 + ;; +*) case $exec in + 0) echo "$@" ;; + *) "$@" ;; + esac + exit + ;; +esac +CMD=$1 +shift +case $CMD in +*/*) ;; +*) for d in $bins + do if test -x $d/$1 -o -x $d/$1.exe + then CMD=$d/$1 + break + fi + done + ;; +esac +while : +do case $1 in + -*) CMD="$CMD $1" ;; + *) break ;; + esac + shift +done +case $exec in +0) CMD="echo $CMD" ;; +esac +case $NUM:$# in +*:0) ;; +1:*) CMD="$CMD $1" + NUM=0 + shift + ;; +esac +case $NUM:$# in +0:*) status=0 + for f + do if test "$f" -ef "$f".exe + then f=$f.exe + fi + $CMD "$f" + case $? in + 0) ;; + *) status=$? ;; + esac + done + exit $status + ;; +2:2) f=$1 + case $f in + *.exe) ;; + *) if test "$f" -ef "$f".exe + then f=$f.exe + fi + ;; + esac + case $f in + *.exe) if test -d "$2" + then t=$2/$f + else t=$2 + fi + case $t in + */*) b=`basename "$t"` ;; + *) b=$t ;; + esac + case $b in + *.*) $CMD "$f" "$t"; exit ;; + *) $CMD "$f" "$t".exe; exit ;; + esac + ;; + esac + ;; +esac +$CMD "$@" diff --git a/src/cmd/INIT/filter.sh b/src/cmd/INIT/filter.sh new file mode 100644 index 0000000..2637a58 --- /dev/null +++ b/src/cmd/INIT/filter.sh @@ -0,0 +1,98 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: convert command that operates on file args to pipeline filter + +command=filter + +tmp=/tmp/$command$$ +suf= + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: filter (AT&T Labs Research) 2001-05-31 $ +] +'$USAGE_LICENSE$' +[+NAME?filter - run a command in stdin/stdout mode] +[+DESCRIPTION?\bfilter\b runs \acommand\a in a mode that takes input from + the \afile\a operands, or from the standard input if no \afile\a + operands are specified, and writes the results to the standard output. + It can be used to run commands like \bsplit\b(1), that normally modify + \afile\a operands in-place, in pipelines. The \afile\a operands are + not modified; \acommand\a is run on copies in \b/tmp\b.] + +command [ option ... ] [ file ... ] + +[+SEE ALSO?\bstrip\b(1)] +' + ;; +*) ARGV0="" + USAGE="command [ option ... ] [ file ... ]" + ;; +esac + +usage() +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + *) usage ;; + esac +done +shift `expr $OPTIND - 1` +case $# in +0) usage ;; +esac + +cmd=$1 +while : +do shift + case $# in + 0) break ;; + esac + case $1 in + -*) cmd="$cmd $1" ;; + *) break ;; + esac +done +trap 'rm -f $tmp$suf' 0 1 2 3 15 +case $# in +0) cat > $tmp + $cmd $tmp + ;; +*) for file + do suf=${file##*/} + case $suf in + *.*) suf=.${suf#*.} ;; + *) suf= ;; + esac + cp $file $tmp$suf || exit 1 + chmod u+rwx $tmp$suf || exit 1 + $cmd $tmp$suf || exit 1 + cat $tmp$suf + rm -f $tmp$suf + done + ;; +esac diff --git a/src/cmd/INIT/gdbm.c b/src/cmd/INIT/gdbm.c new file mode 100644 index 0000000..cc0a9f6 --- /dev/null +++ b/src/cmd/INIT/gdbm.c @@ -0,0 +1,37 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lgdbm + */ + +#define _hdr_gdbm_ndbm 1 + +#if _hdr_gdbm_ndbm +#include +#endif + +int +main() +{ + DBM* dbm = 0; + + dbm_close(dbm); + return 0; +} diff --git a/src/cmd/INIT/gdbm1.c b/src/cmd/INIT/gdbm1.c new file mode 100644 index 0000000..6ad2071 --- /dev/null +++ b/src/cmd/INIT/gdbm1.c @@ -0,0 +1,37 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lgdbm + */ + +#define _hdr_gdbm_ndbm 1 + +#if _hdr_gdbm_ndbm +#include +#endif + +int +main() +{ + DBM* dbm = 0; + + dbm_close(dbm); + return 0; +} diff --git a/src/cmd/INIT/gdbm2.c b/src/cmd/INIT/gdbm2.c new file mode 100644 index 0000000..1b9a48f --- /dev/null +++ b/src/cmd/INIT/gdbm2.c @@ -0,0 +1,37 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lgdbm + */ + +#define _hdr_ndbm 1 + +#if _hdr_ndbm +#include +#endif + +int +main() +{ + DBM* dbm = 0; + + dbm_close(dbm); + return 0; +} diff --git a/src/cmd/INIT/hello.c b/src/cmd/INIT/hello.c new file mode 100755 index 0000000..2a8e2d1 --- /dev/null +++ b/src/cmd/INIT/hello.c @@ -0,0 +1,23 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#ifndef printf +#include +#endif +int main() { int new = 0; printf("hello world\n"); return new;} diff --git a/src/cmd/INIT/hosttype.tst b/src/cmd/INIT/hosttype.tst new file mode 100644 index 0000000..7a64588 --- /dev/null +++ b/src/cmd/INIT/hosttype.tst @@ -0,0 +1,6 @@ +hp.pa hostname 9000/730 hp9000s700 HP-UX hostname A.09.01 A +linux-aout.i386 hostname i586 i386 linux hostname 1.1.59 #1 +sgi.mips2 hostname.domain IP22 mips IRIX hostname 5.2 02282016 +osf.alpha hostname.domain alpha alpha OSF1 hostname.domain V3.2 62 +sun4 hostname.domain sun4 sparc SunOS hostname.domain 4.1.1 1 sun4c +sol.sun4 hostname.domain sun4 sparc SunOS hostname.domain 5.4 Generic_101945-13 diff --git a/src/cmd/INIT/hurl.sh b/src/cmd/INIT/hurl.sh new file mode 100644 index 0000000..60e8a6b --- /dev/null +++ b/src/cmd/INIT/hurl.sh @@ -0,0 +1,207 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: copy http url data + +command=hurl +agent="$command/2009-01-20 (AT&T Research)" +authorize= +verbose=0 + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: hurl (AT&T Research) 2009-01-20 $ +] +'$USAGE_LICENSE$' +[+NAME?hurl - copy http url data] +[+DESCRIPTION?\bhurl\b copies the data for the \bhttp\b \aurl\a operand + to the standard output. The \aurl\a must be of the form + \b[http://]]\b\ahost\a[\b:\b\aport\a]]\b/\b\apath\a. The default + \aport\a is \b80\b.] +[+?\bhurl\b is a shell script that attempts to access the \aurl\a by + these methods:]{ + [+/dev/tcp/\ahost\a\b/80\b?Supported by \bksh\b(1) and recent + \bbash\b(1).] + [+wget -nv -O - \aurl\a?] + [+lynx -source \aurl\a?] + [+curl -s -L -o - \aurl\a?] +} +[a:authorize?The url authorization user name and password, separated + by \b:\b (one colon character.)]:[user::password] +[s:size?Terminate the data transmission after \abytes\a have been + transferred.]:[bytes] +[v:verbose?Verbose trace.] + +url + +[+SEE ALSO?\bcurl\b(1), \blynx\b(1), \bwget\b(1)] +' + ;; +*) ARGV0="" + USAGE="a:v" + ;; +esac + +usage() +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +integer limit=0 total=0 block=8*1024 + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + a) authorize=$OPTARG ;; + s) limit=$OPTARG ;; + v) verbose=1 ;; + esac +done +shift `expr $OPTIND - 1` + +url=$1 +AUTHORIZE= + +exec 9<&0 + +while : +do test 0 != $verbose && echo "$command: url=$url" >&2 + case $url in + *://*/*)prot=${url%%:*} + url=${url#*://} + ;; + *) prot=http + ;; + esac + host=$url + path=/${host#*/} + host=${host%%/*} + case $host in + *:+([0-9])) + port=${host##*:} + host=${host%:*} + ;; + *) port=80 + ;; + esac + test 0 != $verbose && echo "$command: prot=$prot host=$host port=$port path=$path" >&2 + case $prot in + http) if (eval "exec >" || exit 0) 2>/dev/null && + eval "exec 8<> /dev/tcp/\$host/$port" 2>/dev/null + then test 0 != $verbose && echo "$command: using /dev/tcp/$host/$port" >&2 + if ! echo "GET $path HTTP/1.0 +Host: $host +User-Agent: $agent ${AUTHORIZE} + " >&8 + then echo "$command: $host: write error" + exit 1 + fi + { + if ! read prot code text + then echo "$command: $host: read error" >&2 + exit 1 + fi + code=${code%:*} + type=Basic + realm=access + test 0 != $verbose && echo "$command: prot=$prot code=$code $text" >&2 + while : + do if ! read head data + then echo "$command: $host: read error" >&2 + exit 1 + fi + test 0 != $verbose && echo "$command: head=$head $data" >&2 + case $head in + Location:) + case $code in + 30[123])url=$data + continue 2 + ;; + esac + ;; + WWW-Authenticate:) + set -- $data + type=$1 + shift + eval "$@" + realm=${realm%$'\r'} + ;; + ''|?) break + ;; + esac + done + case $code in + 200) if (( limit )) + then (( limit = (limit + block - 1) / block)) + dd bs=$block count=$limit silent=1 + else cat + fi + exit + ;; + 401) { + if [[ $AUTHORIZE || $type != Basic ]] + then print authorization failed + exit 1 + fi + if [[ ! $authorize ]] + then if [[ ! -t 0 ]] + then print authorization failed + exit 1 + fi + print -n "Enter user name for $realm: " + read -u9 user + print -n "Password: " + trap 'stty echo <&9' 0 1 2 3 15 + stty -echo + read password + stty echo + print + trap - 0 1 2 3 15 + authorize=$user:$password + fi + AUTHORIZE=$'\nAuthorization: '$type' '$(print -n -r -- "$authorize" | uuencode -h -x base64)$'\r' + } <&9 >&2 + continue 2 + ;; + *) echo "$0: $url: $code: $text" >&2 + exit 1 + ;; + esac + } <&8 + elif wget ${authorize:+--http-user="${authorize%:*}"} ${password:+--http-passwd="${password##*:}"} -nv -O - $url 2>/dev/null + then test 0 != $verbose && echo "$command: using wget" >&2 + exit + elif lynx ${authorize:+-auth "$authorize"} -source $url 2>/dev/null + then test 0 != $verbose && echo "$command: using wget" >&2 + exit + elif curl ${authorize:+-u "$authorize"} -s -L -o - $url 2>/dev/null + then test 0 != $verbose && echo "$command: using curl" >&2 + exit + else echo "$command: $url: { /dev/tcp/$host/$port wget curl } failed" >&2 + exit 1 + fi + ;; + *) echo "$command: $prot: protocol not supported" >&2 + exit 1 + ;; + esac +done diff --git a/src/cmd/INIT/iconv.c b/src/cmd/INIT/iconv.c new file mode 100644 index 0000000..64f2797 --- /dev/null +++ b/src/cmd/INIT/iconv.c @@ -0,0 +1,29 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#ifndef iconv +#include +#endif + +int +main() +{ + iconv(0, 0, 0, 0, 0); + return 0; +} diff --git a/src/cmd/INIT/iffe.sh b/src/cmd/INIT/iffe.sh new file mode 100644 index 0000000..cfd216c --- /dev/null +++ b/src/cmd/INIT/iffe.sh @@ -0,0 +1,4639 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2012 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +# Glenn Fowler & Phong Vo +# AT&T Research +# +# test if feature exists +# this script is written to make it through all sh variants +# +# NOTE: .exe a.out suffix and [\\/] in path patterns for dos/nt + +case $-:$BASH_VERSION in +*x*:[0123456789]*) : bash set -x is broken :; set +ex ;; +esac + +command=iffe +version=2012-02-23 # update in USAGE too # + +compile() # $cc ... +{ + "$@" 2>$tmp.err + _compile_status=$? + if test -s $tmp.err + then cat $tmp.err >&2 + case $_compile_status in + [1-9]|[1-9][0-9]|1[01][0-9]|12[0-7]) + if egrep -i -c 'terminated with signal|core dump|segmentation fault' $tmp.err >&$nullout + then _compile_status=139 + fi + ;; + esac + fi + case $_compile_status in + ?|??|1[01]?|12[0-8]|25?) + ;; + *) echo "$command: $@" >&$stderr + cat $tmp.err >&$stderr + echo "$command: $1: core dump or fatal interruption -- results inconclusive" >&$stderr + exit $_compile_status + ;; + esac + return $_compile_status +} + +is_hdr() # [ - ] [ file.c ] hdr +{ + case $1 in + -) _is_hdr_flag=-; shift ;; + *) _is_hdr_flag= ;; + esac + case $1 in + *.c) _is_hdr_file=$1; shift ;; + *) _is_hdr_file=$tmp.c ;; + esac + is hdr $1 + compile $cc -c $_is_hdr_file <&$nullin >&$nullout 2>$tmp.e + _is_hdr_status=$? + case $_is_hdr_status in + 0) if test -s $tmp.e + then case `grep '#.*error' $tmp.e` in + ?*) _is_hdr_status=1 ;; + esac + fi + ;; + esac + case $_is_hdr_status in + 0) success $_is_hdr_flag + ;; + *) case $debug in + 3) cat $tmp.e >&$stderr ;; + esac + failure $_is_hdr_flag + ;; + esac + return $_is_hdr_status +} + +pkg() # package +{ + case $1 in + '') pth=`getconf PATH 2>/dev/null` + case $pth in + '') pth="/bin /usr/bin" ;; + *:*) pth=`echo "$pth" | sed 's/:/ /g'` ;; + esac + return + ;; + '<') shift + ;; + *) return + ;; + esac + case $1 in + X|X11*) i="openwin" + case $1 in + X) set X11 ;; + esac + case $1 in + X11) case $# in + 1) set $1 6 5 4 ;; + esac + ;; + esac + ;; + *) i= + ;; + esac + pth="{ usr . - . contrib local $i - . share - . lib - $1" + i=$1 + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + '>') shift; break ;; + esac + pth="$pth ${i}R$1 ${i}.$1" + done + pth="$pth . } $*" +} + +is() # op name +{ + case $verbose in + 1) case $complete in + 1) failure ;; + esac + oo=$1 + shift + case $1 in + ?*) yy=is + ii=$1 + complete=1 + case $oo in + cmd) mm="a command" ;; + dat) mm="a library data symbol" ;; + dfn) mm="a macro with extractable value" ;; + exp) mm="true" ;; + hdr) mm="a header" ;; + id) mm="an identifier" ;; + lcl) mm="a native header" ;; + key) mm="a reserved keyword" ;; + lib) mm="a library function" ;; + LIB) case $2 in + "") mm="a library" ;; + *) ii=$*; mm="a library group" ;; + esac + ;; + mac) mm="a macro" ;; + mem) mm="a member of $2" ;; + mth) mm="a math library symbol" ;; + nos) mm="a non-opaque struct" ;; + npt) mm="a symbol that needs a prototype" ;; + num) mm="a numeric constant or enum" ;; + nxt) mm="an include path for the native header" ;; + opt) mm="set in \$PACKAGE_OPTIONS" ;; + pth) mm="a file" ;; + run) yy="capture output of" mm= ;; + siz) mm="a type with known size" ;; + sym) mm="a typed variable" ;; + sys) mm="a system header" ;; + typ) mm="a type or typedef" ;; + val) yy="determine" mm="value" ;; + *) yy= mm= ;; + esac + case $ii in + [abcdefghijklmnopqrstuvwxyz]*[abcdefghijklmnopqrstuvwxyz]'{') ii="$ii ... }end" ;; + esac + $show "$command: test:" $yy $ii $mm "...$SHOW" >&$stderr + complete=1 + ;; + esac + ;; + esac +} + +success() +{ + case $1 in + -) shift + ;; + *) case $result in + UNKNOWN) result=SUCCESS ;; + esac + case $1 in + +) return ;; + esac + ;; + esac + case $complete:$verbose in + 1:1) case $suspended in + 1) suspended=0 + $show "$command: test:" $yy $ii $mm "...$SHOW" >&$stderr + ;; + esac + complete=0 + case $# in + 0) mm="yes" ;; + *) mm="'$*'" ;; + esac + case $debug in + 0) echo " $mm" >&$stderr ;; + *) echo "$command: ... $mm" >&$stderr ;; + esac + ;; + esac +} + +failure() +{ + case $1 in + -) shift ;; + *) result=FAILURE + case $1 in + +) return ;; + esac + ;; + esac + case $complete:$verbose in + 1:1) case $suspended in + 1) suspended=0 + $show "$command: test:" $yy $ii $mm "...$SHOW" >&$stderr + ;; + esac + complete=0 + case $group in + '') case $# in + 0) mm="no" ;; + *) mm=$* ;; + esac + ;; + *) mm= + ;; + esac + case $debug in + 0) echo " $mm" >&$stderr ;; + *) echo "$command: ... $mm" >&$stderr ;; + esac + ;; + esac +} + +# report +# +# - ignore global status +# -0 normal sense +# -1 inverted sense if ! def +# status test status 0:success *:failure +# success success comment +# failure failure comment +# default default setting comment +# +# globals +# +# $not invert test sense +# $M test variable +# $m test macro +# $v default macro + +report() # [-] [-0] [-1] status value success failure default +{ + case $1 in + -) _report_ignore=$1 + shift + ;; + *) _report_ignore= + ;; + esac + _report_not=$not + case $1 in + -0) shift + ;; + -1) shift + case $def in + ''|-) case $_report_not in + 1) _report_not= ;; + *) _report_not=1 ;; + esac + ;; + esac + ;; + esac + _report_status=$1 + case $_report_ignore:$_report_status in + -:*) ;; + *:0) success $_report_ignore + ;; + *) failure $_report_ignore + case $group in + ?*) return ;; + esac + ;; + esac + _report_value=$2 + case $_report_not in + 1) case $_report_status in + 0) _report_status=1 ;; + *) _report_status=0 ;; + esac + _report_success=$4 + _report_failure=$3 + ;; + *) _report_success=$3 + _report_failure=$4 + ;; + esac + _report_default=$5 + case $_report_status in + 0) case $M in + *-*) ;; + *) usr="$usr$nl#define $m $_report_value" + case $_report_success in + ''|-) ;; + *) case $define in + 1) echo "#define $m $_report_value /* $_report_success */" ;; + n) echo "$m=$_report_value" + esac + ;; + esac + eval $m=\'$_report_value\' + ;; + esac + ;; + *) case $M in + *-*) ;; + *) case $_report_failure in + ''|-) ;; + *) case $define$all$config$undef in + 1?1?|1??1)echo "#undef $m /* $_report_failure */" ;; + 11??) echo "#define $m 0 /* $_report_failure */" ;; + n1?1) echo "$m=" ;; + n1??) echo "$m=0" ;; + esac + ;; + esac + case $_report_default in + ''|-) ;; + *) case $define$set in + 1?*) echo "#define $v $set /* $_report_default */" ;; + n?*) echo "$v=$set" ;; + esac + ;; + esac + eval $m=0 + ;; + esac + ;; + esac +} + +noisy() +{ + case $complete:$verbose in + 1:1) suspended=1 + echo >&$stderr + ;; + esac +} + +here_broken=0 + +literal() # line that echo might process +{ + if cat <&$stderr + ;; + esac + sh -c "cat <&$stderr + ;; + esac + sh -c "cat < "$1" + ;; + *) if cat > "$1" <&$stderr + ;; + esac + sh -c "cat > \"$1\" < $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then echo "(;" > $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then cctest="should not compile '(;'" + fi + else cctest="should compile 'int i = 1;'" + fi + case $cctest in + "") cctest=0 + ;; + *) echo "$command: $cc: not a C compiler: $cctest" >&$stderr + exit 1 + ;; + esac +} + +checkread() +{ + case $cctest in + "") checkcc ;; + esac + case $posix_read in + -no) ;; + *) posix_read=`(read -r _checkread_line; echo $_checkread_line) 2>/dev/null <= 0) + { + if (c == ' ' || c == '\\t') + { + if (k < sizeof(s)) + s[k++] = c; + continue; + } + if (k > 1 && c != '#' && c != '\\n' && c != '\\r') + write(1, s + 1, k - 1); + k = -1; + } + if (c == '\\r') + { + r = c; + if (read(0, &c, 1) == 1 && c != '\\n') + write(1, &r, 1); + } + write(1, &c, 1); + if (c == '\\n') + return 0; + } + return 1; + }" + if compile $cc -o ${tmp}r.exe ${tmp}r.c >&$nullout + then posix_read=${tmp}r.exe + else echo "$command: cannot compile read -r workaround" >&$stderr + exit 1 + fi + ;; + esac +} + +execute() +{ + if test "" != "$cross" + then crossexec $cross "$@" + _execute_=$? + elif test -d /NextDeveloper + then "$@" <&$nullin >&$nullout + _execute_=$? + "$@" <&$nullin | cat + else "$@" + _execute_=$? + fi + return $_execute_ +} + +exclude() +{ + case $excludes in + '') return 0 ;; + esac + for _exclude_var + do eval _exclude_old=\$$_exclude_var + case $_exclude_old in + *" -I"*);; + *) continue ;; + esac + _exclude_new= + _exclude_sep= + for _exclude_arg in $_exclude_old + do _exclude_skip= + for _exclude_dir in $excludes + do case $_exclude_arg in + -I$_exclude_dir|-I*/$_exclude_dir) + _exclude_skip=1 + break; + ;; + esac + done + case $_exclude_skip in + '') _exclude_new="$_exclude_new$_exclude_sep$_exclude_arg" + _exclude_sep=" " + ;; + esac + done + eval $_exclude_var=\$_exclude_new + case $debug in + 0) ;; + *) echo $command: exclude $_exclude_var: "$_exclude_old => $_exclude_new" >&$stderr + ;; + esac + done +} + +all=0 +apis= +binding="-dy -dn -Bdynamic -Bstatic -Wl,-ashared -Wl,-aarchive -call_shared -non_shared '' -static" +complete=0 +config=0 +defhdr= +define=1 +explicit=0 +iff= +usr= +cross= +debug=0 +deflib= +dir=FEATURE +excludes= +executable="test -x" +exists="test -e" +gothdr= +gotlib= +idno= +idyes= +ifs=${IFS-' + '} +in= +includes= +intrinsic= +libpaths="LD_LIBRARY_PATH LD_LIBRARYN32_PATH LD_LIBRARY64_PATH LIBPATH SHLIB_PATH" + LD_LIBRARY_PATH_default=:/lib:/usr/lib + LD_LIBRARYN32_PATH_default=:/lib32:/usr/lib32 + LD_LIBRARY64_PATH_default=:/lib64:/usr/lib64 + LIBPATH_default=:/lib:/usr/lib + SHLIB_PATH_default=:/shlib:/usr/shlib:/lib:/usr/lib +nl=" +" +optimize=1 +occ=cc +one= +out= +posix_read=-check +case `(set -f && set x * && echo $# && set +f) 2>/dev/null` in +2) posix_noglob="set -f" posix_glob="set +f" ;; +*) case `(set -F && set x * && echo $# && set +F) 2>/dev/null` in + 2) posix_noglob="set -F" posix_glob="set +F" ;; + *) posix_noglob=":" posix_glob=":" ;; + esac + ;; +esac +protoflags= +puthdr= +putlib= +pragma= +case $RANDOM in +$RANDOM)shell=bsh + ($executable .) 2>/dev/null || executable='test -r' + ($exists .) 2>/dev/null || exists='test -r' + ;; +*) case $BASH_VERSION in + ?*) shell=bash ;; + *) shell=ksh ;; + esac + ;; +esac +reallystatic= +reallystatictest= +regress= +static=. +statictest= +case $COTEMP in +"") case $HOSTNAME in + ""|?|??|???|????|????) + tmp=${HOSTNAME} + ;; + *) case $shell in + bsh) eval `echo $HOSTNAME | sed 's/\\(....\\).*/tmp=\\1/'` ;; + *) eval 'tmp=${HOSTNAME%${HOSTNAME#????}}' ;; + esac + ;; + esac + tmp=${tmp}$$ + ;; +*) tmp=x${COTEMP} + ;; +esac +COTEMP=${tmp} +export COTEMP +case $tmp in +./*) ;; +??????????*) + case $shell in + bsh) eval `echo $tmp | sed 's/\\(.........\\).*/tmp=\\1/'` ;; + *) eval 'tmp=${tmp%${tmp#?????????}}' ;; + esac + ;; +?????????) + ;; +????????) + tmp=F$tmp + ;; +esac +case $tmp in +./*) ;; +*) tmp=./$tmp ;; +esac +undef=0 +verbose=0 +vers= + +# options -- `-' for output to stdout otherwise usage + +case $1 in +-) out=-; shift ;; +esac +set= + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: iffe (AT&T Research) 2012-02-23 $ +] +'$USAGE_LICENSE$' +[+NAME?iffe - C compilation environment feature probe] +[+DESCRIPTION?\biffe\b is a command interpreter that probes the C + compilation environment for features. A feature is any file, option + or symbol that controls or is controlled by the C compiler. \biffe\b + tests features by generating and compiling C programs and observing + the behavior of the C compiler and generated programs.] +[+?\biffe\b statements are line oriented. Statements may appear in the + operand list with the \b:\b operand or \bnewline\b as the line + delimiter. The standard input is read if there are no command + line statements or if \afile\a\b.iffe\b is omitted.] +[+?Though similar in concept to \bautoconf\b(1) and \bconfig\b(1), there + are fundamental differences. The latter tend to generate global + headers accessed by all components in a package, whereas \biffe\b is + aimed at localized, self contained feature testing.] +[+?Output is generated in \bFEATURE/\b\atest\a by default, where \atest\a is + the base name of \afile\a\b.iffe\b or the \biffe\b \brun\b + file operand. Output is first generated in a temporary file; the + output file is updated if it does not exist or if the temporary file + is different. If the first operand is \b-\b then the output is written + to the standard output and no update checks are done.] +[+?Files with suffixes \b.iffe\b and \b.iff\b are assumed to contain + \biffe\b statements.] +[a:all?Define failed test macros \b0\b. By default only successful test macros + are defined \b1\b.] +[c:cc?Sets the C compiler name and flags to be used in the feature + tests.]:[C-compiler-name [C-compiler-flags ...]]] +[C:config?Generate \bconfig\b(1) style \aHAVE_\a* macro names. This implies + \b--undef\b. Since \bconfig\b(1) has inconsistent naming conventions, + the \bexp\b op may be needed to translate from the (consistent) + \biffe\b names. Unless otherwise noted a \bconfig\b macro name + is the \biffe\b macro name prefixed with \bHAVE\b and converted to + upper case. \b--config\b is set by default if the command arguments + contain a \brun\b op on an input file with the base name \bconfig\b.] +[d:debug?Sets the debug level. Level 0 inhibits most + error messages, level 1 shows compiler messages, and + level 2 traces internal \biffe\b \bsh\b(1) actions and does + not remove core dumps on exit.]#[level] +[D:define?Successful test macro definitions are emitted. This is the default.] +[E:explicit?Disable implicit test output.] +[F:features?Sets the feature test header to \ahdr\a. This header typically + defines *_SOURCE feature test macros.]:[hdr:=NONE] +[i:input?Sets the input file name to \afile\a, which + must contain \biffe\b statements.]:[file] +[I:include?Adds \b-I\b\adir\a to the C compiler flags.]:[dir] +[L:library?Adds \b-L\b\adir\a to the C compiler flags.]:[dir] +[n:name-value?Output \aname\a=\avalue\a assignments only.] +[N!:optimize?\b--nooptimize\b disables compiler optimization options.] +[o:output?Sets the output file name to \afile\a.]:[file] +[O:stdio?Sets the standard io header to \ahdr\a.]:[hdr:=stdio.h] +[e:package?Sets the \bproto\b(1) package name to \aname\a.]:[name] +[p:prototyped?Emits \b#pragma prototyped\b at the top of the + output file. See \bproto\b(1).] +[P:pragma?Emits \b#pragma\b \atext\a at the top of the output file.]:[text] +[r:regress?Massage output for regression testing.] +[s:shell?Sets the internal shell name to \aname\a. Used for debugging + Bourne shell compatibility (otherwise \biffe\b uses \aksh\a constructs + if available). The supported names are \bksh\b, \bbsh\b, \bbash\b, and + \bosh\b. \bosh\b forces the \bread -r\b compatibility read command to + be compiled and used instead of \bread -r\b. The default is determined + by probing the shell at startup.]:[name] +[S:static?Sets the C compiler flags that force static linking. If not set + then \biffe\b probes the compiler to determine the flags. \biffe\b + must use static linking (no dlls) because on some systems missing + library symbols are only detected when referenced at runtime from + dynamically linked executables.]:[flags] +[u:undef?\b#undef\b failed test macros. By default only successful test macros + are defined \b1\b.] +[v:verbose?Produce a message line on the standard error for each test as + it is performed.] +[x:cross?Some tests compile an executable (\ba.out\b) and then run it. + If the C compiler is a cross compiler and the executable format is + incompatible with the execution environment then the generated + executables must be run in a different environment, possibly on + another host. \acrosstype\a is the HOSTTYPE for generated executables + (the \bpackage\b(1) command generates a consistent HOSTTYPE namespace). + Generated executables are run via \bcrossexec\b(1) with \acrosstype\a + as the first argument. \bcrossexec\b supports remote execution for + cross-compiled executables. See \bcrossexec\b(1) for + details.]:[crosstype] +[X:exclude?Removes \b-I\b\adir\a and \b-I\b*/\adir\a C compiler flags.]:[dir] + +[ - ] [ file.iffe | statement [ : statement ... ] ] + +[+SYNTAX?\biffe\b input consists of a sequence of statement lines. Statements + that span more than one line contain \abegin\a\b{\b as the last + operand (where \abegin\a is command specific) and zero + or more data lines terminated by a line containing + \b}end\b as the first operand. The statement syntax is: + [\aname\a \b=\b]] [\b!\b]] \atest\a[,\atest\a...]] [\b-\b]] + [\aarg\a[,\aarg\a...]]]] [\aprereq\a ...]] + [\abegin\a{ ... |\bend\b ...]] [= [\adefault\a]]]]. + \atest\as and \aarg\as may be combined, separated by commas, to perform + a set of tests on a set of arguments. \aname\a \b=\b before \atest\a + overrides the default test variable and macro name, and \b-\b after + \atest\a performs the test but does not define the test variable and + macro values. \b!\b before \atest\a inverts the test sense for \bif\b, + \belif\b, and \byes{\b and \bno{\b blocks.] +[+?\aprereq\as are used when applying the features tests and may be + combinations of:]{ + [+compiler options?\b-D\b*, \b-L\b*, etc.] + [+library references?\b-l\b*, *\b.a\b, etc. \b_LIB_\b\aname\a + is defined to be 1 if \b-l\b\aname\a is a library.] + [+header references?*\b.h\b. \a_dir_name\a is defined to be 1 + if \adir/name\a\b.h\b is a header, or if \adir\a is + omitted, \b_hdr_\b\aname\a is defined to be 1 if + \aname\a\b.h\b is a header.] + [+-?Prereq grouping mark; prereqs before the first \b-\b are + passed to all feature tests. Subsequent groups + are attempted in left-to-right order until the first + successful group is found.] + } +[+?\abegin\a\b{\b ... \b}end\b delimit multiline code blocks that override + or augment the default code provided by \biffe\b. User supplied code + blocks should be compatible with the K&R, ANSI, and C++ C language + dialects for maximal portability. In addition to all macro definitions + generated by previous tests, all generated code contains the + following at the top to hide dialect differences:]{ + [+ ?#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)] + [+ ?#define _STD_ 1] + [+ ?#define _ARG_(x) x] + [+ ?#define _VOID_ void] + [+ ?#else] + [+ ?#define _STD_ 0] + [+ ?#define _ARG_(x) ()] + [+ ?#define _VOID_ char] + [+ ?#endif] + [+ ?#if defined(__cplusplus)] + [+ ?#define _BEGIN_EXTERNS_ extern "C" {] + [+ ?#define _END_EXTERNS_ }] + [+ ?#else] + [+ ?#define _BEGIN_EXTERNS_] + [+ ?#define _END_EXTERNS_] + [+ ?#endif] + [+ ?#define _NIL_(x) ((x)0)] + [+ ?#include ] + } +[+?= \adefault\a may be specified for the \bkey\b, \blib\b, \bmac\b, \bmth\b + and \btyp\b tests. If the test fails for \aarg\a then + \b#define\b \aarg\a \adefault\a is emitted. \bkey\b accepts multiple + \b= \b\adefault\a values; the first valid one is used.] +[+?Each test statement generates a portion of a C language header that contains + macro defintions, comments, and other text corresponding to the feature + tests. \b#ifndef _def_\b\aname\a\b_\b\adirectory\a ... + \b#endif\b guards the generated header from multiple \b#include\bs, + where \aname\a is determined by either the \brun\b statement input file + name if any, or the first \atest\a in the first statement, and \adirectory\a + is the basename component of either the \brun\b statement file, if any, + or the current working directory. The output file name is determined + in this order:]{ + [+-?If the first command line operand is \b-\b then the output + is written to the standard output.] + [+--output=\afile\a?Output is \afile\a.] + [+set out \afile\a?Output is \afile\a.] + [+[run]] [\adirectory\a/]]\abase\a[\a.suffix\a]]?Output is + \bFEATURE/\b\abase\a.] + } +[+?Generated \biffe\b headers are often referenced in C source as: + \b#include "FEATURE/\b\afile\a". The \bnmake\b(1) base rules contain + metarules for generating \bFEATURE/\b\afile\a from + \bfeatures/\b\afile\a[\asuffix\a]], where \asuffix\a may be omitted, + \b.c\b, or \b.sh\b (see the \brun\b test below). Because + \b#include\b prerequisites are automatically detected, \bnmake\b(1) + ensures that all prerequisite \biffe\b headers are generated before + compilation. Note that the directories are deliberately named + \bFEATURE\b and \bfeatures\b to keep case-ignorant file systems + happy.] +[+?The feature tests are:]{ + [+# \acomment\a?Comment line - ignored.] + [+api \aname\a \aYYYYMMDD\a \asymbol ...\a?Emit api compatibility tests + for \aname\a and \b#define\b \asymbol\a \asymbol\a_\aYYYYMMDD\a + when \aNAME\a_API is >= \aYYYYMMDD\a (\aNAME\a is \aname\a + converted to upper case). If \aNAME\a_API is not defined + then \asymbol\a maps to the newest \aYYYYMMDD\a for \aname\a.] + [+define \aname\a [ (\aarg,...\a) ]] [ \avalue\a ]]?Emit a macro + \b#define\b for \aname\a if it is not already defined. The + definition is passed to subsequent tests.] + [+extern \aname\a \atype\a [ (\aarg,...\a) | [\adimension\a]] ]]?Emit + an \bextern\b prototype for \aname\a if one is not already + defined. The prototype is passed to subsequent tests.] + [+header \aheader\a?Emit \b#include <\b\aheader\a\b>\b if \aheader\a + exists. The \b#include\b is passed to subsequent tests.] + [+print \atext\a?Copy \atext\a to the output file. \atext\a is passed + to subsequent tests.] + [+reference \aheader\a?If \aheader\a exists then add \b#include\b + \aheader\a to subsequent tests.] + [+ver \aname\a \aYYYYMMDD\a?\b#define\b \aNAME\a_VERSION \aYYYYMMDD\a + (\aNAME\a is \aname\a converted to upper case).] + [+cmd \aname\a?Defines \b_cmd_\b\aname\a if \aname\a is an executable + in one of the standard system directories (\b/bin, /etc, + /usr/bin, /usr/etc, /usr/ucb\b). + \b_\b\adirectory\a\b_\b\aname\a is defined for \adirectory\a + in which \aname\a is found (with \b/\b translated to \b_\b).] + [+dat \aname\a?Defines \b_dat_\b\aname\a if \aname\a is a data symbol + in the default libraries.] + [+def \aname\a?Equivalent to \bcmd,dat,hdr,key,lib,mth,sys,typ\b + \aname\a.] + [+dfn \aname\a?If \aname\a is a macro in the candidate headers then + a \b#define\b \aname\a \avalue\a statment is output for the + \avalue\a defined in the headers. The definition is \b#ifndef\b + guarded.] + [+exp \aname\a \aexpression\a?If \aexpression\a is a \"...\" string + then \aname\a is defined to be the string, else if the + \bexpr\b(1) evaluation of \aexpression\a is not 0 then \aname\a + is defined to be 1, otherwise \aname\a is defined to be 0. + Identifiers in \aexpression\a may be previously defined names + from other \biffe\b tests; undefined names evaluate to 0. + If \aname\a was defined in a previous successful test then + the current and subsequent \bexp\b test on \aname\a are + skipped. If \aname\a is \b-\b then the \aexpression\a is + simply evaluated.] + [+hdr \aname\a?Defines \b_hdr_\b\aname\a if the header + \b<\b\aname\a\b.h>\b exists. The \b--config\b macro name is + \bHAVE_\b\aNAME\a\b_H\b.] + [+if \astatement\a ... | \belif\b \astatement\a ... | \belse\b | \bendif\b? + Nested if-else test control.] + [+iff \aname\a?The generated header \b#ifndef-#endif\b macro guard is + \b_\b\aname\a\b_H\b.] + [+inc \afile\a [ re ]]?Read #define macro names from \afile\a + and arrange for those names to evaluate to 1 in \bexp\b + expressions. If \are\a is specified then macros not matching + \are\a are ignored.] + [+key \aname\a?Defines \b_key_\b\aname\a if \aname\a is a reserved + word (keyword).] + [+lcl \aname\a?Generates a \b#include\b statement for the native version + of the header \b<\b\aname\a\b.h>\b if it exists. Defines + \b_lcl_\b\aname\a on success. The \b--config\b macro name is + \bHAVE_\b\aNAME\a\b_H\b. The default \are\a is \b^HAVE_\b + for \b--config\b and \b^_\b otherwise.] + [+lib \aname\a?Defines \b_lib_\b\aname\a if \aname\a is an external + symbol in the default libraries.] + [+mac \aname\a?Defines \b_mac_\b\aname\a if \aname\a is a macro.] + [+mem \astruct.member\a?Defines \b_mem_\b\amember\a\b_\b\astruct\a + if \amember\a is a member of the structure \astruct\a.] + [+mth \aname\a?Defines \b_mth_\b\aname\a if \aname\a is an external + symbol in the math library.] + [+nop \aname\a?If this is the first test then \aname\a may be used + to name the output file and/or the output header guard macro. + Otherwise this test is ignored.] + [+npt \aname\a?Defines \b_npt_\b\aname\a if the \aname\a symbol + requires a prototype. The \b--config\b macro name is + \bHAVE_\aNAME\a\b_DECL\b with the opposite sense.] + [+num \aname\a?Defines \b_num_\b\aname\a if \aname\a is a numeric + constant \aenum\a or \amacro\a.] + [+nxt \aname\a?Defines a string macro \b_nxt_\b\aname\a suitable for + a \b#include\b statement to include the next (on the include + path) or native version of the header \b<\b\aname\a\b.h>\b + if it exists. Also defines the \"...\" form + \b_nxt_\b\aname\a\b_str\b. The \b--config\b macro name is + \bHAVE_\b\aNAME\a\b_NEXT\b.] + [+one \aheader\a ...?Generates a \b#include\b statement for the first + header found in the \aheader\a list.] + [+opt \aname\a?Defines \b_opt_\b\aname\a if \aname\a is a space-separated + token in the global environment variable \bPACKAGE_OPTIONS\b.] + [+pth \afile\a [ \adir\a ... | { \ag1\a - ... - \agn\a } | < \apkg\a [\aver\a ...]] > ]]?Defines + \b_pth_\b\afile\a, with embedded \b/\b chars translated to + \b_\b, to the path of the first instance of \afile\a in the + \adir\a directories. \b{\b ... \b}\b forms a directory list + from the cross-product of \b-\b separated directory groups + \ag1\a ... \agn\a. < ... > forms a directory list for the + package \apkg\a with optional versions. If no operands are + specified then the default PATH directories are used. The + \b--config\b macro name is \aNAME\a\b_PATH\b.] + [+run \afile\a?Runs the tests in \afile\a based on the \afile\a + suffix:]{ + [+.c?\afile\a is compiled and executed and the output is copied + to the \biffe\b output file. Macros and headers supplied + to \bbegin{\b ... \b}end\b are also supplied to + \afile\a.] + [+.sh?\afile\a is executed as a shell script and the output is + copied to the \biffe\b output file.] + [+.iffe \bor no suffix?\afile\a contains \biffe\b + statements.] + } + [+set \aoption value\a?Sets option values. The options are described + above.] + [+siz \aname\a?Defines \b_siz_\b\aname\a to be \bsizeof\b(\aname\a) if + \aname\a is a type in any of \b, , + , \b. Any \b.\b characters in \aname\a are + translated to space before testing and are translated to \b_\b + in the output macro name.] + [+sym \aname\a?Defines \b_ary_\b\aname\a if \aname\a is an array, + \b_fun_\b\aname\a if \aname\a is a function pointer, + \b_ptr_\b\aname\a if \aname\a is a pointer, or + \b_reg_\b\aname\a if \aname\a is a scalar. In most cases + \aname\a is part of a macro expansion.] + [+sys \aname\a?Defines \b_sys_\b\aname\a if the header + \b\b exists. The \b--config\b macro name is + \bHAVE_SYS_\b\aNAME\a\b_H\b.] + [+tst \aname\a?A user defined test on name. A source block must be + supplied. Defines \b_\b\aname\a on success. \btst - ...\b is + treated as \btst - - ...\b.] + [+typ \aname\a?Defines \b_typ_\b\aname\a if \aname\a is a type in any + of \b, , , \b. Any + \b.\b characters in \aname\a are translated to space before + testing and are translated to \b_\b in the output macro name.] + [+val \aname\a?The output of \becho\b \aname\a is written to the + output file.] + [+var \aname\a?A user defined test on name. A source block must be + supplied. Sets the \bexp\b variable \b_\b\aname\a on success + but does not define a macro.] + [+(\aexpression\a)?Equivalent to \bexp -\b \aexpression\a.] +} +[+?Code block names may be prefixed by \bno\b to invert the test sense. The + block names are:]{ + [+cat?The block is copied to the output file.] + [+compile?The block is compiled (\bcc -c\b).] + [+cross?The block is executed as a shell script using \bcrossexec\b(1) + if \b--cross\b is on, or on the local host otherwise, and the + output is copied to the output file. Test macros are not + exported to the script.] + [+execute?The block is compiled, linked, and executed. \b0\b exit + status means success.] + [+fail?If the test fails then the block text is evaluated by + \bsh\b(1).] + [+link?The block is compiled and linked (\bcc -o\b).] + [+macro?The block is preprocessed (\bcc -E\b) and lines containing + text bracketed by \b<<"\b ... \b">>\b (\aless-than less-than + double-quote ... double-quote greater-than greater-than\a) + are copied to the output file with the brackets omitted.] + [+no?If the test fails then the block text is copied to the + output file. Deprecated: use { \bif\b \belif\b \belse\b + \bendif\b } with unnamed \b{\b ... \b}\b blocks.] + [+note?If the test succeeds then the block is copied to the output + as a \b/*\b ... \b*/\b comment.] + [+output?The block is compiled, linked, and executed, and the output + is copied to the output file.] + [+pass?If the test succeeds then the block text is evaluated by + \bsh\b(1).] + [+preprocess?The block is preprocessed (\bcc -E\b).] + [+run?The block is executed as a shell script and the output is + copied to the output file. Succesful test macros are also + defined as shell variables with value \b1\b and are available + within the block. Likewise, failed test macros are defined + as shell variables with value \b0\b.] + [+status?The block is compiled, linked, and executed, and the exit + status is the test outcome, 0 for \afailure\a, the value + otherwise.] + [+yes?If the test succeeds then the block text is copied to the output + file. \byes{\b ... \b}end\b is equivalent to the unnamed block + \b{\b ... \b}\b. Deprecated: use { \bif\b \belif\b \belse\b + \bendif\b } with unnamed \b{\b ... \b}\b blocks.] +} +[+SEE ALSO?\bautoconf\b(1), \bconfig\b(1), \bgetconf\b(1), \bcrossexec\b(1), + \bnmake\b(1), \bpackage\b(1), \bproto\b(1), \bsh\b(1)] +' + while getopts -a "$command" "$USAGE" OPT + do case $OPT in + a) set="$set set all :" ;; + c) set="$set set cc $OPTARG :" ;; + C) set="$set set config :" ;; + d) set="$set set debug $OPTARG :" ;; + D) set="$set set define :" ;; + E) set="$set set explicit :" ;; + F) set="$set set features $OPTARG :" ;; + i) set="$set set input $OPTARG :" ;; + I) set="$set set include $OPTARG :" ;; + L) set="$set set library $OPTARG :" ;; + n) set="$set set namval $OPTARG :" ;; + N) set="$set set nooptimize $OPTARG :" ;; + o) set="$set set output $OPTARG :" ;; + e) set="$set set package $OPTARG :" ;; + p) set="$set set prototyped :" ;; + P) set="$set set pragma $OPTARG :" ;; + r) set="$set set regress :" ;; + s) set="$set set shell $OPTARG :" ;; + S) set="$set set static $OPTARG :" ;; + O) set="$set set stdio $OPTARG :" ;; + u) set="$set set undef :" ;; + v) set="$set set verbose :" ;; + x) set="$set set cross $OPTARG :" ;; + X) set="$set set exclude $OPTARG :" ;; + esac + done + shift `expr $OPTIND - 1` + ;; +*) while : + do case $# in + 0) break ;; + esac + case $1 in + -) break + ;; + --) shift + break + ;; + --a|--al|--all) + REM=a + ;; + --cc=*) REM=c`echo X$1 | sed 's,[^=]*=,,'` + ;; + --co|--con|--conf|--confi|--config) + REM=C + ;; + --cr=*|--cro=*|--cros=*|--cross=*) + REM=x`echo X$1 | sed -e 's,[^=]*=,,'` + ;; + --d=*|--de=*|--deb=*|--debu=*|--debug=*) + REM=d`echo X$1 | sed 's,[^=]*=,,'` + ;; + --def|--defi|--defin|--define) + REM=D + ;; + --e=*|--ex=*|--exc=*|--excl=*|--exclu=*|--exclud=*|--exclude=*) + REM=X`echo X$1 | sed 's,[^=]*=,,'` + ;; + --e|--ex|--exp|--expl|--expli|--explic|--explici|--explicit) + REM=E + ;; + --f=*|--fe=*|--fea=*|--feat=*|--featu=*|--featur=*|--feature=*|--features=*) + REM=F`echo X$1 | sed 's,[^=]*=,,'` + ;; + --inp=*|--inpu=*|--input=*) + REM=i`echo X$1 | sed 's,[^=]*=,,'` + ;; + --inc=*|--incl=*|--inclu=*|--includ=*|--include=*) + REM=I`echo X$1 | sed 's,[^=]*=,,'` + ;; + --l=*|--li=*|--lib=*|--libr=*|--libra=*|--librar=*|--library=*) + REM=L`echo X$1 | sed 's,[^=]*=,,'` + ;; + --n|--na|--nam|--name|--name-v|--name-va|--name-val|--name-valu|--name-value) + REM=n + ;; + --o=*|--ou=*|--out=*|--outp=*|--outpu=*|--output=*) + REM=o`echo X$1 | sed 's,[^=]*=,,'` + ;; + --pa=*|--pac=*|--pack=*|--packa=*|--packag=*|--package=*) + REM=e`echo X$1 | sed 's,[^=]*=,,'` + ;; + --pro|--prot|--proto|--protot|--prototy|--prototyp|--prototype|--prototyped) + REM=p + ;; + --pra=*|--prag=*|--pragma=*) + REM=P`echo X$1 | sed 's,[^=]*=,,'` + ;; + --r|--re|--reg|--regre|--regres|--regress) + REM=r + ;; + --sh=*|--she=*|--shel=*|--shell=*) + REM=s`echo X$1 | sed 's,[^=]*=,,'` + ;; + --sta=*|--stat=*|--stati=*|--static=*) + REM=S`echo X$1 | sed 's,[^=]*=,,'` + ;; + --std=*|--stdi=*|--stdio=*) + REM=O`echo X$1 | sed 's,[^=]*=,,'` + ;; + --u|--un|--und|--unde|--undef) + REM=u + ;; + --v|--ve|--ver|--verb|--verbo|--verbos|--verbose) + REM=v + ;; + --*) echo $command: $1: unknown option >&2 + exit 2 + ;; + -*) REM=`echo X$1 | sed 's,X-,,'` + ;; + *) break + ;; + esac + shift + while : + do case $REM in + '') break ;; + esac + eval `echo $REM | sed "s,\(.\)\(.*\),OPT='\1' REM='\2',"` + case $OPT in + [cdFiILoOePsSxX]) + case $REM in + '') case $# in + 0) echo $command: -$OPT: option argument expected >&2 + exit 1 + ;; + esac + OPTARG=$1 + shift + ;; + *) OPTARG=$REM + REM='' + ;; + esac + esac + case $OPT in + a) set="$set set all :" ;; + c) set="$set set cc $OPTARG :" ;; + C) set="$set set config :" ;; + d) set="$set set debug $OPTARG :" ;; + D) set="$set set define :" ;; + E) set="$set set explicit :" ;; + F) set="$set set features $OPTARG :" ;; + i) set="$set set input $OPTARG :" ;; + I) set="$set set include $OPTARG :" ;; + L) set="$set set library $OPTARG :" ;; + n) set="$set set namval $OPTARG :" ;; + N) set="$set set nooptimize $OPTARG :" ;; + o) set="$set set output $OPTARG :" ;; + e) set="$set set package $OPTARG :" ;; + p) set="$set set prototyped :" ;; + P) set="$set set pragma $OPTARG :" ;; + r) set="$set set regress :" ;; + s) set="$set set shell $OPTARG :" ;; + S) set="$set set static $OPTARG :" ;; + O) set="$set set stdio $OPTARG :" ;; + u) set="$set set undef :" ;; + v) set="$set set verbose :" ;; + x) set="$set set cross $OPTARG :" ;; + X) set="$set set exclude $OPTARG :" ;; + *) echo "Usage: $command [-aCDEnpruv] [-c C-compiler-name [C-compiler-flags ...]] [-d level] + [-F features-header] [-i file] [-o file] [-O stdio-header] [-e name] [-P text] + [-s shell-path] [-S[flags]] [-x cross-exec-prefix] [-I dir] [-L dir] [-X dir] [ - ] + [ file.iffe | statement [ : statement ... ] ]" >&2 + exit 2 + ;; + esac + done + done + ;; +esac +case $1 in +-) out=-; shift ;; +esac +case $# in +0) in=- ;; +esac +set -- $set "$@" +case " $* " in +*' set config '*|*' run config.'*|*' run '*' config.'*|*' run '*'/config.'*) + config=1 + ;; +esac + +# standard error to /dev/null unless debugging +# standard output to the current output file +# +# stdout original standard output +# stderr original standard error +# nullin /dev/null input +# nullout /dev/null output + +stdout=5 stderr=6 nullin=7 nullout=8 +eval "exec $nullin/dev/null $stdout>&1 $stderr>&2" +case " $* " in +*" set debug "[3456789]*) + ;; +*) eval "exec 2>&$nullout" + ;; +esac + +# prompt complications + +case `print -n aha /dev/null` in +aha) show='print -n' SHOW='' ;; +*) case `echo -n aha 2>/dev/null` in + -n*) show=echo SHOW='\c' ;; + *) show='echo -n' SHOW='' ;; + esac + ;; +esac + +# tmp files cleaned up on exit +# status: 0:success 1:failure 2:interrupt + +status=1 +case $debug in +2) core= + ;; +*) if (ulimit -c 0) >/dev/null 2>&1 + then ulimit -c 0 + core= + else core="core core.??*" + fi + ;; +esac +trap "rm -f $core $tmp*" 0 +if (:>$tmp.c) 2>/dev/null +then rm -f $tmp.c +else echo "$command: cannot create tmp files in current dir" >&2 + exit 1 +fi +status=2 + +# standard header for c source + +std='#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) +#define _STD_ 1 +#define _ARG_(x) x +#define _VOID_ void +#else +#define _STD_ 0 +#define _ARG_(x) () +#define _VOID_ char +#endif +#if defined(__cplusplus) +#define _BEGIN_EXTERNS_ extern "C" { +#define _END_EXTERNS_ } +#else +#define _BEGIN_EXTERNS_ +#define _END_EXTERNS_ +#endif +#define _NIL_(x) ((x)0)' +tst= +ext="#include " +noext='*[<"][Ss][Tt][Dd][Ii][Oo].[Hh][">]*|**|**|*/[*][*]/*' + +# loop on op [ arg [ ... ] ] [ : op [ arg [ ... ] ] ] + +argx=0 +cur=. +can= +cansep= +cctest= +file= +hdrtest= +ifelse=NONE +ifstack= +ini= +init=1 +line=0 +nan= +prototyped= +while : +do case $in in + "") case $argx:$* in + 1:$argv);; + 1:*) argx=0 + set x $argv + shift + ;; + esac + ;; + *) case $ini in + '') if read lin + then case $shell in + ksh) let line=line+1 ;; + *) line=`expr $line + 1` ;; + esac + $posix_noglob + set x $lin + $posix_glob + case $# in + 1) continue ;; + esac + else set x + fi + ;; + *) $posix_noglob + set x $ini + $posix_glob + ini= + ;; + esac + shift + case $init in + 1) case $1 in + iff) init=0 + ;; + print|ref|set) + ;; + *) init=0 + ini=$* + set ini + ;; + esac + esac + ;; + esac + case $# in + 0) case $ifstack in + ?*) echo "$command: $file$line: missing endif" >&$stderr + exit 1 + ;; + esac + set set out + + ;; + esac + + # if nesting + + while : + do case $1 in + "if") ifstack="$ifelse:$ifstack" + case $ifelse in + KEEP|NONE) + ifelse=TEST + ;; + TEST) ;; + *) ifelse=DONE + ;; + esac + shift + case $explicit in + 1) set '' - "$@"; shift ;; + esac + ;; + "elif") case $ifelse in + SKIP) ifelse=TEST + ;; + TEST) ;; + *) ifelse=DONE + ;; + NONE) echo "$command: $file$line: $1: no matching if" >&$stderr + exit 1 + ;; + esac + shift + case $explicit in + 1) set '' - "$@"; shift ;; + esac + ;; + "else") case $ifelse in + KEEP) ifelse=DONE + ;; + SKIP|TEST) + ifelse=KEEP + ;; + NONE) echo "$command: $file$line: $1: no matching if" >&$stderr + exit 1 + ;; + esac + shift + ;; + "endif")case $ifelse in + NONE) echo "$command: $file$line: $1: no matching if" >&$stderr + exit 1 + ;; + esac + case $shell in + ksh) ifelse=${ifstack%%:*} + ifstack=${ifstack#*:} + ;; + *) eval `echo $ifstack | sed 's,\([^:]*\):\(.*\),ifelse=\1 ifstack=\2,'` + ;; + esac + shift + ;; + *) break + ;; + esac + done + + # check if "run xxx" is equivalent to "set in xxx" + + case $1 in + "("*) set exp - "$@" ;; + *.iffe|*.iff) set run "$@" ;; + esac + case $1 in + :) shift + continue + ;; + run) case $shell in + bsh) case $2 in + */*) x=`echo $2 | sed 's,.*[\\\\/],,'` ;; + *) x=$2 ;; + esac + ;; + *) eval 'x=${2##*[\\/]}' + ;; + esac + case $x in + *.iffe|*.iff) + set set in $2 ;; + *.*) ;; + *) set set in $2 ;; + esac + ;; + esac + + # { inc set } drop out early + + case $1 in + ""|"#"*)continue + ;; + inc) case $ifelse in + DONE|SKIP) set ''; shift; continue ;; + esac + shift + case $# in + 0) echo "$command: $file$line: path expected" >&$stderr + exit 1 + ;; + esac + p=$1 + shift + if test ! -f $p + then echo "$command: $file$line: $p: file not found" >&$stderr + exit 1 + fi + case $# in + 0) case $config in + 1) e="^HAVE_" ;; + *) e="^_" ;; + esac + ;; + 1) e=$1 + ;; + *) shift + echo "$command: $file$line: warning: $*: operands ignored" >&$stderr + ;; + esac + eval `sed -e '/^#define[ ]/!d' -e 's/#define[ ]//' -e 's/[ (].*//' ${e:+"-e/$e/!d"} -e 's/.*/&=1/' $p | LC_ALL=C sort -u` + continue + ;; + set) case $ifelse in + DONE|SKIP) set ''; shift; continue ;; + esac + shift + case $1 in + ""|"#"*)op= + ;; + *) arg= + op=$1 + case $op in + --*) case $shell in + bsh) op=`echo X$op | sed 's/X--//'` ;; + *) op=${op#--} ;; + esac + ;; + -*) case $op in + -??*) case $shell in + bsh) arg=`echo X$op | sed 's/X-.//'` + op=`echo X$op | sed 's/X\\(-.\\).*/\\1/'` + ;; + *) arg=${op#-?} + op=${op%$arg} + ;; + esac + ;; + esac + case $op in + a) op=all ;; + c) op=cc ;; + C) op=config ;; + d) op=debug ;; + D) op=define ;; + E) op=explicit ;; + F) op=features ;; + i) op=input ;; + I) op=include ;; + L) op=library ;; + n) op=namval ;; + N) op=nooptimize ;; + o) op=output ;; + e) op=package ;; + p) op=prototyped ;; + P) op=pragma ;; + r) op=regress ;; + s) op=shell ;; + S) op=static ;; + O) op=stdio ;; + u) op=undef ;; + v) op=verbose ;; + x) op=cross ;; + X) op=exclude ;; + esac + ;; + esac + shift + while : + do case $# in + 0) break ;; + esac + case $1 in + *" "*) shift + continue + ;; + ""|"#"*)break + ;; + :) shift + break + ;; + esac + case $arg in + "") arg=$1 ;; + *) arg="$arg $1" ;; + esac + shift + done + ;; + esac + case $op in + all) all=1 + continue + ;; + cc) occ= + for x in $arg + do case $occ in + "") case $x in + *=*) case $shell in + bsh) eval $x + export `echo $x | sed 's/=.*//'` + ;; + *) export $x + ;; + esac + ;; + -O*) case $optimize in + 1) occ=$x ;; + esac + ;; + *) occ=$x + ;; + esac + ;; + *) occ="$occ $x" + ;; + esac + done + exclude occ + continue + ;; + config) config=1 + continue + ;; + cross) case $arg in + ""|-) cross= ;; + *) cross="$arg" libpaths= ;; + esac + continue + ;; + debug) debug=$arg + case $arg in + 0) exec 2>&$nullout + set - + show=echo + SHOW= + ;; + ""|1) exec 2>&$stderr + set - + show=echo + SHOW= + ;; + 2|3) exec 2>&$stderr + case $shell in + ksh) eval 'PS4="${PS4%+*([ ])}+\$LINENO+ "' + esac + show=echo + SHOW= + set -x + ;; + *) echo "$command: $arg: debug levels are 0, 1, 2, 3" >&$stderr + ;; + esac + continue + ;; + define) define=1 + continue + ;; + exclude)case $arg in + ""|-) excludes= ;; + *) excludes="$excludes $arg" ;; + esac + exclude includes occ + continue + ;; + explicit) + explicit=1 + continue + ;; + features)case $arg in + '') tst= ;; + *) tst="#include \"$arg\"" ;; + esac + continue + ;; + "in"|input) + case $arg in + "") in=- + ;; + *) in=$arg + if test ! -r $in + then echo "$command: $in: not found" >&$stderr + exit 1 + fi + exec < $in + file=$in: + case $out in + "") case $in in + *[.\\/]*) + case $shell in + bsh) eval `echo $in | sed -e 's,.*[\\\\/],,' -e 's/\\.[^.]*//' -e 's/^/out=/'` + ;; + *) eval 'out=${in##*[\\/]}' + eval 'out=${out%.*}' + ;; + esac + ;; + *) out=$in + ;; + esac + ;; + esac + ;; + esac + continue + ;; + include)case $arg in + ""|-) includes= ;; + *) includes="$includes -I$arg" ;; + esac + exclude includes + continue + ;; + library)for y in $libpaths + do eval $y=\"\$$y:\$arg\$${y}_default\" + eval export $y + done + continue + ;; + namval) define=n + continue + ;; + nodebug)exec 2>&$nullout + set - + continue + ;; + nodefine) + define=0 + continue + ;; + nooptimize) + optimize=0 + case $occ in + *" -O"*)occ=`echo $occ | sed 's/ -O[^ ]*//g'` + cc=$occ + ;; + esac + ;; + optimize) + optimize=1 + ;; + out|output) + out=$arg + defhdr= + usr= + deflib= + one= + puthdr= + putlib= + case $op in + output) continue ;; + esac + def= + test= + ;; + package)protoflags="$protoflags -e $arg" + continue + ;; + prototyped|noprototyped) + pragma="$pragma $op" + case $op in + prototyped) prototyped=1 ;; + *) prototyped= ;; + esac + continue + ;; + pragma) pragma="$pragma $arg" + continue + ;; + regress)regress=1 + version=1995-03-19 + continue + ;; + shell) case $arg in + osh) posix_read=-no + shell=bsh + ;; + esac + shell=$arg + continue + ;; + static) static=$arg + continue + ;; + stdio) case $arg in + '') ext= + ;; + *) ext= + sep= + for i in $arg + do case $i in + -) case $ext in + '') continue ;; + *) break ;; + esac + ;; + esac + echo "#include \"$i\"" > t.c + if $cc -E t.c > /dev/null 2>&1 + then ext="$ext$sep#include \"$arg\"" + sep=$nl + fi + done + ;; + esac + continue + ;; + undef) undef=1 + continue + ;; + verbose)verbose=1 + continue + ;; + *) echo "$command: $op: unknown option" >&$stderr + exit 1 + ;; + esac + ;; + api|define|extern|header|include|print|reference|ver) + op=$1 + shift + arg= + ;; + *) case $2 in + '=') def=$1 + shift + shift + ;; + *) case $1 in + '-'|'?')def=- + shift + ;; + *) def= + ;; + esac + ;; + esac + case $1 in + '!') not=1 + shift + ;; + *) not= + ;; + esac + case $1 in + *'{') op=- + ;; + '('*|'"'*'"'|'<'*'>') + op=exp + case $def in + '') def=- ;; + esac + ;; + *) op=$1 + shift + ;; + esac + arg= + cc="$occ $includes" + group= + groups= + fail= + hdr= + lib= + mac= + no= + note= + opt= + pass= + pth= + run= + set= + src= + test= + yes= + case $# in + 0) ;; + *) case $1 in + "#"*) set x + shift + ;; + *) case $op in + ref) ;; + *) case $1 in + '-') case $op:$2 in + tst:*) arg=$1 + case $2 in + -) shift ;; + esac + ;; + *:-*) arg=$1 + shift + ;; + *) def=- + shift + case $1 in + '('*|*'{'|'"'*'"'|'<'*'>') + arg=- + ;; + *) arg=$1 + case $# in + 0) ;; + *) shift ;; + esac + ;; + esac + ;; + esac + ;; + -*|+*|'('*|*'{'|'"'*'"'|'<'*'>') + arg=- + ;; + *) arg=$1 + shift + ;; + esac + ;; + esac + ;; + esac + case $1 in + '('*|'"'*'"'|'<'*'>') + while : + do case $# in + 0) break ;; + esac + case $1 in + *[.{}]*)break ;; + esac + case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + shift + done + case $arg in + '') arg=- ;; + esac + case $op in + exp) case $def in + ''|'-') ;; + *) arg=$def ;; + esac + ;; + esac + ;; + esac + sline=$line + while : + do case $# in + 0) break ;; + esac + case $1 in + "") ;; + "#"*) set x + ;; + "=") shift + set=$* + case $set in + "") set=" " ;; + esac + while : + do case $# in + 0) break ;; + esac + shift + done + break + ;; + [abcdefghijklmnopqrstuvwxyz]*'{'|'{') + v=$1 + shift + x= + case $v in + "note{") + sep=" " ;; + *) sep=$nl ;; + esac + case $v in + '{') e='}' ;; + *) e='}end' ;; + esac + n=1 + SEP= + while : + do case $# in + 0) case $posix_read in + -*) checkread ;; + esac + case $in in + "") echo "$command: $file$line: missing }end" >&$stderr + exit 1 + ;; + esac + while : + do case $posix_read in + 1) case $shell in + ksh) IFS= read -r lin + eof=$? + while : + do lin="${lin#[' ']}" + case $lin in + [' ']*'#'*);; + *) break ;; + esac + done + ;; + *) IFS= + read -r lin + eof=$? + IFS=$ifs + case $lin in + [' ']*) lin=`sed -e 's,^[ ],,' -e 's,^[ ]*#,#,' <&$stderr + exit 1 + ;; + esac + done + ;; + esac + case $1 in + $v) case $shell in + ksh) let n=n+1 ;; + *) n=`expr $n + 1` ;; + esac + ;; + $e|$e';') + case $n in + 1) break ;; + esac + case $shell in + ksh) let n=n-1 ;; + *) n=`expr $n - 1` ;; + esac + ;; + esac + x="$x$SEP$1" + SEP=$sep + shift + done + case $v in + 'note{');; + *) x="$x$nl" # \r\n bash needs this barf # ;; + esac + case $v in + 'fail{') fail=$x ;; + 'nofail{') pass=$x v='pass{' ;; + 'nopass{') fail=$x v='fail{' ;; + 'no{') no=$x ;; + 'note{') note=$x ;; + 'pass{') pass=$x ;; + 'test{') test=$x ;; + 'yes{'|'{') yes=$x ;; + *) src=$x run=$v ;; + esac + ;; + :) shift + break + ;; + *[\"\'\(\)\{\}\ \ ]*) + case $op in + pth) pth="$pth $1" + ;; + *) case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + ;; + esac + ;; + -) group=$group$1 + case $group in + -) com_hdr=$hdr + com_lib=$lib + com_mac=$mac + com_opt=$opt + com_pth=$pth + com_test=$test + ;; + *) groups="$groups $1" + ;; + esac + ;; + -l*) case $group in + --*) groups="$groups $1" ;; + *) lib="$lib $1" ;; + esac + ;; + +l*) case $shell in + bsh) x=`echo X$1 | sed 's/X+/-/'` ;; + *) eval 'x=-${1#+}' ;; + esac + case $group in + --*) groups="$groups $x" ;; + *) lib="$lib $x" ;; + esac + ;; + -*|+*) case $op in + ref) cc="$cc $1" + occ="$occ $1" + case $1 in + -L*) case $shell in + ksh) x=${1#-L} ;; + *) x=`echo x$1 | sed 's,^x-L,,'` ;; + esac + for y in $libpaths + do eval $y=\"\$$y:\$x\$${y}_default\" + eval export $y + done + ;; + esac + ;; + *) case $group in + --*) groups="$groups $1" + ;; + *) case $op in + run) opt="$opt $1" + ;; + *) case $1 in + -D*) mac="$mac $1" ;; + *) cc="$cc $1" ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; + *.[aAxX]|*.[dD][lL][lL]|*.[lL][iI][bB]) + case $group in + --*) groups="$groups $1" ;; + *) lib="$lib $1" ;; + esac + ;; + *[.\\/]*) + case $group in + --*) groups="$groups $1" + ;; + *) case $op in + pth) pth="$pth $1" ;; + *) hdr="$hdr $1" ;; + esac + ;; + esac + ;; + *) case $group in + --*) groups="$groups $1" + ;; + *) case $op in + pth) pth="$pth $1" + ;; + *) case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + ;; + esac + ;; + esac + ;; + esac + shift + done + case $group in + -) group= ;; + esac + ;; + esac + ;; + esac + case $ifelse in + DONE|SKIP) continue ;; + esac + + # make sure $cc compiles C + + case $cc in + "") cc="$occ $includes" ;; + esac + case $cctest in + "") checkcc ;; + esac + + # some ops allow no args + + case $arg in + '') case $op in + api) arg=- + case $1:$2 in + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*:[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) + a=$1 + shift + case " $apis " in + *" $a "*) + ;; + *) apis="$apis $a" + eval api_sym_${a}= api_ver_${a}= + ;; + esac + rel= + while : + do case $# in + 0) break ;; + esac + case $1 in + [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) + rel="$rel $1" + ;; + *) break + ;; + esac + shift + done + while : + do case $# in + 0) break ;; + esac + case $1 in + :) break ;; + esac + eval syms='$'api_sym_${a} + case $syms in + '') sep='' ;; + *) sep=$nl ;; + esac + for r in $rel + do syms=$syms$sep${1}:${r} + sep=$nl + done + eval api_sym_${a}='$'syms + shift + done + ;; + *) echo "$command: $op: expected: name YYYYMMDD symbol ..." >&$stderr + ;; + esac + while : + do case $# in + 0) break ;; + esac + case $1 in + :) break ;; + esac + shift + done + ;; + iff|ini)arg=- + ;; + comment)copy - "/* $* */" + continue + ;; + define) x=$1 + shift + case $1 in + '('*')') + arg=$1 + shift + ;; + esac + case $in in + "") v= + while : + do case $# in + 0) break ;; + esac + t=$1 + shift + case $t in + ":") break ;; + esac + v="$v $t" + done + ;; + *) v=$* + ;; + esac + is mac $x + copy $tmp.c "$std +$usr +#ifndef $x +( +#endif +int x; +" + if compile $cc -c $tmp.c <&$nullin >&$nullout + then success - + else failure - + copy - "#define $x$arg $v" + usr="$usr${nl}#define $x$arg $v" + fi + continue + ;; + extern) x=$1 + shift + t=$1 + shift + is npt $x + copy $tmp.c " +$std +#include +$usr +_BEGIN_EXTERNS_ +struct _iffe_struct { int _iffe_member; }; +extern struct _iffe_struct* $x _ARG_((struct _iffe_struct*)); +_END_EXTERNS_ +" + # some compilers with -O only warn for invalid intrinsic prototypes + case " $cc " in + *" -O "*) xx=`echo $cc | sed 's/ -O / /g'` ;; + *) xx=$cc ;; + esac + if compile $xx -c $tmp.c <&$nullin >&$nullout + then success - + while : + do case $1 in + ''|'('*|'['*) + break + ;; + esac + t="$t $1" + shift + done + case $in in + "") v= + while : + do case $# in + 0) break ;; + esac + t=$1 + shift + case $t in + ":") break ;; + esac + v="$v $t" + done + ;; + *) v=$* + ;; + esac + copy - "extern $t $x$v;" + # NOTE: technically if prototyped is on all tests should + # be run through proto(1), but we'd like iffe to + # work sans proto -- so we drop the extern's in + # the test headers + case $prototyped in + '') usr="$usr${nl}extern $t $x$v;" ;; + esac + else failure - + case $in in + "") while : + do case $# in + 0) break ;; + esac + case $1 in + ":") break ;; + esac + done + ;; + esac + fi + continue + ;; + header|include|reference) + while : + do case $# in + 0) break ;; + esac + x=$1 + shift + case $x in + ":") break ;; + esac + case " $gothdr " in + *" - $x "*) + ;; + *" + $x "*) + case $usr in + *"# include <"$x">"*) + ;; + *) case $op in + reference) + ;; + *) copy - "#include <$x>" + ;; + esac + usr="$usr${nl}#include <$x>" + ;; + esac + ;; + *) copy $tmp.c "$std +$usr +#include <$x> +int x; +" + if is_hdr - $x + then gothdr="$gothdr + $x" + case $op in + reference) + ;; + *) copy - "#include <$x>" + ;; + esac + usr="$usr${nl}#include <$x>" + else gothdr="$gothdr - $x" + fi + ;; + esac + done + continue + ;; + print) case $in in + "") v= + while : + do case $# in + 0) break ;; + esac + t=$1 + shift + case $t in + ":") break ;; + esac + v="$v $t" + done + ;; + *) v=$* + ;; + esac + copy - "$*" + usr="$usr${nl}$v" + continue + ;; + ver) arg=- + case $1:$2 in + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*:[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) + vers="$vers$nl$1" + eval ver_$1=$2 + ;; + *) echo "$command: $op: expected: name YYYYMMDD" >&$stderr + ;; + esac + while : + do case $# in + 0) break ;; + esac + case $1 in + :) break ;; + esac + shift + done + ;; + esac + ;; + esac + + # save $* for ancient shells + + argx=1 + argv=$* + + # loop on all candidate groups + + while : + do + # check the candidate macros + + cc="$cc $mac" + + # check for global default headers (some cc -E insist on compiling) + + case $hdrtest in + '') hdrtest=1 + allinc= + for x in types + do case $config in + 0) c=_sys_${x} + ;; + 1) case $shell in + ksh) typeset -u u=$x ;; + *) u=`echo $x | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=HAVE_SYS_${u}_H + ;; + esac + x=sys/$x.h + echo "${allinc}#include <$x>" > $tmp.c + if is_hdr $x + then gothdr="$gothdr + $x" + case $explicit in + 0) can="$can$cansep#define $c 1 /* #include <$x> ok */" + nan="$nan$cansep$c=1" + cansep=$nl + ;; + esac + eval $c=1 + allinc="${allinc}#include <$x>$nl" + else gothdr="$gothdr - $x" + case $explicit$all$config$undef in + 0?1?|0??1) + can="$can$cansep#undef $c /* #include <$x> not ok */" + nan="$nan$cansep$c=" + cansep=$nl + ;; + 01??) can="$can$cansep#define $c 0 /* #include <$x> not ok */" + nan="$nan$cansep$c=0" + cansep=$nl + ;; + esac + fi + done + ;; + esac + + # add implicit headers/libraries before the checks + + case $op in + npt) hdr="sys/types.h stdlib.h unistd.h $hdr" + ;; + siz|typ)hdr="sys/types.h time.h sys/time.h sys/times.h stddef.h stdlib.h $hdr" + ;; + esac + + # check the candidate headers + + case $hdr in + ?*) z=$hdr + hdr= + dis=0 + for x in $z + do case $x in + *.h) case " $gothdr " in + *" - $x "*) + continue + ;; + *" + $x "*) + ;; + *) case $shell in + bsh) eval `echo $x | sed -e 's,^\\([^\\\\/]*\\).*[\\\\/]\\([^\\\\/]*\\)\$,\\1_\\2,' -e 's/\\..*//' -e 's/^/c=/'` + ;; + *) eval 'c=${x##*[\\/]}' + eval 'c=${c%%.*}' + case $x in + */*) eval 'c=${x%%[\\/]*}_${c}' ;; + esac + ;; + esac + case $explicit in + 0) dis=0 + ;; + *) case $x in + */*) dis=$c ;; + *) dis=hdr ;; + esac + case ${dis}_ in + ${op}_*)dis=0 ;; + *) dis=1 ;; + esac + ;; + esac + case $config in + 0) case $x in + */*) c=_${c} ;; + *) c=_hdr_${c} ;; + esac + ;; + 1) case $shell in + ksh) typeset -u u=$c ;; + *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=HAVE_${u}_H + ;; + esac + echo "${allinc}#include <$x>" > $tmp.c + if is_hdr $x + then gothdr="$gothdr + $x" + case $dis in + 0) can="$can$cansep#define $c 1 /* #include <$x> ok */" + nan="$nan$cansep$c=1" + cansep=$nl + ;; + esac + eval $c=1 + else gothdr="$gothdr - $x" + case $dis$all$config$undef in + 0?1?|0??1) + can="$can$cansep#undef $c /* #include <$x> not ok */" + nan="$nan$cansep$c=" + cansep=$nl + ;; + 01??) can="$can$cansep#define $c 0 /* #include <$x> not ok */" + nan="$nan$cansep$c=0" + cansep=$nl + ;; + esac + continue + fi + ;; + esac + ;; + *) test -r $x || continue + ;; + esac + hdr="$hdr $x" + done + ;; + esac + + # check the candidate libraries + + case $lib in + ?*) z=$lib + lib= + p= + hit=0 + echo "int main(){return(0);}" > $tmp.c + for x in $z + do p=$x + case " $gotlib " in + *"- $p "*) + failure + + p= + ;; + *"+ $p "*) + success + + lib="$lib $p" + ;; + *) rm -f $tmp.exe + is LIB $p + if compile $cc -o $tmp.exe $tmp.c $p <&$nullin >&$nullout + then success + gotlib="$gotlib + $p" + lib="$lib $p" + e=0 + else a= + e=1 + for l in $z + do case $l in + -) a= + continue + ;; + $p) a=$p + continue + ;; + *) case $gotlib in + *" $l "*) continue ;; + esac + ;; + esac + case $a in + $p) a="$a $l" + if compile $cc -o $tmp.exe $tmp.c $a <&$nullin >&$nullout + then success + gotlib="$gotlib + $p" + lib="$lib $p" + e=0 + break + fi + ;; + esac + done + case $e in + 1) failure + gotlib="$gotlib - $p" + ;; + esac + fi + y= + for x in $p + do case $shell in + bsh) c=`echo X$x | sed 's,X-l,,'` ;; + *) eval 'c=${x#-l}' ;; + esac + case $c in + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + c=`echo '' $c | sed -e 's,.*[\\\\/],,' -e 's,\.[^.]*$,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g' -e '/^lib./s,^lib,,'` + ;; + esac + case $config in + 0) case $e$p in + 0*' '*) case " $gotlib " in + *[-+]" $x "*) + ;; + *) can="$can$cansep#define _LIB_$c 1 /* $x is a library */" + nan="$nan${cansep}_LIB_$c=1" + cansep=$nl + eval _LIB_$c=1 + ;; + esac + ;; + esac + ;; + 1) case $shell in + ksh) typeset -u u=$c ;; + *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=$u + case $e in + 0*' '*) case " $gotlib " in + *[-+]" $x "*) + ;; + *) can="$can$cansep#define HAVE_${c}_LIB 1 /* $x is a library */" + nan="$nan${cansep}HAVE_${c}_LIB=1" + cansep=$nl + eval HAVE_${c}_LIB=1 + ;; + esac + ;; + esac + ;; + esac + y=${y}_$c + done + case $config in + 0) c=_LIB${y} ;; + 1) c=HAVE${y}_LIB ;; + esac + case $p in + *' '*) q="a library group" ;; + *) q="a library" ;; + esac + case $e in + 0) can="$can$cansep#define $c 1 /* $p is $q */" + nan="$nan$cansep$c=1" + cansep=$nl + eval $c=1 + case $hit in + 1) break ;; + esac + ;; + 1) case $all$config$undef in + ?1?|??1)can="$can$cansep#undef $c /* $p is not $q */" + nan="$nan$cansep$c=" + cansep=$nl + ;; + 1??) can="$can$cansep#define $c 0 /* $p is not $q */" + nan="$nan$cansep$c=0" + cansep=$nl + ;; + esac + eval $c=0 + ;; + esac + p= + ;; + esac + done + ;; + esac + + # last op precheck + + case $op in + ref) deflib="$deflib $lib" + defhdr="$defhdr $hdr" + break + ;; + esac + IFS=" ," + case $shell in + bash) op=`echo $op` + arg=`echo $arg` + ;; + *) eval op=\"$op\" + eval arg=\"$arg\" + ;; + esac + IFS=$ifs + + # check for op aliases + + x= + for o in $op + do case $o in + def|default) x="$x cmd dat hdr key lib mth sys typ" ;; + *) x="$x $o" ;; + esac + done + + # loop on the ops o and args a + + result=UNKNOWN + for o in $x + do for a in $arg + do c= + case $a in + *[.\\/]*) + case $o in + hdr|lcl|nxt|pth|sys) + x=$a + case $x in + *.lcl|*.nxt) + case $o in + sys) x=sys/$x ;; + esac + case $shell in + bsh) eval `echo $x | sed 's,\\(.*\\)\.\\([^.]*\\),x=\\1 o=\\2,'` + ;; + *) o=${x##*.} + x=${x%.${o}} + ;; + esac + v=$x + ;; + esac + case $x in + *[\\/]*)case $shell in + bsh) eval `echo $x | sed 's,\\(.*\\)[\\\\//]\\(.*\\),p=\\1 v=\\2,'` + ;; + *) eval 'p=${x%/*}' + eval 'v=${x##*/}' + ;; + esac + ;; + *.*) case $shell in + bsh) eval `echo $x | sed 's,\\(.*\\)\\.\\(.*\\),p=\\1 v=\\2,'` + ;; + *) eval 'p=${x%.*}' + eval 'v=${x##*.}' + ;; + esac + ;; + *) p= + ;; + esac + case $o in + lcl|nxt) c=$v.$o ;; + *) c=$v ;; + esac + ;; + *) case $shell in + bsh) eval `echo $a | sed -e 's,.*[\\\\/],,' -e 's/\\(.*\\)\\.\\(.*\\)/p=\\1 v=\\2/'` + ;; + *) eval 'p=${a%.*}' + eval 'p=${p##*[\\/]}' + eval 'v=${a##*.}' + eval 'v=${v##*[\\/]}' + ;; + esac + ;; + esac + case $p in + '') f=${v} ;; + *) f=${p}/${v} ;; + esac + case $o in + run) v=$p + p= + m=_${v} + ;; + mem) case $p in + *.*) case $shell in + bsh) eval `echo $p | sed 's/\\([^.]*\\)\\.\\(.*\\)/p=\\1 m=\\2/'` + ;; + *) eval 'm=${p#*.}' + eval 'p=${p%%.*}' + ;; + esac + v=${m}.${v} + esac + case $config in + 0) m=_${v}_${p} ;; + 1) m=_${v}_in_${p} ;; + esac + ;; + *) case $p in + '') m=_${v} ;; + *) m=_${p}_${v} ;; + esac + ;; + esac + ;; + *) p= + v=$a + f=$a + m=_${v} + ;; + esac + case $c in + '') c=$v ;; + esac + M=$m + case $o in + out) case $a in + -) a=- + ;; + ?*) test="$a $test" + a= + ;; + esac + ;; + *) case " $idyes " in + *" $m "*) + i=1 + ;; + *) case " $idno " in + *" $m "*) + i=0 + ;; + *) case $m in + *'*') m=`echo "$m" | sed 's,\*,_ptr,g'` ;; + esac + case $m in + *[-+/\\]*) + i=0 + ;; + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + is id $m + copy $tmp.c "int $m = 0;" + if compile $cc -c $tmp.c + then success - + idyes="$idyes $m" + i=1 + else failure - + idno="$idno $m" + i=0 + fi + ;; + *) i=1 + ;; + esac + ;; + esac + case $i in + 0) case $o in + dat|dfn|key|lib|mac|mth|nos|npt|siz|sym|typ|val) + continue + ;; + esac + ;; + esac + ;; + esac + ;; + esac + case $m in + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + m=`echo "X$m" | sed -e 's,^.,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` + ;; + esac + + # check output redirection + + case $out in + $cur) ;; + *) case $cur in + $a|$c) ;; + *) case $cur in + .) ;; + *) case $vers in + ?*) echo + for api in $vers + do API=`echo $api | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` + eval ver='${'ver_${api}'}' + echo "#define ${API}_VERSION ${ver}" + done + esac + case $apis in + ?*) for api in $apis + do map= + sep= + eval syms='"${'api_sym_${api}'}"' + # old solaris requires -k # + set x x `echo "$syms" | sort -t: -u -k 1,1 -k 2,2nr 2>/dev/null | sed 's/:/ /'` + case $# in + 2) # ancient sort doesn't have -k # + set x x `echo "$syms" | sort -t: -u +0 -1 +1 -2nr 2>/dev/null | sed 's/:/ /'` + ;; + esac + sym= + while : + do shift 2 + case $# in + [01]) break ;; + esac + prv=$sym + sym=$1 + rel=$2 + case $prv in + $sym) echo "#elif _API_${api} >= $rel" + ;; + *) case $prv in + '') echo + echo "#if !defined(_API_${api}) && defined(_API_DEFAULT)" + echo "#define _API_${api} _API_DEFAULT" + echo "#endif" + ;; + *) echo "#endif" + ;; + esac + echo + echo "#if ( _BLD_${api} || !_API_${api} || _API_${api} >= $rel )" + ;; + esac + echo "#undef ${sym}" + echo "#define ${sym} ${sym}_${rel}" + map=$map$sep${sym}_${rel} + sep=' ' + done + echo "#endif" + echo + echo "#define _API_${api}_MAP \"$map\"" + done + echo + ;; + esac + case $iff in + ?*) echo "#endif" ;; + esac + case $cur in + -) ;; + *) exec >/dev/null + case $cur in + *[\\/]*|*.h) x=$cur ;; + *) x=$dir/$cur ;; + esac + case $define in + n) sed '/^#/d' $tmp.h > $tmp.c + sed '/^#/d' $x > $tmp.t + ;; + *) (proto -r $protoflags $tmp.h) >/dev/null 2>&1 + sed 's,/\*[^/]*\*/, ,g' $tmp.h > $tmp.c + sed 's,/\*[^/]*\*/, ,g' $x > $tmp.t + ;; + esac + if cmp -s $tmp.c $tmp.t + then rm -f $tmp.h + case $verbose in + 1) echo "$command: $x: unchanged" >&$stderr ;; + esac + else case $x in + ${dir}[\\/]$cur) test -d $dir || mkdir $dir || exit 1 ;; + esac + mv $tmp.h $x + fi + ;; + esac + ;; + esac + case $out in + +) case $status in + 1) ;; + *) status=0 ;; + esac + exit $status + ;; + -) eval "exec >&$stdout" + ;; + *) exec >$tmp.h + ;; + esac + case $out in + "") case $a in + *[\\/]*|???????????????*) cur=$c ;; + *) cur=$a ;; + esac + ;; + *) cur=$out + ;; + esac + case $in in + ""|-|+) case $o in + run) x=" from $a" ;; + *) x= ;; + esac + ;; + *) x=" from $in" + ;; + esac + + # output header comments + + case $define in + n) ;; + ?) echo "/* : : generated$x by $command version $version : : */" + for x in $pragma + do echo "#pragma $x" + done + case $out in + ""|-|+) x=$m + ;; + *.*) case $shell in + bsh) eval `echo $in | sed -e 's,\\.,_,g' -e 's/^/x=/'` + ;; + *) i=$out + x=_ + while : + do case $i in + *.*) eval 'x=$x${i%%.*}_' + eval 'i=${i#*.}' + ;; + *) x=$x$i + break + ;; + esac + done + ;; + esac + ;; + *) x=_$out + ;; + esac + case $o in + iff) case $M in + ""|*-*) ;; + *) iff=${m}_H ;; + esac + ;; + *) case $regress in + '') case $x in + *-*) ;; + *) x=`pwd | sed -e 's,.*[\\\\/],,' -e 's,\\..*,,' -e 's,^lib,,' -e 's,^,'${x}_',' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` + # ksh n+ bug workaround + case $x in + *[!_]*) ;; + *) x=_$$ ;; + esac + iff=_def${x} + ;; + esac + ;; + *) case $x in + *-*) ;; + *) iff=_REGRESS + ;; + esac + ;; + esac + ;; + esac + case $iff in + ?*) echo "#ifndef $iff" + echo "#define $iff 1" + ;; + esac + ;; + esac + ;; + esac + ;; + esac + case $can in + ?*) case $define in + 1) echo "$can" ;; + n) echo "$nan" ;; + esac + can= + nan= + cansep= + ;; + esac + + # set up the candidate include list + + pre= + inc= + for x in $defhdr - $hdr + do case $x in + -) case $pre in + ?*) continue ;; + esac + case $v in + *.*) for x in `echo $v | sed 's,\\., ,g'` + do pre="$pre +#undef $x" + done + ;; + *) case $o in + siz|typ)case $v in + char|short|int|long) + ;; + *) pre="#undef $v" + ;; + esac + ;; + *) pre="#undef $v" + ;; + esac + ;; + esac + ;; + *.h) case $shell in + bsh) eval `echo $x | sed -e 's,^\\([^\\\\/]*\\).*[\\\\/]\\([^\\\\/]*\\)\$,\\1_\\2,' -e 's/\\..*//' -e 's/^/c=/'` + ;; + *) eval 'c=${x##*[\\/]}' + eval 'c=${c%%.*}' + case $x in + */*) eval 'c=${x%%[\\/]*}_${c}' ;; + esac + ;; + esac + case $config in + 0) case $x in + */*) c=_${c} ;; + *) c=_hdr_${c} ;; + esac + ;; + 1) case $shell in + ksh) typeset -u u=$c ;; + *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=HAVE_${u}_H + ;; + esac + case " $puthdr " in + *" $c "*) + ;; + *) puthdr="$puthdr $c" + usr="$usr$nl#define $c 1" + ;; + esac + inc="$inc +#include <$x>" + ;; + esac + done + + # set up the candidate lib list + + for x in $lib $deflib + do case $shell in + ksh) eval 'c=${x#-l}' ;; + *) c=`echo X$x | sed 's,X-l,,'` ;; + esac + case $c in + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + c=`echo '' $c | sed -e 's,.*[\\\\/],,' -e 's,\.[^.]*$,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g' -e '/^lib./s,^lib,,'` + ;; + esac + case $config in + 0) c=_LIB_${c} + ;; + 1) case $shell in + ksh) typeset -u u=$c ;; + *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + c=HAVE_${u}_LIB + ;; + esac + case " $putlib " in + *" $c "*) + ;; + *) putlib="$putlib $c" + usr="$usr$nl#define $c 1" + ;; + esac + done + + # src overrides builtin test + + case $config:$def in + 0:) case $o in + tst|var);; + *) m=_${o}${m} ;; + esac + ;; + 1:) case $o in + tst|var)m=${v} ;; + esac + case $shell in + ksh) typeset -u u=$m ;; + *) u=`echo $m | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + case $o in + tst|var)case $m in + $u) ;; + *) case $m in + hdr_*|lib_*|sys_*) + case $shell in + ksh) u=${u#????} ;; + *) u=`echo $u | sed 's/....//'` ;; + esac + ;; + esac + m=HAVE_${u} + ;; + esac + ;; + dat) m=HAVE${u}_DATA ;; + hdr|lcl)m=HAVE${u}_H ;; + key) m=HAVE${u}_RESERVED ;; + mth) m=HAVE${u}_MATH ;; + npt) m=HAVE${u}_DECL ;; + pth) m=${u}_PATH + case $shell in + ksh) m=${m#_} ;; + *) m=`echo $m | sed 's,^_,,'` ;; + esac + ;; + nxt) m=HAVE${u}_NEXT ;; + siz) m=SIZEOF${u} ;; + sys) m=HAVE_SYS${u}_H ;; + *) m=HAVE${u} ;; + esac + ;; + *) m=$def + M=$m + ;; + esac + case $src in + ?*) case $src in + $noext) EXT= ;; + *) EXT="$tst +$ext" + ;; + esac + copy $tmp.c "$std +$EXT +$usr +$inc +$src +" + V=1 + e=0 + is tst "${note:-$run}" + case $run in + cat*|nocat*) + copy - "$src" + ;; + cross*|nocross*) + copy $tmp.sh "$src" + chmod +x $tmp.sh + execute $tmp.sh <&$nullin || e=1 + ;; + run*|norun*) + (eval "$src") <&$nullin || e=1 + ;; + mac*|nomac*) + if compile $cc -E $tmp.c <&$nullin >$tmp.i + then sed -e '/<<[ ]*".*"[ ]*>>/!d' -e 's/<<[ ]*"//g' -e 's/"[ ]*>>//g' $tmp.i + else e=1 + fi + ;; + p*|nop*)compile $cc -DTEST=$p -DID=$v -E $tmp.c <&$nullin >&$nullout || e=1 + ;; + c*|noc*)compile $cc -DTEST=$p -DID=$v -c $tmp.c <&$nullin >&$nullout || e=1 + ;; + *) case $run in + status*)ccflags= + ;; + s*|nos*)case $reallystatictest in + '') #UNDENT... + + reallystatictest=. + echo "$tst +$ext +int main(){printf("hello");return(0);}" > ${tmp}s.c + rm -f ${tmp}s.exe + if compile $cc -c ${tmp}s.c <&$nullin >&$nullout && + compile $cc -o ${tmp}s.exe ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && + $executable ${tmp}s.exe + then e=`wc -l ${tmp}s.e` + eval set x x $binding + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f ${tmp}s.exe + compile $cc -o ${tmp}s.exe $1 ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe || continue + case `wc -l ${tmp}s.e` in + $e) ;; + *) continue ;; + esac + d=`ls -s ${tmp}s.exe` + rm -f ${tmp}s.exe + compile $cc -o ${tmp}s.exe $2 ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe || continue + case `wc -l ${tmp}s.e` in + $e) ;; + *) continue ;; + esac + case `ls -s ${tmp}s.exe` in + $d) ;; + *) reallystatic=$2 + set x + shift + break + ;; + esac + done + fi + rm -f ${tmp}s.* + #...INDENT + ;; + esac + ccflags=$reallystatic + ;; + *) ccflags= + ;; + esac + set x $mac + e=1 + while : + do o= + shift + while : + do case $# in + 0) break ;; + esac + case $1 in + -) break ;; + esac + o="$o $1" + shift + done + rm -f $tmp.exe + if compile $cc $ccflags $o -DTEST=$p -DID=$v -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe + then case $run in + + status*)execute $tmp.exe <&$nullin >&$nullout + V=$? + case $V in + 0) e=1 ;; + *) e=0 ;; + esac + break + ;; + no[ls]*);; + [ls]*) e=0 && break ;; + noo*) execute $tmp.exe <&$nullin >$tmp.out || break ;; + o*) execute $tmp.exe <&$nullin >$tmp.out && e=0 && break ;; + no*) execute $tmp.exe <&$nullin >&$nullout || break ;; + *) execute $tmp.exe <&$nullin >&$nullout && e=0 && break ;; + + esac + else case $run in + no[els]*)e=1 && break ;; + esac + fi + case $# in + 0) case $run in + no*) e=0 ;; + esac + break + ;; + esac + done + ;; + esac + o=1 + case $run in + no*) case $e in + 0) e=1 ;; + *) e=0 ;; + esac + ;; + esac + case $run in + o*|noo*)case $e in + 0) cat $tmp.out ;; + esac + rm -f $tmp.out + ;; + esac + report $e $V "${note:-$run\ passed}" "${note:-$run} failed" + continue + ;; + esac + + # initialize common builtin state + + case $o in + dat|lib|mth|run) + case $statictest in + "") statictest=FoobaR + copy $tmp.c " +$tst +$ext +$std +$usr +_BEGIN_EXTERNS_ +extern int $statictest; +_END_EXTERNS_ +int main(){char* i = (char*)&$statictest; return ((unsigned int)i)^0xaaaa;} +" + rm -f $tmp.exe + if compile $cc -o $tmp.exe $tmp.c <&$nullin >&$nullout && $executable $tmp.exe + then case $static in + .) static= + copy $tmp.c " +$tst +$ext +int main(){printf("hello");return(0);} +" + rm -f $tmp.exe + if compile $cc -c $tmp.c <&$nullin >&$nullout && + compile $cc -o $tmp.exe $tmp.o <&$nullin >&$nullout && + $executable $tmp.exe + then e=`wc -l $tmp.e` + eval set x x $binding + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f $tmp.exe + compile $cc -o $tmp.exe $1 $tmp.o <&$nullin >&$nullout && $executable $tmp.exe || continue + case `wc -l $tmp.e` in + $e) ;; + *) continue ;; + esac + d=`ls -s $tmp.exe` + rm -f $tmp.exe + compile $cc -o $tmp.exe $2 $tmp.o <&$nullin >&$nullout && $executable $tmp.exe || continue + case `wc -l $tmp.e` in + $e) ;; + *) continue ;; + esac + case `ls -s $tmp.exe` in + $d) ;; + *) static=$2 + set x + shift + break + ;; + esac + done + fi + ;; + esac + else static= + fi + ;; + esac + ;; + esac + + # builtin tests + + case $o in + api) ;; + cmd) case $p in + ?*) continue ;; + esac + is $o $a + k=1 + for j in "" usr + do case $j in + "") d= s= ;; + *) d=/$j s=_$j ;; + esac + for i in bin etc ucb + do if test -f $d/$i/$a + then case $k in + 1) k=0 + case $M in + *-*) ;; + *) usr="$usr$nl#define $m 1" + case $define in + 1) echo "#define $m 1 /* $a in ?(/usr)/(bin|etc|ucb) */" ;; + n) echo "$m=1" ;; + esac + ;; + esac + ;; + esac + c=${s}_${i}_${v} + usr="$usr$nl#define $c 1" + case $define in + 1) echo "#define $c 1 /* $d/$i/$a found */" ;; + n) echo "$c=1" ;; + esac + fi + done + done + case $k in + 0) success ;; + 1) failure ;; + esac + ;; + dat) case $p in + ?*) continue ;; + esac + { + copy - " +$tst +$ext +$std +$usr +$pre +" + case $inc in + ?*) echo "$inc" + ;; + *) echo "_BEGIN_EXTERNS_ +extern int $v; +_END_EXTERNS_" + ;; + esac + echo " +#ifdef _DLL +#define _REF_ +#else +#define _REF_ & +#endif +int main(){char* i = (char*) _REF_ $v; return ((unsigned int)i)^0xaaaa;}" + } > $tmp.c + is $o $v + rm -f $tmp.exe + compile $cc -c $tmp.c <&$nullin >&$nullout && + compile $cc $static -o $tmp.exe $tmp.o $lib $deflib <&$nullin >&$nullout && + $executable $tmp.exe + report $? 1 "$v in default lib(s)" "$v not in default lib(s)" + ;; + dfn) case $p in + ?*) continue ;; + esac + is dfn $v + echo "$pre +$tst +$ext +$inc +#ifdef $v +<<\"#ifndef $v\">> +<<\"#define $v\">> $v <<\"/* native $v */\">> +<<\"#endif\">> +#endif" > $tmp.c + if compile $cc -E $tmp.c <&$nullin >$tmp.i + then sed -e '/<<[ ]*".*"[ ]*>>/!d' -e 's/<<[ ]*"//g' -e 's/"[ ]*>>//g' $tmp.i > $tmp.t + if test -s $tmp.t + then success + cat $tmp.t + else failure + fi + else failure + fi + ;; + exp) case $test in + '') echo "$command: $file$sline: test expression expected for $o" >&$stderr + exit 1 + ;; + esac + case $a in + -|'') ;; + *) eval x='$'$a + case $x in + 1) result=FAILURE + continue + ;; + esac + ;; + esac + case $test in + [01]|'"'*'"'|'<'*'>') + case $a in + -|'') ;; + *) case $define$note in + 1) echo "#define $a $test" ;; + 1*) echo "#define $a $test /* $note */" ;; + n) echo "$a=$test" ;; + esac + eval $a='$test' + ;; + esac + ;; + *) case $note in + '') note=$test ;; + esac + case $test in + '') c=1 + ;; + *) is exp "$note" + x= + for i in `echo '' $test | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_], & ,g'` + do case $i in + [\ \ ]) + ;; + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]*) + eval i='${'$i'}' + case $i in + '') i=0 + ;; + '"'*'"');; + *[!-+0123456789]*) + case $i in + *'"'*) i=1 ;; + *) i='"'$i'"' ;; + esac + ;; + esac + x="$x $i" + ;; + '!') x="$x 0 =" + ;; + '&'|'|')case $x in + *"$i") ;; + *) x="$x \\$i" ;; + esac + ;; + *) x="$x \\$i" + ;; + esac + done + c=`eval expr $x 2>&$stderr` + ;; + esac + case $c in + 0) c=1 ;; + *) c=0 ;; + esac + M=$a + m=$a + report $c 1 "$note is true" "$note is false" + ;; + esac + ;; + hdr|lcl|nxt|sys) + case $o in + lcl|nxt)case $M in + *-*) continue ;; + esac + eval x='$'_$m + case $x in + ?*) continue ;; + esac + eval _$m=1 + is $o $f + echo "$pre +$tst +$ext +$inc +#include <$f.h>" > $tmp.c + case $f in + sys/*) e= ;; + *) e='-e /[\\\\\/]sys[\\\\\/]'$f'\\.h"/d' ;; + esac + if compile $cc -E $tmp.c <&$nullin >$tmp.i + then i=`sed -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:]*[\\\\\/].*[\\\\\/]'$f'\\.h"/!d' $e -e s'/.*"\\(.*\\)".*/\\1/' -e 's,\\\\,/,g' -e 's,///*,/,g' $tmp.i | sed 1q` + case $i in + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]:[\\/]*) + ;; + */*/*) k=`echo "$i" | sed 's,.*/\([^/]*/[^/]*\)$,../\1,'` + echo "$pre +$tst +$ext +$inc +#include <$k>" > $tmp.c + if compile $cc -E $tmp.c <&$nullin >$tmp.i + then j=`sed -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:]*[\\\\\/].*[\\\\\/]'$f'\\.h"/!d' $e -e s'/.*"\\(.*\\)".*/\\1/' -e 's,\\\\,/,g' -e 's,///*,/,g' $tmp.i | sed 1q` + wi=`wc < "$i"` + wj=`wc < "$j"` + case $wi in + $wj) i=$k ;; + esac + fi + ;; + *) echo "$pre +$tst +$ext +$inc +#include <../include/$f.h>" > $tmp.c + if compile $cc -E $tmp.c <&$nullin >&$nullout + then i=../include/$f.h + fi + ;; + esac + else i= + fi + case $i in + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]:[\\/]*|[\\/]*) + success + case $o in + lcl) echo "#if defined(__STDPP__directive)" + echo "__STDPP__directive pragma pp:hosted" + echo "#endif" + echo "#include <$i> /* the native <$f.h> */" + echo "#undef $m" + usr="$usr$nl#define $m 1" + echo "#define $m 1" + ;; + nxt) echo "#define $m <$i> /* include path for the native <$f.h> */" + echo "#define ${m}_str \"$i\" /* include string for the native <$f.h> */" + usr="$usr$nl#define $m <$i>$nl#define ${m}_str \"$i\"" + eval $m=\\\<$i\\\> + ;; + esac + break + ;; + ../*/*) success + case $o in + lcl) echo "#include <$i> /* the native <$f.h> */" + echo "#undef $m" + usr="$usr$nl#define $m 1" + echo "#define $m 1" + eval $m=1 + ;; + nxt) echo "#define $m <$i> /* include path for the native <$f.h> */" + echo "#define ${m}_str \"$i\" /* include string for the native <$f.h> */" + usr="$usr$nl#define $m <$i>$nl#define ${m}_str \"$i\"" + eval $m=\\\<$i\\\> + ;; + esac + break + ;; + *) failure + case $o in + lcl) case $all$config$undef in + ?1?|??1)echo "#undef $m /* no native <$f.h> */" ;; + 1??) echo "#define $m 0 /* no native <$f.h> */" ;; + esac + eval $m=0 + ;; + nxt) case $all$config$undef in + ?1?|??1)echo "#undef $m /* no include path for the native <$f.h> */" ;; + esac + ;; + esac + ;; + esac + ;; + *) case $o in + hdr) x=$f.h ;; + sys) x=sys/$f.h ;; + esac + case " $gothdr " in + *" - $x "*) + failure + + ;; + *" + $x "*) + success + + ;; + *) echo " +$tst +$ext +$allinc +$inc +#include <$x>" > $tmp.c + if is_hdr $x + then gothdr="$gothdr + $x" + case $M in + *-*) ;; + *) case " $puthdr " in + *" $m "*) + ;; + *) puthdr="$puthdr $m" + usr="$usr$nl#define $m 1" + ;; + esac + case $define in + 1) echo "#define $m 1 /* #include <$x> ok */" ;; + n) echo "$m=1" ;; + esac + eval $m=1 + ;; + esac + else gothdr="$gothdr - $x" + case $M in + *-*) ;; + *) case $define$all$config$undef in + 1?1?|1??1)echo "#undef $m /* #include <$x> not ok */" ;; + 11??) echo "#define $m 0 /* #include <$x> not ok */" ;; + n1?1) echo "$m=" ;; + n1??) echo "$m=0" ;; + esac + eval $m=0 + ;; + esac + fi + ;; + esac + continue + ;; + esac + ;; + iff) ;; + ini) ;; + key) case $p in + ?*) continue ;; + esac + w=$v + while : + do is $o $w + echo "$pre +$tst +$ext +int f(){int $w = 1;return($w);}" > $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then failure + case $set in + *" ="|*" = "*) + set x $set + shift + w= + while : + do case $# in + 0) break ;; + esac + case $1 in + =) break ;; + esac + case $w in + '') w=$1 ;; + *) w="$w $1" ;; + esac + shift + done + case $1 in + =) shift + case $# in + 0) set=" " ;; + *) set=$* ;; + esac + ;; + *) set= + ;; + esac + case $shell in + ksh) typeset -u u=$w ;; + *) u=`echo $w | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + esac + u=_$u + M=$w + case $M in + *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) + M=`echo "X$m" | sed -e 's,^.,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` + ;; + esac + case $config in + 1) m=HAVE${u}_RESERVED ;; + *) m=_key_${w} ;; + esac + continue + ;; + esac + report - 1 - - "$w is not a reserved keyword" "default for reserved keyword $v" + else report 0 1 "$w is a reserved keyword" - + case $M in + *-*) ;; + *) case $define$w in + 1$v) ;; + 1*) echo "#define $v $w /* alternate for reserved keyword $v */" ;; + n*) echo "$v=$w" ;; + esac + ;; + esac + fi + break + done + ;; + lib|mth)case $p in + ?*) continue ;; + esac + case $v in + -) continue ;; + esac + is $o $v + copy $tmp.c " +$tst +$ext +$std +$usr +$pre +$inc +typedef int (*_IFFE_fun)(); +#ifdef _IFFE_extern +_BEGIN_EXTERNS_ +extern int $v(); +_END_EXTERNS_ +#endif +static _IFFE_fun i=(_IFFE_fun)$v;int main(){return ((unsigned int)i)^0xaaaa;} +" + d=-D_IFFE_extern + if compile $cc -c $tmp.c <&$nullin >&$nullout + then d= + elif compile $cc $d -c $tmp.c <&$nullin >&$nullout + then : + else d=error + fi + if test error != "$d" + then rm -f $tmp.exe + if compile $cc $d $static -o $tmp.exe $tmp.o $lib $deflib <&$nullin >&$nullout && + $executable $tmp.exe + then case $o in + lib) c=0 ;; + *) c=1 ;; + esac + report $c 1 "$v() in default lib(s)" "$v() not in default lib(s)" "default for function $v()" + else case $o in + mth) rm -f $tmp.exe + compile $cc $d $static -o $tmp.exe $tmp.o -lm <&$nullin >&$nullout && + $executable $tmp.exe + report $? 1 "$v() in math lib" "$v() not in math lib" "default for function $v()" + ;; + *) report 1 1 - "$v() not in default lib(s)" "default for function $v()" + ;; + esac + fi + else case $intrinsic in + '') copy $tmp.c " +$tst +$ext +$std +$usr +$pre +$inc +_BEGIN_EXTERNS_ +extern int foo(); +_END_EXTERNS_ +static int ((*i)())=foo;int main(){return(i==0);} +" + compile $cc -c $tmp.c <&$nullin >&$nullout + intrinsic=$? + ;; + esac + case $o in + mth) report $intrinsic 1 "$v() in math lib" "$v() not in math lib" "default for function $v()" ;; + *) report $intrinsic 1 "$v() in default lib(s)" "$v() not in default lib(s)" "default for function $v()" ;; + esac + fi + ;; + mac) case $p in + ?*) continue ;; + esac + is mac $v + echo " +$tst +$ext +$pre +$inc +#ifdef $v +'$m:$v' +#endif" > $tmp.c + compile $cc -E $tmp.c <&$nullin | grep -c "'$m:$v'" >&$nullout + report $? 1 "$v is a macro" "$v is not a macro" "default for macro $v" + ;; + mem) case $p in + ?*) eval i='$'_iffe_typedef_$p + case $i in + 0|1) ;; + *) echo "$pre +$tst +$ext +$inc +static $p i; +int n = sizeof(i);" > $tmp.c + is typ $p + if compile $cc -c $tmp.c <&$nullin >&$nullout + then success - + eval _iffe_typedef_$p=1 + i=1 + else failure - + eval _iffe_typedef_$p=0 + i=0 + fi + ;; + esac + case $i in + 0) i="$v is not a member of $p" p="struct $p" ;; + *) i=- ;; + esac + is mem $v "$p" + echo "$pre +$tst +$ext +$inc +static $p i; +int n = sizeof(i.$v);" > $tmp.c + compile $cc -c $tmp.c <&$nullin >&$nullout + report $? 1 "$v is a member of $p" "$i" + ;; + *) p=$v + eval i='$'_iffe_typedef_$p + case $i in + 0|1) ;; + *) echo "$pre +$tst +$ext +$inc +static $p i; +int n = sizeof(i);" > $tmp.c + is typ $p + if compile $cc -c $tmp.c <&$nullin >&$nullout + then success - + eval _iffe_typedef_$p=1 + i=1 + else failure - + eval _iffe_typedef_$p=0 + i=0 + fi + ;; + esac + case $i in + 0) i="$p is not a non-opaque struct" p="struct $p" ;; + *) i=- ;; + esac + is nos "$p" + echo "$pre +$tst +$ext +$inc +static $p i; +int n = sizeof(i);" > $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then echo "$pre +$tst +$ext +$inc +static $p i; +unsigned long f() { return (unsigned long)i; }" > $tmp.c + if compile $cc -c $tmp.c <&$nullin >&$nullout + then c=1 + else c=0 + fi + else c=1 + fi + report $c 1 "$p is a non-opaque struct" "$i" + esac + ;; + nop) ;; + npt) is npt $v + copy $tmp.c " +$tst +$ext +$std +$usr +$pre +$inc +_BEGIN_EXTERNS_ +struct _iffe_struct { int _iffe_member; }; +extern struct _iffe_struct* $v _ARG_((struct _iffe_struct*)); +_END_EXTERNS_ +" + # some compilers with -O only warn for invalid intrinsic prototypes + case " $cc " in + *" -O "*) xx=`echo $cc | sed 's/ -O / /g'` ;; + *) xx=$cc ;; + esac + compile $xx -c $tmp.c <&$nullin >&$nullout + report -$config $? 1 "$v() needs a prototype" "$v() does not need a prototype" + ;; + num) is num $v + copy $tmp.c " +$tst +$ext +$std +$usr +$pre +$inc +_BEGIN_EXTERNS_ +int _iffe_int = $v / 2; +_END_EXTERNS_ +" + compile $cc -c $tmp.c <&$nullin >&$nullout + report $? 1 "$v is a numeric constant" "$v is not a numeric constant" + ;; + one) for i in $a $hdr + do x="#include <$i>" + case " $gothdr " in + *" - $i "*) + continue + ;; + *" + $i "*) + ;; + *) echo "$x" > $tmp.c + if is_hdr $x + then gothdr="$gothdr + $x" + else gothdr="$gothdr - $x" + continue + fi + ;; + esac + case $one in + "") one=$x + ;; + *"$x"*) break + ;; + *) echo "$one" > $tmp.c + if compile $cc -E $tmp.c <&$nullin >$tmp.i + then c=$i + case $c in + *[\\/]*) c=`echo $c | sed 's,[\\\\/],[\\\\/],g'` ;; + esac + case `sed -e '/^#[line ]*1[ ][ ]*"[\\\\\/].*[\\\\\/]'$c'"/!d' $tmp.i` in + ?*) break ;; + esac + fi + one="$one$nl$x" + ;; + esac + echo "$x" + break + done + ;; + opt) M=$m + is opt $a + case " $PACKAGE_OPTIONS " in + *" $a "*) c=0 ;; + *) c=1 ;; + esac + report $c 1 "$a is set in \$PACKAGE_OPTIONS" "$a is not set in \$PACKAGE_OPTIONS" + ;; + out|output) + ;; + pth) is pth $a + pkg $pth + tab=" " + e= + f= + for i in $pth + do case $i in + '{') e="${nl}}" + l= + x=i + v="\$${x}" + t=${nl}${tab} + b="fnd()${nl}{${t}for ${x} in" + ;; + '}') b="${b}${t}do${tab}if $exists ${v}/\${1}${t}${tab}${tab}then${tab}f=${v}/\${1}${t}${tab}${tab}${tab}return${t}${tab}${tab}fi" + e="${t}done${e}" + eval "${b}${e}" + fnd $a + case $f in + ?*) break ;; + esac + ;; + -) b="${b}${t}do${tab}test \"${v}\" = '' -o -d \"${v}\" &&${t}${tab}${tab}" + x=${x}i + v="${v}\$${x}" + b="${b}for ${x} in" + e="${t}done${e}" + t="${t}${tab}${tab}" + ;; + *) case $e in + '') if $exists ${i}/${a} + then f=${i}/${a} + break + fi + ;; + *) case $i in + /|.) b="${b} ''" ;; + *) b="${b} /${i}" ;; + esac + ;; + esac + ;; + esac + done + case $f in + '') case $set in + ' ') f=$a ;; + ?*) f=$set ;; + esac + ;; + esac + case $f in + '') c=1 + ;; + *) c=0 + f="\"$f\"" + ;; + esac + report $c "$f" "${note:-$a path}" "$a path not found" + ;; + run) is run $a + if test ! -r $a + then failure not found + case $verbose in + 0) echo "$command: $file$line: $a: not found" >&$stderr ;; + esac + exit 1 + fi + noisy + case $a in + *.c) rm -f $tmp.exe + { + echo "$tst +$ext +$std +$usr +$inc" + cat $a + } > $tmp.c + compile $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$stderr 2>&$stderr && + $executable $tmp.exe && + execute $tmp.exe $opt <&$nullin + ;; + *.sh) { + copy - ": +set \"cc='$cc' executable='$executable' id='$m' static='$static' tmp='$tmp'\" $opt $hdr $test" + cat $a + } > $tmp.sh + chmod +x $tmp.sh + ( . $tmp.sh ) <&$nullin + ;; + *) false + ;; + esac + case $? in + 0) success + ;; + *) failure cannot run + case $verbose in + 0) echo "$command: $file$line: $a: cannot run" >&$stderr ;; + esac + exit 1 + ;; + esac + ;; + siz) case $p in + "") x= ;; + *) x="$p " ;; + esac + is siz "$x$v" + { + case $p:$v in + long:*|*:*[_0123456789]int[_0123456789]*) + echo "$pre +$tst +$ext +$inc +static $x$v i; +$x$v f() { +$x$v v; i = 1; v = i;" + echo "i = v * i; i = i / v; v = v + i; i = i - v;" + case $v in + float|double) ;; + *) echo "v <<= 4; i = v >> 2; i = 10; i = v % i; i |= v; v ^= i; i = 123; v &= i;" ;; + esac + echo "return v; }" + ;; + *) echo "$pre +$inc +struct xxx { $x$v mem; }; +static struct xxx v; +struct xxx* f() { return &v; }" + ;; + esac + case $x in + ""|"struct "|"union ") + echo "int g() { return 0; }" + ;; + *) echo "int g() { return sizeof($x$v)<=sizeof($v); }" ;; + esac + copy - " +int main() { + f(); + g(); + printf(\"%u\\n\", sizeof($x$v)); + return 0; +}" + } > $tmp.c + rm -f $tmp.exe $tmp.dat + if compile $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && + $executable $tmp.exe && + execute $tmp.exe > $tmp.dat + then z=`cat $tmp.dat` + c=0 + else z=0 + c=1 + fi + report $c "$z" "sizeof($x$v)" "$x$v not a type with known size" + ;; + sym) case $test in + "") x=$v ;; + *) x=$test ;; + esac + echo "$pre +$tst +$ext +$inc +'=' $x '='" > $tmp.c + compile $cc -E $tmp.c <&$nullin \ + | sed \ + -e "/'='/!d" \ + -e "s/'='//g" \ + -e 's/[ ]//g' \ + -e 's/((([^()]*)))->/->/g' \ + -e 's/(([^()]*))->/->/g' \ + -e 's/([^()]*)->/->/g' \ + -e 's/\([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*\)\[/\ +ary \1[/g' \ + -e 's/\([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*\)(/\ +fun \1[/g' \ + -e 's/\*->\([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]\)/->\ +ptr \1/g' \ + -e 's/->\([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]\)/->\ +reg \1/g' \ + -e "/^$v\$/d" \ + -e 's/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*$/\ +nam &/g' \ + | sed \ + -e '/^... /!d' \ + | LC_ALL=C sort \ + -u \ + | sed \ + -e 's/\(...\) \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*\).*/#ifndef _\1_'$v'\ +#define _\1_'$v' \2\ +#define _\1_'$v'_str "\2"\ +#endif/' + ;; + typ) case $p in + "") x= ;; + *) x="$p " ;; + esac + is typ "$x$v" + { + case $p:$v in + long:*|*:*[_0123456789]int[_0123456789]*) + echo "$pre +$tst +$ext +$inc +static $x$v i; +$x$v f() { +$x$v v; i = 1; v = i;" + echo "i = v * i; i = i / v; v = v + i; i = i - v;" + case $v in + float|double) ;; + *) echo "v <<= 4; i = v >> 2; i = 10; i = v % i; i |= v; v ^= i; i = 123; v &= i;" ;; + esac + echo "return v; }" + ;; + *) echo "$pre +$tst +$ext +$inc +struct xxx { $x$v mem; }; +static struct xxx v; +struct xxx* f() { return &v; }" + ;; + esac + case $x in + ""|"struct "|"union ") + echo "int main() { f(); return 0; }" ;; + *) echo "int main() { f(); return sizeof($x$v)<=sizeof($v); }" ;; + esac + } > $tmp.c + rm -f $tmp.exe + compile $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && + $executable $tmp.exe && + execute $tmp.exe + report $? 1 "$x$v is a type" "$x$v is not a type" "default for type $x$v" + ;; + val) case $arg in + '"'*'"')echo $arg=\'$val\' ;; + *) echo $arg=\"$val\" ;; + esac + ;; + ver) ;; + 0) result=FAILURE + ;; + 1) result=SUCCESS + ;; + :) ;; + -) ;; + *) echo "$command: $file$line: $o: unknown feature test" >&$stderr + status=1 + ;; + esac + done + done + case $not in + 1) case $result in + FAILURE) result=SUCCESS ;; + *) result=FAILURE ;; + esac + ;; + esac + case $result in + FAILURE) user_pf=$fail user_yn=$no ;; + *) user_pf=$pass user_yn=$yes ;; + esac + case $user_pf in + ?*) eval "$user_pf" <&$nullin ;; + esac + case $user_yn in + ?*) case $def in + -) ;; + *) case $note in + ?*) case $user_yn in + *$nl*) user_yn="/* $note */$nl$user_yn" ;; + *) user_yn="$user_yn /* $note */" ;; + esac + ;; + esac + ;; + esac + copy - "$user_yn" + ;; + esac + case $ifelse:$result in + TEST:SUCCESS) ifelse=KEEP ;; + TEST:*) ifelse=SKIP ;; + esac + case $group:$result in + :*|*:SUCCESS) break ;; + esac + set '' $groups '' "$@" + shift + case $1 in + '') shift; break ;; + esac + shift + + # set up and try the next group + + hdr=$com_hdr + lib=$com_lib + mac=$com_mac + opt=$com_opt + pth=$com_pth + test=$com_test + cc="$occ $includes" + group= + groups= + while : + do case $1 in + '') shift; break ;; + esac + case $1 in + *[\"\'\(\)\{\}\ \ ]*) + case $op in + pth) pth="$pth $1" + ;; + *) case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + ;; + esac + ;; + -) group=$group$1 + groups="$groups $1" + ;; + -l*) case $group in + -*) groups="$groups $1" ;; + *) lib="$lib $1" ;; + esac + ;; + +l*) case $shell in + bsh) x=`echo X$1 | sed 's/X+/-/'` ;; + *) eval 'x=-${1#+}' ;; + esac + case $group in + -*) groups="$groups $x" ;; + *) lib="$lib $x" ;; + esac + ;; + -*|+*) case $group in + -*) groups="$groups $1" + ;; + *) case $op in + run) opt="$opt $1" + ;; + *) case $1 in + -D*) mac="$mac $1" ;; + *) cc="$cc $1" ;; + esac + ;; + esac + ;; + esac + ;; + *.[aAxX]|*.[dD][lL][lL]|*.[lL][iI][bB]) + case $group in + -*) groups="$groups $1" ;; + *) lib="$lib $1" ;; + esac + ;; + *[.\\/]*) + case $group in + -*) groups="$groups $1" + ;; + *) case $op in + pth) pth="$pth $1" ;; + *) hdr="$hdr $1" ;; + esac + ;; + esac + ;; + *) case $group in + -*) groups="$groups $1" + ;; + *) case $op in + pth) pth="$pth $1" + ;; + *) case $test in + '') test=$1 ;; + *) test="$test $1" ;; + esac + ;; + esac + ;; + esac + ;; + esac + shift + done + done +done diff --git a/src/cmd/INIT/iffe.tst b/src/cmd/INIT/iffe.tst new file mode 100644 index 0000000..115ef62 --- /dev/null +++ b/src/cmd/INIT/iffe.tst @@ -0,0 +1,1943 @@ +# regression tests for the iffe command + +TEST 01 'command line basics' + + EXEC -r -v - hdr stdio + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + + EXEC -r -v -s bsh - hdr stdio + + EXEC -r -v - hdr stdio,limits + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _hdr_limits 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is limits.h a header ... yes' + + EXEC -r -v -s bsh - hdr stdio,limits + + EXEC -r -v - hdr,lib no_foo_bar,no_bar_foo stdio.h + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is no_foo_bar.h a header ... no +iffe: test: is no_bar_foo.h a header ... no +iffe: test: is no_foo_bar a library function ... no +iffe: test: is no_bar_foo a library function ... no' + + EXEC -r -v -s bsh - hdr,lib no_foo_bar,no_bar_foo stdio.h + + EXEC -r -v - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h + + EXEC -r -v -s bsh - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h + +TEST 02 'file input basics' + + EXEC -r -v - t1.iffe + INPUT t1.iffe $'hdr stdio' + OUTPUT - $'/* : : generated from t1.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + + EXEC -r -v -s bsh - t1.iffe + + EXEC -r -v - t2.iffe + INPUT t2.iffe $'hdr stdio,limits' + OUTPUT - $'/* : : generated from t2.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _hdr_limits 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is limits.h a header ... yes' + + EXEC -r -v -s bsh - t2.iffe + + EXEC -r -v - t3.iffe + INPUT t3.iffe $'hdr,lib no_foo_bar,no_bar_foo stdio.h' + OUTPUT - $'/* : : generated from t3.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is no_foo_bar.h a header ... no +iffe: test: is no_bar_foo.h a header ... no +iffe: test: is no_foo_bar a library function ... no +iffe: test: is no_bar_foo a library function ... no' + + EXEC -r -v -s bsh - t3.iffe + + EXEC -r -v - t3.iffe + INPUT t3.iffe $'hdr no_foo_bar,no_bar_foo stdio.h +lib no_foo_bar,no_bar_foo stdio.h' + + EXEC -r -v -s bsh - t3.iffe + +TEST 03 'nested if' + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr stdio + if lib open { + HIT 1 + } + elif lib close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _lib_open 1 /* open() in default lib(s) */ + HIT 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is open a library function ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr _XXX_stdio + if lib open { + HIT 1 + } + elif lib close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_limits 1 /* #include ok */ +HIT 4 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is _XXX_stdio.h a header ... no +iffe: test: is limits.h a header ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr _XXX_stdio + if lib open { + HIT 1 + } + elif lib close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr _XXX_limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +HIT 5 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is _XXX_stdio.h a header ... no +iffe: test: is _XXX_limits.h a header ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr stdio + if lib _XXX_open { + HIT 1 + } + elif lib close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _lib_close 1 /* close() in default lib(s) */ + HIT 2 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is _XXX_open a library function ... no +iffe: test: is close a library function ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if hdr stdio + if lib _XXX_open { + HIT 1 + } + elif lib _XXX_close { + HIT 2 + } + else { + HIT 3 + } + endif +elif hdr limits { + HIT 4 +} +else { + HIT 5 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ + HIT 3 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is _XXX_open a library function ... no +iffe: test: is _XXX_close a library function ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if mem stat.st_atime sys/types.h sys/stat.h { + #define ATIME 1 +} +elif mem stat.st_ctime sys/types.h sys/stat.h { + #define CTIME 1 +} +elif mem stat.st_mtime sys/types.h sys/stat.h { + #define MTIME 1 +} +else pass{ no_stat_time=1 }end { + #define NOTIME 1 +} +endif +if ( !no_stat_time ) { + #define YESTIME 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _sys_stat 1 /* #include ok */ +#define _mem_st_atime_stat 1 /* st_atime is a member of struct stat */ +#define ATIME 1 + +#define YESTIME 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is stat a type or typedef ... no +iffe: test: is st_atime a member of struct stat ... yes +iffe: test: is ( !no_stat_time ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if mem foo_stat.st_atime sys/types.h sys/stat.h { + #define ATIME 1 +} +elif mem stat.st_ctime sys/types.h sys/stat.h { + #define CTIME 1 +} +elif mem stat.st_mtime sys/types.h sys/stat.h { + #define MTIME 1 +} +else pass{ no_stat_time=1 }end { + #define NOTIME 1 +} +endif +if ( !no_stat_time ) { + #define YESTIME 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _sys_stat 1 /* #include ok */ +#define _mem_st_ctime_stat 1 /* st_ctime is a member of struct stat */ +#define CTIME 1 + +#define YESTIME 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is foo_stat a type or typedef ... no +iffe: test: is st_atime a member of struct foo_stat ... no +iffe: test: is stat a type or typedef ... no +iffe: test: is st_ctime a member of struct stat ... yes +iffe: test: is ( !no_stat_time ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if mem foo_stat.st_atime sys/types.h sys/stat.h { + #define ATIME 1 +} +elif mem foo_stat.st_ctime sys/types.h sys/stat.h { + #define CTIME 1 +} +elif mem stat.st_mtime sys/types.h sys/stat.h { + #define MTIME 1 +} +else pass{ no_stat_time=1 }end { + #define NOTIME 1 +} +endif +if ( !no_stat_time ) { + #define YESTIME 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _sys_stat 1 /* #include ok */ +#define _mem_st_mtime_stat 1 /* st_mtime is a member of struct stat */ +#define MTIME 1 + +#define YESTIME 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is foo_stat a type or typedef ... no +iffe: test: is st_atime a member of struct foo_stat ... no +iffe: test: is st_ctime a member of struct foo_stat ... no +iffe: test: is stat a type or typedef ... no +iffe: test: is st_mtime a member of struct stat ... yes +iffe: test: is ( !no_stat_time ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff ifelse +if mem foo_stat.st_atime sys/types.h sys/stat.h { + #define ATIME 1 +} +elif mem foo_stat.st_ctime sys/types.h sys/stat.h { + #define CTIME 1 +} +elif mem foo_stat.st_mtime sys/types.h sys/stat.h { + #define MTIME 1 +} +else pass{ no_stat_time=1 }end { + #define NOTIME 1 +} +endif +if ( !no_stat_time ) { + #define YESTIME 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _ifelse_H +#define _ifelse_H 1 +#define _sys_types 1 /* #include ok */ +#define _sys_stat 1 /* #include ok */ +#define NOTIME 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is foo_stat a type or typedef ... no +iffe: test: is st_atime a member of struct foo_stat ... no +iffe: test: is st_ctime a member of struct foo_stat ... no +iffe: test: is st_mtime a member of struct foo_stat ... no +iffe: test: is ( !no_stat_time ) true ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'set explicit +iff previous +hdr stdio +if hdr stdio { + OK +} +else { + OK +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _previous_H +#define _previous_H 1 +#define _hdr_stdio 1 /* #include ok */ +OK + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + + EXEC -r -v -s bsh - t.iffe + +TEST 04 'test variable/macro override' + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +HAVE_STDIO = hdr stdio' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HAVE_STDIO 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if hdr - stdio { + #define HIT 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HIT 1 + +#endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if - hdr stdio { + #define HIT 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if ? hdr stdio { + #define HIT 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if hdr - stdio { + #define HIT 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if HAVE_STDIO = hdr stdio { + #define HIT 1 +} +endif +if ( HAVE_STDIO ) { + #define TOO ALSO +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HAVE_STDIO 1 /* #include ok */ +#define HIT 1 + +#define TOO ALSO + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is ( HAVE_STDIO ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if HAVE_STDIO = hdr stdio { + #define HIT 1 +} +endif +exp ALSO HAVE_STDIO' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HAVE_STDIO 1 /* #include ok */ +#define HIT 1 + +#define ALSO 1 /* HAVE_STDIO is true */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is HAVE_STDIO true ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if HAVE_STDIO = hdr stdio { + #define HIT 1 +} +endif +ALSO = ( HAVE_STDIO )' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define HAVE_STDIO 1 /* #include ok */ +#define HIT 1 + +#define ALSO 1 /* ( HAVE_STDIO ) is true */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is ( HAVE_STDIO ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + +TEST 05 'test code option sequence' + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 1 && B == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#define _seq 1 /* long int type */ +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 0 && B == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 2 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 0 && B == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 1 && B == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +/* long int type */ +#define seq 1 + +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 0 && B == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 2 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DA=1 - -DB=1 note{ long int type }end compile{ + #if A == 0 && B == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... no' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{ + #if G == 1 && N == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DN=1 - -DN=2 - -DN=3 note{ long int type }end compile{ + #if N == 1 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +/* long int type */ +#define seq 1 + +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DN=1 - -DN=2 - -DN=3 note{ long int type }end compile{ + #if N == 2 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DN=1 - -DN=2 - -DN=3 note{ long int type }end compile{ + #if N == 3 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... +iffe: test: long int type ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v - t.iffe + INPUT t.iffe $'iff macro +if tst - -DN=1 - -DN=2 - -DN=3 note{ long int type }end compile{ + #if N == 0 + #define t long + #else + #define t error + #endif + t n = 0; +}end { + #define seq 1 +} +endif' + OUTPUT - '/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _macro_H +#define _macro_H 1 +#define _sys_types 1 /* #include ok */ +#endif' + ERROR - 'iffe: test: is sys/types.h a header ... yes +iffe: test: long int type ... +iffe: test: long int type ... +iffe: test: long int type ... no' + + EXEC -r -v -s bsh - t.iffe + +TEST 06 'block side effects' + + EXEC -r - t.iffe + INPUT t.iffe $'iff - +tst output{ + int + main() + { + printf("HIT\\n"); + return 0; + } +}end' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#define _sys_types 1 /* #include ok */ +HIT' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'iff +tst - output{ + int + main() + { + printf("HIT\\n"); + return 0; + } +}end' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'iff +tst - output{ + int + main() + { + printf("HIT\\n"); + return 1; + } +}end' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#define _sys_types 1 /* #include ok */' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'iff +tst - nooutput{ + int + main() + { + printf("HIT\\n"); + return 1; + } +}end' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#define _sys_types 1 /* #include ok */ +HIT' + + EXEC -r -s bsh - t.iffe + +TEST 07 'diagnostics' + + EXEC -r - t.iffe + INPUT t.iffe $'tst foo' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#endif' + ERROR - $'iffe: t.iffe:1: tst: unknown feature test' + EXIT 1 + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'if (1)' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */' + ERROR - $'iffe: t.iffe:1: missing endif' + EXIT 1 + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'if' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */' + ERROR - $'iffe: t.iffe:1: missing endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'endif' + ERROR - $'iffe: t.iffe:1: endif: no matching if' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'if { +}end' + ERROR - $'iffe: t.iffe:2: missing }' + + EXEC -r -s bsh - t.iffe + +TEST 08 'negation consternation' + + EXEC -r - t.iffe + INPUT t.iffe $'npt fopen,fooon stdio.h' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _npt_fooon 1 /* fooon() needs a prototype */ +#endif' + + EXEC -r -u - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#undef _npt_fopen /* fopen() does not need a prototype */ +#define _npt_fooon 1 /* fooon() needs a prototype */ +#endif' + + EXEC -r -a - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define _npt_fopen 0 /* fopen() does not need a prototype */ +#define _npt_fooon 1 /* fooon() needs a prototype */ +#endif' + + EXEC -r -C - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define HAVE_SYS_TYPES_H 1 /* #include ok */ +#define HAVE_STDLIB_H 1 /* #include ok */ +#define HAVE_UNISTD_H 1 /* #include ok */ +#define HAVE_STDIO_H 1 /* #include ok */ +#define HAVE_FOPEN_DECL 1 /* fopen() does not need a prototype */ +#undef HAVE_FOOON_DECL /* fooon() needs a prototype */ +#endif' + + EXEC -r - t.iffe + INPUT t.iffe $'NEED_FOPEN = npt fopen stdio.h +HAVE_FOPEN = ! npt fopen stdio.h +NEED_FOOON = npt fooon stdio.h +HAVE_FOOON = ! npt fooon stdio.h' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#define HAVE_FOPEN 1 /* fopen() does not need a prototype */ +#define NEED_FOOON 1 /* fooon() needs a prototype */ +#endif' + + EXEC -r -u - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_stdlib 1 /* #include ok */ +#define _hdr_unistd 1 /* #include ok */ +#define _hdr_stdio 1 /* #include ok */ +#undef NEED_FOPEN /* fopen() does not need a prototype */ +#define HAVE_FOPEN 1 /* fopen() does not need a prototype */ +#define NEED_FOOON 1 /* fooon() needs a prototype */ +#undef HAVE_FOOON /* fooon() needs a prototype */ +#endif' + + EXEC -r -C - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define HAVE_SYS_TYPES_H 1 /* #include ok */ +#define HAVE_STDLIB_H 1 /* #include ok */ +#define HAVE_UNISTD_H 1 /* #include ok */ +#define HAVE_STDIO_H 1 /* #include ok */ +#undef NEED_FOPEN /* fopen() does not need a prototype */ +#define HAVE_FOPEN 1 /* fopen() does not need a prototype */ +#define NEED_FOOON 1 /* fooon() needs a prototype */ +#undef HAVE_FOOON /* fooon() needs a prototype */ +#endif' + +TEST 09 'exp vs. if' + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_false { + ONE +} +exp _tst_hit !_tst_hit&_tst_true pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_false is true */ +/* !_tst_false */ +ONE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&_tst_true pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_hit&_tst_true is true */ +TWO 0 1 +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&_tst_false pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_hit&_tst_true is true */ +/* !_tst_hit&_tst_true */ +THREE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&_tst_false pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_false { + ONE +} +exp _tst_hit !_tst_hit&&_tst_true pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_false is true */ +/* !_tst_false */ +ONE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&&_tst_true pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_hit&&_tst_true is true */ +TWO 0 1 +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&&_tst_false pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#define _tst_hit 1 /* !_tst_hit&&_tst_true is true */ +/* !_tst_hit&&_tst_true */ +THREE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +exp _tst_hit !_tst_true { + ONE +} +exp _tst_hit !_tst_hit&&_tst_false pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_false ) { + ONE +} +elif ( _tst_true ) pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +ONE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) { + ONE +} +elif ( _tst_true ) pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +TWO +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) { + ONE +} +elif ( _tst_false ) pass{ +cat < ok */ +#define _tst_true 1 /* ( 1 ) is true */ +THREE + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) yes{ + typedef struct + { + int dd_fd; /* file descriptor */ + } DIR; +}end +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _tst_true 1 /* ( 1 ) is true */ +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) { + typedef struct + { + int dd_fd; /* file descriptor */ + } DIR; +} +else { + OK +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _tst_true 1 /* ( 1 ) is true */ +OK + +#endif' + + EXEC -r -s bsh - t.iffe + + EXEC -r - t.iffe + INPUT t.iffe $'_tst_false = ( 0 ) +_tst_true = ( 1 ) +if ( ! _tst_true ) { + typedef struct + { + int dd_fd; /* file descriptor */ + }; +} +else { + OK +} +endif' + + EXEC -r -s bsh - t.iffe + +TEST 10 'exp details' + + EXEC -r -v - t.iffe + INPUT t.iffe $'_str = "string" +_hdr =
+_aaa = ( 0 ) +_zzz = ( 1 ) +( _str ) +( ! _str ) +( _hdr ) +( ! _hdr ) +( _aaa ) +( ! _aaa ) +( _zzz ) +( ! _zzz )' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _str "string" +#define _hdr
+#define _zzz 1 /* ( 1 ) is true */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is ( 0 ) true ... no +iffe: test: is ( 1 ) true ... yes +iffe: test: is ( _str ) true ... yes +iffe: test: is ( ! _str ) true ... no +iffe: test: is ( _hdr ) true ... yes +iffe: test: is ( ! _hdr ) true ... no +iffe: test: is ( _aaa ) true ... no +iffe: test: is ( ! _aaa ) true ... yes +iffe: test: is ( _zzz ) true ... yes +iffe: test: is ( ! _zzz ) true ... no' + + EXEC -r -v -s bsh - t.iffe + +TEST 11 'set [no]define' + + EXEC -r -v - t.iffe + INPUT t.iffe $'set nodefine +mem stat.st_mtime sys/types.h sys/stat.h +set define +mem stat.st_mode sys/types.h sys/stat.h +if ( _mem_st_mtime_stat ) { + 1 +} +endif +if ( _mem_st_mode_stat ) { + 2 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _mem_st_mode_stat 1 /* st_mode is a member of struct stat */ +1 + +2 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is sys/stat.h a header ... yes +iffe: test: is stat a type or typedef ... no +iffe: test: is st_mtime a member of struct stat ... yes +iffe: test: is st_mode a member of struct stat ... yes +iffe: test: is ( _mem_st_mtime_stat ) true ... yes +iffe: test: is ( _mem_st_mode_stat ) true ... yes' + + EXEC -r -v -s bsh - t.iffe + +TEST 12 'non-opaque mem' + + EXEC -r -v - mem OPAQUE -I. t.h + INPUT t.h $'typedef struct opaque OPAQUE;' + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_t 1 /* #include ok */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is t.h a header ... yes +iffe: test: is OPAQUE a type or typedef ... no +iffe: test: is struct OPAQUE a non-opaque struct ... no' + + EXEC -r -v - mem NONOPAQUE -I. t.h + INPUT t.h $'struct nonopaque { int pad; }; +typedef struct nonopaque NONOPAQUE;' + OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _hdr_t 1 /* #include ok */ +#define _mem_NONOPAQUE 1 /* NONOPAQUE is a non-opaque struct */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is t.h a header ... yes +iffe: test: is NONOPAQUE a type or typedef ... yes +iffe: test: is NONOPAQUE a non-opaque struct ... yes' + +TEST 13 'key states' + + EXEC -r -v - t.iffe + INPUT t.iffe $'key int +key const = +key foo +key bar = +key aha = huh = int +key chr = char = int' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _key_int 1 /* int is a reserved keyword */ +#define _key_const 1 /* const is a reserved keyword */ +#define bar /* default for reserved keyword bar */ +#define aha int /* default for reserved keyword aha */ +#define _key_char 1 /* char is a reserved keyword */ +#define chr char /* alternate for reserved keyword chr */ +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is int a reserved keyword ... yes +iffe: test: is const a reserved keyword ... yes +iffe: test: is foo a reserved keyword ... no +iffe: test: is bar a reserved keyword ... no +iffe: test: is aha a reserved keyword ... no +iffe: test: is huh a reserved keyword ... no +iffe: test: is chr a reserved keyword ... no +iffe: test: is char a reserved keyword ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -u -r -v - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _key_int 1 /* int is a reserved keyword */ +#define _key_const 1 /* const is a reserved keyword */ +#undef _key_foo /* foo is not a reserved keyword */ +#undef _key_bar /* bar is not a reserved keyword */ +#define bar /* default for reserved keyword bar */ +#undef _key_huh /* huh is not a reserved keyword */ +#define aha int /* default for reserved keyword aha */ +#define _key_char 1 /* char is a reserved keyword */ +#define chr char /* alternate for reserved keyword chr */ +#endif' + + EXEC -u -r -v -s bsh - t.iffe + + EXEC -a -r -v - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define _key_int 1 /* int is a reserved keyword */ +#define _key_const 1 /* const is a reserved keyword */ +#define _key_foo 0 /* foo is not a reserved keyword */ +#define _key_bar 0 /* bar is not a reserved keyword */ +#define bar /* default for reserved keyword bar */ +#define _key_huh 0 /* huh is not a reserved keyword */ +#define aha int /* default for reserved keyword aha */ +#define _key_char 1 /* char is a reserved keyword */ +#define chr char /* alternate for reserved keyword chr */ +#endif' + + EXEC -a -r -v -s bsh - t.iffe + + EXEC -C -r -v - t.iffe + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define HAVE_SYS_TYPES_H 1 /* #include ok */ +#define HAVE_INT_RESERVED 1 /* int is a reserved keyword */ +#define HAVE_CONST_RESERVED 1 /* const is a reserved keyword */ +#undef HAVE_FOO_RESERVED /* foo is not a reserved keyword */ +#undef HAVE_BAR_RESERVED /* bar is not a reserved keyword */ +#define bar /* default for reserved keyword bar */ +#undef HAVE_HUH_RESERVED /* huh is not a reserved keyword */ +#define aha int /* default for reserved keyword aha */ +#define HAVE_CHAR_RESERVED 1 /* char is a reserved keyword */ +#define chr char /* alternate for reserved keyword chr */ +#endif' + + EXEC -C -r -v -s bsh - t.iffe + +TEST 14 'inc file' + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc t_lib.h +if ( bar_foo ) { + #define all 1 +} +elif ( _foo_bar ) { + #define some 1 +} +endif' + INPUT t_lib.h '#define bar_foo ALL +#define _foo_bar SOME' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define some 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is ( bar_foo ) true ... no +iffe: test: is ( _foo_bar ) true ... yes' + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc t_lib.h . +if ( bar_foo ) { + #define all 1 +} +elif ( _foo_bar ) { + #define ok 1 +} +endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define all 1 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is ( bar_foo ) true ... yes' + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc t_lib.h . ? +if ( bar_foo ) { + #define all 1 +} +elif ( _foo_bar ) { + #define ok 1 +} +endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: t.iffe:1: warning: ?: operands ignored +iffe: test: is ( bar_foo ) true ... yes' + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc foo_lib.h' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: t.iffe:1: foo_lib.h: file not found' + EXIT 1 + + EXEC -r -v - t.iffe + INPUT t.iffe $'inc' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: t.iffe:1: path expected' + +TEST 15 'KnR compatibility' + + EXEC -r -v - t.iffe + INPUT t.iffe $' +if ( 1 ) { + #define all 1 +} +endif +if ( 2 ) { + #define some 1 +} +endif +cat{ +#define a 1 + #define b 2 + #define c 3 + #define d 4 +}end' +#define _foo_bar SOME' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define some 1 + +#endif' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#define all 1 + +#define some 1 + +#define a 1 +#define b 2 +#define c 3 +#define d 4 + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is ( 1 ) true ... yes +iffe: test: is ( 2 ) true ... yes +iffe: test: cat{ ... }end ... yes' + + EXEC -r -v -s bsh - t.iffe + + EXEC -r -v -s osh - t.iffe + +TEST 16 '{ define extern include print }' + + EXEC -r -v - t.iffe + INPUT t.iffe $' +print /* test header */ +header stdio.h +define EOF -1 +define FoobaR (a,b) ((a)+(b)) +define FoomaC -1 +extern fopen FILE* (char*, char*) +extern BarfoO struct barfoo* (int) +extern Tab_lE struct barfoo* [10]' + OUTPUT - $'/* test header */ +/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _REGRESS +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#include +#define FoobaR(a,b) ((a)+(b)) +#define FoomaC -1 +extern struct barfoo* BarfoO(int); +extern struct barfoo* Tab_lE[10]; +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes +iffe: test: is EOF a macro ... yes +iffe: test: is FoobaR a macro ... no +iffe: test: is FoomaC a macro ... no +iffe: test: is fopen a symbol that needs a prototype ... no +iffe: test: is BarfoO a symbol that needs a prototype ... yes +iffe: test: is Tab_lE a symbol that needs a prototype ... yes' + +TEST 17 'features/* => FEATURE/*' + + EXEC -r -v run features/stdio + INPUT features/stdio $'set prototyped +header stdio.h' + OUTPUT FEATURE/stdio $' +/* : : generated by proto : : */ +/* : : generated from features/stdio by iffe version 1995-03-19 : : */ + +#ifndef _REGRESS +#if !defined(__PROTO__) +# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) +# if defined(__cplusplus) +# define __LINKAGE__ "C" +# else +# define __LINKAGE__ +# endif +# define __STDARG__ +# define __PROTO__(x) x +# define __OTORP__(x) +# define __PARAM__(n,o) n +# if !defined(__STDC__) && !defined(__cplusplus) +# if !defined(c_plusplus) +# define const +# endif +# define signed +# define void int +# define volatile +# define __V_ char +# else +# define __V_ void +# endif +# else +# define __PROTO__(x) () +# define __OTORP__(x) x +# define __PARAM__(n,o) o +# define __LINKAGE__ +# define __V_ char +# define const +# define signed +# define void int +# define volatile +# endif +# define __MANGLE__ __LINKAGE__ +# if defined(__cplusplus) || defined(c_plusplus) +# define __VARARG__ ... +# else +# define __VARARG__ +# endif +# if defined(__STDARG__) +# define __VA_START__(p,a) va_start(p,a) +# else +# define __VA_START__(p,a) va_start(p) +# endif +# if !defined(__INLINE__) +# if defined(__cplusplus) +# define __INLINE__ extern __MANGLE__ inline +# else +# if defined(_WIN32) && !defined(__GNUC__) +# define __INLINE__ __inline +# endif +# endif +# endif +#endif +#if !defined(__LINKAGE__) +#define __LINKAGE__ /* 2004-08-11 transition */ +#endif + +#define _REGRESS 1 +#define _sys_types 1 /* #include ok */ +#include +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes +iffe: test: is stdio.h a header ... yes' + +TEST 18 'api + ver' + EXEC -r -v - t.iffe + INPUT t.iffe $'iff api +ver foo 20100606 +ver bar 19840919 + +api foo 19991231 dis dat tother +api foo 20100601 dat +api foo 20100606 dis +api bar 19991231 moe larry shemp +api bar 20020202 curly +api bar 20030303 shemp +api bar 20040404 joe_b +api bar 20050505 joe_d +' + OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ +#ifndef _api_H +#define _api_H 1 +#define _sys_types 1 /* #include ok */ + +#define FOO_VERSION 20100606 +#define BAR_VERSION 19840919 + +#if !defined(_API_foo) && defined(_API_DEFAULT) +#define _API_foo _API_DEFAULT +#endif + +#if ( _BLD_foo || !_API_foo || _API_foo >= 20100601 ) +#undef dat +#define dat dat_20100601 +#elif _API_foo >= 19991231 +#undef dat +#define dat dat_19991231 +#endif + +#if ( _BLD_foo || !_API_foo || _API_foo >= 20100606 ) +#undef dis +#define dis dis_20100606 +#elif _API_foo >= 19991231 +#undef dis +#define dis dis_19991231 +#endif + +#if ( _BLD_foo || !_API_foo || _API_foo >= 19991231 ) +#undef tother +#define tother tother_19991231 +#endif + +#define _API_foo_MAP "dat_20100601 dat_19991231 dis_20100606 dis_19991231 tother_19991231" + +#if !defined(_API_bar) && defined(_API_DEFAULT) +#define _API_bar _API_DEFAULT +#endif + +#if ( _BLD_bar || !_API_bar || _API_bar >= 20020202 ) +#undef curly +#define curly curly_20020202 +#endif + +#if ( _BLD_bar || !_API_bar || _API_bar >= 20040404 ) +#undef joe_b +#define joe_b joe_b_20040404 +#endif + +#if ( _BLD_bar || !_API_bar || _API_bar >= 20050505 ) +#undef joe_d +#define joe_d joe_d_20050505 +#endif + +#if ( _BLD_bar || !_API_bar || _API_bar >= 19991231 ) +#undef larry +#define larry larry_19991231 +#endif + +#if ( _BLD_bar || !_API_bar || _API_bar >= 19991231 ) +#undef moe +#define moe moe_19991231 +#endif + +#if ( _BLD_bar || !_API_bar || _API_bar >= 20030303 ) +#undef shemp +#define shemp shemp_20030303 +#elif _API_bar >= 19991231 +#undef shemp +#define shemp shemp_19991231 +#endif + +#define _API_bar_MAP "curly_20020202 joe_b_20040404 joe_d_20050505 larry_19991231 moe_19991231 shemp_20030303 shemp_19991231" + +#endif' + ERROR - $'iffe: test: is sys/types.h a header ... yes' diff --git a/src/cmd/INIT/ignore.sh b/src/cmd/INIT/ignore.sh new file mode 100644 index 0000000..2999645 --- /dev/null +++ b/src/cmd/INIT/ignore.sh @@ -0,0 +1,43 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +# non-ksh script for the nmake ignore prefix +# @(#)ignore (AT&T Research) 1992-08-11 + +case $-:$BASH_VERSION in +*x*:[0123456789]*) : bash set -x is broken :; set +ex ;; +esac + +while : +do case $# in + 0) exit 0 ;; + esac + case $1 in + *=*) case $RANDOM in + $RANDOM)`echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; + *) export "$1" ;; + esac + shift + ;; + *) break + ;; + esac +done +"$@" +exit 0 diff --git a/src/cmd/INIT/intl.c b/src/cmd/INIT/intl.c new file mode 100644 index 0000000..1623dd6 --- /dev/null +++ b/src/cmd/INIT/intl.c @@ -0,0 +1,29 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#ifndef gettext +#include +#endif + +int +main() +{ + gettext(0); + return 0; +} diff --git a/src/cmd/INIT/ld.hp.pa b/src/cmd/INIT/ld.hp.pa new file mode 100755 index 0000000..99d39f0 --- /dev/null +++ b/src/cmd/INIT/ld.hp.pa @@ -0,0 +1,5 @@ +: hp.pa ld wrapper for reasonable warning defaults + +# @(#)ld.hp.pa (AT&T Labs Research) 1998-01-23 + +/bin/ld +s +vnocompatwarnings "$@" diff --git a/src/cmd/INIT/ldd.cygwin.i386 b/src/cmd/INIT/ldd.cygwin.i386 new file mode 100755 index 0000000..5976b1f --- /dev/null +++ b/src/cmd/INIT/ldd.cygwin.i386 @@ -0,0 +1,22 @@ +#!/bin/env sh +: cygwin.i386 ldd -- how many ways does this confirm the windows bias? +for f +do case $f in + *.exe) ;; + *) f=$f.exe ;; + esac + p=$(type $f) + case $p in + *" not found"*) + ;; + *) p=${p##* } + case $p in + ?*) f=$p ;; + esac + ;; + esac + cygcheck $(cygpath -aw $f) | + for w in $(sed -e 's/^[[:space:]]*//' -e '/^$/d' -e '/^Use /d') + do cygpath -u "$w" + done +done diff --git a/src/cmd/INIT/ldd.darwin b/src/cmd/INIT/ldd.darwin new file mode 100755 index 0000000..ec75f7b --- /dev/null +++ b/src/cmd/INIT/ldd.darwin @@ -0,0 +1,2 @@ +: mac os10 ldd +otool -L "$@" diff --git a/src/cmd/INIT/ldd.hp.pa b/src/cmd/INIT/ldd.hp.pa new file mode 100755 index 0000000..34874b4 --- /dev/null +++ b/src/cmd/INIT/ldd.hp.pa @@ -0,0 +1,21 @@ +: hp.pa ldd +while : +do case $# in + 0) break ;; + esac + case $1 in + -*|+*) ;; + *) break ;; + esac + shift +done +trap ':' 15 +for cmd +do case $# in + 1) ;; + *) echo $cmd: ;; + esac + _HP_DLDOPTS=-ldd "$cmd" < /dev/null 2> /dev/null | sort -u + # chatr "$cmd" | + # sed -e '/^[ ]*dynamic[ ][ ]*/!d' -e 's// /' +done diff --git a/src/cmd/INIT/ldd.ibm.risc b/src/cmd/INIT/ldd.ibm.risc new file mode 100755 index 0000000..984ef6d --- /dev/null +++ b/src/cmd/INIT/ldd.ibm.risc @@ -0,0 +1,16 @@ +: ibm.risc ldd +case $# in +1) header=0 ;; +*) header=1 ;; +esac +for file +do case $header in + 1) echo "$file:" + header=2 + ;; + 2) echo + echo "$file:" + ;; + esac + dump -H "$file" | sed '1,/\*\*\*Import/d' +done diff --git a/src/cmd/INIT/ldd.lynxos b/src/cmd/INIT/ldd.lynxos new file mode 100755 index 0000000..43904a8 --- /dev/null +++ b/src/cmd/INIT/ldd.lynxos @@ -0,0 +1 @@ +elflook -L "$@" | sed -e '/^NEEDED:/!d' -e 's/.*: *//' diff --git a/src/cmd/INIT/ldd.mvs.390 b/src/cmd/INIT/ldd.mvs.390 new file mode 100755 index 0000000..341c4cc --- /dev/null +++ b/src/cmd/INIT/ldd.mvs.390 @@ -0,0 +1,18 @@ +: mvs.390 ldd +case $# in +1) header=0 ;; +*) header=1 ;; +esac +for file +do case $header in + 1) echo "$file:" + header=2 + ;; + 2) echo + echo "$file:" + ;; + esac + strings $file | + sed -e '/\<[[:lower:]][[:alnum:]]*\.dll\>/!d' -e 's/^/ /' | + sort -u +done diff --git a/src/cmd/INIT/ldd.sgi b/src/cmd/INIT/ldd.sgi new file mode 100755 index 0000000..d3c5347 --- /dev/null +++ b/src/cmd/INIT/ldd.sgi @@ -0,0 +1,2 @@ +: sgi.mips ldd +odump -Dl "$@" diff --git a/src/cmd/INIT/m.c b/src/cmd/INIT/m.c new file mode 100644 index 0000000..b56b99b --- /dev/null +++ b/src/cmd/INIT/m.c @@ -0,0 +1,34 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #1 + */ + +#ifndef sin +#include +#endif + +int +main() +{ + sin(0.0); + fmod(100.234, 11.0); + return 0; +} diff --git a/src/cmd/INIT/m2.c b/src/cmd/INIT/m2.c new file mode 100644 index 0000000..cad12b1 --- /dev/null +++ b/src/cmd/INIT/m2.c @@ -0,0 +1,36 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #2 + */ + +#include + +int +main() +{ + double value = 0; + int exp = 0; + int r = 0; + + r |= ldexp(value, exp) != 0; + r |= frexp(value, &exp) != 0; + return r; +} diff --git a/src/cmd/INIT/m3.c b/src/cmd/INIT/m3.c new file mode 100644 index 0000000..5d89991 --- /dev/null +++ b/src/cmd/INIT/m3.c @@ -0,0 +1,36 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #3 + */ + +#include + +int +main() +{ + long double value = 0; + int exp = 0; + int r = 0; + + r |= ldexpl(value, exp) != 0; + r |= frexpl(value, &exp) != 0; + return r; +} diff --git a/src/cmd/INIT/m4.c b/src/cmd/INIT/m4.c new file mode 100644 index 0000000..79b87f0 --- /dev/null +++ b/src/cmd/INIT/m4.c @@ -0,0 +1,32 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #4 + */ + +#include + +int +main() +{ + double value = 0; + + return isnan(value); +} diff --git a/src/cmd/INIT/m5.c b/src/cmd/INIT/m5.c new file mode 100644 index 0000000..f853921 --- /dev/null +++ b/src/cmd/INIT/m5.c @@ -0,0 +1,32 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #5 + */ + +#include + +int +main() +{ + long double value = 0; + + return isnanl(value); +} diff --git a/src/cmd/INIT/m6.c b/src/cmd/INIT/m6.c new file mode 100644 index 0000000..4387ea0 --- /dev/null +++ b/src/cmd/INIT/m6.c @@ -0,0 +1,34 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * -lm test #6 + */ + +#define _ISOC99_SOURCE 1 + +#include + +int +main() +{ + double value = -0.0; + + return !signbit(value); +} diff --git a/src/cmd/INIT/make.probe b/src/cmd/INIT/make.probe new file mode 100644 index 0000000..8a3c383 --- /dev/null +++ b/src/cmd/INIT/make.probe @@ -0,0 +1,2242 @@ +: +### this script contains archaic constructs that work with all sh variants ### +# Glenn Fowler +# AT&T Research +# +# @(#)make.probe (AT&T Research) 2011-06-01 +# +# C probe for make +# +# NOTE: C.probe must be included or .'d here +# + +cc_dll_def=-D_BLD_DLL + +probe_ar_arflags="-Xany" +probe_arflags="-xar" +probe_ccs="strip size nm ld ar" # longest to shortest +probe_debug="-g" +probe_dll="'-G 0' -Wc,dll,exportall,longname,rent -Wc,exportall -dynamic $cc_dll_def" +probe_export_dynamic="-rdynamic -export-dynamic -Wl,-export-dynamic -Wl,-E -bexpall -force_flat_namespace" +probe_gcc_optimize="-O2" +probe_gcc_version="*[Gg][Cc][Cc]*" +probe_include_local="'-ignore-source-dir -iquote' -iquote -I-" +probe_ldlazy='-zlazyload -znolazyload -Wl,-zlazyload -Wl,-znolazyload' +probe_ldlib="LD_LIBRARY_PATH LIBPATH LPATH" +probe_ldmap="'-Wl,-M' '-Qoption ld -M' '-Wl,-m' '-m'" +probe_ldorigin="-Wl,-z,origin" +probe_ldrecord='-zrecord -zignore -Wl,-zrecord -Wl,-zignore' +probe_ldrunpath="-Wl,-R, -R -Wl,-rpath, -L" +probe_ldstrip="'-s -mr' -Wl,-s" +probe_lib="a lib" +probe_lib_append="/usr/lib/pa1.1" +probe_lib_all_undef="-all -notall -all -none -Bwhole-archive -Bno-whole-archive -whole-archive -no-whole-archive -Wl,-whole-archive -Wl,-no-whole-archive -all_load '' -Wl,-zallextract -Wl,-zdefaultextract +forceload +noforceload" +probe_lib_multiple="-Wl,-zmuldefs" +probe_libdir="shlib lib" +probe_nmflags="'' -p -B" +probe_optimize="-O" +probe_pic="-Kpic -KPIC -fpic -fPIC -pic -PIC +z +Z" +probe_no_protect="'-fno-stack-protector -fno-stack-protector-all' -GS-" +probe_readonly="-R -Krodata -xMerge -Wa,-r" +probe_shared="'' -G -b -c -shared -Wl,dll" +probe_shared_name="-Wl,-soname= -h" +probe_shared_nostart="-nostartfiles" +probe_shared_registry='"-update_registry $probe_shared_registry_file"' +probe_shared_registry_file='registry.ld' +probe_shared_registry_path="\$(LIBDIR)/$probe_shared_registry_file" +probe_strict="'-ansi -pedantic' '-ansi -strict' -strict -ansi" +probe_stripflags="'-f -s' -f -s" +probe_unresolved="'-expect_unresolved \"*\"'" +probe_warn="-Wall -fullwarn -w3 '-A -A' +w1" + +echo '#pragma pp:version' > libpp.$src +echo '#define dDflag on' > dDflag.$src +echo 'int main(){return 0;}' > doti.$src +echo 'int code(){return 0;} int main(){return code();}' > export.$src +echo '#include ' > imstd.$src +echo '#include "_i_.h"' > imusr.$src +echo 'int x;' > _i_.h +mkdir im +echo '(' > im/stdio.h +echo '#include "implc_x.h" +int main(){f(1);return 0;}' > implc.$src +echo 'template void f(T){}' > implc_x.$src +echo 'template void f(T);' > implc_x.h +echo 'extern int NotalL(){return(0);}' > notall.$src +echo '#include +extern int i; +int i = 1; +extern int f(){return(!i);} +int main(){FILE* fp=stdin;return(f());}' > pic.$src +echo 'class x {int n;} m;' > plusplus.$src +echo 'int prefix(){return 0;}' > prefix.$src +echo 'template int gt(T a, T b); +template int gt(T a, T b) { return a > b; } +int main () { return gt(2,1); }' > ptr.$src +echo 'int main(){return 0;}' > require.$src +echo '#if mips && !sgi || __CYGWIN__ +( /* some systems choke on this probe */ +#else +#if test_const +#define CONST const +#else +#define CONST +#endif +CONST char x[]={1,2,3,4,5,6,7,8,9,0}; +int main(){*(char*)x=0; return x[0];} +#endif' > readonly.$src +# NOTE: sfclose() defined on uwin, not defined on all other systems +echo 'extern int sfclose(); extern int ShareD(){return(sfclose());}' > shared.$src +echo '#define g(a,b) a ## b +volatile int a; +const int g(x,y)=1; +extern int c(int);' > stdc.$src +echo 'extern int f(); int main() { return f(); }' > sovmain.$src +echo 'int f() { return 0; }' > sovlib.$src +echo '#include +int i; +int main(){int j;j = i * 10;return j;}' > strip.$src +echo 'template void f(T){} +int main(){f(1);return 0;}' > toucho.$src +echo '#if defined(__STDC__) || defined(__cplusplus) +extern type call(int); +#endif +int main() {call(0);return(0);}' > tstlib.$src +echo 'int main(){return 0;}' > warn.$src +echo 'int f(){return 0;}' > warn1.$src +echo 'int f(){}' > warn2.$src +echo 'int f(){int i; return 0;}' > warn3.$src +echo 'int f(){int i; return i;}' > warn4.$src +echo 'int f(){return g();}' > warn5.$src +warn_enum="1 2 3 4 5" + +chmod -w *.$src + +ar_arflags= +arflags= +cc_dll= +cc_pic= +cc_PIC= +dDflag= +debug= +dialect= +dll_dir='$(LIBDIR)' +dll_libraries= +dll_variants= +doti= +exectype= +export_dynamic= +gnu= +implicitc= +include_local= +lddynamic= +ldlazy= +ldnolazy= +ldnorecord= +ldorigin= +ldrecord= +ldrunpath= +ldscript= +ldstatic= +ldstrip= +Lflag= +lib_dll= +lib_all= +lib_undef= +libpath= +libpp= +makeoptions= +nmedit= +nmflags= +no_protect= +optimize= +plusplus= +prefix_archive=lib +prefix_dynamic= +prefix_shared=lib +ptrcopy= +ptrimplicit= +ptrmkdir= +readonly= +repository= +require= +runpath= +shared= +shared_name= +shared_registry= +shellmagic= +soversion= +stdc= +strict= +stripflags= +symprefix= +toucho= +warn= + +set $probe_lib +lib=$1 + +d= +for f in $stdinclude $usrinclude +do case $f in + -I*) ;; + *) d="$d $f" ;; + esac +done +stdinclude=$d + +set x $cc +cc_dir=`echo $2 | sed -e 's,/*[^/]*$,,'` +for c in $probe_ccs +do if $executable $cc_dir/$c + then x=$cc_dir/$c + else x=$c + fi + eval $c='$x' +done +ld_dir= +rm -f doti.$obj +if $cc -c doti.$src +then eval set x $probe_verbose + shift + for o + do $cc $o doti.$obj + $cc $o doti.$obj -lF0oB@r + done 2>&1 | sed -e 's/^[+ ]*//' -e 's/[ ].*//' -e '/^\//!d' -e 's/:$//' -e '/ld[a-zA-Z0-9.]*$/!d' -e 's,///*,/,g' > t + for i in `cat t` + do rm -f t.$obj + if test -x $i && $i -r -o t.$obj doti.$obj && test -f t.$obj + then case $ld in + ld) ld=$i ;; + esac + ld_dir=`echo $i | sed 's,/[^/]*$,,'` + break + fi + done +fi +IFS=: +set x $PATH +IFS=$ifs +path=$* +m= +for c in $probe_ccs +do eval o='$'$c + case $o in + $c) ;; + *) continue ;; + esac + C='${c}' + for x in $cc_dir $ld_dir + do cd $x + for p in "${C}" "${C}[!a-zA-Z]*" "*[!a-zA-Z]${C}" "*[!a-zA-Z]${C}[!a-zA-Z]*" + do eval set x $p + case $# in + 2) if $executable $2 + then case $2 in + *$c*$c*);; + *) m=$p + break 3 + ;; + esac + fi + ;; + esac + done + done +done +cd $tmpdir +for c in $probe_ccs +do eval o='$'$c + case $o in + $c) ;; + *) continue ;; + esac + for x in $cc_dir $ld_dir + do if $executable $x/$c + then eval $c='$x/$c' + continue 2 + fi + case $m in + ?*) eval set x $x/$m + case $# in + 2) if $executable $2 + then eval $c='$2' + continue 2 + fi + ;; + esac + ;; + esac + done + for x in $path + do if $executable $x/$c + then eval $c='$x/$c' + break + fi + done +done +dld=$cc + +rm -f dynamic.$exe +if $cc -o dynamic.$exe dynamic.$obj && $executable dynamic.$exe +then mkdir mylib + echo > mylib/libc.$lib + eval set x $probe_ldlib + while : + do shift + case $# in + 0) break ;; + esac + rm -f dynamic.$exe + if eval $1=./mylib '$'cc -o dynamic.$exe dynamic.$obj + then : + else libpath=$1 + break + fi + done +fi +test `$cc -E libpp.$src | grep -c '^#pragma pp:version "libpp '` -eq 1 && libpp=1 +$cc -E doti.$src > doti.i && $cc -c doti.i && test -s doti.$obj && doti=1 +if $cc -c imusr.$src +then eval set x $probe_include_local + while : + do shift + case $# in + 0) break ;; + esac + if $cc -c $1 imusr.$src + then : "$1 should skip \"_i_.h\" in ." + elif $cc -c imstd.$src + then if $cc -c -Iim imstd.$src + then : '-Idir should find in dir' + elif $cc -c $1 -Iim imstd.$src + then : "$1 -Idir should find in dir" + elif $cc -c -Iim $1 imstd.$src + then include_local=$1 + break + else : "-Idir $1 should skip in dir" + fi + else : should find stdio.h + fi + done +else : 'should find "_i_.h" in .' +fi + +if $cc -c pic.$src 2>e +then e=`wc -l e` + s=`$size pic.$obj; wc pic.$obj` + eval set x $probe_pic + shift + while : + do case $# in + 0|1) break ;; + esac + pic=$1 + shift + PIC=$1 + shift + rm -f pic.$obj + $cc $pic -c pic.$src 2>e && test -f pic.$obj || continue + $cc $pic -o pic.$exe pic.$obj && test -f pic.$exe || { + rm -f pic.$exe + $cc -o pic.$exe pic.$obj && test -f pic.$exe && continue + } + case `wc -l e` in + $e) ;; + *) continue ;; + esac + case $pic in + ???*) m=`echo " $pic" | sed -e 's/^ [-+]//g' -e 's/./-& /g' -e 's/[-+] //g'` + rm -f pic.$obj pic1.$exe + if $cc $m -c pic.$src 2>e && test -f pic.$obj && + $cc -o pic1.$exe pic.$obj && test -f pic1.$exe + then case `wc -l e` in + $e) cc_pic=$m + break + ;; + esac + fi + cc_pic=$pic + break + ;; + *) case `$size pic.$obj; wc pic.$obj` in + $s) ;; + *) cc_pic=$pic + break + ;; + esac + ;; + esac + done + # this works around gcc 2.95 sun4 -fpic a.out core dump after exit + case $hosted:$cc_pic in + 1:?*) if ./pic.$exe + then # this catches lynxos.ppc gcc that dumps -fpic and not -mshared + echo 'static int* f() { static int v; return &v; } +int main() { f(); return 0; }' > picok.$src + $cc $cc_pic -o picok.$exe picok.$src && ./picok.$exe || cc_pic= + else cc_pic= + fi + ;; + esac + case $cc_pic in + ?*) rm -f pic.$obj + if $cc $PIC -c pic.$src 2>e && test -f pic.$obj + then cc_PIC=$PIC + else cc_PIC=$cc_pic + fi + ;; + *) eval set x $probe_dll + while : + do shift + case $# in + 0) break ;; + esac + rm -f pic.$obj pic.$exe + $cc $1 -c pic.$src 2>e && test -f pic.$obj || continue + $cc $1 -o pic.$exe pic.$obj && test -f pic.$exe || { + rm -f pic.$exe + $cc -o pic.$exe pic.$obj && test -f pic.$exe && continue + } + case $1 in + -Wc,*exportall*) + # get specific since sgi gets this far too + rm -f pic.$exe pic.x + $cc -Wl,dll -o pic.$exe pic.$obj || continue + test -f pic.$exe || continue + test -f pic.x || continue + cc_dll="-D_SHARE_EXT_VARS $1" + so=.x + sd=.dll + dld=$cc + shared=-Wl,dll + prefix_shared= + probe_sd= + probe_shared= + #unused# lddynamic=-Bdynamic + #unused# ldstatic=-Bstatic + lib_dll=SYMBOL + break + ;; + esac + case `wc -l e` in + $e) cc_dll=$1 + break + ;; + esac + done + ;; + esac +fi + +$cc -c plusplus.$src && plusplus=1 +$cc -E -dD dDflag.$src > t +case `grep '#define[ ][ ]*dDflag[ ][ ]*on' t` in +?*) dDflag=1 ;; +esac +case `grep '#define.*_GNUC_' t` in +?*) gnu=1 ;; +esac +case $plusplus in +"") $cc -c stdc.$src && stdc=1 ;; +*) mkdir ptr + cd ptr + $cc -c ../ptr.$src & + NFS_locks_are_botched=$! + cd .. + if $cc -c require.$src && $cc require.$obj + then set x `$cc require.$obj 2>&1` + d= + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + -l*) d="$d $1" ;; + esac + done + for f in ++ + do if $cc require.$obj -l$f + then set x `$cc require.$obj -l$f 2>&1` + r= + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + -l*) case " $d $r " in + *" "$1" "*) ;; + *) r="$r $1" ;; + esac + esac + done + case $r in + ?*) require="$require $f" + echo '' $r > req.$f + ;; + esac + fi + done + fi + cd ptr + for i in * + do if test -d $i + then repository=$i + break + fi + done + cd .. + kill -9 $NFS_locks_are_botched + rm -rf ptr + case $repository in + *?) mkdir ptr + cd ptr + i=PTR + case $repository in + $i) i=$i$i ;; + esac + $cc -ptr$i -c ../ptr.$src & + NFS_locks_are_botched=$! + cd .. + sleep 5 + if test -d ptr/$i/$repository + then ptrimplicit=1 + fi + kill -9 $NFS_locks_are_botched + rm -rf ptr + ;; + esac + $cc -o implc implc.$src && $executable implc && implicitc=1 + if $cc -c toucho.$src && test -f toucho.$obj + then o=`ls -l toucho.$obj` + if $cc -o toucho toucho.$obj && $executable toucho + then n=`ls -l touch.$obj` + case $n in + "$o") ;; + *) toucho=1 ;; + esac + fi + fi + ;; +esac + +if $cc -c pic.$src +then eval set x $probe_nmflags + while : + do shift + case $# in + 0) break ;; + esac + case `$nm $1 pic.$obj | grep -c '[0123456789][ ][ ]*T[ ][ ]*[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]'` in + 0) ;; + *) nmflags=$1 + break + ;; + esac + done + case $# in + 0) case `$nm -gh pic.$obj | grep -c '|\.*[TtDdBbC][EeAaSsOo][XxTtSsMm]'` in + 0) ;; + *) nmflags=-gh + nmedit="-e '/\.*[TtDdBbC][EeAaSsOo][XxTtSsMm]/!d' -e 's/[| ].*//'" + ;; + esac + ;; + *) nmedit="-e '/[ ]T[ ][ ]*[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]/!d' -e 's/.*[ ]T[ ][ ]*//'" + ;; + esac +fi + +if $cc -c doti.$src +then eval set x $probe_stripflags + while : + do shift + case $# in + 0) break ;; + esac + if $strip $1 doti.$obj + then stripflags=$1 + break + fi + done +fi + +rm -f export.$obj export.exe +if $cc -c export.$src +then lm= + if $cc -o export.exe export.$obj -lm 2>e && lm=-lm || + $cc -o export.exe export.$obj 2>e + then z=`wc -c < export.exe; $size export.exe 2>/dev/null` + eval set x $probe_export_dynamic + while : + do shift + case $# in + 0) break ;; + esac + rm -f export.exe + if $cc -o export.exe $1 export.$obj $lm 2>f && $executable export.exe + then y=`wc -c < export.exe; $size export.exe 2>/dev/null` + case $y in + $z) ;; + *) if cmp -s e f + then export_dynamic=$1 + break + fi + ;; + esac + fi + done + fi +fi +rm -f export.$obj export.exe + +rm -f strip.exe +if $cc -o strip.exe strip.$src +then z=`wc -c < strip.exe` + eval set x $probe_ldstrip + while : + do shift + case $# in + 0) break ;; + esac + rm -f strip.exe + if $cc -o strip.exe $1 strip.$src + then case `wc -c < strip.exe` in + $z) ;; + *) ldstrip=$1 + break + ;; + esac + fi + done +fi + +rm -f strip.exe strip.$obj +if $cc -c strip.$src && $cc -o strip.exe strip.$obj 2>e +then eval set x x $probe_ldlazy + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f strip.$exe + $cc -o strip.$exe $1 strip.$obj $2 2>f && test -f strip.$exe || continue + cmp -s e f || continue + ldlazy=$1 + ldnolazy=$2 + break + done + eval set x x $probe_ldrecord + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f strip.$exe + $cc -o strip.$exe $1 strip.$obj $2 2>f && test -f strip.$exe || continue + cmp -s e f || continue + ldrecord=$1 + ldnorecord=$2 + break + done +fi + +case $cc_dll:$cc_pic:$so:$dynamic:$static in +::::|$cc_dll_def::::) + : last chance dynamic checks + while : + do + echo '__declspec(dllexport) int fun() { return 0; }' > exp.$src + if $cc -c $cc_dll_def exp.$src + then rm -f xxx.dll xxx.lib + if $cc -shared -Wl,--enable-auto-image-base -Wl,--out-implib=xxx.lib -o xxx.dll exp.$obj && + test -f xxx.lib -a -f xxx.dll + then + : cygwin + cc_dll=$cc_dll_def + dll_dir='$(BINDIR)' + sd=.dll + so=.dll.a + ldscript=".def .exp .ign .res" + lib_dll=option + lib_all=-Wl,-whole-archive + lib_undef=-Wl,-no-whole-archive + dld=$cc + shared='-shared -Wl,--enable-auto-image-base -Wl,--out-implib=$(<:N=*'$so')' + prefix_dynamic=cyg + prefix_shared=lib + break + fi + fi + break + done + ;; +*) if $cc -c $cc_dll $cc_pic shared.$src && $cc -c $cc_dll $cc_pic notall.$src + then for xx in "$cc" "$ld" + do eval set x $probe_shared + while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + # UNDENT ... + + if $xx $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll + then if test -s e && egrep -i 'unknown|invalid|option' e > /dev/null + then continue + fi + case `PATH=/bin:/usr/bin:$PATH file xxx$dll` in + *lib*|*obj*|*shared*) + ;; + "") $executable xxx$dll || continue + ;; + *ELF*|*elf*) + $executable xxx$dll || continue + case `strings xxx$dll | sed -e 's,.*[ |],,' | sort -u | egrep -i '^([._](dynamic|dynstr|dynsym))$'` in + [012]) continue ;; + esac + ;; + *archive*not*stripped*|*data*dynamic*not*stripped*) + $executable xxx$dll || continue + ;; + *) continue + ;; + esac + dld=$xx + shared=$1 + # does -nostartfiles make sense for C? + case $plusplus in + '') z=`wc -c < xxx$dll` + eval set x $probe_shared_nostart + while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + if $dld $shared $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll + then case `wc -c < xxx$dll` in + $z) ;; + *) if test -s e + then case `cat e` in + *[Ee][Rr][Rr][Oo][Rr]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*) + continue + ;; + esac + fi + case $shared in + '') shared=$1 ;; + *) shared="$shared $1" ;; + esac + break + ;; + esac + fi + done + ;; + esac + case $cc_dll in + "") cc_dll=$cc_dll_def ;; + esac + eval set x x $probe_sd + while : + do shift + shift + case $# in + [01]) break ;; + esac + rm -f xxx xxx$1 xxx$2 + if $dld $shared -o xxx shared.$obj 2>e + then if test -f xxx$1 -a \( -f xxx$2 -o "$cc_dll" = "$cc_dll_def" \) + then sd=$1 + so=$2 + lddynamic=-Bdynamic + ldstatic=-Bstatic + break 2 + elif test -f xxx -a -f xxx$2 + then sd=$1 + so=$2 + break 2 + else case $so in + '') so=$1 ;; + esac + break + fi + fi + done + rm -f libxxx.$lib + $ar cr libxxx.$lib shared.$obj + ranlib libxxx.$lib + eval set x x $probe_lib_all_undef + rm -f xxx$dll + if $dld $shared -o xxx$dll libxxx.$lib && test -r xxx$dll + then if $nm $nmflags xxx$dll | grep ShareD + then lib_dll=OPTION + set x x + fi + fi + while : + do shift + shift + case $# in + 0|1) break ;; + esac + rm -f xxx$dll + if $dld $shared -o xxx$dll $1 libxxx.$lib $2 && test -r xxx$dll + then if $nm $nmflags xxx$dll | grep ShareD + then lib_dll=option + lib_all=$1 + lib_undef=$2 + break + fi + fi + case $2 in + ?*) if $dld $shared -o xxx$dll $1 libxxx.$lib && test -r xxx$dll + then if $nm $nmflags xxx$dll | grep ShareD + then lib_dll=option + lib_all=$1 + break + fi + fi + ;; + esac + done + case $lib_dll in + OPTION) lib_dll=option + ;; + option) case $lib_undef in + "") rm -f libyyy.$lib + $ar cr libyyy.$lib notall.$obj + ranlib libyyy.$lib + $cc -c prefix.$src + eval set x x $probe_lib_all_undef + while : + do shift + shift + case $# in + 0|1) break ;; + esac + rm -f xxx$dll + if $dld $shared -o xxx$dll prefix.$obj $lib_all libxxx.$lib $2 libyyy.$lib && test -r xxx$dll + then rm -f t + $nm $nmflags xxx$dll > t + case `grep -c ShareD t`:`grep -c NotalL t` in + 0:*) ;; + *:0) lib_undef=$2 + break + ;; + esac + fi + done + ;; + esac + case $lib_undef in + "") eval set x $probe_lib_multiple + rm -f libyyy.$lib + cp libxxx.$lib libyyy.$lib + rm -f xxx$dll + if $dld $shared -o xxx$dll prefix.$obj $lib_all libxxx.$lib libyyy.$lib && test -r xxx$dll + then : + else while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + if $dld $shared -o xxx$dll prefix.$obj $lib_all $1 libxxx.$lib libyyy.$lib && test -r xxx$dll + then rm -f t + $nm $nmflags xxx$dll > t + case `grep -c ShareD t` in + 0) ;; + *) lib_all="$lib_all $1" + break + ;; + esac + fi + done + fi + lib_dll=symbol + ;; + esac + ;; + *) lib_dll=symbol + ;; + esac + case `cat e` in + ?*) eval set x $probe_unresolved + while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + if eval '$dld $shared' $1 '-o xxx$dll shared.$obj 2>e && test -r xxx$dll' + then case `cat e` in + "") shared="$shared $1"; break ;; + esac + fi + done + ;; + esac + r= + eval set x $probe_shared_registry + while : + do shift + r=x$r + case $# in + 0) break ;; + esac + rm -f xxx$dll + if eval \$dld \$shared -o xxx\$dll $1 shared.\$obj && + test -r xxx$dll -a -r $probe_shared_registry_file + then probe_shared_registry_file='$(CC.SHARED.REGISTRY.PATH)' + eval set x $probe_shared_registry + i= + while : + do shift + i=x$i + case $i in + $r) break ;; + esac + done + shared_registry=$1 + fi + done + break 2 + fi + + # ... INDENT + done + done + fi + case $so in + ?*) rm -f xxx* + if $dld $shared -g -o xxx shared.$obj 2>e + then set x $probe_sdb + while : + do shift + case $1 in + 0) break ;; + esac + if test -f xxx$1 + then sdb=$1 + break + fi + done + fi + if $cc -c require.$src + then p=' +/usr/proberun/lib:/local/runprobe/lib +' + eval set x $probe_ldrunpath + while : + do shift + case $# in + 0) break ;; + esac + rm -f require.exe + if $cc -o require.exe $1"$p" require.$obj && + grep -c /proberun/ require.exe >/dev/null && + grep -c /runprobe/ require.exe > /dev/null + then ldrunpath=$1 + eval set x $probe_ldorigin + while : + do shift + case $# in + 0) break ;; + esac + rm -f origin.exe + if $cc -o origin.exe $1 $ldrunpath'$ORIGIN' require.$obj + then if ./origin.exe > /dev/null 2>&1 + then ldorigin="$1 $ldrunpath"'\$ORIGIN/$(BINDIR:P=R=$(DLLDIR))' + fi + break + fi + done + break + fi + done + fi + rm -f libxxx$so + if $cc -c sovmain.$src && + $cc -c $cc_dll $cc_pic sovlib.c && + $dld $shared -o libxxx$so sovlib.$obj && + $cc -o sovmain.$exe -L. sovmain.$obj -lxxx + then rm -f sovmain.$exe + mv libxxx$so libxxx$so.5.6 + if $cc -o sovmain.$exe -L. sovmain.$obj -lxxx + then soversion=1 + fi + fi + rm -f doti.$obj + std64=/lib64 + lcl64=/usr/local/lib64 + if test -d $std64 -a -d $lcl64 && $cc -c doti.$src + then for i in `cd $lcl64; ls *$so 2>/dev/null | sed 's/lib\([^.]*\).*/\1/'` + do if $cc -o runpath.$exe doti.$obj -l$i >/dev/null 2>&1 + then LD_LIBRARY_PATH= ./runpath.$exe >/dev/null 2>&1 && continue + if LD_LIBRARY_PATH=$lcl64 ./runpath.$exe >/dev/null 2>&1 + then runpath=$lcl64 + break + elif LD_LIBRARY_PATH=$std64 ./runpath.$exe >/dev/null 2>&1 + then runpath=$std64 + break + elif LD_LIBRARY_PATH=$lcl64:$std64 ./runpath.$exe >/dev/null 2>&1 + then runpath=$lcl64:$std64 + break + fi + fi + done + fi + ;; + esac + ;; +esac + +rm -f shared.$obj +if $cc -c shared.$src +then eval set x $probe_ar_arflags + while : + do shift + case $# in + 0) break ;; + esac + rm -f libxxx.$lib + if $ar $1 r libxxx.$lib shared.$obj && $ar $1 t libxxx.$lib 2>&1 | grep shared.$obj >/dev/null + then ar_arflags=$1 + break + fi + done + eval set x $probe_arflags + while : + do shift + case $# in + 0) break ;; + esac + rm -f libxxx.$lib + if $cc $1 -o libxxx.$lib shared.$obj && $ar t libxxx.$lib 2>&1 | grep shared.$obj >/dev/null + then arflags=$1 + break + fi + done +fi + +case $shared in +-G) case $cc_dll in + "") cc_dll=$cc_dll_def ;; + esac + ;; +*) case $lib_dll in + symbol) echo 'extern int f(); + int main() { f(); return 0; }' > main.$src + echo '#include + int f() { printf("hello world"); return 0; }' > member.$src + if $cc -c main.$src && $cc -c member.$src + then echo f > lib.exp + rm -f lib.$obj main.exe + if $ld -o lib.$obj -L: -bexport:lib.exp -berok -bmodtype:SRE -T512 -H512 -lm -lc member.$obj && $cc -o main.exe main.$obj lib.$obj + then dld=$ld + shared='-T512 -H512 -L$(LIBDIR): -berok -bmodtype:SRE' + lib_dll=export + dll_libraries='-lm -lc' + ldscript=.exp + case $cc_dll in + "") cc_dll=$cc_dll_def ;; + esac + case $so in + "") so=.$obj ;; + esac + fi + fi + ;; + esac + ;; +esac +case $shared in +?*) if $cc -c $cc_dll $cc_pic shared.$src + then eval set x $probe_shared_name + while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + if $dld $shared ${1}libfoo.1.2 -o xxx$dll shared.$obj 2>e && test -r xxx$dll + then shared_name=$1 + break + fi + done + fi + ;; +esac +case " $cc_dll " in +*" $cc_dll_def "*) + ;; +" ") ;; +*) cc_dll="$cc_dll_def $cc_dll" + ;; +esac + +case $hosttype in +win32.*|cygwin.*|os2.*) + Lflag=1 + ;; +*) if $cc -c doti.$src + then if $cc -L. doti.$obj -lc >/dev/null + then case $cc_dll in + '') ;; + *) Lflag=1 ;; + esac + fi + fi + ;; +esac + +case $lib_dll in +option) case $hosttype in + linux.*) dll_libraries=-lc ;; + esac + ;; +SYMBOL) lib_dll=symbol + ;; +symbol) echo "#include +extern int fun() +{ + puts(\"fun\"); + return 0; +}" > dllib.$src + echo "extern int fun(); +int +main() +{ + return fun(); +}" > dlmain.$src + pwd=`pwd` + while : + do + if $cc -c $cc_dll $cc_pic dlmain.$src && + $cc -c $cc_dll $cc_pic dllib.$src + then rm -f libxxx$so + if $dld $shared -o libxxx$so dllib.$obj && + chmod 555 libxxx$so + then rm -f dlmain.$exe + if $cc -o dlmain.$exe dlmain.$obj $pwd/libxxx$so && + (./dlmain.$exe) >/dev/null 2>&1 + then break + fi + fi + rm -f libxxx$so dlmain.$exe + if $dld $shared -o libxxx$so dllib.$obj -lm -lc && + chmod 555 libxxx$so && + $cc -o dlmain.$exe dlmain.$obj $pwd/libxxx$so && + (./dlmain.$exe) >/dev/null 2>&1 + then dll_libraries='-lm -lc' + fi + fi + break + done + # the dll_libraries probe is still lame + case $dll_libraries in + '') case $hosttype in + sco.*|sol*.*|sun*) ;; + *) dll_libraries='-lm -lc' ;; + esac + ;; + esac + ;; +esac + +stdlib= +a=`$cc -print-multi-directory 2>/dev/null` +case $a in +.) ;; +*) for d in `$cc -print-search-dirs 2>/dev/null | sed -e '/^libraries:/!d' -e 's/.*=//' | tr : '\n' | grep /lib/` + do if [ -d ${d}${a} ] + then stdlib="$stdlib ${d}${a}" + else case $d in + */lib/) d=`echo '' $d | sed -e 's,/$,,'` + if [ -d ${d}${a} ] + then stdlib="$stdlib ${d}${a}" + fi + ;; + esac + fi + done + ;; +esac +case $stdlib in +'') stdlib=`$cc -v doti.$src 2>&1 | + sed 's/ */\n/g' | + sed -e '/^-L/!d' -e 's/^-L//' | + while read dir + do if test -d "$dir" + then (cd "$dir"; pwd) + fi + done` + ;; +*) eval set x $probe_verbose + shift + for o in "$@" + do stdlib="$stdlib "`$cc $o doti.$src 2>&1 | + sed 's/ */\n/g' | + sed -e '/^-L/!d' -e '/\/lib64$/!d' -e 's/^-L//'` + done + ;; +esac +case $stdlib in +?*) keepstdlib=1 + o=$stdlib + stdlib= + for dir in $o + do case " $stdlib " in + *" $o "*) continue ;; + esac + case $dir in + /usr/lib64) + i=/usr/local/lib64 + a=/lib64 + ;; + /lib64) i=/usr/local/lib64 + a=/usr/lib64 + ;; + /usr/lib) + i=/usr/local/lib + a=/lib + ;; + lib) i=/usr/local/lib + a=/usr/lib + ;; + *) i= + a= + ;; + esac + if test "" != "$i" -a -d "$i" + then case " $o " in + *" $i "*) + ;; + *) stdlib="$stdlib $i" + ;; + esac + fi + stdlib="$stdlib $dir" + if test "" != "$a" -a -d "$a" + then case " $o " in + *" $a "*) + ;; + *) stdlib="$stdlib $a" + ;; + esac + fi + done + case $hosted in + 1) case " $stdlib " in + *" /usr/lib "*) + ;; + *) case " $stdlib " in + *" /usr/local/lib "*) + ;; + *) stdlib="$stdlib /usr/local/lib" + ;; + esac + stdlib="$stdlib /usr/lib" + ;; + esac + case " $stdlib " in + *" /lib "*) + ;; + *) stdlib="$stdlib /lib" + ;; + esac + esac + ;; +*) keepstdlib=0 + case $dir in + */arch/$hosttype/lib/*) + notlib=`echo $dir | sed "s,/arch/$hosttype/lib/.*,/arch/$hosttype/lib,"` + ;; + *) notlib=//// + ;; + esac + tstlib= + implib= + if $cc -c hosted.$src + then for f in `( + eval set x $probe_verbose + while : + do shift + case $# in + 0) break ;; + esac + $cc $1 hosted.$obj + done + ) 2>&1 | sed -e 's/[ :]/\\ + /g' -e 's/-L//g' -e 's/^P,//' -e "s/[\"']//g" -e 's,^[\\\\/]*[\\\\/],/,' | sed -e '/^\$/d' -e '/^[-+]/d' -e '/^[^\\\\\\/]/d' -e '/[\\\\\\/]tmp[\\\\\\/]/d' -e 's/:\$//' -e 's,//*$,,'` + do case " $tstlib $implib " in + *" $f "*) continue ;; + esac + case $f in + $notlib) continue ;; + esac + if test -d $f + then tstlib="$tstlib $f" + elif test -f $f + then d=`echo $f | sed -e 's,[\\\\/]*[^\\\\/]*\$,,'` + case " $tstlib $implib " in + *" $d "*) continue ;; + esac + case $d in + *[\\/]usr[\\/]lib) + x=$d + d="`echo $d | sed -e 's,[\\\\/][\\\\/]*usr[\\\\/]lib\$,/lib,'`" + case " $tstlib $implib " in + *" $d "*) ;; + *) implib="$implib $d" ;; + esac + implib="$implib $x" + ;; + *[\\/]lib) + implib="$implib $d" + d="`echo $d | sed -e 's,[\\\\/][\\\\/]*lib\$,/usr/lib,'`" + case " $tstlib $implib " in + *" $d "*) ;; + *) implib="$implib $d" ;; + esac + ;; + *) implib="$implib $d" + ;; + esac + fi + done + fi + tstlib="$tstlib $implib" + if $cc -Dtype=void -Dcall=exit -c tstlib.$src && mv tstlib.$obj tst.$obj + then case $plusplus in + '') probe_lxx= ;; + esac + l= + for sym in $probe_l $probe_lxx + do case $l in + "") l=$sym; continue ;; + esac + rm -f tstlib.$exe + if $cc -o tstlib.$exe tst.$obj -l$l + then eval set x $probe_ldmap + while : + do shift + case $# in + 0) break ;; + esac + d=`$cc -Dtype=int -Dcall=$sym $static $1 tstlib.$src -l$l 2>&1 | sed -e '/[\\\\\\/].*[\\\\\\/]lib[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+]*\.[^\\\\\\/]*\$/!d' -e 's,^[^\\\\\/]*,,' -e 's,[\\\\\\/]lib[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+]*\.[^\\\\\\/]*\$,,' -e '/^[\\\\\\/]/!d' | sort -u` + case $d in + ?*) tstlib="$tstlib $d" ;; + esac + done + fi + l= + done + fi + libstd= + libset= + stdlibroot="/ /usr/" + for d in $tstlib + do case $d in + [\\/]lib|[\\/]usr[\\/]lib) + ;; + *) case " $stdlib " in + *\ $d\ *) + ;; + *) if ls $d ${PREROOT+$PREROOT/../$d} > tmp.tmp && test -s tmp.tmp + then for i in $probe_lib $obj + do if grep -i "\\.$i\$" tmp.tmp >/dev/null + then case " $probe_lib_append " in + *\ $d\ *) + libstd="$libstd $d" + ;; + *) stdlib="$stdlib $d" + case $d in + /usr/lib|/usr/lib/*) + ;; + /usr/lib?*) + e=`echo $d | sed -e 's,/usr,,'` + g=`echo $d/libc.* $e/libc.*` + case "$e $g " in + *".* "*);; + *) stdlib="$stdlib $e" + stdlibroot= + ;; + esac + ;; + esac + ;; + esac + case $libset in + "") case $i in + $obj) ;; + *) libset=1 + lib=$i + ;; + esac + ;; + esac + break + fi + done + fi + ;; + esac + ;; + esac + done + for d in `$ld --verbose 2>&1 | sed -e '/SEARCH_DIR/!d' -e 's/[ ][ ][ ]*/ /g' -e 's/SEARCH_DIR(\([^ ]*\));/\1/g' -e 's, //[^ ]*,,' -e 's,",,g'` + do if test -d $d + then case " $stdlib $libstd " in + *\ ${d}\ *) + ;; + *) libstd="$libstd $d" + ;; + esac + fi + done + case $hosted in + "") tstlib= ;; + *) tstlib="$stdlibroot /usr/ccs/ /usr/local/" ;; + esac + case $stdlibroot in + ?*) d= + for f in $stdinclude + do f=`echo $f | sed -e 's,[^\\\\/]*\$,,'` + d="$d $f" + done + tstlib="$d $tstlib" + ;; + esac + $cc -c doti.$src > all.tmp + for f in $probe_libdir + do for d in $stdlib $libstd $tstlib + do if test -d ${d}${f} + then ls ${d}${f} ${PREROOT:+$PREROOT/../${d}${f}} | + while read i + do for j in ${d}${f}/${i} ${PREROOT:+$PREROOT/../${d}${f}/${i}} + do if test -f $j -a -r $j -a -s $j + then echo $i + break + fi + done + done > tmp.tmp + if test -s tmp.tmp + then if egrep -i "^${prefix_archive}[abcdefghijklmnopqrstuvwxyz0123456789_][abcdefghijklmnopqrstuvwxyz0123456789_]*\\.$lib\$" tmp.tmp >lib.tmp || + egrep -i "\\.$obj\$" tmp.tmp >/dev/null || + egrep -i "^${prefix_shared}[abcdefghijklmnopqrstuvwxyz0123456789_][abcdefghijklmnopqrstuvwxyz0123456789_]*\\$so(.[0-9]+)*\$" tmp.tmp >>lib.tmp + then if test -s lib.tmp + then sed -e "s,.*/,," -e 's,^'${prefix_archive}'\(.*\)\.'$lib'$,\1,g' -e 's,^'${prefix_shared}'\(.*\)\'$so'[.0-9]*,\1,g' lib.tmp | sort -u > tmp.tmp + xs=`sort all.tmp all.tmp tmp.tmp | uniq -u` + case $xs in + '') continue ;; + esac + ok=0 + for x in $xs + do case $x in + *_p) continue ;; # linux gcc known to hang for -lc_p + esac + if $cc -o doti.$exe doti.$obj -l$x 2>e + then ok=1 + else if test -s e && egrep -i ":.*[ ](find|found|locate|search|-l$x)[ ]" e > /dev/null + then if egrep -i ":.*[ ](access|permission)[ ]" e + then : maybe + else ok=0 + break + fi + fi + case $Lflag in + 1) if $cc -L${d}${f} -o doti.$exe doti.$obj -l$x + then ok=0 + break + fi + ;; + esac + fi + done + case $ok in + 0) continue ;; + esac + sort -u all.tmp tmp.tmp > lib.tmp + mv lib.tmp all.tmp + fi + case " $stdlib $libstd " in + *" ${d}${f} "*) + ;; + *) if test -d ${d}${f}/fsoft + then stdlib="$stdlib ${d}${f}/"'$(FLOAT_OPTION)' + fi + stdlib="$stdlib ${d}${f}" + ;; + esac + fi + fi + fi + done + done + stdlib="$stdlib $libstd" + case $stdlib in + */shlib*) + dy= + st= + for i in $stdlib $libstd + do case $i in + */shlib) dy="$dy $i" ;; + *) st="$st $i" ;; + esac + done + for i in /var + do if test -d $i/shlib + then dy="$dy $i/shlib" + fi + done + stdlib="$dy $st" + ;; + esac + ;; +esac + +if $cc -c prefix.$src +then eval set x $probe_symprefix + while : + do shift + case $# in + 0) break ;; + esac + if $nm $nmflags prefix.$obj | grep -c ${1}prefix >/dev/null + then symprefix=$1 + break + fi + done +fi + +if $cc -c warn.$src 2>e && test -f warn.$obj +then e=`wc -c < e` + + eval set x $probe_debug + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj + $cc $1 -c warn.$src 2>e && test -f warn.$obj || continue + case `wc -c < e` in + $e) debug=$1; break ;; + esac + done + + eval set x $probe_no_protect + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj + $cc $1 -c warn.$src 2>e && test -f warn.$obj || continue + case `wc -c < e` in + $e) no_protect=$1; break ;; + esac + done + + case $version_string in + $probe_gcc_version) probe_optimize="$probe_gcc_optimize $probe_optimize" ;; + esac + eval set x $probe_optimize + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj + $cc $1 -c warn.$src 2>e && test -f warn.$obj || continue + case `wc -c < e` in + $e) optimize=$1; break ;; + esac + done + + eval set x $probe_strict + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj + $cc $1 -c warn.$src 2>e && test -f warn.$obj || continue + n=`wc -c < e` + if test $n -ge $e + then strict=$1 + break + fi + done + + $cc -c warn1.$src 2>e + o=`wc -c < e` + eval set x $probe_warn + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj warn.$exe + $cc -o warn.$exe $1 warn.$src 2>e && test -f warn.$exe || continue + n=`wc -c < e` + for i in $warn_enum + do rm -f warn$i.$obj + $cc -c $1 warn$i.$src 2>e && test -f warn$i.$obj || continue + n=`wc -c < e` + if test $n -gt $o + then warn=$1 + break 2 + fi + done + done + +fi + +while : +do case $hosted in + 1) rm -f readonly.$exe + eval set x '""' $probe_readonly + while : + do shift + case $# in + 0) break ;; + esac + for co in '' -Dtest_const + do rm -f readonly.$exe + if $cc -o readonly.$exe $co $1 readonly.$src && $executable readonly.$exe + then if ./readonly.$exe >/dev/null 2>&1 + then : + else readonly=$1 + break 3 + fi + fi + done + done + rm -f readonly.$exe readonly.s + if $cc -S readonly.$src && test -f readonly.s + then if sed -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)data/\1text/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)zero[ ][ ]*/\1set .,.+/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*1/\1byte 0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*2/\1byte 0,0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*3/\1byte 0,0,0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*4/\1byte 0,0,0,0/' \ + readonly.s > ro.s && $cc -o readonly.$exe ro.s && $executable readonly.$exe + then if ./readonly.$exe >/dev/null 2>&1 + then : + else readonly='-S.data' + break + fi + fi + rm -f readonly.$exe + if sed -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)idat/\1code/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)zero[ ][ ]*/\1set .,.+/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*1/\1byte 0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*2/\1byte 0,0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*3/\1byte 0,0,0/' \ + -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)space[ ][ ]*4/\1byte 0,0,0,0/' \ + readonly.s > ro.s && $cc -o readonly.$exe ro.s && $executable readonly.$exe + then if ./readonly.$exe >/dev/null 2>&1 + then : + else readonly='-S.idat' + break + fi + fi + if sed -e 's/^\([ ]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ ]*\.*\)data/\1rdata/' \ + readonly.s > ro.s && $cc -o readonly.$exe ro.s && $executable readonly.$exe + then if ./readonly.$exe >/dev/null 2>&1 + then : + else readonly='-S.rdata' + break + fi + fi + fi + ;; + esac + break +done + +case $stdc in +?*) dialect="$dialect ANSI" ;; +esac +case $plusplus in +?*) dialect="$dialect C++" ;; +esac +case $hosted in +"") dialect="$dialect CROSS" ;; +esac +case $doti in +?*) dialect="$dialect DOTI" ;; +esac +case $gnu in +?*) dialect="$dialect GNU" ;; +esac +case $so:$dynamic:$static in +::) ;; +*) dialect="$dialect DYNAMIC" + case $soversion in + ?*) dialect="$dialect VERSION" ;; + esac + ;; +esac +case $implicitc in +?*) dialect="$dialect IMPLICITC" ;; +esac +case $ptrcopy in +?*) dialect="$dialect PTRCOPY" ;; +esac +case $ptrimplicit in +?*) dialect="$dialect PTRIMPLICIT" ;; +esac +case $ptrmkdir in +?*) dialect="$dialect PTRMKDIR" ;; +esac +case $libpp in +?*) dialect="$dialect LIBPP" ;; +esac +case $toucho in +?*) dialect="$dialect TOUCHO" ;; +esac +case $dDflag in +?*) dialect="$dialect -dD" ;; +esac +# 2005-05-25 use $(CC.INCLUDE.LOCAL) instead +case $include_local in +?*) dialect="$dialect -I-" ;; +esac +case $Lflag in +?*) dialect="$dialect -L" ;; +esac + +ppcmd='$(CPP)' +ppdir='$(CPP:D)' +eval ppopt='"'$ppopt'"' +eval ppenv='"'$ppenv'"' + +set x "" .$exe +shift +exe= +for i +do rm -f require$i +done +if $cc -o require require.$src +then for i + do if $executable require$i + then exe=$i + break + fi + done +fi +case $sa:$sd:$so in +::?*) eval set x $probe_sa + while : + do shift + case $# in + 0) break ;; + esac + for i in $stdlib + do eval j="'" $i/lib*$1 "'" + case $j in + " $i/lib*$1 ") + eval j="'" $i/lib*$1.[0123456789]* "'" + case $j in + " $i/lib*$1.[0123456789]* ") + continue + ;; + esac + ;; + esac + sa=$1 + lddynamic=-Bdynamic + ldstatic=-Bstatic + break 2 + done + done + ;; +esac +case $ldscript in +"") case $so in + .lib) ldscript=".def .exp" ;; + *) ldscript=".ld" ;; + esac + ;; +esac +case $hosttype in +'') hosttype=unknown ;; +sgi.mips3) dll_variants='sgi.mips2:o32:-mips2 sgi.mips4:64:-mips4' ;; +sgi.mips4) dll_variants='sgi.mips2:o32:-mips2 sgi.mips3:n32:-mips3' ;; +esac + +case $hosted in +"") ccnative=`echo $cc | sed -e 's,.*/,,'` + ccs=$ccnative + for c in cc gcc + do case " $ccs " in + *" $c "*) ;; + *) ccs="$ccs $c" ;; + esac + done + for p in $path + do for c in $ccs + do if $executable $p/$c + then rm -f native.$exe + if $p/$c -o native.$exe doti.$src && ./native.$exe + then ccnative=$p/$c + exectype=`package CC="$ccnative" || $SHELL -c "package CC='$ccnative'"` + case $exectype in + *[Uu][Ss][Aa][Gg][Ee]:*) + exectype=`PATH=$_probe_PATH; export PATH; package CC="$ccnative" || $SHELL -c "package CC='$ccnative'"` + ;; + esac + break 2 + fi + fi + done + done + ;; +*) ccnative=$cc + exectype=$hosttype + ;; +esac + +# runtime shared lib exported symbol resolution + +case $cc_dll:$shared in +:|:*|*:);; +*) cat > cmd.c <<'!' +#include +#include +typedef int (*Lib_f)(int**, int**, int**); +int gbl_def = 1; +int gbl_ref = 1; +int gbl_ext; +int main(int argc, char** argv) +{ + void* dll; + Lib_f lib; + int* def; + int* ref; + int* ext; + + if (!(dll = dlopen(*++argv, RTLD_LAZY))) + fprintf(stderr, "library not found\n"); + else if (!((lib = (Lib_f)dlsym(dll, "lib"))) && !(lib = (Lib_f)dlsym(dll, "_lib"))) + fprintf(stderr, "symbol not found\n"); + else if ((*lib)(&def, &ref, &ext)) + fprintf(stderr, "function failed\n"); + else if (def == &gbl_def && ref == &gbl_ref && ext == &gbl_ext) + printf("ALL\n"); + else if (ref == &gbl_ref && ext == &gbl_ext) + printf("REF\n"); + else if (ext == &gbl_ext) + printf("EXT\n"); + return 0; +} +! + cat > lib.c <<'!' +int gbl_def = 1; +int gbl_ref; +int gbl_ext; +int lib(int** def, int** ref, int** ext) +{ + *def = &gbl_def; + *ref = &gbl_ref; + *ext = &gbl_ext; + return 0; +} +! + if $cc -c $cc_dll $cc_pic cmd.c && + $cc -c $cc_dll $cc_pic lib.c && { + $cc $cc_dll $export_dynamic -o cmd.exe cmd.o || + $cc $cc_dll $export_dynamic -o cmd.exe cmd.o -ldl + } && + $dld $shared -o libgbl.dll lib.o + then x=`./cmd.exe ./libgbl.dll` + case $x in + ?*) dialect="$dialect EXPORT=$x" ;; + esac + else case $sd:$hosttype in + .dll:*win*) dialect="$dialect EXPORT=DLL" ;; + esac + fi + ;; +esac + +# shellmagic defined if installed shell scripts need magic + +echo ': got magic : +echo ok' > ok +chmod +x ok +case `(eval ./ok | /bin/sh) 2>/dev/null` in +ok) ;; +*) echo '#!/bin/env sh +: got magic : +echo ok' > ok + chmod +x ok + case `(eval ./ok | /bin/sh) 2>/dev/null` in + ok) shellmagic='$("#")!/bin/env sh' + ;; + *) for i in /emx/bin/bash.exe /emx/bin/sh.exe + do if test -x $i + then shellmagic='$("#")!'$i + break + fi + done + ;; + esac + ;; +esac + +# +# path cleanup +# + +for i in ar ccnative dld ld nm size stdinclude stdlib strip +do eval o='$'$i + v=$o + case $v in + *//*) v=`echo $v | sed 's,///*,/,g'` ;; + esac + if (test . -ef "`pwd`") + then k= + for x in $v + do case $x in + */../*|*/..) + case $x in + /*) a=/ ;; + *) a= ;; + esac + IFS=/ + set '' $x + IFS=$ifs + r= + for d + do r="$d $r" + done + p= + g= + for d in $r + do case $d in + ..) g="$g $d" ;; + *) case $g in + '') case $p in + '') p=$d ;; + *) p=$d/$p ;; + esac + ;; + *) set $g + shift + g=$* + ;; + esac + ;; + esac + done + case $a in + '') for d in $g + do p=$d/$p + done + ;; + *) p=$a$p + ;; + esac + case $p in + /) continue ;; + esac + test $x -ef $p && x=$p + ;; + esac + k="$k $x" + done + set '' $k + shift + v=$1 + case $# in + 0) ;; + *) shift + while : + do case $# in + 0) break ;; + esac + k= + for d + do for j in $v + do test $d -ef $j && continue 2 + done + k="$k $d" + done + set '' $k + case $# in + 1) break ;; + esac + shift + v="$v $1" + shift + done + ;; + esac + fi + case $v in + $o) ;; + *) eval $i='$'v ;; + esac +done + +case $keepstdlib in +1) ;; +*) # + # favor lib64 over lib + # + case $hosttype in + *64|*[!0-9]64[!a-zA-Z0-9]*) + o=$stdlib + stdlib= + for i in $o + do case " $stdlib " in + *" $i "*) + continue + ;; + esac + case $i in + *64) stdlib="$stdlib $i" + continue + ;; + esac + case " $o " in + *" ${i}64 "*) + case " $stdlib " in + *" ${i}64 "*) + ;; + *) stdlib="$stdlib ${i}64" + ;; + esac + ;; + esac + stdlib="$stdlib $i" + done + ;; + esac + ;; +esac + +# +# set up for local override +# + +CC_VERSION_STAMP=$version_stamp +CC_VERSION_STRING=$version_string +CC_CC=$cc +CC_NATIVE=$ccnative +CC_EXECTYPE=$exectype +CC_HOSTTYPE=$hosttype +CC_ALTPP_FLAGS=$ppopt +CC_ALTPP_ENV=$ppenv +CC_AR=$ar +CC_AR_ARFLAGS=$ar_arflags +CC_ARFLAGS=$arflags +CC_DEBUG=$debug +CC_DIALECT=$dialect +CC_PICBIG=$cc_PIC +CC_PICSMALL=$cc_pic +CC_PIC=$CC_PICBIG +CC_DLL_ONLY=$cc_dll +case $CC_DLL_ONLY in +'') CC_DLLBIG= + CC_DLLSMALL= + CC_DLL= + ;; +*) CC_DLLBIG="$CC_DLL_ONLY $CC_PICBIG" + CC_DLLSMALL="$CC_DLL_ONLY $CC_PICSMALL" + CC_DLL="$CC_DLL_ONLY $CC_PICBIG" + ;; +esac +CC_DLL_DIR=$dll_dir +CC_DLL_LIBRARIES=$dll_libraries +CC_DLL_VARIANTS=$dll_variants +CC_DYNAMIC=$dynamic +CC_EXPORT_DYNAMIC=$export_dynamic +CC_INCLUDE_LOCAL=$include_local +CC_LD=$ld +CC_LD_DYNAMIC=$lddynamic +CC_LD_LAZY=$ldlazy +CC_LD_NOLAZY=$ldnolazy +CC_LD_ORIGIN=$ldorigin +CC_LD_RECORD=$ldrecord +CC_LD_NORECORD=$ldnorecord +CC_LD_RUNPATH=$ldrunpath +CC_LD_STATIC=$ldstatic +CC_LD_STRIP=$ldstrip +CC_LIB_DLL=$lib_dll +CC_LIB_ALL=$lib_all +CC_LIB_UNDEF=$lib_undef +CC_MAKE_OPTIONS=$makeoptions +CC_NM=$nm +CC_NMEDIT=$nmedit +CC_NMFLAGS=$nmflags +CC_NOPROTECT=$no_protect +CC_OPTIMIZE=$optimize +CC_READONLY=$readonly +CC_REPOSITORY=$repository +CC_REQUIRE=$require +CC_RUNPATH=$runpath +CC_SHARED=$shared +CC_SHARED_LD=$dld +CC_SHARED_NAME=$shared_name +CC_SHARED_REGISTRY=$shared_registry +CC_SHARED_REGISTRY_PATH=$probe_shared_registry_path +CC_SHELLMAGIC=$shellmagic +CC_SIZE=$size +CC_STATIC=$static +CC_STDINCLUDE=$stdinclude +CC_STDLIB=$stdlib +CC_STRICT=$strict +CC_STRIP=$strip +CC_STRIP_FLAGS=$stripflags +CC_PREFIX_ARCHIVE=$prefix_archive +CC_PREFIX_DYNAMIC=$prefix_dynamic +CC_PREFIX_SHARED=$prefix_shared +CC_PREFIX_SYMBOL=$symprefix +CC_SUFFIX_ARCHIVE=.$lib +CC_SUFFIX_COMMAND=$suffix_command +CC_SUFFIX_DEBUG=$sdb +CC_SUFFIX_DYNAMIC=$sd +CC_SUFFIX_LD=$ldscript +CC_SUFFIX_OBJECT=.$obj +CC_SUFFIX_SHARED=$so +CC_SUFFIX_SOURCE=.$src +CC_SUFFIX_STATIC=$sa +CC_VERSION=$version_flags +CC_WARN=$warn +CC_ATTRIBUTES=$ATTRIBUTES + +exec >&3 + +# +# check for local override +# all CC_* but { CC_CC CC_VERSION_STAMP CC_VERSION_STRING } may be modified +# additional CC.* may be printed on stdout +# + +if test -f "$dir/probe.lcl" +then . "$dir/probe.lcl" +fi + +# +# the payoff +# + +case $version_stamp in +?*) echo "# $version_stamp" ;; +esac +echo CC.CC = $cc +echo CC.NATIVE = $CC_NATIVE +echo CC.EXECTYPE = $CC_EXECTYPE +echo CC.HOSTTYPE = $CC_HOSTTYPE +echo CC.ALTPP.FLAGS = $CC_ALTPP_FLAGS +echo CC.ALTPP.ENV = $CC_ALTPP_ENV +echo CC.AR = $CC_AR +echo CC.AR.ARFLAGS = $CC_AR_ARFLAGS +echo CC.ARFLAGS = $CC_ARFLAGS +echo CC.DEBUG = $CC_DEBUG +echo CC.DIALECT = $CC_DIALECT +echo CC.DLLBIG = $CC_DLLBIG +echo CC.DLLSMALL = $CC_DLLSMALL +echo CC.DLL = $CC_DLL +echo CC.DLL.DEF = $cc_dll_def +echo CC.DLL.DIR = $CC_DLL_DIR +echo CC.DLL.LIBRARIES = $CC_DLL_LIBRARIES +echo CC.DLL.VARIANTS = $CC_DLL_VARIANTS +echo CC.DYNAMIC = $CC_DYNAMIC +echo CC.EXPORT.DYNAMIC = $CC_EXPORT_DYNAMIC +echo CC.INCLUDE.LOCAL = $CC_INCLUDE_LOCAL +# +# 2004-02-14 release workaround +# +case $CC_SHARED_LD in +$CC_CC) echo if LDSHARED + echo CC.LD = $CC_LD + echo else + echo CC.LD = $CC_CC + echo end + ;; +*) echo CC.LD = $CC_LD + ;; +esac +echo CC.LD.DYNAMIC = $CC_LD_DYNAMIC +echo CC.LD.LAZY = $CC_LD_LAZY +echo CC.LD.NOLAZY = $CC_LD_NOLAZY +echo CC.LD.ORIGIN = $CC_LD_ORIGIN +echo CC.LD.RECORD = $CC_LD_RECORD +echo CC.LD.NORECORD = $CC_LD_NORECORD +echo CC.LD.RUNPATH = $CC_LD_RUNPATH +echo CC.LD.STATIC = $CC_LD_STATIC +echo CC.LD.STRIP = $CC_LD_STRIP +echo CC.LIB.DLL = $CC_LIB_DLL +echo CC.LIB.ALL = $CC_LIB_ALL +echo CC.LIB.UNDEF = $CC_LIB_UNDEF +echo CC.MAKE.OPTIONS = $CC_MAKE_OPTIONS +echo CC.NM = $CC_NM +case $CC_NMEDIT in +?*) CC_NMEDIT=" $CC_NMEDIT" ;; +esac +echo CC.NMEDIT ="$CC_NMEDIT" +echo CC.NMFLAGS = $CC_NMFLAGS +echo CC.NOPROTECT = $CC_NOPROTECT +echo CC.OPTIMIZE = $CC_OPTIMIZE +echo CC.PICBIG = $CC_PICBIG +echo CC.PICSMALL = $CC_PICSMALL +echo CC.PIC = $CC_PIC +echo CC.READONLY = $CC_READONLY +echo CC.REPOSITORY = $CC_REPOSITORY +for f in $CC_REQUIRE +do echo CC.REQUIRE.$f =`cat req.$f` +done +echo CC.RUNPATH = $CC_RUNPATH +echo CC.SHARED = $CC_SHARED +echo CC.SHARED.LD = $CC_SHARED_LD +echo CC.SHARED.NAME = $CC_SHARED_NAME +echo CC.SHARED.REGISTRY = $CC_SHARED_REGISTRY +echo CC.SHARED.REGISTRY.PATH = $CC_SHARED_REGISTRY_PATH +echo CC.SHELLMAGIC = $CC_SHELLMAGIC +echo CC.SIZE = $CC_SIZE +echo CC.STATIC = $CC_STATIC +echo CC.STDINCLUDE = $CC_STDINCLUDE +echo CC.STDLIB = $CC_STDLIB +echo CC.STRICT = $CC_STRICT +echo CC.STRIP = $CC_STRIP +echo CC.STRIP.FLAGS = $CC_STRIP_FLAGS +echo CC.PREFIX.ARCHIVE = $CC_PREFIX_ARCHIVE +echo CC.PREFIX.DYNAMIC = $CC_PREFIX_DYNAMIC +echo CC.PREFIX.SHARED = $CC_PREFIX_SHARED +echo CC.PREFIX.SYMBOL = $CC_PREFIX_SYMBOL +echo CC.SUFFIX.ARCHIVE = $CC_SUFFIX_ARCHIVE +echo CC.SUFFIX.COMMAND = $CC_SUFFIX_COMMAND +echo CC.SUFFIX.DEBUG = $CC_SUFFIX_DEBUG +echo CC.SUFFIX.DYNAMIC = $CC_SUFFIX_DYNAMIC +echo CC.SUFFIX.LD = $CC_SUFFIX_LD +echo CC.SUFFIX.OBJECT = $CC_SUFFIX_OBJECT +echo CC.SUFFIX.SHARED = $CC_SUFFIX_SHARED +echo CC.SUFFIX.SOURCE = $CC_SUFFIX_SOURCE +echo CC.SUFFIX.STATIC = $CC_SUFFIX_STATIC +echo CC.VERSION = $CC_VERSION +case $CC_VERSION_STRING in +*\"*) i=`echo " $CC_VERSION_STRING" | sed -e 's,",\\\\",g' -e 's,^ ,,' -e 's,.*,"&",'` ;; +*\'*) i=\"$CC_VERSION_STRING\" ;; +*) i=$CC_VERSION_STRING ;; +esac +cat < * +* * +***********************************************************************/ +#pragma prototyped + +/* + * mamake -- MAM make + * + * coded for portability + */ + +static char id[] = "\n@(#)$Id: mamake (AT&T Research) 2011-08-31 $\0\n"; + +#if _PACKAGE_ast + +#include +#include + +static const char usage[] = +"[-?\n@(#)$Id: mamake (AT&T Research) 2011-08-31 $\n]" +USAGE_LICENSE +"[+NAME?mamake - make abstract machine make]" +"[+DESCRIPTION?\bmamake\b reads \amake abstract machine\a target and" +" prerequisite file descriptions from a mamfile (see \b-f\b) and executes" +" actions to update targets that are older than their prerequisites." +" Mamfiles are generated by the \b--mam\b option of \bnmake\b(1) and" +" \bgmake\b(1) and are portable to environments that only have" +" \bsh\b(1) and \bcc\b(1).]" +"[+?In practice \bmamake\b is used to bootstrap build \bnmake\b(1) and" +" \bksh\b(1) in new environments. Mamfiles are used rather than" +" old-\bmake\b makefiles because some features are not reliably supported" +" across all \bmake\b variants:]{" +" [+action execution?Multi-line actions are executed as a" +" unit by \b$SHELL\b. There are some shell constructs" +" that cannot be expressed in an old-\bmake\b makefile.]" +" [+viewpathing?\bVPATH\b is properly interpreted. This allows" +" source to be separate from generated files.]" +" [+recursion?Ordered subdirectory recursion over unrelated" +" makefiles.]" +" }" +"[+?\bmamprobe\b(1) is called to probe and generate system specific variable" +" definitions. The probe information is regenerated when it is older" +" than the \bmamprobe\b command.]" +"[+?For compatibility with \bnmake\b(1) the \b-K\b option and the" +" \brecurse\b and \bcc-*\b command line targets are ignored.]" +"[e:?Explain reason for triggering action. Ignored if -F is on.]" +"[f:?Read \afile\a instead of the default.]:[file:=Mamfile]" +"[i:?Ignore action errors.]" +"[k:?Continue after error with sibling prerequisites.]" +"[n:?Print actions but do not execute. Recursion actions (see \b-r\b) are still" +" executed. Use \b-N\b to disable recursion actions too.]" +"[r:?Recursively make leaf directories matching \apattern\a. Only leaf" +" directories containing a makefile named \bNmakefile\b, \bnmakefile\b," +" \bMakefile\b or \bmakefile\b are considered. The first makefile" +" found in each leaf directory is scanned for leaf directory" +" prerequisites; the recusion order is determined by a topological sort" +" of these prerequisites.]:[pattern]" +"[C:?Do all work in \adirectory\a. All messages will mention" +" \adirectory\a.]:[directory]" +"[D:?Set the debug trace level to \alevel\a. Higher levels produce more" +" output.]#[level]" +"[F:?Force all targets to be out of date.]" +"[K:?Ignored.]" +"[N:?Like \b-n\b but recursion actions (see \b-r\b) are also disabled.]" +"[V:?Print the program version and exit.]" +"[G:debug-symbols?Compile and link with debugging symbol options enabled.]" +"[S:strip-symbols?Strip link-time static symbols from executables.]" + +"\n" +"\n[ target ... ] [ name=value ... ]\n" +"\n" + +"[+SEE ALSO?\bgmake\b(1), \bmake\b(1), \bmamprobe\b(1)," +" \bnmake\b(1), \bsh\b(1)]" +; + +#else + +#define elementsof(x) (sizeof(x)/sizeof(x[0])) +#define newof(p,t,n,x) ((p)?(t*)realloc((char*)(p),sizeof(t)*(n)+(x)):(t*)calloc(1,sizeof(t)*(n)+(x))) + +#define NiL ((char*)0) + +#endif + +#include +#include +#include +#include +#include +#include + +#if !_PACKAGE_ast && defined(__STDC__) +#include +#include +#endif + +#define delimiter(c) ((c)==' '||(c)=='\t'||(c)=='\n'||(c)==';'||(c)=='('||(c)==')'||(c)=='`'||(c)=='|'||(c)=='&'||(c)=='=') + +#define add(b,c) (((b)->nxt >= (b)->end) ? append(b, "") : NiL, *(b)->nxt++ = (c)) +#define get(b) ((b)->nxt-(b)->buf) +#define set(b,o) ((b)->nxt=(b)->buf+(o)) +#define use(b) (*(b)->nxt=0,(b)->nxt=(b)->buf) + +#define CHUNK 1024 +#define KEY(a,b,c,d) ((((unsigned long)(a))<<15)|(((unsigned long)(b))<<10)|(((unsigned long)(c))<<5)|(((unsigned long)(d)))) +#define NOW ((unsigned long)time((time_t*)0)) +#define ROTATE(p,l,r,t) ((t)=(p)->l,(p)->l=(t)->r,(t)->r=(p),(p)=(t)) + +#define RULE_active 0x0001 /* active target */ +#define RULE_dontcare 0x0002 /* ok if not found */ +#define RULE_error 0x0004 /* not found or not generated */ +#define RULE_exists 0x0008 /* target file exists */ +#define RULE_generated 0x0010 /* generated target */ +#define RULE_ignore 0x0020 /* ignore time */ +#define RULE_implicit 0x0040 /* implicit prerequisite */ +#define RULE_made 0x0080 /* already made */ +#define RULE_virtual 0x0100 /* not a file */ + +#define STREAM_KEEP 0x0001 /* don't fclose() on pop() */ +#define STREAM_MUST 0x0002 /* push() file must exist */ +#define STREAM_PIPE 0x0004 /* pclose() on pop() */ + +#ifndef S_IXUSR +#define S_IXUSR 0100 /* owner execute permission */ +#endif +#ifndef S_IXGRP +#define S_IXGRP 0010 /* group execute permission */ +#endif +#ifndef S_IXOTH +#define S_IXOTH 0001 /* other execute permission */ +#endif + +struct Rule_s; + +typedef struct stat Stat_t; +typedef FILE Stdio_t; + +typedef struct Buf_s /* buffer stream */ +{ + struct Buf_s* old; /* next dropped buffer */ + char* end; /* 1 past end of buffer */ + char* nxt; /* next char to add */ + char* buf; /* buffer space */ +} Buf_t; + +typedef struct Dict_item_s /* dictionary item */ +{ + struct Dict_item_s* left; /* left child */ + struct Dict_item_s* right; /* right child */ + void* value; /* user defined value */ + char name[1];/* 0 terminated name */ +} Dict_item_t; + +typedef struct Dict_s /* dictionary handle */ +{ + Dict_item_t* root; /* root item */ +} Dict_t; + +typedef struct List_s /* Rule_t list */ +{ + struct List_s* next; /* next in list */ + struct Rule_s* rule; /* list item */ +} List_t; + +typedef struct Rule_s /* rule item */ +{ + char* name; /* unbound name */ + char* path; /* bound path */ + List_t* prereqs; /* prerequisites */ + struct Rule_s* leaf; /* recursion leaf alias */ + int flags; /* RULE_* flags */ + int making; /* currently make()ing */ + unsigned long time; /* modification time */ +} Rule_t; + +typedef struct Stream_s /* input file stream stack */ +{ + Stdio_t* fp; /* read stream */ + char* file; /* stream path */ + unsigned long line; /* stream line */ + int flags; /* stream flags */ +} Stream_t; + +typedef struct View_s /* viewpath level */ +{ + struct View_s* next; /* next level in viewpath */ + int node; /* viewpath node path length */ + char dir[1]; /* viewpath level dir prefix */ +} View_t; + +static struct /* program state */ +{ + Buf_t* buf; /* work buffer */ + Buf_t* old; /* dropped buffers */ + Buf_t* opt; /* option buffer */ + + Dict_t* leaf; /* recursion leaf dictionary */ + Dict_t* libs; /* library dictionary */ + Dict_t* rules; /* rule dictionary */ + Dict_t* vars; /* variable dictionary */ + + View_t* view; /* viewpath levels */ + + char* directory; /* work in this directory */ + char* id; /* command name */ + char* file; /* first input file */ + char* pwd; /* current directory */ + char* recurse; /* recursion pattern */ + char* shell; /* ${SHELL} */ + + int active; /* targets currently active */ + int debug; /* negative of debug level */ + int errors; /* some error(s) occurred */ + int exec; /* execute actions */ + int explain; /* explain actions */ + int force; /* all targets out of date */ + int ignore; /* ignore command errors */ + int indent; /* debug indent */ + int keepgoing; /* do siblings on error */ + int never; /* never execute */ + int peek; /* next line already in input */ + int probed; /* probe already done */ + int verified; /* don't bother with verify() */ + + Stream_t streams[4]; /* input file stream stack */ + Stream_t* sp; /* input stream stack pointer */ + + char input[8*CHUNK]; /* input buffer */ +} state; + +static unsigned long make(Rule_t*); + +static char mamfile[] = "Mamfile"; +static char sh[] = "/bin/sh"; + +extern char** environ; + +#if !_PACKAGE_ast + +#if defined(NeXT) || defined(__NeXT) +#define getcwd(a,b) getwd(a) +#endif + +/* + * emit usage message and exit + */ + +static void +usage() +{ + fprintf(stderr, "Usage: %s [-iknFKNV] [-f mamfile] [-r pattern] [-C directory] [-D level] [target ...] [name=value ...]\n", state.id); + exit(2); +} + +#endif + +/* + * output error message identification + */ + +static void +identify(Stdio_t* sp) +{ + if (state.directory) + fprintf(sp, "%s [%s]: ", state.id, state.directory); + else + fprintf(sp, "%s: ", state.id); +} + +/* + * emit error message + * level: + * <0 debug + * 0 info + * 1 warning + * 2 error + * >2 exit(level-2) + */ + +static void +report(int level, char* text, char* item, unsigned long stamp) +{ + int i; + + if (level >= state.debug) + { + if (level) + identify(stderr); + if (level < 0) + { + fprintf(stderr, "debug%d: ", level); + for (i = 1; i < state.indent; i++) + fprintf(stderr, " "); + } + else + { + if (state.sp && state.sp->line) + { + if (state.sp->file) + fprintf(stderr, "%s: ", state.sp->file); + fprintf(stderr, "%ld: ", state.sp->line); + } + if (level == 1) + fprintf(stderr, "warning: "); + else if (level > 1) + state.errors = 1; + } + if (item) + fprintf(stderr, "%s: ", item); + fprintf(stderr, "%s", text); + if (stamp && state.debug <= -2) + fprintf(stderr, " %10lu", stamp); + fprintf(stderr, "\n"); + if (level > 2) + exit(level - 2); + } +} + +/* + * don't know how to make or exit code making + */ + +static void +dont(Rule_t* r, int code, int keepgoing) +{ + identify(stderr); + if (!code) + fprintf(stderr, "don't know how to make %s\n", r->name); + else + { + fprintf(stderr, "*** exit code %d making %s%s\n", code, r->name, state.ignore ? " ignored" : ""); + unlink(r->name); + if (state.ignore) + return; + } + if (!keepgoing) + exit(1); + state.errors++; + r->flags |= RULE_error; +} + +/* + * local strrchr() + */ + +static char* +last(register char* s, register int c) +{ + register char* r = 0; + + for (r = 0; *s; s++) + if (*s == c) + r = s; + return r; +} + +/* + * open a buffer stream + */ + +static Buf_t* +buffer(void) +{ + register Buf_t* buf; + + if (buf = state.old) + state.old = state.old->old; + else if (!(buf = newof(0, Buf_t, 1, 0)) || !(buf->buf = newof(0, char, CHUNK, 0))) + report(3, "out of space [buffer]", NiL, (unsigned long)0); + buf->end = buf->buf + CHUNK; + buf->nxt = buf->buf; + return buf; +} + +/* + * close a buffer stream + */ + +static void +drop(Buf_t* buf) +{ + buf->old = state.old; + state.old = buf; +} + +/* + * append str length n to buffer and return the buffer base + */ + +static char* +appendn(Buf_t* buf, char* str, int n) +{ + int m; + int i; + + if ((n + 1) >= (buf->end - buf->nxt)) + { + i = buf->nxt - buf->buf; + m = (((buf->end - buf->buf) + n + CHUNK + 1) / CHUNK) * CHUNK; + if (!(buf->buf = newof(buf->buf, char, m, 0))) + report(3, "out of space [buffer resize]", NiL, (unsigned long)0); + buf->end = buf->buf + m; + buf->nxt = buf->buf + i; + } + memcpy(buf->nxt, str, n + 1); + buf->nxt += n; + return buf->buf; +} + +/* + * append str to buffer and return the buffer base + * if str==0 then next pointer reset to base + */ + +static char* +append(Buf_t* buf, char* str) +{ + if (str) + return appendn(buf, str, strlen(str)); + buf->nxt = buf->buf; + return buf->buf; +} + +/* + * allocate space for s and return the copy + */ + +static char* +duplicate(char* s) +{ + char* t; + int n; + + n = strlen(s); + if (!(t = newof(0, char, n, 1))) + report(3, "out of space [duplicate]", s, (unsigned long)0); + strcpy(t, s); + return t; +} + +/* + * open a new dictionary + */ + +static Dict_t* +dictionary(void) +{ + Dict_t* dict; + + if (!(dict = newof(0, Dict_t, 1, 0))) + report(3, "out of space [dictionary]", NiL, (unsigned long)0); + return dict; +} + +/* + * return the value for item name in dictionary dict + * if value!=0 then name entry value is created if necessary and set + * uses top-down splaying (ala Tarjan and Sleator) + */ + +static void* +search(register Dict_t* dict, char* name, void* value) +{ + register int cmp; + register Dict_item_t* root; + register Dict_item_t* t; + register Dict_item_t* left; + register Dict_item_t* right; + register Dict_item_t* lroot; + register Dict_item_t* rroot; + + root = dict->root; + left = right = lroot = rroot = 0; + while (root) + { + if (!(cmp = strcmp(name, root->name))) + break; + else if (cmp < 0) + { + if (root->left && (cmp = strcmp(name, root->left->name)) <= 0) + { + ROTATE(root, left, right, t); + if (!cmp) + break; + } + if (right) + right->left = root; + else + rroot = root; + right = root; + root = root->left; + right->left = 0; + } + else + { + if (root->right && (cmp = strcmp(name, root->right->name)) >= 0) + { + ROTATE(root, right, left, t); + if (!cmp) + break; + } + if (left) + left->right = root; + else + lroot = root; + left = root; + root = root->right; + left->right = 0; + } + } + if (root) + { + if (right) + right->left = root->right; + else + rroot = root->right; + if (left) + left->right = root->left; + else + lroot = root->left; + } + else if (value) + { + if (!(root = newof(0, Dict_item_t, 1, strlen(name)))) + report(3, "out of space [dictionary]", name, (unsigned long)0); + strcpy(root->name, name); + } + if (root) + { + if (value) + root->value = value; + root->left = lroot; + root->right = rroot; + dict->root = root; + return value ? (void*)root->name : root->value; + } + if (left) + { + left->right = rroot; + dict->root = lroot; + } + else if (right) + { + right->left = lroot; + dict->root = rroot; + } + return 0; +} + +/* + * low level for walk() + */ + +static int +apply(Dict_t* dict, Dict_item_t* item, int (*func)(Dict_item_t*, void*), void* handle) +{ + register Dict_item_t* right; + + do + { + right = item->right; + if (item->left && apply(dict, item->left, func, handle)) + return -1; + if ((*func)(item, handle)) + return -1; + } while (item = right); + return 0; +} + +/* + * apply func to each dictionary item + */ + +static int +walk(Dict_t* dict, int (*func)(Dict_item_t*, void*), void* handle) +{ + return dict->root ? apply(dict, dict->root, func, handle) : 0; +} + +/* + * return a rule pointer for name + */ + +static Rule_t* +rule(char* name) +{ + Rule_t* r; + + if (!(r = (Rule_t*)search(state.rules, name, NiL))) + { + if (!(r = newof(0, Rule_t, 1, 0))) + report(3, "out of space [rule]", name, (unsigned long)0); + r->name = (char*)search(state.rules, name, (void*)r); + } + return r; +} + +/* + * prepend p onto rule r prereqs + */ + +static void +cons(Rule_t* r, Rule_t* p) +{ + register List_t* x; + + for (x = r->prereqs; x && x->rule != p; x = x->next); + if (!x) + { + if (!(x = newof(0, List_t, 1, 0))) + report(3, "out of space [list]", r->name, (unsigned long)0); + x->rule = p; + x->next = r->prereqs; + r->prereqs = x; + } +} + +/* + * initialize the viewpath + */ + +static void +view(void) +{ + register char* s; + register char* t; + register char* p; + register View_t* vp; + + View_t* zp; + int c; + int n; + + Stat_t st; + Stat_t ts; + + char buf[CHUNK]; + + if (stat(".", &st)) + report(3, "cannot stat", ".", (unsigned long)0); + if ((s = (char*)search(state.vars, "PWD", NiL)) && !stat(s, &ts) && + ts.st_dev == st.st_dev && ts.st_ino == st.st_ino) + state.pwd = s; + if (!state.pwd) + { + if (!getcwd(buf, sizeof(buf) - 1)) + report(3, "cannot determine PWD", NiL, (unsigned long)0); + state.pwd = duplicate(buf); + search(state.vars, "PWD", state.pwd); + } + if ((s = (char*)search(state.vars, "VPATH", NiL)) && *s) + { + zp = 0; + for (;;) + { + for (t = s; *t && *t != ':'; t++); + if (c = *t) + *t = 0; + if (!state.view) + { + /* + * determine the viewpath offset + */ + + if (stat(s, &st)) + report(3, "cannot stat top view", s, (unsigned long)0); + if (stat(state.pwd, &ts)) + report(3, "cannot stat", state.pwd, (unsigned long)0); + if (ts.st_dev == st.st_dev && ts.st_ino == st.st_ino) + p = "."; + else + { + p = state.pwd + strlen(state.pwd); + while (p > state.pwd) + if (*--p == '/') + { + if (p == state.pwd) + report(3, ". not under VPATH", s, (unsigned long)0); + *p = 0; + if (stat(state.pwd, &ts)) + report(3, "cannot stat", state.pwd, (unsigned long)0); + *p = '/'; + if (ts.st_dev == st.st_dev && ts.st_ino == st.st_ino) + { + p++; + break; + } + } + if (p <= state.pwd) + report(3, "cannot determine viewpath offset", s, (unsigned long)0); + } + } + n = strlen(s); + if (!(vp = newof(0, View_t, 1, strlen(p) + n + 1))) + report(3, "out of space [view]", s, (unsigned long)0); + vp->node = n + 1; + strcpy(vp->dir, s); + *(vp->dir + n) = '/'; + strcpy(vp->dir + n + 1, p); + report(-4, vp->dir, "view", (unsigned long)0); + if (!state.view) + state.view = zp = vp; + else + zp = zp->next = vp; + if (!c) + break; + *t++ = c; + s = t; + } + } +} + +/* + * return next '?' or '}' in nested '}' + */ + +static char* +cond(register char* s) +{ + register int n; + + if (*s == '?') + s++; + n = 0; + for (;;) + { + switch (*s++) + { + case 0: + break; + case '{': + n++; + continue; + case '}': + if (!n--) + break; + continue; + case '?': + if (!n) + break; + continue; + default: + continue; + } + break; + } + return s - 1; +} + +/* + * expand var refs from s into buf + */ + +static void +substitute(Buf_t* buf, register char* s) +{ + register char* t; + register char* v; + register char* q; + register char* b; + register int c; + register int n; + int a = 0; + int i; + + while (c = *s++) + { + if (c == '$' && *s == '{') + { + b = s - 1; + i = 1; + for (n = *(t = ++s) == '-' ? 0 : '-'; (c = *s) && c != '?' && c != '+' && c != n && c != ':' && c != '=' && c != '[' && c != '}'; s++) + if (!isalnum(c) && c != '_') + i = 0; + *s = 0; + if (c == '[') + { + append(buf, b); + *s = c; + continue; + } + v = (char*)search(state.vars, t, NiL); + if ((c == ':' || c == '=') && (!v || c == ':' && !*v)) + { + append(buf, b); + *s = c; + continue; + } + if (t[0] == 'A' && t[1] == 'R' && t[2] == 0) + a = 1; + *s = c; + if (c && c != '}') + { + n = 1; + for (t = ++s; *s; s++) + if (*s == '{') + n++; + else if (*s == '}' && !--n) + break; + } + switch (c) + { + case '?': + q = cond(t - 1); + if (v) + { + if (((q - t) != 1 || *t != '*') && strncmp(v, t, q - t)) + v = 0; + } + else if (q == t) + v = s; + t = cond(q); + if (v) + { + if (t > q) + { + c = *t; + *t = 0; + substitute(buf, q + 1); + *t = c; + } + } + else + { + q = cond(t); + if (q > t) + { + c = *q; + *q = 0; + substitute(buf, t + 1); + *q = c; + } + } + break; + case '+': + case '-': + if ((v == 0 || *v == 0) == (c == '-')) + { + c = *s; + *s = 0; + substitute(buf, t); + *s = c; + break; + } + if (c != '-') + break; + /*FALLTHROUGH*/ + case 0: + case '=': + case '}': + if (v) + { + if (a && t[0] == 'm' && t[1] == 'a' && t[2] == 'm' && t[3] == '_' && t[4] == 'l' && t[5] == 'i' && t[6] == 'b') + { + for (t = v; *t == ' '; t++); + for (; *t && *t != ' '; t++); + if (*t) + *t = 0; + else + t = 0; + substitute(buf, v); + if (t) + *t = ' '; + } + else + substitute(buf, v); + } + else if (i) + { + c = *s; + *s = 0; + append(buf, b); + *s = c; + continue; + } + break; + } + if (*s) + s++; + } + else + add(buf, c); + } +} + +/* + * expand var refs from s into buf and return buf base + */ + +static char* +expand(Buf_t* buf, char* s) +{ + substitute(buf, s); + return use(buf); +} + +/* + * stat() with .exe check + */ + +static char* +status(Buf_t* buf, int off, char* path, struct stat* st) +{ + int r; + char* s; + Buf_t* tmp; + + if (!stat(path, st)) + return path; + if (!(tmp = buf)) + { + tmp = buffer(); + off = 0; + } + if (off) + set(tmp, off); + else + append(tmp, path); + append(tmp, ".exe"); + s = use(tmp); + r = stat(s, st); + if (!buf) + { + drop(tmp); + s = path; + } + if (r) + { + if (off) + s[off] = 0; + s = 0; + } + return s; +} + +/* + * return path to file + */ + +static char* +find(Buf_t* buf, char* file, struct stat* st) +{ + char* s; + View_t* vp; + int node; + int c; + int o; + + if (s = status(buf, 0, file, st)) + { + report(-3, s, "find", (unsigned long)0); + return s; + } + if (vp = state.view) + { + node = 0; + if (*file == '/') + { + do + { + if (!strncmp(file, vp->dir, vp->node)) + { + file += vp->node; + node = 2; + break; + } + } while (vp = vp->next); + } + else + vp = vp->next; + if (vp) + do + { + if (node) + { + c = vp->dir[vp->node]; + vp->dir[vp->node] = 0; + append(buf, vp->dir); + vp->dir[vp->node] = c; + } + else + { + append(buf, vp->dir); + append(buf, "/"); + } + append(buf, file); + o = get(buf); + s = use(buf); + if (s = status(buf, o, s, st)) + { + report(-3, s, "find", (unsigned long)0); + return s; + } + } while (vp = vp->next); + } + return 0; +} + +/* + * bind r to a file and return the modify time + */ + +static unsigned long +bind(Rule_t* r) +{ + char* s; + Buf_t* buf; + struct stat st; + + buf = buffer(); + if (s = find(buf, r->name, &st)) + { + if (s != r->name) + r->path = duplicate(s); + r->time = st.st_mtime; + r->flags |= RULE_exists; + } + drop(buf); + return r->time; +} + +/* + * pop the current input file + */ + +static int +pop(void) +{ + int r; + + if (!state.sp) + report(3, "input stack underflow", NiL, (unsigned long)0); + if (!state.sp->fp || (state.sp->flags & STREAM_KEEP)) + r = 0; + else if (state.sp->flags & STREAM_PIPE) + r = pclose(state.sp->fp); + else + r = fclose(state.sp->fp); + if (state.sp == state.streams) + state.sp = 0; + else + state.sp--; + return r; +} + +/* + * push file onto the input stack + */ + +static int +push(char* file, Stdio_t* fp, int flags) +{ + char* path; + Buf_t* buf; + struct stat st; + + if (!state.sp) + state.sp = state.streams; + else if (++state.sp >= &state.streams[elementsof(state.streams)]) + report(3, "input stream stack overflow", NiL, (unsigned long)0); + if (state.sp->fp = fp) + state.sp->file = "pipeline"; + else if (flags & STREAM_PIPE) + report(3, "pipe error", file, (unsigned long)0); + else if (!file || !strcmp(file, "-") || !strcmp(file, "/dev/stdin")) + { + flags |= STREAM_KEEP; + state.sp->file = "/dev/stdin"; + state.sp->fp = stdin; + } + else + { + buf = buffer(); + if (path = find(buf, file, &st)) + { + if (!(state.sp->fp = fopen(path, "r"))) + report(3, "cannot read", path, (unsigned long)0); + state.sp->file = duplicate(path); + drop(buf); + } + else + { + drop(buf); + pop(); + if (flags & STREAM_MUST) + report(3, "not found", file, (unsigned long)0); + return 0; + } + } + state.sp->flags = flags; + state.sp->line = 0; + return 1; +} + +/* + * return the next input line + */ + +static char* +input(void) +{ + char* e; + + if (!state.sp) + report(3, "no input file stream", NiL, (unsigned long)0); + if (state.peek) + state.peek = 0; + else if (!fgets(state.input, sizeof(state.input), state.sp->fp)) + return 0; + else if (*state.input && *(e = state.input + strlen(state.input) - 1) == '\n') + *e = 0; + state.sp->line++; + return state.input; +} + +/* + * pass shell action s to ${SHELL:-/bin/sh} + * the -c wrapper ensures that scripts are run in the selected shell + * even on systems that otherwise demand #! magic (can you say cygwin) + */ + +static int +execute(register char* s) +{ + register int c; + Buf_t* buf; + + if (!state.shell && (!(state.shell = (char*)search(state.vars, "SHELL", NiL)) || !strcmp(state.shell, sh))) + state.shell = sh; + buf = buffer(); + append(buf, state.shell); + append(buf, " -c '"); + while (c = *s++) + { + if (c == '\'') + { + add(buf, c); + for (s--; *s == c; s++) + { + add(buf, '\\'); + add(buf, c); + } + } + add(buf, c); + } + add(buf, '\''); + s = use(buf); + report(-5, s, "exec", (unsigned long)0); + if ((c = system(s)) > 255) + c >>= 8; + drop(buf); + return c; +} + +/* + * run action s to update r + */ + +static unsigned long +run(Rule_t* r, register char* s) +{ + register Rule_t* q; + register char* t; + register int c; + register View_t* v; + int i; + int j; + int x; + Stat_t st; + Buf_t* buf; + + if (r->flags & RULE_error) + return r->time; + buf = buffer(); + if (!strncmp(s, "mamake -r ", 10)) + { + state.verified = 1; + x = !state.never; + } + else + x = state.exec; + if (x) + append(buf, "trap - 1 2 3 15\nPATH=.:$PATH\nset -x\n"); + if (state.view) + { + do + { + for (; delimiter(*s); s++) + add(buf, *s); + for (t = s; *s && !delimiter(*s); s++); + c = *s; + *s = 0; + if (c == '=') + { + append(buf, t); + continue; + } + if ((q = (Rule_t*)search(state.rules, t, NiL)) && q->path && !(q->flags & RULE_generated)) + append(buf, q->path); + else + { + append(buf, t); + if (*t == '-' && *(t + 1) == 'I' && (*(t + 2) || c)) + { + if (*(t + 2)) + i = 2; + else + { + for (i = 3; *(t + i) == ' ' || *(t + i) == '\t'; i++); + *s = c; + for (s = t + i; *s && *s != ' ' && *s != '\t' && *s != '\n'; s++); + c = *s; + *s = 0; + append(buf, t + 2); + } + if (*(t + i) && *(t + i) != '/') + { + v = state.view; + while (v = v->next) + { + add(buf, ' '); + for (j = 0; j < i; j++) + add(buf, *(t + j)); + append(buf, v->dir); + if (*(t + i) != '.' || *(t + i + 1)) + { + add(buf, '/'); + append(buf, t + i); + } + } + } + } + } + } while (*s = c); + s = use(buf); + } + else if (x) + { + append(buf, s); + s = use(buf); + } + if (x) + { + if (c = execute(s)) + dont(r, c, state.keepgoing); + if (status((Buf_t*)0, 0, r->name, &st)) + { + r->time = st.st_mtime; + r->flags |= RULE_exists; + } + else + r->time = NOW; + } + else + { + fprintf(stdout, "%s\n", s); + if (state.debug) + fflush(stdout); + r->time = NOW; + r->flags |= RULE_exists; + } + drop(buf); + return r->time; +} + +/* + * return the full path for s using buf workspace + */ + +static char* +path(Buf_t* buf, char* s, int must) +{ + register char* p; + register char* d; + register char* x; + char* e; + register int c; + int t; + int o; + Stat_t st; + + for (e = s; *e && *e != ' ' && *e != '\t'; e++); + t = *e; + if ((x = status(buf, 0, s, &st)) && (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))) + return x; + if (!(p = (char*)search(state.vars, "PATH", NiL))) + report(3, "variable not defined", "PATH", (unsigned long)0); + do + { + for (d = p; *p && *p != ':'; p++); + c = *p; + *p = 0; + if (*d && (*d != '.' || *(d + 1))) + { + append(buf, d); + add(buf, '/'); + } + *p = c; + if (t) + *e = 0; + append(buf, s); + if (t) + *e = t; + o = get(buf); + x = use(buf); + if ((x = status(buf, o, x, &st)) && (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))) + return x; + } while (*p++); + if (must) + report(3, "command not found", s, (unsigned long)0); + return 0; +} + +/* + * generate (if necessary) and read the MAM probe information + * done on the first `setv CC ...' + */ + +static void +probe(void) +{ + register char* cc; + register char* s; + unsigned long h; + unsigned long q; + Buf_t* buf; + Buf_t* pro; + Buf_t* tmp; + struct stat st; + + static char let[] = "ABCDEFGHIJKLMNOP"; + static char cmd[] = "mamprobe"; + + if (!(cc = (char*)search(state.vars, "CC", NiL))) + cc = "cc"; + buf = buffer(); + s = path(buf, cmd, 1); + q = stat(s, &st) ? (unsigned long)0 : (unsigned long)st.st_mtime; + pro = buffer(); + s = cc = path(pro, cc, 1); + for (h = 0; *s; s++) + h = h * 0x63c63cd9L + *s + 0x9c39c33dL; + if (!(s = (char*)search(state.vars, "INSTALLROOT", NiL))) + report(3, "variable must be defined", "INSTALLROOT", (unsigned long)0); + append(buf, s); + append(buf, "/lib/probe/C/mam/"); + for (h &= 0xffffffffL; h; h >>= 4) + add(buf, let[h & 0xf]); + s = use(buf); + h = stat(s, &st) ? (unsigned long)0 : (unsigned long)st.st_mtime; + if (h < q || !push(s, (Stdio_t*)0, 0)) + { + tmp = buffer(); + append(tmp, cmd); + add(tmp, ' '); + append(tmp, s); + add(tmp, ' '); + append(tmp, cc); + if (execute(use(tmp))) + report(3, "cannot generate probe info", s, (unsigned long)0); + drop(tmp); + if (!push(s, (Stdio_t*)0, 0)) + report(3, "cannot read probe info", s, (unsigned long)0); + } + drop(pro); + drop(buf); + make(rule("")); + pop(); +} + +/* + * add attributes in s to r + */ + +static void +attributes(register Rule_t* r, register char* s) +{ + register char* t; + register int n; + + for (;;) + { + for (; *s == ' '; s++); + for (t = s; *s && *s != ' '; s++); + if (!(n = s - t)) + break; + switch (*t) + { + case 'd': + if (n == 8 && !strncmp(t, "dontcare", n)) + r->flags |= RULE_dontcare; + break; + case 'g': + if (n == 9 && !strncmp(t, "generated", n)) + r->flags |= RULE_generated; + break; + case 'i': + if (n == 6 && !strncmp(t, "ignore", n)) + r->flags |= RULE_ignore; + else if (n == 8 && !strncmp(t, "implicit", n)) + r->flags |= RULE_implicit; + break; + case 'v': + if (n == 7 && !strncmp(t, "virtual", n)) + r->flags |= RULE_virtual; + break; + } + } +} + +/* + * define ${mam_libX} for library reference lib + */ + +static char* +require(char* lib, int dontcare) +{ + register int c; + char* s; + char* r; + FILE* f; + Buf_t* buf; + Buf_t* tmp; + struct stat st; + + static int dynamic = -1; + + if (dynamic < 0) + dynamic = (s = search(state.vars, "mam_cc_L", NiL)) ? atoi(s) : 0; + if (!(r = search(state.vars, lib, NiL))) + { + buf = buffer(); + tmp = buffer(); + s = 0; + for (;;) + { + if (s) + append(buf, s); + if (r = search(state.vars, "mam_cc_PREFIX_ARCHIVE", NiL)) + append(buf, r); + append(buf, lib + 2); + if (r = search(state.vars, "mam_cc_SUFFIX_ARCHIVE", NiL)) + append(buf, r); + r = expand(tmp, use(buf)); + if (!stat(r, &st)) + break; + if (s) + { + r = lib; + break; + } + s = "${INSTALLROOT}/lib/"; + if (dynamic) + { + append(buf, s); + if (r = search(state.vars, "mam_cc_PREFIX_SHARED", NiL)) + append(buf, r); + append(buf, lib + 2); + if (r = search(state.vars, "mam_cc_SUFFIX_SHARED", NiL)) + append(buf, r); + r = expand(tmp, use(buf)); + if (!stat(r, &st)) + { + r = lib; + break; + } + } + } + if (r != lib) + r = duplicate(r); + search(state.vars, lib, r); + append(tmp, lib + 2); + append(tmp, ".req"); + if (!(f = fopen(use(tmp), "r"))) + { + append(tmp, "${INSTALLROOT}/lib/lib/"); + append(tmp, lib + 2); + f = fopen(expand(buf, use(tmp)), "r"); + } + if (f) + { + for (;;) + { + while ((c = fgetc(f)) == ' ' || c == '\t' || c == '\n'); + if (c == EOF) + break; + do + { + add(tmp, c); + } while ((c = fgetc(f)) != EOF && c != ' ' && c != '\t' && c != '\n'); + s = use(tmp); + if (s[0] && (s[0] != '-' || s[1])) + { + add(buf, ' '); + append(buf, require(s, 0)); + } + } + fclose(f); + r = use(buf); + } + else if (dontcare) + { + append(tmp, "set -\n"); + append(tmp, "cd /tmp\n"); + append(tmp, "echo 'int main(){return 0;}' > x.${!-$$}.c\n"); + append(tmp, "${CC} ${CCFLAGS} -o x.${!-$$}.x x.${!-$$}.c "); + append(tmp, r); + append(tmp, " >/dev/null 2>&1\n"); + append(tmp, "c=$?\n"); + append(tmp, "rm -f x.${!-$$}.[cox]\n"); + append(tmp, "exit $c\n"); + if (execute(expand(buf, use(tmp)))) + r = ""; + } + r = duplicate(r); + search(state.vars, lib, r); + append(tmp, "mam_lib"); + append(tmp, lib + 2); + search(state.vars, use(tmp), r); + drop(tmp); + drop(buf); + } + return r; +} + +/* + * input() until `done r' + */ + +static unsigned long +make(Rule_t* r) +{ + register char* s; + register char* t; + register char* u; + register char* v; + register Rule_t* q; + unsigned long z; + unsigned long x; + Buf_t* buf; + Buf_t* cmd; + + r->making++; + if (r->flags & RULE_active) + state.active++; + if (*r->name) + { + z = bind(r); + state.indent++; + report(-1, r->name, "make", r->time); + } + else + z = 0; + buf = buffer(); + cmd = 0; + while (s = input()) + { + for (; *s == ' '; s++); + for (; isdigit(*s); s++); + for (; *s == ' '; s++); + for (u = s; *s && *s != ' '; s++); + if (*s) + { + for (*s++ = 0; *s == ' '; s++); + for (t = s; *s && *s != ' '; s++); + if (*s) + for (*s++ = 0; *s == ' '; s++); + v = s; + } + else + t = v = s; + switch (KEY(u[0], u[1], u[2], u[3])) + { + case KEY('b','i','n','d'): + if ((t[0] == '-' || t[0] == '+') && t[1] == 'l' && (s = require(t, !strcmp(v, "dontcare"))) && strncmp(r->name, "FEATURE/", 8) && strcmp(r->name, "configure.h")) + for (;;) + { + for (t = s; *s && *s != ' '; s++); + if (*s) + *s = 0; + else + s = 0; + if (*t) + { + q = rule(expand(buf, t)); + attributes(q, v); + x = bind(q); + if (z < x) + z = x; + if (q->flags & RULE_error) + r->flags |= RULE_error; + } + if (!s) + break; + for (*s++ = ' '; *s == ' '; s++); + } + continue; + case KEY('d','o','n','e'): + q = rule(expand(buf, t)); + if (q != r) + report(2, "improper done statement", t, (unsigned long)0); + attributes(r, v); + if (cmd && state.active && (state.force || r->time < z || !r->time && !z)) + { + if (state.explain && !state.force) + { + if (!r->time) + fprintf(stderr, "%s [not found]\n", r->name); + else + fprintf(stderr, "%s [%lu] older than prerequisites [%lu]\n", r->name, r->time, z); + } + substitute(buf, use(cmd)); + x = run(r, use(buf)); + if (z < x) + z = x; + } + r->flags |= RULE_made; + if (!(r->flags & (RULE_dontcare|RULE_error|RULE_exists|RULE_generated|RULE_implicit|RULE_virtual))) + dont(r, 0, state.keepgoing); + break; + case KEY('e','x','e','c'): + r->flags |= RULE_generated; + if (r->path) + { + free(r->path); + r->path = 0; + r->time = 0; + } + if (state.active) + { + if (cmd) + add(cmd, '\n'); + else + cmd = buffer(); + append(cmd, v); + } + continue; + case KEY('m','a','k','e'): + q = rule(expand(buf, t)); + if (!q->making) + { + attributes(q, v); + x = make(q); + if (!(q->flags & RULE_ignore) && z < x) + z = x; + if (q->flags & RULE_error) + r->flags |= RULE_error; + } + continue; + case KEY('p','r','e','v'): + q = rule(expand(buf, t)); + if (!q->making) + { + if (!(q->flags & RULE_ignore) && z < q->time) + z = q->time; + if (q->flags & RULE_error) + r->flags |= RULE_error; + state.indent++; + report(-2, q->name, "prev", q->time); + state.indent--; + } + continue; + case KEY('s','e','t','v'): + if (!search(state.vars, t, NiL)) + { + if (*v == '"') + { + s = v + strlen(v) - 1; + if (*s == '"') + { + *s = 0; + v++; + } + } + search(state.vars, t, duplicate(expand(buf, v))); + } + if (!state.probed && t[0] == 'C' && t[1] == 'C' && !t[2]) + { + state.probed = 1; + probe(); + } + continue; + default: + continue; + } + break; + } + drop(buf); + if (cmd) + drop(cmd); + if (*r->name) + { + report(-1, r->name, "done", z); + state.indent--; + } + if (r->flags & RULE_active) + state.active--; + r->making--; + return r->time = z; +} + +/* + * verify that active targets were made + */ + +static int +verify(Dict_item_t* item, void* handle) +{ + Rule_t* r = (Rule_t*)item->value; + + if ((r->flags & (RULE_active|RULE_error|RULE_made)) == RULE_active) + dont(r, 0, 1); + return 0; +} + +/* + * return 1 if name is an initializer + */ + +static int +initializer(char* name) +{ + register char* s; + + if (s = last(name, '/')) + s++; + else + s = name; + return s[0] == 'I' && s[1] == 'N' && s[2] == 'I' && s[3] == 'T'; +} + +/* + * update recursion leaf r and its prerequisites + */ + +static int +update(register Rule_t* r) +{ + register List_t* x; + Buf_t* buf; + + static char cmd[] = "${MAMAKE} -C "; + static char arg[] = " ${MAMAKEARGS}"; + + r->flags |= RULE_made; + if (r->leaf) + r->leaf->flags |= RULE_made; + for (x = r->prereqs; x; x = x->next) + if (x->rule->leaf && !(x->rule->flags & RULE_made)) + update(x->rule); + buf = buffer(); + substitute(buf, cmd); + append(buf, r->name); + substitute(buf, arg); + run(r, use(buf)); + drop(buf); + return 0; +} + +/* + * scan makefile prereqs + */ + +static int +scan(Dict_item_t* item, void* handle) +{ + register Rule_t* r = (Rule_t*)item->value; + register char* s; + register char* t; + register char* u; + register char* w; + Rule_t* q; + int i; + int j; + int k; + int p; + Buf_t* buf; + + static char* files[] = + { + "Nmakefile", + "nmakefile", + "Makefile", + "makefile" + }; + + /* + * drop non-leaf rules + */ + + if (!r->leaf) + return 0; + + /* + * always make initializers + */ + + if (initializer(r->name)) + { + if (!(r->flags & RULE_made)) + update(r); + return 0; + } + buf = buffer(); + for (i = 0; i < elementsof(files); i++) + { + append(buf, r->name); + add(buf, '/'); + append(buf, files[i]); + if (push(use(buf), (Stdio_t*)0, 0)) + { + while (s = input()) + { + j = p = 0; + while (*s) + { + for (k = 1; (i = *s) == ' ' || i == '\t' || i == '"' || i == '\''; s++); + for (t = s; (i = *s) && i != ' ' && i != '\t' && i != '"' && i != '\'' && i != '\\' && i != ':'; s++) + if (i == '/') + t = s + 1; + else if (i == '.' && *(s + 1) != 'c' && *(s + 1) != 'C' && *(s + 1) != 'h' && *(s + 1) != 'H' && t[0] == 'l' && t[1] == 'i' && t[2] == 'b') + *s = 0; + if (*s) + *s++ = 0; + if (!t[0]) + k = 0; + else if ((t[0] == '-' || t[0] == '+') && t[1] == 'l' && t[2]) + { + append(buf, "lib"); + append(buf, t + 2); + t = use(buf); + } + else if (p) + { + if (t[0] == '+' && !t[1]) + p = 2; + else if (p == 1) + { + if (i != ':' || strncmp(s, "command", 7)) + { + append(buf, "lib"); + append(buf, t); + t = use(buf); + } + if (i == ':') + while (*s && (*s == ' ' || *s == '\t')) + s++; + } + } + else if (i == ':') + { + if (j != ':' || !isupper(*t)) + k = 0; + else if (!strcmp(t, "PACKAGE")) + { + p = 1; + k = 0; + } + else + for (u = t; *u; u++) + if (isupper(*u)) + *u = tolower(*u); + else if (!isalnum(*u)) + { + k = 0; + break; + } + } + else if (t[0] != 'l' || t[1] != 'i' || t[2] != 'b') + k = 0; + else + for (u = t + 3; *u; u++) + if (!isalnum(*u)) + { + k = 0; + break; + } + if (k && ((q = (Rule_t*)search(state.leaf, t, NiL)) && q != r || *t++ == 'l' && *t++ == 'i' && *t++ == 'b' && *t && (q = (Rule_t*)search(state.leaf, t, NiL)) && q != r)) + { + for (t = w = r->name; *w; w++) + if (*w == '/') + t = w + 1; + if (t[0] == 'l' && t[1] == 'i' && t[2] == 'b') + t += 3; + for (u = w = q->name; *w; w++) + if (*w == '/') + u = w + 1; + if (strcmp(t, u)) + cons(r, q); + } + j = i; + } + } + pop(); + for (s = 0, w = r->name; *w; w++) + if (*w == '/') + s = w; + if (s) + { + if ((s - r->name) > 3 && *(s - 1) == 'b' && *(s - 2) == 'i' && *(s - 3) == 'l' && *(s - 4) != '/') + { + /* + * foolib : foo : libfoo + */ + + *(s - 3) = 0; + q = (Rule_t*)search(state.leaf, r->name, NiL); + if (q && q != r) + cons(r, q); + for (t = w = r->name; *w; w++) + if (*w == '/') + t = w + 1; + append(buf, "lib"); + append(buf, t); + q = (Rule_t*)search(state.leaf, use(buf), NiL); + if (q && q != r) + cons(r, q); + *(s - 3) = 'l'; + } + else if (((s - r->name) != 3 || *(s - 1) != 'b' || *(s - 2) != 'i' || *(s - 3) != 'l') && (*(s + 1) != 'l' || *(s + 2) != 'i' || *(s + 3) != 'b')) + { + /* + * huh/foobar : lib/libfoo + */ + + s++; + t = s + strlen(s); + while (--t > s) + { + append(buf, "lib/lib"); + appendn(buf, s, t - s); + q = (Rule_t*)search(state.leaf, use(buf), NiL); + if (q && q != r) + cons(r, q); + } + } + } + break; + } + } + drop(buf); + return 0; +} + +/* + * descend into op and its prereqs + */ + +static int +descend(Dict_item_t* item, void* handle) +{ + Rule_t* r = (Rule_t*)item->value; + + if (!state.active && (!(r->flags & RULE_active) || !(r = (Rule_t*)search(state.leaf, r->name, NiL)))) + return 0; + return r->leaf && !(r->flags & RULE_made) ? update(r) : 0; +} + +/* + * append the non-leaf active targets to state.opt + */ + +static int +active(Dict_item_t* item, void* handle) +{ + Rule_t* r = (Rule_t*)item->value; + + if (r->flags & RULE_active) + { + if (r->leaf || search(state.leaf, r->name, NiL)) + state.active = 0; + else + { + add(state.opt, ' '); + append(state.opt, r->name); + } + } + return 0; +} + +/* + * recurse on mamfiles in subdirs matching pattern + */ + +static int +recurse(char* pattern) +{ + register char* s; + register char* t; + Rule_t* r; + Buf_t* buf; + Buf_t* tmp; + struct stat st; + + /* + * first determine the MAM subdirs + */ + + tmp = buffer(); + buf = buffer(); + state.exec = !state.never; + state.leaf = dictionary(); + append(buf, "ls -d "); + append(buf, pattern); + s = use(buf); + push("recurse", popen(s, "r"), STREAM_PIPE); + while (s = input()) + { + append(buf, s); + add(buf, '/'); + append(buf, mamfile); + if (find(tmp, use(buf), &st)) + { + r = rule(s); + if (t = last(r->name, '/')) + t++; + else + t = r->name; + r->leaf = rule(t); + search(state.leaf, t, r); + } + } + pop(); + drop(buf); + drop(tmp); + + /* + * grab the non-leaf active targets + */ + + if (!state.active) + { + state.active = 1; + walk(state.rules, active, NiL); + } + search(state.vars, "MAMAKEARGS", duplicate(use(state.opt) + 1)); + + /* + * scan the makefile and descend + */ + + walk(state.rules, scan, NiL); + state.view = 0; + walk(state.rules, descend, NiL); + return 0; +} + +int +main(int argc, char** argv) +{ + register char** e; + register char* s; + register char* t; + register char* v; + Buf_t* tmp; + int c; + + /* + * initialize the state + */ + + state.id = "mamake"; + state.active = 1; + state.exec = 1; + state.file = mamfile; + state.opt = buffer(); + state.rules = dictionary(); + state.vars = dictionary(); + search(state.vars, "MAMAKE", *argv); + + /* + * parse the options + */ + +#if _PACKAGE_ast + error_info.id = state.id; + for (;;) + { + switch (optget(argv, usage)) + { + case 'e': + append(state.opt, " -e"); + state.explain = 1; + continue; + case 'i': + append(state.opt, " -i"); + state.ignore = 1; + continue; + case 'k': + append(state.opt, " -k"); + state.keepgoing = 1; + continue; + case 'N': + state.never = 1; + /*FALLTHROUGH*/ + case 'n': + append(state.opt, " -n"); + state.exec = 0; + continue; + case 'F': + append(state.opt, " -F"); + state.force = 1; + continue; + case 'K': + continue; + case 'V': + fprintf(stdout, "%s\n", id + 10); + exit(0); + case 'f': + append(state.opt, " -f "); + append(state.opt, opt_info.arg); + state.file = opt_info.arg; + continue; + case 'r': + state.recurse = opt_info.arg; + continue; + case 'C': + state.directory = opt_info.arg; + continue; + case 'D': + append(state.opt, " -D"); + append(state.opt, opt_info.arg); + state.debug = -opt_info.num; + continue; + case 'G': + append(state.opt, " -G"); + search(state.vars, "-debug-symbols", "1"); + continue; + case 'S': + append(state.opt, " -S"); + search(state.vars, "-strip-symbols", "1"); + continue; + case '?': + error(ERROR_USAGE|4, "%s", opt_info.arg); + continue; + case ':': + error(2, "%s", opt_info.arg); + continue; + } + break; + } + if (error_info.errors) + error(ERROR_USAGE|4, "%s", optusage(NiL)); + argv += opt_info.index; +#else + while ((s = *++argv) && *s == '-') + { + if (*(s + 1) == '-') + { + if (!*(s + 2)) + { + append(state.opt, " --"); + argv++; + break; + } + for (t = s += 2; *t && *t != '='; t++); + if (!strncmp(s, "debug-symbols", t - s) && append(state.opt, " -G") || !strncmp(s, "strip-symbols", t - s) && append(state.opt, " -S")) + { + if (*t) + { + v = t + 1; + if (t > s && *(t - 1) == '+') + t--; + c = *t; + *t = 0; + } + else + { + c = 0; + v = "1"; + } + search(state.vars, s - 1, v); + if (c) + *t = c; + continue; + } + usage(); + break; + } + for (;;) + { + switch (*++s) + { + case 0: + break; + case 'e': + append(state.opt, " -e"); + state.explain = 1; + continue; + case 'i': + append(state.opt, " -i"); + state.ignore = 1; + continue; + case 'k': + append(state.opt, " -k"); + state.keepgoing = 1; + continue; + case 'N': + state.never = 1; + /*FALLTHROUGH*/ + case 'n': + append(state.opt, " -n"); + state.exec = 0; + continue; + case 'F': + append(state.opt, " -F"); + state.force = 1; + continue; + case 'G': + append(state.opt, " -G"); + search(state.vars, "-debug-symbols", "1"); + continue; + case 'K': + continue; + case 'S': + append(state.opt, " -S"); + search(state.vars, "-strip-symbols", "1"); + continue; + case 'V': + fprintf(stdout, "%s\n", id + 10); + exit(0); + case 'f': + case 'r': + case 'C': + case 'D': + t = s; + if (!*++s && !(s = *++argv)) + { + report(2, "option value expected", t, (unsigned long)0); + usage(); + } + else + switch (*t) + { + case 'f': + append(state.opt, " -f "); + append(state.opt, s); + state.file = s; + break; + case 'r': + state.recurse = s; + break; + case 'C': + state.directory = s; + break; + case 'D': + append(state.opt, " -D"); + append(state.opt, s); + state.debug = -atoi(s); + break; + } + break; + default: + report(2, "unknown option", s, (unsigned long)0); + case '?': + usage(); + break; + } + break; + } + } +#endif + + /* + * load the environment + */ + + for (e = environ; s = *e; e++) + for (t = s; *t; t++) + if (*t == '=') + { + *t = 0; + search(state.vars, s, t + 1); + *t = '='; + break; + } + + /* + * grab the command line targets and variable definitions + */ + + while (s = *argv++) + { + for (t = s; *t; t++) + if (*t == '=') + { + v = t + 1; + if (t > s && *(t - 1) == '+') + t--; + c = *t; + *t = 0; + search(state.vars, s, v); + tmp = buffer(); + append(tmp, s); + append(tmp, ".FORCE"); + search(state.vars, use(tmp), v); + drop(tmp); + *t = c; + break; + } + if (!*t) + { + /* + * handle a few targets for nmake compatibility + */ + + if (*s == 'e' && !strncmp(s, "error 0 $(MAKEVERSION:", 22)) + exit(1); + if (*s == 'r' && !strcmp(s, "recurse") || *s == 'c' && !strncmp(s, "cc-", 3)) + continue; + rule(s)->flags |= RULE_active; + state.active = 0; + if (state.recurse) + continue; + } + add(state.opt, ' '); + add(state.opt, '\''); + append(state.opt, s); + add(state.opt, '\''); + } + + /* + * initialize the views + */ + + if (state.directory && chdir(state.directory)) + report(3, "cannot change working directory", NiL, (unsigned long)0); + view(); + + /* + * recursion drops out here + */ + + if (state.recurse) + return recurse(state.recurse); + + /* + * read the mamfile(s) and bring the targets up to date + */ + + search(state.vars, "MAMAKEARGS", duplicate(use(state.opt) + 1)); + push(state.file, (Stdio_t*)0, STREAM_MUST); + make(rule("")); + pop(); + + /* + * verify that active targets were made + */ + + if (!state.active && !state.verified) + walk(state.rules, verify, NiL); + + /* + * done + */ + + return state.errors != 0; +} diff --git a/src/cmd/INIT/mamake.rt b/src/cmd/INIT/mamake.rt new file mode 100644 index 0000000..5f7603d --- /dev/null +++ b/src/cmd/INIT/mamake.rt @@ -0,0 +1,40 @@ +NOTE regression tests for the mamake command + +UNIT mamake + +TEST macros + +DATA Mamfile <<'!' +info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05 +setv DEFINED defined +setv EMPTY +make all + +exec - echo DEFINED ${DEFINED} +exec - echo DEFINED:VALUE ${DEFINED:VALUE} +exec - echo DEFINED:-VALUE ${DEFINED:-VALUE} +exec - echo DEFINED=VALUE ${DEFINED=VALUE} +exec - echo DEFINED[VALUE] ${DEFINED[VALUE]} +exec - echo DEFINED.COMPONENT ${DEFINED.COMPONENT} +exec - echo DEFINED.COMPONENT[VALUE] ${DEFINED.COMPONENT[VALUE]} + +exec - echo EMPTY ${EMPTY} +exec - echo EMPTY:VALUE ${EMPTY:VALUE} +exec - echo EMPTY:-VALUE ${EMPTY:-VALUE} +exec - echo EMPTY=VALUE ${EMPTY=VALUE} +exec - echo EMPTY[VALUE] ${EMPTY[VALUE]} +exec - echo EMPTY.COMPONENT ${EMPTY.COMPONENT} +exec - echo EMPTY.COMPONENT[VALUE] ${EMPTY.COMPONENT[VALUE]} + +exec - echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +exec - echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +exec - echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +exec - echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +exec - echo __NoT_DeFiNeD__[VALUE] ${__NoT_DeFiNeD__[VALUE]} +exec - echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT} +exec - echo __NoT_DeFiNeD__.COMPONENT[VALUE] ${__NoT_DeFiNeD__.COMPONENT[VALUE]} + +done all generated virtual +! + +EXEC -n diff --git a/src/cmd/INIT/mamake.tst b/src/cmd/INIT/mamake.tst new file mode 100644 index 0000000..3c7f94d --- /dev/null +++ b/src/cmd/INIT/mamake.tst @@ -0,0 +1,63 @@ +# : : generated from mamake.rt by mktest : : # + +# regression tests for the mamake command + +UNIT mamake + +TEST 01 macros + + EXEC -n + INPUT -n - + INPUT Mamfile $'info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05 +setv DEFINED defined +setv EMPTY +make all + +exec - echo DEFINED ${DEFINED} +exec - echo DEFINED:VALUE ${DEFINED:VALUE} +exec - echo DEFINED:-VALUE ${DEFINED:-VALUE} +exec - echo DEFINED=VALUE ${DEFINED=VALUE} +exec - echo DEFINED[VALUE] ${DEFINED[VALUE]} +exec - echo DEFINED.COMPONENT ${DEFINED.COMPONENT} +exec - echo DEFINED.COMPONENT[VALUE] ${DEFINED.COMPONENT[VALUE]} + +exec - echo EMPTY ${EMPTY} +exec - echo EMPTY:VALUE ${EMPTY:VALUE} +exec - echo EMPTY:-VALUE ${EMPTY:-VALUE} +exec - echo EMPTY=VALUE ${EMPTY=VALUE} +exec - echo EMPTY[VALUE] ${EMPTY[VALUE]} +exec - echo EMPTY.COMPONENT ${EMPTY.COMPONENT} +exec - echo EMPTY.COMPONENT[VALUE] ${EMPTY.COMPONENT[VALUE]} + +exec - echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +exec - echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +exec - echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +exec - echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +exec - echo __NoT_DeFiNeD__[VALUE] ${__NoT_DeFiNeD__[VALUE]} +exec - echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT} +exec - echo __NoT_DeFiNeD__.COMPONENT[VALUE] ${__NoT_DeFiNeD__.COMPONENT[VAL'\ +$'UE]} + +done all generated virtual' + OUTPUT - $'echo DEFINED defined +echo DEFINED:VALUE +echo DEFINED:-VALUE +echo DEFINED=VALUE defined +echo DEFINED[VALUE] ${DEFINED[VALUE]} +echo DEFINED.COMPONENT +echo DEFINED.COMPONENT[VALUE] ${DEFINED.COMPONENT[VALUE]} +echo EMPTY +echo EMPTY:VALUE ${EMPTY:VALUE} +echo EMPTY:-VALUE ${EMPTY:-VALUE} +echo EMPTY=VALUE +echo EMPTY[VALUE] ${EMPTY[VALUE]} +echo EMPTY.COMPONENT +echo EMPTY.COMPONENT[VALUE] ${EMPTY.COMPONENT[VALUE]} +echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +echo __NoT_DeFiNeD__[VALUE] ${__NoT_DeFiNeD__[VALUE]} +echo __NoT_DeFiNeD__.COMPONENT +echo __NoT_DeFiNeD__.COMPONENT[VALUE] ${__NoT_DeFiNeD__.COMPONENT[VALUE]}' + ERROR -n - diff --git a/src/cmd/INIT/mamprobe.sh b/src/cmd/INIT/mamprobe.sh new file mode 100644 index 0000000..6933bea --- /dev/null +++ b/src/cmd/INIT/mamprobe.sh @@ -0,0 +1,267 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +### this script contains archaic constructs that work with all sh variants ### +# mamprobe - generate MAM cc probe info +# Glenn Fowler + +case $-:$BASH_VERSION in +*x*:[0123456789]*) : bash set -x is broken :; set +ex ;; +esac + +command=mamprobe + +# check the options + +opt= + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: mamprobe (AT&T Labs Research) 2011-02-11 $ +] +[+NAME?mamprobe - generate MAM cc probe info] +[+DESCRIPTION?\bmamprobe\b generates MAM (make abstract machine) \bcc\b(1) + probe information for use by \bmamake\b(1). \acc-path\a is the + absolute path of the probed compiler and \ainfo-file\a is where + the information is placed. \ainfo-file\a is usually + \b$INSTALLROOT/lib/probe/C/mam/\b\ahash\a, where \ahash\a is a hash + of \acc-path\a. Any \ainfo-file\a directories are created if needed. + If \ainfo-file\a is \b-\b then the probe information is written to + the standard output.] +[+?\bmamprobe\b and \bmamake\b are used in the bootstrap phase of + \bpackage\b(1) installation before \bnmake\b(1) is built. The + probed variable names are the \bnmake\b(1) names with a \bmam_\b + prefix, \bCC\b converted to \bcc\b, and \b.\b converted to \b_\b. + Additional variables are:]{ + [+_hosttype_?the \bpackage\b(1) host type] + [+mam_cc_L?\b-L\b\adir\a supported] + [+STDCAT?command to execute for \bcat\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCHMOD?command to execute for \bchmod\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCMP?command to execute for \bcmp\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDCP?command to execute for \bcp\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDED?command to execute for \bed\b(1) or \bex\b(1)] + [+STDEDFLAGS?flags for \bSTDED\b] + [+STDLN?command to execute for \bln\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDMV?command to execute for \bmv\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] + [+STDRM?command to execute for \brm\b(1); prefixed by + \bexecrate\b(1) on \b.exe\b challenged systems] +} +[d:debug?Enable probe script debug trace.] + +info-file cc-path + +[+SEE ALSO?\bexecrate\b(1), \bpackage\b(1), \bmamake\b(1), \bnmake\b(1), + \bprobe\b(1)] +' + while getopts -a "$command" "$USAGE" OPT + do case $OPT in + d) opt=-d ;; + esac + done + shift `expr $OPTIND - 1` + ;; +*) while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + -) break + ;; + -d) opt=-d + ;; + -*) echo $command: $1: unknown option >&2 + ;; + *) break + ;; + esac + set '' + break + done + ;; +esac + +# check the args + +case $1 in +-) ;; +/*) ;; +*) set '' ;; +esac +case $2 in +/*) ;; +*) set '' ;; +esac +case $# in +0|1) echo "Usage: $command info-file cc-path" >&2; exit 2 ;; +esac +info=$1 +shift +cc=$* + +# find the make probe script + +ifs=${IFS-' + '} +IFS=: +set $PATH +IFS=$ifs +script=lib/probe/C/make/probe +while : +do case $# in + 0) echo "$0: ../$script: probe script not found on PATH" >&2 + exit 1 + ;; + esac + case $1 in + '') continue ;; + esac + makeprobe=`echo $1 | sed 's,[^/]*$,'$script,` + if test -x $makeprobe + then break + fi + shift +done + +# create the info dir if necessary + +case $info in +/*) i=X$info + ifs=${IFS-' + '} + IFS=/ + set $i + IFS=$ifs + while : + do i=$1 + shift + case $i in + X) break ;; + esac + done + case $info in + //*) path=/ ;; + *) path= ;; + esac + while : + do case $# in + 0|1) break ;; + esac + comp=$1 + shift + case $comp in + '') continue ;; + esac + path=$path/$comp + if test ! -d $path + then mkdir $path || exit + fi + done + ;; +esac + +# generate info in a tmp file and rename when finished + +case $info in +-) ;; +*) tmp=/tmp/mam$$ + trap "exec >/dev/null; rm -f $tmp" 0 1 2 3 15 + exec > $tmp + echo "probing C language processor $cc for mam information" >&2 + ;; +esac + +echo "note generated by $0 for $cc" + +( + set '' $opt $cc + shift + . $makeprobe "$@" + + case " $CC_DIALECT " in + *" -L "*) echo "CC.L = 1" ;; + esac + +) | sed \ + -e '/^CC\./!d' \ + -e 's/^CC./setv mam_cc_/' \ + -e 's/^\([^=.]*\)\./\1_/' \ + -e 's/^\([^=.]*\)\./\1_/' \ + -e 's/ =//' \ + -e 's/\$("\([^"]*\)")/\1/g' \ + -e 's/\$(\([^)]*\))/${\1}/g' \ + -e 's/\${CC\./${mam_cc_}/g' + +echo 'setv _hosttype_ ${mam_cc_HOSTTYPE}' + +# STD* are standard commands/flags with possible execrate(1) + +if ( +ed < /dev/null 2>&1 +then STDED=ed +else STDED=ex +fi +STDEDFLAGS=- +set STDCAT cat STDCHMOD chmod STDCMP cmp STDCP cp STDLN ln STDMV mv STDRM rm +while : +do case $# in + 0|1) break ;; + esac + p=$2 + for d in /bin /usr/bin /usr/sbin + do if test -x $d/$p + then p=$d/$p + break + fi + done + eval $1=\$p + shift + shift +done +if execrate +then for n in STDCAT STDCHMOD STDCMP STDCP STDLN STDMV STDRM + do eval $n=\"execrate \$$n\" + done +fi +for n in STDCAT STDCHMOD STDCMP STDCP STDED STDEDFLAGS STDLN STDMV STDRM +do eval echo setv \$n \$$n +done + +# all done + +case $info in +-) ;; +*) exec >/dev/null + test -f $info && rm -f $info + cp $tmp $info + chmod -w $info + ;; +esac diff --git a/src/cmd/INIT/mkdir.sh b/src/cmd/INIT/mkdir.sh new file mode 100644 index 0000000..c929e95 --- /dev/null +++ b/src/cmd/INIT/mkdir.sh @@ -0,0 +1,80 @@ +#!/bin/sh +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: mkdir for systems that do not support -p : 2002-09-01 : +MKDIR=/bin/mkdir +CHMOD=chmod +mode= +parents= +while : +do case $1 in + -m) case $# in + 1) echo "mkdir: -m: mode argument expected" >&2 + exit 1 + ;; + esac + shift + mode=$1 + ;; + -m*) mode=`echo X$1 | sed 's/X-m//'` + ;; + -p) parents=1 + ;; + *) break + ;; + esac + shift +done +if test "" != "$parents" +then for d + do if test ! -d $d + then ifs=${IFS-' + '} + IFS=/ + set '' $d + IFS=$ifs + shift + dir=$1 + shift + if test -n "$dir" -a ! -d "$dir" + then $MKDIR "$dir" || exit 1 + if test "" != "$mode" + then $CHMOD "$mode" "$dir" || exit 1 + fi + fi + for d + do dir=$dir/$d + if test ! -d "$dir" + then $MKDIR "$dir" || exit 1 + if test "" != "$mode" + then $CHMOD "$mode" "$dir" || exit 1 + fi + fi + done + fi + done +else $MKDIR "$@" || exit 1 + if test "" != "$mode" + then for d + do $CHMOD "$mode" "$d" || exit 1 + done + fi +fi +exit 0 diff --git a/src/cmd/INIT/mktest.sh b/src/cmd/INIT/mktest.sh new file mode 100755 index 0000000..f24183e --- /dev/null +++ b/src/cmd/INIT/mktest.sh @@ -0,0 +1,641 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: mktest - generate regress or shell regression test scripts + +command=mktest +stdin=8 +stdout=9 +PREFIX=test +STYLE=regress +WIDTH=80 + +eval "exec $stdout>&1" + +case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: mktest (AT&T Labs Research) 2010-08-11 $ +] +'$USAGE_LICENSE$' +[+NAME?mktest - generate a regression test scripts] +[+DESCRIPTION?\bmktest\b generates regression test scripts from test + template commands in the \aunit\a.\brt\b file. The generated test + script writes temporary output to '$PREFIX$'\aunit\a.tmp and compares + it to the expected output in '$PREFIX$'\aunit\a.out. Run the test + script with the \b--accept\b option to (re)generate the + '$PREFIX$'\aunit\a.out.] +[s:style?The script style:]:[style:='$STYLE$'] + { + [+regress?\bregress\b(1) command input.] + [+shell?Standalone test shell script.] + } +[w:width?Set the output format width to approximately + \awidth\a.]:[width:='$WIDTH$'] + +unit.rt [ unit [ arg ... ] ] + +[+INPUT FILES?The regression test command file \aunit\a\b.rt\b is a + \bksh\b(1) script that makes calls to the following functions:] + { + [+DATA \afile\a [ - | [ options ]] data]]?Create input data + \afile\a that is empty (-) or contains \adata\a subject to + \bprint\b(1) \aoptions\a or that is a copy of the DATA command + standard input. Set \afile\a to \b-\b to name the standard + input.] + [+DIAGNOSTICS?Diagnostic messages of unspecified format are + expected.] + [+DO \acommand\a [ \aarg\a ... ]]?Execute \acommand\a if the + current test is active.] + [+EXEC [ \aarg\a ... ]]?Run the command under test with + optional arguments. If the standard input is not specified then + the standard input of the previous EXEC is used. The standard + input of the first EXEC in a TEST group is an empty regular + file.] + [+EXPORT \aname\a=\avalue\a ...?Export list for subsequent + commands in the TEST group or for all TEST groups if before + the first TEST group.] + [+IGNORESPACE [ 0 | 1 ] + ?Ignore space differences when comparing expected output.] + [+KEEP \apattern\a ...?File match patterns of files to retain + between TEST groups.] + [+NOTE \acomment\a?\acomment\a is added to the current test + script.] + [+PROG \acommand\a [ \aarg\a ... ]]?Run \acommand\a with + optional arguments.] + [+TEST [ \anumber\a ]] [ \adescription\a ... ]]?Define a new + test group with optional \anumber\a and \adescripion\a.] + [+TWD [ \adir\a ... ]]?Set the temporary test dir to \adir\a. + The default is \aunit\a\b.tmp\b, where \aunit\a is the test + input file sans directory and suffix. If \adir\a matches \b/*\b + then it is the directory name; if \adir\a is non-null then the + prefix \b${TMPDIR:-/tmp}\b is added; otherwise if \adir\a is + omitted then + \b${TMPDIR:-/tmp}/tst-\b\aunit\a-$$-$RANDOM.\b\aunit\a is + used.] + [+UMASK [ \amask\a ]]?Run subsequent tests with \bumask\b(1) + \amask\a. If \amask\a is omitted then the original \bumask\b is + used.] + [+UNIT \acommand\a [ \aarg\a ... ]]?Define the command and + optional default arguments to be tested. \bUNIT\b explicitly + overrides the default command name derived from the test script + file name.] + [+WIDTH \awidth\a?Set the output format width to approximately + \awidth\a.] + } +[+SEE ALSO?\bregress\b(1), \bksh\b(1)] +' + ;; +*) ARGV0="" + USAGE='s: unit.rt [ arg ... ]' + ;; +esac + +typeset ARG SCRIPT UNIT TEMP=${TMPDIR:-/tmp}/$command.$$.tmp WORK +typeset IO INPUT INPUT_N OUTPUT OUTPUT_N ERROR ERROR_N KEEP +typeset -C STATE +typeset -A DATA STATE.RESET REMOVE FORMAT +integer KEEP_UNIT=0 SCRIPT_UNIT=0 TEST=0 CODE=0 EXIT=0 ACCEPT=0 DIAGNOSTICS=0 code + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + s) case $OPTARG in + regress|shell) + STYLE=$OPTARG + ;; + *) print -u2 -r -- $command: --style=$OPTARG: regress or shell expected + exit 1 + ;; + esac + ;; + w) WIDTH=$OPTARG + ;; + *) OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 + ;; + esac +done +shift $OPTIND-1 + +typeset SINGLE= quote='%${SINGLE}..${WIDTH}q' + +if [[ $1 == - ]] +then shift +fi +if (( ! $# )) +then + print -u2 -r -- $command: test command script path expected + exit 1 +fi +SCRIPT=$1 +shift +if [[ ! -r $SCRIPT ]] +then print -u2 -r -- $command: $SCRIPT: cannot read + exit 1 +fi +(ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0 +if (( $# )) +then set -A UNIT -- "$@" + KEEP_UNIT=1 +else ARG=${SCRIPT##*/} + set -A UNIT -- "${ARG%.*}" +fi +WORK=${UNIT[0]}.tmp +rm -rf $WORK +mkdir $WORK || exit +export PATH=$PWD:$PATH + +function LINE +{ + if [[ $STYLE == regress ]] + then print -u$stdout + fi +} + +function NOTE +{ + case $STYLE in + regress)LINE + print -u$stdout -r -- '#' "$@" + ;; + shell) print -u$stdout -r -f ": $QUOTE"$'\n' -- "$*" + ;; + esac +} + +function UNIT +{ + (( KEEP_UNIT )) || set -A UNIT -- "$@" + case $STYLE in + regress)LINE + print -u$stdout -r -f $'UNIT' + for ARG in "$@" + do print -u$stdout -r -f " $QUOTE" -- "$ARG" + done + print -u$stdout + ;; + shell) print -u$stdout -r -f $'set x' + for ARG in "$@" + do print -u$stdout -r -f " $QUOTE" -- "$ARG" + done + print -u$stdout + print -u$stdout shift + ;; + esac +} + +function TEST +{ + typeset i + typeset -A REM + if (( ${#STATE.RESET[@]} )) + then unset ${!STATE.RESET[@]} + case $STYLE in + shell) print -u$stdout -r -- unset ${!STATE.RESET[@]} ;; + esac + unset STATE.RESET + typeset -A STATE.RESET + fi + if (( ${#REMOVE[@]} )) + then rm -f -- "${!REMOVE[@]}" + case $STYLE in + shell) print -u$stdout -r -f $'rm -f' + for i in ${!REMOVE[@]} + do print -u$stdout -r -f " $QUOTE" "$i" + done + print -u$stdout + ;; + esac + for i in ${!REMOVE[@]} + do unset REMOVE[$i] + done + fi + rm -rf $WORK/* + if [[ $1 == +([0-9]) ]] + then TEST=${1##0} + shift + else ((TEST++)) + fi + LINE + case $STYLE in + regress)print -u$stdout -r -f "TEST %02d $QUOTE"$'\n' -- $TEST "$*" + ;; + shell) print -u$stdout -r -f ": TEST %02d $QUOTE"$'\n' -- $TEST "$*" + ;; + esac + : > $TEMP.INPUT > $TEMP.in + INPUT= + INPUT_N= + OUTPUT= + OUTPUT_N= + ERROR= + ERROR_N= + UMASK=$UMASK_ORIG + UMASK_DONE=$UMASK + CODE=0 +} + +function TWD +{ + case $STYLE in + regress)LINE + print -u$stdout -r -f $'TWD' + for ARG in "$@" + do print -u$stdout -r -f " $QUOTE" -- "$ARG" + done + print -u$stdout + ;; + esac +} + +function RUN +{ + typeset i n p op unit sep output=1 error=1 exitcode=1 + op=$1 + shift + while : + do case $1 in + ++NOOUTPUT) output= ;; + ++NOERROR) error= ;; + ++NOEXIT) exitcode= ;; + ++*) print -u2 -r -- $command: $0: $1: unknown option; exit 1 ;; + *) break ;; + esac + shift + done + if [[ $op == PROG ]] + then unit=$1 + shift + elif (( ! ${#UNIT[@]} )) + then print -u2 -r -- $command: $SCRIPT: UNIT statement or operand expected + exit 1 + fi + LINE + case $STYLE in + regress)if [[ $op == PROG ]] + then print -u$stdout -r -f $'\t'"$op"$'\t'"$unit" + sep=$' ' + else print -u$stdout -r -f $'\t'"$op" + sep=$'\t' + fi + for ARG in "$@" + do LC_CTYPE=C print -u$stdout -r -f "$sep$QUOTE" -- "$ARG" + sep=$' ' + done + print -u$stdout + [[ ${DATA[-]} || /dev/fd/0 -ef /dev/fd/$stdin ]] || cat > $TEMP.in + IO=$(cat $TEMP.in; print :) + if [[ $IO == ?*$'\n:' ]] + then IO=${IO%??} + n= + else IO=${IO%?} + n=-n + fi + { + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK + cd $WORK + if [[ $op == PROG ]] + then "$unit" "$@" + code=$? + else "${UNIT[@]}" "$@" + code=$? + fi + cd .. + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK_ORIG + } < $TEMP.in > $TEMP.out 2> $TEMP.err + if [[ $IO != "$INPUT" || $n != "$INPUT_N" ]] + then INPUT=$IO + INPUT_N=$n + if [[ ${FORMAT[-]} ]] + then print -u$stdout -n -r -- $'\t\tINPUT' + print -u$stdout -r -f " $QUOTE" -- "${FORMAT[-]}" + print -u$stdout -r -f " $QUOTE" -- - + unset FORMAT[-] + else print -u$stdout -n -r -- $'\t\tINPUT' $n - + [[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO" + fi + print -u$stdout + unset DATA[-] + fi + for i in ${!DATA[@]} + do if [[ ${FORMAT[$i]} ]] + then print -u$stdout -n -r -- $'\t\tINPUT' + print -u$stdout -r -f " $QUOTE" -- "${FORMAT[$i]}" + print -u$stdout -r -f " $QUOTE" -- "$i" + unset FORMAT[$i] + else case $i in + -) p=$TEMP.in ;; + *) p=$WORK/$i ;; + esac + IO=$(cat $p; print :) + if [[ $IO == ?*$'\n:' ]] + then IO=${IO%??} + n= + else IO=${IO%?} + n=-n + fi + print -u$stdout -n -r -- $'\t\tINPUT' $n + print -u$stdout -r -f " $QUOTE" -- "$i" + [[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO" + fi + print -u$stdout + unset DATA[$i] + done + IO=$(cat $TEMP.out; print :) + if [[ $IO == ?*$'\n:' ]] + then IO=${IO%??} + n= + else IO=${IO%?} + n=-n + fi + if [[ $IO != "$OUTPUT" || $n != "$OUTPUT_N" ]] + then OUTPUT=$IO + OUTPUT_N=$n + if [[ $output ]] + then if [[ ! -s $TEMP.out ]] + then print -u$stdout -n -r -- $'\t\tOUTPUT' - + elif cmp -s $TEMP.in $TEMP.out + then OUTPUT=not-$OUTPUT + print -u$stdout -n -r -- $'\t\tSAME OUTPUT INPUT' + else print -u$stdout -n -r -- $'\t\tOUTPUT' $n - + [[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO" + fi + print -u$stdout + fi + fi + IO=$(cat $TEMP.err; print :) + IO=${IO//$command\[*([0-9])\]:\ .\[*([0-9])\]:\ @(EXEC|PROG)\[*([0-9])\]:\ /} + if [[ $IO == ?*$'\n:' ]] + then IO=${IO%??} + n= + else IO=${IO%?} + n=-n + fi + if [[ $IO != "$ERROR" || $n != "$ERROR_N" ]] + then ERROR=$IO + ERROR_N=$n + if [[ $error ]] + then print -u$stdout -n -r -- $'\t\tERROR' $n - + [[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO" + print -u$stdout + fi + fi + case $output:$error in + :) OUTPUT= + OUTPUT_N= + ERROR= + ERROR_N= + print -u$stdout -r -- $'\t\tIGNORE OUTPUT ERROR' + ;; + :1) OUTPUT= + OUTPUT_N= + print -u$stdout -r -- $'\t\tIGNORE OUTPUT' + ;; + 1:) ERROR= + ERROR_N= + print -u$stdout -r -- $'\t\tIGNORE ERROR' + ;; + esac + if [[ $UMASK_DONE != $UMASK ]] + then UMASK_DONE=$UMASK + print -u$stdout -r -f $'\t\tUMASK %s\n' $UMASK + fi + if (( code != CODE )) + then (( CODE=code )) + if [[ $exitcode ]] + then print -u$stdout -r -f $'\t\tEXIT %d\n' $CODE + fi + fi + ;; + shell) [[ $UMASK != $UMASK_ORIG ]] && print -u$stdout -r -f "{ umask $UMASK; " + if [[ $op == PROG ]] + then print -u$stdout -r -f $'"'"$unit"$'"' + else print -u$stdout -r -f $'"$@"' + fi + for ARG in "$@" + do print -u$stdout -r -f " $QUOTE" -- "$ARG" + done + [[ $UMASK != $UMASK_ORIG ]] && print -u$stdout -r -f "umask $UMASK_ORIG; } " + if [[ ! $output ]] + then print -u$stdout -r -f " >/dev/null" + fi + if [[ ! $error ]] + then if [[ ! $output ]] + then print -u$stdout -r -f " 2>&1" + else print -u$stdout -r -f " 2>/dev/null" + fi + fi + IO=$(cat) + if [[ $IO ]] + then print -u$stdout -r -- "<<'!TEST-INPUT!'" + print -u$stdout -r -- "$IO" + print -u$stdout -r -- !TEST-INPUT! + else print -u$stdout + fi + if [[ $exitcode ]] + then print -u$stdout -r -- $'CODE=$?\ncase $CODE in\n0) ;;\n*) echo exit status $CODE ;;\nesac' + fi + ;; + esac +} + +function DO +{ + LINE + print -r $'\t'DO "$@" +} + +function EXEC +{ + RUN EXEC "$@" +} + +function DATA +{ + typeset f p o + f=$1 + shift + case $f in + -) p=$TEMP.in ;; + *) p=$WORK/$f ;; + esac + case $1 in + '') cat ;; + -) ;; + *) print -r "$@" ;; + esac > $p + DATA[$f]=1 + if (( $# == 1 )) && [[ $1 == -?* ]] + then FORMAT[$f]=$1 + else FORMAT[$f]= + fi + if [[ $f != $KEEP ]] + then REMOVE[$f]=1 + fi + if [[ $STYLE == shell ]] + then { + print -r -f "cat > $QUOTE <<'!TEST-INPUT!'"$'\n' -- "$f" + cat "$p" + print -r -- !TEST-INPUT! + } >&$stdout + fi +} + +function KEEP +{ + typeset p + for p + do if [[ $KEEP ]] + then KEEP=$KEEP'|' + fi + KEEP=$KEEP$p + done +} + +function DIAGNOSTICS +{ + LINE + case $STYLE in + regress) print -u$stdout -r $'DIAGNOSTICS' ;; + shell) DIAGNOSTICS=1 ;; + esac +} + +function EXPORT +{ + typeset x n v + LINE + case $STYLE in + regress) print -u$stdout -r -f $'EXPORT' ;; + shell) print -u$stdout -r -f $'export' ;; + esac + for x + do n=${x%%=*} + v=${x#*=} + export "$x" + print -u$stdout -r -f " %s=$QUOTE" "$n" "$v" + (( TEST )) && STATE.RESET["$n"]=1 + done + print -u$stdout +} + +function PROG +{ + RUN PROG "$@" +} + +function WIDTH +{ + WIDTH=${1:-80} + eval QUOTE='"'$quote'"' +} + +function IGNORESPACE +{ + IGNORESPACE=-b + LINE + print -u$stdout -r IGNORESPACE +} + +function UMASK # [ mask ] +{ + [[ $UMASK_ORIG ]] || UMASK_ORIG=$(umask) + UMASK=$1 + [[ $UMASK ]] || UMASK=$UMASK_ORIG +} + +trap 'CODE=$?; rm -rf $TEMP.* $WORK; exit $CODE' 0 1 2 3 15 + +typeset IGNORESPACE UMASK UMASK_ORIG UMASK_DONE +UMASK_ORIG=$(umask) +IFS=$IFS$'\n' + +print -u$stdout -r "# : : generated from $SCRIPT by $command : : #" +case $STYLE in +shell) cat <&2 <&2 + exit 1 + ;; + *) break + ;; + esac + shift +done +export COLUMNS=80 +{ +! + ;; +esac + +export COLUMNS=80 + +case $STYLE in +shell) SINGLE='#' + eval QUOTE='"'$quote'"' + . $SCRIPT < /dev/null | sed -e $'s,\\\\n,\n,g' -e $'s,\\\\t,\t,g' -e $'s,\\$\',\',g' + ;; +*) eval QUOTE='"'$quote'"' + : > $TEMP.INPUT > $TEMP.in + eval "exec $stdin<$TEMP.INPUT" + . $SCRIPT <&$stdin + ;; +esac + +case $STYLE in +shell) cat < $PREFIX${UNIT[0]}.tmp 2>&1 < /dev/null +case \$ACCEPT in +0) if grep ' $' $PREFIX${UNIT[0]}.tmp >/dev/null + then mv $PREFIX${UNIT[0]}.tmp $PREFIX${UNIT[0]}.junk + sed 's/ $//' < $PREFIX${UNIT[0]}.junk > $PREFIX${UNIT[0]}.tmp + rm -f $PREFIX${UNIT[0]}.junk + fi + if cmp -s $PREFIX${UNIT[0]}.tmp $PREFIX${UNIT[0]}.out + then echo ${UNIT[0]} tests PASSED + rm -f $PREFIX${UNIT[0]}.tmp + else echo ${UNIT[0]} tests FAILED + diff $IGNORESPACE $PREFIX${UNIT[0]}.tmp $PREFIX${UNIT[0]}.out + fi + ;; + +*) mv $PREFIX${UNIT[0]}.tmp $PREFIX${UNIT[0]}.out + ;; +esac +! + ;; +esac diff --git a/src/cmd/INIT/mprobe.sh b/src/cmd/INIT/mprobe.sh new file mode 100644 index 0000000..975ebb1 --- /dev/null +++ b/src/cmd/INIT/mprobe.sh @@ -0,0 +1,30 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: mam probe script +opt= +while : +do case $1 in + -d) opt=-d ;; + -*) ;; + *) break ;; + esac + shift +done +mamprobe $opt - "$1" diff --git a/src/cmd/INIT/nsl.c b/src/cmd/INIT/nsl.c new file mode 100644 index 0000000..e961e01 --- /dev/null +++ b/src/cmd/INIT/nsl.c @@ -0,0 +1,31 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lnsl + */ + + +extern void* gethostbyname(); + +int +main() +{ + return gethostbyname(0) == 0; +} diff --git a/src/cmd/INIT/p.c b/src/cmd/INIT/p.c new file mode 100644 index 0000000..387c4bb --- /dev/null +++ b/src/cmd/INIT/p.c @@ -0,0 +1,24 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for prototyping cc + */ + +int main(int argc, char** argv) { return argc || argv; } diff --git a/src/cmd/INIT/package.mk b/src/cmd/INIT/package.mk new file mode 100644 index 0000000..921fa2d --- /dev/null +++ b/src/cmd/INIT/package.mk @@ -0,0 +1,1537 @@ +/* + * source and binary package support + * + * @(#)package.mk (AT&T Research) 2012-02-14 + * + * usage: + * + * cd $INSTALLROOT/lib/package + * nmake -f name [closure] [cyg|exp|lcl|pkg|rpm|tgz] [base|delta] type + * + * where: + * + * name package description file or component + * + * type source build source archive, generates + * $(PACKAGEDIR)/name.version.release.suffix + * binary build binary archive, generates + * $(PACKAGEDIR)/name.version.hosttype.release.suffix + * runtime build binary archive, generates + * $(PACKAGEDIR)/name-run.version.hosttype.release.suffix + * + * NOTE: $(PACKAGEDIR) is in the lowest view and is shared among all views + * + * generated archive member files are $(PACKAGEROOT) relative + * + * main assertions: + * + * NAME [ name=value ] :PACKAGE: component ... + * :OMIT: component ... + * :LICENSE: license-class-pattern + * :CATEGORY: category-id ... + * :COVERS: package ... + * :REQURES: package ... + * :INDEX: index description line + * :DESCRIPTION: + * [ verbose description ] + * :DETAILS: style + * :README: + * readme lines + * :EXPORT: + * name=value + * target :INSTALL: [ source ] + * + * option variables, shown with default values + * + * format=tgz + * archive format + * + * version=YYYY-MM-DD + * package base version (overrides current date) + * + * release=YYYY-MM-DD + * package delta release (overrides current date) + * + * license=type.class + * :LICENSE: type.class pattern override + * + * notice=1 + * include the conspicuous empty notice file + * + * copyright=0 + * do not prepend source file copyright notice + * + * strip=0 + * don't strip non-lcl binary package members + * + * variants=pattern + * include variants matching pattern in binary packages + * + * incremental=[source:1 binary:0] + * if a base archive is generated then also generate an + * incremental delta archive from the previous base + * + * NOTE: the Makerules.mk :PACKAGE: operator defers to :package: when + * a target is specified + */ + +/* these are ast centric -- we'll parameterize another day */ + +org = ast +url = http://www.research.att.com/sw/download + +/* generic defaults */ + +base = +category = utils +checksum = md5 +closure = +copyright = 1 +delta = +format = tgz +incremental = +index = +init = INIT +license = +licenses = $(org) +mamfile = 1 +opt = +name = +notice = +release = +strip = 0 +style = tgz +suffix = tgz +type = +variants = !(cc-g) +vendor = +version = $("":T=R%Y-%m-%d) + +SUM = sum + +package.notice = ------------ NOTICE -- LICENSED SOFTWARE -- SEE README FOR DETAILS ------------ + +package.readme = $(@.package.readme.) + +.package.readme. : + This is a package root directory $PACKAGEROOT. Source and binary + packages in this directory tree are controlled by the command + $() + bin/package + $() + Binary files may be in this directory or in the install root directory + $() + INSTALLROOT=$PACKAGEROOT/arch/`bin/package` + $() + For more information run + $() + bin/package help + $() + Many of the packaged commands self-document via the --man and --html + options; those that do have no separate man page. + $() + Each package is covered by one of the license files + $() + $(PACKAGELIB)/LICENSES/ + $() + where is the license type for the package. At the top + of each license file is a URL; the license covers all software that + refers to this URL. For details run + $() + bin/package license [] + $() + Any archives, distributions or packages made from source or + binaries covered by license(s) must contain the corresponding + license file(s)$(notice:?, this README file, and the empty file$$("\n")$$(package.notice)?.?) + +.package.licenses. : .FUNCTION + local I F L R T all save text + L := $(%) + while L == "--*" + I := $(L:O=1) + if I == "--all" + all = 1 + elif I == "--save" + save = 1 + elif I == "--text" + text = 1 + end + L := $(L:O>1) + end + if "$(L)" == "*-*" + L += $(L:/[^-]*-//) $(L:/-.*//) + end + L += $(licenses) + for I $(L:U) + if I == "gpl" + I = gnu + all = + end + if F = "$(I:D=$(PACKAGESRC):B:S=.lic:T=F)" + R += $(F) + if save || text + T := $(.FIND. lib/package .lic $(F):P=W,query=type) + R += $(T:D=$(PACKAGESRC)/LICENSES:B) + end + if save + R += $(F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F) + elif ! all + break + end + end + end + return $(R) + +/* + * glob(3) doesn't handle / in alternation -- should it? + */ + +.package.glob. : .FUNCTION + local A D I P S + for I $(%) + if I == "*/*" + D := $(I:C,/.*,,) + if ! "$(A:N=$(D))" + local S.$(D) + A += $(D) + end + S.$(D) += $(I:C,[^/]*/,,) + else + P := $(P)$(S)$(I) + end + S = | + end + if P == "*\|*" + P := ($(P)) + end + for I $(A) + P += $(I)/$(.package.glob. $(S.$(I))) + end + return $(P) + + +.MAKEINIT : .package.init + +.package.init : .MAKE .VIRTUAL .FORCE + local V + V := $(VROOT:T=F:P=L*) + if ! PACKAGEROOT + PACKAGEROOT := $(V:N!=*/arch/+([!/]):O=1) + end + if V == "$(PACKAGEROOT)" + V := + end + V += $(INSTALLROOT) $(PACKAGEROOT) + PACKAGEVIEW := $(V:H=RU) + INSTALLOFFSET := $(INSTALLROOT:C%$(PACKAGEROOT)/%%) + if license + license := $(license)|none.none + end + +PACKAGELIB = lib/package +PACKAGESRC = $(PACKAGEROOT)/$(PACKAGELIB) +PACKAGEBIN = $(INSTALLROOT)/$(PACKAGELIB) +PACKAGEDIR = $(PACKAGESRC)/$(style) +INSTALLOFFSET = $(INSTALLROOT:C%$(PACKAGEROOT)/%%) + +package.omit = -|*/$(init) +package.glob.all = $(INSTALLROOT)/src/*/*/($(MAKEFILES:/:/|/G)) +package.all = $(package.glob.all:P=G:W=O=$(?$(name):A=.VIRTUAL):N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) +package.glob.pkg = $(.package.glob. $(~$(name):P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%) $(~$(name):P=U:N=$(name):?$$(INSTALLROOT)/src/$$(name)/($$(MAKEFILES:/:/|/G))??) +package.pkg = $(package.glob.pkg:P=G:D:N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) +package.closure = $(closure:?$$(package.all)?$$(package.pkg)?) + +package.init = $(.package.glob. $("$(init)$(name)":P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%:P=G:T=F:D::B) +package.ini = ignore mamprobe manmake package silent +package.src.pat = $(PACKAGESRC)/($(name).(ini|pkg)) +package.src = $(package.src.pat:P=G) $(.package.licenses. --save $(name)) +package.bin = $(PACKAGEBIN)/$(name).ini + +package.mam = --never --force --mam=static --corrupt=accept --clobber --compare --link='lib*.a*' CC=$(CC.DIALECT:N=C++:?CC?cc?) package.license.class=$(license:Q) $(=) 'dontcare test' install test + +op = current +stamp = [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] +source = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(suffix) +binary = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) +runtime = $(PACKAGEDIR)/$(name)-run.$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) +old.new.source = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(suffix) +old.new.binary = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) +old.new.runtime = $(PACKAGEDIR)/$(name)-run.$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) + +source.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(suffix)":P=G:H=R) +binary.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H=R) +runtime.list = $("$(PACKAGEDIR)/$(name)-run.*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H>) + +source.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz.c":T=F) +binary.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz":T=F) + +$(init) : .VIRTUAL $(init) + +package.requires = 0 + +":package:" : .MAKE .OPERATOR + local P I R V + P := $(<:O=1) + $(P) : $(>:V) + if ! package.requires + if ! name + name := $(P) + .PACKAGE. := $(P) + if name == "$(init)" + package.omit = - + package.src += $(package.ini:C,^,$(PACKAGEROOT)/bin/,) $(PACKAGESRC)/package.mk + else + $(P) : $(package.init) + end + for I $(<:O>1) + if I == "*=*" + eval + $(I) + end + else + version := $(I) + end + end + LICENSEFILEDEFAULT := $(.package.licenses. $(name):@/ /:/G) + export LICENSEFILEDEFAULT + end + if "$(>)" + for I $(>:V) + $(I) : .VIRTUAL + if I == "/*" + package.dir += $(I:V) + end + end + end + if "$(@)" + $(P).README := $(@) + else + $(P).README := This is the $(P) package. + end + end + +":AUXILIARY:" : .MAKE .OPERATOR + package.auxiliary.$(style) += $(>:N=/*:T=F) $(>:N!=/*:C%^%$(INSTALLROOT)/%:T=F) + +":CATEGORY:" : .MAKE .OPERATOR + if ! package.requires + category := $(>) + end + +.covers. : .FUNCTION + local I C D F K=0 L + for I $(%) + if ! "$(~covers:N=$(I:B))" + if F = "$(I:D:B:S=.pkg:T=F)" + if D = "$(F:T=I)" + covers : $(I:B) + for L $(D) + if L == ":COVERS:" + K = 1 + elif L == ":*:" + if K + break + end + elif K + : $(.covers. $(L)) + end + end + end + else + error $(--exec:?3?1?) $(I): unknown package $(I) + end + end + end + +":COVERS:" : .MAKE .OPERATOR + if ! package.requires + : $(.covers. $(>)) + end + +":DESCRIPTION:" : .MAKE .OPERATOR + if ! package.requires + $(name).README := $(@:V) + end + +":DETAILS:" : .MAKE .OPERATOR + if ! package.requires + details.$(>:O=1) := $(@:V) + end + +":EXPORT:" : .MAKE .OPERATOR + if ! package.requires + export.$(style) := $(@:/$$("\n")/ /G) + end + +":INDEX:" : .MAKE .OPERATOR + if ! package.requires + index := $(>) + end + +":INSTALL:" : .MAKE .OPERATOR + if ! package.requires + local T S F X + S := $(>) + T := $(<) + if "$(exe.$(style))" && "$(T)" == "bin/*([!./])" + T := $(T).exe + end + if ! "$(S)" + S := $(T) + elif "$(exe.$(style))" && "$(S)" == "bin/*([!./])" + S := $(S).exe + end + install.$(style) := $(install.$(style):V)$("\n")install : $$(ROOT)/$(T)$("\n")$$(ROOT)/$(T) : $$(ARCH)/$(S)$("\n\t")cp $< $@ + if strip && "$(T:N=*.exe)" + install.$(style) := $(install.$(style):V)$("\n\t")strip $@ 2>/dev/null + end + X := $(PACKAGEROOT)/arch/$(CC.HOSTTYPE)/$(S) + if strip && "$(X:T=Y)" == "*/?(x-)(dll|exe)" + F := filter $(STRIP) $(STRIPFLAGS) $(X) + end + if "$(filter.$(style):V)" + filter.$(style) := $(filter.$(style):V)$$("\n") + end + filter.$(style) := $(filter.$(style):V);;$(F);$(X);usr/$(T) + end + +":LICENSE:" : .MAKE .OPERATOR + if ! package.requires && ! license + license := $(>) + end + +":OMIT:" : .MAKE .OPERATOR + if ! package.requires + package.omit := $(package.omit)|$(>:C,^,*/,:/ /|/G) + end + +":POSTINSTALL:" : .MAKE .OPERATOR + if ! package.requires + postinstall.$(style) := $(@:V) + end + +":README:" : .MAKE .OPERATOR + if ! package.requires + readme.$(style) := $(@:V) + end + +.requires. : .FUNCTION + local I C D F K=0 L V T M=0 + for I $(%) + if ! "$(~requires:N=$(I:B))" + if F = "$(I:D:B:S=.pkg:T=F)" + if I == "$(init)" + package.omit = - + else + requires : $(I:B) + end + if V = "$(I:D:B=gen/$(I:B):S=.ver:T=F)" + req : $(I:B) + else + error 1 $(I): package should be written before $(P) + end + let package.requires = package.requires + 1 + include "$(F)" + let package.requires = package.requires - 1 + else + error 1 $(I): package not found + end + end + end + +":REQUIRES:" : .MAKE .OPERATOR + : $(.requires. $(>)) + +":TEST:" : .MAKE .OPERATOR + if ! package.requires + local T + T := $(>) + if "$(T)" == "bin/*([!./])" + if "$(exe.$(style))" + T := $(T).exe + end + T := $$(PWD)/$$(ARCH)/$(T) + end + test.$(style) := $(test.$(style):V)$("\n")test : $(T:V)$("\n\t")$(@) + end + +base delta : .MAKE .VIRTUAL .FORCE + op := $(<) + +closure : .MAKE .VIRTUAL .FORCE + $(<) := 1 + +cyg exp lcl pkg rpm tgz : .MAKE .VIRTUAL .FORCE + style := $(<) + +source : .source.init .source.gen .source.$$(style) + +.source.init : .MAKE + local A B D P V I + type := source + if ! "$(incremental)" + incremental = 1 + end + if "$(source.$(name))" + suffix = c + end + : $(.init.$(style)) + : $(details.$(style):V:R) : + A := $(source.list) + B := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + deltaversion := $(B:B:/$(name).//) + let deltasince = $(deltaversion:/.*-//) + 1 + deltasince := $(deltaversion:/[^-]*$/$(deltasince:F=%02d)/) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + source := $(B:D:B:S=.$(release).$(suffix)) + version := $(source:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)\.\([^.]*\).*/\1/) + if V == "$(stamp)" && V != "$(version)" + old.version := $(V) + old.source := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + source := $(B) + end + if B == "$(source)" + if "$(B:D:B:B)" == "$(D:D:B:B)" && "$(B:B::S)" != "$(D:B::S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(source:B:S:/^$(name).\(.*\).$(suffix)$/\1/) + end + PACKAGEGEN := $(PACKAGESRC)/gen + +.source.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) $$(PACKAGEGEN)/SOURCE.html $$(PACKAGEGEN)/BINARY.html $$(PACKAGEGEN)/DETAILS.html + +BINPACKAGE := $(PATH:/:/ /G:X=package:T=F:O=1) + +$$(PACKAGEDIR) $$(PACKAGEGEN) : .IGNORE + [[ -d $(<) ]] || mkdir $(<) + +$$(PACKAGEGEN)/SOURCE.html : $(BINPACKAGE) + $(*) html source > $(<) + +$$(PACKAGEGEN)/BINARY.html : $(BINPACKAGE) + $(*) html binary > $(<) + +$$(PACKAGEGEN)/DETAILS.html : $(BINPACKAGE) + $(*) html intro > $(<) + +.source.exp .source.pkg .source.rpm : .MAKE + error 3 $(style): source package style not supported yet + +exe.cyg = .exe +vendor.cyg = gnu + +.name.cyg : .FUNCTION + local N + N := $(%) + if N == "*-*" + vendor := $(N:/-.*//) + if vendor == "$(vendor.cyg)" + vendor := + N := $(N:/[^-]*-//) + end + N := $(N:/-//G) + end + return $(N) + +.init.cyg : .FUNCTION + local N O + closure = 1 + init = . + strip = 1 + suffix = tar.bz2 + format = tbz + vendor := $(licenses:N!=$(vendor.cyg):O=1) + package.ini := $(package.ini) + package.src.pat := $(package.src.pat) + package.src := $(package.src) + package.bin := $(package.bin) + .source.gen : .CLEAR $(*.source.gen:V:N!=*.html) + name.original := $(name) + name := $(.name.cyg $(name)) + if name != "$(name.original)" + $(name) : $(~$(name.original)) + O := $(~covers) + covers : .CLEAR + for N $(O) + covers : $(.name.cyg $(N)) + end + end + stamp = [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9] + version.original := $(version) + version := $(version:/-//G)-1 + if opt + opt := $(opt)/$(vendor)/ + else + opt := $(name)-$(version)/ + end + if type == "source" + version := $(version)-src + source = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) + else + binary = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) + end + +.source.cyg : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + cat > $tmp/configure <<'!' + echo "you didn't have to do that" + ! + chmod +x $tmp/configure + echo ";;;$tmp/configure;configure" + cat > $tmp/Makefile0 <<'!' + HOSTTYPE := $$(shell bin/package) + ROOT = ../.. + ARCH = arch/$$(HOSTTYPE) + all : + PACKAGEROOT= CYGWIN="$$CYGWIN ntsec binmode" bin/package make $(export.$(style)) + install : all + $(install.$(style):V) + $(test.$(style):V) + ! + echo ";;;$tmp/Makefile0;Makefile" + cat > $tmp/CYGWIN-README <<'!' + $(readme.$(style):@?$$(readme.$$(style))$$("\n\n")??)To build binaries from source into the ./arch/`bin/package` tree run: + $() + make + $() + $(test.$(style):@?To test the binaries after building/installing run:$$("\n\n\t")make test$$("\n\n")??)To build and/or install the binaries run: + $() + make install + $() + The bin/package command provides a command line interface for all package + operations. The $(opt:/.$//) source and binary packages were generated by: + $() + package write cyg base source version=$(version.original) $(name.original) + package write cyg base binary version=$(version.original) $(name.original) + $() + using the $(org)-base package. To download and install the latest + $(org)-base source package in /opt/$(org) run: + $() + PATH=/opt/$(org)/bin:$PATH + cd /opt/$(org) + package authorize "NAME" password "PASSWORD" setup flat source $("\\") + $(url) $("\\") + $(org)-base + package make + $() + and export /opt/$(org)/bin in PATH to use. The NAME and PASSWORD signify your + agreement to the software license(s). All users get the same NAME and PASSWORD. + See $(url) for details. If multiple architectures may be built under + /opt/$(org) then drop "flat" and export /opt/$(org)/arch/`package`/bin in PATH + to use. To update previously downloaded packages from the same url simply run: + $() + cd /opt/$(org) + package setup + package make + $() + To download and install the latest $(org)-base binary package in + /opt/$(org) change "source" to "binary" and omit "package make". + ! + echo ";;;$tmp/CYGWIN-README;CYGWIN-PATCHES/README" + cat > $(source:/-src.$(suffix)//).setup.hint <<'!' + category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) + requires: cygwin + sdesc: "$(index)" + ldesc: "$($(name.original).README)" + ! + echo ";;;$(source:/-src.$(suffix)//).setup.hint;CYGWIN-PATCHES/setup.hint" + echo ";;;$(BINPACKAGE);bin/package" + cat > $tmp/Makefile <<'!' + :MAKE: + ! + echo ";;;$tmp/Makefile;src/Makefile" + echo ";;;$tmp/Makefile;src/cmd/Makefile" + echo ";;;$tmp/Makefile;src/lib/Makefile" + if [[ '$(mamfile)' == 1 ]] + then cat > $tmp/Mamfile1 <<'!' + info mam static + note source level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/Mamfile1;src/Mamfile" + cat > $tmp/Mamfile2 <<'!' + info mam static + note component level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" + echo ";;;$tmp/Mamfile2;src/lib/Mamfile" + fi + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + echo ";;;$(PACKAGEGEN)/$(name.original).req" + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then if [[ '$(mamfile)' == 1 ]] + then (( o=m )) + s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) + if [[ $s ]] + then for j in $s + do if [[ -d $j ]] + then cd $j + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then (( m++ )) + $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/$j/Mamfile" + fi + cd $(INSTALLROOT)/$i + fi + done + if (( o != m )) + then (( m++ )) + cat > $tmp/$m.mam <<'!' + info mam static + note subcomponent level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + else (( m++ )) + $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + fi + $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) + fi + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + { + : > $tmp/HEAD + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + --format=$(format) \ + --local \ + -wvf $(source) $(base) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) \ + $(vendor:?-s",^[^/],$(opt)&,"??) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + rm -rf $tmp + fi + +.source.lcl : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) $(=) .FILES.+=Mamfile recurse list.package.local + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + sort -t';' -k5,5 -u | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + -wvf $(source) $(base) \ + $(op:N=delta:?--format=gzip??) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) + rm -rf $tmp + fi + +.source.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + if [[ '$(init)' == '$(name)' ]] + then cat > $tmp/Makefile <<'!' + :MAKE: + ! + $(CMP) $(CMPFLAGS) $tmp/Makefile $(PACKAGEROOT)/src/Makefile && touch -r $(PACKAGEROOT)/src/Makefile $tmp/Makefile + echo ";;;$tmp/Makefile;src/Makefile" + cp $tmp/Makefile $tmp/Makefile1 + $(CMP) $(CMPFLAGS) $tmp/Makefile1 $(PACKAGEROOT)/src/cmd/Makefile && touch -r $(PACKAGEROOT)/src/cmd/Makefile $tmp/Makefile1 + echo ";;;$tmp/Makefile1;src/cmd/Makefile" + cp $tmp/Makefile $tmp/Makefile2 + $(CMP) $(CMPFLAGS) $tmp/Makefile2 $(PACKAGEROOT)/src/lib/Makefile && touch -r $(PACKAGEROOT)/src/lib/Makefile $tmp/Makefile2 + echo ";;;$tmp/Makefile2;src/lib/Makefile" + if [[ '$(mamfile)' == 1 ]] + then cat > $tmp/Mamfile1 <<'!' + info mam static + note source level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/Mamfile1 $(PACKAGEROOT)/src/Mamfile && touch -r $(PACKAGEROOT)/src/Mamfile $tmp/Mamfile1 + echo ";;;$tmp/Mamfile1;src/Mamfile" + cat > $tmp/Mamfile2 <<'!' + info mam static + note component level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/Mamfile2 $(PACKAGEROOT)/src/cmd/Mamfile && touch -r $(PACKAGEROOT)/src/cmd/Mamfile $tmp/Mamfile2 + echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" + cp $tmp/Mamfile2 $tmp/Mamfile3 + $(CMP) $(CMPFLAGS) $tmp/Mamfile3 $(PACKAGEROOT)/src/lib/Mamfile && touch -r $(PACKAGEROOT)/src/lib/Mamfile $tmp/Mamfile3 + echo ";;;$tmp/Mamfile3;src/lib/Mamfile" + fi + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lib pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] + then echo $(name) $(version) $(release|version) 1 > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).ver || cp $tmp/t $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).req || cp $tmp/t $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).inx || cp $tmp/t $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + } | fmt + package help source + package release $(name) + } > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).README || cp $tmp/t $(PACKAGEGEN)/$(name).README + echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" + { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package"' + echo '.xx meta.keywords="software, package"' + echo '.MT 4' + echo '.TL' + echo '$(name) package' + echo '.H 1 "$(name) package"' + echo '$($(name).README)' + set -- $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F:D::B) + hot= + for i + do hot="$hot -e s/\\(\\<$i\\>\\)/\\\\h'0*1'\\1\\\\h'0'/" + done + set -- $(package.closure:B) + if (( $# )) + then echo 'Components in this package:' + echo '.P' + echo '.TS' + echo 'center expand;' + echo 'l l l l l l.' + if [[ $hot ]] + then hot="sed $hot" + else hot=cat + fi + for i + do echo $i + done | + pr -6 -t -s' ' | + $hot + echo '.TE' + fi + echo '.P' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + set -- $(.package.licenses. --all $(name)) + case $# in + 0) ;; + *) case $# in + 1) echo 'The software is covered by this license:' ;; + *) echo 'The software is covered by these licenses:' ;; + esac + echo .BL + for j + do i=$( $(PROTO) -l $j -p -h -o type=usage /dev/null | sed -e 's,.*\[-license?\([^]]*\).*,\1,' ) + echo .LI + echo ".xx link=\"$i\"" + done + echo .LE + echo 'Individual components may be covered by separate licenses;' + echo 'refer to the component source and/or binaries for more information.' + echo .P + ;; + esac + echo 'A recent' + echo '.xx link="release change log"' + echo 'is also included.' + cat $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F) < /dev/null + echo '.H 1 "release change log"' + echo '.xx index' + echo '.nf' + package release $(name) | + sed -e 's/:::::::: \(.*\) ::::::::/.fi\$("\n").H 1 "\1 changes"\$("\n").nf/' + echo '.fi' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t + $(STDED) $(STDEDFLAGS) $tmp/t <<'!' + /^$/,/^$/s/ changes$/,/^$/m// + w + q + ! + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).html || cp $tmp/t $(PACKAGEGEN)/$(name).html + echo ";;;$(PACKAGEGEN)/$(name).html;$(PACKAGELIB)/$(name).html" + if [[ '$(deltasince)' ]] + then { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package $(version) delta $(release)"' + echo '.xx meta.keywords="software, package, delta"' + echo '.MT 4' + echo '.TL' + echo '$(name) package $(deltaversion) delta $(release)' + echo '.H 1 "$(name) package $(deltaversion) delta $(release) changes"' + echo '.nf' + package release $(deltasince) $(name) | + sed -e 's/:::::::: \(.*\) ::::::::/.H 2 \1/' + echo '.fi' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t + $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).$(release).html || cp $tmp/t $(PACKAGEGEN)/$(name).$(release).html + echo ";;;$(PACKAGEGEN)/$(name).$(release).html;$(PACKAGELIB)/$(name).$(release).html" + fi + fi + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then if [[ '$(mamfile)' == 1 ]] + then (( o=m )) + s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) + if [[ $s ]] + then for j in $s + do if [[ -d $j ]] + then cd $j + if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . + then (( m++ )) + $(MAKE) $(package.mam) > $tmp/$m.mam + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/$j/Mamfile && touch -r $(PACKAGEROOT)/$i/$j/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/$j/Mamfile" + fi + cd $(INSTALLROOT)/$i + fi + done + if (( o != m )) + then (( m++ )) + cat > $tmp/$m.mam <<'!' + info mam static + note subcomponent level :MAKE: equivalent + make install + make all + exec - ${MAMAKE} -r '*' ${MAMAKEARGS} + done all virtual + done install virtual + ! + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + else (( m++ )) + $(MAKE) $(package.mam) > $tmp/$m.mam + $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam + echo ";;;$tmp/$m.mam;$i/Mamfile" + fi + fi + $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) $(copyright:N=1:??LICENSE=?) + fi + done + set -- $(package.dir:P=G) + for i + do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + $(CMP) $(CMPFLAGS) $tmp/README $(PACKAGEROOT)/README && touch -r $(PACKAGEROOT)/README $tmp/README + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + -wvf $(source) $(base) \ + $(op:N=delta:?--format=gzip??) \ + $(PACKAGEVIEW:C%.*%-s",^&/,,"%) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + echo local > $(source:D:B=$(name):S=.tim) + if [[ '$(incremental)' == 1 && '$(old.source)' ]] + then $(PAX) -rf $(source) -wvf $(old.new.source) -z $(old.source) + $(SUM) -x $(checksum) < $(old.new.source) > $(old.new.source:D:B:S=.$(checksum)) + fi + rm -rf $tmp + else if [[ '$(old.source)' ]] && $(CMP) $(CMPFLAGS) $(source.$(name)) $(source) + then : $(name) is up to date + else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + : > $(PACKAGEGEN)/$(name).req + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + echo '.xx title="$(name) package"' + echo '.xx meta.description="$(name) package"' + echo '.xx meta.keywords="software, package"' + echo '.MT 4' + echo '.TL' + echo '$(name) package' + echo '.H 1' + echo '$($(name).README)' + } | + $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $(PACKAGEGEN)/$(name).html + if [[ '$(source.$(name))' ]] + then { + echo '$($(name).README)' + package help source + } > $(PACKAGEGEN)/$(name).README + cp $(source.$(name)) $(source) + $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) + fi + echo local > $(source:D:B=$(name):S=.tim) + fi + fi + +binary : .binary.init .binary.gen .binary.$$(style) + +.binary.init : .MAKE + local A B D I P V + type := binary + if ! "$(incremental)" + incremental = 0 + end + if ! "$(~$(name))" + if name == "ratz" + suffix = exe + else + suffix = gz + end + end + : $(.init.$(style)) : + : $(details.$(style):V:R) : + A := $(binary.list) + B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + binary := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) + version := $(binary:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)\.\([^.]*\).*/\1/) + if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" + old.version := $(V) + old.binary := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + binary := $(B) + end + if B == "$(binary)" + if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(binary:B:/$(name).//:/\..*//) + end + PACKAGEGEN := $(PACKAGEBIN)/gen + +.binary.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) + +.binary.exp .binary.pkg .binary.rpm : .MAKE + error 3 $(style): binary package style not supported yet + +.binary.cyg : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + integer m=0 o + { + echo '$($(name.original).README)' | fmt + cat <<'!' + $(readme.$(style):@?$$("\n")$$(readme.$$(style))??) + ! + } > $tmp/README1 + echo ";;;$tmp/README1;usr/share/doc/Cygwin/$(opt:/.$//).README" + { + echo '$($(name.original).README)' | fmt + cat <<'!' + $() + The remainder of this file is the README from the source package + that was used to generate this binary package. It describes + the source build hierarchy, not the current directory. + $() + $(package.readme) + ! + } > $tmp/README2 + echo ";;;$tmp/README2;usr/share/doc/$(opt)README" + package release $(name.original) > $tmp/RELEASE + echo ";;;$tmp/RELEASE;usr/share/doc/$(opt)RELEASE" + cat > $(binary:/.$(suffix)//).setup.hint <<'!' + category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) + requires: cygwin + sdesc: "$(index)" + ldesc: "$($(name.original).README)" + ! + set -- $(.package.licenses. --text $(name.original):N!=*.lic) + for i + do echo ";;;${i};usr/share/doc/$(opt)LICENSE-${i##*/}" + done + cat <<'!' + $(filter.$(style)) + ! + if [[ '$(postinstall.$(style):V:O=1:?1??)' ]] + then cat >$tmp/postinstall <<'!' + $("#")!/bin/sh + $(postinstall.$(style)) + ! + echo ";;;$tmp/postinstall;etc/postinstall/$(name).sh" + fi + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + --format=$(format) \ + --local \ + -wvf $(binary) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + rm -rf $tmp + fi + +.binary.lcl : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) + $(package.bin:U:T=F:/.*/echo ";;;&"$("\n")/) + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name).sum \ + --install=$(PACKAGEGEN)/$(name).ins \ + -wvf $(binary) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + rm -rf $tmp + fi + +.binary.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + if [[ '$(init)' == '$(name)' ]] + then for i in lib32 lib64 + do if [[ -d $(INSTALLROOT)/$i ]] + then echo ";physical;;$(INSTALLROOT)/$i" + fi + done + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] + then echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lic pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + } | fmt + package help binary + package release $(name) + } > $(PACKAGEGEN)/$(name).README + echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" + fi + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name).sum \ + --install=$(PACKAGEGEN)/$(name).ins \ + -wvf $(binary) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + if [[ '$(incremental)' == 1 && '$(old.binary)' ]] + then $(PAX) -rf $(binary) -wvf $(old.new.binary) -z $(old.binary) + echo $(old.new.binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(old.new.binary) > $(old.new.binary:D:B:S=.$(checksum)) + echo $(old.new.binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + rm -rf $tmp + else if [[ '$(binary.$(name))' ]] + then exe=$(binary.$(name)) + else exe=$(INSTALLROOT)/bin/$(name) + fi + if [[ '$(old.binary)' ]] && $(CMP) $(CMPFLAGS) $exe $(binary) + then : $(name) is up to date + else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + : > $(PACKAGEGEN)/$(name).req + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + echo '$($(name).README)' + package help binary + } > $(PACKAGEGEN)/$(name).README + case "$(binary)" in + *.gz) gzip < $exe > $(binary) ;; + *) cp $exe $(binary) ;; + esac + $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) + echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) + fi + echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + +runtime : .runtime.init .runtime.gen .runtime.$$(style) + +.runtime.init : .MAKE + local A B D I P V + type := runtime + if ! "$(incremental)" + incremental = 0 + end + if ! "$(~$(name))" + if name == "ratz" + suffix = exe + else + suffix = gz + end + end + : $(.init.$(style)) : + : $(details.$(style):V:R) : + A := $(runtime.list) + B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) + P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) + D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) + if op == "delta" + if ! B + error 3 delta requires a base archive + end + base := -z $(B) + if "$(release)" != "$(stamp)" + release := $("":T=R%Y-%m-%d) + end + runtime := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) + version := $(runtime:B:B:/$(name).//) + elif B || op == "base" + if op == "base" + for I $(B) $(P) + V := $(I:B:/$(name)-run\.\([^.]*\).*/\1/) + if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" + old.version := $(V) + old.runtime := $(I) + if "$(old.version)" >= "$(version)" + error 3 $(name): previous base $(old.version) is newer than $(version) + end + break + end + end + else + runtime := $(B) + end + if B == "$(runtime)" + if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" + error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) + end + error 1 $(B:B:S): replacing current base + end + version := $(runtime:B:/$(name)-run.//:/\..*//) + end + PACKAGEGEN := $(PACKAGESRC)/gen + +.runtime.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) + +.runtime.cyg .runtime.exp .runtime.lcl .runtime.pkg .runtime.rpm : .MAKE + error 3 $(style): runtime package style not supported yet + +.runtime.tgz : + if [[ '$(~$(name))' ]] + then tmp=/tmp/pkg$(tmp) + mkdir $tmp + { + if [[ '$(init)' == '$(name)' ]] + then for i in lib32 lib64 + do if [[ -d $(INSTALLROOT)/$i ]] + then echo ";physical;;$(INSTALLROOT)/$i" + fi + done + fi + $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) + $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) + echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver + echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" + if [[ '$(~covers)' ]] + then for i in $(~covers) + do for j in lic pkg + do if [[ -f $(PACKAGESRC)/$i.$j ]] + then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + for j in ver req + do if [[ -f $(PACKAGEGEN)/$i.$j ]] + then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" + fi + done + done + for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) + do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" + done + fi + sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req + echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" + { + echo "name='$(name)'" + echo "index='$(index)'" + echo "covers='$(~covers)'" + echo "requires='$(~req)'" + } > $(PACKAGEGEN)/$(name).inx + { + { + echo '$($(name).README)' + if [[ '$(~covers)' ]] + then echo + echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." + fi + if [[ '$(~requires)' ]] + then echo + echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' + fi + echo + echo "To install this $(type) package read the tarball into a directory" + echo "suitable for containing bin and lib subdirectories, and run the" + echo "$(PACKAGELIB)/gen/$(name)-run.ins script to fix up permissions." + echo + echo "To use the package export the bin directory in PATH. The commands and" + echo "libraries use \$PATH to locate dynamic libraries and related data files." + echo + } | fmt + } > $(PACKAGEGEN)/$(name)-run.README + echo ";;;$(PACKAGEGEN)/$(name)-run.README;$(PACKAGELIB)/$(name)-run.README" + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- + done + } | + { + : > $tmp/HEAD + [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" + cat > $tmp/README <<'!' + $(package.readme) + ! + echo ";;;$tmp/README;README" + sort -t';' -k5,5 -u + : > $tmp/TAIL + [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" + } | + $(PAX) --filter=- \ + --to=ascii \ + $(op:N=delta:??--format=$(format)?) \ + --local \ + --checksum=md5:$(PACKAGEGEN)/$(name)-run.sum \ + --install=$(PACKAGEGEN)/$(name)-run.ins \ + -wvf $(runtime) $(base) \ + $(op:N=delta:?--format=gzip??) \ + -s",^$tmp/,$(INSTALLOFFSET)/," \ + $(PACKAGEROOT:C%.*%-s",^&/,,"%) + echo $(runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(runtime) > $(runtime:D:B:S=.$(checksum)) + echo $(runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + echo local > $(runtime:D:B=$(name)-run:S=.$(CC.HOSTTYPE).tim) + if [[ '$(incremental)' == 1 && '$(old.runtime)' ]] + then $(PAX) -rf $(runtime) -wvf $(old.new.runtime) -z $(old.runtime) + echo $(old.new.runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + $(SUM) -x $(checksum) < $(old.new.runtime) > $(old.new.runtime:D:B:S=.$(checksum)) + echo $(old.new.runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) + fi + rm -rf $tmp + fi + +list.installed list.manifest : + set -- $(package.closure) + for i + do cd $(INSTALLROOT)/$i + ignore $(MAKE) --noexec $(-) $(=) $(<) + done diff --git a/src/cmd/INIT/package.sh b/src/cmd/INIT/package.sh new file mode 100644 index 0000000..3f1ed1b --- /dev/null +++ b/src/cmd/INIT/package.sh @@ -0,0 +1,7302 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2012 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +### this script contains archaic constructs that work with all sh variants ### +# package - source and binary package control +# Glenn Fowler + +command=package + +case $-:$BASH_VERSION in +*x*:[0123456789]*) : bash set -x is broken :; set +ex ;; +esac + +# ksh checks -- ksh between 2007-11-05 and 2011-11-11 conflict with new -lcmd -- wea culpa +checksh() +{ + egrep 'Version.*(88|1993)' $1 >/dev/null 2>&1 || + $1 -c '(( .sh.version >= 20111111 ))' >/dev/null 2>&1 +} + +case $_AST_BIN_PACKAGE_:$SHELL:$0 in +1:*|*:/bin/sh:*) + ;; +*:*/*:*/*) + _AST_BIN_PACKAGE_=1 # prevent non-interactive sh .rc referencing bin/package recursion # + export _AST_BIN_PACKAGE_ + if checksh $SHELL + then : no -lcmd conflict : + else case " $* " in + *" debug "*|*" DEBUG "*|*" show "*) + echo $command: $SHELL: warning: possible -lcmd conflict -- falling back to /bin/sh >&2 + ;; + esac + SHELL=/bin/sh + export SHELL + exec $SHELL "$0" "$@" + fi + ;; +esac + +LC_ALL=C +export LC_ALL + +src="cmd contrib etc lib" +use="/usr/common /exp /usr/local /usr/add-on /usr/addon /usr/tools /usr /opt" +usr="/home" +lib="" # nee /usr/local/lib /usr/local/shlib +ccs="/usr/kvm /usr/ccs/bin" +org="gnu GNU" +makefiles="Mamfile Nmakefile nmakefile Makefile makefile" +env="HOSTTYPE NPROC PACKAGEROOT INSTALLROOT PATH" +checksum=md5sum +checksum_commands="$checksum md5" +checksum_empty="d41d8cd98f00b204e9800998ecf8427e" + +package_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC=' + +PACKAGE_admin_tail_timeout=${PACKAGE_admin_tail_timeout:-"1m"} + +CROSS=0 + +admin_db=admin.db +admin_env=admin.env +admin_ditto="ditto --checksum --delete --verbose" +admin_ditto_update=--update +admin_ditto_skip="OFFICIAL|core|old|*.core|*.tmp|.nfs*" +admin_list='PACKAGE.$type.lst' +admin_ping="ping -c 1 -w 5" + +default_url=default.url +MAKESKIP=${MAKESKIP:-"*[-.]*"} +RATZ=ratz +SED= +TAR=tar +TARFLAGS=xv +TARPROBE=B +TR= + +all_types='*.*|sun4' # all but sun4 match *.* + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) USAGE=$' +[-? +@(#)$Id: package (AT&T Research) 2012-02-29 $ +]'$USAGE_LICENSE$' +[+NAME?package - source and binary package control] +[+DESCRIPTION?The \bpackage\b command controls source and binary + packages. It is a \bsh\b(1) script coded for maximal portability. All + package files are in the \b$PACKAGEROOT\b directory tree. + \b$PACKAGEROOT\b must at minumum contain a \bbin/package\b command or a + \blib/package\b directory. Binary package files are in the + \b$INSTALLROOT\b (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where + \ahosttpe\a=`\bpackage\b`. All \aactions\a but \bhost\b and \buse\b + require the current directory to be under \b$PACKAGEROOT\b. See + \bDETAILS\b for more information.] +[+?Note that no environment variables need be set by the user; + \bpackage\b determines the environment based on the current working + directory. The \buse\b action starts a \bsh\b(1) with the environment + initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set + by explicit command argument assignments to override the defaults.] +[+?Packages are composed of components. Each component is built and + installed by an \bast\b \bnmake\b(1) makefile. Each package is also + described by an \bnmake\b makefile that lists its components and + provides a content description. The package makefile and component + makefiles provide all the information required to read, write, build + and install packages.] +[+?Package recipients only need \bsh\b(1) and \bcc\b(1) to build and + install source packages, and \bsh\b to install binary packages. + \bnmake\b and \bksh93\b are required to write new packages. An + \b$INSTALLROOT/bin/cc\b script may be supplied for some architectures. + This script supplies a reasonable set of default options for compilers + that accept multiple dialects or generate multiple object/executable + formats.] +[+?The command arguments are composed of a sequence of words: zero or + more \aqualifiers\a, one \aaction\a, and zero or more action-specific + \aarguments\a, and zero or more \aname=value\a definitions. \apackage\a + names a particular package. The naming scheme is a \b-\b separated + hierarchy; the leftmost parts describe ownership, e.g., + \bgnu-fileutils\b, \bast-base\b. If no packages are specified then all + packages are operated on. \boptget\b(3) documentation options are also + supported. The default with no arguments is \bhost type\b.] +[+?The qualifiers are:] + { + [+authorize \aname\a?Remote authorization user name or license + acceptance phrase.] + [+debug|environment?Show environment and actions but do not + execute.] + [+flat?Collapse \b$INSTALLROOT\b { bin fun include lib } onto + \b$PACKAGEROOT\b.] + [+force?Force the action to override saved state.] + [+never?Run make -N and show other actions.] + [+only?Only operate on the specified packages.] + [+password \apassword\a?Remote authorization or license + acceptance password.] + [+quiet?Do not list captured action output.] + [+show?Run make -n and show other actions.] + [+verbose?Provide detailed action output.] + [+DEBUG?Trace the package script actions in detail.] + } +[+?The actions are:] + { + [+admin\b [\ball\b]] [\bdb\b \afile\a]] [\bon\b \apattern\a]][\aaction\a ...]]?Apply + \aaction\a ... to the hosts listed in \afile\a. If \afile\a is + omitted then \badmin.db\b is assumed. The caller must have + \brcp\b(1) and \brsh\b(1) or \bscp\b(1) and \bssh\b(1) access + to the hosts. Output for \aaction\a is saved per-host in the + file \aaction\a\b.log/\b\ahost\a. Logs can be viewed by + \bpackage admin\b [\bon\b \ahost\a]] \bresults\b [\aaction\a]]. + By default only local PACKAGEROOT hosts are selected from + \afile\a; \ball\b selects all hosts. \bon\b \apattern\a selects + only hosts matching the \b|\b separated \apattern\a. \afile\a + contains four types of lines. Blank lines and lines beginning + with \b#\b are ignored. Lines starting with \aid\a=\avalue\a + are variable assignments. Set admin_ping to local conventions + if \"'$admin_ping$'\" fails. If a package list is not specified + on the command line the \aaction\a applies to all packages; a + variable assigment \bpackage\b=\"\alist\a\" applies \aaction\a + to the packages in \alist\a for subsequent hosts in \afile\a. + The remaining line type is a host description consisting of 6 + tab separated fields. The first 3 are mandatory; the remaining + 3 are updated by the \badmin\b action. \afile\a is saved in + \afile\a\b.old\b before update. The fields are:] + { + [+hosttype?The host type as reported by + \"\bpackage\b\".] + [+[user@]]host?The host name and optionally user name + for \brcp\b(1) and \brsh\b(1) access.] + [+[remote::[[master]]::]]]]PACKAGEROOT?The absolute remote package + root directory and optionally the remote protocol (rsh + or ssh) if the directory is on a different server than + the master package root directory. If + \blib/package/admin/'$admin_env$'\b exists under this + directory then it is sourced by \bsh\b(1) before + \aaction\a is done. If this field begins with \b-\b + then the host is ignored. If this field contains \b:\b + then \bditto\b(1) is used to sync the remote \bsrc\b + directory hierarchy to the local one. If [\amaster\a]]: + is specified then the sync is deferred to the \amaster\a + host. If \amaster\a is omitted (two :) then the sync is + disabled. These directories must exist on the remote side: + \blib/package\b, \bsrc/cmd\b, \bsrc/lib\b.] + [+date?\aYYMMDD\a of the last action.] + [+time?Elapsed wall time for the last action.] + [+M T W?The \badmin\b action \bmake\b, \btest\b and + \bwrite\b action error counts. A non-numeric value in + any of these fields disables the corresponding action.] + } + [+clean | clobber?Delete the \barch/\b\aHOSTTYPE\a hierarchy; this + deletes all generated files and directories for \aHOSTTYPE\a. + The heirarchy can be rebuilt by \bpackage make\b.] + [+contents\b [ \apackage\a ... ]]?List description and + components for \apackage\a on the standard output.] + [+copyright\b [ \apackage\a ... ]]?List the general copyright + notice(s) for \apackage\a on the standard output. Note that + individual components in \apackage\a may contain additional or + replacement notices.] + [+export\b [ \avariable\a ...]]?List \aname\a=\avalue\a for + \avariable\a, one per line. If the \bonly\b attribute is + specified then only the variable values are listed. If no + variables are specified then \b'$env$'\b are assumed.] + [+help\b [ \aaction\a ]]?Display help text on the standard + error (standard output for \aaction\a).] + [+host\b [ \aattribute\a ... ]]?List + architecture/implementation dependent host information on the + standard output. \btype\b is listed if no attributes are + specified. Information is listed on a single line in + \aattribute\a order. The attributes are:] + { + [+canon \aname\a?An external host type name to be + converted to \bpackage\b syntax.] + [+cpu?The number of cpus; 1 if the host is not a + multiprocessor.] + [+name?The host name.] + [+rating?The cpu rating in pseudo mips; the value is + useful useful only in comparisons with rating values of + other hosts. Other than a vax rating (mercifully) fixed + at 1, ratings can vary wildly but consistently from + vendor mips ratings. \bcc\b(1) may be required to + determine the rating.] + [+type?The host type, usually in the form + \avendor\a.\aarchitecture\a, with an optional trailing + -\aversion\a. The main theme is that type names within + a family of architectures are named in a similar, + predictable style. OS point release information is + avoided as much as possible, but vendor resistance to + release incompatibilities has for the most part been + futile.] + } + [+html\b [ \aaction\a ]]?Display html help text on the standard + error (standard output for \aaction\a).] + [+install\b [ \aarchitecture\a ... ]] \adirectory\a [ \apackage\a ... ]]?Copy + the package binary hierarchy to \adirectory\a. If + \aarchitecture\a is omitted then all architectures are + installed. If \bflat\b is specified then exactly one + \aarchitecture\a must be specified; this architecture will be + installed in \adirectory\a without the \barch/\b\aHOSTTYPE\a + directory prefixes. Otherwise each architecture will be + installed in a separate \barch/\b\aHOSTTYPE\a subdirectory of + \adirectory\a. The \aarchitecture\a \b-\b names the current + architecture. \adirectory\a must be an existing directory. If + \apackage\a is omitted then all binary packages are installed. + This action requires \bnmake\b.] + [+license\b [ \apackage\a ... ]]?List the source license(s) for + \apackage\a on the standard output. Note that individual + components in \apackage\a may contain additional or replacement + licenses.] + [+list\b [ \apackage\a ... ]]?List the name, version and + prerequisites for \apackage\a on the standard output.] + [+make\b [ \apackage\a ]] [ \aoption\a ... ]] [ \atarget\a ... ]]?Build + and install. The default \atarget\a is \binstall\b, which makes + and installs \apackage\a. If the standard output is a terminal + then the output is also captured in + \b$INSTALLROOT/lib/package/gen/make.out\b. The build is done in + the \b$INSTALLROOT\b directory tree viewpathed on top of the + \b$PACKAGEROOT\b directory tree. If \bflat\b is specified then + the \b$INSTALLROOT\b { bin fun include lib } directories are + linked to the same directories in the package root. Only one + architecture may be \bflat\b. Leaf directory names matching the + \b|\b-separated shell pattern \b$MAKESKIP\b are ignored. The + \bview\b action is done before making. \aoption\a operands are + passed to the underlying make command.] + [+read\b [ \apackage\a ... | \aarchive\a ... ]]?Read the named + package or archive(s). Must be run from the package root + directory. Archives are searched for in \b.\b and + \blib/package/tgz\b. Each package archive is read only once. + The file \blib/package/tgz/\b\apackage\a[.\atype\a]]\b.tim\b + tracks the read time. See the \bwrite\b action for archive + naming conventions. Text file archive member are assumed to be + ASCII or UTF-8 encoded.] + [+regress?\bdiff\b(1) the current and previous \bpackage test\b + results.] + [+release\b [ [\aCC\a]]\aYY-MM-DD\a [ [\acc\a]]\ayy-mm-dd\a ]]]] [ \apackage\a ]]?Display + recent changes for the date range [\aCC\a]]\aYY-MM-DD\a (up to + [\acc\a]]\ayy-mm-dd\a.), where \b-\b means lowest (or highest.) + If no dates are specified then changes for the last 4 months + are listed. \apackage\a may be a package or component name.] + [+remove\b [ \apackage\a ]]?Remove files installed for + \apackage\a.] + [+results\b [ \bfailed\b ]] [ \bpath\b ]] [ \bold\b ]] [\bmake\b | \btest\b | \bwrite\b ]]?List + results and interesting messages captured by the most recent + \bmake\b (default), \btest\b or \bwrite\b action. \bold\b + specifies the previous results, if any (current and previous + results are retained.) \b$HOME/.pkgresults\b, if it exists, + must contain an \begrep\b(1) expression of result lines to be + ignored. \bfailed\b lists failures only and \bpath\b lists the + results file path name only.] + [+setup\b [ beta ]] [ binary ]] [ source ]] [ \aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?This + action initializes the current directory as a package root, runs the + \bupdate\b action to download new or out of date packages, and runs the + \bread\b action on those packages. If \bflat\b is specified then the + \b$INSTALLROOT\b { bin fun include lib } directories are linked to the + same directories in the package root. Only one architecture may be + \bflat\b. See the \bupdate\b and \bread\b action descriptions for + argument details.] + [+test\b [ \apackage\a ]]?Run the regression tests for + \apackage\a. If the standard output is a terminal then the + output is also captured in + \b$INSTALLROOT/lib/package/gen/test.out\b. In general a package + must be made before it can be tested. Components tested with + the \bregress\b(1) command require \bksh93\b. If \bonly\b is + also specified then only the listed package components are + tested, otherwise the closure of the components is tested.] + [+update\b [ beta ]] [ binary ]] [ source ]] [\aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?Download + the latest release of the selected and required packages from \aurl\a + (e.g., \bhttp://www.research.att.com/sw/download\b) into the directory + \b$PACKAGEROOT/lib/package/tgz\b. \bbeta\b acesses beta packages; + download these at your own risk. If \aarchitecture\a is omitted then + only architectures already present in the \btgz\b directory will be + downloaded. If \aarchitecture\a is \b-\b then all posted architectures + will be downloaded. If \aurl\a matches \b*.url\b then it is interpreted + as a file containing shell variable assignments for \burl\b, + \bauthorize\b and \bpassword\b. If \aurl\a is omitted then the + definitions for \burl\b, \bauthorize\b and \bpassword\b in + \b$PACKAGEROOT/lib/package/tgz/default.url\b, if it exists, are used. + If \b$PACKAGEROOT/lib/package/tgz/default.url\b does not exist then it + is initialized with the current \burl\b, \bauthorize\b and \bpassword\b + values and read permission for the current user only. If \apackage\a is + omitted then only packages already present in the tgz directory will be + downloaded. If \apackage\a is \b-\b then all posted packages will be + downloaded. If \bsource\b and \bbinary\b are omitted then both source + and binary packages will be downloaded. If \bonly\b is specified then + only the named packages are updated; otherwise the closure of required + packages is updated. This action requires \bwget\b(1), \blynx\b(1), + \bcurl\b(1) or a shell that supports io to + \b/dev/tcp/\b\ahost\a/\aport\a.] + [+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run + \acommand\a, or an interactive shell if \acommand\a is omitted, + with the environment initialized for using the package (can you + say \ashared\a \alibrary\a or \adll\a without cussing?) If + \auid\a or \apackage\a or \a.\a is specified then it is used + to determine a \b$PACKAGEROOT\b, possibly different from + the current directory. For example, to try out bozo`s package: + \bpackage use bozo\b. The \buse\b action may be run from any + directory. If the file \b$INSTALLROOT/lib/package/profile\b is + readable then it is sourced to initialize the environment. 32 or 64 + implies \b$PACKAGEROOT\b of . and specifies the target architecture + word size (which may be silently ignored.)] + [+verify\b [ \apackage\a ]]?Verify installed binary files + against the checksum files in + \b$INSTALLROOT/lib/\b\apackage\a\b/gen/*.sum\b. The checksum + files contain mode, user and group information. If the checksum + matches for a given file then the mode, user and group are + changed as necessary to match the checksum entry. A warning is + printed on the standard error for each mismatch. Requires the + \bast\b package \bcksum\b(1) command.] + [+view\b?Initialize the architecture specific viewpath + hierarchy. If \bflat\b is specified then the \b$INSTALLROOT\b { + bin fun include lib } directories are linked to the same + directories in the package root. Only one architecture may be + \bflat\b. The \bmake\b action implicitly calls this action.] + [+write\b [\aformat\a]] \atype\a ... [ \apackage\a ...]]?Write + a package archive for \apackage\a. All work is done in the + \b$PACKAGEROOT/lib/package\b directory. \aformat\a-specific + files are placed in the \aformat\a subdirectory. A + \apackage\a[.\atype\a]]\b.tim\b file in this directory tracks + the write time and prevents a package from being read in the + same root it was written. If more than one file is generated + for a particular \aformat\a then those files are placed in the + \aformat\a/\apackage\a subdirectory. File names in the + \aformat\a subdirectory will contain the package name, a + \ayyyy-mm-dd\a date, and for binary packages, \aHOSTTYPE\a. If + \apackage\a is omitted then an ordered list of previously + written packages is generated. If \bonly\b is specified then + only the named packages will be written; otherwise prerequisite + packages are written first. Package components must be listed + in \apackage\a\b.pkg\b. \aformat\a may be one of:] + { + [+cyg?Generate a \bcygwin\b package.] + [+exp?Generate an \bexptools\b maintainer source + archive and \aNPD\a file, suitable for \bexpmake\b(1)] + [+lcl?Generate a package archive suitable for + restoration into the local source tree (i.e., the + source is not annotated for licencing.)] + [+pkg?Generate a \bpkgmk\b(1) package suitable for + \bpkgadd\b(1).] + [+rpm?Generate an \brpm\b(1) package.] + [+tgz?Generate a \bgzip\b(1) \btar\b(1) package + archive. This is the default.] + [+tst?Generate a \btgz\b format package archive in the + \btst\b subdirectory. Version state files are not updated.] + } + [+?\btype\b specifies the package type which must be one of + \bsource\b, \bbinary\b or \bruntime\b. A source package + contains the source needed to build the corresponding binary + package. A binary package includes the libraries and headers + needed for compiling and linking against the public interfaces. + A runtime package contains the commands and required dynamic + libraries.] + [+?A package may be either a \bbase\b or \bdelta\b. A base + package contains a complete copy of all components. A delta + package contains only changes from a previous base package. + Delta recipients must have the \bast\b \bpax\b(1) command (in + the \bast-base\b package.) If neither \bbase\b nor \bdelta\b is + specified, then the current base is overwritten if there are no + deltas referring to the current base. Only the \btgz\b and + \blcl\b formats support \bdelta\b. If \bbase\b is specified + then a new base and two delta archives are generated: one delta + to generate the new base from the old, and one delta to + generate the old base from the new; the old base is then + removed. If \bdelta\b is specified then a new delta referring + to the current base is written.] + [+?\apackage\a\b.pkg\b may reference other packages. By default + a pointer to those packages is written. The recipient \bpackage + read\b will then check that all required packages have been + downloaded. If \bclosure\b is specified then the components for + all package references are included in the generated package. + This may be useful for \blcl\b and versioning.] + [+?All formats but \blcl\b annotate each \bsource\b file (not + already annotated) with a license comment as it is written to + the package archive using \bproto\b(1).] + } +[+DETAILS?The package directory hierarchy is rooted at + \b$PACKAGEROOT\b. All source and binaries reside under this tree. A two + level viewpath is used to separate source and binaries. The top view is + architecture specific, the bottom view is shared source. All building + is done in the architecture specific view; no source view files are + intentionally changed. This means that many different binary + architectures can be made from a single copy of the source.] +[+?Independent \b$PACKAGEROOT\b hierarchies can be combined by + appending \b$INSTALLROOT:$PACKAGEROOT\b pairs to \bVPATH\b. The + \bVPATH\b viewing order is from left to right. Each \b$PACKAGEROOT\b + must have a \b$PACKAGEROOT/lib/package\b directory.] +[+?Each package contains one or more components. Component source for + the \afoo\a command is in \b$PACKAGEROOT/src/cmd/\b\afoo\a, and source + for the \abar\a library is in \b$PACKAGEROOT/src/lib/lib\b\abar\a. This + naming is for convenience only; the underlying makefiles handle + inter-component build order. The \bINIT\b component, which contains + generic package support files, is always made first, then the + components named \bINIT\b*, then the component order determined by the + closure of component makefile dependencies.] +[+?\b$PACKAGEROOT/lib/package\b contains package specific files. The + package naming convention is \agroup\a[-\apart\a]]; e.g., \bast-base\b, + \bgnu-fileutils\b. The *\b.pkg\b files are ast \bnmake\b(1) makefiles + that contain the package name, package components, references to other + packages, and a short package description. *\b.pkg\b files are used by + \bpackage write\b to generate new source and binary packages.] +[+?\b$PACKAGEROOT/lib/package/\b\agroup\a\b.lic\b files contain license + information that is used by the \bast\b \bproto\b(1) and \bnmake\b(1) + commands to generate source and binary license strings. \agroup\a is + determined by the first \b:PACKAGE:\b operator name listed in the + component \bnmake\b makefile. \agroup\a\b.lic\b files are part of the + licensing documentation. Each component may have its own \bLICENSE\b file + that overrides the \agroup\a\b.lic\b file. The full text of the licenses + are in the \b$PACKAGEROOT/lib/package/LICENSES\b and + \b$INSTALLROOT/lib/package/LICENSES\b directories.] +[+?A few files are generated in \b$PACKAGEROOT/lib/package/gen\b and + \b$INSTALLROOT/lib/package/gen\b. \apackage\a\b.ver\b contains one line + consisting of \apackage version release\a \b1\b for the most recent + instance of \apackage\a read into \b$PACKAGEROOT\b, where \apackage\a + is the package name, \aversion\a is the \aYYYY-MM-DD\a base version, + and \arelease\a is \aversion\a for the base release or \aYYYY-MM-DD\a + for delta releases. \apackage\a\b.req\b contains *\b.ver\b entries for + the packages required by \apackage\a, except that the fourth field is + \b0\b instead of \b1\b. All packages except \bINIT\b require the + \bINIT\b package. A simple sort of \apackage\a\b.pkg\b and *\b.ver\b + determines if the required package have been read in. Finally, + \apackage\a\b.README\b and \apackage\a\a.html\b contain the README text + for \apackage\a and all its components. Included are all changes added + to the component \bRELEASE\b, \bCHANGES\b or \bChangeLog\b files dated + since the two most recent base releases. Component \bRELEASE\b files + contain tag lines of the form [\aYY\a]]\aYY-MM-DD\a [ \atext\a ]] (or + \bdate\b(1) format dates) followed by README text, in reverse + chronological order (newer entries at the top of the file.) \bpackage + release\b lists this information, and \bpackage contents ...\b lists + the descriptions and components.] +[+?\b$HOSTYPE\b names the current binary architecture and is determined + by the output of \bpackage\b (no arguments.) The \b$HOSTTYPE\b naming + scheme is used to separate incompatible executable and object formats. + All architecture specific binaries are placed under \b$INSTALLROOT\b + (\b$PACKAGEROOT/arch/$HOSTTYPE\b.) There are a few places that match + against \b$HOSTTYPE\b when making binaries; these are limited to + makefile compiler workarounds, e.g., if \b$HOSTTYPE\b matches \bhp.*\b + then turn off the optimizer for these objects. All other architecture + dependent logic is handled either by the \bast\b \biffe\b(1) command or + by component specific configure scripts. Explicit \b$HOSTYPE\b + values matching *,*cc*[,-*,...]] optionally set the default \bCC\b and + \bCCFLAGS\b. This is handy for build farms that support different + compilers on the same architecture.] +[+?Each component contains an \bast\b \bnmake\b(1) makefile (either + \bNmakefile\b or \bMakefile\b) and a \bMAM\b (make abstract machine) + file (\bMamfile\b.) A Mamfile contains a portable makefile description + that is used by \bmamake\b(1) to simulate \bnmake\b. Currently there is + no support for old-make/gnu-make makefiles; if the binaries are just + being built then \bmamake\b will suffice; if source or makefile + modifications are anticipated then \bnmake\b (in the \bast-base\b + package) should be used. Mamfiles are automatically generated by + \bpackage write\b.] +[+?Most component C source is prototyped. If \b$CC\b (default value + \bcc\b) is not a prototyping C compiler then \bpackage make\b runs + \bproto\b(1) on portions of the \b$PACKAGEROOT/src\b tree and places + the converted output files in the \b$PACKAGEROOT/proto/src\b tree. + Converted files are then viewpathed over the original source. + \bproto\b(1) converts an ANSI C subset to code that is compatible with + K&R, ANSI, and C++ dialects.] +[+?All scripts and commands under \b$PACKAGEROOT\b use \b$PATH\b + relative pathnames (via the \bast\b \bpathpath\b(3) function); there + are no imbedded absolute pathnames. This means that binaries generated + under \b$PACKAGEROOT\b may be copied to a different root; users need + only change their \b$PATH\b variable to reference the new installation + root \bbin\b directory. \bpackage install\b installs binary packages in + a new \b$INSTALLROOT\b.] + +[ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] + +[+SEE ALSO?\bautoconfig\b(1), \bcksum\b(1), \bexecrate\b(1), \bexpmake\b(1), + \bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bnmake\b(1), \bpax\b(1), + \bpkgadd\b(1), \bpkgmk\b(1), \bproto\b(1), \bratz\b(1), \brpm\b(1), + \bsh\b(1), \btar\b(1), \boptget\b(3)] +' + case $* in + help) set -- --man ;; + esac + while getopts -a $command "$USAGE" OPT + do : + done + shift $OPTIND-1 + ;; +esac + +# check the args + +case $AR in +'') AR=ar ;; +esac +case $CC in +'') CC=cc ;; +esac +case $LD in +'') LD=ld ;; +esac +case $NM in +'') NM=nm ;; +esac + +action= +admin_all=1 +admin_on= +authorize= +bit= +exec= +flat=0 +force=0 +global= +hi= +html=0 +ifs=${IFS-' + '} +lo= +make= +makeflags='-k -K' +nmakeflags= +nmakesep= +nl=" +" +noexec= +only=0 +output= +package_src= +password= +quiet=0 +show=: +tab=" " +verbose=0 +AUTHORIZE= +DEBUG= +HURL= +PROTOROOT=- +SHELLMAGIC=- + +unset FIGNORE BINDIR DLLDIR ETCDIR FUNDIR INCLUDEDIR LIBDIR LOCALEDIR MANDIR SHAREDIR 2>/dev/null || true + +while : +do case $# in + 0) set host type ;; + esac + case $1 in + admin|clean|clobber|contents|copyright|export|host|install|license|list|make|read|regress|release|remove|results|setup|test|update|use|verify|view|write|TEST) + action=$1 + shift + break + ;; + authorize) + case $# in + 1) echo $command: $1: authorization user name argument expected >&2; exit 1 ;; + esac + shift + authorize=$1 + shift + continue + ;; + debug|environment) + exec=echo make=echo show=echo + ;; + flat) flat=1 + ;; + force) force=1 + ;; + never) exec=echo noexec=-N + ;; + only) only=1 + ;; + password) + case $# in + 1) echo $command: $1: authorization password argument expected >&2; exit 1 ;; + esac + shift + password=$1 + shift + continue + ;; + quiet) quiet=1 + ;; + show) exec=echo noexec=-n + ;; + verbose)verbose=1 + ;; + DEBUG) DEBUG=1 + PS4='+$LINENO:$SECONDS+ ' + set -x + ;; + help|HELP|html|man|--[?m]*) + case $1 in + help) code=0 + case $2 in + '') exec 1>&2 ;; + esac + ;; + html) code=0 html=1 + ;; + *) code=2 + exec 1>&2 + ;; + esac + case $html in + 1) bO=" + +$2 package installation instructions + +" + eO=' +' + bH="

" + eH='

' + bP='

' + bL='

' + bL2='

' + eL='

' + bT='' + bD='' eD='' + bB='' eB='' + bI='' eI='' + bX='

'			eX='
' + bF='' eF='' + Camp='&' + Mcurl='
curl(1)' + Mdate='date(1)' + Mfile='file(1)' + Mgunzip='gunzip(1)' + Mhurl='hurl(1)' + Mlynx='lynx(1)' + Mnmake='nmake(1)' + Mpackage='package(1)' + Mproto='proto(1)' + Mratz='ratz' + Mtar='tar(1)' + Mwget='wget(1)' + ;; + *) bO='' eO='' + bH='' eH=':' + bP='' + bL='' eL='' + bL2='' + bT=' ' + bD=' ' eD='' + bB='' eB='' + bI='' eI='' + bX='' eX='' + bF='"' eF='"' + Camp='&' + Mcurl='curl(1)' + Mdate='date(1)' + Mfile='file(1)' + Mgunzip='gunzip(1)' + Mhurl='hurl(1)' + Mlynx='lynx(1)' + Mnmake='nmake(1)' + Mpackage='package(1)' + Mproto='proto(1)' + Mratz='ratz' + Mtar='tar(1)' + Mwget='wget(1)' + ;; + esac + case $2 in + binary) echo "${bO} +${bH}Binary Package Installation Instructions${eH} +${bL} +${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may + have setuid executables, few must be owned by ${bI}root${eI}. These are best + changed manually when the security implications are understood.${eD} +${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work + area for all packages.${eD} +${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the + download site. If you already clicked, or if your system does not have + ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions + for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} + script which works with ksh and modern bash. The top level URL is:${bX} + URL=http://www.research.att.com/sw/download${eX}${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} + test -d bin || mkdir bin + url=\$URL/package + (wget -O bin/package \$url||curl -L \$url||hurl \$url) > bin/package + chmod +x bin/package${eX}${eD} +${bT}(5)${bD}Determine the list of package names you want from the download site, then + use the ${Mpackage} command to do the actual download:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + setup binary \$URL ${bI}PACKAGE${eI} ...${eX} + (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for + ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest + binary package(s); covered and up-to-date packages are not downloaded again unless + ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. + If the package root will contain only one architecture then you can install in ${bB}bin${eB} and + ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this + instead:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + flat setup binary \$URL ${bB}PACKAGE${eB} ...${eX} + To update the same packages from the same URL run:${bX} + bin/package setup binary${eX}${eD} +${bT}(6)${bD}The packaged binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + ${Mfile} and ${Mnmake}, require the path of the bin directory to be + exported in ${bB}PATH${eb}.${eD} +${bT}(7)${bD}You can run the binaries directly from the package root, or you can + install them in a public root (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} + bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} + This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to + preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the + ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a + flat install:${bX} + cd \$INSTALLROOT + cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} +${bT}(8)${bD}To summarize, after the first time, the download cycle for the latest + binary release is:${bX} + bin/package setup binary${eX}${eD}${eL} + +${bH}Binary Package Installation Instructions -- Plan B${eH} +${bL} +${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives + into that directory.${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} + binary package:${bX} + gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz | + ${TAR} ${TARFLAGS}f -${eX} + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz + If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} + binary package:${bX} + mkdir bin + cp lib/package/tgz/ratz.${bI}YYYY-MM-DD.HOSTTYPE${eI}.exe bin/ratz + chmod +x bin/ratz + bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD/HOSTTYPE${eI}.tgz +${bT}(5)${bD}Read all unread package archive(s):${bX} + bin/package read${eX} + Both source and binary packages will be read by this step.${eD}${eL}${eO}" + ;; + intro) echo "${bO} +${bH}Package Hierarchy Details${eH} +${bP} +The package directory hierarchy is rooted at ${bB}\$PACKAGEROOT${eB}. All source and +binaries reside under this tree. A two level viewpath is used to separate +source and binaries. The top view is architecture specific, the bottom view +is shared source. All building is done in the architecture specific view; +no source view files are intentionally changed. This means that many +different binary architectures can be made from a single copy of the source. +${bP} +Each package contains one or more components. Component source for the ${bI}FOO${eI} +command is in ${bB}\$PACKAGEROOT/src/cmd/${eB}${bI}FOO${eI}, and source for the ${bI}BAR${eI} library is +in ${bB}\$PACKAGEROOT/src/lib/lib${eB}${bI}BAR${eI}. This naming is for convenience only; the +underlying makefiles handle inter-component build order. The ${bB}INIT${eB} component, +which contains generic package support files, is always made first, then the +components named ${bB}INIT${eB}*, then the order determined by the closure of component +makefile dependencies. +${bP} +${bB}\$PACKAGEROOT/lib/package${eB} contains package specific files. The package naming +convention is ${bI}GROUP${eI}[${bI}-PART${eI}]; e.g., ${bB}ast-base${eB}, ${bB}gnu-fileutils${eB}. The *${bB}.pkg${eB} files +are ${bB}ast${eB} ${Mnmake} makefiles that contain the package name, package components, +references to other packages, and a short package description. *${bB}.pkg${eB} files +are used by ${bF}package write${eF} to generate new source and binary packages. +${bP} +${bB}\$PACKAGEROOT/lib/package/${eB}${bI}GROUP${eI}${bB}.lic${eB} files contain license information that +is used by the ${bB}ast${eB} ${Mproto} and ${Mnmake} commands to generate source and +binary license strings. ${bI}GROUP${eI} is determined by the first ${bB}:PACKAGE:${eB} operator +name listed in the component ${bB}nmake${eB} makefile. ${bI}GROUP${eI}${bB}.lic${eB} files are part of the +licensing documentation. Each component may have its own ${bB}LICENSE${eB} file that +overrides the ${bI}GROUP${eI}${bB}.lic${eB} file. The full text of the licenses are in the +${bB}\$PACKAGEROOT/lib/package/LICENSES${eB} and ${bB}\$INSTALLROOT/lib/package/LICENSES${eB} +directories. +${bP} +A few files are generated in ${bB}\$PACKAGEROOT/lib/package/gen${eB} and +${bB}\$INSTALLROOT/lib/package/gen${eB}. ${bI}PACKAGE${eI}${bB}.ver${eB} contains one line consisting of${bX} + ${bI}PACKAGE VERSION RELEASE${eI} 1${eX} +for the most recent instance of ${bI}PACKAGE${eI} read into ${bB}\$PACKAGEROOT${eB}, where +${bI}PACKAGE${eI} is the package name, ${bI}VERSION${eI} is the ${bI}YYYY-MM-DD${eI} base version, +and ${bI}RELEASE${eI} is ${bI}VERSION${eI} for the base release or ${bI}YYYY-MM-DD${eI} for delta releases. +${bI}PACKAGE${eI}${bB}.req${eB} contains *${bB}.ver${eB} entries for the packages required by +${bI}PACKAGE${eI}, except that the fourth field is 0 instead of 1. All packages +except ${bB}INIT${eB} and ${Mratz} require the ${bB}INIT${eB} package. A simple sort of ${bI}PACKAGE${eI}${bB}.pkg${eB} +and *${bB}.ver${eB} determines if the required package have been read in. Finally, +${bI}PACKAGE${eI}${bB}.README${eB} contains the ${bB}README${eB} text for ${bI}PACKAGE${eI} and all its +components. Included are all changes added to the component ${bB}RELEASE${eB}, +${bB}CHANGES${eB} or ${bB}ChangeLog${eB} files dated since the two most recent base +releases. Component ${bB}RELEASE${eB} files contain tag lines of the form +[${bI}CC${eI}]${bI}YY-MM-DD${eI} [ ${bI}TEXT${eI} ] (or ${Mdate} format dates) followed by README +text, in reverse chronological order (newer entries at the top of the +file.) ${bF}package release${eF} generates this information, and +${bF}package contents ...${eF} lists the descriptions and components. +${bP} +${bB}\$HOSTYPE${eB} names the current binary architecture and is determined by the +output of ${bF}package${eF} (no arguments.) The ${bB}\$HOSTTYPE${eB} naming scheme is used +to separate incompatible executable and object formats. All architecture +specific binaries are placed under ${bB}\$INSTALLROOT${eB} (${bB}\$PACKAGEROOT/arch/\$HOSTTYPE${eB}.) +There are a few places that match against ${bB}\$HOSTTYPE${eB} when making binaries; these +are limited to makefile compiler workarounds, e.g., if ${bB}\$HOSTTYPE${eB} matches +'hp.*' then turn off the optimizer for these objects. All other architecture +dependent logic is handled either by ${bB}\$INSTALLROOT/bin/iffe${eB} or by component +specific configure scripts. Explicit ${bB}\$HOSTYPE${eB} values matching *,*cc*[,-*,...] +optionally set the default ${bB}CC${eB} and ${bB}CCFLAGS${eB}. This is handy for build +farms that support different compilers on the same architecture. +${bP} +Each component contains an ${bB}ast${eB} ${Mnmake} makefile (either ${bB}Nmakefile${eB} or ${bB}Makefile${eB}) +and a ${bI}MAM${eI} (make abstract machine) file (${bB}Mamfile${eB}.) A Mamfile contains a portable +makefile description that is used by ${bB}\$INSTALLROOT/bin/mamake${eB} to simulate +${bB}nmake${eB}. Currently there is no support for old-make/gnu-make makefiles; if +the binaries are just being built then ${bB}mamake${eB} will suffice; if source or +makefile modifications are anticipated then ${bB}nmake${eB} (from the ${bB}ast-open${eB} or +${bB}ast-base${eB} package) should be used. Mamfiles are automatically generated by +${bF}package write${eF}. +${bP} +Most component C source is prototyped. If ${bB}\$CC${eB} (default value ${bB}cc${eB}) is not a +prototyping C compiler then ${bF}package make${eF} runs ${Mproto} on portions of the +${bB}\$PACKAGEROOT/src${eB} tree and places the converted output files in the +${bB}\$PACKAGEROOT/proto/src${eB} tree. Converted files are then viewpathed over the +original source. The ${bB}ast${eB} ${Mproto} command converts an ANSI C subset to code +that is compatible with K&R, ANSI, and C++ dialects. +${bP} +All scripts and commands under ${bB}\$PACKAGEROOT${eB} use ${bB}\$PATH${eB} relative pathnames; +there are no imbedded absolute pathnames. This means that binaries generated +under ${bB}\$PACKAGEROOT${eB} may be copied to a different root; users need only change +their ${bB}\$PATH${eB} variable to reference the new instalation root bin directory. +${bF}package install${eF} installs binary packages in a new ${bB}\$INSTALLROOT${eB}. +${eO}" + ;; + source) echo "${bO} +${bH}Source Package Installation Instructions${eH} +${bL} +${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may + have setuid executables, few must be owned by ${bI}root${eI}. These are best + changed manually when the security implications are understood.${eD} +${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work + area for all packages. +${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the + download site. If you already clicked, or if your system does not have + ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions + for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} + script which works with ksh and modern bash. The top level URL is:${bX} + URL=http://www.research.att.com/sw/download${eX}${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} + test -d bin || mkdir bin + url=\$URL/package + (wget -O bin/package \$url||curl -L \$url||hurl \$url) > bin/package + chmod +x bin/package${eX}${eD} +${bT}(5)${bD}Determine the list of package names you want from the download site, then + use the ${Mpackage} command to do the actual download:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + setup source \$URL ${bB}PACKAGE${eB} ...${eX} + (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for + ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest + source package(s); covered and up-to-date packages are not downloaded again unless + ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. + If the package root will contain only one architecture then you can install in ${bB}bin${eB} and + ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this + instead:${bX} + bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ + flat setup source \$URL ${bB}PACKAGE${eB} ...${eX} + To update the same packages from the same URL run:${bX} + bin/package setup source${eX}${eD} +${bT}(6)${bD}Build and install; all generated files are placed under ${bB}arch/${eB}${bI}HOSTTYPE${eI} + (${bB}\$INSTALLROOT${eB}), where ${bI}HOSTTYPE${eI} is the output of ${bB}bin/package${eB} (with no + arguments.) ${bI}name=value${eI} arguments are supported; ${bB}CC${eB} and ${bB}debug=1${eB} (compile + with -g instead of -O) are likely candidates. The output is written to + the terminal and captured in ${bB}\$INSTALLROOT/lib/package/gen/make.out${eB}:${bX} + bin/package make${eX}${eD} +${bT}(7)${bD}List make results and interesting errors:${bX} + bin/package results${eX} + Run the regression tests:${bX} + bin/package test${eX} + List test results and errors:${bX} + bin/package results test${eX}${eD} +${bT}(8)${bD}The generated binaries are position independent, i.e., they do not + contain hard-coded paths. However, commands with related files, like + ${Mfile} and ${Mnmake}, require the path of the bin directory to be + exported in ${bB}PATH${eb}.${eD} +${bT}(9)${bD}You can run the binaries directly from the package root, or you can + install them in a public root after you are satisfied with the make and + test actions (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} + bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} + This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to + preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the + ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a + flat install:${bX} + cd \$INSTALLROOT + cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} +${bT}(10)${bD}To summarize, after the first time the download, build, and test cycle + for the latest source release is:${bX} + bin/package setup source + bin/package make + bin/package test${eX}${eD}${eL} + +${bH}Source Package Installation Instructions -- Plan B${eH} +${bL} +${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives + into that directory.${eD} +${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} + source package:${bX} + gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz | ${TAR} ${TARFLAGS}f -${eX} + Note that some browsers automatically unzip downloaded without warning. + If the gunzip fails try: + ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz + If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} + source package, compile it, and manually read the ${bB}INIT${eB} + source package:${bX} + mkdir bin + cp lib/package/tgz/ratz.${bI}YYYY-MM-DD${eI}.c lib/package/tgz/ratz.c + cc -o bin/ratz lib/package/tgz/ratz.c + bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz +${bT}(5)${bD}Read all unread package archive(s):${bX} + bin/package read${eX} + Both source and binary packages will be read by this step.${eD}${eL}${eO}" + ;; + *) echo "Usage: $command [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] + + The $command command controls source and binary packages. It must be run + within the package root directory tree. See \"$command help intro\" for + details. In the following, PACKAGE names either a package or a component + within a package; if omitted, all packages are operated on. The default + action is \"host type\". + + qualifier: + authorize NAME Remote authorization name or license acceptance phrase. + debug|environment Show environment and actions; do not execute. + flat Collapse \$INSTALLROOT { bin fun include lib } onto \$PACKAGEROOT. + force Force the action to override saved state. + never Run make -N; otherwise show other actions. + only Only operate on the specified packages. + password PASSWORD Remote authorization or license acceptance password. + quiet Do not list captured make and test action output. + show Run make -n; otherwise show other actions. + DEBUG Trace the package script actions in detail for debugging. + action: + admin [ all ] [ db FILE ] [ on PATTERN ] [ action ... ] + Apply ACTION ... to the hosts listed in FILE. If FILE is + omitted then "admin.db" is assumed. The caller must have rcp(1) + and rsh(1) or scp(1) and ssh(1) access to the hosts. Output + for the action is saved per-host in ACTION.log/HOST. Logs + can be viewed by \"package admin [on HOST] results [ACTION]\". + By default only local PACKAGEROOT hosts are selected from FILE; + \"all\" selects all hosts. \"on PATTERN\" selects only + hosts matching the | separated PATTERN. FILE contains four + types of lines. Blank lines and lines beginning with # are + ignored. Lines starting with id=value are variable assignments. + Set admin_ping to local conventions if \"$admin_ping\" fails. + If a package list is not specified on the command line the + action applies to all packages; a variable assigment + package=list applies action to the packages in list for + subsequent hosts in FILE. The remaining line type is a host + description consisting of 6 tab separated fields. The first 3 + are mandatory; the remaining 3 are updated by the admin action: + hosttype + The host type as reported by package. + [user@]host + The host name and optionally user name for rcp(1) + and rsh(1) access. + [remote:[[master]:]]PACKAGEROOT + The absolute remote package root directory and + optionally the remote prorocol (rsh or ssh) if + the directory is on a different server than the + master package root directory. If + lib/package/admin/$admin_env exists under + this directory then it is sourced by sh(1) + before ACTION is done. If this field begins with - + then the host is ignored. If this field contains + : then ditto(1) is used to sync the remote src + directory hierarchy to the local one. If [master]: + is specified then the sync is deferred to the + master host. If master is omitted (two :) then + the sync is disabled. These directories must exist + on the remote side: lib/package, src/cmd, src/lib. + date YYMMDD of the last action. + date Elapsed wall time of the last action. + M T W The admin action make, test and write action error + counts. A non-numeric value in any of these fields + disables the corresponding action. + clean | clobber + Delete the arch/HOSTTYPE hierarchy; this deletes all generated + files and directories for HOSTTYPE. The heirarchy can be rebuilt + by package make.] + contents [ package ... ] + List description and components for PACKAGE on the standard + output. + copyright [ package ... ] + List the general copyright notice(s) for PACKAGE on the + standard output. Note that individual components in PACKAGE + may contain additional or replacement notices. + export [ VARIABLE ... ] + List NAME=VALUE for each VARIABLE, one per line. If the + \"only\" attribute is specified then only the variable + values are listed. If no variables are specified then + $env are assumed. + help [ ACTION ] + Display help text on the standard error [ standard output + for ACTION ]. + host [ canon cpu name rating type ... ] + List architecture/implementation dependent host information + on the standard output. type is listed if no attributes are + specified. Information is listed on a single line in attributes + order. The attributes are: + canon The next argument is a host type name to be + converted to package syntax. + cpu The number of cpus; 1 if the host is not a + multiprocessor. + name The host name. + rating The cpu rating in pseudo mips; the value is useful + useful only in comparisons with rating values of + other hosts. Other than a vax rating fixed at 1, + ratings can vary wildly but consistently from + vendor mips ratings. cc(1) may be required to + determine the rating. + type The host type, usually of the form + vendor.architecture, with an optional trailing + -version. The main theme is that type names within + a family of architectures are named in a similar, + predictable style. Os point release information is + avoided as much as possible, but vendor resistance + to release incompatibilities has for the most part + been futile. + html [ ACTION ] + Display html help text on the standard error [ standard output + for ACTION ]. + install [ ARCHITECTURE ... ] DIR [ PACKAGE ... ] + Copy the package binary hierarchy to DIR. If ARCHITECTURE is + omitted then all architectures are installed. If the \"flat\" + attribute is specified then exactly one ARCHITECTURE must be + specified; this architecture will be installed in DIR without + the \"arch/HOSTTYPE\" directory prefixes. Otherwise each + architecture will be installed in a separate \"arch/HOSTTYPE\" + subdirectory of DIR. The ARCHITECTURE - names the current + architecture. DIR must be an existing directory. If PACKAGE + is omitted then all binary packages are installed. This action + requires nmake. + license [ package ... ] + List the source license(s) for PACKAGE on the standard output. + Note that individual components in PACKAGE may contain + additional or replacement licenses. + list [ PACKAGE ... ] + List the name, version and prerequisites for PACKAGE on the + standard output. + make [ PACKAGE ] [ OPTION ... ] [ TARGET ... ] + Build and install. The default TARGET is install, which + makes and installs all packages. If the standard output + is a terminal then the output is also captured in + \$INSTALLROOT/lib/package/gen/make.out. The build is done + in the \$INSTALLROOT directory tree viewpathed on top of + the \$PACKAGEROOT directory tree. If \"flat\" is specified then + the \$INSTALLROOT { bin fun include lib } directories are + linked to the same directories in the package root. Only + one architecture may be flat. Leaf directory names matching + the |-separated shell pattern \$MAKESKIP are ignored. The + view action is done before making. OPTION operands are + passed to the underlying make command. + read [ package ... | archive ... ] + Read the named package archive(s). Must be run from the + package root directory. Archives are searched for in . + and lib/package/tgz. Each package is read only once. The + file lib/package/tgz/package[.type].tim tracks the read time. + See the write action for archive naming conventions. Text + file archive member are assumed to be ASCII or UTF-8 encoded. + regress diff(1) the current and previous package test results. + release [ [CC]YY-MM-DD [ [cc]yy-mm-dd ] ] [ package ] + Display recent changes since [CC]YY-MM-DD (up to [cc]yy-mm-dd), + where - means lowest (or highest.) If no dates are specified + then changes for the last 4 months are listed. PACKAGE may + be a package or component name. + remove PACKAGE + Remove files installed for PACKAGE. + results [ path ] [ old ] [ make | test ] + List results and interesting messages captured by the most + recent make (default), test or write action. old specifies the + previous results, if any (current and previous results are + retained.) $HOME/.pkgresults, if it exists, must contain an + egrep(1) expression of result lines to be ignored. failed lists + failures only and path lists the results file path only. + setup [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] + The action initializes the current directory as a package root, + runs the update action to download new or out of date packages, + and runs the read action on those packages. If \"flat\" is + specified then the \$INSTALLROOT { bin fun include lib } + directories are linked to the same directories in the package + root. Only one architecture may be flat. See the update and + read actions for argument details. + test [ PACKAGE ] + Run the regression tests for PACKAGE. If the standard output + is a terminal then the output is also captured in + \$INSTALLROOT/lib/package/gen/test.out. In general a package + must be made before it can be tested. Components tested with + the \bregress\b(1) command require \bksh93\b. If only is + also specified then only the listed package components are + tested, otherwise the closure of the components is tested. + update [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] + Download the latest release of the selected and required + packages from URL (e.g., + http://www.research.att.com/sw/download) into the directory + \$PACKAGEROOT/lib/package/tgz. beta acesses beta packages; + download these at your own risk. If ARCHITECTURE is omitted + then only architectures already present in the tgz directory + will be downloaded. If ARCHITECTURE is - then all posted + architectures will be downloaded. If URL matches *.url then + it is interpreted as a file containing shell variable + assignments for url, authorize and password. If URL is + omitted then the definitions for url, authorize and password + in \$PACKAGEROOT/lib/package/tgz/$default_url, if it exists, + are used. If \$PACKAGEROOT/lib/package/tgz/$default_url does + not exist then it is initialized with the current url, + authorize and password values and read permission for the + current user only. If PACKAGE is omitted then only + packages already present in the tgz directory will be + downloaded. If PACKAGE is - then all posted packages will be + downloaded. If source and binary are omitted then both source + and binary packages will be downloaded. If \bonly\b is + specified then only the named packages are updated; otherwise + the closure of required packages is updated. This action + requires wget(1), lynx(1), curl(1) or a shell that supports + io to /dev/tcp/HOST/PORT. + use [ uid | PACKAGE | . [ 32 | 64 ] | 32 | 64 | - ] [ COMMAND ... ] + Run COMMAND or an interactive shell if COMMAND is omitted, with + the environment initialized for using the package (can you say + shared library without cussing?) If uid or PACKAGE or . is + specified then it is used to determine a \$PACKAGEROOT, + possibly different from the current directory. For example, to + try out bozo's package: \"package use bozo\". In this case the + command may be run from any directory. If the file + \$INSTALLROOT/lib/package/profile is readable then it is + sourced to initialize the environment. 32 or 64 implies + \$PACKAGEROOT of . and specifies the target architecture word + size (which may be silently ignored.) + verify [ PACKAGE ] + Verify installed binary files against the checksum files in + \$INSTALLROOT/lib/package/gen/*.sum. The checksum files contain + mode, user and group information. If the checksum matches + for a given file then the mode, user and group are changed + as necessary to match the checksum entry. A warning is printed + on the standard error for each mismatch. Requires the ast + package cksum(1) command. + view + Initialize the architecture specific viewpath hierarchy. The + make action implicitly calls this action. If \"flat\" is specified + then the \$INSTALLROOT { bin fun include lib } directories are + linked to the same directories in the package root. Only one + architecture may be flat. + write [closure] [cyg|exp|lcl|pkg|rpm|tgz|tst] [base|delta] + [binary|runtime|source] PACKAGE + Write a package archive for PACKAGE. All work is done in the + \$PACKAGEROOT/lib/package directory. FORMAT-specific files + are placed in the FORMAT subdirectory. A PACKAGE[.TYPE].tim + file in this directory tracksthe write time and prevents a + package from being read in the same root it was written. If + more than one file is generated for a particular FORMAT then + those files are placed in the FORMAT/PACKAGE subdirectory. + File names in the FORMAT subdirectory will contain the package + name, a YYYY-MM-DD date, and for binary packages, HOSTTYPE. + If PACKAGE is omitted then an ordered list of previously + written packages is generated. If \"only\" is specified then + only the named packages will be written; otherwise + prerequisite packages are written first. Package components + must be listed in PACKAGE.pkg. FORMAT may be one of: + cyg generate a cygwin package + exp generate an exptools(1) maintainer source archive + and NPD file in the exp subdirectory, suitable for + expmake(1); support files are placed in the + exp/PACKAGE subdirectory + lcl generate a package archive or delta in the lcl + subdirectory, suitable for restoration into the + primary source tree (no source licence annotation) + pkg generate a pkgmk(1) package, suitable for pkgadd(1) + rpm generate an rpm(1) package + tgz generate a gzip(1) tar(1) package archive; this is + the default + tst generate tgz FORMAT package archive in the tst + subdirectory; version state files are not updated + The package type must be one of source, binary or runtime. + A source package contains the source needed to build the + corresponding binary package. A binary package includes the + libraries and headers needed for compiling and linking + against the public interfaces. A runtime package contains + the commands and required dynamic libraries. A package may + be either a base or delta. A base package contains a + complete copy of all components. A delta package contains + only changes from a previous base package. Delta recipients + must have the ast pax(1) command (in the ast-base package.) + If neither base nor delta is specified, then the current + base is overwritten if there are no deltas referring to the + current base. Only the tgz and lcl formats support delta. + If base is specified then a new base and two delta archives + are generated: one delta to generate the new base from the + old, and one delta to generate the old base from the new; + the old base is then removed. If delta is specified then a + new delta referring to the current base is written. + package.pkg may reference other packages. By default a + pointer to those packages is written. The recipient package + read will then check that all required packages have been + downloaded. If closure is specified then the components for + all package references are included in the generated + package. This may be useful for lcl and versioning. All + formats but lcl annotate each source file (not already + annotated) with a license comment as it is written to the + package archive using proto(1). + name=value: + variable definition: typically CC=cc or CCFLAGS=-g." + ;; + esac + exit $code + ;; + *=*) set DEFAULT host type "$@" + ;; + *) echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2 + exit 2 + ;; + esac + global="$global $1" + shift +done + +# gather HOSTTYPE *,* options +# ,*cc*,-*,... set CC and CCFLAGS + +hostopts() +{ + _ifs_=$IFS + IFS=, + set '' $HOSTTYPE + IFS=$_ifs_ + shift + while : + do case $# in + 0|1) break ;; + esac + shift + case $1 in + *cc*) CC=$1 + while : + do case $# in + 0|1) break ;; + esac + case $2 in + -*) case $assign_CCFLAGS in + ?*) assign_CCFLAGS="$assign_CCFLAGS " ;; + esac + assign_CCFLAGS="$assign_CCFLAGS$2" + shift + ;; + *) break + ;; + esac + done + ;; + esac + done +} + +# collect command line targets and definitions + +case $_PACKAGE_HOSTTYPE_ in +?*) HOSTTYPE=$_PACKAGE_HOSTTYPE_ + KEEP_HOSTTYPE=1 + ;; +*) KEEP_HOSTTYPE=0 + ;; +esac +KEEP_PACKAGEROOT=0 +KEEP_SHELL=0 +USER_VPATH= +args= +assign= +assign_CCFLAGS= +for i +do case $i in + *:*=*) args="$args $i" + continue + ;; + *=*) eval `echo ' ' "$i" | sed 's,^[ ]*\([^=]*\)=\(.*\),n=\1 v='\''\2'\'','` + ;; + esac + case $i in + AR=*|LD=*|NM=*) + assign="$assign $n='$v'" + eval $n='$'v + ;; + CC=*) eval $n='$'v + ;; + CCFLAGS=*) + eval $n='$'v + assign_CCFLAGS="CCFLAGS=\"\$CCFLAGS\"" + ;; + HOSTTYPE=*) + eval $n='$'v + case $HOSTTYPE in + ?*) KEEP_HOSTTYPE=1 ;; + esac + ;; + HURL=*) eval $n='$'v + ;; + PACKAGEROOT=*) + eval $n='$'v + case $PACKAGEROOT in + ?*) KEEP_PACKAGEROOT=1 ;; + esac + ;; + SHELL=*)eval $n='$'v + case $SHELL in + ?*) KEEP_SHELL=1 ;; + esac + ;; + TAR=*) eval $n='$'v + ;; + TARFLAGS=*) + eval $n='$'v + ;; + VPATH=*)eval USER_$n='$'v + ;; + 'debug=1') + makeflags="$makeflags --debug-symbols" + ;; + 'strip=1') + makeflags="$makeflags --strip-symbols" + ;; + *=*) assign="$assign $n='$v'" + ;; + *) args="$args $i" + ;; + esac +done +case $HOSTTYPE in +*,*) hostopts $HOSTTYPE ;; +esac +case $assign_CCFLAGS in +?*) assign="$assign $assign_CCFLAGS" +esac +case $CC in +''|cc) ;; +*) export CC ;; +esac + +# grab action specific args + +case $action in +admin) while : + do case $# in + 0) set list + break + ;; + esac + case $1 in + all) admin_all=1 + ;; + db) case $# in + 1) echo $command: $action: $1: db file argument expected >&2 + exit 1 + ;; + esac + shift + admin_db=$1 + ;; + on) case $# in + 1) echo $command: $action: $1: host pattern argument expected >&2 + exit 1 + ;; + esac + shift + admin_on=$1 + ;; + *) break + ;; + esac + shift + done + admin_action=$1 + admin_args=$* + for i + do case $i in + debug|environment|force|never|only|quiet|show|DEBUG) + ;; + *) admin_action=$i + break + ;; + esac + done + ;; +setup) PACKAGEROOT=${PWD:-`pwd`} + export PACKAGEROOT + KEEP_PACKAGEROOT=1 + ;; +use) case $1 in + .|32|64)case $1 in + 32|64) bit=$1 ;; + esac + shift + + # HOSTTYPE specific setup + + case $HOSTTYPE in + win32.*)sys=uwin + wow=`uname -i` + case $bit in + 32) case $HOSTTYPE in + *-64) HOSTTYPE=${HOSTTYPE%-64} ;; + esac + case $wow in + */32) ;; + *) vpath / /$bit ;; + esac + ;; + 64) case $HOSTTYPE in + *-64) ;; + *) HOSTTYPE=$HOSTTYPE-64 ;; + esac + case $wow in + */32) echo $command: cannot build $bit-bit on $wow $sys >&2; exit 2 ;; + *) vpath / /$bit ;; + esac + ;; + esac + case $bit in + '') PS1="($sys) " ;; + *) PS1="($sys-$bit) " ;; + esac + + $exec umask 002 + $exec unset MAKESKIP + + $exec export P=$PWD + $exec export A=$P/arch/$HOSTTYPE + + $exec export CDPATH=:..:$A/src/cmd:$A/src/lib:$A/src/uwin:$P/lib/package + $exec export INSTALLROOT=$A + $exec export PACKAGEROOT=$P + $exec export PATH=$A/bin:$P/bin:$PATH + $exec export PS1="$PS1" + $exec export VPATH=$A:$P + $exec export nativepp=/usr/lib + + if test '' != "$INSTALLROOT" -a -d $INSTALLROOT/include/ast + then $exec export PACKAGE_ast=$INSTALLROOT + elif test -d ${PWD%/*}/ast/arch/$HOSTTYPE + then $exec export PACKAGE_ast=${PWD%/*}/ast/arch/$HOSTTYPE + fi + + # run the command + + case $# in + 0) case $show in + ':') $exec exec $SHELL ;; + esac + ;; + *) $exec exec $SHELL -c "$@" + ;; + esac + exit + ;; + esac + PACKAGEROOT=${PWD:-`pwd`} + $show export PACKAGEROOT + esac + ;; +esac + +# true if arg is a valid PACKAGEROOT + +packageroot() # dir +{ + test -d $1/lib/$command -o -x $1/bin/$command +} + +# true if arg is executable + +executable() # [!] command +{ + case $1 in + '!') test ! -x "$2" -a ! -x "$2.exe"; return ;; + *) test -x "$1" -o -x "$1.exe"; return ;; + esac +} + +# initialize SHELLMAGIC +# tangible proof of cygwin's disdain for unix (well, this and execrate) + +shellmagic() +{ + case $SHELLMAGIC in + '') ;; + -) if test -f /emx/bin/sh.exe + then SHELLMAGIC='#!/emx/bin/sh.exe'$nl + elif test -f /bin/env.exe + then SHELLMAGIC='#!/bin/env sh'$nl + else SHELLMAGIC= + fi + ;; + esac +} + +# true if arg is executable command on $PATH + +onpath() # command +{ + _onpath_b=$1 + case $_onpath_b in + /*) if executable $_onpath_b + then _onpath_=$_onpath_b + return 0 + fi + return 1 + ;; + esac + IFS=':' + set '' $PATH + IFS=$ifs + shift + for _onpath_d + do case $_onpath_d in + '') _onpath_d=. ;; + esac + if executable "$_onpath_d/$_onpath_b" + then _onpath_=$_onpath_d/$_onpath_b + return 0 + fi + done + return 1 +} + +# true if no nmake or nmake not from AT&T or nmake too old + +nonmake() # nmake +{ + _nonmake_version=`( $1 -n -f - 'print $(MAKEVERSION:@/.*AT&T.* //:/-//G:@/.* .*/19960101/)' . ) /dev/null || echo 19840919` + if test $_nonmake_version -lt 20001031 + then return 0 + fi + return 1 +} + +# determine local host attributes + +hostinfo() # attribute ... +{ + case $DEBUG in + 1) set -x ;; + esac + map= + something= + path=$PATH + for i in $ccs + do PATH=$PATH:$i + done + for i in $use + do for j in $org + do PATH=$PATH:$i/$j/bin + done + PATH=$PATH:$i/bin + done + # LD_LIBRARY_PATH may be out of sync with PATH here + case $SED in + '') SED=sed + $SED 1d < /dev/null > /dev/null 2>&1 || + for dir in /bin /usr/bin + do if test -x $dir/$SED + then SED=$dir/$SED + break + fi + done + TR=tr + $TR < /dev/null > /dev/null 2>&1 || + for dir in /bin /usr/bin + do if test -x $dir/$TR + then TR=$dir/$TR + break + fi + done + ;; + esac + case $PACKAGE_PATH in + ?*) for i in `echo $PACKAGE_PATH | $SED 's,:, ,g'` + do PATH=$PATH:$i/bin + done + ;; + esac + + # validate the args + + canon= + cc=$CC + for info + do case $canon in + -) canon=$info + ;; + *) case $info in + */*|*[cC][cC]) + cc=$info + ;; + canon) canon=- + something=1 + ;; + cpu|name|rating|type) + something=1 + ;; + *) echo "$command: $action: $info: unknown attribute" >&2 + exit 1 + ;; + esac + ;; + esac + done + case $canon in + -) echo "$command: $action: canon: host type name expected" >&2 + exit 1 + ;; + esac + case $something in + "") set "$@" type ;; + esac + case $DEBUG in + '') exec 9>&2 + exec 2>/dev/null + ;; + esac + + # compute the info + + _hostinfo_= + for info + do + case $info in + cpu) case $NPROC in + [123456789]*) + _hostinfo_="$_hostinfo_ $NPROC" + continue + ;; + esac + cpu=`grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo` + case $cpu in + [123456789]*) + _hostinfo_="$_hostinfo_ $cpu" + continue + ;; + esac + cpu=1 + # exact match + set \ + hinv '^Processor [0123456789]' \ + psrinfo 'on-line' \ + 'cat /reg/LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ + 'cat /proc/registry/HKEY_LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | grep -c "$2"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift + done + case $cpu in + 0|1) set \ + /bin/mpstat + + while : + do case $# in + 0) break ;; + esac + if executable $1 + then case `$1 | grep -ic '^cpu '` in + 1) cpu=`$1 | grep -ic '^ *[0123456789][0123456789]* '` + break + ;; + esac + fi + shift + done + ;; + esac + case $cpu in + 0|1) # token match + set \ + /usr/kvm/mpstat 'cpu[0123456789]' \ + /usr/etc/cpustatus 'enable' \ + /usr/alliant/showsched 'CE' \ + 'ls /config/hw/system/cpu' 'cpu' \ + prtconf 'cpu-unit' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | $TR ' ' ' + +' | grep -c "^$2"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift + done + ;; + esac + case $cpu in + 0|1) # special match + set \ + \ + hinv \ + '/^[0123456789][0123456789]* .* Processors*$/' \ + '/[ ].*//' \ + \ + /usr/bin/hostinfo \ + '/^[0123456789][0123456789]* .* physically available\.*$/' \ + '/[ ].*//' \ + + while : + do case $# in + 0) break ;; + esac + i=`$1 2>/dev/null | $SED -e "${2}!d" -e "s${3}"` + case $i in + [123456789]*) + cpu=$i + break + ;; + esac + shift;shift;shift + done + ;; + esac + case $cpu in + 0|1) cpu=`( + cd ${TMPDIR:-/tmp} + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.c < +#include +int main() +{ + printf("%d\n", pthread_num_processors_np()); + return 0; +} +! + for o in -lpthread '' + do if $CC $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 || + gcc $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 + then ./$tmp.exe + break + fi + done + )` + case $cpu in + [0123456789]*) ;; + *) cpu=1 ;; + esac + ;; + esac + _hostinfo_="$_hostinfo_ $cpu" + ;; + name) _name_=`hostname || uname -n || cat /etc/whoami || echo local` + _hostinfo_="$_hostinfo_ $_name_" + ;; + rating) for rating in `grep -i ^bogomips /proc/cpuinfo 2>/dev/null | $SED -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,'` + do case $rating in + [0123456789]*) break ;; + esac + done + case $rating in + [0123456789]*) ;; + *) cd ${TMPDIR:-/tmp} + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.c < +#include +#if TD || TZ +#include +#else +extern time_t time(); +#endif +int main() +{ + register unsigned long i; + register unsigned long j; + register unsigned long k; + unsigned long l; + unsigned long m; + unsigned long t; + int x; +#if TD || TZ + struct timeval b; + struct timeval e; +#if TZ + struct timezone z; +#endif +#endif + l = 500; + m = 890; + x = 0; + for (;;) + { +#if TD || TZ +#if TZ + gettimeofday(&b, &z); +#else + gettimeofday(&b); +#endif +#else + t = (unsigned long)time((time_t*)0); +#endif + k = 0; + for (i = 0; i < l; i++) + for (j = 0; j < 50000; j++) + k += j; +#if TD || TZ +#if TZ + gettimeofday(&e, &z); +#else + gettimeofday(&e); +#endif + t = (e.tv_sec - b.tv_sec) * 1000 + (e.tv_usec - b.tv_usec) / 1000; + if (!x++ && t < 1000) + { + t = 10000 / t; + l = (l * t) / 10; + continue; + } +#else + t = ((unsigned long)time((time_t*)0) - t) * 1000; + if (!x++ && t < 20000) + { + t = 200000l / t; + l = (l * t) / 10; + continue; + } +#endif +#if PR + printf("[ k=%lu l=%lu m=%lu t=%lu ] ", k, l, m, t); +#endif + if (t == 0) + t = 1; + break; + } + printf("%lu\n", ((l * m) / 10) / t); + return k == 0; +} +! + rating= + for o in -DTZ -DTD '' + do if $CC $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 || + gcc $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 + then rating=`./$tmp.exe` + break + fi + done + case $rating in + [0123456789]*) ;; + *) rating=1 ;; + esac + ;; + esac + _hostinfo_="$_hostinfo_ $rating" + ;; + type|canon) + case $CROSS:$canon in + 0:) case $cc in + cc) case $KEEP_HOSTTYPE:$HOSTTYPE in + 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$HOSTTYPE + then KEEP_HOSTTYPE=1 + fi + ;; + esac + ;; + esac + case $KEEP_HOSTTYPE in + 1) _hostinfo_="$_hostinfo_ $HOSTTYPE" + continue + ;; + esac + ;; + esac + case $cc in + /*) a=`$cc -dumpmachine $CCFLAGS 2>/dev/null` + case $a in + '') case $CCFLAGS in + ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + esac + ;; + esac + case $a in + ''|*' '*|*/*:*) + ;; + *.*-*) _hostinfo_="$_hostinfo_ $a" + continue + ;; + *-*-*) case $canon in + '') canon=$a ;; + esac + ;; + *) _hostinfo_="$_hostinfo_ $a" + continue + ;; + esac + ;; + esac + IFS=: + set /$IFS$PATH + IFS=$ifs + shift + f=../lib/hostinfo/typemap + for i + do case $i in + "") i=. ;; + esac + case $canon in + '') case $cc in + /*|cc) ;; + *) if executable $i/$cc + then a=`$i/$cc -dumpmachine $CCFLAGS 2>/dev/null` + case $a in + '') case $CCFLAGS in + ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + esac + ;; + esac + case $a in + ''|*' '*|*/*:*) + ;; + *-*) canon=$a + ;; + *) _hostinfo_="$_hostinfo_ $a" + continue 2 + ;; + esac + fi + ;; + esac + ;; + esac + if test -f "$i/$f" + then map="`grep -v '^#' $i/$f` $map" + fi + done + + # inconsistent -dumpmachine filtered here + + case -${canon}- in + --|*-powerpc-*) + h=`hostname || uname -n || cat /etc/whoami` + case $h in + '') h=local ;; + esac + a=`arch || uname -m || att uname -m || uname -s || att uname -s` + case $a in + *[\ \ ]*) a=`echo $a | $SED "s/[ ]/-/g"` ;; + esac + case $a in + '') a=unknown ;; + esac + m=`mach || machine || uname -p || att uname -p` + case $m in + *[\ \ ]*) m=`echo $m | $SED "s/[ ]/-/g"` ;; + esac + case $m in + '') m=unknown ;; + esac + x=`uname -a || att uname -a` + case $x in + '') x="unknown $host unknown unknown unknown unknown unknown" ;; + esac + set "" $h $a $m $x + expected=$1 host=$2 arch=$3 mach=$4 os=$5 sys=$6 rel=$7 ver=$8 + ;; + *) case $canon in + *-*) IFS=- + set "" $canon + shift + IFS=$ifs + case $# in + 2) host= mach= arch=$1 os=$2 sys= rel= ;; + *) host= mach=$2 arch=$1 os=$3 sys= rel= ;; + esac + case $os in + [abcdefghijklmnopqrstuvwxyz]*[0123456789]) + eval `echo $os | $SED -e 's/^\([^0123456789.]*\)\.*\(.*\)/os=\1 rel=\2/'` + ;; + esac + ;; + *) arch=$canon mach= os= sys= rel= + ;; + esac + ;; + esac + type=unknown + case $host in + *.*) host=`echo $host | $SED -e 's/\..*//'` ;; + esac + case $mach in + unknown) + mach= + ;; + [Rr][0123][0123456789][0123456789][0123456789]) + mach=mips1 + ;; + [Rr][4][0123456789][0123456789][0123456789]) + mach=mips2 + ;; + [Rr][56789][0123456789][0123456789][0123456789]|[Rr][123456789][0123456789][0123456789][0123456789][0123456789]) + mach=mips4 + ;; + pc) arch=i386 + mach= + ;; + [Pp][Oo][Ww][Ee][Rr][Pp][Cc]) + arch=ppc + mach= + ;; + *) case $arch in + 34[0123456789][0123456789]) + os=ncr + arch=i386 + ;; + esac + ;; + esac + case $canon in + '') set \ + \ + /NextDeveloper -d next - \ + /config/hw/system/cpu -d tandem mach \ + + while : + do case $# in + 0) break ;; + esac + if test $2 $1 + then os=$3 + case $4 in + arch) mach=$arch ;; + mach) arch=$mach ;; + esac + break + fi + shift;shift;shift;shift + done + ;; + esac + case $os in + AIX*|aix*) + type=ibm.risc + ;; + HP-UX) case $arch in + 9000/[78]*) + type=hp.pa + ;; + */*) type=hp.`echo $arch | $SED 's,/,_,g'` + ;; + *) type=hp.$arch + ;; + esac + ;; + [Ii][Rr][Ii][Xx]*) + set xx `hinv | $SED -e '/^CPU:/!d' -e 's/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + shift + type=$1 + n= + case $2 in + r[0123][0123456789][0123456789][0123456789]) + n=1 + ;; + r[4][0123][0123456789][0123456789]) + n=2 + ;; + r[4][456789][0123456789][0123456789]|r[5][0123456789][0123456789][0123456789]) + n=3 + ;; + r[6789][0123456789][0123456789][0123456789]|r[123456789][0123456789][0123456789][0123456789][0123456789]) + n=4 + ;; + esac + case $rel in + [01234].*|5.[012]|5.[012].*) + case $n in + 1) ;; + *) n=2 ;; + esac + ;; + 5.*) case $n in + 2) n=3 ;; + esac + ;; + esac + if executable $cc + then a=$cc + else IFS=: + set /$IFS$PATH + IFS=$ifs + shift + for i + do a=$i/$cc + if executable $a + then break + fi + done + fi + split=' +' + a=`strings $a < /dev/null | $SED -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | $SED -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q` + case $a in + [0123456789]) n=$a ;; + esac + case $n in + 4) a=`$cc -${type}3 2>&1` + case $a in + *unknown*|*install*|*conflict*) + ;; + *) n=3 + ;; + esac + ;; + esac + a=`$cc -show F0oB@r.c 2>&1` + case $n:$a in + [!2]:*mips2*) n=2 ;; + [!23]:*mips3*) n=3 ;; + [!234]:*mips4*) n=4 ;; + esac + case $n:$a in + [!2]:*[Oo]32*) abi=-o32 ;; + [!3]:*[Nn]32*) abi=-n32 ;; + esac + mach=${type}$n + type=sgi.$mach + ;; + OSx*|SMP*|pyramid) + type=pyr + ;; + OS/390) type=mvs.390 + ;; + [Ss][Cc][Oo]*) + type=sco + ;; + [Ss]ol*) + v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + case $v in + [6789]|[1-9][0-9]) + ;; + *) v= + ;; + esac + case $arch in + '') case $mach in + '') arch=sun4 ;; + *) arch=$mach ;; + esac + ;; + esac + case $arch in + sparc) arch=sun4 ;; + esac + type=sol$v.$arch + ;; + [Ss]un*)type=`echo $arch | $SED -e 's/\(sun.\).*/\1/'` + case $type in + sparc) type=sun4 ;; + esac + case $rel in + [01234]*) + ;; + '') case $os in + *[Oo][Ss]) + ;; + *) type=sol.$type + ;; + esac + ;; + *) case $type in + '') case $mach in + sparc*) type=sun4 ;; + *) type=$mach ;; + esac + ;; + esac + v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + case $v in + [6789]|[1-9][0-9]) + ;; + *) v= + ;; + esac + type=sol$v.$type + ;; + esac + case $type in + sun*|*.*) + ;; + *) type=sun.$type + ;; + esac + ;; + [Uu][Nn][Ii][Xx]_[Ss][Vv]) + type=unixware + ;; + UTS*|uts*) + if test -x /bin/u370 -o -x /bin/u390 + then type=uts.390 + else case $arch in + '') arch=$mach ;; + esac + type=uts.$arch + fi + ;; + $host) type=$arch + case $type in + *.*|*[0123456789]*86|*68*) + ;; + *) case $mach in + *[0123456789]*86|*68*|mips) + type=$type.$mach + ;; + esac + ;; + esac + ;; + unknown) + case $arch in + ?*) case $arch in + sun*) mach= ;; + esac + type=$arch + case $mach in + ?*) type=$type.$mach ;; + esac + ;; + esac + ;; + *) case $ver in + FTX*|ftx*) + case $mach in + *[0123456789][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*) + mach=`echo $mach | $SED -e 's/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*$//'` + ;; + esac + type=stratus.$mach + ;; + *) case $arch in + [Oo][Ss][-/.]2) + type=os2 + arch=$rel + ;; + *) type=`echo $os | $SED -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//'` + ;; + esac + case $type in + [Cc][Yy][Gg][Ww][Ii][Nn]_*) + type=cygwin + ;; + [Uu][Ww][Ii][Nn]*|[Ww]indows_[0123456789][0123456789]|[Ww]indows_[Nn][Tt]) + type=win32 + arch=`echo $arch | $SED -e 's/_[^_]*$//'` + ;; + esac + case $arch in + '') case $mach in + ?*) type=$type.$mach ;; + esac + ;; + *) type=$type.$arch ;; + esac + ;; + esac + esac + case $type in + [0123456789]*) + case $mach in + ?*) type=$mach ;; + esac + case $type in + */MC) type=ncr.$type ;; + esac + ;; + *.*) ;; + *[0123456789]*86|*68*) + case $rel in + [34].[0123456789]*) + type=att.$type + ;; + esac + ;; + [abcdefghijklmnopqrstuvwxyz]*[0123456789]) + ;; + [abcdefghijklmnopqrstuvwxyz]*) case $mach in + $type) case $ver in + Fault*|fault*|FAULT*) + type=ft.$type + ;; + esac + ;; + ?*) case $arch in + '') type=$type.$mach ;; + *) type=$type.$arch ;; + esac + ;; + esac + ;; + esac + case $type in + *[-_]32|*[-_]64|*[-_]128) + bits=`echo $type | $SED 's,.*[-_],,'` + type=`echo $type | $SED 's,[-_][0-9]*$,,'` + ;; + *) bits= + ;; + esac + type=`echo $type | $SED -e 's%[-+/].*%%' | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + case $type in + *.*) lhs=`echo $type | $SED -e 's/\..*//'` + rhs=`echo $type | $SED -e 's/.*\.//'` + case $rhs in + [x0123456789]*86) rhs=i$rhs ;; + 68*) rhs=m$rhs ;; + esac + case $rhs in + i[x23456789]86|i?[x23456789]86|*86pc) + rhs=i386 ;; + powerpc) rhs=ppc ;; + s[0123456789]*[0123456789]x) + rhs=`echo $rhs | $SED -e 's/x$/-64/'` ;; + esac + case $rhs in + arm[abcdefghijklmnopqrstuvwxyz_][0123456789]*) + rhs=arm ;; + hppa) rhs=pa ;; + esac + case $lhs in + ?*coff|?*dwarf|?*elf) + case $lhs in + ?*coff) x=coff ;; + ?*dwarf)x=coff ;; + ?*elf) x=elf ;; + esac + lhs=`echo ${lhs}XXX | $SED -e "s/${x}XXX//"` + ;; + esac + case $lhs in + bsdi) lhs=bsd ;; + darwin) case $rel in + [01234567].*) lhs=${lhs}7 ;; + esac + ;; + freebsd) case $rel in + [01234].*) lhs=${lhs}4 ;; + [123456789]*.*) lhs=${lhs}`echo $rel | $SED -e 's/\..*//'` ;; + esac + ;; + hpux) lhs=hp ;; + mvs) rhs=390 ;; + esac + case $lhs in + '') type=$rhs ;; + $rhs) type=$lhs ;; + *) type=$lhs.$rhs ;; + esac + ;; + esac + case $type in + sgi.mips*) + case $mach in + mips2) type=sgi.$mach + abi=-o32 + ;; + mips3) type=sgi.$mach + abi=-n32 + ;; + mips[456789]) + type=sgi.$mach + case $abi in + *-n32) ;; + *) abi=-64 ;; + esac + ;; + *) pwd=`pwd` + cd ${TMPDIR:-/tmp} + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.a.c < $tmp.b.c </dev/null 2>&1 + rm -f $tmp.* + trap - 0 1 2 + cd $pwd + ;; + esac + case $type$abi in + sgi.mips2-o32) + ;; + sgi.mips3) + type=$type-o32 + ;; + sgi.mips3-n32) + ;; + sgi.mips4) + type=$type-o32 + ;; + sgi.mips[456789]-64) + ;; + *) type=$type$abi + ;; + esac + ;; + *) case $bits in + '') case `file /bin/sh 2>/dev/null` in + *universal*64*) + pwd=`pwd` + cd ${TMPDIR:-/tmp} + tmp=hi$$ + trap 'rm -f $tmp.*' 0 1 2 + cat > $tmp.a.c </dev/null 2>&1 + rm -f $tmp.* + trap - 0 1 2 + cd $pwd + ;; + esac + ;; + esac + ;; + esac + case $bits in + 32) case $type in + *.i386) bits= ;; + esac + ;; + esac + case $bits in + ?*) type=$type-$bits ;; + esac + + # last chance mapping + + set "" "" $map + while : + do case $# in + [012]) break ;; + esac + shift;shift + eval " case \$type in + $1) type=\$2; break ;; + esac" + done + _hostinfo_="$_hostinfo_ $type" + ;; + esac + done + set '' $_hostinfo_ + shift + _hostinfo_=$* + + # restore the global state + + PATH=$path + case $DEBUG in + '') exec 2>&9 + exec 9>&- + ;; + esac +} + +# info message + +note() # message ... +{ + echo $command: "$@" >&2 +} + +# cc checks +# +# CC: compiler base name name +# cc: full path, empty if not found + +checkcc() +{ + cc= + if onpath $CC + then cc=$_onpath_ + else case $CC in + cc) if onpath gcc + then CC=gcc + cc=$_onpath_ + fi + ;; + esac + fi + case $cc in + '') case $action in + make|test) note "$CC: not found"; exit 1 ;; + *) note "warning: $CC: not found" ;; + esac + ;; + esac +} + +# some actions have their own PACKAGEROOT or kick out early + +case $action in +host) eval u=$package_use + case $u in + $PACKAGE_USE) + ;; + *) if onpath $0 + then case $_onpath_ in + */arch/$HOSTTYPE/bin/package) + KEEP_HOSTTYPE=1 + ;; + *) KEEP_HOSTTYPE=0 + ;; + esac + else KEEP_HOSTTYPE=0 + fi + ;; + esac + hostinfo $args + echo $_hostinfo_ + exit 0 + ;; +export|setup|use) + x= + ;; +*) x= + eval u=$package_use + case $u in + $PACKAGE_USE) + case :$PATH: in + *:$INSTALLROOT/bin:*) + case $LIBPATH: in + $INSTALLROOT/bin:$INSTALLROOT/lib:*) + case $SHLIB_PATH: in + $INSTALLROOT/lib:*) + x=1 + ;; + esac + ;; + esac + ;; + esac + ;; + esac + ;; +esac +run=- +case $x in +1) : accept the current package use environment + + OK=ok + KSH=$EXECROOT/bin/ksh + MAKE=nmake + NMAKE=$EXECROOT/bin/$MAKE + SUM=$EXECROOT/bin/sum + TEE=$EXECROOT/bin/tee + INITROOT=$PACKAGEROOT/src/cmd/INIT + checkcc + ;; +*) hosttype= + case $KEEP_PACKAGEROOT in + 0) case $action in + use) PACKAGEROOT= + case $show in + echo) exec=echo make=echo show=echo ;; + esac + set '' $args + shift + case $# in + 0) ;; + *) case $1 in + -|.) ;; + /*) PACKAGEROOT=$1 + ;; + *) i=`echo ~$1` + if packageroot $i + then PACKAGEROOT=$i + else for i in `echo $HOME | sed -e 's,/[^/]*$,,'` $usr $use + do if packageroot $i/$1 + then PACKAGEROOT=$i/$1 + break + fi + done + case $PACKAGEROOT in + '') hosttype=$1 ;; + esac + fi + ;; + esac + shift + ;; + esac + run="$@" + ;; + esac + case $PACKAGEROOT in + '') PACKAGEROOT=${PWD:-`pwd`} ;; + esac + + # . must be within the PACKAGEROOT tree + + i=X$PACKAGEROOT + IFS=/ + set $i + IFS=$ifs + while : + do i=$1 + shift + case $i in + X) break ;; + esac + done + case $PACKAGEROOT in + //*) d=/ ;; + *) d= ;; + esac + case $1 in + home) k=1 ;; + *) k=0 ;; + esac + for i + do case $i in + '') continue ;; + esac + d=$d/$i + case $k in + 2) k=1 + ;; + 1) k=0 + ;; + 0) case $i in + arch) k=2 + ;; + *) if packageroot $d + then PACKAGEROOT=$d + fi + ;; + esac + ;; + esac + done + ;; + esac + INITROOT=$PACKAGEROOT/src/cmd/INIT + $show PACKAGEROOT=$PACKAGEROOT + $show export PACKAGEROOT + export PACKAGEROOT + + # initialize the architecture environment + + case $KEEP_HOSTTYPE in + 0) hostinfo type + HOSTTYPE=$_hostinfo_ + ;; + 1) _PACKAGE_HOSTTYPE_=$HOSTTYPE + export _PACKAGE_HOSTTYPE_ + ;; + esac + $show HOSTTYPE=$HOSTTYPE + $show export HOSTTYPE + export HOSTTYPE + INSTALLROOT=$PACKAGEROOT/arch/$HOSTTYPE + case $action in + admin|install|make|read|remove|test|verify|view|write) + ;; + *) if test ! -d $INSTALLROOT + then INSTALLROOT=$PACKAGEROOT + fi + ;; + esac + $show INSTALLROOT=$INSTALLROOT + $show export INSTALLROOT + export INSTALLROOT + + # HOSTTYPE specific package profile + + if test -r $INSTALLROOT/lib/package/profile + then . $INSTALLROOT/lib/package/profile + fi + + # check the basic package hierarchy + + case $action in + export|use) + packageroot $PACKAGEROOT || { + echo "$command: $PACKAGEROOT: invalid package root directory" >&2 + exit 1 + } + case $KEEP_HOSTTYPE:$hosttype in + 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$hosttype + then KEEP_HOSTTYPE=1 + HOSTTYPE=$hosttype + else echo "$command: $hosttype: package root not found" >&2 + exit 1 + fi + ;; + esac + ;; + *) packageroot $PACKAGEROOT || { + case $KEEP_PACKAGEROOT in + 1) ;; + *) echo "$command: $PACKAGEROOT: must be in the package root directory tree" >&2 + exit 1 + ;; + esac + } + + case $action in + admin) ;; + *) for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in lib + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + ;; + esac + + # no $INITROOT means INIT already installed elsewhere + + if test -d $INITROOT + then + # update the basic package commands + + for i in execrate ignore mamprobe silent + do test -h $PACKAGEROOT/bin/$i 2>/dev/null || + case `ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null` in + "$INITROOT/$i.sh"*) + note update $PACKAGEROOT/bin/$i + shellmagic + case $SHELLMAGIC in + '') $exec cp $INITROOT/$i.sh $PACKAGEROOT/bin/$i || exit + ;; + *) case $exec in + '') { + echo "$SHELLMAGIC" + cat $INITROOT/$i.sh + } > $PACKAGEROOT/bin/$i || exit + ;; + *) echo "{ +echo \"$SHELLMAGIC\" +cat $INITROOT/$i.sh +} > $PACKAGEROOT/bin/$i" + ;; + esac + ;; + esac + $exec chmod +x $PACKAGEROOT/bin/$i || exit + ;; + esac + done + fi + ;; + esac + path=$PATH + PATH=$INSTALLROOT/bin:$PACKAGEROOT/bin:$PATH + checkcc + PATH=$path + case $cc in + ?*) if test -f $INITROOT/hello.c + then + # check if $CC (full path $cc) is a cross compiler + + ( + cd /tmp || exit 3 + cp $INITROOT/hello.c pkg$$.c || exit 3 + $cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || { + if $cc -Dnew=old -o pkg$$.exe pkg$$.c > /dev/null 2>&1 + then echo "$command: ${warn}$CC: must be a C compiler (not C++)" >&2 + else cat pkg$$.e + echo "$command: ${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" >&2 + fi + exit 2 + } + if ./pkg$$.exe >/dev/null 2>&1 + then code=0 + else code=1 + fi + rm -f pkg$$.* + exit $code + ) + code=$? + case $code in + 1) CROSS=1 ;; + esac + fi + ;; + esac + EXECTYPE=$HOSTTYPE + EXECROOT=$INSTALLROOT + case $CROSS in + 0) # dll hackery -- why is this so complicated? + + abi= + case $HOSTTYPE in + sgi.mips[0123456789]*) + x=rld + if executable /lib32/$x || executable /lib64/$x + then case $INSTALLROOT in + */sgi.mips[0123456789]*) + u=`echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,'` + ;; + *) u= + ;; + esac + for a in "n=2 v= l=" "n=3 v=N32 l=lib32" "n=4-n32 v=N32 l=lib32" "n=4 v=64 l=lib64" + do eval $a + case $v in + N32) case $n:$HOSTTYPE in + *-n32:*-n32) ;; + *-n32:*) continue ;; + *:*-n32) continue ;; + esac + ;; + esac + case $l in + ?*) if executable ! /$l/$x + then continue + fi + ;; + esac + case $u in + '') case $HOSTTYPE in + sgi.mips$n|sgi.mips$n-*) + abi="$abi 'd=$INSTALLROOT v=$v'" + ;; + *) continue + ;; + esac + ;; + *) if test -d $u$n + then abi="$abi 'd=$u$n v=$v'" + fi + ;; + esac + done + fi + ;; + esac + case $abi in + '') abi="'d=$INSTALLROOT v='" ;; + esac + p=0 + eval " + for a in $abi + do eval \$a + eval \" + case \\\$LD_LIBRARY\${v}_PATH: in + \\\$d/lib:*) + ;; + *) x=\\\$LD_LIBRARY\${v}_PATH + case \\\$x in + ''|:*) ;; + *) x=:\\\$x ;; + esac + LD_LIBRARY\${v}_PATH=\$d/lib\\\$x + export LD_LIBRARY\${v}_PATH + p=1 + ;; + esac + \" + done + " + case $LD_LIBRARY_PATH in + '') ;; + *) for d in $lib + do case $HOSTTYPE in + *64) if test -d ${d}64 + then d=${d}64 + fi + ;; + esac + case :$LD_LIBRARY_PATH: in + *:$d:*) ;; + *) if test -d $d + then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$d + p=1 + fi + ;; + esac + done + ;; + esac + case $p in + 1) $show LD_LIBRARY_PATH=$LD_LIBRARY_PATH + $show export LD_LIBRARY_PATH + export LD_LIBRARY_PATH + ;; + esac + case $LIBPATH: in + $INSTALLROOT/bin:$INSTALLROOT/lib:*) + ;; + *) case $LIBPATH in + '') LIBPATH=/usr/lib:/lib ;; + esac + LIBPATH=$INSTALLROOT/bin:$INSTALLROOT/lib:$LIBPATH + $show LIBPATH=$LIBPATH + $show export LIBPATH + export LIBPATH + ;; + esac + case $SHLIB_PATH: in + $INSTALLROOT/lib:*) + ;; + *) SHLIB_PATH=$INSTALLROOT/lib${SHLIB_PATH:+:$SHLIB_PATH} + $show SHLIB_PATH=$SHLIB_PATH + $show export SHLIB_PATH + export SHLIB_PATH + ;; + esac + case $DYLD_LIBRARY_PATH: in + $INSTALLROOT/lib:*) + ;; + *) DYLD_LIBRARY_PATH=$INSTALLROOT/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH} + $show DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH + $show export DYLD_LIBRARY_PATH + export DYLD_LIBRARY_PATH + ;; + esac + case $_RLD_ROOT in + $INSTALLROOT/arch*) ;; + ':') _RLD_ROOT=$INSTALLROOT/arch:/ ;; + /|*:/) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT ;; + *) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT:/ ;; + esac + $show _RLD_ROOT=$_RLD_ROOT + $show export _RLD_ROOT + export _RLD_ROOT + + # now set up PATH + # + # NOTE: PACKAGEROOT==INSTALLROOT is possible for binary installations + + case $PATH: in + $PACKAGEROOT/bin:*) + ;; + *) PATH=$PACKAGEROOT/bin:$PATH + ;; + esac + case $PATH: in + $INSTALLROOT/bin:*) + ;; + *) PATH=$INSTALLROOT/bin:$PATH + ;; + esac + $show PATH=$PATH + $show export PATH + export PATH + ;; + *) for i in package proto nmake + do if onpath $i + then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'` + EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'` + break + fi + done + case $HOSTTYPE in + $EXECTYPE) + OCC=$CC + CC=cc + hostinfo type + EXECTYPE=$_hostinfo_ + case $HOSTTYPE in + $EXECTYPE) + echo "$command: $CC: seems to be a cross-compiler" >&2 + echo "$command: set HOSTTYPE to something other than the native $EXECTYPE" >&2 + exit 1 + ;; + esac + ;; + esac + $show EXECTYPE=$EXECTYPE + $show export EXECTYPE + export EXECTYPE + ;; + esac + $show EXECROOT=$EXECROOT + $show export EXECROOT + export EXECROOT + + # use these if possible + + OK=ok + KSH=$EXECROOT/bin/ksh + MAKE=nmake + NMAKE=$EXECROOT/bin/$MAKE + SUM=$EXECROOT/bin/sum + TEE=$EXECROOT/bin/tee + + # grab a decent default shell + + case $KEEP_SHELL in + 0) executable "$SHELL" || SHELL= + case $SHELL in + ?*) checksh $SHELL || SHELL= ;; + esac + case $SHELL in + ''|/bin/*|/usr/bin/*) + case $SHELL in + '') SHELL=/bin/sh ;; + esac + for i in ksh sh bash + do if onpath $i && checksh $_onpath_ + then SHELL=$_onpath_ + break + fi + done + ;; + */*ksh) if executable $KSH + then SHELL=$KSH + fi + ;; + esac + ;; + esac + + # $SHELL must be /bin/sh compatible + + case $SHELL in + /bin/sh);; + '') SHELL=/bin/sh + ;; + *) $SHELL -c 'trap "exit 0" 0; exit 1' 2>/dev/null + case $? in + 1) SHELL=/bin/sh + ;; + *) # catch (our own) pipe/socket configuration mismatches + $SHELL -c "date | $SHELL -c 'read x'" + case $? in + 0) ;; + *) SHELL=/bin/sh ;; + esac + ;; + esac + ;; + esac + export SHELL + $show SHELL=$SHELL + $show export SHELL + COSHELL=$SHELL + export COSHELL + $show COSHELL=$COSHELL + $show export COSHELL + + # tame the environment + + case $action in + use) ;; + *) ENV= + ERROR_OPTIONS= + export ENV ERROR_OPTIONS + ;; + esac + + # finalize the views + + case $USER_VPATH in + '') case $VPATH in + ?*) IFS=':' + set '' $VPATH + shift + IFS=$ifs + USER_VPATH= + for i + do case $i in + */arch/$HOSTTYPE) ;; + */arch/*/*) ;; + */arch/*) continue ;; + esac + if packageroot $i + then case $USER_VPATH in + '') USER_VPATH=$i ;; + ?*) USER_VPATH=$USER_VPATH:$i ;; + esac + fi + done + esac + ;; + esac + case $USER_VPATH in + ?*) IFS=':' + set '' $USER_VPATH + shift + IFS=$ifs + USER_VPATH= + USER_VPATH_CHAIN= + p=$PACKAGEROOT + for i + do case $i in + ''|$PACKAGEROOT|$INSTALLROOT) + ;; + ?*) USER_VPATH=$USER_VPATH:$i + USER_VPATH_CHAIN="$USER_VPATH_CHAIN $p $i" + p=$i + case $PROTOROOT in + -) executable $i/bin/mamake && PROTOROOT= ;; + esac + ;; + esac + done + ;; + esac + ;; +esac +PACKAGESRC=$PACKAGEROOT/lib/package +PACKAGEBIN=$INSTALLROOT/lib/package +case $action:$run in +use:-) set '' $args + shift + case $# in + 0) ;; + *) shift ;; + esac + run="$@" + ;; +esac + +# more cygwin hassles + +case $HOSTTYPE in +cygwin.*) + lose= + case $CYGWIN in + *nontsec*) + lose=ntsec + ;; + *ntsec*);; + *) exe=/tmp/pkg$$.exe + rm -f $exe + : > $exe + if test -x $exe + then lose=ntsec + fi + ;; + esac + case $CYGWIN in + *nobinmode*) + case $lose in + '') lose=binmode ;; + *) lose="$lose binmode" ;; + esac + ;; + esac + case $lose in + ?*) echo "$command: $HOSTTYPE: export '$lose' in CYGWIN or languish in windows" >&2 + exit 1 + ;; + esac + ;; +esac + +# set up the view state + +VIEW_bin=$INSTALLROOT VIEW_src=$PACKAGEROOT VIEW_all="$INSTALLROOT $PACKAGEROOT" +if (vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN) >/dev/null 2>&1 && + vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN +then $show vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN +else VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + $show export VPATH + export VPATH + IFS=':' + set '' $VPATH + shift + IFS=$ifs + for i + do case $i in + */arch/*/*) + VIEW_src="$VIEW_src $i" + ;; + */arch/*) + VIEW_bin="$VIEW_bin $i" + ;; + *) + VIEW_src="$VIEW_src $i" + ;; + esac + VIEW_all="$VIEW_all $i" + done +fi + +# return 0 if arg in src|bin|all view + +view() # [test] [-|type] [src|bin|all] file +{ + case $1 in + -[dfsx])_view_T_=$1; shift ;; + *) _view_T_=-f ;; + esac + case $1 in + -) _view_t_= ;; + *) _view_t_=$1 ;; + esac + shift + case $1 in + all) shift; _view_v_=$VIEW_all ;; + bin) shift; _view_v_=$VIEW_bin ;; + src) shift; _view_v_=$VIEW_src ;; + *) _view_v_=$VIEW_all ;; + esac + case $1 in + /*) if test $_view_T_ $1 + then _view_=$1 + return 0 + fi + ;; + *) for _view_d_ in $_view_v_ + do if test $_view_T_ $_view_d_/$1 + then _view_=$_view_d_/$1 + return 0 + fi + done + ;; + esac + _view_= + case $_view_t_ in + ?*) echo $command: $1: $_view_t_ not found >&2 ;; + esac + return 1 +} + +# determine the package and targets + +case $action in +admin) case $admin_action in + results)action=$admin_action + set '' $admin_args + shift;shift + admin_args="admin $*" + case $admin_on in + '') target=$admin_args ;; + *) target="on $admin_on $admin_args" ;; + esac + ;; + esac + ;; +release)set '' $args + target= + while : + do shift + case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + target="$target $1" + ;; + *) break + ;; + esac + done + package=$* + ;; +setup) # { update read } with optional (bin|fun|include|lib) symlinks + # flat option sets up { bin fun include lib } symlinks from + # $INSTALLROOT to $PACKAGEROOT + + # . is the package root + + set '' $args + shift + types= + url= + while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + flat) flat=1 # backwards compatibility -- documentation dropped + ;; + *://*|*.url) + url=$1 + shift + break + ;; + *) types="$types $1" + ;; + esac + shift + done + if test ! -d $PACKAGEROOT/lib/package/tgz + then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit + fi + case " $types " in + *" source "*) + case " $* " in + ' ') ;; + *" INIT "*) + ;; + *) view - all src/cmd/INIT || + set INIT "$@" + ;; + esac + ;; + esac + packages=`$0 $global authorize "$authorize" password "$password" update setup $types $url "$@" PACKAGEROOT=$PACKAGEROOT` + case $packages in + ?*) $0 $global read $packages PACKAGEROOT=$PACKAGEROOT + esac + exit + ;; +*) package= + target= + set '' $args + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + ''|-) target="$target $package" + package= + ;; + *) if view - src "lib/package/$1.pkg" + then package="$package $1" + else target="$target $package $1" + package= + fi + ;; + esac + done + ;; +esac + +# flatten -- assumes symlink support + +case $flat in +1) case $action in + make|read|setup|update|use|view) + if test ! -d $INSTALLROOT + then $exec mkdir -p $INSTALLROOT || exit + fi + for i in bin include lib fun man share + do if test ! -d $INSTALLROOT/../../$i + then $exec mkdir $INSTALLROOT/../../$i + fi + if test ! -d $INSTALLROOT/$i + then if test ! -h $INSTALLROOT/$i + then $exec ln -s ../../$i $INSTALLROOT/$i + fi + elif test ! -h $INSTALLROOT/$i + then for x in $INSTALLROOT/$i/.[a-z]* $INSTALLROOT/$i/* + do if test -f $x -o -d $x + then if test ! -d $INSTALLROOT/$i/$x || test ! -d $INSTALLROOT/../../$i/$x + then $exec mv $x $INSTALLROOT/../../$i + fi + fi + done + $exec rm -rf $INSTALLROOT/$i + $exec ln -s ../../$i $INSTALLROOT/$i + fi + done + ;; + esac + ;; +esac + +# check that cmd args are up to date a.out's + +checkaout() # cmd ... +{ + case $PROTOROOT in + -) PROTOROOT= + case $* in + ratz) if test -f $INITROOT/ratz.c -a -w $PACKAGEROOT + then test -f $INITROOT/hello.c || { + cat > $INITROOT/hello.c <<'!' +#ifndef printf +#include +#endif +int main() { int new = 0; printf("hello world\n"); return new;} +! + } + test -f $INITROOT/p.c || { + cat > $INITROOT/p.c <<'!' +/* + * small test for prototyping cc + */ + +int main(int argc, char** argv) { return argc || argv; } +! + } + fi + ;; + esac + test -f $INITROOT/hello.c -a -f $INITROOT/p.c -a -w $PACKAGEROOT || { + for i + do onpath $i || { + echo "$command: $i: command not found" >&2 + return 1 + } + done + return 0 + } + case $cc in + '') _PACKAGE_cc=0 + ;; + *) _PACKAGE_cc=1 + test -f $INITROOT/hello.c -a -f $INITROOT/p.c || { + echo "$command: $INITROOT: INIT package source not found" >&2 + return 1 + } + executable $INSTALLROOT/bin/nmake || { + # check for prototyping cc + # NOTE: proto.c must be K&R compatible + + $CC -c $INITROOT/p.c >/dev/null 2>&1 + c=$? + rm -f p.* + test 0 != "$c" && { + checkaout proto || return + PROTOROOT=$PACKAGEROOT/proto + $show PROTOROOT=$PACKAGEROOT/proto + export PROTOROOT + INITPROTO=$PROTOROOT/src/cmd/INIT + note proto convert $PACKAGEROOT/src into $PROTOROOT/src + if test -d $PACKAGEROOT/src/cmd/nmake + then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libcoshell src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" + else dirs="src" + fi + ( + if test -f $PROTOROOT/UPDATE + then newer="-newer $PROTOROOT/UPDATE" + else newer="" + fi + case $exec in + '') cd $PACKAGEROOT + find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto + ;; + *) $exec cd $PACKAGEROOT + $exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto" + ;; + esac + $exec touch $PROTOROOT/UPDATE + ) + if (vpath $INSTALLROOT - $INSTALLROOT $PROTOROOT $PROTOROOT $PACKAGEROOT) >/dev/null 2>&1 && + vpath $INSTALLROOT - $INSTALLROOT $PROTOROOT $PROTOROOT $PACKAGEROOT + then $show vpath $INSTALLROOT $PROTOROOT $PROTOROOT $PACKAGEROOT $USER_VPATH_CHAIN + else VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + export VPATH + fi + } + } + for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return + done + ;; + esac + ;; + esac + case $_PACKAGE_cc in + '') case $cc in + '') _PACKAGE_cc=0 ;; + *) _PACKAGE_cc=1 ;; + esac + ;; + esac + for i + do eval j=\$_PACKAGE_AOUT_$i + case $j in + '') eval _PACKAGE_AOUT_$i=1 ;; + *) continue ;; + esac + k=$_PACKAGE_cc + if test -f $INITROOT/$i.c + then k=${k}1 + else k=${k}0 + fi + if executable $EXECROOT/bin/$i + then k=${k}1 + else k=${k}0 + fi + : $k : compiler : source : binary : + case $k in + *00) view - bin/$i && continue ;; + esac + case $k in + 000) echo "$command: $i: not found: download the INIT package $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 010) echo "$command: $i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 100) echo "$command: $i: not found: download the INIT package source or $HOSTTYPE binary to continue" >&2 + return 1 + ;; + 110) case $CROSS in + 1) echo "$command: $i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" >&2 + return 1 + ;; + esac + ;; + ?01) : accept binary + continue + ;; + 011) : accept binary + continue + ;; + ??1) case $CROSS in + 1) continue ;; + esac + ;; + esac + case `ls -t $INITROOT/$i.c $INSTALLROOT/bin/$i 2>/dev/null` in + "$INITROOT/$i.c"*) + note update $INSTALLROOT/bin/$i + if test proto != "$i" && executable $INSTALLROOT/bin/proto + then case $exec in + '') $INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c || return ;; + *) $exec "$INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c" ;; + esac + $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $i.c || return + $exec rm -f $i.c + else if test ! -d $INSTALLROOT/bin + then for j in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return + done + fi + if test '' != "$PROTOROOT" -a -f $INITPROTO/$i.c + then $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITPROTO/$i.c || return + else $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return + fi + case $i:$exec in + proto:) test -d $INSTALLROOT/include || mkdir $INSTALLROOT/include + $INSTALLROOT/bin/proto -f /dev/null > $i.c + cmp -s $i.c $INSTALLROOT/include/prototyped.h 2>/dev/null || cp $i.c $INSTALLROOT/include/prototyped.h + rm $i.c + ;; + esac + fi + test -f $i.o && $exec rm -f $i.o + i=$PATH + PATH=/bin + PATH=$i + ;; + esac + done + return 0 +} + +# check package requirements against received packages + +requirements() # source|binary [ package ] +{ + case $1 in + binary) r=$VIEW_BIN ;; + source) r=$VIEW_SRC ;; + *) r=$VIEW_ALL ;; + esac + shift + case $1 in + '') x= ;; + *) x=$* ;; + esac + set '' + for d in $r + do set "$@" $d/gen/*.ver + case $x in + '') set "$@" $d/gen/*.req + ;; + *) for p in $x + do set "$@" $d/gen/$p.req + done + ;; + esac + done + shift + e=0 + x=$* + y= + n= + set '' + for i in $x + do p=`echo $i | sed -e 's,.*/,,' -e 's,\....$,,'` + if test -f $i + then set "$@" $i + y="$y $p" + else case $p in + '*') ;; + *) n="$n $p" ;; + esac + fi + done + for i in $n + do case " $y " in + *" $i "*) + ;; + *) echo "$command: $i: must read or write package" >&2 + e=1 + ;; + esac + done + case $e in + 1) exit 1 ;; + esac + shift + test 0 != "$#" && release=`sort -r "$@" | { + q= + e=0 + o= + while read p v r s + do q="$q +$v $r" + case $p in + $o) continue ;; + esac + case $s in + 0) e=1 + case $r in + base) echo "$command: base package $p.$v or newer required" >&2 ;; + *) echo "$command: delta package $p.$v.$r or newer required" >&2 ;; + esac + ;; + esac + o=$p + done + case $e in + 0) echo "$q" | sort | { read v r; read v r; echo $v; } ;; + 1) echo ERROR ;; + esac + }` + case $release in + ERROR) case $force in + 0) exit 1 ;; + esac + ;; + ?*) eval `echo $release | sed -e 's,\(.*\)-\(.*\)-\(.*\),yy=\1 mm=\2 dd=\3,'` + # slide back 4 months + case $mm in + 01) mm=09 dd=1 ;; + 02) mm=10 dd=1 ;; + 03) mm=11 dd=1 ;; + 04) mm=12 dd=1 ;; + 05) mm=01 dd=0 ;; + 06) mm=02 dd=0 ;; + 07) mm=03 dd=0 ;; + 08) mm=04 dd=0 ;; + 09) mm=05 dd=0 ;; + 10) mm=06 dd=0 ;; + 11) mm=07 dd=0 ;; + 12) mm=08 dd=0 ;; + esac + case $dd in + 1) yy=`expr $yy - 1` ;; + esac + release=$yy-$mm-01 + count=1 + lo=$release + release="-f $release -r $count" + ;; + esac +} + +# write ordered package prerequisite list to the standard output + +order() # [ package ] +{ + _order_t_=lib/package/tgz + case $action in + binary) _order_a_=.$HOSTTYPE ;; + *) _order_a_= ;; + esac + _order_n_=$# + case $_order_n_ in + 0) _order_p_= + for _order_v_ in $VIEW_all + do for _order_f_ in $_order_v_/lib/package/*.pkg + do if test -f $_order_f_ + then _order_p_="$_order_p_ $_order_f_" + fi + done + done + set '' $_order_p_ + shift + esac + { + if test ratz != "$*" + then for _order_f_ in ratz INIT + do if view -s - src $_order_t_/$_order_f_$_order_a_.tim + then echo $_order_f_ $_order_f_ + fi + done + fi + for _order_f_ + do while : + do view - src $_order_f_ && break + case $_order_f_ in + *.pkg) ;; + *) _order_f_=$_order_f_.pkg; view - src $_order_f_ && break ;; + esac + case $_order_f_ in + */*) ;; + *) _order_f_=lib/package/$_order_f_; view - src $_order_f_ && break ;; + esac + echo "$command: $_order_f_: not a package" >&2 + continue 2 + done + _order_f_=$_view_ + _order_p_=`echo $_order_f_ | sed -e 's,.*/,,' -e 's,\.pkg$,,'` + case $_order_n_ in + 0) view -s - src $_order_t_/$_order_p_$_order_a_.tim || continue ;; + esac + echo $_order_p_ $_order_p_ + case $_order_p_ in + INIT|ratz) + ;; + *) echo INIT $_order_p_ + ;; + esac + { + req= req_sep= + op=:: + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :REQUIRES:) + req="$req$req_sep$1" + req_sep=" " + ;; + esac + ;; + esac + done + done + for _order_i_ in $req + do if view - src lib/package/$_order_i_.pkg + then case $_order_u_ in + 0) view -s - src $_order_t_/$_order_i_$_order_a_.tim || continue ;; + esac + echo $_order_i_ $_order_i_; echo INIT $_order_i_; echo $_order_i_ $_order_p_ + fi + done + } < $_order_f_ + done + } | tsort +} + +# generate the package component list in _components_ + +components() # [ package ] +{ + _components_= + for p + do case $p in + '') ;; + INIT) case " $_components_ " in + *" $p "*) ;; + *) _components_="$_components_ $p" ;; + esac + ;; + *) if view - src lib/package/$p.pkg + then p=$_view_ + op=:: + exec < $p + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :PACKAGE:) + case " $_components_ " in + *" $1 "*) ;; + *) _components_="$_components_ $1" ;; + esac + ;; + esac + ;; + esac + done + done + exec < /dev/null + elif test -d $PACKAGEROOT/src/cmd/$p -o -d $PACKAGEROOT/src/lib/$p + then _components_="$_components_ $p" + else echo "$command: $p: package or component not found" >&2 + exit 1 + fi + ;; + esac + done +} + +# list main environment values + +showenv() +{ + case $1 in + ''|make)for __i__ in CC SHELL $env + do eval echo $__i__='$'$__i__ + done + ;; + esac +} + +# capture command output + +capture() # file command ... +{ + case $make:$noexec in + :) case $action in + install|make|view) + o=$action + ;; + *) case $package in + ''|*' '*) + o=$action + ;; + *) o=$package + ;; + esac + ;; + esac + case $action in + write) d=$PACKAGESRC/gen ;; + *) d=$PACKAGEBIN/gen ;; + esac + test -d $d || $exec mkdir $d + o=$d/$o + case $o in + $output)o=$o.out + s= + ;; + *) output=$o + if test -f $o.old + then mv $o.old $o.out.1 + if test -f $o.out + then mv $o.out $o.out.2 + fi + elif test -f $o.out + then for i in `ls -t $o.out.? 2>/dev/null` + do break + done + case $i in + *.1) i=2 ;; + *.2) i=3 ;; + *.3) i=4 ;; + *.4) i=5 ;; + *.5) i=6 ;; + *.6) i=7 ;; + *.7) i=8 ;; + *.8) i=9 ;; + *) i=1 ;; + esac + mv $o.out $o.out.$i + fi + o=$o.out + : > $o + note $action output captured in $o + s="$command: $action start at `date` in $INSTALLROOT" + case $quiet in + 0) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT 2>&1 | \$TEE -a $o" 0 1 2 ;; + *) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT >> $o" 0 1 2 ;; + esac + ;; + esac + case $quiet in + 0) if executable ! $TEE + then TEE=tee + fi + { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null 2>&1 | $TEE -a $o + ;; + *) { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null > $o 2>&1 + ;; + esac + ;; + *) $make "$@" + ;; + esac +} + +package_install() # dest sum +{ + dest=$1 sum=$2 + ot= + code=0 + sed -e '/ /!d' -e 's,[^ ]* ,,' -e 's, \(arch/[^/]*\)/, \1 ,' -e '/ arch\//!s,^[^ ]* [^ ]* [^ ]*,& .,' -e 's,/\([^ /]*\)$, \1,' $sum | + while read mode user group arch dir file + do case $flat:$arch in + 1:*|?:.)t=$dest/$dir ;; + *) t=$dest/$arch/$dir ;; + esac + case $t in + $ot) ;; + *) if test ! -d "$t" + then $exec mkdir -p "$t" || exit + fi + ot=$t + ;; + esac + case $file in + ?*) case $arch in + .) f=$dir/$file ;; + *) f=$arch/$dir/$file ;; + esac + if test -f "$f" + then t=$t/$file + case $quiet in + 0) echo "$t" ;; + esac + $exec cp -f "$f" "$t" || code=1 + $exec chmod $mode "$t" || code=1 + fi + ;; + esac + done + return $code +} + +package_verify() # sum +{ + $exec $SUM -cp $1 +} + +make_recurse() # dir +{ + for _make_recurse_j in $makefiles + do if view - $1/$_make_recurse_j + then return + fi + done + if test -d $1 + then case $exec in + '') echo :MAKE: > $1/Makefile || exit ;; + *) $exec "echo :MAKE: > $1/Makefile" ;; + esac + fi +} + +get() # host path [ file size ] +{ + case $HURL in + '') HURL=. + for i in wget lynx curl + do if onpath $i + then HURL=$i + break; + fi + done + AUTHORIZE="User-Agent: package AT&T Research\\r\\n" + case $HURL:$authorize in + .:?*) AUTHORIZE="${AUTHORIZE}Authorization: Basic `print -n -r -- $authorize:$password | uuencode -h -x base64`\\r\\n" ;; + esac + ;; + esac + getfd=8 + case $3 in + '') case $HURL in + .) host=$1 + path=$2 + while : + do eval "exec $getfd<> /dev/tcp/$host/80" || exit + case $path in + /*) ;; + *) path=/$path ;; + esac + print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd + cat <&8 > get.tmp + got=`sed -e 1q get.tmp` + case $got in + *" "200" "*) + got=`sed -e '1,/^.$/d' -e '/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]/!d' get.tmp` + : > get.err + code=0 + break + ;; + *" "30[123]" "*) + got=`sed -e '/^Location: /!d' -e 's,^Location: \(.*\)://\([^/]*\)\(/.*\),prot='\''\1'\'' host='\''\2'\'' path='\''\3'\'',' get.tmp` + case $got in + '') rm get.tmp + echo "$command: $action: $url: redirect error" >&2 + exit 1 + ;; + esac + eval $got + ;; + *) rm get.tmp + echo "$command: $action: $url: $got" >&2 + echo '' "$got" > get.err + code=1 + break + ;; + esac + done + ;; + curl) case $authorize in + '') curl -s -L -o get.tmp http://$1/$2 2> get.err; code=$? ;; + *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` + case $code in + 0) if grep '^

Authorization Required

' get.tmp > get.err + then code=1 + fi + ;; + esac + ;; + hurl) case $authorize in + '') hurl http://$1/$2 > get.tmp 2> get.err; code=$? ;; + *) hurl -a "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` + ;; + lynx) case $authorize in + '') lynx -source http://$1/$2 > get.tmp 2> get.err; code=$? ;; + *) lynx -source -auth "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; + esac + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` + ;; + wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2 2> get.err + code=$? + got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` + ;; + *) echo $command: $action: $HURL: url get command not found >&2 + exit 1 + ;; + esac + if test 0 != "$code" + then case `cat get.err get.tmp 2>/dev/null` in + *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) + echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 + ;; + *) cat get.err + ;; + esac + rm -f get.tmp get.err + echo $command: $action: $2: download failed >&2 + exit 1 + fi + rm -f get.tmp get.err + ;; + *) case $exec in + '') echo "$3 ($4 bytes):" >&2 + case $HURL in + .) eval "exec $getfd<> /dev/tcp/$1/80" || exit + path=$2/$3 + case $path in + /*) ;; + *) path=/$path ;; + esac + print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd + read got <&$getfd + case $got in + *" 200 "*) + code=0 + : > get.err + ;; + *) echo '' "$got" > get.err + code=1 + ;; + esac + while read got <&$getfd + do case $got in + ''|?) break ;; + esac + done + cat <&$getfd > get.tmp + ;; + curl) case $authorize in + '') curl -s -L -o get.tmp http://$1/$2/$3 2> get.err; code=$? ;; + *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2/$3 2> get.err; code=$? + esac + case $code in + 0) if grep '^

Authorization Required

' get.tmp > get.err + then code=1 + fi + ;; + esac + ;; + hurl) case $authorize in + '') ksh -x hurl http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + *) ksh -x hurl -a "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + esac + ;; + lynx) case $authorize in + '') lynx -source http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + *) lynx -source -auth "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; + esac + ;; + wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2/$3 2> get.err + code=$? + ;; + *) echo $command: $action: $HURL: url get command not found >&2 + exit 1 + ;; + esac + if test 0 != "$code" + then case `cat get.err get.tmp` in + *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) + echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 + ;; + *) cat get.err + ;; + esac + rm get.tmp get.err + echo $command: $action: $3: download failed >&2 + exit 1 + fi + rm get.err + case $checksum:$5 in + :*|*:-) z=`wc -c < get.tmp` + case " $z " in + *" $4 "*) + ;; + *) rm -f get.tmp + echo $command: $3: download error: expected $4 bytes, got $z >&2 + exit 1 + ;; + esac + ;; + *) z=`$checksum < get.tmp | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` + case " $z " in + *" $5 "*) + ;; + *) rm -f get.tmp + echo $command: $3: download $checksum error: expected $5, got $z >&2 + exit 1 + ;; + esac + ;; + esac + mv get.tmp $3 || exit + ;; + *) echo "$3 ($4 bytes)" >&2 + ;; + esac + esac +} + +# generate copyright notice + +copyright() +{ + if test -f $1.lic + then echo $1 package general copyright notice + echo + proto -c'#' -p -s -l $1.lic -o type=verbose,author='*' /dev/null + return 0 + fi + case $1 in + *-*) eval `echo '' $1 | sed 's/\([^-]*\)-\(.*\)/__j__="\1" __i__="\2"/'` + if copyright $__i__ || copyright $__j__ + then return 0 + fi + ;; + esac + return 1 +} + +# run remote make on host + +remote() # host no-exec-background +{ + host=$1 + background=$2 + eval name=\$${host}_name user=\$${host}_user snarf=\$${host}_snarf type=\$${host}_type rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep log=\$${host}_log + case $keep in + 1*) ;; + *) return ;; + esac + case $host in + $main) ;; + *) case $exec in + '') exec > $admin_log/$log 2>&1 ;; + *) echo "exec > $admin_log/$log 2>&1" ;; + esac + ;; + esac + if $admin_ping $name >/dev/null 2>&1 || $admin_ping $name >/dev/null 2>&1 + then cmd=". ./.profile" + case $root in + .) root= + ;; + *) cmd="$cmd && cd $root" + root=$root/ + ;; + esac + cmd="$cmd && { test -f lib/package/admin/$admin_env && . ./lib/package/admin/$admin_env || true ;} && PATH=\${PWD:-\`pwd\`}/bin:\$PATH \${SHELL:-/bin/sh} -c 'package $admin_args PACKAGEROOT=\${PWD:-\`pwd\`} HOSTTYPE=$type VPATH='" + case $admin_binary in + '') snarf= ;; + esac + case $snarf in + '') $exec $rsh $user$name "$cmd" $background + ;; + *?) rcp=`echo $rsh | sed 's/\(.\).*/\1/'`cp + case $background in + ?*) $exec "{" ;; + esac + $exec $rsh $user$name "$cmd" + eval lst=$admin_list + case $admin_pkgs in + '') filter=cat ;; + *) filter="egrep lib/package/tgz/($admin_pkgs)\\." ;; + esac + if $exec $rcp $user$name:${root}lib/package/tgz/$lst $PACKAGESRC/tgz + then $exec $rcp `$filter $PACKAGESRC/tgz/$lst | sed "s,^,$user$name:,"` $PACKAGESRC/tgz + else echo "$command: $user$name:${root}lib/package/tgz/$lst: not found" >&2 + fi + case $background in + ?*) $exec "} $background" ;; + esac + ;; + esac + else echo "$command: $name: down" >&2 + fi +} + +# update package_src + +checksrc() +{ + case $package_src in + '') package_src=$src + for _i_ in `cd $PACKAGESRC; ls *.def *.lic *.pkg 2>/dev/null | sed 's/[-.].*//'` + do case " $package_src " in + *" $_i_ "*) + ;; + *) package_src="$package_src $_i_" + ;; + esac + done + ;; + esac +} + +# check for native ascii 0:yes 1:no + +__isascii__= + +isascii() +{ + case $__isascii__ in + '') case `echo A | od -o | sed -e 's/[ ]*$//' -e '/[ ]/!d' -e 's/.*[ ]//'` in + 005101|040412) __isascii__=0 ;; + *) __isascii__=1 ;; + esac + esac + return $__isascii__ +} + +case $action in + +admin) while test ! -f $admin_db + do case $admin_db in + /*) echo $command: $action: $admin_db: data file not found >&2 + exit 1 + ;; + esac + view file src lib/package/admin/$admin_db || exit 1 + admin_db=$_view_ + done + admin_components= + case $admin_action in + list) cat $admin_db + exit + ;; + test) set $admin_args + while : + do case $# in + 1) break ;; + esac + shift + case $1 in + *=*) ;; + *) admin_components=-$1 + break + ;; + esac + done + ;; + esac + : all work done in $PACKAGESRC/admin + cd $PACKAGESRC/admin || exit + checksrc + packages= + admin_log=${admin_action}${admin_components}.log + exec < $admin_db || exit + test -d $admin_log || $exec mkdir $admin_log || exit + case $admin_on in + '') admin_on="*" ;; + esac + hostname= + hosts= + logs= + local_hosts= + local_types= + pids= + remote_hosts= + sync_hosts= + admin_host=_admin_host_ + admin_out= + case " $admin_args " in + *" write binary "*|*" write "*" binary "*) + admin_binary=1 + ;; + *) admin_binary= + ;; + esac + case $only in + 1) admin_args="only $admin_args" ;; + esac + trap 'kill $pids >/dev/null 2>&1' 1 2 3 15 + index=0 + while read type host root date time make test write comment + do case $type in + ''|'#'*);; + *=*) eval "$type $host $root $date $time $make $test $write $comment" + ;; + *) case $admin_action in + make|test|write) + eval f='$'$admin_action + case $f in + *[!0123456789]*) continue ;; + esac + ;; + esac + rsh=rsh + case $host in + *@*) IFS=@ + set '' $host + IFS=$ifs + user=${2}@ + host=$3 + ;; + *) user= + ;; + esac + : type=$type host=$host root=$root date=$date time=$time make=$make test=$test write=$write : + name=$host + host=`echo $name | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789],__,g'` + eval x='$'${host}_index + eval ${host}_index=1 + case $x in + 1) i=0 + while : + do case $i in + $index) h='' + break + ;; + esac + i=`expr $i + 1` + eval h='$'${admin_host}${i}_name + case $h in + $host) host=${admin_host}${i} + eval user='$'${host}_user root='$'${host}_rsh:$host:'$'${host}_root + break + ;; + esac + done + ;; + esac + case $root in + *:$name:*)root=`echo '' $root | sed 's,:.*,:,'` ;; + esac + case $root in + *:*:*) index=`expr $index + 1` + host=${admin_host}$index + ;; + *:*) case " $sync_hosts " in + *" $name ${admin_host}"*) + set '' '' $sync_hosts + while : + do shift + shift + case $1 in + $name) host=$2 + break + ;; + esac + done + ;; + *) index=`expr $index + 1` + host=${admin_host}$index + sync_hosts="$sync_hosts $name $host" + ;; + esac + ;; + *) index=`expr $index + 1` + host=${admin_host}$index + ;; + esac + case $root in + -*) continue + ;; + *:*) case $admin_all in + 0) continue ;; + esac + case $root in + *:) root=${root}. ;; + esac + IFS=: + set '' $root + IFS=$ifs + sync=$host + case $hostname in + '') hostinfo name + hostname=$_hostinfo_ + ;; + esac + shift + case $# in + 0) ;; + 1) root=$1 + ;; + 2) rsh=$1 root=$2 + ;; + *) rsh=$1 sync=$2 root=$3 + case $sync in + ${admin_host}*) + ;; + ?*) case " $sync_hosts " in + *" $sync ${admin_host}"*) + set '' '' $sync_hosts + while : + do shift + shift + case $1 in + $sync) sync=$2 + break + ;; + esac + done + ;; + *) index=`expr $index + 1` + x=${admin_host}$index + sync_hosts="$sync_hosts $sync $x" + sync=$x + ;; + esac + ;; + esac + ;; + esac + ;; + *) sync= + ;; + esac + case $name in + $admin_on) + keep=1 + ;; + *) case " $admin_on " in + *" $name "*) keep=1 ;; + *) keep=0 ;; + esac + ;; + esac + case " $admin_out " in + *" $name "*) + log=$name.$type + ;; + *) admin_out="$admin_out $name" + log=$name + ;; + esac + case $sync in + '') local_types="$local_types $type" ;; + esac + case $sync in + $host) remote_hosts="$remote_hosts $host" + ;; + ?*) eval ${sync}_share=\"\$${sync}_share $host\" + ;; + '') local_hosts="$local_hosts $host" + ;; + esac + eval ${host}_name='$'name ${host}_type='$'type ${host}_user='$'user ${host}_sync='$'sync ${host}_snarf='$'sync ${host}_rsh='$'rsh ${host}_root='$'root ${host}_keep='$'keep ${host}_log='$'log + ;; + esac + done + p= + for i in $admin_args + do p="$i $p" + done + admin_pkgs= + for i in $p + do if view - src "lib/package/$i.pkg" + then case $admin_pkgs in + '') admin_pkgs="$i" ;; + *) admin_pkgs="$admin_pkgs|$i" ;; + esac + fi + done + : "admin_binary :" $admin_binary + : "admin_args :" $admin_args + : "admin_pkgs :" $admin_pkgs + : "admin_on :" "$admin_on" + : "local_hosts :" $local_hosts + : "local_types :" $local_types + : "remote_hosts :" $remote_hosts + : "sync_hosts :" $sync_hosts + : "sync_share :" $sync_share + case $admin_binary in + 1) admin_bin_types= + admin_bin_main= + for main in $local_hosts $remote_hosts + do eval share=\$${main}_share keep=\$${main}_keep + case $keep in + 0*) continue ;; + esac + for host in $main $share + do case " $admin_bin_hosts " in + *" $host "*) + continue + ;; + esac + eval type=\$${host}_type + case " $admin_bin_types " in + *" $type "*) + continue + ;; + esac + case " $types " in + " ") ;; + *" $type "*) + ;; + *) continue + ;; + esac + admin_bin_hosts="$admin_bin_hosts $host" + admin_bin_types="$admin_bin_types $type" + case " $admin_bin_hosts " in + *" $main "*) + ;; + *) case " $admin_bin_main " in + *" $main "*) + ;; + *) admin_bin_main="$admin_bin_main $main" + ;; + esac + ;; + esac + done + done + local= + remote= + for host in $admin_bin_main $admin_bin_hosts + do case " $local_hosts " in + *" $host "*) + local="$local $host" + ;; + *) case " $remote_hosts " in + *" $host "*) + remote="$remote $host" + ;; + esac + ;; + esac + done + local_hosts=$local + remote_hosts=$remote + ;; + esac + for host in $remote_hosts $local_hosts + do eval share=\$${host}_share + case $share in + ?*) while : + do oshare=$share + for s in $share + do eval r='$'${s}_share + case $r in + ?*) case " $share " in + *" $r "*) ;; + *) share="$share $r" ;; + esac + ;; + esac + done + case $share in + $oshare) eval ${host}_share="'$share'" + break + ;; + esac + done + ;; + esac + done + for host in $remote_hosts + do eval type=\$${host}_type + case " $local_types " in + *" $type "*) + eval ${host}_snarf= + ;; + esac + eval name=\$${host}_name keep=\$${host}_keep share=\$${host}_share + for share in $share + do eval type=\$${share}_type keep=\$keep\$${share}_keep + case " $local_types " in + *" $type "*) + eval ${share}_snarf= + ;; + esac + done + case $keep in + 0*1*) keep=2$keep ;; + *1*) ;; + *) keep=0 ;; + esac + eval ${host}_keep=$keep + done + for host in $remote_hosts $local_hosts + do eval name=\$${host}_name user=\$${host}_user type=\$${host}_type sync=\$${host}_sync snarf=\$${host}_snarf share=\$${host}_share rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep + case $keep in + 0*) continue ;; + esac + case $sync in + '') case $admin_action in + ditto) continue ;; + esac + case $admin_binary in + 1) case $keep in + 1*|?*1*);; + *) continue ;; + esac + ;; + esac + ;; + esac + eval main_log='$'${host}_log + main= + share_keep= + for i in $host $share + do eval n='$'${i}_name t='$'${i}_type q='$'${i}_sync s='$'${i}_snarf l='$'${i}_log k='$'${i}_keep + case $main:$k in + :*) ;; + *:0) continue ;; + esac + case $admin_binary in + 1) case $s:$q in + :?*) continue ;; + esac + case " $admin_bin_hosts " in + *" $i "*) + ;; + *) continue + ;; + esac + ;; + esac + case $main in + '') main=$i ;; + *) share_keep="$share_keep $i" ;; + esac + echo package "$admin_args" "[ $n $t ]" + case $exec in + '') : > $admin_log/$l ;; + *) $exec ": > $admin_log/$l" ;; + esac + done + host=$main + share=$share_keep + case $force in + 0) admin_ditto_update=--update ;; + *) admin_ditto_update= ;; + esac + case $exec in + '') { + case $admin_binary:$sync in + :?*) eval syncname='$'${sync}_name + test -x $PACKAGEROOT/bin/package && $admin_ditto $admin_ditto_update --remote=$rsh --expr="name=='package'" $PACKAGEROOT/bin $user$syncname:$root/bin + test -d $PACKAGESRC && $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1&&path!='LICENSES/*')status=SKIP;path=='LICENSES*|*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package + for dir in $package_src + do case $MAKESKIP in + '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; + *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; + esac + test -d $PACKAGEROOT/src/$dir && $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir + done + ;; + esac + case $admin_action in + ditto) ;; + ?*) pids= + set '' $host $share + while : + do shift + case $# in + 0) break + ;; + 1) remote $1 + ;; + *) remote $1 & + pids="$pids $!" + ;; + esac + done + case $pids in + ?*) wait $pids ;; + esac + ;; + esac + } < /dev/null > $admin_log/$main_log 2>&1 & + pids="$pids $!" + ;; + *) echo "{" + case $admin_binary:$sync in + :?*) eval syncname='$'${sync}_name + test -d $PACKAGESRC && echo $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1)status=SKIP;name=='*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package + for dir in $package_src + do case $MAKESKIP in + '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; + *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; + esac + test -d $PACKAGEROOT/src/$dir && echo $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir + done + ;; + esac + case $admin_action in + ditto) ;; + ?*) pids= + set '' $host $share + while : + do shift + case $# in + 0) break + ;; + 1) remote $1 + ;; + *) remote $1 "&" + pids=1 + ;; + esac + done + case $pids in + 1) echo wait ;; + esac + ;; + esac + echo "} < /dev/null > $admin_log/$main_log 2>&1 &" + ;; + esac + eval name='$'${main}_name + hosts="$hosts $name" + logs="$logs $main_log" + for share in $share + do eval keep=\$${share}_keep + case $keep in + 1) eval name='$'${share}_name log='$'${share}_log + hosts="$hosts $name" + logs="$logs $log" + ;; + esac + done + done + case $exec in + '') # track the progress + case $quiet in + 0) cd $admin_log + tail -t $PACKAGE_admin_tail_timeout -f $logs + cd .. + ;; + esac + # wait for the remote actions to complete + wait + trap - 1 2 3 15 + # update the db + exec < $admin_db || exit + exec 9>&1 + D=`date +%y%m%d` + while read line + do set -- $line + case $1 in + ''|'#'*|*=*) + ;; + *) case " $hosts " in + *" $2 "*) + : ast date command assumed : + E=`eval date -E \`egrep '[ ](start|done)[ ][ ]*at[ ]' $admin_log/$2 | sed -e 's/.*[ ][ ]*at[ ][ ]*//' -e 's/[ ][ ]*in[ ].*$//' -e 's/.*/"&"/'\`` + M=$6 T=$7 W=$8 + case $admin_action in + make|view) + M=`egrep -c ']:.* (\*\*\*.* code|don'\''t know) | \*\*\* termination code ' $admin_log/$2` ;; + test) T=`grep -ci 'fail[es]' $admin_log/$2` ;; + *) W=`grep '^[abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyz]*:.' $admin_log/$2 | egrep -cv 'start at|done at|output captured|warning:|: package not found|whence: command not found'` ;; + esac + case $1 in + ?|??|???|????|?????|??????|???????) + t1=' ' + ;; + ????????|?????????|??????????|???????????|????????????|?????????????|??????????????|???????????????) + t1=' ' + ;; + *) t1='' + ;; + esac + case $2 in + ?|??|???|????|?????|??????|???????) + t2=' ' + ;; + *) t2='' + ;; + esac + case $3 in + ?|??|???|????|?????|??????|???????) + t3=' ' + ;; + *) t3='' + ;; + esac + case $E in + ?????) E=" $E" ;; + ????) E=" $E" ;; + ???) E=" $E" ;; + ??) E=" $E" ;; + ?) E=" $E" ;; + esac + case $M in + ???) M="$M" ;; + ??) M=" $M" ;; + ?) M=" $M" ;; + '') M=" 0" ;; + esac + case $T in + ???) T="$T" ;; + ??) T=" $T" ;; + ?) T=" $T" ;; + '') T=" 0" ;; + esac + case $W in + ???) W="$W" ;; + ??) W=" $W" ;; + ?) W=" $W" ;; + '') W=" 0" ;; + esac + A=$1$t1 + H=$2$t2 + R=$3$t3 + case $# in + [0-8]) C= + ;; + *) shift 8 + C=" $*" + ;; + esac + echo "$A $H $R $D $E $M $T $W$C" + echo "$A $H $R $D $E $M $T $W$C" >&9 + continue + ;; + esac + ;; + esac + echo "$line" + done > $admin_db.new + mv $admin_db $admin_db.old + mv $admin_db.new $admin_db + ;; + esac + ;; + +clean|clobber) + cd $PACKAGEROOT + $exec rm -rf $INSTALLROOT + exit + ;; + +contents|list) + # all work in $PACKAGESRC + + cd $PACKAGESRC + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' *.pkg + case $2 in + '*.pkg') + echo $command: $action: no packages >&2 + exit 1 + ;; + esac + set '' `echo $* | sed 's,\.pkg,,g'` + shift + ;; + esac + sep="$nl " + echo packages in $PACKAGEROOT + case $action in + list) echo + echo "NAME${nl}VERSION${nl}RELEASE${nl}TYPE${nl}STATUS${nl}REQUIRES${nl}----${nl}-------${nl}-------${nl}----${nl}------${nl}--------" | pr -6 -a -o4 -t + ;; + esac + { + omit=: + for pkg + do if test ! -f $pkg.pkg + then echo $command: $action: $pkg: not a package >&2 + else if test -f gen/$pkg.ver + then set '' `cat gen/$pkg.ver` + case $3 in + $2) ver=base ;; + *) ver=$3 ;; + esac + if test -s tgz/$pkg.tim + then sts=local + else sts= + fi + else ver= + sts=unwritten + fi + typ= + txt= + cmp= cmp_sep= + req= req_sep= + op=:: + exec < $pkg.pkg + while read line + do IFS=' \\' + set '' $line + IFS=$ifs + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + :*:) op=$1 + ;; + INIT|'$('*|*')') + ;; + *) case $op in + :DESCRIPTION:) + txt="$txt$sep$line" + break + ;; + :PACKAGE:) + cmp="$cmp$cmp_sep$1" + cmp_sep=$nl + ;; + :REQUIRES:) + req="$req$req_sep$1" + req_sep=" " + ;; + esac + ;; + esac + done + done + exec < /dev/null + case $txt in + ?*) txt="$nl$txt" ;; + esac + case :$ver: in + *::*) ;; + *) case $action in + list) case $sts in + '') case `ls -t "tgz/$pkg.$ver.base" "tgz/$pkg.tim" 2>/dev/null` in + "tgz/$pkg.tim"*) + sts=read + ;; + *) sts=unread + ;; + esac + ;; + esac + echo "$pkg${nl}$ver${nl}base${nl}$typ${nl}$sts${nl}$req" + case $typ in + '') omit=$omit$pkg.$ver.base: ;; + esac + ;; + *) case $req in + ?*) req=": $req" ;; + esac + echo + echo $pkg $ver $req "$txt" + case $cmp in + ?*) echo "${sep}Components in this package:$nl" + echo "$cmp" | pr -4 -o4 -t ;; + esac + ;; + esac + ;; + esac + fi + done + case $argc:$action in + 0:list) if test -d tgz + then cd tgz + # f:file p:package v:version r:release t:type u:update + for f in `find . -name '*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*' -print | sed 's,^\./,,' | sort -r` + do eval `echo "$f" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` + case $t in + '') case $omit in + *:$p.$v.$r:*) continue ;; + esac + u=$p.tim + ;; + *) u=$p.$t.tim + ;; + esac + if test -s "$u" + then s=local + elif test -f "$u" + then case `ls -t "$f" "$u" 2>/dev/null` in + "$u"*) s=read ;; + *) s=unread ;; + esac + else s=unread + fi + echo "$p$nl$v$nl$r$nl$t$nl$s$nl" + done + fi + ;; + esac + } | + case $action in + list) pr -6 -a -o4 -t | sort -u ;; + *) cat ;; + esac + case $argc in + 0) if test -d $PACKAGEROOT/arch + then echo + echo architectures in $PACKAGEROOT + echo + for i in `ls $PACKAGEROOT/arch` + do if test -f $PACKAGEROOT/arch/$i/lib/package/gen/host + then h=`cat $PACKAGEROOT/arch/$i/lib/package/gen/host` + else h= + fi + echo $i + echo $h + echo + echo + done | pr -4 -a -o4 -t + fi + ;; + esac + ;; + +copyright) + # all work in $PACKAGESRC + + cd $PACKAGESRC + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' `echo *.lic | sed 's,\.lic,,g'` + shift + case $1 in + '*') echo $command: $action: no packages >&2 + exit 1 + ;; + esac + ;; + esac + checkaout proto || exit + for i + do copyright $i + done + ;; + +export) case $INSTALLROOT in + $PACKAGEROOT) + INSTALLROOT=$INSTALLROOT/arch/$HOSTTYPE + ;; + esac + case $only in + 0) v='$i=' ;; + *) v= ;; + esac + set '' $target $package + case $# in + 1) set '' $env ;; + esac + while : + do case $# in + 1) break ;; + esac + shift + i=$1 + eval echo ${v}'$'${i} + done + ;; + +install)cd $PACKAGEROOT + set '' $package + shift + case $only in + 0) set '' `order "$@"` + shift + ;; + esac + case $# in + 0) echo "$command: at least one package name expected" >&2 + exit 1 + ;; + esac + package=$* + requirements - $package + set '' $target + shift + case $1 in + flat) flat=1 # backwards compatibility -- documentation dropped + shift + ;; + esac + case $# in + 0) echo "$command: $action: target directory argument expected" >&2 + exit 1 + ;; + esac + target= + while : + do case $# in + 1) directory=$1 + break + ;; + esac + target="$target $1" + shift + done + if test ! -d $directory + then echo "$command: $action: $directory: target directory not found" >&2 + exit 1 + fi + case $target in + '') cd arch + set '' * + shift + target=$* + cd .. + ;; + esac + code=0 + makecheck=1 + for a in $target + do case $a in + -) a=$HOSTTYPE ;; + esac + case $flat:$a in + 1:*|?:.)dest=$directory + ;; + *) dest=$directory/arch/$a + if test "" = "$exec" -a ! -d $dest + then mkdir -p $dest || { + echo "$command: $dest: destination directory must exist" >&2 + exit 1 + } + fi + ;; + esac + for i in $package + do if test "ratz" = "$i" + then : skip + elif test -f arch/$a/lib/package/gen/$i.sum + then package_install $directory arch/$a/lib/package/gen/$i.sum || code=1 + elif test ! -d arch/$a/bin + then echo "$command: $a: invalid architecture" >&2 + elif test ! -d $dest + then echo "$command: $dest: destination directory must exist" >&2 + else if test "" != "$makecheck" + then if onpath $MAKE + then MAKE=$_onpath_ + else echo "$command: $MAKE: not found" >&2 + exit 1 + fi + makecheck= + fi + if test "" != "$exec" + then ( + trap - 0 1 2 15 + echo "=== $i installation manifest ===" + cd arch/$a + ( + cd lib/package + INSTALLROOT=$PACKAGEROOT/arch/$a + VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH + export INSTALLROOT VPATH + $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign + ) | sort -u + ) + else ( + set - + cd arch/$a + ( + cd lib/package + INSTALLROOT=$PACKAGEROOT/arch/$a + VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH + export INSTALLROOT VPATH + echo lib/$command + $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign + ) | sort -u | pax -drw -ps $dest + ) + fi + fi + done + done + exit $code + ;; + +license)# all work in $PACKAGESRC/LICENSES + + cd $PACKAGESRC/LICENSES || exit + + # generate the package list + + set '' $target $package + shift + argc=$# + case $# in + 0) set '' * + shift + case $1 in + '*') echo $command: $action: no licenses >&2 + exit 1 + ;; + esac + ;; + *) checkaout proto || exit + a= + for i + do while : + do if test -f ../$i.lic + then j=`proto -df -l ../$i.lic -o query=type /dev/null 2>/dev/null` + case $j in + ?*) if test -f $j + then case " $a " in + *" $j "*) ;; + *) a="$a $j" ;; + esac + fi + break + ;; + esac + fi + case $i in + *-*) i=`echo $i | sed 's/-[^-]*$//'` + ;; + *) echo "$command: $i: package license not found" >&2 + break + ;; + esac + done + done + set '' $a + shift + ;; + esac + for i + do case $exec in + '') echo + echo " --- $i source license ---" + echo + cat $i + ;; + *) echo $PACKAGESRC/LICENSES/$i + ;; + esac + done + ;; + +make|view) + cd $PACKAGEROOT + case $package in + '') lic="lib/package/*.lic" + ;; + *) for i in $package + do lic="$lic lib/package/$i.lic" + case $i in + *-*) lic="$lic lib/package/"`echo $i | sed 's,-.*,,'`".lic" ;; + esac + done + ;; + esac + checksrc + requirements source $package + components $package + package=$_components_ + + # check for some required commands + + must="$AR" + warn="$NM yacc bison" + test="$must $warn" + have= + IFS=: + set /$IFS$PATH + IFS=$ifs + shift + for t in $test + do if executable $t + then have="$have $t" + fi + done + for d + do for t in $test + do case " $have " in + *" $t "*) + ;; + *) if executable $d/$t + then have="$have $t" + fi + ;; + esac + done + done + case " $have " in + *" bison "*) ;; + *" yacc "*) have="$have bison" ;; + esac + case " $have " in + *" yacc "*) ;; + *" bison "*) have="$have yacc" ;; + esac + for t in $test + do case " $have " in + *" $t "*) + ;; + *) case " $must " in + *" $t "*) + echo "$command: $t: not found -- must be on PATH to $action" >&2 + exit 1 + ;; + *) echo "$command: warning: $t: not found -- some $action actions may fail" >&2 + ;; + esac + ;; + esac + done + + # verify the top view + + if test ! -d $PACKAGEROOT/src + then note no source packages to make + exit 0 + elif test ! -d $INSTALLROOT/src + then note initialize the $INSTALLROOT view + fi + for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in bin bin/$OK bin/$OK/lib fun include lib lib/package lib/package/gen src man man/man1 man/man3 man/man8 + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + make_recurse src + o= k= + for i in $makefiles + do case $o in + ?*) o="$o -o" k="$k|" ;; + esac + o="$o -name $i" + k="$k$i" + done + o="( $o ) -print" + for d in $package_src + do i=src/$d + if test -d $i + then test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + make_recurse $i + for j in `cd $i; find . $o 2>/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/[^/]*$,,' | sort -u` + do case $j in + $k|$MAKESKIP) continue ;; + esac + test -d $INSTALLROOT/$i/$j || + $exec mkdir -p $INSTALLROOT/$i/$j || exit + done + fi + done + def= + for i in $lic + do test -f $i || continue + cmp -s $i $INSTALLROOT/$i 2>/dev/null || + $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i + for j in `grep '^. .*\.def$' $i` + do case $j in + .) ;; + *) case " $def " in + *" $i "*) ;; + *) def="$def $i" ;; + esac + ;; + esac + done + done + for i in $def + do i=lib/package/$i + test -f $i || continue + cmp -s $i $INSTALLROOT/$i 2>/dev/null || + $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i + done + + # check $CC and { ar cc ld ldd } intercepts + + h="${HOSTTYPE} ${HOSTTYPE}.*" + case $HOSTTYPE in + *.*) t=`echo $HOSTTYPE | sed 's/[.][^.]*//'` + h="$h $t" + ;; + *) t=$HOSTTYPE + ;; + esac + case $t in + *[0123456789]) + t=`echo $t | sed 's/[0123456789]*$//'` + h="$h $t" + ;; + esac + case $CC in + cc) c=cc + b=$INSTALLROOT/bin/$c + t=$INSTALLROOT/lib/package/gen/$c.tim + intercept=0 + for k in $h + do for s in $INITROOT/$c.$k + do test -x "$s" || continue + if cmp -s "$s" "$b" >/dev/null 2>&1 + then intercept=1 + break 2 + fi + case `ls -t "$t" "$b" "$s" 2>/dev/null` in + $t*) ;; + $b*) cc=$b + ;; + $s*) cd $INSTALLROOT/lib/package/gen + tmp=pkg$$ + eval '$'exec echo "'int main(){return 0;}' > $tmp.c" + if $exec $s -o $tmp.exe $tmp.c >/dev/null 2>&1 && + test -x $tmp.exe + then case $HOSTTYPE in + *.mips*)$s -version >/dev/null 2>&1 || s= ;; + esac + case $s in + ?*) $exec sed "s/^HOSTTYPE=.*/HOSTTYPE=$HOSTTYPE/" < "$s" > "$b" || exit + $exec chmod +x "$b" || exit + cc=$b + intercept=1 + note update $b + ;; + esac + fi + $exec rm -f $tmp.* + $exec touch "$t" + cd $PACKAGEROOT + ;; + esac + break 2 + done + done + case $intercept in + 1) c=ld + b=$INSTALLROOT/bin/$c + for k in $h + do for s in $INITROOT/$c.$k + do test -x "$s" || continue + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done + done + ;; + esac + ;; + esac + c=ldd + b=$INSTALLROOT/bin/$c + for t in $h + do s=$INITROOT/$c.$t + test -x "$s" || continue + onpath $c || + case `ls -t "$b" "$s" 2>/dev/null` in + $b*) ;; + $s*) $exec cp "$s" "$b" + note update $b + ;; + esac + done +# following code stubbed out just in case ar.ibm.risc is needed +# c=ar +# b=$INSTALLROOT/bin/$c +# for t in $h +# do s=$INITROOT/$c.$t +# test -x "$s" || continue +# onpath $c || +# case `ls -t "$b" "$s" 2>/dev/null` in +# $b*) ;; +# $s*) x=`$s -tv /foo/bar.a 2>&1 | egrep -i 'option|usage'` +# case $x in +# '') $exec cp "$s" "$b" +# note update $b +# ;; +# esac +# ;; +# esac +# done + case $cc in + /*) ;; + *) echo "$command: $CC: not found -- set CC=C-compiler" >&2 + exit 1 + ;; + esac + case $exec in + '') cd $INSTALLROOT/lib/package/gen + tmp=pkg$$ + echo 'int main(){return 0;}' > $tmp.c + if $CC -o $tmp.exe $tmp.c > /dev/null 2> $tmp.err && + test -x $tmp.exe + then : ok + else echo "$command: $CC: failed to compile this program:" >&2 + cat $tmp.c >&2 + if test -s $tmp.err + then cat $tmp.err >&2 + else echo "$command: $CC: not a C compiler" >&2 + fi + rm -f $tmp.* + exit 1 + fi + rm -f $tmp.* + cd $PACKAGEROOT + ;; + esac + + # remember the default $CC + + case $CC in + cc) ;; + *) if test -x $INSTALLROOT/bin/cc + then case `sed 1q $INSTALLROOT/bin/cc` in + ": $CC :") + CC=cc + export CC + ;; + *) assign="$assign CC=\"\$CC\"" + ;; + esac + else case $CROSS in + 1) assign="$assign CC=\"\$CC\"" + ;; + *) case $exec in + '') { + echo ": $CC :" + echo "$CC \"\$@\"" + } > $INSTALLROOT/bin/cc + chmod +x $INSTALLROOT/bin/cc + ;; + *) note generate a $INSTALLROOT/bin/cc wrapper for $CC + ;; + esac + CC=cc + export CC + ;; + esac + fi + ;; + esac + + # no $INITROOT means INIT already installed elsewhere + + if test -d $INITROOT + then + # update probe scripts + + for i in lib/probe lib/probe/C lib/probe/C/make + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done + i=$INSTALLROOT/lib/probe/C/make/probe + j=$INITROOT/C+probe + k=$INITROOT/make.probe + case `ls -t $i $j $k 2>/dev/null` in + $i*) ;; + *) if test -f $j -a -f $k + then note update $i + shellmagic + case $exec in + '') { + case $SHELLMAGIC in + ?*) echo "$SHELLMAGIC" ;; + esac + cat $j $k + } > $i || exit + ;; + *) echo "{ +echo $SHELLMAGIC +cat $j $k +} > $i" + ;; + esac + $exec chmod +x $i || exit + fi + ;; + esac + fi + + # initialize a few mamake related commands + + checkaout mamake proto ratz release || exit + + # execrate if necessary + + if (execrate) >/dev/null 2>&1 + then execrate=execrate + $make cd $INSTALLROOT/bin + for i in chmod chgrp cmp cp ln mv rm + do if test ! -x $OK/$i -a -x /bin/$i.exe + then shellmagic + case $exec in + '') echo "$SHELLMAGIC"'execrate /bin/'$i' "$@"' > $OK/$i + chmod +x $OK/$i + ;; + *) $exec echo \'"$SHELLMAGIC"'execrate /bin/'$i' "$@"'\'' >' $OK/$i + $exec chmod +x $OK/$i + ;; + esac + fi + done + PATH=$INSTALLROOT/bin/$OK:$PATH + export PATH + else execrate= + fi + case $action in + view) exit 0 ;; + esac + + # all work under $INSTALLROOT/src + + $make cd $INSTALLROOT/src + + # record the build host name + + case $noexec in + '') hostinfo name + echo "$_hostinfo_" | sed 's,\..*,,' > $PACKAGEBIN/gen/host + ;; + esac + + # make in parallel if possible + + case $NPROC in + '') hostinfo cpu + case $_hostinfo_ in + 0|1) ;; + *) NPROC=$_hostinfo_ + $show NPROC=$NPROC + $show export NPROC + export NPROC + ;; + esac + ;; + esac + + # separate flags from target list + + case $target in + *-*) a= + for t in $target + do case $t in + -[eiknFKNV]*|--*-symbols) + makeflags="$makeflags $t" + ;; + -*) nmakeflags="$nmakeflags $t" + ;; + *) a="$a $t" + ;; + esac + done + target=$a + ;; + esac + + # generate nmake first if possible + + if executable ! $NMAKE && test -d $PACKAGEROOT/src/cmd/nmake + then if nonmake $MAKE + then note make $NMAKE with mamake + c=$CC + a=$assign + case $HOSTTYPE in + win32*|cygwin*) + CC="$CC -D_BLD_STATIC" + accept="libast" + case $assign in + *' CC='*) ;; + *) assign="$assign CC=\"\$CC\"" ;; + esac + ;; + *) accept=nmake + ;; + esac + eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign + assign=$a + CC=$c + case $make$noexec in + '') if executable ! $NMAKE + then echo "$command: $action: errors making $NMAKE" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + if test '' != "$PROTOROOT" + then if (vpath $INSTALLROOT - $PROTOROOT - $INSTALLROOT $PACKAGEROOT) >/dev/null 2>&1 && + vpath $INSTALLROOT - $PROTOROOT - $INSTALLROOT $PACKAGEROOT + then $show vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN + else VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH + $show VPATH=$VPATH + export VPATH + fi + fi + note believe generated files for $accept + eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign + $exec touch $INSTALLROOT/bin/.paths + note make the remaining targets with $NMAKE + else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign + case $make$noexec in + '') if executable ! $NMAKE + then echo "$command: $action: errors making $NMAKE" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + fi + fi + + # generate ksh next if possible + + if nonmake $MAKE + then : no need to generate ksh next -- it could be the only package + elif test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH + then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign + case $make$noexec in + '') if executable ! $KSH + then echo "$command: $action: errors making $KSH" >&2 + exit 1 + fi + ;; + *) make=echo + ;; + esac + fi + + # mamprobe data should have been generated by this point + + case $exec in + '') if test ! -f $INSTALLROOT/bin/.paths -o -w $INSTALLROOT/bin/.paths + then nl=" +" + o=`cat $INSTALLROOT/bin/.paths 2>/dev/null` + v= + n= + case $nl$o in + *${nl}FPATH=*|*#FPATH=*|*[Nn][Oo]FPATH=*) + ;; + *) case $n in + '') ;; + *) n="$n$nl" v="$v|" ;; + esac + n="${n}FPATH=../fun" + v="${v}FPATH" + ;; + esac + case $nl$o in + *${nl}BUILTIN_LIB=*|*#BUILTIN_LIB=*|*[Nn][Oo]BUILTIN_LIB=*) + ;; + *) case $n in + '') ;; + *) n="$n$nl" v="$v|" ;; + esac + if grep '^setv mam_cc_DIALECT .* EXPORT=[AD]LL' $INSTALLROOT/lib/probe/C/mam/* >/dev/null 2>&1 + then x= + else x='no' + fi + n="${n}${x}BUILTIN_LIB=cmd" + v="${v}BUILTIN_LIB" + ;; + esac + case $n in + ?*) case $o in + ?*) o=`egrep -v "($v)=" $INSTALLROOT/bin/.paths`$nl ;; + esac + echo "# use { # no NO } prefix instead of XX to permanently disable #$nl$o$n" > $INSTALLROOT/bin/.paths + ;; + esac + fi + ;; + esac + + # run from separate copies since nmake and ksh may be rebuilt + + case $EXECROOT in + $INSTALLROOT) + $make cd $INSTALLROOT/bin + if executable /bin/cp + then cp=/bin/cp + else cp=cp + fi + if executable /bin/mv + then mv=/bin/mv + else mv=mv + fi + if executable /bin/rm + then rm=/bin/rm + else rm=rm + fi + for i in \ + ksh nmake tee cp ln mv rm \ + *ast*.dll *cmd*.dll *dll*.dll *shell*.dll + do executable $i && { + cmp -s $i $OK/$i 2>/dev/null || { + test -f $OK/$i && + $exec $execrate $rm $OK/$i &2 + exit 1 + ;; + esac + $exec $execrate $cp $i $OK/$i + } + } + done + if test -f ../lib/make/makerules.mo + then cmp -s ../lib/make/makerules.mo $OK/lib/makerules.mo || + $exec $execrate $cp -p ../lib/make/makerules.mo $OK/lib/makerules.mo || + $exec $execrate $cp ../lib/make/makerules.mo $OK/lib/makerules.mo + fi + if executable $OK/nmake + then MAKE="$INSTALLROOT/bin/$OK/nmake LOCALRULESPATH=$INSTALLROOT/bin/$OK/lib" + fi + if executable $OK/tee + then TEE=$INSTALLROOT/bin/$OK/tee + fi + if test "$KEEP_SHELL" != 1 && executable $OK/ksh + then SHELL=$INSTALLROOT/bin/$OK/ksh + export SHELL + COSHELL=$SHELL + export COSHELL + fi + case :$PATH: in + *:$INSTALLROOT/bin/$OK:*) + ;; + *) PATH=$INSTALLROOT/bin/$OK:$PATH + export PATH + ;; + esac + $make cd $INSTALLROOT/src + ;; + esac + + # fall back to mamake if nmake not found or too old + + if nonmake $MAKE + then note make with mamake + case $target in + '') target="install" ;; + esac + eval capture mamake \$makeflags \$noexec \$target $assign + else case $target in + '') target="install cc-" ;; + esac + eval capture \$MAKE \$makeflags \$nmakeflags \$noexec recurse \$target \$nmakesep \$package $assign + fi + ;; + +read) case ${PWD:-`pwd`} in + $PACKAGEROOT) + ;; + *) echo "$command: must be in package root directory" >&2 + exit 1 + ;; + esac + PAX= + if onpath pax + then case `$_onpath_ -rw --?meter 2>&1` in + *--meter*) PAX=pax ;; + esac + fi + code=0 + i= + x= + remove= + touch= + set '' $target + case $2 in + lcl|tgz)tgz=$2 + shift 2 + target=$* + ;; + *) tgz=tgz + ;; + esac + set '' $package $target + case $# in + 1) verbose=: + set '' `ls lib/package/$tgz/*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + ;; + *) verbose= + ;; + esac + shift + files= + for f + do if test -f "$f" + then : ok + elif test -f "lib/package/$tgz/$f" + then f=lib/package/$tgz/$f + else set '' `ls -r ${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + if test '' != "$2" -a -f "$2" + then f=$2 + else set '' `ls -r lib/package/$tgz/${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` + if test '' != "$2" -a -f "$2" + then f=$2 + else echo "$command: $f: package archive not found" >&2 + continue + fi + fi + fi + files="$files $f" + done + case $files in + '') echo "$command: lib/package/$tgz: no package archives" >&2 + exit 1 + ;; + esac + set '' `ls -r $files 2>/dev/null` + shift + f1= f2= f3= f4= + for f + do case $f in + ratz.*|*/ratz.*) + f1="$f1 $f" + ;; + INIT.*|*/INIT.*) + f2="$f2 $f" + ;; + INIT*|*/INIT*) + f3="$f3 $f" + ;; + *) f4="$f4 $f" + ;; + esac + done + gen= + set '' $f1 $f2 $f3 $f4 + while : + do shift + case $# in + 0) break ;; + esac + f=$1 + case $f in + *.gz) : standalone packages unbundled manually + continue + ;; + *.md5) : tarball checksum + continue + ;; + *?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*) + ;; + *) echo "$command: $f: not a package archive" >&2 + code=1 + continue + ;; + esac + case $f in + */*) eval `echo "$f" | sed -e 's,\(.*/\)\(.*\),d=\1 a=\2,'` ;; + *) d= a=$f ;; + esac + # f:file d:dir a:base p:package v:version r:release t:type + eval `echo "$a" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` + case $r in + base) y=$p.base ;; + *) y=$p.delta ;; + esac + case " $x " in + *" $y "*) + continue + ;; + esac + case $t in + '') w=$PACKAGESRC + q= + Q= + m= + ;; + *) w=$PACKAGEROOT/arch/$t/lib/package + q=".$t" + Q="_$t" + m="[_.]$t" + ;; + esac + u=$d$p$q.tim + if test -s "$u" + then continue + else case $force in + 0) case `ls -t "$f" "$u" 2>/dev/null` in + "$u"*) case $verbose in + 1) note $p already read ;; + esac + continue + ;; + esac + ;; + esac + fi + case $p in + INIT) if test -f $PACKAGEROOT/bin/package + then $exec mv $PACKAGEROOT/bin/package $PACKAGEROOT/bin/package.old + fi + ;; + esac + z= + case $r in + base) # base archive + if test ratz = "$p" + then # ratz packages are not archives + case $t in + '') for i in src src/cmd src/cmd/INIT + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + $exec cp $f $PACKAGEROOT/src/cmd/INIT/$p.c + ;; + *) for i in arch arch/$t arch/$t/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + $exec cp $f $PACKAGEROOT/arch/$t/bin/$p && + $exec chmod +x $PACKAGEROOT/arch/$t/bin/$p + ;; + esac + elif test "" != "$PAX" + then $exec pax -L --from=ascii --local -m -ps -rvf "$f" || { + code=1 + continue + } + else if onpath gunzip && onpath $TAR && isascii + then case $TARPROBE in + ?*) for i in $TARPROBE + do if $TAR ${i}f - /dev/null > /dev/null 2>&1 + then TARFLAGS=$TARFLAGS$i + fi + done + TARPROBE= + ;; + esac + if gunzip -l < "$f" > /dev/null 2>&1 + then case $exec in + '') $exec gunzip < "$f" | $TAR ${TARFLAGS}f - ;; + *) $exec "gunzip < $f | $TAR ${TARFLAGS}f -" ;; + esac || { + code=1 + continue + } + else $exec $TAR ${TARFLAGS}f "$f" || { + code=1 + continue + } + fi + else checkaout ratz && onpath ratz || { + code=1 + continue + } + RATZ=$_onpath_ + case $exec in + '') echo $f: + $exec $RATZ -lm < "$f" + ;; + *) $exec "$RATZ -lm < $f" + ;; + esac || { + code=1 + continue + } + fi + if test -f $PACKAGEBIN/gen/$p.sum + then while read md5 mode usr grp file + do case $file in + -*) file=./$file ;; + esac + case $mode in + [01234567][01234567][01234567][01234567]) + case $grp in + -) ;; + *) $exec chgrp $grp "$file" ;; + esac + case $usr in + -) ;; + *) $exec chown $usr "$file" ;; + esac + $exec chmod $mode "$file" + ;; + esac + done < $PACKAGEBIN/gen/$p.sum + fi + fi + ;; + *) # delta archive + test "" != "$PAX" || { + echo "$command: $f: pax required to read delta archive" >&2 + code=1 + continue + } + case `echo "$v: +$r:" | sort` in + $r:*) y=$p.base + b=${d}${p}_${r}${Q}.tgz + test -f "$b" || b=${d}${p}.${r}${q}.tgz + test -f "$b" || { + case " $gen " in + *" $b "*) + ;; + *) case $# in + 1) echo "$command: $f: base archive $b required to read delta" >&2 + code=1 + ;; + *) shift + y=$1 + shift + set '' $y $f "$@" + esac + continue + ;; + esac + } + # -m with delta bug fixed 2005-02-08 + $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { + code=1 + continue + } + note $f: generate new base $d$p.$v$q.tgz + $exec pax -rf "$f" -z "$b" -wf $d$p.$v$q.tgz -x tgz || { + code=1 + continue + } + case $exec in + '') echo $p $v $v 1 > $w/gen/$p.ver + ;; + *) z=$d${p}[_.]$v$q.tgz + $exec "echo $p $v $v 1 > $w/gen/$p.ver" + gen="$gen $d$p.$v$q.tgz" + ;; + esac + case " $remove " in + *" $f "*) ;; + *) remove="$remove $f" ;; + esac + ;; + *) b=${d}${p}_${v}${Q}.tgz + test -f "$b" || b=${d}${p}.${v}${q}.tgz + test -f "$b" || { + case " $gen " in + *" $b "*) + ;; + *) case $# in + 1) echo "$command: $f: base archive $b required to read delta" >&2 + code=1 + ;; + *) shift + y=$1 + shift + set '' $y $f "$@" + esac + continue + ;; + esac + } + # -m with delta bug fixed 2005-02-08 + $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { + code=1 + continue + } + ;; + esac + ;; + *) echo "$command: $f: unknown archive type" >&2 + code=1 + continue + ;; + esac + + # check for ini files + + if executable $w/$p.ini + then $exec $w/$p.ini read || { + code=1 + continue + } + fi + + # add to the obsolete list + + k= + for i in `ls $d$p[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]????$m* $z 2>/dev/null` + do case $i in + *.md5) continue + ;; + $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) + ;; + $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) + continue + ;; + esac + case $k in + ?*) case " $remove " in + *" $k "*) ;; + *) remove="$remove $k" ;; + esac + ;; + esac + k=$i + done + x="$x $y" + case " $touch " in + *" $u "*) ;; + *) touch="$touch $u" ;; + esac + done + if test ! -f $PACKAGEROOT/bin/package -a -f $PACKAGEROOT/bin/package.old + then $exec cp $PACKAGEROOT/bin/package.old $PACKAGEROOT/bin/package + fi + + # drop obsolete archives + + case $remove in + ?*) $exec rm -f $remove ;; + esac + + # mark the updated archives + + case $touch in + ?*) sleep 1; $exec touch $touch ;; + esac + + # check the requirements + + case $code$exec in + 0) requirements - $x ;; + esac + exit $code + ;; + +regress)if test ! -d $PACKAGEBIN/gen + then echo "$command: 'package make' and 'package test' required for regression" >&2 + exit 1 + fi + dir=$PACKAGEBIN/gen + cd $dir + for s in out old + do case `ls -t regress.$s test.$s 2>/dev/null` in + regress*) + ;; + test*) if test -f regress.$s + then $exec mv regress.$s regress.old + fi + case $exec in + '') egrep -i '\*\*\*|FAIL|^TEST.* [123456789][0123456789]* error|core.*dump' test.$s | + sed -e '/\*\*\* [0123456789]/d' \ + -e '/^TEST.\//s,/[^ ]*/,,' \ + -e 's,[ ][ ]*$,,' \ + -e 's/[0123456789][0123456789]*:* \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*[Cc][Oo][Rr][Ee][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*)\)/\1/' \ + -e 's/\.sh failed at .* with /.sh failed /' \ + > regress.$s + ;; + *) $exec filter test failures from $dir/test.$s to $dir/regress.$s + ;; + esac + ;; + esac + done + if test -f regress.out -a -f regress.old + then $exec diff -b regress.out regress.old + else echo "$command: at least 2 test runs required for regression" >&2 + exit 1 + fi + ;; + +release)count= lo= hi= + checksrc + checkaout release || exit + requirements source $package + components $package + package=$_components_ + set '' $target + shift + case $# in + 0) ;; + *) case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + case $1 in + -) lo= release= ;; + *) lo=$1 release="-f $1" ;; + esac + shift + case $1 in + -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) + case $1 in + -) hi= ;; + *) hi=$1 release="$release -t $1" ;; + esac + shift + ;; + esac + ;; + [0123456789]|[0123456789][0123456789]|[0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789][0123456789]*) + count=$1 + release="-r $count" + shift + ;; + esac + ;; + esac + case $# in + 0) case $package in + '') package=* ;; + esac + ;; + *) case $package in + '') package=$* + ;; + *) echo $command: $*: lo-date hi-date arguments expected >&2 + exit 1 + ;; + esac + ;; + esac + echo + case $count:$lo:$hi in + ::) echo "All recorded changes follow." ;; + 1::) echo "Changes since the last release follow." ;; + ?*::) echo "Changes since the last $count releases follow." ;; + 1:?*:) echo "Changes since $lo or the last release follow." ;; + *:?*:*) echo "Changes since $lo follow." ;; + *::?*) echo "Changes before $hi follow." ;; + *) echo "Changes between $lo and $hi follow." ;; + esac + x= + for r in $INSTALLROOT $PACKAGEROOT + do for s in $package_src + do d=$r/src/$s + if test -d $d + then cd $d + for i in $package + do if test -h $i 2>/dev/null + then continue + fi + case " $x " in + *" $i "*) continue ;; + esac + for f in RELEASE CHANGES ChangeLog + do if test -f $i/$f + then $exec release $release $i/$f + x="$x $i" + for f in $i/*/$f + do if test -f $f + then $exec release $release $f + fi + done + break + fi + done + done + fi + done + done + ;; + +remove) echo "$command: $action: not implemented yet" >&2 + exit 1 + ;; + +results)set '' $target + shift + def=make + dir=$PACKAGEBIN/gen + case $verbose in + 0) filter=yes ;; + *) filter=cat ;; + esac + path=0 + suf=out + on= + while : + do case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + admin) dir=$PACKAGESRC/admin + ;; + error*|fail*) + filter=errors + ;; + make|test|view|write) + def=$1 + case $filter:$1:$SHELL in + errors:*:*) ;; + *:test:*/ksh*) filter=rt ;; + esac + ;; + old) suf=old + ;; + on) case $# in + 1) echo $command: $action: $1: host pattern argument expected >&2 + exit 1 + ;; + esac + shift + case $on in + ?*) on="$on|" ;; + esac + on="$on$1" + ;; + path) path=1 + ;; + test) def=test + filter=rt + ;; + *) break + ;; + esac + shift + done + case $dir in + */admin)case $on in + '') on="*" ;; + *) on="@($on)" ;; + esac + def=$def.log/$on + ;; + esac + case $# in + 0) set "$def" ;; + esac + m= + t= + for i + do k=0 + eval set '""' $i - $i.$suf - $dir/$i - $dir/$i.$suf - + shift + for j + do case $j in + -) case $k in + 1) continue 2 ;; + esac + ;; + *) if test -f $j + then k=1 + case /$j in + */test.*) t="$t $j" ;; + *) m="$m $j" ;; + esac + fi + ;; + esac + done + echo "$command: $i action output not found" >&2 + exit 1 + done + sep= + case $t in + ?*) case $path in + 0) for j in $t + do echo "$sep==> $j <==" + sep=$nl + case $filter in + cat) $exec cat $j + ;; + errors) $exec egrep -i '\*\*\*|FAIL[ES]|^TEST.* [123456789][0123456789]* error|core.*dump' $j | sed -e '/^TEST.\//s,/[^ ]*/,,' + ;; + rt) $exec rt - $j + ;; + *) $exec egrep -i '^TEST|FAIL' $j + ;; + esac + done + ;; + 1) echo $t + ;; + esac + ;; + esac + case $m in + ?*) case $path in + 0) case $filter in + cat) cat $m + ;; + *) if test -f $HOME/.pkgresults + then i="`cat $HOME/.pkgresults`" + case $i in + '|'*) ;; + *) i="|$i" ;; + esac + else i= + fi + for j in $m + do echo "$sep==> $j <==" + sep=$nl + case $filter in + errors) $exeg egrep '^pax:|\*\*\*' $j + ;; + *) $exec egrep -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|pragma.*prototyped|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | + $exec grep : + ;; + esac + done + ;; + esac + ;; + 1) echo $m + ;; + esac + esac + ;; + +test) requirements source $package + components $package + package=$_components_ + case $only in + 0) only= ;; + 1) only=--recurse=only ;; + esac + + # must have nmake + + if nonmake $MAKE + then echo $command: $action: must have $MAKE to test >&2 + exit 1 + fi + + # all work under $INSTALLROOT/src + + $make cd $INSTALLROOT/src + + # disable core dumps (could be disasterous over nfs) + + (ulimit -c 0) > /dev/null 2>&1 && ulimit -c 0 + + # do the tests + + eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign + ;; + +update) # download the latest release.version for selected packages + + # all work in $PACKAGEROOT/lib/package/tgz + + if test ! -d $PACKAGEROOT/lib/package/tgz + then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit + $exec cd $PACKAGEROOT/lib/package/tgz + else cd $PACKAGEROOT/lib/package/tgz + fi + + # get the architectures, update query url, and packages + + set '' $args + op=update + tgz=tgz + source= + binary= + setup= + types= + url= + urlfile=$default_url + while : + do shift + case $# in + 0) break ;; + esac + case $1 in + --) shift + break + ;; + beta) op=beta + tgz=beta + ;; + binary) binary=1 + ;; + setup) setup=1 + ;; + source) source=1 + ;; + *://*) url=$1 + shift + break + ;; + *.url) urlfile=$1 + if test ! -s $urlfile + then echo $command: $urlfile: not found >&2; exit 1 + fi + break + ;; + $all_types) + binary=1 + types="$types $1" + ;; + *) break + ;; + esac + done + case $source:$binary in + :) source=1 binary=1 + ;; + :1) case $types in + '') types=$HOSTTYPE ;; + esac + ;; + esac + case $url in + '') case $urlfile in + $default_url) + if test ! -s $urlfile + then echo $command: url argument expected >&2; exit 1 + fi + ;; + *) default_url= + ;; + esac + url= + if grep '^url=' $urlfile >/dev/null + then a=$authorize + p=$password + case $urlfile in + */*) ;; + *) urlfile=./$urlfile ;; + esac + . $urlfile + case $a:$p in + $authorize:$password) + default_url= + ;; + *) case $a in + ?*) authorize=$a ;; + esac + case $p in + ?*) password=$p ;; + esac + ;; + esac + else url=`cat $urlfile` + fi + ;; + esac + case $exec in + ?*) default_url= ;; + esac + + # get the update list + + eval `echo $url | sed 's,\(.*\)://\([^/]*\)/\(.*\),prot=\"\1\" host=\"\2\" dir=\"\3\",'` + get $host $dir/$op.html + + # get/check the package names + + case " $* " in + *" - "*)case $source in + 1) source_packages=$* ;; + *) source_packages= ;; + esac + case $binary in + 1) binary_packages=$* ;; + *) binary_packages= ;; + esac + package_hit=$* + ;; + " ") nl=" +" + case $source in + 1) p= + for f in `ls *.????-??-??.* 2>/dev/null` + do case $f in + *.????-??-??.????-??-??.*.*) + ;; + *.????-??-??.????-??-??.*) + p=$p$nl$f + ;; + *.????-??-??.*.*) + ;; + *.????-??-??.*) + p=$p$nl$f + ;; + esac + done + set '' `echo "$p" | sed 's,\..*,,' | sort -u` + shift + source_packages=$* + ;; + *) source_packages= + ;; + esac + case $binary in + 1) p= + for f in `ls *.????-??-??.* 2>/dev/null` + do case $f in + *.????-??-??.????-??-??.*.*) + p=$p$nl$f + ;; + *.????-??-??.????-??-??.*) + ;; + *.????-??-??.*.*) + p=$p$nl$f + ;; + *.????-??-??.*) + ;; + esac + done + set '' `echo "$p" | sed 's,\..*,,' | sort -u` + shift + binary_packages=$* + ;; + *) binary_packages= + ;; + esac + package_hit="$source_packages $binary_packages" + ;; + *) case $source in + 1) source_packages=$* ;; + *) source_packages= ;; + esac + case $binary in + 1) binary_packages=$* ;; + *) binary_packages= ;; + esac + package_hit= + ;; + esac + + # get the latest updates + + types_test= + types_local= + dir=$dir/$tgz + case $default_url in + ?*) echo "url='$url' authorize='$authorize' password='$password'" > $default_url + case $authorize in + ?*) chmod go-rwx $default_url ;; + esac + ;; + esac + echo "$got" > got.tmp + case $only in + 0) exec < got.tmp + covered= + while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment + do case $requires in + ''|-*) continue ;; + esac + IFS=: + set '' $requires + IFS=$ifs + case $type in + -) case " $source_packages " in + *" $name "*|*" - "*) + for name + do case " $source_packages " in + *" $name "*) + ;; + *) source_packages="$source_packages $name" + covered=$covered:$covers + ;; + esac + done + ;; + esac + ;; + *) case " $binary_packages " in + *" $name "*|*" - "*) + for name + do case " $binary_packages " in + *" $name "*) + ;; + *) binary_packages="$binary_packages $name" + covered=$covered:$covers + ;; + esac + done + ;; + esac + ;; + esac + done + case $covered in + ?*) x=$source_packages + source_packages= + for name in $x + do case :$covered: in + *:$name:*) ;; + *) source_packages="$source_packages $name" ;; + esac + done + x=$binary_packages + binary_packages= + for name in $x + do case :$covered: in + *:$name:*) ;; + *) binary_packages="$binary_packages $name" ;; + esac + done + ;; + esac + ;; + esac + checksum= + for i in $checksum_commands + do case `( $i ) < /dev/null 2> /dev/null` in + ${checksum_empty}|${checksum_empty}[\ \ ]*) + checksum=$i + break + ;; + esac + done + case $checksum in + '') echo $command: warning: '{' $checksum_commands '}' command not found -- only download sizes will be checked >&2 ;; + esac + exec < got.tmp + while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment + do case $verbose in + 1) case $type in + -) i= ;; + *) i=.$type ;; + esac + j="$name.$base$i.$suffix" + case $delta in + -) j="$j -" ;; + *) j="$j $name.$base.$delta$i.$suffix" ;; + esac + case $sync in + -) j="$j -" ;; + *) j="$j $name.$base.$sync$i.$suffix" ;; + esac + echo $command: $j $base_size:$base_sum $delta_size:$delta_sum $sync_size:$sync_sum $requires >&2 + esac + case " $package_hit " in + *" $name "*|*" - "*) + ;; + *) package_hit="$package_hit $name" + ;; + esac + case $type in + -) case " $source_packages " in + *" $name "*|*" - "*) + if test -s $name.tim + then continue + fi + lcl=$name.$base.$suffix + if test -f $lcl + then case $checksum:$base_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" + then rmt= + case $sync:$sync_size in + -*|*[-:]) + ;; + *) lcl=$name.$base.$sync.$suffix + if test -f $lcl + then rmt=1 + get $host $dir $lcl $sync_size $sync_sum + fi + ;; + esac + case $base:$base_size in + -*|*[-:]) + ;; + *) case $rmt in + '') lcl=$name.$base.$suffix + get $host $dir $lcl $base_size $base_sum + ;; + esac + ;; + esac + fi + case $delta:$delta_size in + -*|*[-:]) + ;; + *) lcl=$name.$delta.$base.$suffix + if test -f $lcl + then case $checksum:$delta_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" + then get $host $dir $lcl $delta_size $delta_sum + fi + ;; + esac + ;; + esac + ;; + *) case " $binary_packages " in + *" $name "*|*" - "*) + if test -s $name.$type.tim + then continue + fi + case " $types " in + *" - "*);; + " ") case " $types_test " in + *" $type "*) + ;; + *) types_test="$types_test $type" + for i in *.????-??-??.$type.* *.????-??-??.????-??-??.$type.* + do if test -f $i + then types_local="$types_local $type" + fi + break + done + ;; + esac + case " $types_local " in + *" $type "*) + ;; + *) continue + ;; + esac + ;; + *) case " $types " in + *" $type "*) + ;; + *) continue + ;; + esac + ;; + esac + lcl=$name.$base.$type.$suffix + if test -f $lcl + then case $checksum:$base_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" + then rmt= + case $sync:$sync_size in + -*|*[-:]) + ;; + *) lcl=$name.$base.$sync.$type.$suffix + if test -f $lcl + then rmt=1 + get $host $dir $lcl $sync_size $sync_sum + fi + ;; + esac + case $base:$base_size in + -*|*[-:]) + ;; + *) case $rmt in + '') lcl=$name.$base.$type.$suffix + get $host $dir $lcl $base_size $base_sum + ;; + esac + ;; + esac + fi + case $delta:$delta_size in + -*|*[-:]) + ;; + *) lcl=$name.$delta.$base.$type.$suffix + if test -f $lcl + then sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` + else sum=X + fi + if test -f $lcl + then case $checksum:$delta_sum in + :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; + *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; + esac + else size=X sum=X + fi + if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" + then get $host $dir $lcl $delta_size $delta_sum + fi + ;; + esac + ;; + esac + ;; + esac + done + closure= + for name in $source_packages $binary_packages + do case $name in + -) ;; + *) case " $package_hit " in + *" $name "*) + case $setup in + 1) case " $closure " in + *" $name "*) + ;; + *) closure="$closure $name" + ;; + esac + ;; + esac + ;; + *) echo $command: $name: unknown package >&2 + ;; + esac + ;; + esac + done + exec <&- + rm -f got.tmp + case $closure in + ?*) echo $closure ;; + esac + ;; + +use) # finalize the environment + + x=:.. + for d in `( cd $PACKAGEROOT; ls src/*/Makefile src/*/Nmakefile 2>/dev/null | sed 's,/[^/]*$,,' | sort -u )` + do x=$x:$INSTALLROOT/$d + done + x=$x:$INSTALLROOT + case $CDPATH: in + $x:*) ;; + *) CDPATH=$x:$CDPATH + $show CDPATH=$CDPATH + $show export CDPATH + export CDPATH + ;; + esac + P=$PACKAGEROOT + $show P=$P + $show export P + export P + A=$INSTALLROOT + $show A=$A + $show export A + export A + case $NPROC in + '') hostinfo cpu + case $_hostinfo_ in + 0|1) ;; + *) NPROC=$_hostinfo_ + $show NPROC=$NPROC + $show export NPROC + export NPROC + ;; + esac + ;; + esac + eval PACKAGE_USE=$package_use + export PACKAGE_USE + + # run the command + + case $run in + '') case $show in + ':') $exec exec $SHELL ;; + esac + ;; + *) $exec exec $SHELL -c "$run" + ;; + esac + ;; + +verify) cd $PACKAGEROOT + requirements binary $package + if executable ! $SUM + then echo "$command: $action: $SUM command required" >&2 + exit 1 + fi + case $target in + '') cd arch + set '' * + shift + target=$* + cd .. + ;; + esac + code=0 + for a in $target + do case $package in + '') set '' arch/$a/lib/package/gen/*.sum + shift + if test -f $1 + then for i + do package_verify $i || code=1 + done + else echo "$command: warning: $a: no binary packages" >&2 + fi + ;; + *) for i in $package + do if test -f arch/$a/lib/package/gen/$i.sum + then package_verify arch/$a/lib/package/gen/$i.sum || code=1 + else echo "$command: warning: $a: no binary package for $i" >&2 + fi + done + ;; + esac + done + exit $code + ;; + +write) set '' $target + shift + action= + list= + qualifier= + while : + do case $1 in + base|closure|delta|exp|lcl|pkg|rpm|tgz) + qualifier="$qualifier $1" + ;; + binary) action=$1 + type=$HOSTTYPE + eval list=$PACKAGESRC/tgz/$admin_list + ;; + cyg) qualifier="$qualifier $1" + assign="$assign closure=1" + only=1 + ;; + runtime|source) + action=$1 + ;; + tst) qualifier="$qualifier tgz" + assign="$assign copyright=0 'PACKAGEDIR=\$(PACKAGESRC)/tst'" + ;; + nocopyright) + assign="$assign copyright=0" + ;; + *) break + ;; + esac + shift + done + case $action in + '') echo "$command: binary or source operand expected" >&2 + exit 1 + ;; + esac + set '' "$@" $package + shift + case $only in + 0) set '' `order "$@"` + shift + ;; + esac + case $# in + 0) echo "$command: at least one package name expected" >&2 + exit 1 + ;; + esac + if nonmake $MAKE + then echo "$command: must have $MAKE to generate archives" >&2 + exit 1 + fi + + # all work under $PACKAGEBIN + + $make cd $PACKAGEBIN + case $list in + ?*) $exec rm -f $list ;; + esac + + # go for it + + for package + do if view - all $package.pkg || view - all lib/package/$package.pkg + then eval capture \$MAKE \$makeflags -X ignore \$noexec -f \$package.pkg \$qualifier \$action $assign + else echo "$command: $package: not a package" >&2 + fi + done + ;; + +TEST) set '' $target $package + shift + case $1 in + binary|source) + action=$1 + shift + ;; + esac + order "$@" + ;; + +*) echo "$command: $action: internal error" >&2 + exit 1 + ;; + +esac diff --git a/src/cmd/INIT/probe.win32 b/src/cmd/INIT/probe.win32 new file mode 100644 index 0000000..7939fcc --- /dev/null +++ b/src/cmd/INIT/probe.win32 @@ -0,0 +1,283 @@ +: +# @(#)probe.win32 (AT&T Research) 2010-01-01 +# +# win32 specific make C probe initialization +# wrapped cc's are easy on uwin +# +# 2> easy.err to avoid mysterious hang with bcc + +# begin preamble shared with the pp probe.ini + +IFS=$'\n' + +chmod 777 . # cl.exe setuid workaround + +typeset -A header version + +# we are probing on behalf of libpp and nmake +# so the native preprocessor must be forced in +# order to bootstrap libpp and nmake + +nativepp=-1 +export nativepp + +probe_header=" +stddef.h +" +for inc in syslimits.h winerror.h ostream bits/ctype_base.h stream.h +do echo "#include <$inc>" > easy.c + if $cc -E easy.c > /dev/null 2> easy.err + then probe_header="$probe_header +$inc +" + fi +done + +{ +for i in $probe_header +do echo "#include <$i>" +done +echo '#ifdef __cplusplus' +echo "int _Pr0b3_cplus=__cplusplus;" +echo '#endif' +echo '#ifdef _UWIN' +echo "int _Pr0b3_uwin=_UWIN;" +echo '#endif' +echo '#ifdef __BORLANDC__' +echo "int _Pr0b3_version_BORLAND=__BORLANDC__;" +echo '#endif' +echo '#ifdef __DMC__' +echo "int _Pr0b3_version_DM=__DMC__;" +echo '#endif' +echo '#ifdef _MSC_VER' +echo "int _Pr0b3_version_MS=_MSC_VER;" +echo '#endif' +echo '#ifdef __ICL' +echo "int _Pr0b3_version_ICL=__ICL;" +echo '#endif' +echo '#ifdef __LCC__' +echo "int _Pr0b3_version_LCC=0+__LCC__;" +echo '#endif' +echo '#ifdef __MINGW32__' +echo "int _Pr0b3_version_MINGW=__MINGW32__;" +echo '#endif' +echo '#ifdef __INTERIX' +echo "int _Pr0b3_version_INTERIX=__INTERIX;" +echo '#endif' +echo '#ifdef __WATCOMC__' +echo "int _Pr0b3_version_WATCOM=__WATCOMC__;" +echo '#endif' +} > easy.c + +include= +uwin= +cplus= + +$cc -E easy.c 2>&1 | +egrep -i '^(#(line)? 1 .*\.[hH]| *int +_Pr0b3_[a-zA-Z_]* *= *[0-9])' | +sed -e 's,_Pr0b3_,,' \ + -e 's/.*"\(.*\)".*/\1/' \ + -e 's,^ *,,' \ + -e 's, *$,,' \ + -e 's, *= *,=,' \ + -e 's,^\(.\):[\\/]*,/\1/,' \ + -e 's,[\\/][\\/]*,/,g' \ + -e 's,^\(/.*\)/\(.*\)$,header[\2]="\1",' \ + -e 's, *int *\(.*\);.*,\1,' \ + -e 's,^version_\(.*\)=,version[\1]=,' \ + > easy.sh +. ./easy.sh + +include= +for i in $probe_header +do d=${header[$i]} + if [[ $d ]] + then include="$include +$d" + elif [[ $i == */* ]] + then d=${header[${i##*/}]} + if [[ $d == */${i%/*} ]] + then include="$include +${d%/${i%/*}}" + fi + fi +done + +i=$($cc -V 2> easy.err) +if test "" != "$i" -a -d "$i/include" +then include="$i/include +$include" +fi + +stdinclude= +for inc in $include +do if [[ ${inc%/*} -ef /msdev/platformsdk ]] + then inc=/msdev/platformsdk/${inc##*/} + elif [[ ${inc%/*} -ef /platformsdk ]] + then inc=/platformsdk/${inc##*/} + fi + for dup in $stdinclude + do [[ $inc -ef $dup ]] && continue 2 + done + stdinclude="$stdinclude +$inc" +done + +# end preamble shared with the pp probe.ini + +if [[ ${version[@]} == [0-9]* && $stdinclude ]] +then : the payoff + set -- $cc + cmd=$1 + shift + set -- $(whence $cmd) "$@" + typ=$(package) + dialect="ANSI CLOSURE DYNAMIC EXPORT=DLL LIBPP -I-" + case ${cc##*/} in + *CC*) dialect="$dialect C++" + cplus=1 + ;; + esac + ld=${cc%cc}ld + if [[ ! -x $ld ]] + then ld=${cc%/*}/ld + if [[ ! -x $ld ]] + then case $cc in + */ncc) ld=/usr/bin/nld ;; + *) ld=/usr/bin/ld ;; + esac + fi + fi + { + if $cc -v >/dev/null 2>&1 + then v=$($cc -v 2>/dev/null) + if [[ $v ]] + then print "# ;VERSION;-v;$v;PATH;$cc" + fi + else v= + fi + cat <&3 + exit 0 +fi diff --git a/src/cmd/INIT/proto.c b/src/cmd/INIT/proto.c new file mode 100644 index 0000000..d030a1d --- /dev/null +++ b/src/cmd/INIT/proto.c @@ -0,0 +1,5283 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1990-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ + +/* : : generated by proto : : */ + +#if !defined(__PROTO__) +# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) +# if defined(__cplusplus) +# define __LINKAGE__ "C" +# else +# define __LINKAGE__ +# endif +# define __STDARG__ +# define __PROTO__(x) x +# define __OTORP__(x) +# define __PARAM__(n,o) n +# if !defined(__STDC__) && !defined(__cplusplus) +# if !defined(c_plusplus) +# define const +# endif +# define signed +# define void int +# define volatile +# define __V_ char +# else +# define __V_ void +# endif +# else +# define __PROTO__(x) () +# define __OTORP__(x) x +# define __PARAM__(n,o) o +# define __LINKAGE__ +# define __V_ char +# define const +# define signed +# define void int +# define volatile +# endif +# define __MANGLE__ __LINKAGE__ +# if defined(__cplusplus) || defined(c_plusplus) +# define __VARARG__ ... +# else +# define __VARARG__ +# endif +# if defined(__STDARG__) +# define __VA_START__(p,a) va_start(p,a) +# else +# define __VA_START__(p,a) va_start(p) +# endif +# if !defined(__INLINE__) +# if defined(__cplusplus) +# define __INLINE__ extern __MANGLE__ inline +# else +# if defined(_WIN32) && !defined(__GNUC__) +# define __INLINE__ __inline +# endif +# endif +# endif +#endif +#if !defined(__LINKAGE__) +#define __LINKAGE__ /* 2004-08-11 transition */ +#endif +#line 1 "proto.c" + + +#line 151 +# ifndef __STDC__ +# ifndef creat +# define creat _huh_creat +# endif +# if 1 +# ifndef access +# define access _huh_access +# endif +# ifndef ctime +# define ctime _huh_ctime +# endif +# ifndef mkdir +# define mkdir _huh_mkdir +# endif +# endif +# endif + +# include +# include +# include +# if 1 +# include +# else +# include +# endif + +# ifndef __STDC__ +# undef access +# undef ctime +# undef creat +# undef mkdir +# endif + +# ifndef O_RDONLY +# define O_RDONLY 0 +# endif + +# ifndef S_IRUSR +# define S_IRUSR 0400 +# endif +# ifndef S_IWUSR +# define S_IWUSR 0200 +# endif +# ifndef S_IXUSR +# define S_IXUSR 0100 +# endif +# ifndef S_IRGRP +# define S_IRGRP 0040 +# endif +# ifndef S_IWGRP +# define S_IWGRP 0020 +# endif +# ifndef S_IXGRP +# define S_IXGRP 0010 +# endif +# ifndef S_IROTH +# define S_IROTH 0004 +# endif +# ifndef S_IWOTH +# define S_IWOTH 0002 +# endif +# ifndef S_IXOTH +# define S_IXOTH 0001 +# endif + +# ifndef __STDC__ +# if !_WIN32 && !_WINIX +# define remove(x) unlink(x) +# define rename(x,y) ((link(x,y)||remove(x))?-1:0) +# endif + +# if 1 +extern __MANGLE__ int access __PROTO__((const char*, int)); +extern __MANGLE__ int mkdir __PROTO__((const char*, int)); +# endif + +# endif + +# if 1 +extern __MANGLE__ int utime __PROTO__((const char*, time_t*)); +# endif + + + + + + +int +replace __PARAM__((const char* newfile, const char* oldfile, int preserve), (newfile, oldfile, preserve)) __OTORP__(const char* newfile; const char* oldfile; int preserve;){ + struct stat st; + time_t ut[2]; + + if (stat(oldfile, &st)) + { + if (preserve) + return -1; + st.st_mode = 0; + } + if (remove(oldfile) || rename(newfile, oldfile)) + return -1; + if (st.st_mode &= (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH)) + chmod(oldfile, st.st_mode); + if (preserve) + { + ut[0] = st.st_atime; + ut[1] = st.st_mtime; + preserve = utime(oldfile, ut); + } + return preserve; +} + +# undef utime +# define utime ______utime + +#line 1 "../../lib/libpp/ppproto.c" + +#line 13 +static const char id[] = "\n@(#)$Id: proto (AT&T Research) 2012-04-14 $\000\n"; + +#line 1 "../../lib/libpp/ppfsm.c" + +#line 1 "../../lib/libpp/pplib.h" + +#line 108 +struct ppsymbol; +struct ppindex; + +typedef char* (*PPBUILTIN) __PROTO__((char*, const char*, const char*)); +typedef void (*PPCOMMENT) __PROTO__((const char*, const char*, const char*, int)); +typedef void (*PPINCREF) __PROTO__((const char*, const char*, int, int)); +typedef void (*PPLINESYNC) __PROTO__((int, const char*)); +typedef void (*PPMACREF) __PROTO__((struct ppsymbol*, const char*, int, int, unsigned long)); +typedef int (*PPOPTARG) __PROTO__((int, int, const char*)); +typedef void (*PPPRAGMA) __PROTO__((const char*, const char*, const char*, const char*, int)); + +struct ppinstk +{ + char* nextchr; + struct ppinstk* next; + struct ppinstk* prev; + long* control; + char* buffer; + char* file; + char* prefix; + struct ppsymbol* symbol; + + struct ppindex* index; + int buflen; + + int line; + int vendor; + short fd; + short hide; + short flags; + char type; +}; + + + + + + + + + +struct pplist +{ + char* value; + struct pplist* next; +}; + +struct oplist +{ + int op; + char* value; + struct oplist* next; +}; + +struct pphide +{ + struct ppmacro* macro; + unsigned long flags; + int level; +}; + +struct ppmacstk +{ + struct ppmacstk* next; + struct ppmacstk* prev; + int line; + char* arg[1]; +}; + +struct ppmember +{ + struct ppdirs* archive; + unsigned long offset; + unsigned long size; +}; + +struct counter +{ + int candidate; + int function; + int macro; + int pplex; + int push; + int terminal; + int token; +}; + +struct pptuple +{ + struct pptuple* nomatch; + struct pptuple* match; + char token[1]; +}; + +struct ppfileid +{ + unsigned long st_dev; + unsigned long st_ino; +}; + +struct pathid +{ + char* path; + struct ppfileid id; +}; + +#line 1 "../../lib/libpp/pp.h" + +#line 206 + +#line 217 + +#line 329 +struct ppdirs +{ + char* name; + struct ppdirs* next; + + + unsigned char c; unsigned char index; unsigned char type; union { char* buffer; char* sp; struct ppdirs* subdir; } info; struct ppfileid id; + + +}; + +struct ppkeyword +{ + char* name; + int value; +}; + +struct ppmacro +{ + int arity; + char* value; + + + struct pptuple* tuple; char* formals; int size; + + +}; + +struct ppsymbol +{ + int hash_header; + unsigned long flags; + struct ppmacro* macro; + __V_* value; + + + struct pphide* hidden; + + +}; + +#line 378 +struct ppglobals +{ + const char* version; + char* lineid; + char* outfile; + char* pass; + char* token; + struct ppsymbol* symbol; + + + + char* outb; + char* outbuf; + char* outp; + char* oute; + unsigned long offset; + + + struct ppdirs* lcldirs; struct ppdirs* stddirs; int flags; char* symtab; + + + + struct ppcontext* context; long state; long mode; long option; long test; struct { char* sp; long flags; } filedeps; struct ppdirs* firstdir; struct ppdirs* lastdir; int hide; int column; int pending; char* firstfile; char* lastfile; char* ignore; char* probe; char* filtab; char* prdtab; char* date; char* time; char* maps; long ro_state; long ro_mode; long ro_option; long ro_op[2]; struct pathid cdir; struct pathid hostdir; char* ppdefault; struct ppindex* firstindex; struct ppindex* lastindex; struct oplist* firstop; struct oplist* lastop; struct oplist* firsttx; struct oplist* lasttx; unsigned char arg_file; unsigned char arg_mode; unsigned char arg_style; unsigned char c; unsigned char hosted; unsigned char ignoresrc; unsigned char initialized; unsigned char standalone; unsigned char spare_1; + + + + char* checkpoint; int constack; struct ppinstk* in; char* addp; char* args; char* addbuf; char* catbuf; char* hdrbuf; char* hidebuf; char* path; char* tmpbuf; char* valbuf; char* optflags; int lastout; char* include; char* prefix; struct ppmember* member; int hidden; int hiding; int level; struct { int input; int output; } pool; struct { long ro_state; long ro_mode; long ro_option; long ro_op[2]; int on; char* symtab; } reset; int truncate; struct ppmacstk* macp; char* maxmac; char* mactop; char* toknxt; long* control; long* maxcon; struct oplist* chop; struct ppfile* insert; struct ppfile* original; struct ppdirs* found; int vendor; char* dirtab; char* strtab; PPBUILTIN builtin; PPCOMMENT comment; PPINCREF incref; PPLINESYNC linesync; PPLINESYNC olinesync; PPMACREF macref; PPOPTARG optarg; PPPRAGMA pragma; struct counter counter; char funbuf[256]; + + +}; + + + + + + + +extern __MANGLE__ struct ppglobals pp; +extern __MANGLE__ char _pp_ctype[]; + +extern __MANGLE__ int ppargs __PROTO__((char**, int)); +extern __MANGLE__ void ppcpp __PROTO__((void)); +extern __MANGLE__ void ppcomment __PROTO__((char*, char*, char*, int)); +extern __MANGLE__ __V_* ppcontext __PROTO__((__V_*, int)); +extern __MANGLE__ void pperror __PROTO__((int, ...)); +extern __MANGLE__ void ppincref __PROTO__((char*, char*, int, int)); +extern __MANGLE__ void ppinput __PROTO__((char*, char*, int)); +extern __MANGLE__ int pplex __PROTO__((void)); +extern __MANGLE__ void ppline __PROTO__((int, char*)); +extern __MANGLE__ void ppmacref __PROTO__((struct ppsymbol*, char*, int, int, unsigned long)); +extern __MANGLE__ void ppop __PROTO__((int, ...)); +extern __MANGLE__ void pppragma __PROTO__((char*, char*, char*, char*, int)); +extern __MANGLE__ int ppprintf __PROTO__((char*, ...)); +extern __MANGLE__ int ppsync __PROTO__((void)); + +#line 368 "../../lib/libpp/pplib.h" + +#line 1 "../../lib/libpp/ppdef.h" + +#line 369 "../../lib/libpp/pplib.h" + +#line 1 "../../lib/libpp/ppkey.h" + +#line 16 + +#line 125 +extern __MANGLE__ struct ppkeyword ppkey[]; + +#line 370 "../../lib/libpp/pplib.h" + +#line 683 +struct ppcontext +{ + struct ppdirs* lcldirs; struct ppdirs* stddirs; int flags; char* symtab; + struct ppcontext* context; long state; long mode; long option; long test; struct { char* sp; long flags; } filedeps; struct ppdirs* firstdir; struct ppdirs* lastdir; int hide; int column; int pending; char* firstfile; char* lastfile; char* ignore; char* probe; char* filtab; char* prdtab; char* date; char* time; char* maps; long ro_state; long ro_mode; long ro_option; long ro_op[2]; struct pathid cdir; struct pathid hostdir; char* ppdefault; struct ppindex* firstindex; struct ppindex* lastindex; struct oplist* firstop; struct oplist* lastop; struct oplist* firsttx; struct oplist* lasttx; unsigned char arg_file; unsigned char arg_mode; unsigned char arg_style; unsigned char c; unsigned char hosted; unsigned char ignoresrc; unsigned char initialized; unsigned char standalone; unsigned char spare_1; +}; + +struct ppfile +{ + int hash_header; + struct ppsymbol* guard; + struct ppfile* bound[4]; + int flags; +}; + + + +struct ppindex +{ + struct ppindex* next; + struct ppfile* file; + unsigned long begin; + unsigned long end; +}; + + + +struct ppsymkey +{ + struct ppsymbol sym; + int lex; +}; + +#line 729 +# ifdef __STDC__ + +# include +# include +# include +# include + +# else + +# define size_t int + +extern __MANGLE__ __V_* realloc __PROTO__((__V_*, size_t)); +extern __MANGLE__ __V_* calloc __PROTO__((size_t, size_t)); +extern __MANGLE__ char* ctime __PROTO__((time_t*)); +extern __MANGLE__ void free __PROTO__((__V_*)); + +# ifndef O_RDONLY + +extern __MANGLE__ int access __PROTO__((const char*, int)); +extern __MANGLE__ int close __PROTO__((int)); +extern __MANGLE__ int creat __PROTO__((const char*, int)); +extern __MANGLE__ void exit __PROTO__((int)); +extern __MANGLE__ int link __PROTO__((const char*, const char*)); +extern __MANGLE__ int open __PROTO__((const char*, int, ...)); +extern __MANGLE__ int read __PROTO__((int, __V_*, int)); +extern __MANGLE__ time_t time __PROTO__((time_t*)); +extern __MANGLE__ int unlink __PROTO__((const char*)); +extern __MANGLE__ int write __PROTO__((int, const __V_*, int)); + +# endif + +# endif + +#line 802 +extern __MANGLE__ void ppassert __PROTO__((int, char*, char*)); +extern __MANGLE__ void ppbuiltin __PROTO__((void)); +extern __MANGLE__ int ppcall __PROTO__((struct ppsymbol*, int)); +extern __MANGLE__ int ppcontrol __PROTO__((void)); +extern __MANGLE__ void ppdump __PROTO__((void)); +extern __MANGLE__ char* ppexpand __PROTO__((char*)); +extern __MANGLE__ long ppexpr __PROTO__((int*)); +extern __MANGLE__ void ppfsm __PROTO__((int, char*)); +extern __MANGLE__ char* ppinstr __PROTO__((struct ppinstk*)); +extern __MANGLE__ char* ppkeyname __PROTO__((int, int)); +extern __MANGLE__ char* pplexstr __PROTO__((int)); +extern __MANGLE__ void ppload __PROTO__((char*)); +extern __MANGLE__ void ppmapinclude __PROTO__((char*, char*)); +extern __MANGLE__ char* ppmodestr __PROTO__((long)); +extern __MANGLE__ int ppmultiple __PROTO__((struct ppfile*, struct ppsymbol*)); +extern __MANGLE__ void ppnest __PROTO__((void)); +extern __MANGLE__ int ppoption __PROTO__((char*)); +extern __MANGLE__ char* ppoptionstr __PROTO__((long)); +extern __MANGLE__ void pppclose __PROTO__((char*)); +extern __MANGLE__ int pppdrop __PROTO__((char*)); +extern __MANGLE__ char* pppopen __PROTO__((char*, int, char*, char*, char*, char*, int)); +extern __MANGLE__ int pppread __PROTO__((char*)); +extern __MANGLE__ int pppredargs __PROTO__((void)); +extern __MANGLE__ void pppush __PROTO__((int, char*, char*, int)); +extern __MANGLE__ struct ppsymbol* pprefmac __PROTO__((char*, int)); +extern __MANGLE__ int ppsearch __PROTO__((char*, int, int)); +extern __MANGLE__ int ppset __PROTO__((long*, long, int)); +extern __MANGLE__ char* ppstatestr __PROTO__((long)); +extern __MANGLE__ char* pptokstr __PROTO__((char*, int)); +extern __MANGLE__ void pptrace __PROTO__((int)); + +#line 11 "../../lib/libpp/ppfsm.c" + +#line 1 "../../lib/libpp/ppfsm.h" + +#line 185 + +#line 249 +extern __MANGLE__ short _pp_fsmtab[(0+28)+1][255+1]; + + + + + +extern __MANGLE__ char _pp_trigraph[255+1]; + +extern __MANGLE__ void _pp_refill __PROTO__((int)); + +#line 12 "../../lib/libpp/ppfsm.c" + + +#line 67 +struct fsminit +{ + int state; + unsigned char ch[4]; + int nextstate; +}; + +static struct fsminit fsminit[] = +{ + + { 0, { 023 }, ((0+28)+11), }, + { 0, { 002 }, (0), }, + { 0, { 001 }, (0+23), }, + { 0, { '.' }, (0+25), }, + { 0, { 021 }, (0+19), }, + { 0, { 'L' }, (0+20), }, + { 0, { 'd', 'e', 'f', 'i' }, (0+1), }, + { 0, { 'r', 's', 't', 'v' }, (0+1), }, + { 0, { 'w', 'N' }, (0+1), }, + { 0, { '"', '\'' }, ((0+28)+3), }, + { 0, { '/' }, (0+12), }, + { 0, { '\n' }, ((0+28)+7), }, + { 0, { ' ','\t','\f','\013' }, (0+27), }, + + + { (0+1), { 023 }, ((0+28)+6), }, + { (0+1), { 021, 001 }, (0+19), }, + { (0+1), { 'a' }, (0+2), }, + { (0+1), { 'e' }, (0+3), }, + { (0+1), { 'f' }, (0+4), }, + { (0+1), { 'h' }, (0+5), }, + { (0+1), { 'l' }, (0+6), }, + { (0+1), { 'n' }, (0+7), }, + { (0+1), { 'o' }, (0+8), }, + { (0+1), { 't' }, (0+9), }, + { (0+1), { 'x' }, (0+10), }, + { (0+1), { 'y' }, (0+11), }, + + + { (0+2), { 023 }, (((0+28)+12)), }, + { (0+2), { 021, 001 }, (0+19), }, + { (0+2), { '_','s','t','a' }, (0+2), }, + { (0+2), { 'r' }, (0+2), }, + + + { (0+3), { 023 }, (((0+28)+12)), }, + { (0+3), { 021, 001 }, (0+19), }, + { (0+3), { 't','u','r','n' }, (0+3), }, + + + { (0+4), { 023 }, (((0+28)+12)), }, + { (0+4), { 021, 001 }, (0+19), }, + + + { (0+5), { 023 }, (((0+28)+12)), }, + { (0+5), { 021, 001 }, (0+19), }, + { (0+5), { 'i','l','e' }, (0+5), }, + + + { (0+6), { 023 }, (((0+28)+12)), }, + { (0+6), { 021, 001 }, (0+19), }, + { (0+6), { 's','e' }, (0+6), }, + + + { (0+7), { 023 }, (((0+28)+12)), }, + { (0+7), { 021, 001 }, (0+19), }, + { (0+7), { 'l','i','n','e' }, (0+7), }, + + + { (0+8), { 023 }, (((0+28)+12)), }, + { (0+8), { 021, 001 }, (0+19), }, + { (0+8), { 'r','i','d','N' }, (0+8), }, + + + { (0+9), { 023 }, (((0+28)+12)), }, + { (0+9), { 021, 001 }, (0+19), }, + { (0+9), { 'a','t','i','c' }, (0+9), }, + + + { (0+10), { 023 }, (((0+28)+12)), }, + { (0+10), { 021, 001 }, (0+19), }, + { (0+10), { 't','e','r','n' }, (0+10), }, + + + { (0+11), { 023 }, (((0+28)+12)), }, + { (0+11), { 021, 001 }, (0+19), }, + { (0+11), { 'p','e','d','f' }, (0+11), }, + + + { (0+12), { 023 }, ((0+28)+0), }, + { (0+12), { '*' }, (0+13), }, + + { (0+12), { '/' }, (0+16), }, + + + + { (0+13), { 023 }, (0+13), }, + { (0+13), { '\n', 002 }, ((0+28)+1), }, + { (0+13), { '/' }, (0+15), }, + { (0+13), { '*' }, (0+14), }, + { (0+13), { '#', ';', ')' }, ((( (0+13))<<(7+1))|(((0+28)+8))), }, + + + { (0+14), { 023 }, (0+13), }, + { (0+14), { '\n', 002 }, ((0+28)+1), }, + { (0+14), { '#', ';', ')' }, ((( (0+13))<<(7+1))|(((0+28)+8))), }, + { (0+14), { '*' }, (0+14), }, + { (0+14), { '/' }, ((0+28)+1), }, + + + { (0+15), { 023 }, (0+13), }, + { (0+15), { '*', '\n', 002 }, ((0+28)+1), }, + { (0+15), { '/' }, (0+15), }, + + + { (0+16), { 023 }, (0+16), }, + { (0+16), { '\n', 002 }, ((0+28)+1), }, + { (0+16), { '/' }, (0+17), }, + { (0+16), { '*' }, (0+18), }, + + + { (0+17), { 023 }, (0+16), }, + { (0+17), { '*', '\n', 002 }, ((0+28)+1), }, + { (0+17), { '/' }, (0+17), }, + + + { (0+18), { 023 }, (0+16), }, + { (0+18), { '\n', 002 }, ((0+28)+1), }, + { (0+18), { '*' }, (0+18), }, + { (0+18), { '/' }, ((0+28)+1), }, + + + { (0+19), { 023 }, ((0+28)+6), }, + { (0+19), { 021, 001 }, (0+19), }, + + + { (0+25), { 023 }, ((0+28)+0), }, + { (0+25), { '.' }, (0+26), }, + { (0+25), { 001 }, (0+23), }, + + + { (0+26), { 023 }, (((( (0401+1))-0401)<<(7+1))|( ((0+28)+14))), }, + { (0+26), { '.' }, (((( (0401+29))-0401)<<(7+1))|( ((0+28)+13))), }, + + + { (0+20), { 023 }, ((0+28)+6), }, + { (0+20), { 021, 001 }, (0+19), }, + { (0+20), { '"', '\'' }, ((( (0+21))<<(7+1))|(((0+28)+8))), }, + + + { (0+21), { 023 }, (0+21), }, + { (0+21), { '"', '\'' }, ((0+28)+4), }, + { (0+21), { '\n', 002 }, ((0+28)+4), }, + { (0+21), { '\\' }, (0+22), }, + + + { (0+22), { 023 }, ((0+28)+5), }, + { (0+22), { '\n', 002 }, ((0+28)+4), }, + + + { (0+23), { 023 }, (((( (0401+1))-0401)<<(7+1))|( ((0+28)+14))), }, + { (0+23), { 021, 001, '.' }, (0+23), }, + { (0+23), { 'e', 'E' }, (0+24), }, + + + { (0+24), { 023 }, (((( (0401+1))-0401)<<(7+1))|( ((0+28)+14))), }, + { (0+24), { 021, 001, '.' }, (0+23), }, + { (0+24), { '+', '-' }, (0+23), }, + + + { (0+27), { 023 }, ((0+28)+15), }, + { (0+27), { ' ', '\t' }, (0+27), }, + { (0+27), { '\f', '\013' }, ((0+28)+10), }, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#line 528 + { (-1), { 0 }, 0, } +}; + +short _pp_fsmtab[(0+28)+1][255+1]; + +char _pp_trigraph[255+1]; + + +static char spl[] = { '\\', '\r', 0 }; +static char aln[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$@"; + + + + +static char* let = &aln[10]; +static char hex[] = "fedcbaFEDCBA9876543210"; +static char* dec = &hex[12]; +static char* oct = &hex[14]; + + + + + + +void +ppfsm __PARAM__((int op, register char* s), (op, s)) __OTORP__(int op; register char* s;){ + register int c; + register int n; + register int i; + register short* rp; + register struct fsminit* fp; + + + + + + switch (op) + { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + case 4: + for (fp = fsminit;; fp++) + { + if ((n = fp->nextstate) >= (0+28)) n = ~n; + if (fp->state == (-1)) + { + + + + + + + + + + + + + + break; + } + rp = _pp_fsmtab[fp->state]; + for (i = 0; i < sizeof(fp->ch) && (c = fp->ch[i]); i++) + { + switch (c) + { + case 023: + for (c = 0; c <= 255; c++) + rp[c] = n; + + + case 002: + _pp_fsmtab[(0+28)][fp->state+1] = n < 0 ? ~n : n; + continue; + + case 021: + s = let; + break; + + case 003: + s = hex; + break; + + case 001: + s = dec; + break; + + case 022: + s = oct; + break; + + default: + rp[c] = n; + continue; + } + while (c = *s++) + rp[c] = n; + } + } + + + + + + + for (i = 0; i < (0+28); i++) + { + rp = _pp_fsmtab[i]; + s = spl; + while (c = *s++) + if (c != '@' || !(( rp)>=_pp_fsmtab[(0+13)]&&( rp)<=_pp_fsmtab[(0+18)])) + { + if (rp[c] >= 0) rp[c] = ~rp[c]; + rp[c] &= ~(1<<7); + } + rp[0] = ~((0+28)+2); + for (c = 0; c <= 255; c++) + if (rp[c] == i) + rp[c] = 0; + } + _pp_fsmtab[(0+28)][0] = ~((0+28)+2); + + + + + + + + + + + + + + + + + + +#line 707 + break; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#line 860 + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#line 18 "../../lib/libpp/ppproto.c" + +#line 1 "../../../include/ast/hashkey.h" + +#line 24 + + +#line 68 +extern __MANGLE__ long strkey __PROTO__((const char*)); + +#line 20 "../../lib/libpp/ppproto.c" + +#line 41 +typedef struct Key_s +{ + const char* name; + size_t size; + int hit; + int val; +} Key_t; + +typedef struct Proto_s +{ + int brace; + int call; + int fd; + char* file; + long flags; + long options; + char* package; + int line; + int test; + + char* tp; + + int iz; + char* ib; + char* ip; + + int oz; + char* ob; + char* op; + char* ox; + + char cc[3]; + char pushback[4]; + + char variadic[256]; + + + + +} Proto_t; + + +#line 171 +static const Key_t pragmas[] = +{ + { "prototyped",sizeof( "prototyped")-1, 0x01, 1}, + { "noprototyped",sizeof( "noprototyped")-1, 0x01, 0}, + { "noticed",sizeof( "noticed")-1, 0x02, 1}, + { "nonoticed",sizeof( "nonoticed")-1, 0x02, 0}, +}; + +static const Key_t notices[] = +{ + { "Copyright",sizeof( "Copyright")-1, 0x02, 1}, + { "COPYRIGHT",sizeof( "COPYRIGHT")-1, 0x02, 1}, + { "copyright",sizeof( "copyright")-1, 0x02, 1}, + { "Public Domain",sizeof( "Public Domain")-1, 0x02, 0}, + { "PUBLIC DOMAIN",sizeof( "PUBLIC DOMAIN")-1, 0x02, 0}, +}; + + + + + + +static char* +number __PARAM__((register char* p, register long n), (p, n)) __OTORP__(register char* p; register long n;){ + register long d; + + for (d = 1000000; d > 1; d /= 10) + if (n >= d) *p++ = '0' + (n / d) % 10; + *p++ = '0' + n % 10; + return p; +} + + + +static int errors; + + +#line 224 + + + + +static int +sstrlen __PARAM__((register const char* s), (s)) __OTORP__(register const char* s;){ + register const char* b; + + for (b = s; *s; s++); + return s - b; +} + + + + + +static int +sstrncmp __PARAM__((register const char* s, register const char* t, register int n), (s, t, n)) __OTORP__(register const char* s; register const char* t; register int n;){ + register const char* e = s + n; + + while (s < e) + { + if (*s != *t || !*s) + return *s - *t; + s++; + t++; + } + return 0; +} + + + + + +static char* +strcopy __PARAM__((register char* s, register const char* t), (s, t)) __OTORP__(register char* s; register const char* t;){ + while (*s++ = *t++); + return s - 1; +} + + + +static void +proto_error __PARAM__((char* iob, int level, char* msg, char* arg), (iob, level, msg, arg)) __OTORP__(char* iob; int level; char* msg; char* arg;){ + register char* p; + char buf[1024]; + + p = strcopy(buf, "proto: "); + if (iob) + { + register Proto_t* proto = (Proto_t*)(iob - sizeof(Proto_t)); + + if (proto->line) + { + if (proto->file) + { + *p++ = '"'; + p = strcopy(p, proto->file); + *p++ = '"'; + *p++ = ','; + *p++ = ' '; + } + p = strcopy(p, "line "); + p = number(p, proto->line); + } + else if (proto->file) + p = strcopy(p, proto->file); + } + else + { + p = strcopy(p, msg); + msg = arg; + arg = 0; + } + if (*(p - 1) != ' ') + { + *p++ = ':'; + *p++ = ' '; + } + if (level == 1) + p = strcopy(p, "warning: "); + p = strcopy(p, msg); + if (arg) + { + *p++ = ' '; + p = strcopy(p, arg); + } + *p++ = '\n'; + write(2, buf, p - buf); + if (level >= 3) + exit(level - 2); + if (level >= 2) + errors++; +} + + + + + +static char* +memcopy __PARAM__((register char* s, register char* t, int n), (s, t, n)) __OTORP__(register char* s; register char* t; int n;){ + register char* e = t + n; + + while (t < e) *s++ = *t++; + return s; +} + +#line 1 "../../lib/libast/port/astlicense.c" + + + +#line 84 +typedef struct Buffer_s +{ + char* buf; + char* nxt; + char* end; + int siz; +} Buffer_t; + +typedef struct Item_s +{ + char* data; + int size; + int quote; +} Item_t; + +typedef struct Id_s +{ + Item_t name; + Item_t value; +} Id_t; + + + + + + + +static const Item_t key[] = +{ + { "author",sizeof( "author")-1,0}, + { "class",sizeof( "class")-1,0}, + { "company",sizeof( "company")-1,0}, + { "component",sizeof( "component")-1,0}, + { "contributor",sizeof( "contributor")-1,0}, + { "corporation",sizeof( "corporation")-1,0}, + { "domain",sizeof( "domain")-1,0}, + { "id",sizeof( "id")-1,0}, + { "incorporation",sizeof( "incorporation")-1,0}, + { "license",sizeof( "license")-1,0}, + { "location",sizeof( "location")-1,0}, + { "name",sizeof( "name")-1,0}, + { "notice",sizeof( "notice")-1,0}, + { "organization",sizeof( "organization")-1,0}, + { "package",sizeof( "package")-1,0}, + { "parent",sizeof( "parent")-1,0}, + { "query",sizeof( "query")-1,0}, + { "since",sizeof( "since")-1,0}, + { "source",sizeof( "source")-1,0}, + { "start",sizeof( "start")-1,0}, + { "type",sizeof( "type")-1,0}, + { "url",sizeof( "url")-1,0}, + { "urlmd5",sizeof( "urlmd5")-1,0}, + { "version",sizeof( "version")-1,0}, + {0} +}; + + + + + +static const Item_t lic[] = +{ + { "none",sizeof( "none")-1, 0}, + { "inline",sizeof( "inline")-1, 12}, + { "test",sizeof( "test")-1, 2}, + { "verbose",sizeof( "verbose")-1, 3}, + { "usage",sizeof( "usage")-1, 4}, + { "open",sizeof( "open")-1, 5}, + { "cpl",sizeof( "cpl")-1, 5}, + { "epl",sizeof( "epl")-1, 5}, + { "bsd",sizeof( "bsd")-1, 5}, + { "zlib",sizeof( "zlib")-1, 5}, + { "mit",sizeof( "mit")-1, 5}, + { "gpl",sizeof( "gpl")-1, 11}, + { "special",sizeof( "special")-1, 12}, + { "nonexclusive",sizeof( "nonexclusive")-1, 12}, + { "noncommercial",sizeof( "noncommercial")-1, 12}, + { "proprietary",sizeof( "proprietary")-1, 15}, + {0} +}; + +typedef struct Notice_s +{ + int test; + int type; + int verbose; + int ids; + Item_t item[(sizeof(key)/sizeof(key[0])-1)]; + Id_t id[64]; + char cc[3]; +} Notice_t; + + + + + +static int +lookup __PARAM__((register const Item_t* item, const char* name, int size), (item, name, size)) __OTORP__(register const Item_t* item; const char* name; int size;){ + register int c; + register int i; + + c = name[0]; + for (i = 0; item[i].data; i++) + if (c == item[i].data[0] && size == item[i].size && !sstrncmp( name, item[i].data, size)) + return i; + return -1; +} + + + + + + +static void +copy __PARAM__((register Buffer_t* b, register char* s, int n), (b, s, n)) __OTORP__(register Buffer_t* b; register char* s; int n;){ + if (n < 0) + n = sstrlen( s); + while (n--) + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( *s++)):(( *s++),(-1))); +} + + +#line 217 +static void +comment __PARAM__((Notice_t* notice, register Buffer_t* b, register char* s, register int n, int u), (notice, b, s, n, u)) __OTORP__(Notice_t* notice; register Buffer_t* b; register char* s; register int n; int u;){ + register int i; + register int m; + register int x; + int cc; + + cc = notice->cc[1]; + if (!s) + { + if (n) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( notice->cc[n > 0 ? 0 : 1])):(( notice->cc[n > 0 ? 0 : 1]),(-1))); + for (i = 0; i < 70; i++) + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( cc)):(( cc),(-1))); + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( notice->cc[n > 0 ? 1 : 2])):(( notice->cc[n > 0 ? 1 : 2]),(-1))); + } + else + s = ""; + } + if (s) + { + if (n > 70) + n = 70; + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( cc)):(( cc),(-1))); + m = (u < 0) ? 1 : (70 - n) / 2; + if ((x = 70 - m - n) < 0) + n--; + while (m-- > 0) + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + while (n-- > 0) + { + i = *s++; + if (u > 0 && i >= 'a' && i <= 'z') + i = i - 'a' + 'A'; + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( i)):(( i),(-1))); + } + while (x-- > 0) + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( cc)):(( cc),(-1))); + } + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( '\n')):(( '\n'),(-1))); +} + + + + + +static void +expand __PARAM__((Notice_t* notice, register Buffer_t* b, const Item_t* item), (notice, b, item)) __OTORP__(Notice_t* notice; register Buffer_t* b; const Item_t* item;){ + register char* t; + register char* e; + register int q; + register char* x; + register char* z; + register int c; + int m; + int i; + int k; + + if (t = item->data) + { + q = item->quote; + e = t + item->size; + i = 0; + while (t < e) + { + if (*t == '$' && t < (e + 2) && *(t + 1) == '{') + { + k = m = 0; + x = t += 2; + while (t < e && (c = *t++) != '}') + if (c == '.') + x = t; + else if (c == '-') + { + k = 1; + break; + } + else if (c == '/') + { + m = 1; + break; + } + if ((c = lookup(key, x, t - x - 1)) >= 0 && (x = notice->item[c].data)) + { + z = x + notice->item[c].size; + while (x < z) + { + c = *x++; + if (!m || c >= '0' && c <= '9') + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( c)):(( c),(-1))); + } + } + else if (k) + { + k = 0; + i++; + } + if (k || m) + { + k = 1; + while (t < e) + if ((c = *t++) == '{') + k++; + else if (c == '}' && !--k) + break; + } + } + else if (q > 0 && *t == '\\' && (*(t + 1) == q || *(t + 1) == '\\')) + t++; + else if (*t == '}' && i) + { + t++; + i--; + } + else + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( *t++)):(( *t++),(-1))); + } + } +} + + + + + +static void +copyright __PARAM__((Notice_t* notice, register Buffer_t* b), (notice, b)) __OTORP__(Notice_t* notice; register Buffer_t* b;){ + register char* x; + register char* t; + time_t clock; + + copy(b, "Copyright (c) ", -1); + if (notice->test) + clock = (time_t)1000212300; + else if (!(t = notice->item[18].data)) + { + time(&clock); + t = ctime(&clock) + 20; + } + if ((x = notice->item[19].data) && sstrncmp( t, x, 4) < 0) + t = x; + if ((x = notice->item[17].data) && sstrncmp( x, t, 4) < 0) + { + expand(notice, b, ¬ice->item[17]); + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( '-')):(( '-'),(-1))); + } + copy(b, t, 4); + if (notice->item[15].data) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + expand(notice, b, ¬ice->item[15]); + } + if (notice->item[5].data) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + expand(notice, b, ¬ice->item[5]); + if (notice->item[8].data) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + expand(notice, b, ¬ice->item[8]); + } + } + else if (notice->item[2].data) + { + ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); + expand(notice, b, ¬ice->item[2]); + } +} + +typedef struct Stack_s +{ + char* info; + char* file; + int line; + int size; +} Stack_t; + +static int +push __PARAM__((Stack_t* sp, char* file, char* parent, char* info, int size, Buffer_t* buf), (sp, file, parent, info, size, buf)) __OTORP__(Stack_t* sp; char* file; char* parent; char* info; int size; Buffer_t* buf;){ + char* s; + char* t; + int i; + int n; + char path[1024]; + + if (size <= 8) + { + copy(buf, file, -1); + copy(buf, ": no space", -1); + ((( buf)->nxt<( buf)->end)?(*( buf)->nxt++=( 0)):(( 0),(-1))); + return -1; + } + if (*file != '/' && parent && (s = strrchr(parent, '/'))) + { + n = s - parent + 1; + if ((sstrlen( file) + n + 1) <= sizeof(path)) + { + memcopy( path, parent, n); + strcopy( path + n, file); + file = path; + } + } + if ((i = open(file, O_RDONLY)) < 0) + { + + if (file == path) + for (s = path; *s; s++) + if (s[0] == '/' && s[1] == 'a' && s[2] == 'r' && s[3] == 'c' && s[4] == 'h' && s[5] == '/') + { + t = s; + for (s += 6; *s && *s != '/'; s++); + while (*t++ = *s++); + i = open(file, O_RDONLY); + } + if (i < 0) + { + copy(buf, file, -1); + copy(buf, ": cannot open", -1); + ((( buf)->nxt<( buf)->end)?(*( buf)->nxt++=( 0)):(( 0),(-1))); + return -1; + } + } + n = read(i, info, size - 1); + close(i); + if (n < 0) + { + copy(buf, file, -1); + copy(buf, ": cannot read", -1); + ((( buf)->nxt<( buf)->end)?(*( buf)->nxt++=( 0)):(( 0),(-1))); + return -1; + } + info[n++] = 0; + sp->file = file; + sp->info = info; + sp->line = 0; + sp->size = n; + return 0; +} + + + + + + + +int +astlicense __PARAM__((char* p, int size, char* file, char* options, int cc1, int cc2, int cc3), (p, size, file, options, cc1, cc2, cc3)) __OTORP__(char* p; int size; char* file; char* options; int cc1; int cc2; int cc3;){ + register char* s; + register char* v; + register char* x; + register int c; + int i; + int h; + int k; + int n; + int q; + int contributor; + int first; + int level; + int quote; + char* data; + char tmpbuf[(70+4)]; + char info[8 * 1024]; + Stack_t input[4]; + Notice_t notice; + Item_t item; + Buffer_t buf; + Buffer_t tmp; + + buf.end = (buf.buf = buf.nxt = p) + size; + tmp.end = (tmp.buf = tmp.nxt = tmpbuf) + sizeof(tmpbuf); + level = 0; + data = info; + level = -1; + if (options) + { + level++; + input[level].file = ""; + input[level].info = options; + input[level].line = 0; + } + if (file && *file) + { + if (push(&input[++level], file, 0, data, &info[sizeof(info)] - data, &buf)) + return -1; + data += input[level].size; + } + if (level < 0) + return 0; + s = input[level].info; + notice.test = 0; + notice.type = 0; + notice.verbose = 0; + notice.ids = 0; + notice.cc[0] = cc1; + notice.cc[1] = cc2; + notice.cc[2] = cc3; + for (i = 0; i < (sizeof(key)/sizeof(key[0])-1); i++) + notice.item[i].data = 0; + notice.item[20] = notice.item[1] = lic[notice.type]; + notice.item[20].quote = notice.item[1].quote = 0; + contributor = i = k = 0; + for (;;) + { + first = 1; + while (c = *s) + { + while (c == ' ' || c == '\t' || c == '\n' && ++input[level].line || c == '\r' || c == ',' || c == ';' || c == ')') + c = *++s; + if (!c) + break; + if (c == '#') + { + while (*++s && *s != '\n'); + if (*s) + s++; + input[level].line++; + continue; + } + if (c == '.') + { + while ((c = *++s) && (c == ' ' || c == '\t')); + file = s; + while (c && c != ' ' && c != '\t' && c != '\r' && c != '\n') + c = *++s; + *s = 0; + while (c && c != '\n') + c = *++s; + if (*file) + { + input[level].info = s + (c != 0); + if (++level >= (sizeof(input) / sizeof(input[0])) || push(&input[level], file, input[level-1].file, data, &info[sizeof(info)] - data, &buf)) + return -1; + data += input[level].size; + s = input[level].info; + } + continue; + } + if (c == '\n') + { + s++; + input[level].line++; + continue; + } + if (c == '[') + c = *++s; + x = s; + n = 0; + while (c && c != '+' && c != '=' && c != ']' && c != ')' && c != ',' && c != ' ' && c != '\t' && c != '\n' && c != '\r') + c = *++s; + n = s - x; + h = lookup(key, x, n); + if (c == '+' || c == ']') + c = *++s; + quote = 0; + if (c == '=' || first) + { + if (c == '=') + { + q = ((c = *++s) == '"' || c == '\'') ? *s++ : 0; + if (c == '(') + { + s++; + if (h == 9) + contributor = 0; + else if (h == 4) + contributor = 1; + else + { + q = 1; + i = 0; + for (;;) + { + switch (*s++) + { + case 0: + s--; + break; + case '(': + if (!i) + q++; + continue; + case ')': + if (!i && !--q) + break; + continue; + case '"': + case '\'': + if (!i) + i = *(s - 1); + else if (i == *(s - 1)) + i = 0; + continue; + case '\\': + if (*s == i && i == '"') + i++; + continue; + case '\n': + input[level].line++; + continue; + default: + continue; + } + break; + } + } + continue; + } + v = s; + while ((c = *s) && (q == '"' && (c == '\\' && (*(s + 1) == '"' || *(s + 1) == '\\') && s++ && (quote = q)) || q && c != q || !q && c != ' ' && c != '\t' && c != '\n' && c != '\r' && c != ',' && c != ';')) + { + if (c == '\n') + input[level].line++; + s++; + } + } + else + { + h = 20; + v = x; + } + if (c == '\n') + input[level].line++; + if (contributor) + { + for (i = 0; i < notice.ids; i++) + if (n == notice.id[i].name.size && !sstrncmp( x, notice.id[i].name.data, n)) + break; + if (i < 64) + { + notice.id[i].name.data = x; + notice.id[i].name.size = n; + notice.id[i].name.quote = 0; + notice.id[i].value.data = v; + notice.id[i].value.size = s - v; + notice.id[i].value.quote = quote; + if (notice.ids <= i) + notice.ids = i + 1; + } + } + else if (h == 16) + { + if ((s - v) == 3 && v[0] == 'a' && v[1] == 'l' && v[2] == 'l') + { + for (i = 0; i < (sizeof(key)/sizeof(key[0])-1); i++) + if (notice.item[i].size) + { + expand(¬ice, &buf, &key[i]); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '=')):(( '='),(-1))); + for (h = 0;; h++) + if (h >= notice.item[i].size) + { + h = 0; + break; + } + else if (notice.item[i].data[h] == ' ' || notice.item[i].data[h] == '\t') + break; + if (h) + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\'')):(( '\''),(-1))); + expand(¬ice, &buf, ¬ice.item[i]); + if (h) + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\'')):(( '\''),(-1))); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\n')):(( '\n'),(-1))); + } + } + else + { + if ((h = lookup(key, v, s - v)) < 0) + { + item.data = v; + item.size = s - v; + item.quote = 0; + expand(¬ice, &buf, &item); + } + else + expand(¬ice, &buf, ¬ice.item[h]); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\n')):(( '\n'),(-1))); + } + return (*(( &buf)->nxt>=( &buf)->end?(( &buf)->nxt=( &buf)->end-1):( &buf)->nxt)=0,( &buf)->nxt-( &buf)->buf); + } + else + { + if (h == 20) + switch (c = lookup(lic, v, s - v)) + { + case 0: + return 0; + case 2: + notice.test = 1; + h = -1; + break; + case 3: + notice.verbose = 1; + h = -1; + break; + case 4: + notice.type = c; + h = -1; + break; + case -1: + c = 12; + + default: + notice.type = c; + notice.item[1].data = lic[lic[c].quote].data; + notice.item[1].size = lic[lic[c].quote].size; + if (notice.item[20].data != lic[0].data) + h = -1; + break; + } + if (h >= 0) + { + notice.item[h].data = (notice.item[h].size = s - v) ? v : (char*)0; + notice.item[h].quote = quote; + k = 1; + } + } + } + else + { + if (input[level].file) + { + copy(&buf, "\"", -1); + copy(&buf, input[level].file, -1); + copy(&buf, "\", line ", -1); + x = &tmpbuf[sizeof(tmpbuf)]; + *--x = 0; + n = ++input[level].line; + do *--x = ("0123456789")[n % 10]; while (n /= 10); + copy(&buf, x, -1); + copy(&buf, ": ", -1); + } + copy(&buf, "option error: assignment expected", -1); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( 0)):(( 0),(-1))); + return -1; + } + if (*s) + s++; + first = 0; + } + if (!level--) + break; + s = input[level].info; + } + if (!k) + return 0; + if (notice.type == 1 && (!notice.verbose || !notice.item[12].data)) + return 0; + if (notice.type != 4) + { + if (!notice.type) + notice.type = 12; + comment(¬ice, &buf, ((char*)0), 1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + if (notice.item[14].data) + { + copy(&tmp, "This software is part of the ", -1); + expand(¬ice, &tmp, ¬ice.item[14]); + copy(&tmp, " package", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + if (notice.type >= 5) + { + copyright(¬ice, &tmp); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.type >= 12) + comment( ¬ice, &buf, "All Rights Reserved",sizeof( "All Rights Reserved")-1, 0); + } + if (notice.type == 6 || notice.type == 7) + { + copy(&tmp, notice.item[14].data ? "and": "This software", -1); + copy(&tmp, " is licensed under the", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.type == 7) + copy(&tmp, "Eclipse Public License", -1); + else + copy(&tmp, "Common Public License", -1); + if (notice.item[23].data) + { + copy(&tmp, ", Version ", -1); + expand(¬ice, &tmp, ¬ice.item[23]); + } + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[5].data || notice.item[2].data) + { + copy(&tmp, "by ", -1); + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[15]); + copy(&tmp, " ", -1); + } + if (notice.item[5].data) + { + expand(¬ice, &tmp, ¬ice.item[5]); + if (notice.item[8].data) + { + copy(&tmp, " ", -1); + expand(¬ice, &tmp, ¬ice.item[8]); + } + } + else if (notice.item[2].data) + expand(¬ice, &tmp, ¬ice.item[2]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "A copy of the License is available at",sizeof( "A copy of the License is available at")-1, 0); + if (notice.item[21].data) + { + expand(¬ice, &tmp, ¬ice.item[21]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[22].data) + { + copy(&tmp, "(with md5 checksum ", -1); + expand(¬ice, &tmp, ¬ice.item[22]); + copy(&tmp, ")", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + } + else if (notice.type == 7) + comment( ¬ice, &buf, "http://www.eclipse.org/org/documents/epl-v10.html",sizeof( "http://www.eclipse.org/org/documents/epl-v10.html")-1, 0); + else + comment( ¬ice, &buf, "http://www.opensource.org/licenses/cpl",sizeof( "http://www.opensource.org/licenses/cpl")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 5) + { + copy(&tmp, notice.item[14].data ? "and it": "This software", -1); + copy(&tmp, " may only be used by you under license from", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[i = 5].data) + { + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[i = 15]); + copy(&tmp, " ", -1); + } + expand(¬ice, &tmp, ¬ice.item[5]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + else if (notice.item[i = 2].data) + { + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[i = 15]); + copy(&tmp, " ", -1); + } + expand(¬ice, &tmp, ¬ice.item[2]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + else + i = -1; + if (notice.item[21].data) + { + comment( ¬ice, &buf, "A copy of the Source Code Agreement is available",sizeof( "A copy of the Source Code Agreement is available")-1, 0); + copy(&tmp, "at the ", -1); + if (i >= 0) + expand(¬ice, &tmp, ¬ice.item[i]); + copy(&tmp, " Internet web site URL", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + expand(¬ice, &tmp, ¬ice.item[21]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[22].data) + { + copy(&tmp, "(with an md5 checksum of ", -1); + expand(¬ice, &tmp, ¬ice.item[22]); + copy(&tmp, ")", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + } + comment( ¬ice, &buf, "If you have copied or used this software without agreeing",sizeof( "If you have copied or used this software without agreeing")-1, 0); + comment( ¬ice, &buf, "to the terms of the license you are infringing on",sizeof( "to the terms of the license you are infringing on")-1, 0); + comment( ¬ice, &buf, "the license and copyright and are violating",sizeof( "the license and copyright and are violating")-1, 0); + if (i >= 0) + expand(¬ice, &tmp, ¬ice.item[i]); + copy(&tmp, "'s", -1); + if (n >= (70-32)) + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + else + ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); + copy(&tmp, "intellectual property rights.", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 11) + { + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "This is free software; you can redistribute it and/or",sizeof( "This is free software; you can redistribute it and/or")-1, 0); + comment( ¬ice, &buf, "modify it under the terms of the GNU General Public License",sizeof( "modify it under the terms of the GNU General Public License")-1, 0); + comment( ¬ice, &buf, "as published by the Free Software Foundation;",sizeof( "as published by the Free Software Foundation;")-1, 0); + comment( ¬ice, &buf, "either version 2, or (at your option) any later version.",sizeof( "either version 2, or (at your option) any later version.")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "This software is distributed in the hope that it",sizeof( "This software is distributed in the hope that it")-1, 0); + comment( ¬ice, &buf, "will be useful, but WITHOUT ANY WARRANTY;",sizeof( "will be useful, but WITHOUT ANY WARRANTY;")-1, 0); + comment( ¬ice, &buf, "without even the implied warranty of MERCHANTABILITY",sizeof( "without even the implied warranty of MERCHANTABILITY")-1, 0); + comment( ¬ice, &buf, "or FITNESS FOR A PARTICULAR PURPOSE.",sizeof( "or FITNESS FOR A PARTICULAR PURPOSE.")-1, 0); + comment( ¬ice, &buf, "See the GNU General Public License for more details.",sizeof( "See the GNU General Public License for more details.")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "You should have received a copy of the",sizeof( "You should have received a copy of the")-1, 0); + comment( ¬ice, &buf, "GNU General Public License",sizeof( "GNU General Public License")-1, 0); + comment( ¬ice, &buf, "along with this software (see the file COPYING.)",sizeof( "along with this software (see the file COPYING.)")-1, 0); + comment( ¬ice, &buf, "If not, a copy is available at",sizeof( "If not, a copy is available at")-1, 0); + comment( ¬ice, &buf, "http://www.gnu.org/copyleft/gpl.html",sizeof( "http://www.gnu.org/copyleft/gpl.html")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 8) + { + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "Redistribution and use in source and binary forms, with or",sizeof( "Redistribution and use in source and binary forms, with or")-1, -1); + comment( ¬ice, &buf, "without modification, are permitted provided that the following",sizeof( "without modification, are permitted provided that the following")-1, -1); + comment( ¬ice, &buf, "conditions are met:",sizeof( "conditions are met:")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 1. Redistributions of source code must retain the above",sizeof( " 1. Redistributions of source code must retain the above")-1, -1); + comment( ¬ice, &buf, " copyright notice, this list of conditions and the",sizeof( " copyright notice, this list of conditions and the")-1, -1); + comment( ¬ice, &buf, " following disclaimer.",sizeof( " following disclaimer.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 2. Redistributions in binary form must reproduce the above",sizeof( " 2. Redistributions in binary form must reproduce the above")-1, -1); + comment( ¬ice, &buf, " copyright notice, this list of conditions and the",sizeof( " copyright notice, this list of conditions and the")-1, -1); + comment( ¬ice, &buf, " following disclaimer in the documentation and/or other",sizeof( " following disclaimer in the documentation and/or other")-1, -1); + comment( ¬ice, &buf, " materials provided with the distribution.",sizeof( " materials provided with the distribution.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + copy(&tmp, " 3. Neither the name of ", -1); + if (notice.item[i = 15].data || notice.item[i = 5].data || notice.item[i = 2].data) + expand(¬ice, &tmp, ¬ice.item[i]); + else + copy(&tmp, "the copyright holder", -1); + copy(&tmp, " nor the", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), -1); + comment( ¬ice, &buf, " names of its contributors may be used to endorse or",sizeof( " names of its contributors may be used to endorse or")-1, -1); + comment( ¬ice, &buf, " promote products derived from this software without",sizeof( " promote products derived from this software without")-1, -1); + comment( ¬ice, &buf, " specific prior written permission.",sizeof( " specific prior written permission.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND",sizeof( "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND")-1, -1); + comment( ¬ice, &buf, "CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,",sizeof( "CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,")-1, -1); + comment( ¬ice, &buf, "INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF",sizeof( "INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF")-1, -1); + comment( ¬ice, &buf, "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE",sizeof( "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE")-1, -1); + comment( ¬ice, &buf, "DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS",sizeof( "DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS")-1, -1); + comment( ¬ice, &buf, "BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,",sizeof( "BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")-1, -1); + comment( ¬ice, &buf, "EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED",sizeof( "EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED")-1, -1); + comment( ¬ice, &buf, "TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,",sizeof( "TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,")-1, -1); + comment( ¬ice, &buf, "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON",sizeof( "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON")-1, -1); + comment( ¬ice, &buf, "ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,",sizeof( "ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,")-1, -1); + comment( ¬ice, &buf, "OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY",sizeof( "OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY")-1, -1); + comment( ¬ice, &buf, "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE",sizeof( "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE")-1, -1); + comment( ¬ice, &buf, "POSSIBILITY OF SUCH DAMAGE.",sizeof( "POSSIBILITY OF SUCH DAMAGE.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 9) + { + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "This software is provided 'as-is', without any express or implied",sizeof( "This software is provided 'as-is', without any express or implied")-1, -1); + comment( ¬ice, &buf, "warranty. In no event will the authors be held liable for any",sizeof( "warranty. In no event will the authors be held liable for any")-1, -1); + comment( ¬ice, &buf, "damages arising from the use of this software.",sizeof( "damages arising from the use of this software.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "Permission is granted to anyone to use this software for any",sizeof( "Permission is granted to anyone to use this software for any")-1, -1); + comment( ¬ice, &buf, "purpose, including commercial applications, and to alter it and",sizeof( "purpose, including commercial applications, and to alter it and")-1, -1); + comment( ¬ice, &buf, "redistribute it freely, subject to the following restrictions:",sizeof( "redistribute it freely, subject to the following restrictions:")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 1. The origin of this software must not be misrepresented;",sizeof( " 1. The origin of this software must not be misrepresented;")-1, -1); + comment( ¬ice, &buf, " you must not claim that you wrote the original software. If",sizeof( " you must not claim that you wrote the original software. If")-1, -1); + comment( ¬ice, &buf, " you use this software in a product, an acknowledgment in the",sizeof( " you use this software in a product, an acknowledgment in the")-1, -1); + comment( ¬ice, &buf, " product documentation would be appreciated but is not",sizeof( " product documentation would be appreciated but is not")-1, -1); + comment( ¬ice, &buf, " required.",sizeof( " required.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 2. Altered source versions must be plainly marked as such,",sizeof( " 2. Altered source versions must be plainly marked as such,")-1, -1); + comment( ¬ice, &buf, " and must not be misrepresented as being the original",sizeof( " and must not be misrepresented as being the original")-1, -1); + comment( ¬ice, &buf, " software.",sizeof( " software.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, " 3. This notice may not be removed or altered from any source",sizeof( " 3. This notice may not be removed or altered from any source")-1, -1); + comment( ¬ice, &buf, " distribution.",sizeof( " distribution.")-1, -1); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 10) + { + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "Permission is hereby granted, free of charge, to any person",sizeof( "Permission is hereby granted, free of charge, to any person")-1, 0); + comment( ¬ice, &buf, "obtaining a copy of this software and associated",sizeof( "obtaining a copy of this software and associated")-1, 0); + comment( ¬ice, &buf, "documentation files (the \"Software\"), to deal in the",sizeof( "documentation files (the \"Software\"), to deal in the")-1, 0); + comment( ¬ice, &buf, "Software without restriction, including without limitation",sizeof( "Software without restriction, including without limitation")-1, 0); + comment( ¬ice, &buf, "the rights to use, copy, modify, merge, publish, distribute,",sizeof( "the rights to use, copy, modify, merge, publish, distribute,")-1, 0); + comment( ¬ice, &buf, "sublicense, and/or sell copies of the Software, and to",sizeof( "sublicense, and/or sell copies of the Software, and to")-1, 0); + comment( ¬ice, &buf, "permit persons to whom the Software is furnished to do so,",sizeof( "permit persons to whom the Software is furnished to do so,")-1, 0); + comment( ¬ice, &buf, "subject to the following conditions:",sizeof( "subject to the following conditions:")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "The above copyright notice and this permission notice shall",sizeof( "The above copyright notice and this permission notice shall")-1, 0); + comment( ¬ice, &buf, "be included in all copies or substantial portions of the",sizeof( "be included in all copies or substantial portions of the")-1, 0); + comment( ¬ice, &buf, "Software.",sizeof( "Software.")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + comment( ¬ice, &buf, "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY",sizeof( "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY")-1, 0); + comment( ¬ice, &buf, "KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE",sizeof( "KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE")-1, 0); + comment( ¬ice, &buf, "WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR",sizeof( "WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR")-1, 0); + comment( ¬ice, &buf, "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS",sizeof( "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS")-1, 0); + comment( ¬ice, &buf, "OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR",sizeof( "OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR")-1, 0); + comment( ¬ice, &buf, "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR",sizeof( "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR")-1, 0); + comment( ¬ice, &buf, "OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE",sizeof( "OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE")-1, 0); + comment( ¬ice, &buf, "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",sizeof( "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else + { + if (notice.type == 15) + { + if (notice.item[i = 15].data || notice.item[i = 5].data || notice.item[i = 2].data) + { + expand(¬ice, &tmp, ¬ice.item[i]); + copy(&tmp, " - ", -1); + } + else + i = -1; + copy(&tmp, "Proprietary", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + comment(¬ice, &buf, ((char*)0), 0, 0); + if (notice.item[21].data) + { + copy(&tmp, "This is proprietary source code", -1); + if (i >= 0) + copy(&tmp, " licensed by", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[15]); + copy(&tmp, " ", -1); + } + if (notice.item[5].data) + { + expand(¬ice, &tmp, ¬ice.item[5]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + } + else if (notice.item[2].data) + { + expand(¬ice, &tmp, ¬ice.item[2]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + } + } + else + { + copy(&tmp, "This is unpublished proprietary source code", -1); + if (i >= 0) + copy(&tmp, " of", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + if (notice.item[i = 15].data || notice.item[i = 5].data) + expand(¬ice, &tmp, ¬ice.item[i]); + if (notice.item[2].data) + { + if ((( &tmp)->nxt-( &tmp)->buf)) + ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); + expand(¬ice, &tmp, ¬ice.item[2]); + } + if ((( &tmp)->nxt-( &tmp)->buf)) + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); + comment( ¬ice, &buf, "and is not to be disclosed or used except in",sizeof( "and is not to be disclosed or used except in")-1, 1); + comment( ¬ice, &buf, "accordance with applicable agreements",sizeof( "accordance with applicable agreements")-1, 1); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 13) + { + comment( ¬ice, &buf, "For nonexclusive individual use",sizeof( "For nonexclusive individual use")-1, 1); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 14) + { + comment( ¬ice, &buf, "For noncommercial use",sizeof( "For noncommercial use")-1, 1); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + if (notice.type >= 15 && !notice.item[21].data) + { + comment( ¬ice, &buf, "Unpublished & Not for Publication",sizeof( "Unpublished & Not for Publication")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + if (notice.item[21].data) + { + copy(&tmp, "This software is licensed", -1); + if (notice.item[5].data || notice.item[2].data) + { + copy(&tmp, " by", -1); + if ((notice.item[15].size + (notice.item[5].data ? (notice.item[5].size + notice.item[8].size) : notice.item[2].size)) >= ((70-32) - 6)) + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + else + ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); + if (notice.item[15].data) + { + expand(¬ice, &tmp, ¬ice.item[15]); + copy(&tmp, " ", -1); + } + if (notice.item[5].data) + { + expand(¬ice, &tmp, ¬ice.item[5]); + if (notice.item[8].data) + { + copy(&tmp, " ", -1); + expand(¬ice, &tmp, ¬ice.item[8]); + } + } + else if (notice.item[2].data) + expand(¬ice, &tmp, ¬ice.item[2]); + } + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + comment( ¬ice, &buf, "under the terms and conditions of the license in",sizeof( "under the terms and conditions of the license in")-1, 0); + expand(¬ice, &tmp, ¬ice.item[21]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[22].data) + { + copy(&tmp, "(with an md5 checksum of ", -1); + expand(¬ice, &tmp, ¬ice.item[22]); + copy(&tmp, ")", -1); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + } + else if (notice.type == 15) + { + comment( ¬ice, &buf, "The copyright notice above does not evidence any",sizeof( "The copyright notice above does not evidence any")-1, 0); + comment( ¬ice, &buf, "actual or intended publication of such source code",sizeof( "actual or intended publication of such source code")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + } + if (v = notice.item[12].data) + { + x = v + notice.item[12].size; + if (*v == '\n') + v++; + item.quote = notice.item[12].quote; + do + { + for (item.data = v; v < x && *v != '\n'; v++); + if ((item.size = v - item.data) && *item.data == '\t') + { + item.data++; + item.size--; + h = 0; + } + else + h = -1; + expand(¬ice, &tmp, &item); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), h); + } while (v++ < x); + if (item.size) + comment(¬ice, &buf, ((char*)0), 0, 0); + } + if (notice.item[13].data) + { + expand(¬ice, &tmp, ¬ice.item[13]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[i = 15].data || notice.item[i = 5].data) + expand(¬ice, &tmp, ¬ice.item[i]); + if (notice.item[2].data) + { + if ((( &tmp)->nxt-( &tmp)->buf)) + ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); + expand(¬ice, &tmp, ¬ice.item[2]); + } + if ((( &tmp)->nxt-( &tmp)->buf)) + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + if (notice.item[10].data) + { + expand(¬ice, &tmp, ¬ice.item[10]); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + comment(¬ice, &buf, ((char*)0), 0, 0); + } + } + if (v = notice.item[0].data) + { + x = v + notice.item[0].size; + q = (x - v) == 1 && (*v == '*' || *v == '-'); + k = q && notice.type != 4 ? -1 : 0; + for (;;) + { + if (!q) + { + while (v < x && (*v == ' ' || *v == '\t' || *v == '\r' || *v == '\n' || *v == ',' || *v == '+')) + v++; + if (v >= x) + break; + item.data = v; + while (v < x && *v != ',' && *v != '+' && *v++ != '>'); + item.size = v - item.data; + item.quote = notice.item[0].quote; + } + h = 0; + for (i = 0; i < notice.ids; i++) + if (q || item.size == notice.id[i].name.size && !sstrncmp( item.data, notice.id[i].name.data, item.size)) + { + h = 1; + if (notice.type == 4) + { + copy(&buf, "[-author?", -1); + expand(¬ice, &buf, ¬ice.id[i].value); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); + } + else + { + if (k < 0) + { + comment( ¬ice, &buf, "CONTRIBUTORS",sizeof( "CONTRIBUTORS")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + k = 1; + expand(¬ice, &tmp, ¬ice.id[i].value); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + if (!q) + break; + } + if (q) + break; + if (!h) + { + if (notice.type == 4) + { + copy(&buf, "[-author?", -1); + expand(¬ice, &buf, &item); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); + } + else + { + if (k < 0) + { + comment( ¬ice, &buf, "CONTRIBUTORS",sizeof( "CONTRIBUTORS")-1, 0); + comment(¬ice, &buf, ((char*)0), 0, 0); + } + k = 1; + expand(¬ice, &tmp, &item); + comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); + } + } + } + if (k > 0) + comment(¬ice, &buf, ((char*)0), 0, 0); + } + if (notice.type == 4) + { + copy(&buf, "[-copyright?", -1); + copyright(¬ice, &buf); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); + if (notice.item[21].data) + { + copy(&buf, "[-license?", -1); + expand(¬ice, &buf, ¬ice.item[21]); + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); + } + ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\n')):(( '\n'),(-1))); + } + else + comment(¬ice, &buf, ((char*)0), -1, 0); + return (*(( &buf)->nxt>=( &buf)->end?(( &buf)->nxt=( &buf)->end-1):( &buf)->nxt)=0,( &buf)->nxt-( &buf)->buf); +} +#line 336 "../../lib/libpp/ppproto.c" + +#line 348 +static char* +linesync __PARAM__((register Proto_t* proto, register char* p, register long n), (proto, p, n)) __OTORP__(register Proto_t* proto; register char* p; register long n;){ + + if (proto->flags & (1L<<13)) + + { + + p = strcopy(p, "\n#line "); + + + + p = number(p, n); + *p++ = '\n'; + } + return p; +} + + + + + + +static char* +init __PARAM__((Proto_t* proto, char* op, int flags), (proto, op, flags)) __OTORP__(Proto_t* proto; char* op; int flags;){ + register char* s; + + if (flags & (1L<<10)) + { + op = strcopy(op, "\ +\n\ +#if !defined(__PROTO__)\n\ +# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)\n\ +# if defined(__cplusplus)\n\ +# define __LINKAGE__ \"C\"\n\ +# else\n\ +# define __LINKAGE__\n\ +# endif\n\ +# define __STDARG__\n\ +# define __PROTO__(x) x\n\ +# define __OTORP__(x)\n\ +# define __PARAM__(n,o) n\n\ +# if !defined(__STDC__) && !defined(__cplusplus)\n\ +# if !defined(c_plusplus)\n\ +# define const\n\ +# endif\n\ +# define signed\n\ +# define void int\n\ +# define volatile\n\ +# define __V_ char\n\ +# else\n\ +# define __V_ void\n\ +# endif\n\ +# else\n\ +# define __PROTO__(x) ()\n\ +# define __OTORP__(x) x\n\ +# define __PARAM__(n,o) o\n\ +# define __LINKAGE__\n\ +# define __V_ char\n\ +# define const\n\ +# define signed\n\ +# define void int\n\ +# define volatile\n\ +# endif\n\ +# define __MANGLE__ __LINKAGE__\n\ +# if defined(__cplusplus) || defined(c_plusplus)\n\ +# define __VARARG__ ...\n\ +# else\n\ +# define __VARARG__\n\ +# endif\n\ +# if defined(__STDARG__)\n\ +# define __VA_START__(p,a) va_start(p,a)\n\ +# else\n\ +# define __VA_START__(p,a) va_start(p)\n\ +# endif\n\ +# if !defined(__INLINE__)\n\ +# if defined(__cplusplus)\n\ +# define __INLINE__ extern __MANGLE__ inline\n\ +# else\n\ +# if defined(_WIN32) && !defined(__GNUC__)\n\ +# define __INLINE__ __inline\n\ +# endif\n\ +# endif\n\ +# endif\n\ +#endif\n\ +#if !defined(__LINKAGE__)\n\ +#define __LINKAGE__ /* 2004-08-11 transition */\n\ +#endif\n\ +"); + } + else + op = strcopy(op, "\ +\n\ +#if !defined(__PROTO__)\n\ +#include \n\ +#endif\n\ +#if !defined(__LINKAGE__)\n\ +#define __LINKAGE__ /* 2004-08-11 transition */\n\ +#endif\n\ +"); + if (proto->package) + { + s = "\ +#ifndef __MANGLE_%_DATA__\n\ +# ifdef _BLD_%\n\ +# ifdef __EXPORT__\n\ +# define __MANGLE_%_DATA__ __MANGLE__ __EXPORT__\n\ +# else\n\ +# define __MANGLE_%_DATA__ __MANGLE__\n\ +# endif\n\ +# define __MANGLE_%_FUNC__ __MANGLE__\n\ +# else\n\ +# ifdef __IMPORT__\n\ +# define __MANGLE_%_DATA__ __MANGLE__ __IMPORT__\n\ +# else\n\ +# define __MANGLE_%_DATA__ __MANGLE__\n\ +# endif\n\ +# define __MANGLE_%_FUNC__ __MANGLE__\n\ +# endif\n\ +#endif\n\ +"; + for (;;) + { + switch (*op++ = *s++) + { + case 0: + op--; + break; + case '%': + op = strcopy(op - 1, proto->package); + continue; + default: + continue; + } + break; + } + } + return op; +} + + +#line 422 +static char* +nns __PARAM__((register char* s), (s)) __OTORP__(register char* s;){ + while (*s == ' ' || *s == '\t' || *s == '\n') + s++; + return s; +} + + +#line 439 +static int +directive __PARAM__((register char* s, int dir), (s, dir)) __OTORP__(register char* s; int dir;){ + switch (*(s = nns(s))) + { + case 'e': + case 'i': + dir <<= 2; + switch (*++s) + { + case 'f': + dir |= 01; + break; + case 'l': + dir |= 02; + break; + case 'n': + dir |= 03; + break; + } + break; + } + return dir; +} + + + + + + + +static int +lex __PARAM__((register Proto_t* proto, register long flags), (proto, flags)) __OTORP__(register Proto_t* proto; register long flags;){ + register char* ip; + register char* op; + register int c; + register int state; + register short* rp; + char* m; + char* e; + char* t; + char* bp; + char* v; + char* im; + char* ko; + char* aom; + int n; + int line; + int quot; + int brack; + int sub; + int x; + int vc; + + char* ie = 0; + char* om = 0; + char* aim = 0; + char* aie = 0; + char* func = 0; + int call = 0; + int dir = 0; + int group = 0; + int last = 0; + int paren = 0; + + char* qe = 0; + int qn = 0; + int args = 0; + + + do{(ip=proto->ip);(op=proto->op);call=proto->call;}while(0); + + if (flags & (1L<<5)) (ko=op); + + fsm_start: + proto->tp = ip; + state = 0; + bp = ip; + do + { + rp = _pp_fsmtab[state]; + fsm_get: + while (!(state = rp[c = (*(unsigned char*)ip++)])); + fsm_next: + ; + } while (state > 0); + if ((n = ip - bp - 1) > 0) + { + ip = bp; + do switch( n) { default : memcopy( op, ip, n); op += n; ip += n; break; case 7 : * op++ = * ip++; case 6 : * op++ = * ip++; case 5 : * op++ = * ip++; case 4 : * op++ = * ip++; case 3 : * op++ = * ip++; case 2 : * op++ = * ip++; case 1 : * op++ = * ip++; case 0 : break; } while (0); + ip++; + } + state = ~state; + fsm_terminal: + switch ((( state)&((1<<(7+1))-1))) + { + case ((0+28)+11): + if (op > proto->ob && *(op - 1) == '=' && (op == proto->ob + 1 || *(op - 2) != '=')) switch (c) + { + case '+': + case '-': + case '*': + case '&': + (*op++=( ' ')); + break; + } + (*op++=( c)); + break; + + case ((0+28)+0): + (ip--); + c = (*(op-1)); + break; + + case ((0+28)+1): + switch (c) + { + case '\n': + if ((( rp)>=_pp_fsmtab[(0+16)]&&( rp)<=_pp_fsmtab[(0+18)])) goto fsm_newline; + (*op++=( c)); + proto->line++; + rp = _pp_fsmtab[(0+13)]; + break; + case '/': + + if ((flags & ((1L<<5)|(1L<<15))) == (1L<<5)) (op=ko); + else + + (*op++=( c)); + if ((( rp)>=_pp_fsmtab[(0+16)]&&( rp)<=_pp_fsmtab[(0+18)])) + { + rp = _pp_fsmtab[(0+16)]; + break; + } + goto fsm_start; + case (255+1): + break; + default: + + if ((flags & ((1L<<5)|(1L<<15))) == (1L<<5)) (op=ko); + else + + (*op++=( c)); + rp = _pp_fsmtab[(( rp)>=_pp_fsmtab[(0+16)]&&( rp)<=_pp_fsmtab[(0+18)]) ? (0+16) : (0+14)]; + break; + } + bp = ip; + goto fsm_get; + + case ((0+28)+2): + if (c) + { + if (state = _pp_fsmtab[(0+28)][((( rp)-_pp_fsmtab[0])/(255+1))+1]) + goto fsm_terminal; + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + } + (ip--); + fsm_eob: + if ((flags & ((1L<<1)|((1L<<16))|(1L<<21))) == ((1L<<16)) && (proto->flags & (1L<<16))) + { + + if (!(flags & (1L<<5))) + + flags |= (1L<<24); + c = ip - proto->ib; + if (!(flags & (1L<<15))) + im = proto->tp; + if (ip > proto->ib) + { + n = ip - im; + if (ip - n < proto->ib) + proto->flags |= (1L<<4); + memcopy(proto->ib - n, ip - n, n); + ip = proto->ib; + } + proto->tp -= c; + if (flags & (1L<<15)) + { + im -= c; + ie -= c; + } + if (aim) + aim -= c; + if (aie) + aie -= c; + if ((n = read(proto->fd, ip, proto->iz)) > 0) + { + if ((proto->options & (1L<<0)) && n < proto->iz) + { + proto->flags &= ~(1L<<16); + close(proto->fd); + } + *(ip + n) = 0; + if (state & (1<<7)) + goto fsm_splice; + bp = ip; + goto fsm_get; + } + *ip = 0; + proto->flags &= ~(1L<<16); + close(proto->fd); + } + if (state & (1<<7)) + goto fsm_splice; + + if (!(flags & (1L<<21)) && (state = rp[c = (255+1)])) + { + bp = ip; + goto fsm_next; + } + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + + case ((0+28)+3): + quot = c; + + if (c == '"' && qe) + { + for (n = 0, t = qe + 1; t < op && (*t == ' ' || *t == '\t' || *t == '\n' && ++n || *t >= 'A' && *t <= 'Z' || *t == '_'); t++); + if (t == op) + { + op = qe; + qe = 0; + qn = n; + } + else (*op++=( c)); + } + else + + (*op++=( c)); + rp = _pp_fsmtab[(0+21)]; + bp = ip; + goto fsm_get; + + case ((0+28)+4): + if (c == quot) + { + + if (!(flags & (1L<<3))) + qe = (c == '"') ? op : (char*)0; + + (*op++=( c)); + + while (qn > 0) + { + qn--; + (*op++=( '\n')); + } + + } + else if (c != '\n' && c != (255+1)) + { + (*op++=( c)); + bp = ip; + goto fsm_get; + } + else + { + + while (qn > 0) + { + qn--; + (*op++=( '\n')); + } + + (ip--); + } + c = (0401+1); + break; + + case ((0+28)+5): + + if (flags & (1L<<0)) (*op++=( c)); + else + + switch (c) + { + case 'a': + n = (('A'==0301)?0057:0007); + goto fsm_oct; + case 'E': + n = (('A'==0301)?0047:0033); + goto fsm_oct; + case 'v': + n = 0013; + goto fsm_oct; + case 'x': + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + lex(proto, (flags & ((1L<<16))) | (1L<<21)); + for (n = x = 0; (c = (*(unsigned char*)ip++)), x < 3; x++) switch (c) + { + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + n = (n << 4) + c - '0'; + break; + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': + n = (n << 4) + c - 'a' + 10; + break; + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': + n = (n << 4) + c - 'A' + 10; + break; + default: + goto fsm_hex; + } + fsm_hex: + (ip--); + fsm_oct: + (*op++=( ((n >> 6) & 07) + '0')); + (*op++=( ((n >> 3) & 07) + '0')); + (*op++=( (n & 07) + '0')); + break; + default: + (*op++=( c)); + break; + } + rp = _pp_fsmtab[(0+21)]; + bp = ip; + goto fsm_get; + + case ((0+28)+6): + (ip--); + + if ((flags & (1L<<5)) && *proto->tp == 's' && !sstrncmp( proto->tp, "static", 6)) + { + c = ((0500+4)+9); + break; + } + + if (*proto->tp == '_' && !sstrncmp( proto->tp, "__STDPP__directive", 6)) c = '#'; + else c = (0401+0); + + break; + + case ((0+28)+7): + fsm_newline: + proto->line++; + + if (flags & (1L<<5)) + { + if (op != proto->ob && (*(op-1)) != ' ' && (*(op-1)) != '\n') + (*op++=( ' ')); + } + else + + (*op++=( c)); + if (flags & (1L<<3)) + { + + if (flags & (1L<<0)) + { + if (flags & (1L<<5)) (op=ko); + if (flags & (1L<<12)) + { + *(ip - 1) = 0; + op = strcopy(om, "/* "); + op = strcopy(op, im); + op = strcopy(op, " */\n"); + } + flags &= ~((1L<<2)|(1L<<3)|(1L<<7)|(1L<<8)|(1L<<12)|(1L<<15)|(1L<<22)|(1L<<26)); + } + else + + { + if ((flags & ((1L<<2)|(1L<<22))) == ((1L<<2)|(1L<<22))) + { + *(ip - 1) = 0; + op = strcopy(om, "#if defined(__STDC__) || defined(__STDPP__)\n"); + op = strcopy(op, im); + op = strcopy(op, "\n#else\n"); + bp = ip; + ip = im; + *op++ = *ip++; + while (*op = *ip++) + if (*op++ == '#' && *ip != '(') + { + op--; + while (*--op == ' ' || *op == '\t'); + if (*ip == '#') + { + op = strcopy(op + 1, "/**/"); + while (*++ip == ' ' || *ip == '\t'); + } + else + { + if (*op != '"') *++op = '"'; + op++; + while (*ip == ' ' || *ip == '\t') ip++; + while ((c = *ip) >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '_') *op++ = *ip++; + while (*ip == ' ' || *ip == '\t') ip++; + if (*ip == '"') ip++; + else *op++ = '"'; + } + } + ip = bp; + op = strcopy(op, "\n#endif\n"); + op = linesync(proto, op, proto->line); + } + flags &= ~((1L<<2)|(1L<<3)|(1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<22)|(1L<<23)|(1L<<25)|(1L<<26)); + } + call = 0; + group = 0; + paren = 0; + last = '\n'; + } + if (paren == 0 && (flags & ((1L<<15)|(1L<<21)|(1L<<23)|(1L<<24))) == (1L<<24)) + { + + if (flags & (1L<<5)) (op=ko); + + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + } + goto fsm_start; + + case ((0+28)+8): + (*op++=( c)); + rp = _pp_fsmtab[((( state)>>(7+1))&((1<<7)-1))]; + bp = ip; + goto fsm_get; + + case ((0+28)+13): + (*op++=( c)); + c = (((( state)>>(7+1))&((1<<7)-1))+0401); + break; + + case ((0+28)+14): + (ip--); + c = (((( state)>>(7+1))&((1<<7)-1))+0401); + break; + + case (((0+28)+12)): + (ip--); + c = (0401+0); + if (!(flags & (1L<<1))) switch (((((long)( *proto->tp))<<16)|(((long)( *(ip - 1)))<<8)|((long)( ip - proto->tp)))) + { + case ((((long)( 'N'))<<16)|(((long)( 'N'))<<8)|((long)( 3))): + if (proto->tp[1] == 'o') + c = ((0500+4)+6); + break; + case ((((long)( 'd'))<<16)|(((long)( 'o'))<<8)|((long)( 2))): + c = ((0500+4)+6); + break; + case ((((long)( 'e'))<<16)|(((long)( 'e'))<<8)|((long)( 4))): + if (!(flags & (1L<<21)) && (flags & ((1L<<3)|(1L<<25))) != (1L<<3) && !sstrncmp( proto->tp, "else", 4)) + { + c = ((0500+4)+8); + goto fsm_id; + } + break; + case ((((long)( 'e'))<<16)|(((long)( 'n'))<<8)|((long)( 6))): + if (!sstrncmp( proto->tp, "extern", 6)) + c = ((0500+4)+9); + break; + case ((((long)( 'f'))<<16)|(((long)( 'r'))<<8)|((long)( 3))): + if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "for", 3)) + { + c = ((0500+4)+11); + goto fsm_id; + } + break; + case ((((long)( 'i'))<<16)|(((long)( 'f'))<<8)|((long)( 2))): + c = ((0500+4)+13); + break; + case ((((long)( 'i'))<<16)|(((long)( 'e'))<<8)|((long)( 6))): + if (!sstrncmp( proto->tp, "inline", 6) && !(flags & ((1L<<15)|(1L<<23)|(1L<<25)|(1L<<26))) && proto->brace == 0 && paren == 0 && group == 0 && (last == ';' || last == '}' || last == '\n' || last == 0)) + { + flags |= (1L<<23); + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + line = proto->line; + op = strcopy(op - 6, "__INLINE__"); + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + } + break; + case ((((long)( 'r'))<<16)|(((long)( 'n'))<<8)|((long)( 6))): + if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "return", 6)) + { + c = ((0500+4)+17); + goto fsm_id; + } + break; + case ((((long)( 's'))<<16)|(((long)( 'c'))<<8)|((long)( 6))): + if ((proto->options & (1L<<6)) && !sstrncmp( proto->tp, "static", 6)) + { + proto->ox = op - 6; + flags |= (1L<<6); + } + break; + case ((((long)( 't'))<<16)|(((long)( 'f'))<<8)|((long)( 7))): + if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "typedef", 7)) + { + flags |= (1L<<26); + c = ((0500+4)+9); + } + break; + case ((((long)( 'v'))<<16)|(((long)( 't'))<<8)|((long)( 8))): + if (*ip == '(' && !sstrncmp( proto->tp, "va_start", 8)) c = (0500+1); + break; + case ((((long)( 'v'))<<16)|(((long)( 'd'))<<8)|((long)( 4))): + if (!sstrncmp( proto->tp, "void", 4)) + { + if (flags & ((1L<<0)|(1L<<19)|(1L<<10)|(1L<<11))) c = ((0500+4)+30); + else + { + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + line = proto->line; + if (lex(proto, (flags & ((1L<<16))) | (1L<<21)) == '*') + { + memcopy(op - 4, "__V_", 4); + memcopy(ip - 4, "__V_", 4); + } + else c = ((0500+4)+30); + proto->line = line; + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + bp = ip; + } + } + break; + case ((((long)( 'w'))<<16)|(((long)( 'e'))<<8)|((long)( 5))): + if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "while", 5)) + { + c = ((0500+4)+26); + goto fsm_id; + } + break; + } + + if ((flags & (1L<<0)) && c != ((0500+4)+9)) + c = (0401+0); + + break; + + case ((0+28)+10): + goto fsm_start; + + case ((0+28)+15): + (ip--); + + if ((flags & ((1L<<5)|(1L<<15))) == (1L<<5)) + { + while (op > proto->ob && (*(op - 1) == ' ' || *(op - 1) == '\t')) + op--; + if (op > proto->ob && *(op - 1) != '\n') *op++ = ' '; + } + + goto fsm_start; + + default: + if (state & (1<<7)) + { + if (c == '\\') + { + if (!(n = (*(unsigned char*)ip++))) + { + goto fsm_eob; + fsm_splice: + c = '\\'; + n = (*(unsigned char*)ip++); + } + if (n == '\n') + { + proto->line++; + (*op++=( '\\')); + (*op++=( '\n')); + bp = ip; + goto fsm_get; + } + (ip--); + } + state &= ~(1<<7); + if (state >= (0+28)) + goto fsm_terminal; + rp = _pp_fsmtab[state]; + } + (*op++=( c)); + bp = ip; + goto fsm_get; + } + if (!(flags & ((1L<<10)|(1L<<11)|(1L<<21)))) + { + if (!(flags & (1L<<3))) switch (c) + { + case '(': + + if (!(flags & (1L<<0)) || proto->brace == 0) + + { + if (paren++ == 0) + { + + if (!(flags & (1L<<0)) || group <= 1) + + { + + args = 0; + + if (group++ == 0) group++; + else if (flags & (1L<<8)) call++; + flags |= (1L<<15); + im = ip - 1; + om = op - 1; + } + sub = 0; + } + else if (paren == 2 && !aim) + { + sub++; + if (last == '(') + { + flags &= ~(1L<<15); + om = 0; + } + else if (flags & (1L<<8)) + { + aim = ip - 1; + aom = op - 1; + } + else if ((flags & ((1L<<15)|(1L<<25))) == (1L<<15)) + { + for (m = ip - 2; m > im && (*m == ' ' || *m == '\t'); m--); + if (m != im && sub == 1) + { + m = im + (*nns(ip) == '*'); + } + if (m == im) + { + flags &= ~(1L<<15); + om = 0; + } + } + else if ((flags & (1L<<15)) && sub == 1 && *nns(ip) != '*') + { + flags &= ~(1L<<15); + om = 0; + } + } + flags &= ~(1L<<25); + } + break; + case ')': + + if (!(flags & (1L<<0)) || proto->brace == 0) + + if (--paren == 0) + { + + if (flags & (1L<<0)) + { + if (group != 2) + { + c = (0401+0); + break; + } + group++; + } + + ie = ip; + } + else if (paren == 1 && (flags & (1L<<8)) && !aie) + aie = ip; + break; + case '*': + if (last == '(' && group == 2) + { + group--; + if (paren == 1) + { + flags |= (1L<<8); + aim = aie = 0; + } + } + break; + case '#': + dir = directive(ip, dir); + if (proto->brace == 0 && paren == 0 && last != '=' && (flags & ((1L<<0)|(1L<<1)|(1L<<3)|(1L<<15)|(1L<<19)|(1L<<23)|(1L<<25))) == ((1L<<15)|(1L<<25)) && ((dir & 03) != 03 || ((dir>>2) & 03) != 01)) + flags |= (1L<<3); + else if (!(flags & ((1L<<1)|(1L<<3)))) + { + flags |= (1L<<3); + if (!(flags & (1L<<19))) + { + bp = ip; + while (*ip == ' ' || *ip == '\t') ip++; + if (*ip == 'l' && *++ip == 'i' && *++ip == 'n' && *++ip == 'e') + { + if (*++ip == ' ' || *ip == '\t') + { + proto->line = 0; + while (*++ip >= '0' && *ip <= '9') + proto->line = proto->line * 10 + *ip - '0'; + proto->line--; + } + } + + else if ((flags & ((1L<<0)|(1L<<5))) == (1L<<0)) + { + n = 0; + t = ip + 6; + while (ip < t && *ip >= 'a' && *ip <= 'z') + n = ((( n)<<5)+(( *ip++)-('a'-1))); + switch (n) + { + case ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'l')-('a'-1))))<<5)+(( 's')-('a'-1))))<<5)+(( 'e')-('a'-1))): + case ((( ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'n')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'i')-('a'-1))))<<5)+(( 'f')-('a'-1))): + while (*ip == ' ' || *ip == '\t') ip++; + if (*ip != '\n' && *ip != '/' && *(ip + 1) != '*') + { + flags |= (1L<<12)|(1L<<15); + im = ip; + om = op + (ip - bp); + } + break; + case ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'l')-('a'-1))))<<5)+(( 'i')-('a'-1))))<<5)+(( 'f')-('a'-1))): + case ((( ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'r')-('a'-1))))<<5)+(( 'r')-('a'-1))))<<5)+(( 'o')-('a'-1))))<<5)+(( 'r')-('a'-1))): + case ((( (( 'i')-('a'-1)))<<5)+(( 'f')-('a'-1))): + case ((( ((( ((( ((( (( 'i')-('a'-1)))<<5)+(( 'f')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))): + case ((( ((( ((( ((( ((( (( 'i')-('a'-1)))<<5)+(( 'f')-('a'-1))))<<5)+(( 'n')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))): + case ((( ((( ((( ((( (( 'u')-('a'-1)))<<5)+(( 'n')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))): + break; + case ((( ((( ((( ((( ((( (( 'i')-('a'-1)))<<5)+(( 'n')-('a'-1))))<<5)+(( 'c')-('a'-1))))<<5)+(( 'l')-('a'-1))))<<5)+(( 'u')-('a'-1))))<<5)+(( 'd')-('a'-1))): + if (*ip == 'e') ip++; + + case ((( ((( ((( ((( ((( (( 'd')-('a'-1)))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))))<<5)+(( 'i')-('a'-1))))<<5)+(( 'n')-('a'-1))))<<5)+(( 'e')-('a'-1))): + case ((( ((( ((( ((( ((( (( 'p')-('a'-1)))<<5)+(( 'r')-('a'-1))))<<5)+(( 'a')-('a'-1))))<<5)+(( 'g')-('a'-1))))<<5)+(( 'm')-('a'-1))))<<5)+(( 'a')-('a'-1))): + if (*ip < 'a' || *ip > 'z') break; + + default: + flags |= (1L<<12)|(1L<<15); + im = bp - 1; + om = op - 1; + break; + } + } + else + + { + if (*ip == 'i' && *++ip == 'n' && *++ip == 'c' && *++ip == 'l' && *++ip == 'u' && *++ip == 'd' && *++ip == 'e') + { + while (*++ip == ' ' || *ip == '\t'); + if (*ip++ == '<' && *ip++ == 's' && *ip++ == 't' && *ip++ == 'd' && *ip++ == 'a' && *ip++ == 'r' && *ip++ == 'g' && *ip++ == '.' && *ip++ == 'h' && *ip++ == '>') + { + op = strcopy(op, "\ +if !defined(va_start)\n\ +#if defined(__STDARG__)\n\ +#include \n\ +#else\n\ +#include \n\ +#endif\n\ +#endif\n\ +"); + op = linesync(proto, op, proto->line); + break; + } + } + else if (*ip == 'd' && *++ip == 'e' && *++ ip == 'f' && *++ip == 'i' && *++ip == 'n' && *++ip == 'e' && (*++ip == ' ' || *ip == '\t')) + { + while (*++ip == ' ' || *ip == '\t'); + if (*ip == 'e' && *++ip == 'x' && *++ ip == 't' && *++ip == 'e' && *++ip == 'r' && *++ip == 'n' && (*++ip == ' ' || *ip == '\t')) + { + t = ip; + while (*++t == ' ' || *t == '\t'); + if (*t == 'e' && *++t == 'x' && *++ t == 't' && *++t == 'e' && *++t == 'r' && *++t == 'n' && (*++t == ' ' || *t == '\t' || *t == '\n' || *t == '\r')) + ip = t; + t = ip; + while (*++t == ' ' || *t == '\t'); + if (*t == '_' && *(t + 1) == '_') + { + op = strcopy(op, "undef __MANGLE__\n"); + op = linesync(proto, op, proto->line); + op = strcopy(op, "#define __MANGLE__ __LINKAGE__"); + break; + } + } + flags |= (1L<<2)|(1L<<15); + im = bp - 1; + om = op - 1; + } + else if (*ip == 'u' && *++ip == 'n' && *++ ip == 'd' && *++ip == 'e' && *++ip == 'f' && (*++ip == ' ' || *ip == '\t')) + { + while (*++ip == ' ' || *ip == '\t'); + if (*ip == 'e' && *++ip == 'x' && *++ ip == 't' && *++ip == 'e' && *++ip == 'r' && *++ip == 'n' && (*++ip == ' ' || *ip == '\t' || *ip == '\n' || *ip == '\r')) + { + op = strcopy(op, "undef __MANGLE__\n"); + op = linesync(proto, op, proto->line); + op = strcopy(op, "#define __MANGLE__ __LINKAGE__"); + break; + } + flags |= (1L<<2)|(1L<<15); + im = bp - 1; + om = op - 1; + } + } + ip = bp; + } + break; + } + else + break; + + case '{': + if (proto->brace++ == 0 && paren == 0) + { + if (last == '=') flags |= (1L<<9); + + else if (flags & (1L<<0)) + { + if ((flags & ((1L<<15)|(1L<<17)|(1L<<23))) == (1L<<15)) + { + if (args) + { + v = number(op, args < 0 ? -args : args); + v = strcopy(v, " argument actual/formal mismatch"); + *v++ = ' '; + v = memcopy(v, im, ie - im); + *v = 0; + proto_error((char*)proto + sizeof(Proto_t), 2, op, ((char*)0)); + } + ip--; + + v = ie; + while (ie < ip) + if (*ie++ == '/' && *ie == '*') + { + e = ie - 1; + while (++ie < ip) + { + if (*ie == '*') + { + while (ie < ip && *ie == '*') ie++; + if (ie < ip && *ie == '/') + { + while (++ie < ip && (*ie == ' ' || *ie == '\t')); + while (e > v && (*(e - 1) == ' ' || *(e - 1) == '\t')) e--; + if (e > v && *e != '\n') *e++ = ' '; + t = ie; + while (--e >= v) + *--t = *e; + v = t; + break; + } + } + } + } + ie = v; + + op = om++; + if (flags & (1L<<5)) + { + v = op; + while (v > ko && *--v != ' '); + if (*v != ' ') + { + om = (v = (op += 4)) + 1; + while (v >= ko + 4) + { + *v = *(v - 4); + v--; + } + memcopy(ko, "int ", 4); + } + if (*v == ' ') + { + while (*(v + 1) == '*') + *v++ = '*'; + *v = '\t'; + if ((v - ko) <= 8) + { + om = (e = ++op) + 1; + while (e > v) + { + *e = *(e - 1); + e--; + } + } + } + om = (v = (op += 7)) + 1; + while (v >= ko + 7) + { + *v = *(v - 7); + v--; + } + memcopy(ko, "extern ", 7); + } + (*op++=( '(')); + t = op; + e = 0; + + while (ie < ip) + { + if ((c = *ie) == ' ' || c == '\t' || c == '\n') + { + while ((c = *++ie) == ' ' || c == '\t' || c == '\n'); + if (ie >= ip) break; + if (c != '*' && op > om) (*op++=( ' ')); + } + if ((n = ((c = *ie) == ',')) || c == ';') + { + if (flags & (1L<<5)) + { + m = op; + while (op > om && ((c = *(op - 1)) == '(' || c == ')' || c == '[' || c == ']')) + op--; + v = op; + while (op > om && (c = *(op - 1)) != ' ' && c != '*') + op--; + while (*(op - 1) == ' ') + op--; + if (!e) + { + e = op; + while (e > om && *(e - 1) == '*') + e--; + } + + + + + if (op <= om) + op = strcopy(op, "int"); + else if (*(op - 1) == ',') + op = strcopy(op, " int"); + + while (v < m) + (*op++=( *v++)); + } + (*op++=( ',')); + if (n) + { + if (x = !e) e = op - 1; + (*op++=( ' ')); + m = t; + while (m < e) + (*op++=( *m++)); + if (x) + { + m = e; + while (*--e != ' '); + while (*(e - 1) == '*') e--; + op -= m - e; + } + } + while ((c = *++ie) == ' ' || c == '\t' || c == '\n'); + if (ie >= ip) (op--); + else (*op++=( ' ')); + if (!n) + { + t = op; + e = 0; + } + } + else if (*ie == '*') + { + if (op > om && (c = *(op - 1)) == ' ') op--; + while (*ie == '*') (*op++=( *ie++)); + while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; + if (c != '(') (*op++=( ' ')); + } + else if (*ie == '(') + { + if (op > om && *(op - 1) == ' ') op--; + (*op++=( *ie++)); + while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; + } + else if (*ie == ')') + { + if (op > om && *(op - 1) == '(') + proto_error((char*)proto + sizeof(Proto_t), 1, "function pointer argument prototype omitted", ((char*)0)); + (*op++=( *ie++)); + while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; + } + else if ((flags & (1L<<5)) && (op == om || *(op - 1) == ' ') && *ie == 'r' && !sstrncmp( ie, "register", 8) && (*(ie + 8) == ' ' || *(ie + 8) == '\t' || *(ie + 8) == '\n')) + { + ie += 8; + if (op > om) (op--); + } + else (*op++=( *ie++)); + } + + if (op <= om) op = strcopy(op, "void"); + (*op++=( ')')); + if (flags & (1L<<5)) + { + (*op++=( ';')); + (*op++=( '\n')); + (proto->op=op); + (ko=op); + } + else + { + (*op++=( '\n')); + (*op++=( *ip)); + } + ip++; + flags &= ~((1L<<15)|(1L<<23)); + } + } + + else if ((flags & ((1L<<15)|(1L<<19)|(1L<<23)|(1L<<25))) == ((1L<<15)|(1L<<25))) + { + line = proto->line; + op = strcopy(om, " __PARAM__("); + op = memcopy(op, im, ie - im); + (*op++=( ',')); + (*op++=( ' ')); + (*op++=( '(')); + flags &= ~((1L<<15)|(1L<<23)); + if (flags & (1L<<27)) + { + if ((vc = ie - im + 1) > sizeof(proto->variadic)) vc = sizeof(proto->variadic); + memcopy(proto->variadic, im, vc); + op = strcopy(op, "va_alist)) __OTORP__(va_dcl)\n{"); + } + else + { + flags |= (1L<<23); + proto->ip = im; + proto->op = op; + group = 0; + brack = 0; + for (;;) + { + switch (lex(proto, (flags & ((1L<<16))) | (1L<<21))) + { + case '[': + brack++; + continue; + case ']': + brack--; + continue; + case '(': + if (paren++) group++; + continue; + case ')': + if (--paren == 0) + { + group = 0; + if (flags & (1L<<15)) + { + flags &= ~((1L<<15)|(1L<<23)); + op = memcopy(op, m, e - m); + } + break; + } + continue; + case ',': + if (paren == 1) + { + group = 0; + if (flags & (1L<<15)) + { + flags &= ~((1L<<15)|(1L<<23)); + op = memcopy(op, m, e - m); + } + (*op++=( ',')); + (*op++=( ' ')); + proto->op = op; + } + continue; + case (0401+0): + if (group <= 1 && !brack) + { + flags |= (1L<<15); + m = proto->tp; + e = proto->ip; + } + continue; + default: + continue; + } + break; + } + (*op++=( ')')); + (*op++=( ')')); + } + if (!(flags & (1L<<23))) + { + flags |= (1L<<23); + proto->op = strcopy(op, " __OTORP__("); + proto->ip = im + 1; + n = *(ie - 1); + *(ie - 1) = ';'; + c = *ie; + *ie = 0; + lex(proto, (flags & ((1L<<16))) | (1L<<1)); + *(ie - 1) = n; + *ie = c; + proto->ip = ie; + op = proto->op; + (*op++=( ')')); + } + if (flags & (1L<<6)) memcopy( proto->ox, "extern", 6); + op = linesync(proto, op, proto->line = line); + if (flags & (1L<<3)) + { + proto->brace = 0; + (*op++=( '\n')); + (*op++=( '#')); + } + else if (!(flags & (1L<<27))) (*op++=( '{')); + } + } + flags &= ~((1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<23)); + call = 0; + group = 0; + break; + case '}': + flags &= ~((1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<23)|(1L<<25)); + if (--proto->brace == 0) + { + flags &= ~((1L<<9)|(1L<<27)|(1L<<28)); + + if (flags & (1L<<5)) (op=ko); + + } + call = 0; + group = 0; + paren = 0; + break; + case '=': + if (last == '?') flags |= (1L<<3); + else if (paren == 0 && (flags & ((1L<<9)|(1L<<15)|(1L<<23))) == (1L<<15)) + { + if (last == ')' && proto->brace && (group != 2 || call != 2)) flags |= (1L<<23); + else goto fsm_statement; + } + goto fsm_other; + case ',': + + if (flags & (1L<<0)) + { + if (paren == 1) args++; + else + { + args--; + flags &= ~(1L<<15); + } + break; + } + + if (paren == 0 && (flags & (1L<<1))) *(op - 1) = c = ';'; + + case ';': + fsm_statement: + if (flags & (1L<<9)) ; + + else if (flags & (1L<<0)) + { + if (paren == 0) + { + if ((flags & (1L<<15)) && last == ')') + flags &= ~(1L<<15); + if (!(flags & (1L<<15))) + { + call = 0; + group = 0; + flags &= ~(1L<<23); + if (flags & (1L<<5)) (op=ko); + if (flags & (1L<<24)) + { + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + } + } + else + { + args--; + if ((flags & ((1L<<5)|(1L<<23))) == ((1L<<5)|(1L<<23))) + (op=ko); + } + } + } + + else if (paren == 0) + { + if ((flags & ((1L<<15)|(1L<<17)|(1L<<23))) == (1L<<15) && call > 1) + { + if ((flags & (1L<<14)) && func) + { + func[0] = 'F'; + func[1] = 'U'; + func[2] = 'N'; + func[3] = 'C'; + func = 0; + } + if ((flags & ((1L<<1)|(1L<<8))) == (1L<<8) && aim && aie < im) + { + while (aie < ip && (*aie == ' ' || *aie == '\t' || *aie == '\n')) aie++; + v = aim; + while (v < aie) + if (*v++ == ')') break; + while (v < aie && (*v == ' ' || *v == '\t' || *v == '\n')) v++; + if (v == aie || !(flags & (1L<<20))) + { + if (flags & (1L<<20)) n = 3; + else if (v == aie && *v == '(') n = 10; + else n = 11; + ko = op; + om += n; + v = op += n; + while (v >= ko + n) + { + *v = *(v - n); + v--; + } + if (flags & (1L<<20)) memcopy(aom, "(...))", 6); + else if (n == 10) memcopy(aom, "(__VARARG__))", 13); + else + { + ko = strcopy(aom, " __PROTO__("); + ko = memcopy(ko, aim, aie - aim); + *ko = ')'; + if (++ko >= om) + { + *ko++ = ')'; + om = ko; + } + } + } + } + else if (flags & (1L<<26)) + { + op = om; + while (*--op == ' ' || *op == '\t' || *op == '\n'); + if (*op != ')') + { + op = om += 14; + *--op = ')'; + while ((x = *(op - 14)) >= 'A' && x <= 'Z' || x >= 'a' && x <= 'z' || x >= '0' && x <= '9' || x == '_') + *--op = x; + memcopy(op - 13, "(__OTORP__(*)", 13); + } + } + if (flags & (1L<<17)) + ; + else if (flags & (1L<<20)) + { + op = om; + if (!(flags & (1L<<25))) op = strcopy(op, "(...)"); + else op = memcopy(op, im, ie - im); + (*op++=( c)); + } + else + { + if (flags & (1L<<1)) op = strcopy(om, "()"); + else if (!(flags & (1L<<25))) op = strcopy(om, "(__VARARG__)"); + else + { + op = strcopy(om, " __PROTO__("); + op = memcopy(op, im, ie - im); + (*op++=( ')')); + } + if (flags & (1L<<6)) memcopy( proto->ox, "extern", 6); + (*op++=( c)); + } + flags &= ~((1L<<15)|(1L<<27)|(1L<<28)); + if (c == ',' && !(flags & (1L<<8))) + { + call = 1; + group = 0; + break; + } + } + else if (flags & ((1L<<17)|(1L<<23))) call = 0; + if (c == ';') + { + flags &= ~((1L<<6)|(1L<<14)|(1L<<25)|(1L<<26)); + call = 0; + if (flags & (1L<<24)) + { + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return 0; + } + } + else call = call > 1 && c == ','; + group = 0; + flags &= ~((1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<23)); + } + else if (paren == 1 && group == 1 && !(flags & ((1L<<7)|(1L<<14)))) flags |= (1L<<25)|(1L<<17); + break; + case ((0500+4)+6): + case ((0500+4)+13): + flags |= (1L<<25)|(1L<<23); + break; + case ((0500+4)+9): + + if (flags & (1L<<0)) + { + if (proto->brace == 0) + flags |= (1L<<23); + } + else + + if (paren == 0 && !(flags & (1L<<26))) + { + flags |= (1L<<14); + if (!(flags & (1L<<19)) || proto->package) + { + op = strcopy(op, " __MANGLE__"); + if (proto->package) + { + op = strcopy(op - 1, proto->package); + func = op + 1; + op = strcopy(op, "_DATA__"); + } + } + else + func = 0; + } + break; + case (0401+29): + if (paren == 0 && (flags & ((1L<<1)|(1L<<27))) == (1L<<1)) + { + op -= 3; + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return c; + } + if (paren == 1 && !(flags & (1L<<23))) + flags |= (1L<<27); + flags |= (1L<<25); + break; + case ((0500+4)+30): + goto fsm_id; + case (0500+1): + if ((flags & ((1L<<19)|(1L<<27))) == (1L<<27)) + { + flags &= ~(1L<<15); + line = proto->line; + op = strcopy(op - 8, "__VA_START__"); + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + for (;;) + { + switch (lex(proto, (flags & ((1L<<16))) | (1L<<21))) + { + case 0: + case ';': + break; + case (0401+0): + if (!(flags & (1L<<15))) + { + flags |= (1L<<15); + m = proto->tp; + e = proto->ip; + } + continue; + default: + continue; + } + break; + } + do{(ip=proto->ip);(op=proto->op);call=proto->call;}while(0); + if (flags & (1L<<15)) + { + v = m; + n = e - m; + } + else + { + v = "ap"; + n = 2; + } + op = strcopy(op, " __OTORP__("); + proto->ip = proto->variadic; + proto->op = op; + flags &= ~(1L<<15); + group = 0; + bp = proto->ip + 1; + if (*bp == 'r' && !sstrncmp( bp, "register", 8) && (*(bp + 8) == ' ' || *(bp + 8) == '\t')) bp += 9; + for (;;) + { + switch (lex(proto, (flags & ((1L<<16))) | (1L<<21))) + { + case '(': + if (paren++) group++; + continue; + case ')': + if (--paren == 0) + { + if (flags & (1L<<15)) + { + flags &= ~(1L<<15); + if (!(flags & (1L<<28))) + { + op = memcopy(op, m, e - m); + op = strcopy(op, " = "); + } + op = strcopy(op, "va_arg("); + op = memcopy(op, v, n); + (*op++=( ',')); + (*op++=( ' ')); + if (m > bp) op = memcopy(op, bp, m - bp); + else op = strcopy(op, "int "); + if (group > 1) op = strcopy(op, ")()"); + else op = memcopy(op, e, proto->ip - e - 1); + (*op++=( ')')); + (*op++=( ';')); + } + group = 0; + break; + } + continue; + case ',': + if (paren == 1) + { + if (flags & (1L<<15)) + { + flags &= ~(1L<<15); + if (!(flags & (1L<<28))) + { + op = memcopy(op, m, e - m); + op = strcopy(op, " = "); + } + op = strcopy(op, "va_arg("); + op = memcopy(op, v, n); + (*op++=( ',')); + (*op++=( ' ')); + if (m > bp) op = memcopy(op, bp, m - bp); + else op = strcopy(op, "int "); + if (group > 1) op = strcopy(op, ")()"); + else op = memcopy(op, e, proto->ip - e - 1); + (*op++=( ')')); + (*op++=( ';')); + bp = proto->ip + 1; + if (*bp == 'r' && !sstrncmp( bp, "register", 8) && (*(bp + 8) == ' ' || *(bp + 8) == '\t')) bp += 9; + } + group = 0; + proto->op = op; + } + continue; + case (0401+0): + if (group <= 1) + { + flags |= (1L<<15); + m = proto->tp; + e = proto->ip; + } + continue; + default: + continue; + } + break; + } + op = strcopy(op, ")"); + flags |= (1L<<28); + proto->line = line; + call = 0; + break; + } + + case (0401+0): + fsm_id: + + if (flags & (1L<<0)) + { + if (!args && paren == 1) args++; + break; + } + + if (paren == 0) + { + if (last == ')') + { + if (proto->brace == 0 && !(flags & (1L<<1))) flags |= (1L<<23); + call = !call; + } + else if ((flags & (1L<<23)) || c == (0401+0) || c == ((0500+4)+30)) call++; + else flags |= (1L<<23); + if (last == (0401+0)) flags |= (1L<<7); + } + c = (0401+0); + flags |= (1L<<25); + break; + case (0401+1): + if (*proto->tp >= '0' && *proto->tp <= '9') + { + n = 0; + for (;; op--) + { + switch (*(op - 1)) + { + case 'f': + case 'F': + t = op; + while ((c = *--t) >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'); + if (*t == '.') + op--; + n = 0; + break; + case 'l': + case 'L': + if (!(n & 01)) + { + n |= 01; + t = op; + while ((c = *--t) >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'); + if (*t == '.') + { + n = 0; + op--; + break; + } + } + continue; + case 'u': + case 'U': + n |= 02; + continue; + } + break; + } + if (n & 01) + *op++ = 'L'; + if (n & 02) + { + m = op; + t = op = m + 10; + while ((c = *--m) >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z') + *--t = c; + c = *t; + strcopy(m + 1, "(unsigned)"); + *t = c; + break; + } + } + goto fsm_other; + + case '[': + if ((flags & (1L<<0)) && paren == 0 && group <= 2) flags |= (1L<<23); + + + default: + fsm_other: + + if (flags & (1L<<0)) break; + + flags |= (1L<<25); + if (paren == 0) flags |= (1L<<17); + break; + } + else if (c == '#' && *ip != '(') flags |= (1L<<22); + last = c; + + if ((flags & ((1L<<5)|(1L<<15))) == ((1L<<5)|(1L<<15)) && ((flags & ((1L<<3)|(1L<<23))) || proto->brace || c != '(' && c != ')' && c != '*' && c != (0401+0))) + (op=proto->op); + else + + (proto->op=op); + goto fsm_start; + } + else if (flags & ((1L<<10)|(1L<<11))) + { + + if ((flags & (1L<<29)) && c == '%' && *ip == '{') + t = 0; + else + + { + if (c == '#') + { + for (t = ip; *t == ' ' || *t == '\t'; t++); + if (*t++ == 'i' && *t++ == 'f' && *t++ == 'n' && *t++ == 'd' && *t++ == 'e' && *t++ == 'f') + { + + + + + t = 0; + } + } + else + t = ""; + } + if (t) + { + + n = ip - proto->tp; + ip -= n; + op -= n; + + + + + } + else + while (*ip != '\n') + *op++ = *ip++; + op = init(proto, op, flags); + op = linesync(proto, op, proto->line); + flags &= ~((1L<<10)|(1L<<11)); + proto->flags &= ~((1L<<10)|(1L<<11)); + goto fsm_start; + } + do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); + return c; +} + + + + + +void +pppclose __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ + register Proto_t* proto = (Proto_t*)(iob - sizeof(Proto_t)); + + if (proto->flags & (1L<<16)) close(proto->fd); + free((char*)proto); +} + + +#line 2055 +char* +pppopen __PARAM__((char* file, int fd, char* notice, char* options, char* package, char* comment, int flags), (file, fd, notice, options, package, comment, flags)) __OTORP__(char* file; int fd; char* notice; char* options; char* package; char* comment; int flags;){ + register Proto_t* proto; + register char* iob; + register long n; + register char* s; + char* t; + int pragma; + int clr; + int hit; + int i; + int z; + char* b; + + int comlen; + char com[80]; + + int m = 0; + + static int retain; + + + + + + + if (flags & (1<<0)) flags &= ~(1<<5); + + if (flags & (1<<11)) flags &= ~retain; + else retain &= (1<<6); + if (file && (fd = open(file, O_RDONLY)) < 0) return 0; + + + + + + + + + + + + + + + + + + + + + + + { + + + + + n = (16*1024); + if (!(proto = (( 0)?( Proto_t*)realloc((char*)( 0),sizeof( Proto_t)*( 1)+( 5 * n + 2)):( Proto_t*)calloc(1,sizeof( Proto_t)*( 1)+( 5 * n + 2))))) + return 0; + proto->iz = n; + proto->oz = 3 * n; + proto->flags |= (1L<<16); + } + proto->fd = fd; + proto->package = package; + iob = (char*)proto + sizeof(Proto_t); + proto->op = proto->ob = iob; + proto->ip = proto->ib = iob + proto->oz + n; + if (m) proto->options |= (1L<<0); + if (!comment) + comment = "/*"; + if (!(proto->cc[0] = comment[0])) + notice = options = 0; + else if (comment[1]) + { + proto->cc[1] = comment[1]; + proto->cc[2] = comment[2] ? comment[2] : comment[0]; + } + else + proto->cc[1] = proto->cc[2] = comment[0]; + + + + + + n = read(fd, proto->ip, proto->iz); + if (!(proto->flags & (1L<<16))) + close(fd); + if (n < 0) + { + pppclose(iob); + return 0; + } + *(proto->ip + n) = 0; + + +#line 2165 + if (!notice && !options || (comlen = astlicense(com, sizeof(com), ((char*)0), "type=check", proto->cc[0], proto->cc[1], proto->cc[2])) <= 0) + *com = 0; + + hit = (notice || options) ? 0 : 0x02; + pragma = -1; + s = proto->ip; + m = 80; + while (m-- > 0 && *s && hit != (0x01|0x02)) + { + while (*s == ' ' || *s == '\t') + s++; + if (*s == '#') + { + b = s++; + while (*s == ' ' || *s == '\t') + s++; + if (*s == *"pragma"&& !sstrncmp( s, "pragma", sizeof("pragma") - 1) && (*(s += sizeof("pragma") - 1) == ' ' || *s == '\t')) + { + clr = 0; + while (*s && *s != '\r' && *s != '\n') + { + for (; *s == ' ' || *s == '\t'; s++); + for (t = s; *s && *s != ' ' && *s != '\t' && *s != '\r' && *s != '\n'; s++); + z = s - t; + for (i = 0; i < (sizeof( pragmas)/sizeof( pragmas[0])); i++) + if (pragmas[i].size == z && !sstrncmp( t, pragmas[i].name, z)) + { + clr = 1; + hit |= pragmas[i].hit; + switch (pragmas[i].hit) + { + case 0x02: + notice = options = 0; + break; + case 0x01: + pragma = pragmas[i].val; + break; + } + } + } + if (clr) + { + + if (!(flags & (1<<1)) || (flags & (1<<8))) + + for (; b < s; *b++ = ' '); + } + } + } + else if (*s == *"/* : : generated by proto : : */\n"&& !sstrncmp( s, "/* : : generated by proto : : */\n", sizeof("/* : : generated by proto : : */\n") - 1)) + { + pragma = 0; + break; + } + + else if (*s == '%' && *(s + 1) == '{') + proto->flags |= (1L<<29); + else if (!(hit & 0x02)) + { + if (*s == *com && !sstrncmp( s, com, comlen)) + { + hit |= 0x02; + notice = options = 0; + } + else + for (; *s && *s != '\n' && !(hit & 0x02); s++) + for (i = 0; i < (sizeof( notices)/sizeof( notices[0])); i++) + if (*s == notices[i].name[0] && !sstrncmp( s, notices[i].name, notices[i].size)) + { + s += notices[i].size; + if (notices[i].val) + { + while (*s == ' ' || *s == '\t') + s++; + if (*s == '(' && (*(s + 1) == 'c' || *(s + 1) == 'C') && *(s + 2) == ')' || *s >= '0' && *s <= '9' && *(s + 1) >= '0' && *(s + 1) <= '9') + { + hit |= notices[i].hit; + notice = options = 0; + } + } + else + { + hit |= notices[i].hit; + notice = options = 0; + } + break; + } + } + + while (*s && *s++ != '\n'); + } + if (flags & (1<<10)) proto->flags |= (1L<<20); + if (flags & (1<<12)) proto->test = 1; + if (flags & (1<<2)) proto->options |= (1L<<6); + + if (flags & (1<<0)) pragma = -pragma; + if (flags & (1<<1)) pragma = 0; + if (flags & (1<<7)) proto->flags |= (1L<<13); + if (!(proto->flags & (1L<<29)) && file && (m = sstrlen( file)) > 2 && file[--m] == 'y' && file[--m] == '.') + proto->flags |= (1L<<29); + + if (pragma <= 0) + { + if (flags & (1<<10)) + { + flags &= ~((1<<4)|(1<<5)); + proto->flags |= (1L<<19); + } + else if (!(flags & ((1<<3)|(1<<9)))) + { + pppclose(iob); + return 0; + } + else if ((flags & ((1<<3)|(1<<9))) == (1<<9) || !pragma) + { + proto->flags |= (1L<<18); + if (proto->flags & (1L<<16)) + proto->oz += proto->iz; + proto->iz = n; + if (notice || options) + { + if (proto->cc[0] == '#' && proto->ip[0] == '#' && proto->ip[1] == '!') + { + s = proto->ip; + while (*s && *s++ != '\n'); + m = s - proto->ip; + proto->op = memcopy(proto->op, proto->ip, m); + proto->ip = s; + proto->iz = n -= m; + } + + if (proto->cc[0]) + { + if ((comlen = astlicense(proto->op, proto->oz, notice, options, proto->cc[0], proto->cc[1], proto->cc[2])) < 0) + proto_error((char*)proto + sizeof(Proto_t), 1, proto->op, ((char*)0)); + else + proto->op += comlen; + } + if (!(flags & (1<<0)) && !(proto->flags & (1L<<29))) + + proto->op = linesync(proto, proto->op, 1); + proto->iz += proto->op - proto->ob; + } + memcopy(proto->op, proto->ip, n); + return iob; + } + } + + if (!(retain & (1<<6))) + { + retain |= (1<<6); + ppfsm(4, ((char*)0)); + } + + proto->line = 1; + + if (notice || options || (flags & ((1<<4)|(1<<5)))) + { + + if (notice || options) + { + if ((comlen = astlicense(proto->op, proto->oz, notice, options, proto->cc[0], proto->cc[1], proto->cc[2])) < 0) + proto_error((char*)proto + sizeof(Proto_t), 1, proto->op, ((char*)0)); + else + proto->op += comlen; + } + + if (flags & (1<<5)) + { + proto->flags |= (1L<<11); + if (flags & (1<<11)) + retain |= (1<<5); + } + else if (flags & (1<<4)) + { + if (flags & (1<<11)) retain |= (1<<4); + + if (flags & (1<<0)) + { + *proto->op++ = '#'; + proto->op = strcopy(proto->op, "pragma"); + *proto->op++ = ' '; + proto->op = strcopy(proto->op, pragmas[0].name); + *proto->op++ = '\n'; + } + else + + proto->flags |= (1L<<10); + } + + if (!(flags & (1<<0))) + { + if (proto->flags & (1L<<29)) + { + proto->op = strcopy(proto->op, "\n%{\n"+ !notice); + proto->op = strcopy(proto->op, "/* : : generated by proto : : */\n"); + proto->op = strcopy(proto->op, "%}\n"); + } + else + { + if (n || notice || options) + *proto->op++ = '\n'; + proto->op = strcopy(proto->op, "/* : : generated by proto : : */\n"); + if (n) + proto->op = linesync(proto, proto->op, proto->line); + else if (proto->flags & ((1L<<10)|(1L<<11))) + proto->op = init(proto, proto->op, proto->flags); + } + } + + } + + + proto->file = file; + if (flags & (1<<0)) + { + proto->flags |= (1L<<0); + if (!(flags & (1<<4))) proto->flags |= (1L<<5); + } + + return iob; +} + + + + + + +int +pppread __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ + register Proto_t* proto = (Proto_t*)(iob - sizeof(Proto_t)); + register int n; + + if (proto->flags & (1L<<18)) + { + if (proto->iz) + { + n = proto->iz; + proto->iz = 0; + } + else if (!(proto->flags & (1L<<16))) n = 0; + else if ((n = read(proto->fd, proto->ob, proto->oz)) <= 0 || (proto->options & (1L<<0)) && n < proto->oz) + { + proto->flags &= ~(1L<<16); + close(proto->fd); + } + } + else + { + if (proto->op == proto->ob) + { + if (proto->flags & (1L<<4)) return -1; + + if (proto->flags & (1L<<29)) + { + register char* ip = proto->ip; + register char* op = proto->ob; + register char* ep = proto->ob + proto->oz - 2; + + if (!*ip) + { + ip = proto->ip = proto->ib; + if (!(proto->flags & (1L<<16))) n = 0; + else if ((n = read(proto->fd, ip, proto->iz)) <= 0 || (proto->options & (1L<<0)) && n < proto->iz) + { + if (n < 0) n = 0; + proto->flags &= ~(1L<<16); + close(proto->fd); + } + ip[n] = 0; + } + if (proto->flags & (1L<<30)) + { + proto->flags &= ~(1L<<30); + if (*ip == '%') + { + *op++ = *ip++; + if (proto->flags & (1L<<31)) proto->flags &= ~(1L<<29); + else proto->flags |= (1L<<31); + } + } + if (proto->flags & (1L<<29)) + while (op < ep && (n = *op++ = *ip)) + { + ip++; + if (n == '%') + { + if (*ip == '%' && (ip == proto->ip + 1 || *(ip - 2) == '\n')) + { + *op++ = *ip++; + if (proto->flags & (1L<<31)) proto->flags &= ~(1L<<29); + else proto->flags |= (1L<<31); + break; + } + if (!*ip) + { + *op++ = '%'; + proto->flags |= (1L<<30); + break; + } + } + else if (n == '\n') proto->line++; + } + proto->op = memcopy(proto->ob, proto->ip, ip - proto->ip); + proto->ip = ip; + } + else + + lex(proto, proto->flags); + if ((proto->flags & ((1L<<4)|(1L<<16))) == (1L<<4)) + proto->op = strcopy(proto->op, "/* NOTE: some constructs may not have been converted */\n"); + } + n = proto->op - proto->ob; + proto->op = proto->ob; + } + return n; +} + + + + + + + + + + + + +#line 269 "proto.c" + + + + + +static int +proto __PARAM__((char* file, char* license, char* options, char* package, char* copy, char* comment, int flags), (file, license, options, package, copy, comment, flags)) __OTORP__(char* file; char* license; char* options; char* package; char* copy; char* comment; int flags;){ + char* b; + char* e; + char* p; + int n; + int m; + int x; + int fd; + char buf[1024]; + + if (file && access(file, 4)) + proto_error(((char*)0), 2, file, "not found"); + else if (b = pppopen(file, 0, license, options, package, comment, flags)) + { + if (!file) + fd = 1; + else if (flags & ((1<<13)<<1)) + { + e = file + sstrlen( file) - 1; + x = *e; + *e = '_'; + if ((fd = creat(file, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) + { + proto_error(b, 2, file, "cannot create temporary file"); + pppclose(b); + return flags | ((1<<13)<<0); + } + *e = x; + } + else if (copy) + { + if (((n = sstrlen( copy)) + sstrlen( file) + 2) > sizeof(buf)) + { + proto_error(b, 2, copy, "copy path too long"); + pppclose(b); + return flags | ((1<<13)<<0); + } + strcopy( buf, copy); + e = buf + n; + if (*file != '/') + *e++ = '/'; + strcopy( e, file); + if ((fd = creat(buf, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) + { + for (e = buf; *e == '/'; e++); + do + { + if (*e == '/') + { + *e = 0; + if (access(buf, 0) && mkdir(buf, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) + { + proto_error(b, 2, buf, "cannot create copy directory"); + pppclose(b); + return flags | ((1<<13)<<0); + } + *e = '/'; + } + } while (*e++); + if ((fd = creat(buf, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) + { + proto_error(b, 2, buf, "cannot create copy file"); + pppclose(b); + return flags | ((1<<13)<<0); + } + } + file = buf; + } + else + fd = 1; + if (file && (flags & ((1<<13)<<2))) + proto_error(b, 0, "convert to", file); + while ((n = pppread(b)) > 0) + { + p = b; + for (;;) + { + if ((m = write(fd, p, n)) <= 0) + { + proto_error(b, 2, "write error", ((char*)0)); + flags |= ((1<<13)<<0); + break; + } + if ((n -= m) <= 0) + break; + p += m; + } + if (m < 0) + break; + } + if (fd > 1) + close(fd); + if (file && (flags & ((1<<13)<<1))) + { + *e = '_'; + strcopy( b, file); + *e = x; + if (replace(b, file, !(flags & (1<<0)))) + proto_error(b, 2, "cannot rename to", file); + } + pppclose(b); + } + return flags; +} + + + + + +typedef struct Sufcom_s +{ + char suffix[4]; + char comment[4]; +} Sufcom_t; + +static const Sufcom_t sufcom[] = +{ + "c", "/*", + "cpp", "/*", + "cxx", "/*", + "c++", "/*", + "C", "/*", + "CPP", "/*", + "CXX", "/*", + "C++", "/*", + "f", "C", + "F", "C", + "h", "/*", + "hpp", "/*", + "hxx", "/*", + "H", "/*", + "HPP", "/*", + "HXX", "/*", + "ksh", "#", + "KSH", "#", + "l", "/*", + "L", "/*", + "p", "(*)", + "pas", "(*)", + "P", "(*)", + "PAS", "(*)", + "pl", "#", + "PL", "#", + "pl1", "/*", + "pli", "/*", + "PL1", "/*", + "PLI", "/*", + "sh", "#", + "SH", "#", + "sml", "(*)", + "SML", "(*)", + "y", "/*", + "Y", "/*", +}; + + + + + +static char* +type __PARAM__((register char* file, char* comment), (file, comment)) __OTORP__(register char* file; char* comment;){ + register char* suffix; + register int i; + + if (file && (!comment || !*comment)) + { + suffix = 0; + while (*file) + if (*file++ == '.') + suffix = file; + if (suffix && sstrlen( suffix) <= 3) + for (i = 0; i < sizeof(sufcom) / sizeof(sufcom[0]); i++) + if (!strcmp(suffix, sufcom[i].suffix)) + return (char*)sufcom[i].comment; + } + return comment; +} + +int +main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){ + char* b; + char* file; + int fd; + int n; + char* op; + char* oe; + char* comment = 0; + char* copy = 0; + char* list = 0; + char* license = 0; + char* options = 0; + char* package = 0; + int flags = (1<<4); + char buf[1024]; + char opt[4 * 1024]; + + ; + + while ((file = *++argv) && *file == '-' && *(file + 1)) + { + for (;;) + { + switch (*++file) + { + case 0: + break; + case 'c': + if (!*(comment = ++file)) + comment = *++argv; + break; + case 'd': + flags |= (1<<1); + continue; + case 'e': + if (!*(package = ++file) && !(package = *++argv)) + { + file = "??"; + continue; + } + break; + case 'f': + flags |= (1<<3); + continue; + case 'h': + flags &= ~(1<<4); + continue; + case 'i': + flags |= (1<<0); + continue; + case 'l': + if (!*(license = ++file) && !(license = *++argv)) + { + file = "??"; + continue; + } + break; + case 'n': + flags |= (1<<7); + continue; + case 'o': + if (!*(b = ++file) && !(b = *++argv)) + { + file = "??"; + continue; + } + if (!options) + { + options = op = opt; + oe = op + sizeof(opt) - 1; + } + n = sstrlen( b); + if ((n + 1) >= (oe - op)) + proto_error(((char*)0), 3, b, "too many options"); + else + { + *op++ = '\n'; + memcopy( op, b, n + 1); + op += n; + } + break; + case 'p': + flags |= (1<<9); + continue; + case 'r': + flags |= ((1<<13)<<1); + continue; + case 's': + flags |= (1<<5); + continue; + case 't': + flags |= (1<<12); + continue; + case 'v': + flags |= ((1<<13)<<2); + continue; + case 'x': + flags |= (1<<2); + continue; + case 'z': + flags |= (1<<1)|(1<<8); + continue; + case 'C': + if (!*(copy = ++file) && !(copy = *++argv)) + { + file = "??"; + continue; + } + break; + case 'L': + if (!*(list = ++file) && !(list = *++argv)) + { + file = "??"; + continue; + } + break; + case 'P': + case '+': + flags |= (1<<10); + continue; + case 'S': + comment = "#"; + continue; + default: + proto_error(((char*)0), 2, file, "unknown option"); + + case '?': + b = "Usage: proto [-dfhinprstvzP+S] [-C directory] [-e package] [-l file]\n [-o \"name='value' ...\"] [-L file] file ...\n"; + write(2, b, sstrlen( b)); + return 2; + } + break; + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (list) + { + if (*list == '-' && !*(list + 1)) + fd = 0; + else if ((fd = open(list, O_RDONLY)) < 0) + proto_error(((char*)0), 3, list, "not found"); + do + { + for (b = buf; (n = read(fd, b, 1)) > 0 && *b != '\n' && b < &buf[sizeof(buf) - 1]; b++); + if (b > buf) + { + *b = 0; + flags = proto(buf, license, options, package, copy, type(buf, comment), flags); + } + } while (n > 0); + if (fd > 0) + close(fd); + } + if (file) + do flags = proto(file, license, options, package, copy, type(file, comment), flags); while (file = *++argv); + else if (!list) + flags = proto(file, license, options, package, copy, type(file, comment), flags); + return errors ? 1 : (flags & ((1<<13)<<0)) ? 2 : 0; +} diff --git a/src/cmd/INIT/ratz.c b/src/cmd/INIT/ratz.c new file mode 100644 index 0000000..df7d1e3 --- /dev/null +++ b/src/cmd/INIT/ratz.c @@ -0,0 +1,5293 @@ +/* + * ratz -- read a tar gzip archive from the standard input + * + * coded for portability + * _SEAR_* macros for win32 self extracting archives -- see sear(1). + */ + +static char id[] = "\n@(#)$Id: ratz (Jean-loup Gailly, Mark Adler, Glenn Fowler) 1.2.3 2010-10-10 $\0\n"; + +#if _PACKAGE_ast + +#include +#include + +static const char usage[] = +"[-?\n@(#)$Id: ratz (Jean-loup Gailly, Mark Adler, Glenn Fowler) 1.2.3 2010-10-10 $\n]" +"[-author?Jean-loup Gailly]" +"[-author?Mark Adler]" +"[-author?Glenn Fowler ]" +"[-copyright?Copyright (c) 1995-2005 Jean-loup Gailly and Mark Adler]" +"[-license?http://www.opensource.org/licenses/zlib-license]" +"[+NAME?ratz - read a tar gzip archive]" +"[+DESCRIPTION?\bratz\b extracts files and directories from a tar gzip" +" archive on the standard input. It is a standalone program for systems" +" that do not have \bpax\b(1), \btar\b(1) or \bgunzip\b(1). Only regular" +" files and directories are extracted; all other file types are ignored.]" +"[+?\b.exe\b files generated by \bsear\b(1) are fully functional \bratz\b" +" executables, so any \bratz\b option may be used on a \bsear\b file." +" This allows \bsear\b file contents to be examined and extracted without" +" executing any embedded installation scripts.]" +"[c:cat|uncompress?Uncompress the standard input and copy it to the standard" +" output.]" +#if defined(_SEAR_EXEC) +"[i!:install?Execute the sear installation script.]" +#endif +"[l:local?Reject files that traverse outside the current directory.]" +"[m:meter?Display a one line text meter showing archive read progress.]" +"[n!:convert?In ebcdic environments convert text archive members from ascii" +" to the native ebcdic.]" +"[t:list?List each file path on the standard output but do not extract.]" +"[v:verbose?List each file path on the standard output as it is extracted.]" +"[V?Print the program version and exit.]" +"[+SEE ALSO?\bgunzip\b(1), \bpackage\b(1), \bpax\b(1), \bsear\b(1), \btar\b(1)]" +; + +#else + +#define NiL ((char*)0) + +#endif + +#define METER_width 80 +#define METER_parts 20 + +#ifndef _GUNZIP_H +#define _GUNZIP_H 1 + +/* + * stripped down zlib containing public gzfopen()+gzread() in one file + * USE THE REAL ZLIB AFTER BOOTSTRAP + */ + +#define ZLIB_INTERNAL 1 +#define NO_GZCOMPRESS 1 + +#define gz_headerp voidp + +#include +#include + +#if _PACKAGE_ast || defined(__STDC__) || defined(_SEAR_EXEC) || defined(_WIN32) + +#define FOPEN_READ "rb" +#define FOPEN_WRITE "wb" + +#else + +#define FOPEN_READ "r" +#define FOPEN_WRITE "w" + +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#if _PACKAGE_ast + +#define setmode(d,m) + +#else + +#if !defined(_WINIX) && (_UWIN || __CYGWIN__ || __EMX__) +#define _WINIX 1 +#endif + +#if _WIN32 && !_WINIX + +#include +#include +#include +#include + +#define access _access +#define chmod _chmod +#define close _close +#define dup _dup +#define lseek _lseek +#define open _open +#define read _read +#define setmode _setmode +#define unlink _unlink + +#define mkdir(a,b) _mkdir(a) + +#else + +#define HAVE_UNISTD_H 1 + +#include +#include + +#define setmode(d,m) + +#endif + +#if defined(__STDC__) + +#include +#include + +#endif + +#endif + +#ifndef _ZLIB_H +#define _ZLIB_H 1 + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.3, July 18th, 2005 + + Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef _ZCONF_H +#define _ZCONF_H 1 + +#if _PACKAGE_ast +#include /* for { _WINIX __IMPORT__ __EXPORT__ } */ +#define z_off_t int32_t +#if _typ_int64_t +#define z_off64_t int64_t +#endif +#else +#if !defined(_WINIX) && (_UWIN || __CYGWIN__ || __EMX__) +#define _WINIX 1 +#endif +#endif + +#if _BLD_z && defined(__EXPORT__) +#define ZEXTERN __EXPORT__ +#define ZEXPORT +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# ifdef ZLIB_DLL +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#if HAVE_UNISTD_H +# include /* for off_t */ +# include /* for SEEK_* and off_t */ +# ifdef VMS +# include /* for off_t */ +# endif +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +#if defined(__OS400__) +# define NO_vsnprintf +#endif + +#if defined(__MVS__) +# define NO_vsnprintf +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(deflateBound,"DEBND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(compressBound,"CMBND") +# pragma map(inflate_table,"INTABL") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* _ZCONF_H */ + +#define ZLIB_VERSION "1.2.3" +#define ZLIB_VERNUM 0x1230 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip streams in memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field (though see inflate()) */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + +#endif /* _ZLIB_H */ + +#ifndef _ZUTIL_H +#define _ZUTIL_H 1 + +#if !_PACKAGE_ast && !defined(STDC) +#if defined(__STDC__) +# include +#endif +# include +# include +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + +#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) +# define OS_CODE 0x00 +# if defined(__TURBOC__) || defined(__BORLANDC__) +# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) + /* Allow compilation with ANSI keywords only enabled */ + void _Cdecl farfree( void *block ); + void *_Cdecl farmalloc( unsigned long nbytes ); +# else +# include +# endif +# else /* MSC or DJGPP */ +# include +# endif +#endif + +#ifdef AMIGA +# define OS_CODE 0x01 +#endif + +#if defined(VAXC) || defined(VMS) +# define OS_CODE 0x02 +# define F_OPEN(name, mode) \ + fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") +#endif + +#if defined(ATARI) || defined(atarist) +# define OS_CODE 0x05 +#endif + +#ifdef OS2 +# define OS_CODE 0x06 +# ifdef M_I86 + #include +# endif +#endif + +#if defined(MACOS) || defined(TARGET_OS_MAC) +# define OS_CODE 0x07 +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fdopen */ +# else +# ifndef fdopen +# define fdopen(fd,mode) NULL /* No fdopen() */ +# endif +# endif +#endif + +#ifdef TOPS20 +# define OS_CODE 0x0a +#endif + +#ifdef WIN32 +# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ +# define OS_CODE 0x0b +# endif +#endif + +#ifdef __50SERIES /* Prime/PRIMOS */ +# define OS_CODE 0x0f +#endif + +#if defined(_BEOS_) || defined(RISCOS) +# define fdopen(fd,mode) NULL /* No fdopen() */ +#endif + +#if (defined(_MSC_VER) && (_MSC_VER > 600)) +# if defined(_WIN32_WCE) +# define fdopen(fd,mode) NULL /* No fdopen() */ +# ifndef _PTRDIFF_T_DEFINED + typedef int ptrdiff_t; +# define _PTRDIFF_T_DEFINED +# endif +# else +# define fdopen(fd,type) _fdopen(fd,type) +# endif +#endif + + /* common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif +#if defined(__CYGWIN__) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif +#ifndef HAVE_VSNPRINTF +# ifdef MSDOS + /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), + but for now we just assume it doesn't. */ +# define NO_vsnprintf +# endif +# ifdef __TURBOC__ +# define NO_vsnprintf +# endif +# ifdef WIN32 + /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ +# if !defined(vsnprintf) && !defined(NO_vsnprintf) +# define vsnprintf _vsnprintf +# endif +# endif +# ifdef __SASC +# define NO_vsnprintf +# endif +#endif +#ifdef VMS +# define NO_vsnprintf +#endif + +#if defined(pyr) +# define NO_MEMCPY +#endif +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) + /* Use our own functions for small and medium model with MSC <= 5.0. + * You may have to use the same strategy for Borland C (untested). + * The __SC__ check is for Symantec. + */ +# define NO_MEMCPY +#endif +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) +# define HAVE_MEMCPY +#endif +#ifdef HAVE_MEMCPY +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ +# define zmemcpy _fmemcpy +# define zmemcmp _fmemcmp +# define zmemzero(dest, len) _fmemset(dest, 0, len) +# else +# define zmemcpy memcpy +# define zmemcmp memcmp +# define zmemzero(dest, len) memset(dest, 0, len) +# endif +#else + extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + extern void zmemzero OF((Bytef* dest, uInt len)); +#endif + +/* Diagnostic functions */ +#ifdef Z_DEBUG +# include + extern int z_verbose; + extern void z_error OF((char *m)); +# define Assert(cond,msg) {if(!(cond)) z_error(msg);} +# define Trace(x) {if (z_verbose>=0) fprintf x ;} +# define Tracev(x) {if (z_verbose>0) fprintf x ;} +# define Tracevv(x) {if (z_verbose>1) fprintf x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + + +voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); +void zcfree OF((voidpf opaque, voidpf ptr)); + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} +#endif /* _ZUTIL_H */ + +#ifndef _ZUTIL_C +#define _ZUTIL_C + +#if 0 && !_PACKAGE_ast && !defined(STDC) +extern void exit OF((int)); +#endif + +#ifndef HAVE_MEMCPY + +void zmemcpy(dest, source, len) + Bytef* dest; + const Bytef* source; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = *source++; /* ??? to be unrolled */ + } while (--len != 0); +} + +int zmemcmp(s1, s2, len) + const Bytef* s1; + const Bytef* s2; + uInt len; +{ + uInt j; + + for (j = 0; j < len; j++) { + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + } + return 0; +} + +void zmemzero(dest, len) + Bytef* dest; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = 0; /* ??? to be unrolled */ + } while (--len != 0); +} +#endif + + +#ifdef SYS16BIT + +#ifdef __TURBOC__ +/* Turbo C in 16-bit mode */ + +# define MY_ZCALLOC + +/* Turbo C malloc() does not allow dynamic allocation of 64K bytes + * and farmalloc(64K) returns a pointer with an offset of 8, so we + * must fix the pointer. Warning: the pointer must be put back to its + * original form in order to free it, use zcfree(). + */ + +#define MAX_PTR 10 +/* 10*64K = 640K */ + +local int next_ptr = 0; + +typedef struct ptr_table_s { + voidpf org_ptr; + voidpf new_ptr; +} ptr_table; + +local ptr_table table[MAX_PTR]; +/* This table is used to remember the original form of pointers + * to large buffers (64K). Such pointers are normalized with a zero offset. + * Since MSDOS is not a preemptive multitasking OS, this table is not + * protected from concurrent access. This hack doesn't work anyway on + * a protected system like OS/2. Use Microsoft C instead. + */ + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + voidpf buf = opaque; /* just to make some compilers happy */ + ulg bsize = (ulg)items*size; + + /* If we allocate less than 65520 bytes, we assume that farmalloc + * will return a usable pointer which doesn't have to be normalized. + */ + if (bsize < 65520L) { + buf = farmalloc(bsize); + if (*(ush*)&buf != 0) return buf; + } else { + buf = farmalloc(bsize + 16L); + } + if (buf == NULL || next_ptr >= MAX_PTR) return NULL; + table[next_ptr].org_ptr = buf; + + /* Normalize the pointer to seg:0 */ + *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; + *(ush*)&buf = 0; + table[next_ptr++].new_ptr = buf; + return buf; +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + int n; + if (*(ush*)&ptr != 0) { /* object < 64K */ + farfree(ptr); + return; + } + /* Find the original pointer */ + for (n = 0; n < next_ptr; n++) { + if (ptr != table[n].new_ptr) continue; + + farfree(table[n].org_ptr); + while (++n < next_ptr) { + table[n-1] = table[n]; + } + next_ptr--; + return; + } + ptr = opaque; /* just to make some compilers happy */ + Assert(0, "zcfree: ptr not found"); +} + +#endif /* __TURBOC__ */ + + +#ifdef M_I86 +/* Microsoft C in 16-bit mode */ + +# define MY_ZCALLOC + +#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) +# define _halloc halloc +# define _hfree hfree +#endif + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + return _halloc((long)items, size); +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + _hfree(ptr); +} + +#endif /* M_I86 */ + +#endif /* SYS16BIT */ + + +#ifndef MY_ZCALLOC /* Any system without a special alloc function */ + +#if 0 && !_PACKAGE_ast +#ifndef STDC +extern voidp malloc OF((uInt size)); +extern voidp calloc OF((uInt items, uInt size)); +extern void free OF((voidpf ptr)); +#endif +#endif + +voidpf zcalloc (opaque, items, size) + voidpf opaque; + unsigned items; + unsigned size; +{ + if (opaque) items += size - size; /* make compiler happy */ + return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : + (voidpf)calloc(items, size); +} + +void zcfree (opaque, ptr) + voidpf opaque; + voidpf ptr; +{ + free(ptr); + if (opaque) return; /* make compiler happy */ +} + +#endif /* MY_ZCALLOC */ + +#endif /* _ZUTIL_C */ + +#ifndef _CRC32_H +#define _CRC32_H 1 + +/* crc32.h -- tables for rapid CRC calculation + * Generated automatically by crc32.c + */ + +#ifndef TBLS +#define TBLS 1 +#endif + +local const unsigned long FAR crc_table[TBLS][256] = +{ + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d + }, +}; + +#endif /* _CRC32_H */ + +#ifndef _CRC32_C +#define _CRC32_C 1 + +/* ========================================================================= */ +#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) +#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 + +/* ========================================================================= */ +unsigned long ZEXPORT crc32(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + if (buf == Z_NULL) return 0; + +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif /* DYNAMIC_CRC_TABLE */ + +#ifdef BYFOUR + if (sizeof(void *) == sizeof(ptrdiff_t)) { + u4 endian; + + endian = 1; + if (*((unsigned char *)(&endian))) + return crc32_little(crc, buf, len); + else + return crc32_big(crc, buf, len); + } +#endif /* BYFOUR */ + crc = crc ^ 0xffffffff; + while (len >= 8) { + DO8; + len -= 8; + } + if (len) do { + DO1; + } while (--len); + return crc ^ 0xffffffff; +} + +#undef DO1 +#undef DO8 + +#endif /* _CRC32_C */ + +#ifndef _ADLER32_C +#define _ADLER32_C 1 + +#define BASE 65521 /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* use NO_DIVIDE if your processor does not do division in hardware */ +#ifdef NO_DIVIDE +# define MOD(a) \ + do { \ + if (a >= (BASE << 16)) a -= (BASE << 16); \ + if (a >= (BASE << 15)) a -= (BASE << 15); \ + if (a >= (BASE << 14)) a -= (BASE << 14); \ + if (a >= (BASE << 13)) a -= (BASE << 13); \ + if (a >= (BASE << 12)) a -= (BASE << 12); \ + if (a >= (BASE << 11)) a -= (BASE << 11); \ + if (a >= (BASE << 10)) a -= (BASE << 10); \ + if (a >= (BASE << 9)) a -= (BASE << 9); \ + if (a >= (BASE << 8)) a -= (BASE << 8); \ + if (a >= (BASE << 7)) a -= (BASE << 7); \ + if (a >= (BASE << 6)) a -= (BASE << 6); \ + if (a >= (BASE << 5)) a -= (BASE << 5); \ + if (a >= (BASE << 4)) a -= (BASE << 4); \ + if (a >= (BASE << 3)) a -= (BASE << 3); \ + if (a >= (BASE << 2)) a -= (BASE << 2); \ + if (a >= (BASE << 1)) a -= (BASE << 1); \ + if (a >= BASE) a -= BASE; \ + } while (0) +# define MOD4(a) \ + do { \ + if (a >= (BASE << 4)) a -= (BASE << 4); \ + if (a >= (BASE << 3)) a -= (BASE << 3); \ + if (a >= (BASE << 2)) a -= (BASE << 2); \ + if (a >= (BASE << 1)) a -= (BASE << 1); \ + if (a >= BASE) a -= BASE; \ + } while (0) +#else +# define MOD(a) a %= BASE +# define MOD4(a) a %= BASE +#endif + +/* ========================================================================= */ +uLong ZEXPORT adler32(adler, buf, len) + uLong adler; + const Bytef *buf; + uInt len; +{ + unsigned long sum2; + unsigned n; + + /* split Adler-32 into component sums */ + sum2 = (adler >> 16) & 0xffff; + adler &= 0xffff; + + /* in case user likes doing a byte at a time, keep it fast */ + if (len == 1) { + adler += buf[0]; + if (adler >= BASE) + adler -= BASE; + sum2 += adler; + if (sum2 >= BASE) + sum2 -= BASE; + return adler | (sum2 << 16); + } + + /* initial Adler-32 value (deferred check for len == 1 speed) */ + if (buf == Z_NULL) + return 1L; + + /* in case short lengths are provided, keep it somewhat fast */ + if (len < 16) { + while (len--) { + adler += *buf++; + sum2 += adler; + } + if (adler >= BASE) + adler -= BASE; + MOD4(sum2); /* only added so many BASE's */ + return adler | (sum2 << 16); + } + + /* do length NMAX blocks -- requires just one modulo operation */ + while (len >= NMAX) { + len -= NMAX; + n = NMAX / 16; /* NMAX is divisible by 16 */ + do { + DO16(buf); /* 16 sums unrolled */ + buf += 16; + } while (--n); + MOD(adler); + MOD(sum2); + } + + /* do remaining bytes (less than NMAX, still just one modulo) */ + if (len) { /* avoid modulos if none remaining */ + while (len >= 16) { + len -= 16; + DO16(buf); + buf += 16; + } + while (len--) { + adler += *buf++; + sum2 += adler; + } + MOD(adler); + MOD(sum2); + } + + /* return recombined sums */ + return adler | (sum2 << 16); +} + +#endif /* _ADLER32_C */ + +#ifndef _DEFLATE_H +#define _DEFLATE_H 1 + +/* =========================================================================== + * Internal compression state. + */ + +#define LENGTH_CODES 29 +/* number of length codes, not counting the special END_BLOCK code */ + +#define LITERALS 256 +/* number of literal bytes 0..255 */ + +#define L_CODES (LITERALS+1+LENGTH_CODES) +/* number of Literal or Length codes, including the END_BLOCK code */ + +#define D_CODES 30 +/* number of distance codes */ + +#define BL_CODES 19 +/* number of codes used to transfer the bit lengths */ + +#define HEAP_SIZE (2*L_CODES+1) +/* maximum heap size */ + +#define MAX_BITS 15 +/* All codes must not exceed MAX_BITS bits */ + +#define INIT_STATE 42 +#define EXTRA_STATE 69 +#define NAME_STATE 73 +#define COMMENT_STATE 91 +#define HCRC_STATE 103 +#define BUSY_STATE 113 +#define FINISH_STATE 666 +/* Stream status */ + + +/* Data structure describing a single value and its code string. */ +typedef struct ct_data_s { + union { + ush freq; /* frequency count */ + ush code; /* bit string */ + } fc; + union { + ush dad; /* father node in Huffman tree */ + ush len; /* length of bit string */ + } dl; +} FAR ct_data; + +#define Freq fc.freq +#define Code fc.code +#define Dad dl.dad +#define Len dl.len + +typedef struct static_tree_desc_s static_tree_desc; + +typedef struct tree_desc_s { + ct_data *dyn_tree; /* the dynamic tree */ + int max_code; /* largest code with non zero frequency */ + static_tree_desc *stat_desc; /* the corresponding static tree */ +} FAR tree_desc; + +typedef ush Pos; +typedef Pos FAR Posf; +typedef unsigned IPos; + +/* A Pos is an index in the character window. We use short instead of int to + * save space in the various tables. IPos is used only for parameter passing. + */ + +typedef struct internal_state { + z_streamp strm; /* pointer back to this zlib stream */ + int status; /* as the name implies */ + Bytef *pending_buf; /* output still pending */ + ulg pending_buf_size; /* size of pending_buf */ + Bytef *pending_out; /* next pending byte to output to the stream */ + uInt pending; /* nb of bytes in the pending buffer */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + gz_headerp gzhead; /* gzip header information to write */ + uInt gzindex; /* where in extra, name, or comment */ + Byte method; /* STORED (for zip only) or DEFLATED */ + int last_flush; /* value of flush param for previous deflate call */ + + /* used by deflate.c: */ + + uInt w_size; /* LZ77 window size (32K by default) */ + uInt w_bits; /* log2(w_size) (8..16) */ + uInt w_mask; /* w_size - 1 */ + + Bytef *window; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. Also, it limits + * the window size to 64K, which is quite useful on MSDOS. + * To do: use the user input buffer as sliding window. + */ + + ulg window_size; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + Posf *prev; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + Posf *head; /* Heads of the hash chains or NIL. */ + + uInt ins_h; /* hash index of string to be inserted */ + uInt hash_size; /* number of elements in hash table */ + uInt hash_bits; /* log2(hash_size) */ + uInt hash_mask; /* hash_size-1 */ + + uInt hash_shift; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + long block_start; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + uInt match_length; /* length of best match */ + IPos prev_match; /* previous match */ + int match_available; /* set if previous match exists */ + uInt strstart; /* start of string to insert */ + uInt match_start; /* start of matching string */ + uInt lookahead; /* number of valid bytes ahead in window */ + + uInt prev_length; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + uInt max_chain_length; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + uInt max_lazy_match; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ +# define max_insert_length max_lazy_match + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + int level; /* compression level (1..9) */ + int strategy; /* favor or force Huffman coding*/ + + uInt good_match; + /* Use a faster search when the previous match is longer than this */ + + int nice_match; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + /* Didn't use ct_data typedef below to supress compiler warning */ + struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + struct tree_desc_s l_desc; /* desc. for literal tree */ + struct tree_desc_s d_desc; /* desc. for distance tree */ + struct tree_desc_s bl_desc; /* desc. for bit length tree */ + + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + int heap_len; /* number of elements in the heap */ + int heap_max; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + uch depth[2*L_CODES+1]; + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + uchf *l_buf; /* buffer for literals or lengths */ + + uInt lit_bufsize; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + uInt last_lit; /* running index in l_buf */ + + ushf *d_buf; + /* Buffer for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + ulg opt_len; /* bit length of current block with optimal trees */ + ulg static_len; /* bit length of current block with static trees */ + uInt matches; /* number of string matches in current block */ + int last_eob_len; /* bit length of EOB code for last block */ + +#ifdef Z_DEBUG + ulg compressed_len; /* total bit length of compressed file mod 2^32 */ + ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ +#endif + + ush bi_buf; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + int bi_valid; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + +} FAR deflate_state; + +/* Output a byte on the stream. + * IN assertion: there is enough room in pending_buf. + */ +#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} + + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) +/* In order to simplify the code, particularly on 16 bit machines, match + * distances are limited to MAX_DIST instead of WSIZE. + */ + + /* in trees.c */ +void _tr_init OF((deflate_state *s)); +int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); +void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); +void _tr_align OF((deflate_state *s)); +void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); + +#define d_code(dist) \ + ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) +/* Mapping from a distance to a distance code. dist is the distance - 1 and + * must not have side effects. _dist_code[256] and _dist_code[257] are never + * used. + */ + +#ifndef Z_DEBUG +/* Inline versions of _tr_tally for speed: */ + +#if defined(GEN_TREES_H) || !defined(STDC) + extern uch _length_code[]; + extern uch _dist_code[]; +#else + extern const uch _length_code[]; + extern const uch _dist_code[]; +#endif + +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->last_lit] = 0; \ + s->l_buf[s->last_lit++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (length); \ + ush dist = (distance); \ + s->d_buf[s->last_lit] = dist; \ + s->l_buf[s->last_lit++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +#else +# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) +# define _tr_tally_dist(s, distance, length, flush) \ + flush = _tr_tally(s, distance, length) +#endif + +#endif /* _DEFLATE_H */ + +#ifndef _INFTREES_H +#define _INFTREES_H 1 + +typedef struct { + unsigned char op; /* operation, extra bits, table bits */ + unsigned char bits; /* bits in this part of the code */ + unsigned short val; /* offset in table or code value */ +} code; + +/* op values as set by inflate_table(): + 00000000 - literal + 0000tttt - table link, tttt != 0 is the number of table index bits + 0001eeee - length or distance, eeee is the number of extra bits + 01100000 - end of block + 01000000 - invalid code + */ + +/* Maximum size of dynamic tree. The maximum found in a long but non- + exhaustive search was 1444 code structures (852 for length/literals + and 592 for distances, the latter actually the result of an + exhaustive search). The true maximum is not known, but the value + below is more than safe. */ +#define ENOUGH 2048 +#define MAXD 592 + +/* Type of code to build for inftable() */ +typedef enum { + CODES, + LENS, + DISTS +} codetype; + +#endif /* _INFTREES_H */ + +#ifndef _INFLATE_H +#define _INFLATE_H 1 + +/* Possible inflate modes between inflate() calls */ +typedef enum { + HEAD, /* i: waiting for magic header */ + FLAGS, /* i: waiting for method and flags (gzip) */ + TIME, /* i: waiting for modification time (gzip) */ + OS, /* i: waiting for extra flags and operating system (gzip) */ + EXLEN, /* i: waiting for extra length (gzip) */ + EXTRA, /* i: waiting for extra bytes (gzip) */ + NAME, /* i: waiting for end of file name (gzip) */ + COMMENT, /* i: waiting for end of comment (gzip) */ + HCRC, /* i: waiting for header crc (gzip) */ + DICTID, /* i: waiting for dictionary check value */ + DICT, /* waiting for inflateSetDictionary() call */ + TYPE, /* i: waiting for type bits, including last-flag bit */ + TYPEDO, /* i: same, but skip check to exit inflate on new block */ + STORED, /* i: waiting for stored size (length and complement) */ + COPY, /* i/o: waiting for input or output to copy stored block */ + TABLE, /* i: waiting for dynamic block table lengths */ + LENLENS, /* i: waiting for code length code lengths */ + CODELENS, /* i: waiting for length/lit and distance code lengths */ + LEN, /* i: waiting for length/lit code */ + LENEXT, /* i: waiting for length extra bits */ + DIST, /* i: waiting for distance code */ + DISTEXT, /* i: waiting for distance extra bits */ + MATCH, /* o: waiting for output space to copy string */ + LIT, /* o: waiting for output space to write literal */ + CHECK, /* i: waiting for 32-bit check value */ + LENGTH, /* i: waiting for 32-bit length (gzip) */ + DONE, /* finished check, done -- remain here until reset */ + BAD, /* got a data error -- remain here until reset */ + MEM, /* got an inflate() memory error -- remain here until reset */ + SYNC /* looking for synchronization bytes to restart inflate() */ +} inflate_mode; + +/* + State transitions between above modes - + + (most modes can go to the BAD or MEM mode -- not shown for clarity) + + Process header: + HEAD -> (gzip) or (zlib) + (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME + NAME -> COMMENT -> HCRC -> TYPE + (zlib) -> DICTID or TYPE + DICTID -> DICT -> TYPE + Read deflate blocks: + TYPE -> STORED or TABLE or LEN or CHECK + STORED -> COPY -> TYPE + TABLE -> LENLENS -> CODELENS -> LEN + Read deflate codes: + LEN -> LENEXT or LIT or TYPE + LENEXT -> DIST -> DISTEXT -> MATCH -> LEN + LIT -> LEN + Process trailer: + CHECK -> LENGTH -> DONE + */ + +/* state maintained between inflate() calls. Approximately 7K bytes. */ +struct inflate_state { + inflate_mode mode; /* current inflate mode */ + int last; /* true if processing last block */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + int havedict; /* true if dictionary provided */ + int flags; /* gzip header method and flags (0 if zlib) */ + unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ + unsigned long check; /* protected copy of check value */ + unsigned long total; /* protected copy of output count */ + gz_headerp head; /* where to save gzip header information */ + /* sliding window */ + unsigned wbits; /* log base 2 of requested window size */ + unsigned wsize; /* window size or zero if not using window */ + unsigned whave; /* valid bytes in the window */ + unsigned write; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if needed */ + /* bit accumulator */ + unsigned long hold; /* input bit accumulator */ + unsigned bits; /* number of bits in "in" */ + /* for string and stored block copying */ + unsigned length; /* literal or length of data to copy */ + unsigned offset; /* distance back to copy string from */ + /* for table and code decoding */ + unsigned extra; /* extra bits needed */ + /* fixed and dynamic code tables */ + code const FAR *lencode; /* starting table for length/literal codes */ + code const FAR *distcode; /* starting table for distance codes */ + unsigned lenbits; /* index bits for lencode */ + unsigned distbits; /* index bits for distcode */ + /* dynamic table building */ + unsigned ncode; /* number of code length code lengths */ + unsigned nlen; /* number of length code lengths */ + unsigned ndist; /* number of distance code lengths */ + unsigned have; /* number of code lengths in lens[] */ + code FAR *next; /* next available space in codes[] */ + unsigned short lens[320]; /* temporary storage for code lengths */ + unsigned short work[288]; /* work area for code table building */ + code codes[ENOUGH]; /* space for code tables */ +}; +#endif /* _INFLATE_H */ + +#ifndef _INFTREES_C +#define _INFTREES_C 1 + +#define MAXBITS 15 + +const char inflate_copyright[] = + " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* + Build a set of tables to decode the provided canonical Huffman code. + The code lengths are lens[0..codes-1]. The result starts at *table, + whose indices are 0..2^bits-1. work is a writable array of at least + lens shorts, which is used as a work area. type is the type of code + to be generated, CODES, LENS, or DISTS. On return, zero is success, + -1 is an invalid code, and +1 means that ENOUGH isn't enough. table + on return points to the next available entry's address. bits is the + requested root table index bits, and on return it is the actual root + table index bits. It will differ if the request is greater than the + longest code or if it is less than the shortest code. + */ +int inflate_table(type, lens, codes, table, bits, work) +codetype type; +unsigned short FAR *lens; +unsigned codes; +code FAR * FAR *table; +unsigned FAR *bits; +unsigned short FAR *work; +{ + unsigned len; /* a code's length in bits */ + unsigned sym; /* index of code symbols */ + unsigned min, max; /* minimum and maximum code lengths */ + unsigned root; /* number of index bits for root table */ + unsigned curr; /* number of index bits for current table */ + unsigned drop; /* code bits to drop for sub-table */ + int left; /* number of prefix codes available */ + unsigned used; /* code entries in table used */ + unsigned huff; /* Huffman code */ + unsigned incr; /* for incrementing code, index */ + unsigned fill; /* index for replicating entries */ + unsigned low; /* low bits for current root entry */ + unsigned mask; /* mask for low root bits */ + code this; /* table entry for duplication */ + code FAR *next; /* next available space in table */ + const unsigned short FAR *base; /* base value table to use */ + const unsigned short FAR *extra; /* extra bits table to use */ + int end; /* use base and extra for symbol > end */ + unsigned short count[MAXBITS+1]; /* number of codes of each length */ + unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ + static const unsigned short lbase[31] = { /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + static const unsigned short lext[31] = { /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; + static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0}; + static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64}; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) + count[len] = 0; + for (sym = 0; sym < codes; sym++) + count[lens[sym]]++; + + /* bound code lengths, force root to be within code lengths */ + root = *bits; + for (max = MAXBITS; max >= 1; max--) + if (count[max] != 0) break; + if (root > max) root = max; + if (max == 0) { /* no symbols to code at all */ + this.op = (unsigned char)64; /* invalid code marker */ + this.bits = (unsigned char)1; + this.val = (unsigned short)0; + *(*table)++ = this; /* make a table to force an error */ + *(*table)++ = this; + *bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min <= MAXBITS; min++) + if (count[min] != 0) break; + if (root < min) root = min; + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) return -1; /* over-subscribed */ + } + if (left > 0 && (type == CODES || max != 1)) + return -1; /* incomplete set */ + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) + offs[len + 1] = offs[len] + count[len]; + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) + if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked when a LENS table is being made + against the space in *table, ENOUGH, minus the maximum space needed by + the worst case distance code, MAXD. This should never happen, but the + sufficiency of ENOUGH has not been proven exhaustively, hence the check. + This assumes that when type == LENS, bits == 9. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + switch (type) { + case CODES: + base = extra = work; /* dummy value--not used */ + end = 19; + break; + case LENS: + base = lbase; + base -= 257; + extra = lext; + extra -= 257; + end = 256; + break; + default: /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize state for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = *table; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = (unsigned)(-1); /* trigger new sub-table when len > root */ + used = ((unsigned int)1) << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if (type == LENS && used >= ENOUGH - MAXD) + return 1; + + /* process all codes and make table entries */ + for (;;) { + /* create table entry */ + this.bits = (unsigned char)(len - drop); + if ((int)(work[sym]) < end) { + this.op = (unsigned char)0; + this.val = work[sym]; + } + else if ((int)(work[sym]) > end) { + this.op = (unsigned char)(extra[work[sym]]); + this.val = base[work[sym]]; + } + else { + this.op = (unsigned char)(32 + 64); /* end of block */ + this.val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = ((unsigned int)1) << (len - drop); + fill = ((unsigned int)1) << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + next[(huff >> drop) + fill] = this; + } while (fill != 0); + + /* backwards increment the len-bit code huff */ + incr = ((unsigned int)1) << (len - 1); + while (huff & incr) + incr >>= 1; + if (incr != 0) { + huff &= incr - 1; + huff += incr; + } + else + huff = 0; + + /* go to next symbol, update count, len */ + sym++; + if (--(count[len]) == 0) { + if (len == max) break; + len = lens[work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) != low) { + /* if first time, transition to sub-tables */ + if (drop == 0) + drop = root; + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = (int)(1 << curr); + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) break; + curr++; + left <<= 1; + } + + /* check for enough space */ + used += ((unsigned int)1) << curr; + if (type == LENS && used >= ENOUGH - MAXD) + return 1; + + /* point entry in root table to sub-table */ + low = huff & mask; + (*table)[low].op = (unsigned char)curr; + (*table)[low].bits = (unsigned char)root; + (*table)[low].val = (unsigned short)(next - *table); + } + } + + /* + Fill in rest of table for incomplete codes. This loop is similar to the + loop above in incrementing huff for table indices. It is assumed that + len is equal to curr + drop, so there is no loop needed to increment + through high index bits. When the current sub-table is filled, the loop + drops back to the root table to fill in any remaining entries there. + */ + this.op = (unsigned char)64; /* invalid code marker */ + this.bits = (unsigned char)(len - drop); + this.val = (unsigned short)0; + while (huff != 0) { + /* when done with sub-table, drop back to root table */ + if (drop != 0 && (huff & mask) != low) { + drop = 0; + len = root; + next = *table; + this.bits = (unsigned char)len; + } + + /* put invalid code marker in table */ + next[huff >> drop] = this; + + /* backwards increment the len-bit code huff */ + incr = ((unsigned int)1) << (len - 1); + while (huff & incr) + incr >>= 1; + if (incr != 0) { + huff &= incr - 1; + huff += incr; + } + else + huff = 0; + } + + /* set return parameters */ + *table += used; + *bits = root; + return 0; +} + +#endif /* _INFTREES_C */ + +#ifndef _INFFAST_C +#define _INFFAST_C 1 + +/* Allow machine dependent optimization for post-increment or pre-increment. + Based on testing to date, + Pre-increment preferred for: + - PowerPC G3 (Adler) + - MIPS R5000 (Randers-Pehrson) + Post-increment preferred for: + - none + No measurable difference: + - Pentium III (Anderson) + - M68060 (Nikl) + */ +#undef OFF /* (ancient) sunos */ +#ifdef POSTINC +# define OFF 0 +# define PUP(a) *(a)++ +#else +# define OFF 1 +# define PUP(a) *++(a) +#endif + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state->mode == LEN + strm->avail_in >= 6 + strm->avail_out >= 258 + start >= strm->avail_out + state->bits < 8 + + On return, state->mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm->avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm->avail_out >= 258 for each loop to avoid checking for + output space. + */ +void inflate_fast(strm, start) +z_streamp strm; +unsigned start; /* inflate()'s starting value for strm->avail_out */ +{ + struct inflate_state FAR *state; + unsigned char FAR *in; /* local strm->next_in */ + unsigned char FAR *last; /* while in < last, enough input available */ + unsigned char FAR *out; /* local strm->next_out */ + unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ + unsigned char FAR *end; /* while out < end, enough space available */ +#ifdef INFLATE_STRICT + unsigned dmax; /* maximum distance from zlib header */ +#endif + unsigned wsize; /* window size or zero if not using window */ + unsigned whave; /* valid bytes in the window */ + unsigned write; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ + unsigned long hold; /* local strm->hold */ + unsigned bits; /* local strm->bits */ + code const FAR *lcode; /* local strm->lencode */ + code const FAR *dcode; /* local strm->distcode */ + unsigned lmask; /* mask for first level of length codes */ + unsigned dmask; /* mask for first level of distance codes */ + code this; /* retrieved table entry */ + unsigned op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + unsigned len; /* match length, unused bytes */ + unsigned dist; /* match distance */ + unsigned char FAR *from; /* where to copy match from */ + + /* copy state to local variables */ + state = (struct inflate_state FAR *)strm->state; + in = strm->next_in - OFF; + last = in + (strm->avail_in - 5); + out = strm->next_out - OFF; + beg = out - (start - strm->avail_out); + end = out + (strm->avail_out - 257); +#ifdef INFLATE_STRICT + dmax = state->dmax; +#endif + wsize = state->wsize; + whave = state->whave; + write = state->write; + window = state->window; + hold = state->hold; + bits = state->bits; + lcode = state->lencode; + dcode = state->distcode; + lmask = (((unsigned int)1) << state->lenbits) - 1; + dmask = (((unsigned int)1) << state->distbits) - 1; + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + do { + if (bits < 15) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + this = lcode[hold & lmask]; + dolen: + op = (unsigned)(this.bits); + hold >>= op; + bits -= op; + op = (unsigned)(this.op); + if (op == 0) { /* literal */ + Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", this.val)); + PUP(out) = (unsigned char)(this.val); + } + else if (op & 16) { /* length base */ + len = (unsigned)(this.val); + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + len += (unsigned)hold & ((((unsigned int)1) << op) - 1); + hold >>= op; + bits -= op; + } + Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + this = dcode[hold & dmask]; + dodist: + op = (unsigned)(this.bits); + hold >>= op; + bits -= op; + op = (unsigned)(this.op); + if (op & 16) { /* distance base */ + dist = (unsigned)(this.val); + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + } + dist += (unsigned)hold & ((((unsigned int)1) << op) - 1); +#ifdef INFLATE_STRICT + if (dist > dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif + hold >>= op; + bits -= op; + Tracevv((stderr, "inflate: distance %u\n", dist)); + op = (unsigned)(out - beg); /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + from = window - OFF; + if (write == 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + else if (write < op) { /* wrap around window */ + from += wsize + write - op; + op -= write; + if (op < len) { /* some from end of window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = window - OFF; + if (write < len) { /* some from start of window */ + op = write; + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + } + else { /* contiguous in window */ + from += write - op; + if (op < len) { /* some from window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + while (len > 2) { + PUP(out) = PUP(from); + PUP(out) = PUP(from); + PUP(out) = PUP(from); + len -= 3; + } + if (len) { + PUP(out) = PUP(from); + if (len > 1) + PUP(out) = PUP(from); + } + } + else { + from = out - dist; /* copy direct from output */ + do { /* minimum length is three */ + PUP(out) = PUP(from); + PUP(out) = PUP(from); + PUP(out) = PUP(from); + len -= 3; + } while (len > 2); + if (len) { + PUP(out) = PUP(from); + if (len > 1) + PUP(out) = PUP(from); + } + } + } + else if ((op & 64) == 0) { /* 2nd level distance code */ + this = dcode[this.val + (hold & ((((unsigned int)1) << op) - 1))]; + goto dodist; + } + else { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + } + else if ((op & 64) == 0) { /* 2nd level length code */ + this = lcode[this.val + (hold & ((((unsigned int)1) << op) - 1))]; + goto dolen; + } + else if (op & 32) { /* end-of-block */ + Tracevv((stderr, "inflate: end of block\n")); + state->mode = TYPE; + break; + } + else { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + } while (in < last && out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + in -= len; + bits -= len << 3; + hold &= (((unsigned int)1) << bits) - 1; + + /* update state and return */ + strm->next_in = in + OFF; + strm->next_out = out + OFF; + strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); + strm->avail_out = (unsigned)(out < end ? + 257 + (end - out) : 257 - (out - end)); + state->hold = hold; + state->bits = bits; + return; +} + +/* + inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): + - Using bit fields for code structure + - Different op definition to avoid & for extra bits (do & for table bits) + - Three separate decoding do-loops for direct, window, and write == 0 + - Special case for distance > 1 copies to do overlapped load and store copy + - Explicit branch predictions (based on measured branch probabilities) + - Deferring match copy and interspersed it with decoding subsequent codes + - Swapping literal/length else + - Swapping window/direct else + - Larger unrolled copy loops (three is about right) + - Moving len -= 3 statement into middle of loop + */ + +#endif /* _INFFAST_C */ + +#ifndef _INFLATE_C +#define _INFLATE_C 1 + +/* function prototypes */ +local void fixedtables OF((struct inflate_state FAR *state)); +local int updatewindow OF((z_streamp strm, unsigned out)); +#ifdef BUILDFIXED + void makefixed OF((void)); +#endif +local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, + unsigned len)); + +int ZEXPORT inflateReset(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + strm->total_in = strm->total_out = state->total = 0; + strm->msg = Z_NULL; + strm->adler = 1; /* to support ill-conceived Java test suite */ + state->mode = HEAD; + state->last = 0; + state->havedict = 0; + state->dmax = 32768; + state->head = Z_NULL; + state->wsize = 0; + state->whave = 0; + state->write = 0; + state->hold = 0; + state->bits = 0; + state->lencode = state->distcode = state->next = state->codes; + Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +int ZEXPORT inflatePrime(strm, bits, value) +z_streamp strm; +int bits; +int value; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; + value &= (1L << bits) - 1; + state->hold += value << state->bits; + state->bits += bits; + return Z_OK; +} + +int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) +z_streamp strm; +int windowBits; +const char *version; +int stream_size; +{ + struct inflate_state FAR *state; + + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != (int)(sizeof(z_stream))) + return Z_VERSION_ERROR; + if (strm == Z_NULL) return Z_STREAM_ERROR; + strm->msg = Z_NULL; /* in case we return an error */ + if (strm->zalloc == (alloc_func)0) { + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; + } + if (strm->zfree == (free_func)0) strm->zfree = zcfree; + state = (struct inflate_state FAR *) + ZALLOC(strm, 1, sizeof(struct inflate_state)); + if (state == Z_NULL) return Z_MEM_ERROR; + Tracev((stderr, "inflate: allocated\n")); + strm->state = (struct internal_state FAR *)state; + if (windowBits < 0) { + state->wrap = 0; + windowBits = -windowBits; + } + else { + state->wrap = (windowBits >> 4) + 1; +#ifdef GUNZIP + if (windowBits < 48) windowBits &= 15; +#endif + } + if (windowBits < 8 || windowBits > 15) { + ZFREE(strm, state); + strm->state = Z_NULL; + return Z_STREAM_ERROR; + } + state->wbits = (unsigned)windowBits; + state->window = Z_NULL; + return inflateReset(strm); +} + +int ZEXPORT inflateInit_(strm, version, stream_size) +z_streamp strm; +const char *version; +int stream_size; +{ + return inflateInit2_(strm, DEF_WBITS, version, stream_size); +} + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +local void fixedtables(state) +struct inflate_state FAR *state; +{ +#ifndef _INFFIXED_H +#define _INFFIXED_H 1 + static const code lenfix[512] = { + {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, + {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, + {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, + {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, + {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, + {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, + {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, + {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, + {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, + {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, + {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, + {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, + {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, + {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, + {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, + {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, + {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, + {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, + {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, + {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, + {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, + {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, + {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, + {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, + {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, + {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, + {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, + {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, + {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, + {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, + {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, + {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, + {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, + {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, + {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, + {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, + {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, + {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, + {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, + {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, + {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, + {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, + {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, + {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, + {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, + {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, + {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, + {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, + {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, + {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, + {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, + {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, + {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, + {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, + {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, + {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, + {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, + {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, + {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, + {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, + {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, + {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, + {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, + {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, + {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, + {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, + {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, + {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, + {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, + {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, + {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, + {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, + {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, + {0,9,255} + }; + + static const code distfix[32] = { + {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, + {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, + {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, + {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, + {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, + {22,5,193},{64,5,0} + }; +#endif /* _INFFIXED_H */ + state->lencode = lenfix; + state->lenbits = 9; + state->distcode = distfix; + state->distbits = 5; +} + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +local int updatewindow(strm, out) +z_streamp strm; +unsigned out; +{ + struct inflate_state FAR *state; + unsigned copy, dist; + + state = (struct inflate_state FAR *)strm->state; + + /* if it hasn't been done already, allocate space for the window */ + if (state->window == Z_NULL) { + state->window = (unsigned char FAR *) + ZALLOC(strm, ((unsigned int)1) << state->wbits, + sizeof(unsigned char)); + if (state->window == Z_NULL) return 1; + } + + /* if window not in use yet, initialize */ + if (state->wsize == 0) { + state->wsize = ((unsigned int)1) << state->wbits; + state->write = 0; + state->whave = 0; + } + + /* copy state->wsize or less output bytes into the circular window */ + copy = out - strm->avail_out; + if (copy >= state->wsize) { + zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); + state->write = 0; + state->whave = state->wsize; + } + else { + dist = state->wsize - state->write; + if (dist > copy) dist = copy; + zmemcpy(state->window + state->write, strm->next_out - copy, dist); + copy -= dist; + if (copy) { + zmemcpy(state->window, strm->next_out - copy, copy); + state->write = copy; + state->whave = state->wsize; + } + else { + state->write += dist; + if (state->write == state->wsize) state->write = 0; + if (state->whave < state->wsize) state->whave += dist; + } + } + return 0; +} + +/* Macros for inflate(): */ + +/* check function to use adler32() for zlib or crc32() for gzip */ +#ifdef GUNZIP +# define UPDATE(check, buf, len) \ + (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) +#else +# define UPDATE(check, buf, len) adler32(check, buf, len) +#endif + +/* check macros for header crc */ +#ifdef GUNZIP +# define CRC2(check, word) \ + do { \ + hbuf[0] = (unsigned char)(word); \ + hbuf[1] = (unsigned char)((word) >> 8); \ + check = crc32(check, hbuf, 2); \ + } while (0) + +# define CRC4(check, word) \ + do { \ + hbuf[0] = (unsigned char)(word); \ + hbuf[1] = (unsigned char)((word) >> 8); \ + hbuf[2] = (unsigned char)((word) >> 16); \ + hbuf[3] = (unsigned char)((word) >> 24); \ + check = crc32(check, hbuf, 4); \ + } while (0) +#endif + +/* Load registers with state in inflate() for speed */ +#define LOAD() \ + do { \ + put = strm->next_out; \ + left = strm->avail_out; \ + next = strm->next_in; \ + have = strm->avail_in; \ + hold = state->hold; \ + bits = state->bits; \ + } while (0) + +/* Restore state from registers in inflate() */ +#define RESTORE() \ + do { \ + strm->next_out = put; \ + strm->avail_out = left; \ + strm->next_in = next; \ + strm->avail_in = have; \ + state->hold = hold; \ + state->bits = bits; \ + } while (0) + +/* Clear the input bit accumulator */ +#define INITBITS() \ + do { \ + hold = 0; \ + bits = 0; \ + } while (0) + +/* Get a byte of input into the bit accumulator, or return from inflate() + if there is no input available. */ +#define PULLBYTE() \ + do { \ + if (have == 0) goto inf_leave; \ + have--; \ + hold += (unsigned long)(*next++) << bits; \ + bits += 8; \ + } while (0) + +/* Assure that there are at least n bits in the bit accumulator. If there is + not enough available input to do that, then return from inflate(). */ +#define NEEDBITS(n) \ + do { \ + while (bits < (unsigned)(n)) \ + PULLBYTE(); \ + } while (0) + +/* Return the low n bits of the bit accumulator (n < 16) */ +#define BITS(n) \ + ((unsigned)hold & ((((unsigned int)1) << (n)) - 1)) + +/* Remove n bits from the bit accumulator */ +#define DROPBITS(n) \ + do { \ + hold >>= (n); \ + bits -= (unsigned)(n); \ + } while (0) + +/* Remove zero to seven bits as needed to go to a byte boundary */ +#define BYTEBITS() \ + do { \ + hold >>= bits & 7; \ + bits -= bits & 7; \ + } while (0) + +/* Reverse the bytes in a 32-bit value */ +#define REVERSE(q) \ + ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ + (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) + +/* + inflate() uses a state machine to process as much input data and generate as + much output data as possible before returning. The state machine is + structured roughly as follows: + + for (;;) switch (state) { + ... + case STATEn: + if (not enough input data or output space to make progress) + return; + ... make progress ... + state = STATEm; + break; + ... + } + + so when inflate() is called again, the same case is attempted again, and + if the appropriate resources are provided, the machine proceeds to the + next state. The NEEDBITS() macro is usually the way the state evaluates + whether it can proceed or should return. NEEDBITS() does the return if + the requested bits are not available. The typical use of the BITS macros + is: + + NEEDBITS(n); + ... do something with BITS(n) ... + DROPBITS(n); + + where NEEDBITS(n) either returns from inflate() if there isn't enough + input left to load n bits into the accumulator, or it continues. BITS(n) + gives the low n bits in the accumulator. When done, DROPBITS(n) drops + the low n bits off the accumulator. INITBITS() clears the accumulator + and sets the number of available bits to zero. BYTEBITS() discards just + enough bits to put the accumulator on a byte boundary. After BYTEBITS() + and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. + + NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return + if there is no input available. The decoding of variable length codes uses + PULLBYTE() directly in order to pull just enough bytes to decode the next + code, and no more. + + Some states loop until they get enough input, making sure that enough + state information is maintained to continue the loop where it left off + if NEEDBITS() returns in the loop. For example, want, need, and keep + would all have to actually be part of the saved state in case NEEDBITS() + returns: + + case STATEw: + while (want < need) { + NEEDBITS(n); + keep[want++] = BITS(n); + DROPBITS(n); + } + state = STATEx; + case STATEx: + + As shown above, if the next state is also the next case, then the break + is omitted. + + A state may also return if there is not enough output space available to + complete that state. Those states are copying stored data, writing a + literal byte, and copying a matching string. + + When returning, a "goto inf_leave" is used to update the total counters, + update the check value, and determine whether any progress has been made + during that inflate() call in order to return the proper return code. + Progress is defined as a change in either strm->avail_in or strm->avail_out. + When there is a window, goto inf_leave will update the window with the last + output written. If a goto inf_leave occurs in the middle of decompression + and there is no window currently, goto inf_leave will create one and copy + output to the window for the next call of inflate(). + + In this implementation, the flush parameter of inflate() only affects the + return code (per zlib.h). inflate() always writes as much as possible to + strm->next_out, given the space available and the provided input--the effect + documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers + the allocation of and copying into a sliding window until necessary, which + provides the effect documented in zlib.h for Z_FINISH when the entire input + stream available. So the only thing the flush parameter actually does is: + when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it + will return Z_BUF_ERROR if it has not reached the end of the stream. + */ + +int ZEXPORT inflate(strm, flush) +z_streamp strm; +int flush; +{ + struct inflate_state FAR *state; + unsigned char FAR *next; /* next input */ + unsigned char FAR *put; /* next output */ + unsigned have, left; /* available input and output */ + unsigned long hold; /* bit buffer */ + unsigned bits; /* bits in bit buffer */ + unsigned in, out; /* save starting available input and output */ + unsigned copy; /* number of stored or match bytes to copy */ + unsigned char FAR *from; /* where to copy match bytes from */ + code this; /* current decoding table entry */ + code last; /* parent table entry */ + unsigned len; /* length to copy for repeats, bits to drop */ + int ret; /* return code */ +#ifdef GUNZIP + unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ +#endif + static const unsigned short order[19] = /* permutation of code lengths */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || + (strm->next_in == Z_NULL && strm->avail_in != 0)) + return Z_STREAM_ERROR; + + state = (struct inflate_state FAR *)strm->state; + if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ + LOAD(); + in = have; + out = left; + ret = Z_OK; + for (;;) + switch (state->mode) { + case HEAD: + if (state->wrap == 0) { + state->mode = TYPEDO; + break; + } + NEEDBITS(16); +#ifdef GUNZIP + if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ + state->check = crc32(0L, Z_NULL, 0); + CRC2(state->check, hold); + INITBITS(); + state->mode = FLAGS; + break; + } + state->flags = 0; /* expect zlib header */ + if (state->head != Z_NULL) + state->head->done = -1; + if (!(state->wrap & 1) || /* check if zlib header allowed */ +#else + if ( +#endif + ((BITS(8) << 8) + (hold >> 8)) % 31) { + strm->msg = (char *)"incorrect header check"; + state->mode = BAD; + break; + } + if (BITS(4) != Z_DEFLATED) { + strm->msg = (char *)"unknown compression method"; + state->mode = BAD; + break; + } + DROPBITS(4); + len = BITS(4) + 8; + if (len > state->wbits) { + strm->msg = (char *)"invalid window size"; + state->mode = BAD; + break; + } + state->dmax = ((unsigned int)1) << len; + Tracev((stderr, "inflate: zlib header ok\n")); + strm->adler = state->check = adler32(0L, Z_NULL, 0); + state->mode = hold & 0x200 ? DICTID : TYPE; + INITBITS(); + break; +#ifdef GUNZIP + case FLAGS: + NEEDBITS(16); + state->flags = (int)(hold); + if ((state->flags & 0xff) != Z_DEFLATED) { + strm->msg = (char *)"unknown compression method"; + state->mode = BAD; + break; + } + if (state->flags & 0xe000) { + strm->msg = (char *)"unknown header flags set"; + state->mode = BAD; + break; + } + if (state->head != Z_NULL) + state->head->text = (int)((hold >> 8) & 1); + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + state->mode = TIME; + case TIME: + NEEDBITS(32); + if (state->head != Z_NULL) + state->head->time = hold; + if (state->flags & 0x0200) CRC4(state->check, hold); + INITBITS(); + state->mode = OS; + case OS: + NEEDBITS(16); + if (state->head != Z_NULL) { + state->head->xflags = (int)(hold & 0xff); + state->head->os = (int)(hold >> 8); + } + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + state->mode = EXLEN; + case EXLEN: + if (state->flags & 0x0400) { + NEEDBITS(16); + state->length = (unsigned)(hold); + if (state->head != Z_NULL) + state->head->extra_len = (unsigned)hold; + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + } + else if (state->head != Z_NULL) + state->head->extra = Z_NULL; + state->mode = EXTRA; + case EXTRA: + if (state->flags & 0x0400) { + copy = state->length; + if (copy > have) copy = have; + if (copy) { + if (state->head != Z_NULL && + state->head->extra != Z_NULL) { + len = state->head->extra_len - state->length; + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); + } + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + state->length -= copy; + } + if (state->length) goto inf_leave; + } + state->length = 0; + state->mode = NAME; + case NAME: + if (state->flags & 0x0800) { + if (have == 0) goto inf_leave; + copy = 0; + do { + len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->name != Z_NULL && + state->length < state->head->name_max) + state->head->name[state->length++] = len; + } while (len && copy < have); + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + if (len) goto inf_leave; + } + else if (state->head != Z_NULL) + state->head->name = Z_NULL; + state->length = 0; + state->mode = COMMENT; + case COMMENT: + if (state->flags & 0x1000) { + if (have == 0) goto inf_leave; + copy = 0; + do { + len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->comment != Z_NULL && + state->length < state->head->comm_max) + state->head->comment[state->length++] = len; + } while (len && copy < have); + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + if (len) goto inf_leave; + } + else if (state->head != Z_NULL) + state->head->comment = Z_NULL; + state->mode = HCRC; + case HCRC: + if (state->flags & 0x0200) { + NEEDBITS(16); + if (hold != (state->check & 0xffff)) { + strm->msg = (char *)"header crc mismatch"; + state->mode = BAD; + break; + } + INITBITS(); + } + if (state->head != Z_NULL) { + state->head->hcrc = (int)((state->flags >> 9) & 1); + state->head->done = 1; + } + strm->adler = state->check = crc32(0L, Z_NULL, 0); + state->mode = TYPE; + break; +#endif + case DICTID: + NEEDBITS(32); + strm->adler = state->check = REVERSE(hold); + INITBITS(); + state->mode = DICT; + case DICT: + if (state->havedict == 0) { + RESTORE(); + return Z_NEED_DICT; + } + strm->adler = state->check = adler32(0L, Z_NULL, 0); + state->mode = TYPE; + case TYPE: + if (flush == Z_BLOCK) goto inf_leave; + case TYPEDO: + if (state->last) { + BYTEBITS(); + state->mode = CHECK; + break; + } + NEEDBITS(3); + state->last = BITS(1); + DROPBITS(1); + switch (BITS(2)) { + case 0: /* stored block */ + Tracev((stderr, "inflate: stored block%s\n", + state->last ? " (last)" : "")); + state->mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + Tracev((stderr, "inflate: fixed codes block%s\n", + state->last ? " (last)" : "")); + state->mode = LEN; /* decode codes */ + break; + case 2: /* dynamic block */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + state->last ? " (last)" : "")); + state->mode = TABLE; + break; + case 3: + strm->msg = (char *)"invalid block type"; + state->mode = BAD; + } + DROPBITS(2); + break; + case STORED: + BYTEBITS(); /* go to byte boundary */ + NEEDBITS(32); + if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { + strm->msg = (char *)"invalid stored block lengths"; + state->mode = BAD; + break; + } + state->length = (unsigned)hold & 0xffff; + Tracev((stderr, "inflate: stored length %u\n", + state->length)); + INITBITS(); + state->mode = COPY; + case COPY: + copy = state->length; + if (copy) { + if (copy > have) copy = have; + if (copy > left) copy = left; + if (copy == 0) goto inf_leave; + zmemcpy(put, next, copy); + have -= copy; + next += copy; + left -= copy; + put += copy; + state->length -= copy; + break; + } + Tracev((stderr, "inflate: stored end\n")); + state->mode = TYPE; + break; + case TABLE: + NEEDBITS(14); + state->nlen = BITS(5) + 257; + DROPBITS(5); + state->ndist = BITS(5) + 1; + DROPBITS(5); + state->ncode = BITS(4) + 4; + DROPBITS(4); +#ifndef PKZIP_BUG_WORKAROUND + if (state->nlen > 286 || state->ndist > 30) { + strm->msg = (char *)"too many length or distance symbols"; + state->mode = BAD; + break; + } +#endif + Tracev((stderr, "inflate: table sizes ok\n")); + state->have = 0; + state->mode = LENLENS; + case LENLENS: + while (state->have < state->ncode) { + NEEDBITS(3); + state->lens[order[state->have++]] = (unsigned short)BITS(3); + DROPBITS(3); + } + while (state->have < 19) + state->lens[order[state->have++]] = 0; + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 7; + ret = inflate_table(CODES, state->lens, 19, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid code lengths set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: code lengths ok\n")); + state->have = 0; + state->mode = CODELENS; + case CODELENS: + while (state->have < state->nlen + state->ndist) { + for (;;) { + this = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if (this.val < 16) { + NEEDBITS(this.bits); + DROPBITS(this.bits); + state->lens[state->have++] = this.val; + } + else { + if (this.val == 16) { + NEEDBITS(this.bits + 2); + DROPBITS(this.bits); + if (state->have == 0) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + len = state->lens[state->have - 1]; + copy = 3 + BITS(2); + DROPBITS(2); + } + else if (this.val == 17) { + NEEDBITS(this.bits + 3); + DROPBITS(this.bits); + len = 0; + copy = 3 + BITS(3); + DROPBITS(3); + } + else { + NEEDBITS(this.bits + 7); + DROPBITS(this.bits); + len = 0; + copy = 11 + BITS(7); + DROPBITS(7); + } + if (state->have + copy > state->nlen + state->ndist) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + while (copy--) + state->lens[state->have++] = (unsigned short)len; + } + } + + /* handle error breaks in while */ + if (state->mode == BAD) break; + + /* build code tables */ + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 9; + ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid literal/lengths set"; + state->mode = BAD; + break; + } + state->distcode = (code const FAR *)(state->next); + state->distbits = 6; + ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, + &(state->next), &(state->distbits), state->work); + if (ret) { + strm->msg = (char *)"invalid distances set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: codes ok\n")); + state->mode = LEN; + case LEN: + if (have >= 6 && left >= 258) { + RESTORE(); + inflate_fast(strm, out); + LOAD(); + break; + } + for (;;) { + this = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if (this.op && (this.op & 0xf0) == 0) { + last = this; + for (;;) { + this = state->lencode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + this.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(this.bits); + state->length = (unsigned)this.val; + if ((int)(this.op) == 0) { + Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", this.val)); + state->mode = LIT; + break; + } + if (this.op & 32) { + Tracevv((stderr, "inflate: end of block\n")); + state->mode = TYPE; + break; + } + if (this.op & 64) { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + state->extra = (unsigned)(this.op) & 15; + state->mode = LENEXT; + case LENEXT: + if (state->extra) { + NEEDBITS(state->extra); + state->length += BITS(state->extra); + DROPBITS(state->extra); + } + Tracevv((stderr, "inflate: length %u\n", state->length)); + state->mode = DIST; + case DIST: + for (;;) { + this = state->distcode[BITS(state->distbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if ((this.op & 0xf0) == 0) { + last = this; + for (;;) { + this = state->distcode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + this.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(this.bits); + if (this.op & 64) { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + state->offset = (unsigned)this.val; + state->extra = (unsigned)(this.op) & 15; + state->mode = DISTEXT; + case DISTEXT: + if (state->extra) { + NEEDBITS(state->extra); + state->offset += BITS(state->extra); + DROPBITS(state->extra); + } +#ifdef INFLATE_STRICT + if (state->offset > state->dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif + if (state->offset > state->whave + out - left) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + Tracevv((stderr, "inflate: distance %u\n", state->offset)); + state->mode = MATCH; + case MATCH: + if (left == 0) goto inf_leave; + copy = out - left; + if (state->offset > copy) { /* copy from window */ + copy = state->offset - copy; + if (copy > state->write) { + copy -= state->write; + from = state->window + (state->wsize - copy); + } + else + from = state->window + (state->write - copy); + if (copy > state->length) copy = state->length; + } + else { /* copy from output */ + from = put - state->offset; + copy = state->length; + } + if (copy > left) copy = left; + left -= copy; + state->length -= copy; + do { + *put++ = *from++; + } while (--copy); + if (state->length == 0) state->mode = LEN; + break; + case LIT: + if (left == 0) goto inf_leave; + *put++ = (unsigned char)(state->length); + left--; + state->mode = LEN; + break; + case CHECK: + if (state->wrap) { + NEEDBITS(32); + out -= left; + strm->total_out += out; + state->total += out; + if (out) + strm->adler = state->check = + UPDATE(state->check, put - out, out); + out = left; + if (( +#ifdef GUNZIP + state->flags ? hold : +#endif + REVERSE(hold)) != state->check) { + strm->msg = (char *)"incorrect data check"; + state->mode = BAD; + break; + } + INITBITS(); + Tracev((stderr, "inflate: check matches trailer\n")); + } +#ifdef GUNZIP + state->mode = LENGTH; + case LENGTH: + if (state->wrap && state->flags) { + NEEDBITS(32); + if (hold != (state->total & 0xffffffff)) { + strm->msg = (char *)"incorrect length check"; + state->mode = BAD; + break; + } + INITBITS(); + Tracev((stderr, "inflate: length matches trailer\n")); + } +#endif + state->mode = DONE; + case DONE: + ret = Z_STREAM_END; + goto inf_leave; + case BAD: + ret = Z_DATA_ERROR; + goto inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + default: + return Z_STREAM_ERROR; + } + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + inf_leave: + RESTORE(); + if (state->wsize || (state->mode < CHECK && out != strm->avail_out)) + if (updatewindow(strm, out)) { + state->mode = MEM; + return Z_MEM_ERROR; + } + in -= strm->avail_in; + out -= strm->avail_out; + strm->total_in += in; + strm->total_out += out; + state->total += out; + if (state->wrap && out) + strm->adler = state->check = + UPDATE(state->check, strm->next_out - out, out); + strm->data_type = state->bits + (state->last ? 64 : 0) + + (state->mode == TYPE ? 128 : 0); + if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) + ret = Z_BUF_ERROR; + return ret; +} + +int ZEXPORT inflateEnd(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (state->window != Z_NULL) ZFREE(strm, state->window); + ZFREE(strm, strm->state); + strm->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} + +int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) +z_streamp strm; +const Bytef *dictionary; +uInt dictLength; +{ + struct inflate_state FAR *state; + unsigned long id; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (state->wrap != 0 && state->mode != DICT) + return Z_STREAM_ERROR; + + /* check for correct dictionary id */ + if (state->mode == DICT) { + id = adler32(0L, Z_NULL, 0); + id = adler32(id, dictionary, dictLength); + if (id != state->check) + return Z_DATA_ERROR; + } + + /* copy dictionary to window */ + if (updatewindow(strm, strm->avail_out)) { + state->mode = MEM; + return Z_MEM_ERROR; + } + if (dictLength > state->wsize) { + zmemcpy(state->window, dictionary + dictLength - state->wsize, + state->wsize); + state->whave = state->wsize; + } + else { + zmemcpy(state->window + state->wsize - dictLength, dictionary, + dictLength); + state->whave = dictLength; + } + state->havedict = 1; + Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +int ZEXPORT inflateGetHeader(strm, head) +z_streamp strm; +gz_headerp head; +{ + struct inflate_state FAR *state; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; + + /* save header structure */ + state->head = head; +#ifdef GUNZIP + head->done = 0; +#endif + return Z_OK; +} + +/* + Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found + or when out of input. When called, *have is the number of pattern bytes + found in order so far, in 0..3. On return *have is updated to the new + state. If on return *have equals four, then the pattern was found and the + return value is how many bytes were read including the last byte of the + pattern. If *have is less than four, then the pattern has not been found + yet and the return value is len. In the latter case, syncsearch() can be + called again with more data and the *have state. *have is initialized to + zero for the first call. + */ +local unsigned syncsearch(have, buf, len) +unsigned FAR *have; +unsigned char FAR *buf; +unsigned len; +{ + unsigned got; + unsigned next; + + got = *have; + next = 0; + while (next < len && got < 4) { + if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) + got++; + else if (buf[next]) + got = 0; + else + got = 4 - got; + next++; + } + *have = got; + return next; +} + +int ZEXPORT inflateSync(strm) +z_streamp strm; +{ + unsigned len; /* number of bytes to look at or looked at */ + unsigned long in, out; /* temporary to save total_in and total_out */ + unsigned char buf[4]; /* to restore bit buffer to byte string */ + struct inflate_state FAR *state; + + /* check parameters */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; + + /* if first time, start search in bit buffer */ + if (state->mode != SYNC) { + state->mode = SYNC; + state->hold <<= state->bits & 7; + state->bits -= state->bits & 7; + len = 0; + while (state->bits >= 8) { + buf[len++] = (unsigned char)(state->hold); + state->hold >>= 8; + state->bits -= 8; + } + state->have = 0; + syncsearch(&(state->have), buf, len); + } + + /* search available input */ + len = syncsearch(&(state->have), strm->next_in, strm->avail_in); + strm->avail_in -= len; + strm->next_in += len; + strm->total_in += len; + + /* return no joy or set up to restart inflate() on a new block */ + if (state->have != 4) return Z_DATA_ERROR; + in = strm->total_in; out = strm->total_out; + inflateReset(strm); + strm->total_in = in; strm->total_out = out; + state->mode = TYPE; + return Z_OK; +} + +/* + Returns true if inflate is currently at the end of a block generated by + Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP + implementation to provide an additional safety check. PPP uses + Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored + block. When decompressing, PPP checks that at the end of input packet, + inflate is waiting for these length bytes. + */ +int ZEXPORT inflateSyncPoint(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + return state->mode == STORED && state->bits == 0; +} + +int ZEXPORT inflateCopy(dest, source) +z_streamp dest; +z_streamp source; +{ + struct inflate_state FAR *state; + struct inflate_state FAR *copy; + unsigned char FAR *window; + unsigned wsize; + + /* check input */ + if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || + source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)source->state; + + /* allocate space */ + copy = (struct inflate_state FAR *) + ZALLOC(source, 1, sizeof(struct inflate_state)); + if (copy == Z_NULL) return Z_MEM_ERROR; + window = Z_NULL; + if (state->window != Z_NULL) { + window = (unsigned char FAR *) + ZALLOC(source, ((unsigned int)1) << state->wbits, sizeof(unsigned char)); + if (window == Z_NULL) { + ZFREE(source, copy); + return Z_MEM_ERROR; + } + } + + /* copy state */ + zmemcpy(dest, source, sizeof(z_stream)); + zmemcpy(copy, state, sizeof(struct inflate_state)); + if (state->lencode >= state->codes && + state->lencode <= state->codes + ENOUGH - 1) { + copy->lencode = copy->codes + (state->lencode - state->codes); + copy->distcode = copy->codes + (state->distcode - state->codes); + } + copy->next = copy->codes + (state->next - state->codes); + if (window != Z_NULL) { + wsize = ((unsigned int)1) << state->wbits; + zmemcpy(window, state->window, wsize); + } + copy->window = window; + dest->state = (struct internal_state FAR *)copy; + return Z_OK; +} + +#endif /* _INFLATE_C */ + +#ifndef _GZIO_C +#define _GZIO_C 1 + +typedef voidp gzFile; + +#ifndef Z_BUFSIZE +# ifdef MAXSEG_64K +# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */ +# else +# define Z_BUFSIZE 16384 +# endif +#endif +#ifndef Z_PRINTF_BUFSIZE +# define Z_PRINTF_BUFSIZE 4096 +#endif + +#ifdef __MVS__ +# pragma map (fdopen , "\174\174FDOPEN") + FILE *fdopen(int, const char *); +#endif + +#if 0 && !_PACKAGE_ast +#ifndef STDC +extern voidp malloc OF((uInt size)); +extern void free OF((voidpf ptr)); +#endif +#endif + +#define ALLOC(size) malloc(size) +#define TRYFREE(p) {if (p) free(p);} + +static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ + +/* gzip flag byte */ +#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ +#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ +#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ +#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ +#define COMMENT 0x10 /* bit 4 set: file comment present */ +#define RESERVED 0xE0 /* bits 5..7: reserved */ + +typedef struct gz_stream { + z_stream stream; + int z_err; /* error code for last stream operation */ + int z_eof; /* set if end of input file */ + FILE *file; /* .gz file */ + Byte *inbuf; /* input buffer */ + Byte *outbuf; /* output buffer */ + uLong crc; /* crc32 of uncompressed data */ + char *msg; /* error message */ + char *path; /* path name for debugging only */ + int transparent; /* 1 if input file is not a .gz file */ +#if _PACKAGE_ast + int fatal; /* fatal stream error => all other ops fail */ + int nocrc; /* 1 to skip 'r' crc checks */ + int noclose; /* 1 to skip destroy fclose */ + int verified;/* 2-byte magic read and verified ('v') */ +#endif + char mode; /* 'w' or 'r' */ + z_off_t start; /* start of compressed data in file (header skipped) */ + z_off_t in; /* bytes into deflate or inflate */ + z_off_t out; /* bytes out of deflate or inflate */ + int back; /* one character push-back */ + int last; /* true if push-back is last character */ +} gz_stream; + + +local gzFile gz_open OF((const char *path, const char *mode, FILE* fp)); +local int get_byte OF((gz_stream *s)); +local void check_header OF((gz_stream *s)); +local int destroy OF((gz_stream *s)); +local uLong getLong OF((gz_stream *s)); + +/* =========================================================================== + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb"). The file is given either by FILE pointer + or path name (if fp == 0). + gz_open returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). +*/ +local gzFile gz_open (path, mode, fp) + const char *path; + const char *mode; + FILE *fp; +{ + int err; + int level = Z_DEFAULT_COMPRESSION; /* compression level */ + int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */ + char *p = (char*)mode; + gz_stream *s; + char fmode[80]; /* copy of mode, without the compression level */ + char *m = fmode; + + if (!path || !mode) return Z_NULL; + + s = (gz_stream *)ALLOC(sizeof(gz_stream)); + if (!s) return Z_NULL; + + s->stream.zalloc = (alloc_func)0; + s->stream.zfree = (free_func)0; + s->stream.opaque = (voidpf)0; + s->stream.next_in = s->inbuf = Z_NULL; + s->stream.next_out = s->outbuf = Z_NULL; + s->stream.avail_in = s->stream.avail_out = 0; + s->file = NULL; + s->z_err = Z_OK; + s->z_eof = 0; + s->in = 0; + s->out = 0; + s->back = EOF; + s->crc = crc32(0L, Z_NULL, 0); +#if _PACKAGE_ast + s->fatal = 0; + s->nocrc = 0; + s->verified = 0; +#endif + s->msg = NULL; + s->transparent = 0; + + s->path = (char*)ALLOC(strlen(path)+1); + if (s->path == NULL) { + return destroy(s), (gzFile)Z_NULL; + } + strcpy(s->path, path); /* do this early for debugging */ + + s->mode = '\0'; + do { + if (*p == 'r') s->mode = 'r'; + if (*p == 'w' || *p == 'a') s->mode = 'w'; + if (*p >= '0' && *p <= '9') { + level = *p - '0'; + } else if (*p == 'f') { + strategy = Z_FILTERED; + } else if (*p == 'h') { + strategy = Z_HUFFMAN_ONLY; + } else if (*p == 'R') { + strategy = Z_RLE; +#if _PACKAGE_ast + } else if (*p == 'n') { + s->nocrc = 1; + } else if (*p == 'o') { + s->noclose = 1; + } else if (*p == 'v') { + s->verified = 1; +#endif + } else { + *m++ = *p; /* copy the mode */ + } + } while (*p++ && m != fmode + sizeof(fmode)); + if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL; + + if (s->mode == 'w') { +#ifdef NO_GZCOMPRESS + err = Z_STREAM_ERROR; +#else +#if _PACKAGE_ast + s->nocrc = 0; +#endif + err = deflateInit2(&(s->stream), level, + Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy); + /* windowBits is passed < 0 to suppress zlib header */ + + s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); +#endif + if (err != Z_OK || s->outbuf == Z_NULL) { + return destroy(s), (gzFile)Z_NULL; + } + } else { + s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); + + err = inflateInit2(&(s->stream), -MAX_WBITS); + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are + * present after the compressed stream. + */ + if (err != Z_OK || s->inbuf == Z_NULL) { + return destroy(s), (gzFile)Z_NULL; + } + } + s->stream.avail_out = Z_BUFSIZE; + + errno = 0; + + if (!(s->file = fp) && !(s->file = F_OPEN(path, fmode))) { + return destroy(s), (gzFile)Z_NULL; + } + if (s->mode == 'w') { + /* Write a very simple .gz header: + */ + fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1], + Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE); + s->start = 10L; + /* We use 10L instead of ftell(s->file) to because ftell causes an + * fflush on some systems. This version of the library doesn't use + * start anyway in write mode, so this initialization is not + * necessary. + */ + } else { +#if _PACKAGE_ast + sfsetbuf(s->file, (void*)s->file, SF_UNBOUND); +#endif + check_header(s); /* skip the .gz header */ + s->start = ftell(s->file) - s->stream.avail_in; + } + + return (gzFile)s; +} + +/* =========================================================================== + Associate a gzFile with the stdio stream fp. +*/ +gzFile ZEXPORT gzfopen (fp, mode) + FILE* fp; + const char *mode; +{ + FILE* sp = (FILE*)fp; + char name[20]; + + if (!sp) + return (gzFile)Z_NULL; + sprintf(name, "", fileno(sp)); /* for debugging */ + + return gz_open (name, mode, sp); +} + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ +local int get_byte(s) + gz_stream *s; +{ + if (s->z_eof) return EOF; + if (s->stream.avail_in == 0) { + errno = 0; + s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); + if (s->stream.avail_in == 0) { + s->z_eof = 1; + if (ferror(s->file)) s->z_err = Z_ERRNO; + return EOF; + } + s->stream.next_in = s->inbuf; + } + s->stream.avail_in--; + return *(s->stream.next_in)++; +} + +/* =========================================================================== + Check the gzip header of a gz_stream opened for reading. Set the stream + mode to transparent if the gzip magic header is not present; set s->err + to Z_DATA_ERROR if the magic header is present but the rest of the header + is incorrect. + IN assertion: the stream s has already been created sucessfully; + s->stream.avail_in is zero for the first time, but may be non-zero + for concatenated .gz files. +*/ +local void check_header(s) + gz_stream *s; +{ + int method; /* method byte */ + int flags; /* flags byte */ + uInt len; + int c; + +#if _PACKAGE_ast + if (!s->verified) + for (len = 0; len < 2; len++) { + c = get_byte(s); + if (c != gz_magic[len]) { + if (len != 0) s->stream.avail_in++, s->stream.next_in--; + if (c != EOF) { + s->stream.avail_in++, s->stream.next_in--; + s->transparent = 1; + } + s->z_err = s->stream.avail_in != 0 ? Z_OK : Z_STREAM_END; + return; + } + } +#else + /* Assure two bytes in the buffer so we can peek ahead -- handle case + where first byte of header is at the end of the buffer after the last + gzip segment */ + len = s->stream.avail_in; + if (len < 2) { + if (len) s->inbuf[0] = s->stream.next_in[0]; + errno = 0; + len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); + if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO; + s->stream.avail_in += len; + s->stream.next_in = s->inbuf; + if (s->stream.avail_in < 2) { + s->transparent = s->stream.avail_in; + return; + } + } + + /* Peek ahead to check the gzip magic header */ + if (s->stream.next_in[0] != gz_magic[0] || + s->stream.next_in[1] != gz_magic[1]) { + s->transparent = 1; + return; + } + s->stream.avail_in -= 2; + s->stream.next_in += 2; +#endif + + /* Check the rest of the gzip header */ + method = get_byte(s); + flags = get_byte(s); + if (method != Z_DEFLATED || (flags & RESERVED) != 0) { + s->z_err = Z_DATA_ERROR; + return; + } + + /* Discard time, xflags and OS code: */ + for (len = 0; len < 6; len++) (void)get_byte(s); + + if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */ + len = (uInt)get_byte(s); + len += ((uInt)get_byte(s))<<8; + /* len is garbage if EOF but the loop below will quit anyway */ + while (len-- != 0 && get_byte(s) != EOF) ; + } + if ((flags & ORIG_NAME) != 0) { /* skip the original file name */ + while ((c = get_byte(s)) != 0 && c != EOF) ; + } + if ((flags & COMMENT) != 0) { /* skip the .gz file comment */ + while ((c = get_byte(s)) != 0 && c != EOF) ; + } + if ((flags & HEAD_CRC) != 0) { /* skip the header crc */ + for (len = 0; len < 2; len++) (void)get_byte(s); + } + s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK; +} + + /* =========================================================================== + * Cleanup then free the given gz_stream. Return a zlib error code. + Try freeing in the reverse order of allocations. + */ +local int destroy (s) + gz_stream *s; +{ + int err = Z_OK; + + if (!s) return Z_STREAM_ERROR; + + TRYFREE(s->msg); + + if (s->stream.state != NULL) { + if (s->mode == 'w') { +#ifdef NO_GZCOMPRESS + err = Z_STREAM_ERROR; +#else + err = deflateEnd(&(s->stream)); +#endif + } else if (s->mode == 'r') { + err = inflateEnd(&(s->stream)); + } + } +#if _PACKAGE_ast + if (s->file != NULL && (s->noclose ? (s->mode == 'r' ? 0 : fflush(s->file)) : fclose(s->file))) { +#else + if (s->file != NULL && fclose(s->file)) { +#endif +#ifdef ESPIPE + if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */ +#endif + err = Z_ERRNO; + } + if (s->z_err < 0) err = s->z_err; + + TRYFREE(s->inbuf); + TRYFREE(s->outbuf); + TRYFREE(s->path); + TRYFREE(s); + return err; +} + +/* =========================================================================== + Reads the given number of uncompressed bytes from the compressed file. + gzread returns the number of bytes actually read (0 for end of file). +*/ +int ZEXPORT gzread (file, buf, len) + gzFile file; + voidp buf; + unsigned len; +{ + gz_stream *s = (gz_stream*)file; + Bytef *start = (Bytef*)buf; /* starting point for crc computation */ + Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ + + if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR; + + if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1; + if (s->z_err == Z_STREAM_END) return 0; /* EOF */ + + next_out = (Byte*)buf; + s->stream.next_out = (Bytef*)buf; + s->stream.avail_out = len; + + if (s->stream.avail_out && s->back != EOF) { + *next_out++ = s->back; + s->stream.next_out++; + s->stream.avail_out--; + s->back = EOF; + s->out++; + start++; + if (s->last) { + s->z_err = Z_STREAM_END; + return 1; + } + } + + while (s->stream.avail_out != 0) { + + if (s->transparent) { + /* Copy first the lookahead bytes: */ + uInt n = s->stream.avail_in; + if (n > s->stream.avail_out) n = s->stream.avail_out; + if (n > 0) { + zmemcpy(s->stream.next_out, s->stream.next_in, n); + next_out += n; + s->stream.next_out = next_out; + s->stream.next_in += n; + s->stream.avail_out -= n; + s->stream.avail_in -= n; + } + if (s->stream.avail_out > 0) { + s->stream.avail_out -= + (uInt)fread(next_out, 1, s->stream.avail_out, s->file); + } + len -= s->stream.avail_out; + s->in += len; + s->out += len; + if (len == 0) s->z_eof = 1; + return (int)len; + } + if (s->stream.avail_in == 0 && !s->z_eof) { + + errno = 0; + s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); + if (s->stream.avail_in == 0) { + s->z_eof = 1; + if (ferror(s->file)) { + s->z_err = Z_ERRNO; + break; + } + } + s->stream.next_in = s->inbuf; + } + s->in += s->stream.avail_in; + s->out += s->stream.avail_out; + s->z_err = inflate(&(s->stream), Z_NO_FLUSH); + s->in -= s->stream.avail_in; + s->out -= s->stream.avail_out; + + if (s->z_err == Z_STREAM_END) { + /* Check CRC and original size */ +#if _PACKAGE_ast + if (!s->nocrc) +#endif + s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); + start = s->stream.next_out; + +#if _PACKAGE_ast + if (getLong(s) != s->crc && !s->nocrc) { +#else + if (getLong(s) != s->crc) { +#endif + s->z_err = Z_DATA_ERROR; + } else { + (void)getLong(s); + /* The uncompressed length returned by above getlong() may be + * different from s->out in case of concatenated .gz files. + * Check for such files: + */ + check_header(s); + if (s->z_err == Z_OK) { + inflateReset(&(s->stream)); +#if _PACKAGE_ast + if (!s->nocrc) +#endif + s->crc = crc32(0L, Z_NULL, 0); +#if _PACKAGE_ast + else + s->z_err = Z_STREAM_END; +#endif + } + } + } + if (s->z_err != Z_OK || s->z_eof) break; + } +#if _PACKAGE_ast + if (!s->nocrc) +#endif + s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); + + if (len == s->stream.avail_out && + (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) + return -1; + return (int)(len - s->stream.avail_out); +} + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets z_err in case + of error. +*/ +local uLong getLong (s) + gz_stream *s; +{ + uLong x = (uLong)get_byte(s); + int c; + + x += ((uLong)get_byte(s))<<8; + x += ((uLong)get_byte(s))<<16; + c = get_byte(s); + if (c == EOF) s->z_err = Z_DATA_ERROR; + x += ((uLong)c)<<24; + return x; +} + +#endif /* _GZIO_C */ + +#endif /* _GUNZIP_H */ + +#undef local + +#ifndef _RATZ_C +#define _RATZ_C 1 + +#include + +#ifndef S_IRUSR +#define S_IRUSR 0400 +#endif +#ifndef S_IWUSR +#define S_IWUSR 0200 +#endif +#ifndef S_IXUSR +#define S_IXUSR 0100 +#endif +#ifndef S_IRGRP +#define S_IRGRP 0040 +#endif +#ifndef S_IWGRP +#define S_IWGRP 0020 +#endif +#ifndef S_IXGRP +#define S_IXGRP 0010 +#endif +#ifndef S_IROTH +#define S_IROTH 0004 +#endif +#ifndef S_IWOTH +#define S_IWOTH 0002 +#endif +#ifndef S_IXOTH +#define S_IXOTH 0001 +#endif + +/* + * Standard Archive Format + * USTAR - Uniform Standard Tape ARchive + */ + +#define TBLOCK 512 +#define NAMSIZ 100 +#define PFXSIZ 155 + +#define TMODLEN 8 +#define TUIDLEN 8 +#define TGIDLEN 8 +#define TSIZLEN 12 +#define TMTMLEN 12 +#define TCKSLEN 8 + +#define TMAGIC "ustar" /* ustar and a null */ +#define TMAGLEN 6 +#define TVERSION "00" /* 00 and no null */ +#define TVERSLEN 2 +#define TUNMLEN 32 +#define TGNMLEN 32 +#define TDEVLEN 8 +#define TPADLEN 12 + +/* + * values used in typeflag field + */ + +#define REGTYPE '0' /* regular file */ +#define AREGTYPE 0 /* alternate REGTYPE */ +#define LNKTYPE '1' /* hard link */ +#define SYMTYPE '2' /* soft link */ +#define CHRTYPE '3' /* character special */ +#define BLKTYPE '4' /* block special */ +#define DIRTYPE '5' /* directory */ +#define FIFOTYPE '6' /* FIFO special */ +#define CONTTYPE '7' /* reserved */ +#define SOKTYPE '8' /* socket -- reserved */ +#define VERTYPE 'V' /* version -- reserved */ +#define EXTTYPE 'x' /* extended header -- reserved */ + +/* + * bits used in mode field + */ + +#define TSUID 04000 /* set uid on exec */ +#define TSGID 02000 /* set gid on exec */ +#define TSVTX 01000 /* sticky bit -- reserved */ + +/* + * file permissions + */ + +#define TUREAD 00400 /* read by owner */ +#define TUWRITE 00200 /* write by owner */ +#define TUEXEC 00100 /* execute by owner */ +#define TGREAD 00040 /* read by group */ +#define TGWRITE 00020 /* execute by group */ +#define TGEXEC 00010 /* write by group */ +#define TOREAD 00004 /* read by other */ +#define TOWRITE 00002 /* write by other */ +#define TOEXEC 00001 /* execute by other */ + +#define TAR_SUMASK ((1L<<(TCKSLEN-1)*3)-1) + +typedef struct +{ + char name[NAMSIZ]; + char mode[TMODLEN]; + char uid[TUIDLEN]; + char gid[TGIDLEN]; + char size[TSIZLEN]; + char mtime[TMTMLEN]; + char chksum[TCKSLEN]; + char typeflag; + char linkname[NAMSIZ]; + char magic[TMAGLEN]; + char version[TVERSLEN]; + char uname[TUNMLEN]; + char gname[TGNMLEN]; + char devmajor[TDEVLEN]; + char devminor[TDEVLEN]; + char prefix[PFXSIZ]; + char pad[TPADLEN]; +} Header_t; + +static struct +{ + char* id; + unsigned long blocks; + unsigned long files; +} state; + +#if !_PACKAGE_ast + +static void +usage() +{ + fprintf(stderr, "Usage: %s [-clmntvV] < input.tgz\n", state.id); + exit(2); +} + +#endif + +/* + * the X/Open dd EBCDIC table + */ + +static const unsigned char a2e[] = +{ + 0000,0001,0002,0003,0067,0055,0056,0057, + 0026,0005,0045,0013,0014,0015,0016,0017, + 0020,0021,0022,0023,0074,0075,0062,0046, + 0030,0031,0077,0047,0034,0035,0036,0037, + 0100,0132,0177,0173,0133,0154,0120,0175, + 0115,0135,0134,0116,0153,0140,0113,0141, + 0360,0361,0362,0363,0364,0365,0366,0367, + 0370,0371,0172,0136,0114,0176,0156,0157, + 0174,0301,0302,0303,0304,0305,0306,0307, + 0310,0311,0321,0322,0323,0324,0325,0326, + 0327,0330,0331,0342,0343,0344,0345,0346, + 0347,0350,0351,0255,0340,0275,0232,0155, + 0171,0201,0202,0203,0204,0205,0206,0207, + 0210,0211,0221,0222,0223,0224,0225,0226, + 0227,0230,0231,0242,0243,0244,0245,0246, + 0247,0250,0251,0300,0117,0320,0137,0007, + 0040,0041,0042,0043,0044,0025,0006,0027, + 0050,0051,0052,0053,0054,0011,0012,0033, + 0060,0061,0032,0063,0064,0065,0066,0010, + 0070,0071,0072,0073,0004,0024,0076,0341, + 0101,0102,0103,0104,0105,0106,0107,0110, + 0111,0121,0122,0123,0124,0125,0126,0127, + 0130,0131,0142,0143,0144,0145,0146,0147, + 0150,0151,0160,0161,0162,0163,0164,0165, + 0166,0167,0170,0200,0212,0213,0214,0215, + 0216,0217,0220,0152,0233,0234,0235,0236, + 0237,0240,0252,0253,0254,0112,0256,0257, + 0260,0261,0262,0263,0264,0265,0266,0267, + 0270,0271,0272,0273,0274,0241,0276,0277, + 0312,0313,0314,0315,0316,0317,0332,0333, + 0334,0335,0336,0337,0352,0353,0354,0355, + 0356,0357,0372,0373,0374,0375,0376,0377, +}; + +/* + * the X/Open dd IBM table + */ + +static const unsigned char a2i[] = +{ + 0000,0001,0002,0003,0067,0055,0056,0057, + 0026,0005,0045,0013,0014,0015,0016,0017, + 0020,0021,0022,0023,0074,0075,0062,0046, + 0030,0031,0077,0047,0034,0035,0036,0037, + 0100,0132,0177,0173,0133,0154,0120,0175, + 0115,0135,0134,0116,0153,0140,0113,0141, + 0360,0361,0362,0363,0364,0365,0366,0367, + 0370,0371,0172,0136,0114,0176,0156,0157, + 0174,0301,0302,0303,0304,0305,0306,0307, + 0310,0311,0321,0322,0323,0324,0325,0326, + 0327,0330,0331,0342,0343,0344,0345,0346, + 0347,0350,0351,0255,0340,0275,0137,0155, + 0171,0201,0202,0203,0204,0205,0206,0207, + 0210,0211,0221,0222,0223,0224,0225,0226, + 0227,0230,0231,0242,0243,0244,0245,0246, + 0247,0250,0251,0300,0117,0320,0241,0007, + 0040,0041,0042,0043,0044,0025,0006,0027, + 0050,0051,0052,0053,0054,0011,0012,0033, + 0060,0061,0032,0063,0064,0065,0066,0010, + 0070,0071,0072,0073,0004,0024,0076,0341, + 0101,0102,0103,0104,0105,0106,0107,0110, + 0111,0121,0122,0123,0124,0125,0126,0127, + 0130,0131,0142,0143,0144,0145,0146,0147, + 0150,0151,0160,0161,0162,0163,0164,0165, + 0166,0167,0170,0200,0212,0213,0214,0215, + 0216,0217,0220,0232,0233,0234,0235,0236, + 0237,0240,0252,0253,0254,0255,0256,0257, + 0260,0261,0262,0263,0264,0265,0266,0267, + 0270,0271,0272,0273,0274,0275,0276,0277, + 0312,0313,0314,0315,0316,0317,0332,0333, + 0334,0335,0336,0337,0352,0353,0354,0355, + 0356,0357,0372,0373,0374,0375,0376,0377, +}; + +/* + * the mvs OpenEdition EBCDIC table + */ + +static const unsigned char a2o[] = +{ + 0000,0001,0002,0003,0067,0055,0056,0057, + 0026,0005,0025,0013,0014,0015,0016,0017, + 0020,0021,0022,0023,0074,0075,0062,0046, + 0030,0031,0077,0047,0034,0035,0036,0037, + 0100,0132,0177,0173,0133,0154,0120,0175, + 0115,0135,0134,0116,0153,0140,0113,0141, + 0360,0361,0362,0363,0364,0365,0366,0367, + 0370,0371,0172,0136,0114,0176,0156,0157, + 0174,0301,0302,0303,0304,0305,0306,0307, + 0310,0311,0321,0322,0323,0324,0325,0326, + 0327,0330,0331,0342,0343,0344,0345,0346, + 0347,0350,0351,0255,0340,0275,0137,0155, + 0171,0201,0202,0203,0204,0205,0206,0207, + 0210,0211,0221,0222,0223,0224,0225,0226, + 0227,0230,0231,0242,0243,0244,0245,0246, + 0247,0250,0251,0300,0117,0320,0241,0007, + 0040,0041,0042,0043,0044,0045,0006,0027, + 0050,0051,0052,0053,0054,0011,0012,0033, + 0060,0061,0032,0063,0064,0065,0066,0010, + 0070,0071,0072,0073,0004,0024,0076,0377, + 0101,0252,0112,0261,0237,0262,0152,0265, + 0273,0264,0232,0212,0260,0312,0257,0274, + 0220,0217,0352,0372,0276,0240,0266,0263, + 0235,0332,0233,0213,0267,0270,0271,0253, + 0144,0145,0142,0146,0143,0147,0236,0150, + 0164,0161,0162,0163,0170,0165,0166,0167, + 0254,0151,0355,0356,0353,0357,0354,0277, + 0200,0375,0376,0373,0374,0272,0256,0131, + 0104,0105,0102,0106,0103,0107,0234,0110, + 0124,0121,0122,0123,0130,0125,0126,0127, + 0214,0111,0315,0316,0313,0317,0314,0341, + 0160,0335,0336,0333,0334,0215,0216,0337, +}; + +/* + * ascii text vs. control + */ + +static const unsigned char ascii_text[] = +{ + 0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +}; + +static int +block(fp, gz, buf) +FILE* fp; +gzFile gz; +char* buf; +{ + int r; + + if (gz) + r = gzread(gz, buf, sizeof(Header_t)) == sizeof(Header_t); + else + r = fread(buf, sizeof(Header_t), 1, fp) == 1; + if (r) + state.blocks++; + return r; +} + +static int +skip(fp, gz, buf, n) +FILE* fp; +gzFile gz; +char* buf; +unsigned long n; +{ + while (n > 0) + { + if (!block(fp, gz, buf)) + { + fprintf(stderr, "%s: unexpected EOF\n", state.id); + return 1; + } + if (n <= sizeof(Header_t)) + break; + n -= sizeof(Header_t); + } + return 0; +} + +static unsigned long +number(s) +register char* s; +{ + unsigned long n = 0; + + while (*s == ' ') + s++; + while (*s >= '0' && *s <= '7') + n = (n << 3) + (*s++ - '0'); + return n; +} + +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) + +#ifndef PATH_MAX +#define PATH_MAX 256 +#endif + +#define EXIT(n) return(sear_exec((char*)0,(char**)0,(char*)0),(n)) + +static int sear_stdin; +static char* sear_tmp; +static char sear_buf[PATH_MAX]; + +static int +sear_seek(off_t offset, int tmp) +{ + int n; + char cmd[PATH_MAX]; + + GetModuleFileName(NULL, cmd, sizeof(cmd)); + sear_stdin = dup(0); + close(0); + if (open(cmd, O_BINARY|O_RDONLY) || lseek(0, offset, 0) != offset) + { + fprintf(stderr, "%s: %s: cannot seek to data offset\n", state.id, cmd); + return -1; + } + if (tmp) + { + if ((n = GetTempPath(sizeof(cmd), cmd)) <= 0 || n > sizeof(cmd)) + { + fprintf(stderr, "%s: cannot determine temporary directory path\n", state.id); + return -1; + } + if (!GetTempFileName(cmd, "SEA", 0, sear_buf)) + { + fprintf(stderr, "%s: cannot determine temporary file path\n", state.id); + return -1; + } + sear_tmp = sear_buf; + if (!DeleteFile(sear_tmp)) + { + fprintf(stderr, "%s: %s: cannot initialize temporary directory\n", state.id, sear_tmp); + return -1; + } + if (!CreateDirectory(sear_tmp, NULL)) + { + fprintf(stderr, "%s: %s: cannot create temporary directory\n", state.id, sear_tmp); + return -1; + } + if (!SetCurrentDirectory(sear_tmp)) + { + fprintf(stderr, "%s: %s: cannot cd to temporary directory\n", state.id, sear_tmp); + return -1; + } + } + return 0; +} + +/* + * remove dir and its subdirs + */ + +static void +sear_rm_r(char* dir) +{ + WIN32_FIND_DATA info; + HANDLE hp; + + if (!SetCurrentDirectory(dir)) + return; + if ((hp = FindFirstFile("*.*", &info)) != INVALID_HANDLE_VALUE) + { + do + { + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + if (info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) + SetFileAttributes(info.cFileName, info.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY); + DeleteFile(info.cFileName); + } + else if (info.cFileName[0] != '.' || info.cFileName[1] != 0 && (info.cFileName[1] != '.' || info.cFileName[2] != 0)) + sear_rm_r(info.cFileName); + } while(FindNextFile(hp, &info)); + FindClose(hp); + } + if (SetCurrentDirectory("..")) + RemoveDirectory(dir); +} + +/* + * system(3) without PATH search that should work on all windows variants + */ + +static int +sear_system(const char* command, int nowindow) +{ + PROCESS_INFORMATION pinfo; + STARTUPINFO sinfo; + char* cp; + char path[PATH_MAX]; + int n = *command == '"'; + DWORD flags = NORMAL_PRIORITY_CLASS; + + strncpy(path, &command[n], PATH_MAX - 4); + n = n ? '"' : ' '; + for (cp = path; *cp; *cp++) + if (*cp == n) + break; + *cp = 0; + if (GetFileAttributes(path) == 0xffffffff && GetLastError() == ERROR_FILE_NOT_FOUND) + strcpy(cp, ".exe"); + ZeroMemory(&sinfo, sizeof(sinfo)); + if (nowindow) + flags |= CREATE_NO_WINDOW; + if (!CreateProcess(path, (char*)command, 0, 0, TRUE, flags, NULL, NULL, &sinfo, &pinfo)) + n = GetLastError() == ERROR_FILE_NOT_FOUND ? 127 : 126; + else + { + CloseHandle(pinfo.hThread); + WaitForSingleObject(pinfo.hProcess, INFINITE); + if (!GetExitCodeProcess(pinfo.hProcess, &n)) + n = 1; + CloseHandle(pinfo.hProcess); + Sleep(2 * 1000); + } + return n; +} + +/* + * copy t to f but no farther than e + * next t returned + */ + +static char* +copy(char* t, const char* f, char* e) +{ + while (t < e && *f) + *t++ = *f++; + return t; +} + +/* + * execute cmd, chdir .., and remove sear_tmp + */ + +static int +sear_exec(const char* cmd, char* const* arg, char* operands) +{ + const char* a; + char* b; + char* e; + int r; + int sh; + int nowindow; + char buf[1024]; + + fflush(stdout); + fflush(stderr); + if (sear_tmp) + { + close(0); + dup(sear_stdin); + close(sear_stdin); + nowindow = 0; + if (cmd) + { + if (arg) + for (r = 0; arg[r]; r++) + if (!strcmp(arg[r], "remote")) + { + nowindow = 1; + break; + } + sh = 0; + for (a = cmd; *a && *a != ' '; a++) + if (a[0] == '.' && a[1] == 's' && a[2] == 'h' && (!a[3] || a[3] == ' ')) + { + sh = 1; + break; + } + b = buf; + e = buf + sizeof(buf) - 1; + if (sh || arg) + { + if (sh) + { + b = copy(b, "ksh.exe ", e); + if (*cmd && *cmd != '/') + b = copy(b, "./", e); + } + b = copy(b, cmd, e); + while (a = *arg++) + { + if ((e - b) < 3) + break; + b = copy(b, " \"", e); + b = copy(b, a, e); + b = copy(b, "\"", e); + } + } + if (operands) + { + if (b == buf) + b = copy(b, cmd, e); + b = copy(b, " -- ", e); + b = copy(b, operands, e); + } + if (b > buf) + { + *b = 0; + cmd = (const char*)buf; + } + } + r = cmd ? sear_system(cmd, nowindow) : 1; + sear_rm_r(sear_tmp); + } + else + r = cmd ? 0 : 1; + return r; +} + +#else + +#define EXIT(n) return(n) + +#endif + +int +main(argc, argv) +int argc; +char** argv; +{ + register int c; + register char* s; + register char* t; + register char* e; + unsigned long n; + unsigned long m; + const unsigned char* a2x; + int clear; + int list; + int local; + int meter; + int unzip; + int verbose; + unsigned int mode; + unsigned long total; + off_t pos; + gzFile gz; + FILE* fp; + Header_t header; + unsigned char num[4]; + char path[sizeof(header.prefix) + sizeof(header.name) + 4]; + char buf[sizeof(header)]; +#if defined(_SEAR_OPTS) + char* opts[4]; +#endif + +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) + int install = 1; +#endif + + setmode(0, O_BINARY); + setmode(1, O_BINARY); + clear = 0; + list = 0; + local = 0; + meter = 0; + unzip = 0; + verbose = 0; + if (s = *argv) + { + t = s; + while (*s) + if (*s++ == '/') + t = s; + if (!strcmp(t, "gunzip")) + unzip = 1; + state.id = t; + } + else + state.id = "ratz"; + switch ('~') + { + case 0241: + switch ('\n') + { + case 0025: + a2x = a2o; + break; + default: + a2x = a2e; + break; + } + break; + case 0137: + a2x = a2i; + break; + default: + a2x = 0; + break; + } +#if defined(_SEAR_OPTS) + opts[0] = argv[0]; + opts[1] = _SEAR_OPTS; + opts[2] = argv[1]; + opts[3] = 0; + argv = opts; +#endif +#if _PACKAGE_ast + error_info.id = state.id; + for (;;) + { + switch (optget(argv, usage)) + { + case 'c': + unzip = 1; + continue; +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) + case 'i': + install = 0; + continue; +#endif + case 'l': + local = 1; + continue; + case 'm': + meter = 1; + continue; + case 'n': + a2x = 0; + continue; + case 't': + list = 1; + continue; + case 'v': + verbose = 1; + continue; + case 'V': + sfprintf(sfstdout, "%s\n", id + 10); + return 0; + case '?': + error(ERROR_USAGE|4, "%s", opt_info.arg); + continue; + case ':': + error(2, "%s", opt_info.arg); + continue; + } + break; + } + if (error_info.errors) + error(ERROR_USAGE|4, "%s", optusage(NiL)); + argv += opt_info.index; +#else + while ((s = *++argv) && *s == '-' && *(s + 1)) + { + if (*(s + 1) == '-') + { + if (!*(s + 2)) + { + argv++; + break; + } + usage(); + break; + } + for (;;) + { + switch (c = *++s) + { + case 0: + break; + case 'c': + unzip = 1; + continue; +#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) + case 'i': + install = 0; + continue; +#endif + case 'l': + local = 1; + continue; + case 'm': + meter = 1; + continue; + case 'n': + a2x = 0; + continue; + case 't': + list = 1; + continue; + case 'v': + verbose = 1; + continue; + case 'V': + fprintf(stdout, "%s\n", id + 10); + return 0; + default: + fprintf(stderr, "%s: -%c: unknown option\n", state.id, c); + /*FALLTHROUGH*/ + case '?': + usage(); + break; + } + break; + } + } +#endif + +#if defined(_SEAR_SEEK) + if (sear_seek((off_t)_SEAR_SEEK, install && !list)) + { + Sleep(2 * 1000); + return 1; + } +#endif + + /* + * commit on the first gzip magic char + */ + + if ((c = getchar()) == EOF) + EXIT(0); + ungetc(c, stdin); + if (c != gz_magic[0]) + gz = 0; + else if (!(gz = gzfopen(stdin, FOPEN_READ))) + { + fprintf(stderr, "%s: gunzip open error\n", state.id); + EXIT(1); + } + if (unzip) + { + if (!gz) + { + fprintf(stderr, "%s: not a gzip file\n", state.id); + EXIT(1); + } + while ((c = gzread(gz, buf, sizeof(buf))) > 0) + if (fwrite(buf, c, 1, stdout) != 1) + { + fprintf(stderr, "%s: write error\n", state.id); + EXIT(1); + } + if (c < 0) + { + fprintf(stderr, "%s: read error\n", state.id); + EXIT(1); + } + if (fflush(stdout)) + { + fprintf(stderr, "%s: flush error\n", state.id); + EXIT(1); + } + EXIT(0); + } + if (meter) + { + if ((pos = lseek(0, (off_t)0, SEEK_CUR)) < 0) + meter = 0; + else + { + if (lseek(0, (off_t)(-4), SEEK_END) < 0 || read(0, num, 4) != 4) + meter = 0; + else if (!(total = ((num[0]|(num[1]<<8)|(num[2]<<16)|(num[3]<<24)) + sizeof(Header_t) - 1) / sizeof(Header_t))) + total = 1; + lseek(0, pos, SEEK_SET); + } + } + + /* + * loop on all the header blocks + */ + + while (block(stdin, gz, (char*)&header)) + { + /* + * last 2 blocks are NUL + */ + + if (!*header.name) + break; + + /* + * verify the checksum + */ + + s = header.chksum; + e = header.chksum + sizeof(header.chksum); + if (a2x) + { + for (; s < e; s++) + *s = a2x[*(unsigned char*)s]; + s = header.chksum; + } + n = number(s) & TAR_SUMASK; + while (s < e) + *s++ = 040; + m = 0; + s = (char*)&header; + e = (char*)&header + sizeof(header); + while (s < e) + m += *(unsigned char*)s++; + m &= TAR_SUMASK; + if (m != n) + { + if (state.files) + fprintf(stderr, "%s: archive corrupted\n", state.id); + else + fprintf(stderr, "%s: not a tar archive\n", state.id); + fprintf(stderr, "check sum %lu != %lu\n", m, n); + EXIT(1); + } + + /* + * convert to the native charset + */ + + if (a2x) + for (e = (s = (char*)&header) + sizeof(header); s < e; s++) + *s = a2x[*(unsigned char*)s]; + + /* + * get the pathname, type and size + */ + + state.files++; + t = path; + if (!strncmp(header.magic, TMAGIC, sizeof(header.magic)) && *header.prefix) + { + s = header.prefix; + e = header.prefix + sizeof(header.prefix); + while (s < e && (c = *s++)) + *t++ = c; + *t++ = '/'; + } + s = header.name; + e = header.name + sizeof(header.name); + while (s < e && (c = *s++)) + *t++ = c; + *t = 0; + + /* + * verify the dir prefix + */ + + t = 0; + s = path; + while (*s) + if (*s++ == '/') + t = s; + if (t) + { + *--t = 0; + if (!list && access(path, 0)) + { + s = path; + do + { + if (!(c = *s) || c == '/') + { + *s = 0; + if (access(path, 0) && mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) + { + fprintf(stderr, "%s: %s: cannot create directory\n", state.id, path); + EXIT(1); + } + *s = c; + } + } while (*s++); + } + if (*(t + 1)) + *t = '/'; + else + header.typeflag = DIRTYPE; + } + + /* + * check for non-local paths + */ + + if (local && (path[0] == '/' || path[0] == '.' && path[1] == '.' && (!path[2] || path[2] == '/'))) + { + fprintf(stderr, "%s: %s: non-local path rejected", state.id, path); + if ((header.typeflag == REGTYPE || header.typeflag == AREGTYPE) && (n = number(header.size))) + while (n > 0) + { + if (!block(stdin, gz, buf)) + { + fprintf(stderr, "%s: unexpected EOF\n", state.id); + EXIT(1); + } + if (n <= sizeof(header)) + break; + n -= sizeof(header); + } + continue; + } + + /* + * create and grab the data + */ + + n = number(header.mode); + mode = 0; + if (n & TUREAD) + mode |= S_IRUSR; + if (n & TUWRITE) + mode |= S_IWUSR; + if (n & TUEXEC) + mode |= S_IXUSR; + if (n & TGREAD) + mode |= S_IRGRP; + if (n & TGWRITE) + mode |= S_IWGRP; + if (n & TGEXEC) + mode |= S_IXGRP; + if (n & TOREAD) + mode |= S_IROTH; + if (n & TOWRITE) + mode |= S_IWOTH; + if (n & TOEXEC) + mode |= S_IXOTH; + if (list || meter) + { + if (meter) + { + int i; + int j; + int k; + int n; + int p; + char bar[METER_parts + 1]; + + for (s = path; *s; s++) + if (s[0] == ' ' && s[1] == '-' && s[2] == '-' && s[3] == ' ') + break; + if (*s) + { + if (clear) + { + fprintf(stderr, "%*s", clear, "\r"); + clear = 0; + } + fprintf(stderr, "\n%s\n\n", path); + } + else + { + n = (int)strlen(s = path); + p = (state.blocks * 100) / total; + if (n > (METER_width - METER_parts - 1)) + { + s += n - (METER_width - METER_parts - 1); + n = METER_width - METER_parts - 1; + } + j = n + METER_parts + 2; + if (!clear) + clear = j + 5; + if ((k = clear - j - 5) < 0) + k = 0; + if ((i = (p / (100 / METER_parts))) >= sizeof(bar)) + i = sizeof(bar) - 1; + n = 0; + while (n < i) + bar[n++] = '*'; + while (n < sizeof(bar) - 1) + bar[n++] = ' '; + bar[n] = 0; + clear = fprintf(stderr, "%02d%% |%s| %s%*s", p, bar, s, k, "\r"); + } + } + else + { + if (verbose) + { + switch (header.typeflag) + { + case REGTYPE: + case AREGTYPE: + c = '-'; + break; + case DIRTYPE: + c = 'd'; + break; + case LNKTYPE: + c = 'h'; + break; + case SYMTYPE: + c = 'l'; + break; + default: + c = '?'; + break; + } + printf("%c", c); + m = 0400; + while (m) + { + printf("%c", (n & m) ? 'r' : '-'); + m >>= 1; + printf("%c", (n & m) ? 'w' : '-'); + m >>= 1; + printf("%c", (n & m) ? 'x' : '-'); + m >>= 1; + } + printf(" %10lu ", number(header.size)); + } + switch (header.typeflag) + { + case LNKTYPE: + printf("%s == %s\n", path, header.linkname); + break; + case SYMTYPE: + printf("%s => %s\n", path, header.linkname); + break; + default: + printf("%s\n", path); + break; + } + } + if (list) + { + if (skip(stdin, gz, buf, number(header.size))) + EXIT(1); + continue; + } + } + else if (verbose) + printf("%s\n", path); + switch (header.typeflag) + { + case REGTYPE: + case AREGTYPE: + while (!(fp = fopen(path, FOPEN_WRITE))) + if (unlink(path)) + { + fprintf(stderr, "%s: warning: %s: cannot create file\n", state.id, path); + break; + } + n = number(header.size); + c = a2x ? 0 : -1; + while (n > 0) + { + if (!block(stdin, gz, buf)) + { + fprintf(stderr, "%s: unexpected EOF\n", state.id); + EXIT(1); + } + switch (c) + { + case 0: + if ((m = n) < 4) + { + for (e = (s = buf) + m; s < e; s++) + if (a2x[*(unsigned char*)s] != '\n') + break; + } + else + { + if (m > 256) + m = 256; + for (e = (s = buf) + m; s < e; s++) + if (!ascii_text[*(unsigned char*)s]) + break; + } + if (s < e) + { + c = -1; + break; + } + c = 1; + /*FALLTHROUGH*/ + case 1: + for (e = (s = buf) + sizeof(header); s < e; s++) + *s = a2x[*(unsigned char*)s]; + break; + } + if (fp && fwrite(buf, n > sizeof(header) ? sizeof(header) : n, 1, fp) != 1) + { + fprintf(stderr, "%s: %s: write error\n", state.id, path); + EXIT(1); + } + if (n <= sizeof(header)) + break; + n -= sizeof(header); + } + if (fp && fclose(fp)) + { + fprintf(stderr, "%s: %s: write error\n", state.id, path); + EXIT(1); + } + break; + case DIRTYPE: + if (access(path, 0) && mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) + { + fprintf(stderr, "%s: %s: cannot create directory\n", state.id, path); + EXIT(1); + } + break; + case SYMTYPE: +#if defined(S_IFLNK) || defined(S_ISLNK) + while (symlink(header.linkname, path)) + if (unlink(path)) + { + fprintf(stderr, "%s: %s: cannot symlink to %s\n", state.id, path, header.linkname); + EXIT(1); + } + continue; +#endif +#if !_WIN32 || _WINIX + case LNKTYPE: + while (link(header.linkname, path)) + if (unlink(path)) + { + fprintf(stderr, "%s: %s: cannot link to %s\n", state.id, path, header.linkname); + EXIT(1); + } + continue; +#endif + default: + fprintf(stderr, "%s: %s: file type %c ignored\n", state.id, path, header.typeflag); + if (skip(stdin, gz, buf, number(header.size))) + EXIT(1); + continue; + } + if (chmod(path, mode)) + fprintf(stderr, "%s: %s: cannot change mode to %03o\n", state.id, path, mode); + } + if (clear) + fprintf(stderr, "%*s", clear, "\r"); + if (!state.files) + fprintf(stderr, "%s: warning: empty archive\n", state.id); + else if (verbose) + fprintf(stderr, "%lu file%s, %lu block%s\n", state.files, state.files == 1 ? "" : "s", state.blocks, state.blocks == 1 ? "" : "s"); +#if defined(_SEAR_EXEC) +#if !defined(_SEAR_ARGS) +#define _SEAR_ARGS 0 +#endif + if (install && sear_exec(_SEAR_EXEC, argv, _SEAR_ARGS)) + { + Sleep(2 * 1000); + return 1; + } +#endif + return 0; +} + +#endif /* _RATZ_C */ diff --git a/src/cmd/INIT/regress.sh b/src/cmd/INIT/regress.sh new file mode 100644 index 0000000..a4417c4 --- /dev/null +++ b/src/cmd/INIT/regress.sh @@ -0,0 +1,1463 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2012 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: regress - run regression tests in command.tst + +command=regress +case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in +0123) USAGE=$' +[-? +@(#)$Id: regress (AT&T Research) 2012-02-02 $ +] +'$USAGE_LICENSE$' +[+NAME?regress - run regression tests] +[+DESCRIPTION?\bregress\b runs the tests in \aunit\a, or + \aunit\a\b.tst\b if \aunit\a does not exist. If \acommand\a is omitted + then it is assumed to be the base name of \aunit\a. All testing is done + in the temporary directory \aunit\a\b.tmp\b.] +[+?Default test output lists the \anumber\a and \adescription\a for + each active \bTEST\b group and the \anumber\a:\aline\a for each + individual \bEXEC\b test. Each test that fails results in a diagnostic + that contains the word \bFAILED\b; no other diagnostics contain this + word.] +[b:ignore-space?Ignore space differences when comparing expected + output.] +[i:pipe-input?Repeat each test with the standard input redirected through a + pipe.] +[k:keep?Enable \bcore\b dumps, exit after the first test that fails, + and do not remove the temporary directory \aunit\a\b.tmp\b.] +[l:local-fs?Force \aunit\a\b.tmp\b to be in a local filesystem.] +[o:pipe-output?Repeat each test with the standard output redirected through + a pipe.] +[p:pipe-io?Repeat each test with the standard input and standard output + redirected through pipes.] +[q:quiet?Output information on \bFAILED\b tests only.] +[r!:regular?Run each test with the standard input and standard output + redirected through regular files.] +[t:test?Run only tests matching \apattern\a. Tests are numbered and + consist of at least two digits (0 filled if necessary.) Tests matching + \b+(0)\b are always run.]:[pattern] +[x:trace?Enable debug tracing.] +[v:verbose?List differences between actual (<) and expected (>) output, + errors and exit codes. Also disable long output line truncation.] + +unit [ command [ arg ... ] ] + +[+INPUT FILES?The regression test file \aunit\a\b.tst\b is a \bksh\b(1) + script that is executed in an environment with the following functions + defined:] + { + [+BODY \b{ ... }?Defines the test body; used for complex tests.] + [+CD \b\adirectory\a?Create and change to working directory for + one test.] + [+CLEANUP \b\astatus\a?Called at exit time to remove the + temporary directory \aunit\a\b.tmp\b, list the tests totals via + \bTALLY\b, and exit with status \astatus\a.] + [+COMMAND \b\aarg\a ...?Runs the current command under test with + \aarg\a ... appended to the default args.] + [+CONTINUE?The background job must be running.] + [+COPY \b\afrom to\a?Copy file \afrom\a to \ato\a. \afrom\a may + be a regular file or \bINPUT\b, \bOUTPUT\b or \bERROR\b. Post + test comparisons are still done for \afrom\a.] + [+DIAGNOSTICS \b[ \b1\b | \b0\b | \apattern\a ]]?No argument or an + argument of \b1\b declares that diagnostics are to expected for + the remainder of the current \bTEST\b; \b0\b reverts to the default + state that diagnostics are not expected; otherwise the argument + is a \bksh\b(1) pattern that must match the non-empty contents + of the standard error.] + [+DO \b\astatement\a?Defines additional statements to be executed + for the current test. \astatement\a may be a { ... } group.] + [+EMPTY \bINPUT|OUTPUT|ERROR|SAME?The corresponding file is + expected to be empty.] + [+ERROR \b[ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?The + standard error is expected to match either the contents + of \afile\a or the line \adata\a. \bERROR -n\b does not + append a newline to \adata\a. \afilter\a is a shell command + or pipeline that reads standard input and writes standard + output that is applied to ERROR before comparison with the + expected contents.] + [+EXEC \b[ \aarg\a ... ]]?Runs the command under test with + optional arguments. \bINPUT\b, \bOUTPUT\b, \bERROR\b, \bEXIT\b + and \bSAME\b calls following this \bEXEC\b up until the next + \bEXEC\b or the end of the script provide details for the + expected results. If no arguments are specified then the + arguments from the previious \bEXEC\b in the current \bTEST\b + group are used, or no arguments if this is the first \bEXEC\b + in the group.] + [+EXIT \b\astatus\a?The command exit status is expected to match + the pattern \astatus\a.] + [+EXITED?The background job must have exited.] + [+EXPORT \b[-]] \aname\a=\avalue\a ...?Export environment + variables for one test.] + [+FATAL \b\amessage\a ...?\amessage\a is printed on the standard + error and \bregress\b exits with status \b1\b.] + [+FIFO \bINPUT|OUTPUT|ERROR\b [ \b-n\b ]] \afile\a | - \adata\a ...?The + \bIO\B file is a fifo.] + [+IF \b\acommand\a [\anote\a]]?If the \bsh\b(1) \acommand\a exits + 0 then tests until the next \bELIF\b, \bELSE\b or \bFI\b are + enabled. Otherwise those tests are skipped. \bIF\b ... \bFI\b + may be nested, but must not cross \bTEST\b boundaries. \anote\a + is listed on the standard error if the correspoding test block + is enabled; \bIF\b, \bELIF\b, \bELSE\b may nave a \anote\a + operand.] + [+IGNORE \b\afile\a ...?\afile\a is ignored for subsequent result + comparisons. \afile\a may be \bOUTPUT\b or \bERROR\b.] + [+IGNORESPACE?Ignore space differences when comparing expected + output.] + [+INCLUDE \b\afile\a ...?One or more \afile\a operands are read + via the \bksh\b(1) \b.\b(1) command. \bVIEW\b is used to locate + the files.] + [+INFO \b\adescription\a?\adescription\a is printed on the + standard error.] + [+INITIALIZE?Called by \bregress\b to initialize a each + \bTEST\b group.] + [+INPUT \b[ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?The + standard input is set to either the contents of \afile\a + or the line \adata\a. \bINPUT -n\b does not append a newline + to \adata\a. \afilter\a is a shell command or pipeline that + reads standard input and writes standard output that is + applied to OUTPUT before comparison with the expected contents.] + [+INTRO?Called by \bregress\b to introduce all \bTEST\b + groups.] + [+IO \b[ \bFIFO\b | \bPIPE\b ]] \bINPUT|OUTPUT|ERROR\b [ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?Internal + support for the \bINPUT\b, \bOUTPUT\b and \bERROR\b functions.] + [+JOB \b\aop\a [ ... ]]?Like \bEXEC\b except the command is run + as a background job for the duration of the group or until it + is killed via \bKILL\b.] + [+KEEP \b\apattern\a ...?The temporary directory is cleared for + each test. Files matching \apattern\a are retained between + tests.] + [+KILL \b[ \asignal\a ]]?Kill the background job with \asignal\a + [ \bSIGKILL\b ]].] + [+MOVE \b\afrom to\a?Rename file \afrom\a to \ato\a. \afrom\a may + be a regular file or \bINPUT\b, \bOUTPUT\b or \bERROR\b. Post + test comparisons are ignored for \afrom\a.] + [+NOTE \b\acomment\a?\acomment\a is added to the current test + trace output.] + [+OUTPUT \b[ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?The + standard output is expected to match either the contents + of \afile\a or the line \adata\a. \bOUTPUT -n\b does not + append a newline to \adata\a. \afilter\a is a shell command + or pipeline that reads standard input and writes standard + output that is applied to ERROR before comparison with the + expected contents.] + [+PIPE \bINPUT|OUTPUT|ERROR\b [ \b-n\b ]] \afile\a | - \adata\a ...?The + \bIO\B file is a pipe.] + [+PROG \b\acommand\a [ \aarg\a ... ]]?\acommand\a is run with + optional arguments.] + [+REMOVE \b\afile\a ...?\afile\a ... are removed after the + current test is done.] + [+RUN?Called by \bregress\b to run the current test.] + [+SAME \b\anew old\a?\anew\a is expected to be the same as + \aold\a after the current test completes.] + [+SET \b[\bno\b]]\aname\a[=\avalue\a]]?Set the command line + option --\aname\a. The setting is in effect for all tests until + the next explicit \bSET\b.] + [+TALLY?Called by \bregress\b display the \bTEST\b results.] + [+TEST \b\anumber\a [ \adescription\a ... ]]?Define a new test + group labelled \anumber\a with optional \adescripion\a.] + [+TITLE \b[+]] \atext\a?Set the \bTEST\b output title to + \atext\a. If \b+\b is specified then \atext\a is appended to + the default title. The default title is the test file base + name, and, if different from the test file base name, the test + unit base name.] + [+TWD \b[ \adir\a ... ]]?Set the temporary test dir to \adir\a. + The default is \aunit\a\b.tmp\b, where \aunit\a is the test + input file sans directory and suffix. If \adir\a matches \b/*\b + then it is the directory name; if \adir\a is non-null then the + prefix \b${TMPDIR:-/tmp}\b is added; otherwise if \adir\a is + omitted then + \b${TMPDIR:-/tmp}/tst-\b\aunit\a-$$-$RANDOM.\b\aunit\a is + used.] + [+UMASK \b[ \amask\a ]]?Run subsequent tests with \bumask\b(1) + \amask\a. If \amask\a is omitted then the original \bumask\b is + used.] + [+UNIT \b\acommand\a [ \aarg\a ... ]]?Define the command and + optional default arguments to be tested. \bUNIT\b explicitly + overrides the default command name derived from the test script + file name. A \acommand\a operand with optional arguments + overrides the \bUNIT\b \acommand\a and arguments, with the + exception that if the \bUNIT\b \acommand\a is \b-\b or \b+\b + the \bUNIT\b arguments are appended to the operand or default + unit command and arguments.] + [+VIEW \b\avar\a [ \afile\a ]]?\avar\a is set to the full + pathname of \avar\a [ \afile\a ]] in the current \b$VPATH\b + view if defined.] + } +[+SEE ALSO?\bnmake\b(1), \bksh\b(1)] +' + ;; +*) USAGE='ko:[[no]name[=value]]t:[test]v unit [path [arg ...]]' + ;; +esac + +function FATAL # message +{ + print -r -u2 "$command: $*" + GROUP=FINI + exit 1 +} + +function EMPTY +{ + typeset i + typeset -n ARRAY=$1 + for i in ${!ARRAY[@]} + do unset ARRAY[$i] + done +} + +function INITIALIZE # void +{ + typeset i j + cd "$TWD" + case $KEEP in + "") RM * + ;; + *) for i in * + do case $i in + !($KEEP)) j="$j $i" ;; + esac + done + case $j in + ?*) RM $j ;; + esac + ;; + esac + : >INPUT >OUTPUT.ex >ERROR.ex + BODY="" + COPY="" + DIAGNOSTICS="" + DONE="" + ERROR="" + EXIT=0 + IGNORE="" + INIT="" + INPUT="" + MOVE="" + OUTPUT="" + EMPTY FILE + EMPTY FILTER + EMPTY SAME + EMPTY TYPE +} + +function INTRO +{ + typeset base command + + if [[ ! $TEST_quiet ]] + then base=${REGRESS##*/} + base=${base%.tst} + command=${COMMAND##*/} + command=${command%' '*} + set -- $TITLE + TITLE= + case $1 in + ''|+) if [[ $command == $base ]] + then TITLE=$COMMAND + else TITLE="$COMMAND, $base" + fi + if (( $# )) + then shift + fi + ;; + esac + while (( $# )) + do if [[ $TITLE ]] + then TITLE="$TITLE, $1" + else TITLE="$1" + fi + shift + done + print -u2 "TEST $TITLE" + fi +} + +function TALLY # extra message text +{ + typeset msg + case $GROUP in + INIT) ;; + *) msg="TEST $TITLE, $TESTS test" + case $TESTS in + 1) ;; + *) msg=${msg}s ;; + esac + msg="$msg, $ERRORS error" + case $ERRORS in + 1) ;; + *) msg=${msg}s ;; + esac + if (( $# )) + then msg="$msg, $*" + fi + print -u2 "$msg" + GROUP=INIT + TESTS=0 + ERRORS=0 + ;; + esac +} + +function TITLE # text +{ + TITLE=$@ +} + +function UNWIND +{ + while (( COND > 1 )) + do print -r -u2 "$command: line $LINE: no matching FI for IF on line ${COND_LINE[COND]}" + (( COND-- )) + done + if (( COND > 0 )) + then (( COND = 0 )) + FATAL "line $LINE: no matching FI for IF on line ${COND_LINE[COND+1]}" + fi + if [[ $JOBPID ]] + then if [[ $JOBPID != 0 ]] + then kill -KILL $JOBPID 2>/dev/null + wait + fi + JOBPID= + fi + JOBSTATUS= + JOBOP= + wait +} + +function CLEANUP # status +{ + typeset note + + if [[ $GROUP != INIT ]] + then if [[ ! $TEST_keep ]] + then cd $SOURCE + if [[ $TEST_local ]] + then RM ${TEST_local} + fi + RM "$TWD" + fi + if (( $1 )) && [[ $GROUP != FINI ]] + then note=terminated + fi + fi + TALLY $note + [[ $TEST_keep ]] || UNWIND + exit $1 +} + +function RUN # [ op ] +{ + typeset i r=1 + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK_ORIG +#print -u2 AHA#$LINENO $0 GROUP=$GROUP ITEM=$ITEM FLUSHED=$FLUSHED JOBOP=$JOBOP + case $GROUP in + INIT) RM "$TWD" + if [[ $TEST_local ]] + then TEST_local=${TMPDIR:-/tmp}/rt-$$/${TWD##*/} + mkdir -p "$TEST_local" && ln -s "$TEST_local" "$TWD" || FATAL "$TWD": cannot create directory + TEST_local=${TEST_local%/*} + else mkdir "$TWD" || FATAL "$TWD": cannot create directory + fi + cd "$TWD" + TWD=$PWD + : > rmu + if rm -u rmu >/dev/null 2>&1 + then TEST_rmu=-u + else rm rmu + fi + if [[ $UNIT ]] + then set -- "${ARGV[@]}" + case $1 in + ""|[-+]*) + UNIT $UNIT "${ARGV[@]}" + ;; + *) UNIT "${ARGV[@]}" + ;; + esac + fi + INTRO + ;; + FINI) ;; + $TEST_select) + if [[ $ITEM == $FLUSHED ]] + then return 0 + fi + FLUSHED=$ITEM + if (( COND_SKIP[COND] )) + then return 1 + fi + ((COUNT++)) + if (( $ITEM <= $LASTITEM )) + then LABEL=$TEST#$COUNT + else LASTITEM=$ITEM + LABEL=$TEST:$ITEM + fi + TEST_file="" + exec >/dev/null + for i in $INPUT + do case " $OUTPUT " in + *" $i "*) + if [[ -f $i.sav ]] + then cp $i.sav $i + COMPARE="$COMPARE $i" + elif [[ -f $i ]] + then cp $i $i.sav + COMPARE="$COMPARE $i" + fi + ;; + esac + done + for i in $OUTPUT + do case " $COMPARE " in + *" $i "*) + ;; + *) COMPARE="$COMPARE $i" + ;; + esac + done + for i in $INIT + do $i $TEST INIT + done +#print -u2 AHA#$LINENO $0 GROUP=$GROUP ITEM=$ITEM JOBOP=$JOBOP JOBPID=$JOBPID JOBSTATUS=$JOBSTATUS + if [[ $JOBPID != 0 && ( $JOBPID || $JOBSTATUS ) ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + RESULTS + elif [[ $BODY ]] + then SHOW=$NOTE + if [[ ! $TEST_quiet ]] + then print -r -u2 " $SHOW" + fi + for i in $BODY + do $i $TEST BODY + done + else SHOW= + if [[ ${TYPE[INPUT]} == PIPE ]] + then if [[ ${TYPE[OUTPUT]} == PIPE ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + cat <$TWD/INPUT | COMMAND "${ARGS[@]}" | cat >$TWD/OUTPUT + RESULTS 'pipe input' + else if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + cat <$TWD/INPUT | COMMAND "${ARGS[@]}" >$TWD/OUTPUT + RESULTS 'pipe io' + fi + elif [[ ${TYPE[OUTPUT]} == PIPE ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + COMMAND "${ARGS[@]}" <$TWD/INPUT | cat >$TWD/OUTPUT + RESULTS 'pipe output' + else if [[ $TEST_regular ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + if [[ ${TYPE[INPUT]} == FIFO ]] + then COMMAND "${ARGS[@]}" >$TWD/OUTPUT + else COMMAND "${ARGS[@]}" <$TWD/INPUT >$TWD/OUTPUT + fi + RESULTS + fi + if [[ $TEST_pipe_input ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + (trap '' PIPE; cat <$TWD/INPUT 2>/dev/null; exit 0) | COMMAND "${ARGS[@]}" >$TWD/OUTPUT + STATUS=$? + RESULTS 'pipe input' + fi + if [[ $TEST_pipe_output ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + COMMAND "${ARGS[@]}" <$TWD/INPUT | cat >$TWD/OUTPUT + STATUS=$? + RESULTS 'pipe output' + fi + if [[ $TEST_pipe_io ]] + then if [[ ! $TEST_quiet ]] + then print -nu2 "$LABEL" + fi + (trap '' PIPE; cat <$TWD/INPUT 2>/dev/null; exit 0) | COMMAND "${ARGS[@]}" | cat >$TWD/OUTPUT + STATUS=$? + RESULTS 'pipe io' + fi + fi + set -- $COPY + COPY="" + while : + do case $# in + 0|1) break ;; + *) cp $1 $2 ;; + esac + shift 2 + done + set -- $MOVE + MOVE="" + while (( $# > 1 )) + do mv $1 $2 + shift 2 + done + fi + for i in $DONE + do $i $TEST DONE $STATUS + done + COMPARE="" + r=0 + ;; + esac + if [[ $COMMAND_ORIG ]] + then COMMAND=$COMMAND_ORIG + COMMAND_ORIG= + ARGS=(${ARGS_ORIG[@]}) + fi + return $r +} + +function DO # cmd ... +{ + [[ $GROUP == $TEST_select ]] || return 1 + (( COND_SKIP[COND] )) && return 1 + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK + return 0 +} + +function UNIT # cmd arg ... +{ + typeset cmd=$1 + case $cmd in + [-+]) shift + if (( UNIT_READONLY )) + then COMMAND="$COMMAND $*" + else #BUG# ARGV=("${ARGV[@]}" "$@") + set -- "${ARGV[@]}" "$@" + ARGV=("$@") + fi + return + ;; + esac + (( UNIT_READONLY )) && return + if [[ $UNIT ]] && (( $# <= 1 )) + then set -- "${ARGV[@]}" + case $1 in + "") set -- "$cmd" ;; + [-+]*) set -- "$cmd" "${ARGV[@]}" ;; + *) cmd=$1 ;; + esac + fi + UNIT= + COMMAND=$cmd + shift + typeset cmd=$(whence $COMMAND) + if [[ ! $cmd ]] + then FATAL $COMMAND: not found + elif [[ ! $cmd ]] + then FATAL $cmd: not found + fi + case $# in + 0) ;; + *) COMMAND="$COMMAND $*" ;; + esac +} + +function TWD # [ dir ] +{ + case $1 in + '') TWD=${TWD##*/}; TWD=${TMPDIR:-/tmp}/tst-${TWD%.*}-$$-$RANDOM ;; + /*) TWD=$1 ;; + *) TWD=${TMPDIR:-/tmp}/$1 ;; + esac +} + +function TEST # number description arg ... +{ + RUN + LINE=$TESTLINE + UNWIND + COUNT=0 + LASTITEM=0 + case $1 in + -) ((LAST++)); TEST=$LAST ;; + +([0123456789])) LAST=$1 TEST=$1 ;; + *) LAST=0${1/[!0123456789]/} TEST=$1 ;; + esac + NOTE= + if [[ ! $TEST_quiet && $TEST == $TEST_select ]] && (( ! COND_SKIP[COND] )) + then print -r -u2 "$TEST $2" + fi + unset ARGS + unset EXPORT + EXPORTS=0 + TEST_file="" + if [[ $TEST != ${GROUP}* ]] + then GROUP=${TEST%%+([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ])} + if [[ $GROUP == $TEST_select ]] && (( ! COND_SKIP[COND] )) + then INITIALIZE + fi + fi + ((SUBTESTS=0)) + [[ $TEST == $TEST_select ]] && (( ! COND_SKIP[COND] )) +} + +function EXEC # arg ... +{ + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + if ((SUBTESTS++)) + then RUN + fi + case $# in + 0) set -- "${ARGS[@]}" ;; + esac + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- $COMMAND_ORIG "$@")${JOBPID:+&}" + ARGS=("$@") +} + +function JOB # arg ... +{ + JOBPID=0 + EXEC "$@" +} + +function CONTINUE +{ + RUN || return + JOBOP=CONTINUE + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- $JOBOP)" +#print -u2 AHA#$LINENO JOBOP=$JOBOP ITEM=$ITEM NOTE=$NOTE +} + +function EXITED +{ + RUN || return + JOBOP=EXITED + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- $JOBOP)" +#print -u2 AHA#$LINENO JOBOP=$JOBOP ITEM=$ITEM NOTE=$NOTE +} + +function KILL # [ signal ] +{ + RUN || return + JOBOP=$2 + [[ $JOBOP ]] || JOBOP=KILL + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- $JOBOP)" +} + +function CD +{ + RUN + if [[ $GROUP == $TEST_select ]] && (( ! COND_SKIP[COND] )) + then mkdir -p "$@" && cd "$@" || FATAL cannot initialize working directory "$@" + fi +} + +function EXPORT +{ + typeset x n v + if [[ $GROUP == INIT ]] + then for x + do n=${x%%=*} + v=${x#*=} + ENVIRON[ENVIRONS++]=$n="'$v'" + done + else RUN + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + for x + do n=${x%%=*} + v=${x#*=} + EXPORT[EXPORTS++]=$n="'$v'" + done + fi +} + +function FLUSH +{ + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + if ((SUBTESTS++)) + then RUN + fi +} + +function PROG # cmd arg ... +{ + typeset command args + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + ITEM=$LINE + NOTE="$(print -r -f '%q ' -- "$@")" + COMMAND_ORIG=$COMMAND + COMMAND=$1 + shift + ARGS_ORIG=(${ARGS[@]}) + ARGS=("$@") +} + +function NOTE # description +{ + NOTE=$* +} + +function IO # [ PIPE ] INPUT|OUTPUT|ERROR [-f*|-n] file|- data ... +{ + typeset op i v f file type x + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK_ORIG + while : + do case $1 in + FIFO|PIPE) type=$1; shift ;; + *) break ;; + esac + done + op=$1 + shift + [[ $type ]] && TYPE[$op]=$type + FILTER[$op]= + file=$TWD/$op + while : + do case $1 in + -x) x=1 + shift + ;; + -e) (( $# > 1 )) && shift + FILTER[$op]=$1 + shift + ;; + -e*) FILTER[$op]=${1#-e} + shift + ;; + -f*|-n) f=$1 + shift + ;; + *) break + ;; + esac + done + case $# in + 0) ;; + *) case $1 in + -) ;; + *) file=$1 + eval i='$'$op + case " $i " in + *" $file "*) + ;; + *) eval $op='"$'$op' $file"' + ;; + esac + ;; + esac + shift + ;; + esac + case " $IGNORE " in + *" $file "*) + for i in $IGNORE + do case $i in + $file) ;; + *) v="$v $i" ;; + esac + done + IGNORE=$v + ;; + esac + FILE[$op]=$file + case $op in + OUTPUT|ERROR) + file=$file.ex + if [[ $file != /* ]] + then file=$TWD/$file + fi + ;; + esac + #unset SAME[$op] + SAME[$op]= + if [[ $file == /* ]] + then RM $file.sav + else RM $TWD/$file.sav + fi + if [[ $file == */* ]] + then mkdir -p ${file%/*} + fi + if [[ $file != */ ]] + then if [[ $type == FIFO ]] + then rm -f $file + mkfifo $file + fi + if [[ ${TYPE[$op]} != FIFO ]] + then if [[ $JOBOP ]] + then case $#:$f in + 0:) ;; + *:-f) printf -- "$@" ;; + *:-f*) printf -- "${f#-f}""$@" ;; + *) print $f -r -- "$@" ;; + esac >> $file + else case $#:$f in + 0:) ;; + *:-f) printf -- "$@" ;; + *:-f*) printf -- "${f#-f}""$@" ;; + *) print $f -r -- "$@" ;; + esac > $file + fi + elif [[ $#:$f != 0: ]] + then case $#:$f in + *:-f) printf -- "$@" ;; + *:-f*) printf -- "${f#-f}""$@" ;; + *) print $f -r -- "$@" ;; + esac >> $file & + fi + if [[ $x ]] + then chmod +x $file + fi + fi +} + +function INPUT # file|- data ... +{ + IO $0 "$@" +} + +function COPY # from to +{ + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + COPY="$COPY $@" +} + +function MOVE # from to +{ + typeset f + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + for f + do case $f in + INPUT|OUTPUT|ERROR) + f=$TWD/$f + ;; + /*) ;; + *) f=$PWD/$f + ;; + esac + MOVE="$MOVE $f" + done +} + +function SAME # new old +{ + typeset i file v + if [[ $GROUP != $TEST_select ]] || (( COND_SKIP[COND] )) + then return + fi + case $# in + 2) case $1 in + INPUT) cat $2 > $1; return ;; + esac + SAME[$1]=$2 + file=$1 + COMPARE="$COMPARE $1" + ;; + 3) SAME[$2]=$3 + file=$2 + eval i='$'$1 + case " $i " in + *" $2 "*) + ;; + *) eval $1='"$'$1' $2"' + ;; + esac + COMPARE="$COMPARE $2" + ;; + esac + case " $IGNORE " in + *" $file "*) + for i in $IGNORE + do case $i in + $file) ;; + *) v="$v $i" ;; + esac + done + IGNORE=$v + ;; + esac +} + +function OUTPUT # file|- data ... +{ + IO $0 "$@" +} + +function ERROR # file|- data ... +{ + IO $0 "$@" +} + +function RM # rm(1) args +{ + if [[ ! $TEST_rmu ]] + then chmod -R u+rwx "$@" >/dev/null 2>&1 + fi + rm $TEST_rmu $TEST_rmflags "$@" +} + +function REMOVE # file ... +{ + typeset i + for i + do RM $i $i.sav + done +} + +function IGNORE # file ... +{ + typeset i + for i + do case $i in + INPUT|OUTPUT|ERROR) + i=$TWD/$i + ;; + esac + case " $IGNORE " in + *" $i "*) + ;; + *) IGNORE="$IGNORE $i" + ;; + esac + done +} + +function KEEP # pattern ... +{ + typeset i + for i + do case $KEEP in + "") KEEP="$i" ;; + *) KEEP="$KEEP|$i" ;; + esac + done +} + +function DIAGNOSTICS # [ 1 | 0 ] +{ + case $#:$1 in + 0:|1:1) DIAGNOSTICS=1 + EXIT='*' + ;; + 1:|1:0) DIAGNOSTICS="" + EXIT=0 + ;; + *) DIAGNOSTICS=$1 + EXIT='*' + ;; + esac +} + +function IGNORESPACE +{ + : ${IGNORESPACE=-b} +} + +function EXIT # status +{ + EXIT=$1 +} + +function INFO # info description +{ + typeset -R15 info=$1 + if [[ ! $1 ]] + then info=no + fi + shift + if [[ ! $TEST_quiet ]] + then print -r -u2 "$info " "$@" + fi +} + +function COMMAND # arg ... +{ + typeset input + ((TESTS++)) + case " ${ENVIRON[*]} ${EXPORT[*]}" in + *' 'LC_ALL=*) + ;; + *' 'LC_+([A-Z])=*) + EXPORT[EXPORTS++]="LC_ALL=" + ;; + esac + if [[ $TEST_keep ]] + then ( + PS4='' + set -x + print -r -- "${ENVIRON[@]}" "${EXPORT[@]}" "PATH=$PATH" $COMMAND "$@" + ) 2>&1 >/dev/null | + sed -e 's,^print -r -- ,,' -e 's,$, "$@",' >$TWD/COMMAND + chmod +x $TWD/COMMAND + fi + if [[ $UMASK != $UMASK_ORIG ]] + then : >$TWD/ERROR + umask $UMASK + fi + if [[ ${TYPE[INPUT]} == FIFO && ${FILE[INPUT]} == */INPUT ]] + then input="< ${FILE[INPUT]}" + fi + if [[ $TEST_trace ]] + then set +x + eval print -u2 "$PS4" "${ENVIRON[@]}" "${EXPORT[@]}" PATH='$PATH' '$'COMMAND '"$@"' '$input' '"2>$TWD/ERROR"' '"${JOBPID:+&}"' + fi + eval "${ENVIRON[@]}" "${EXPORT[@]}" PATH='$PATH' '$'COMMAND '"$@"' $input "2>$TWD/ERROR" "${JOBPID:+&}" + STATUS=$? + [[ $TEST_trace ]] && set -x + if [[ $JOBPID ]] + then JOBPID=$! + fi + [[ $UMASK != $UMASK_ORIG ]] && umask $UMASK_ORIG + return $STATUS +} + +function RESULTS # pipe* +{ + typeset i j k s failed ignore io op + if [[ $1 ]] + then io="$1 " + fi + [[ $JOBOP || $JOBPID || $JOBSTATUS ]] && sleep 1 + for i in $COMPARE $TWD/OUTPUT $TWD/ERROR + do case " $IGNORE $ignore $MOVE " in + *" $i "*) continue ;; + esac + ignore="$ignore $i" + op=${i##*/} + if [[ ${FILTER[$op]} ]] + then eval "{ ${FILTER[$op]} ;} < $i > $i.fi" + mv $i.fi $i + fi + j=${SAME[$op]} + if [[ ! $j ]] + then if [[ $i == /* ]] + then k=$i + else k=$TWD/$i + fi + for s in ex sav err + do [[ -f $k.$s ]] && break + done + j=$k.$s + fi + if [[ "$DIAGNOSTICS" && $i == */ERROR ]] + then if [[ $STATUS == 0 && ! -s $TWD/ERROR || $DIAGNOSTICS != 1 && $(<$i) != $DIAGNOSTICS ]] + then failed=$failed${failed:+,}DIAGNOSTICS + if [[ $TEST_verbose && $DIAGNOSTICS != 1 ]] + then print -u2 " ===" "diagnostic pattern '$DIAGNOSTICS' did not match" ${i#$TWD/} "===" + cat $i >&2 + fi + fi + continue + fi + diff $IGNORESPACE $i $j >$i.diff 2>&1 + if [[ -s $i.diff ]] + then failed=$failed${failed:+,}${i#$TWD/} + if [[ $TEST_verbose ]] + then print -u2 " ===" diff $IGNORESPACE ${i#$TWD/} "expected ===" + cat $i.diff >&2 + fi + fi + done + if [[ $JOBOP ]] + then if [[ $JOBPID ]] && ! kill -0 $JOBPID 2>/dev/null + then wait $JOBPID + JOBSTATUS=$? + JOBPID= + fi +#print -u2 AHA#$LINENO JOBOP=$JOBOP JOBPID=$JOBPID JOBSTATUS=$JOBSTATUS + case $JOBOP in + CONTINUE) + if [[ ! $JOBPID ]] + then failed=$failed${failed:+,}EXITED + fi + ;; + EXITED) if [[ $JOBPID ]] + then failed=$failed${failed:+,}RUNNING + fi + ;; + *) if [[ ! $JOBPID ]] + then failed=$failed${failed:+,}EXITED + fi + if ! kill -$JOBOP $JOBPID 2>/dev/null + then failed=$failed${failed:+,}KILL-$JOBOP + fi + ;; + esac + JOBOP= + fi + if [[ ! $failed && $STATUS != $EXIT ]] + then failed="exit code $EXIT expected -- got $STATUS" + fi + if [[ $failed ]] + then ((ERRORS++)) + if [[ ! $TEST_quiet ]] + then SHOW="FAILED ${io}[ $failed ] $NOTE" + print -r -u2 " $SHOW" + fi + if [[ $TEST_keep ]] + then GROUP=FINI + exit + fi + elif [[ ! $TEST_quiet ]] + then SHOW=$NOTE + print -r -u2 " $SHOW" + fi +} + +function SET # [no]name[=value] +{ + typeset i r + if [[ $TEST ]] + then RUN + fi + for i + do if [[ $i == - ]] + then r=1 + elif [[ $i == + ]] + then r= + else if [[ $i == no?* ]] + then i=${i#no} + v= + elif [[ $i == *=* ]] + then v=${i#*=} + if [[ $v == 0 ]] + then v= + fi + i=${i%%=*} + else v=1 + fi + i=${i//-/_} + if [[ $r ]] + then READONLY[$i]=1 + elif [[ ${READONLY[$i]} ]] + then continue + fi + eval TEST_$i=$v + fi + done +} + +function VIEW # var [ file ] +{ + nameref var=$1 + typeset i bwd file pwd view root offset + if [[ $var ]] + then return 0 + fi + case $# in + 1) file=$1 ;; + *) file=$2 ;; + esac + pwd=${TWD%/*} + bwd=${PMP%/*} + if [[ -r $file ]] + then if [[ ! -d $file ]] + then var=$PWD/$file + return 0 + fi + for i in $file/* + do if [[ -r $i ]] + then var=$PWD/$file + return 0 + fi + break + done + fi + for view in ${VIEWS[@]} + do case $view in + /*) ;; + *) view=$pwd/$view ;; + esac + case $offset in + '') case $pwd in + $view/*) offset=${pwd#$view} ;; + *) offset=${bwd#$view} ;; + esac + ;; + esac + if [[ -r $view$offset/$file ]] + then if [[ ! -d $view$offset/$file ]] + then var=$view$offset/$file + return 0 + fi + for i in $view$offset/$file/* + do if [[ -f $i ]] + then var=$view$offset/$file + return 0 + fi + break + done + fi + done + var= + return 1 +} + +function INCLUDE # file ... +{ + typeset f v x + for f + do if VIEW v $f || [[ $PREFIX && $f != /* ]] && VIEW v $PREFIX$f + then x=$x$'\n'". $v" + else FATAL $f: not found + fi + done + [[ $x ]] && trap "$x" 0 +} + +function UMASK # [ mask ] +{ + if (( $# )) + then UMASK=$1 + else UMASK=$UMASK_ORIG + fi +} + +function PIPE # INPUT|OUTPUT|ERROR file|- data ... +{ + IO $0 "$@" +} + +function FIFO # INPUT|OUTPUT|ERROR file|- data ... +{ + IO $0 "$@" +} + +function IF # command(s) [note] +{ + [[ $GROUP == $TEST_select ]] || return + RUN + (( COND++ )) + COND_LINE[COND]=$LINE + if (( COND > 1 && COND_SKIP[COND-1] )) + then (( COND_KEPT[COND] = 1 )) + (( COND_SKIP[COND] = 1 )) + elif eval "{ $1 ;} >/dev/null 2>&1" + then (( COND_KEPT[COND] = 1 )) + (( COND_SKIP[COND] = 0 )) + [[ $2 && ! $TEST_quiet ]] && print -u2 "NOTE $2" + else (( COND_KEPT[COND] = 0 )) + (( COND_SKIP[COND] = 1 )) + fi +} + +function ELIF # command(s) [note] +{ + [[ $GROUP == $TEST_select ]] || return + RUN + if (( COND <= 0 )) + then FATAL line $LINE: no matching IF for ELIF + fi + if (( COND_KEPT[COND] )) + then (( COND_SKIP[COND] = 0 )) + elif eval "$* > /dev/null 2>&1" + then (( COND_KEPT[COND] = 1 )) + (( COND_SKIP[COND] = 0 )) + [[ $2 && ! $TEST_quiet ]] && print -u2 "NOTE $2" + else (( COND_SKIP[COND] = 1 )) + fi +} + +function ELSE # [note] +{ + [[ $GROUP == $TEST_select ]] || return + RUN + if (( COND <= 0 )) + then FATAL line $LINE: no matching IF for ELSE + fi + if (( COND_KEPT[COND] )) + then (( COND_SKIP[COND] = 1 )) + else (( COND_KEPT[COND] = 1 )) + (( COND_SKIP[COND] = 0 )) + [[ $1 && ! $TEST_quiet ]] && print -u2 "NOTE $1" + fi +} + +function FI +{ + [[ $GROUP == $TEST_select ]] || return + RUN + if (( COND <= 0 )) + then FATAL line $LINE: no matching IF for FI on line $LINE + fi + (( ! COND_KEPT[COND] )) && [[ $1 && ! $TEST_quiet ]] && print -u2 "NOTE $1" + (( COND-- )) +} + +# main + +integer ERRORS=0 ENVIRONS=0 EXPORTS=0 TESTS=0 SUBTESTS=0 LINE=0 TESTLINE=0 +integer ITEM=0 LASTITEM=0 COND=0 UNIT_READONLY=0 COUNT +typeset ARGS COMMAND COPY DIAGNOSTICS ERROR EXEC FLUSHED=0 GROUP=INIT +typeset IGNORE INPUT KEEP OUTPUT TEST SOURCE MOVE NOTE UMASK UMASK_ORIG +typeset ARGS_ORIG COMMAND_ORIG TITLE UNIT ARGV PREFIX OFFSET IGNORESPACE +typeset COMPARE MAIN JOBPID='' JOBSTATUS='' +typeset TEST_file TEST_keep TEST_pipe_input TEST_pipe_io TEST_pipe_output TEST_local +typeset TEST_quiet TEST_regular=1 TEST_rmflags='-rf --' TEST_rmu TEST_select + +typeset -A SAME VIEWS FILE TYPE READONLY FILTER +typeset -a COND_LINE COND_SKIP COND_KEPT ENVIRON EXPORT +typeset -Z LAST=00 + +unset FIGNORE + +while getopts -a $command "$USAGE" OPT +do case $OPT in + b) (( $OPTARG )) && IGNORESPACE=-b + ;; + i) SET - pipe-input=$OPTARG + ;; + k) SET - keep=$OPTARG + ;; + l) SET - local + ;; + o) SET - pipe-output=$OPTARG + ;; + p) SET - pipe-io=$OPTARG + ;; + q) SET - quiet=$OPTARG + ;; + r) SET - regular=$OPTARG + ;; + t) if [[ $TEST_select ]] + then TEST_select="$TEST_select|${OPTARG//,/\|}" + else TEST_select="${OPTARG//,/\|}" + fi + ;; + x) SET - trace=$OPTARG + ;; + v) SET - verbose=$OPTARG + ;; + *) GROUP=FINI + exit 2 + ;; + esac +done +shift $OPTIND-1 +case $# in +0) FATAL test unit name omitted ;; +esac +export COLUMNS=80 +SOURCE=$PWD +PATH=$SOURCE:${PATH#?(.):} +PATH=${PATH%%:?(.)}:/usr/5bin:/bin:/usr/bin +UNIT=$1 +shift +if [[ -f $UNIT && ! -x $UNIT ]] +then REGRESS=$UNIT +else REGRESS=${UNIT%.tst} + REGRESS=$REGRESS.tst + [[ -f $REGRESS ]] || FATAL $REGRESS: regression tests not found +fi +UNIT=${UNIT##*/} +UNIT=${UNIT%.tst} +MAIN=$UNIT +if [[ $VPATH ]] +then set -A VIEWS ${VPATH//:/' '} + OFFSET=${SOURCE#${VIEWS[0]}} + if [[ $OFFSET ]] + then OFFSET=${OFFSET#/}/ + fi +fi +if [[ $REGRESS == */* ]] +then PREFIX=${REGRESS%/*} + if [[ ${#VIEWS[@]} ]] + then for i in ${VIEWS[@]} + do PREFIX=${PREFIX#$i/} + done + fi + PREFIX=${PREFIX#$OFFSET} + if [[ $PREFIX ]] + then PREFIX=$PREFIX/ + fi +fi +TWD=$PWD/$UNIT.tmp +PMP=$(pwd -P)/$UNIT.tmp +UMASK_ORIG=$(umask) +UMASK=$UMASK_ORIG +ARGV=("$@") +if [[ ${ARGV[0]} && ${ARGV[0]} != [-+]* ]] +then UNIT "${ARGV[@]}" + UNIT_READONLY=1 +fi +trap 'code=$?; CLEANUP $code' EXIT +if [[ ! $TEST_select ]] +then TEST_select="[0123456789]*" +fi +TEST_select="@($TEST_select|+(0))" +if [[ $TEST_trace ]] +then export PS4=':$LINENO: ' + typeset -ft $(typeset +f) + set -x +fi +if [[ $TEST_verbose ]] +then typeset SHOW +else typeset -L70 SHOW +fi +if [[ ! $TEST_keep ]] && (ulimit -c 0) >/dev/null 2>&1 +then ulimit -c 0 +fi +set --pipefail + +# some last minute shenanigans + +alias BODY='BODY=BODY; function BODY' +alias CONTINUE='LINE=$LINENO; CONTINUE' +alias DO='(( $ITEM != $FLUSHED )) && RUN DO; DO &&' +alias DONE='DONE=DONE; function DONE' +alias EXEC='LINE=$LINENO; EXEC' +alias EXITED='LINE=$LINENO; EXITED' +alias INIT='INIT=INIT; function INIT' +alias JOB='LINE=$LINENO; JOB' +alias KILL='LINE=$LINENO; KILL' +alias PROG='LINE=$LINENO; FLUSH; PROG' +alias TEST='TESTLINE=$LINENO; TEST' +alias IF='LINE=$LINENO; FLUSH; IF' +alias ELIF='LINE=$LINENO; FLUSH; ELIF' +alias ELSE='LINE=$LINENO; FLUSH; ELSE' +alias FI='LINE=$LINENO; FLUSH; FI' + +# do the tests + +. $REGRESS +RUN +GROUP=FINI diff --git a/src/cmd/INIT/release.c b/src/cmd/INIT/release.c new file mode 100644 index 0000000..7b4b1b0 --- /dev/null +++ b/src/cmd/INIT/release.c @@ -0,0 +1,366 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#pragma prototyped + +/* + * release -- list recent release changes + * + * coded for portability + */ + +static char id[] = "\n@(#)$Id: release (AT&T Research) 2000-01-28 $\0\n"; + +#if _PACKAGE_ast + +#include +#include + +static const char usage[] = +"[-?\n@(#)$Id: release (AT&T Research) 2000-01-28 $\n]" +USAGE_LICENSE +"[+NAME?release - list recent changes]" +"[+DESCRIPTION?\brelease\b lists the changes within the date range specified" +" by the \b--from\b and \b--to\b options. The input files are assumed to" +" contain date tag lines of the form [\acc\a]]\ayy-mm-dd\a [ \atext\a ]]" +" (or \bdate\b(1) default format), where \acc\a is determined by a Y2K" +" window year of 69 (we can produce an example coding dated 1991 - this" +" can be patented?, how about 1+1=2?.) The date tag lines are followed by" +" \areadme\a text in reverse chronological order (newer entries at the" +" top of the file.) If no selection options are spcified then all" +" changes are listed. If no \afile\a operands are specified then the" +" standard input is read.]" +"[+?The entries for each \afile\a are annotated with the file directory name.]" +"[f:from?Entries older than \adate\a are omitted.]:[date]" +"[r:release?List all changes that include the first \acount\a release marks." +" A release mark has a date tag followed by optional space and at least" +" three \b-\b characters. Changes from release mark \acount\a+1 are not" +" listed. If there are no release marks then the date range is used;" +" if there is at least one release mark then the date range is ignored" +" and at most \acount\a release marks will be listed.]#[count]" +"[t:to?Entries newer than \adate\a are omitted.]:[date]" +"[V?Print the program version and exit.]" + +"\n" +"\n[ file ... ]\n" +"\n" + +"[+SEE ALSO?\bpackage\b(1)]" +; + +#else + +#define elementsof(x) ((int)(sizeof(x)/sizeof(x[0]))) + +#define NiL ((char*)0) + +#endif + +#include +#include +#include +#include + +#if !_PACKAGE_ast && defined(__STDC__) +#include +#include +#endif + +static char mon[] = "janfebmaraprmayjunjulaugsepoctnovdec"; +static char day[] = "sunmontuewedthufrisat"; + +#if !_PACKAGE_ast + +static void +usage() +{ + fprintf(stderr, "Usage: release [-V] [-h hi-date] [-l lo-date] [-r count] [ file ...]\n"); + exit(2); +} + +#endif + +static unsigned long +number(register char* s, char** e) +{ + unsigned long q = 0; + + while (isspace(*s)) + s++; + while (isdigit(*s)) + q = q * 10 + *s++ - '0'; + if (e) + *e = s; + return q; +} + +unsigned long +string(register char* s, char* tab, int num, int siz, char** e) +{ + register int i; + register int j; + char buf[16]; + + while (isspace(*s)) + s++; + for (i = 0; i < siz; i++) + buf[i] = isupper(s[i]) ? tolower(s[i]) : s[i]; + for (i = 0; i < num; i += siz) + for (j = 0; j < siz && buf[j] == tab[j+i]; j++) + if (j == (siz - 1)) + { + *e = s + siz; + return i / siz + 1; + } + return 0; +} + +static unsigned long +date(char* s, char** e) +{ + char* t; + unsigned long y; + unsigned long m; + unsigned long d; + + if (isdigit(*s)) + { + y = number(s, &t); + if (*t != '-') + return 0; + switch (t - s) + { + case 2: + y += 1900; + if (y <= 1969) + y += 100; + break; + case 4: + if (y < 1969) + return 0; + break; + } + if (!(m = number(++t, &s))) + return 0; + if ((s - t) != 2 || *s != '-' || m < 1 || m > 12) + return 0; + if (!(d = number(++s, &t))) + return 0; + if ((t - s) != 2 || d < 1 || d > 31) + return 0; + } + else + { + if (string(s, day, elementsof(day), 3, &t)) + s = t; + if (!(m = string(s, mon, elementsof(mon), 3, &t))) + return 0; + if (!(d = number(t, &s))) + return 0; + for (y = 1969; *s; s++) + if ((y = number(s, &t)) && (t - s) == 4) + { + if (y < 1969) + return 0; + break; + } + } + if (e) + { + while (isspace(*t)) + t++; + *e = t; + } + return ((y - 1969) * 13 + m) * 32 + d; +} + +int +main(int argc, char** argv) +{ + register char* s; + register char* u; + register char* v; + char* p; + char* e; + int i; + unsigned long t; + unsigned long lo; + unsigned long hi; + int mk; + FILE* f; + char buf[1024]; + + mk = 0; + lo = hi = 0; +#if _PACKAGE_ast + error_info.id = "release"; + for (;;) + { + switch (optget(argv, usage)) + { + case 'f': + if (!(lo = date(opt_info.arg, &e)) || *e) + { + error(2, "%s: invalid from date [%s]", opt_info.arg, e); + return 1; + } + continue; + case 'r': + mk = opt_info.num + 1; + continue; + case 't': + if (!(hi = date(opt_info.arg, &e)) || *e) + { + error(2, "%s: invalid to date [%s]", opt_info.arg, e); + return 1; + } + continue; + case 'V': + sfprintf(sfstdout, "%s\n", id + 10); + return 0; + case '?': + error(ERROR_USAGE|4, "%s", opt_info.arg); + continue; + case ':': + error(2, "%s", opt_info.arg); + continue; + } + break; + } + if (error_info.errors) + error(ERROR_USAGE|4, "%s", optusage(NiL)); + argv += opt_info.index; +#else + while ((s = *++argv) && *s == '-' && *(s + 1)) + { + if (*(s + 1) == '-') + { + if (!*(s + 2)) + { + argv++; + break; + } + usage(); + break; + } + for (;;) + { + switch (i = *++s) + { + case 0: + break; + case 'f': + case 't': + if (!*(v = ++s) && !(v = *++argv)) + { + s = "??"; + continue; + } + if (!(t = date(v, &e)) || *e) + { + fprintf(stderr, "release: -%c%s: invalid date [%s]\n", i, s, e); + return 1; + } + switch (i) + { + case 'f': + lo = t; + break; + case 't': + hi = t; + break; + } + break; + case 'r': + if (!*(v = ++s) && !(v = *++argv)) + { + s = "??"; + continue; + } + mk = number(v, &e) + 1; + if (*e) + { + fprintf(stderr, "release: -%c%s: invalid count\n", i, s); + return 1; + } + break; + case 'V': + fprintf(stdout, "%s\n", id + 10); + return 0; + default: + fprintf(stderr, "release: -%c: unknown option\n", i); + /*FALLTHROUGH*/ + case '?': + usage(); + break; + } + break; + } + } +#endif + do + { + if (!(p = *argv++) || !*p || *p == '-' && !*(p + 1)) + { + argv--; + p = ""; + f = stdin; + } + else if (!(f = fopen(p, "r"))) + { + fprintf(stderr, "release: %s: cannot read", p); + return 1; + } + while (s = fgets(buf, sizeof(buf), f)) + { + if (t = date(s, &e)) + { + if (mk && e[0] == '-' && e[1] == '-' && e[2] == '-' && !--mk) + break; + if (t < lo) + break; + if (hi && t > hi) + continue; + if (p) + { + if (*p) + { + for (u = v = p; *p; p++) + if (*p == '/') + { + v = u; + u = p + 1; + } + printf("\n:::::::: "); + while ((i = *v++) && i != '/') + fputc(i, stdout); + printf(" ::::::::\n\n"); + } + p = 0; + } + } + if (!p) + fputs(s, stdout); + } + if (f == stdin) + break; + fclose(f); + } while (*argv); + return 0; +} diff --git a/src/cmd/INIT/rt.sh b/src/cmd/INIT/rt.sh new file mode 100644 index 0000000..2b8b840 --- /dev/null +++ b/src/cmd/INIT/rt.sh @@ -0,0 +1,479 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +: rt - nmake test output filter + +command=rt +flags='--silent --keepgoing' +failed=0 +heading=1 +verbose=0 + +case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +0123) ARGV0="-a $command" + USAGE=$' +[-? +@(#)$Id: rt (AT&T Research) 2010-07-27 $ +] +'$USAGE_LICENSE$' +[+NAME?rt - run "nmake test" and filter output] +[+DESCRIPTION?\brt\b runs \vnmake test\v and filters the regression + test output to contain only test summary lines. If no \atest\a + operands are specified then \btest\b is assumed. If \b-\b is + specified then the \afile\a operands, or the standard input + if no \afile\a operands are specified, are filtered instead + of the output from \bnmake\b.] +[f:failed?Only list failed test results.] +[h!:heading?Enable per-file heading when more than one \afile\a operand + follows \b-\b.] +[v:verbose?Run with \vREGRESSFLAGS=-v\v.] + +[ test ... | - [ file ... ] ] + +[+SEE ALSO?\bnmake\b(1), \bregress\b(1)] +[+CAVEATS?\brt\b guesses the regression test output style. Garbled + output indicates a bad guess.] +' + ;; +*) ARGV0="" + USAGE="fhv" + ;; +esac + +function usage +{ + OPTIND=0 + getopts $ARGV0 "$USAGE" OPT '-?' + exit 2 +} + +while getopts $ARGV0 "$USAGE" OPT +do case $OPT in + f) failed=1 ;; + h) heading=0 ;; + v) (( verbose=$OPTARG )) && flags="$flags REGRESSFLAGS=-v" ;; + esac +done +shift `expr $OPTIND - 1` + +ifs=${IFS:-$' \t\n'} +set -o noglob +component= +dots='............................................' +bad=' ***' +style=unknown +integer tests errors signals lineno=0 skip=0 +typeset -l lower + +function results # tests errors signals +{ + integer t=$1 e=$2 s=$3 + typeset label note + if [[ $style != unknown ]] && (( errors >= 0 )) + then style=unknown + if (( !failed || errors )) + then if (( failed )) + then print -r -n -- "$unit" + fi + if (( t >= 0 )) + then if (( t == 1)) + then label="test " + else label=tests + fi + printf $'%s%5d %s' "$prefix" "$t" "$label" + prefix= + else prefix="$prefix..........." + fi + if (( s )) + then label=signal + (( e=s )) + else label=error + fi + if (( e != 1)) + then label=${label}s + fi + if (( e == 1 )) + then note=" $bad" + elif (( e > 1 )) + then note=$bad + fi + printf $'%s%5d %s%s\n' "$prefix" "$e" "$label" "$note" + fi + fi +} + +function unit +{ + typeset x + if [[ $component ]] + then x=${component##*/} + if [[ " $x " != *' '$unit' '* && " $unit " != *' '$x' '* ]] + then if [[ $component == cmd/?*lib/* ]] + then unit="$unit $x" + else unit="$x $unit" + fi + fi + fi + unit="$unit ${dots:1:${#dots}-${#unit}}" + if [[ $1 ]] + then unit="$unit..........." + fi + if (( ! failed )) + then print -r -n -- "$unit" + fi +} + +if [[ $1 == - ]] +then shift + if (( $# <= 1 )) + then heading=0 + fi + if (( heading )) + then for i + do print test heading $i + cat -- "$i" + done + else cat "$@" + fi +else if [[ $1 == *=* ]] + then set test "$@" + elif (( ! $# )) + then set test + fi + nmake "$@" $flags 2>&1 +fi | +while read -r line +do set '' $line + shift + case $line in + TEST[' ']*', '*' error'*) + IFS=${IFS}"," + set '' $line + IFS=$ifs + set '' $* + while : + do case $2 in + '') break + ;; + error|errors) + errors=$1 + break + ;; + test|tests) + tests=$1 + ;; + esac + shift + done + results $tests $errors + continue + ;; + TEST[' ']*) + results $tests $errors + IFS=${IFS}"," + set '' $line + IFS=$ifs + set '' $* + unit=${3##*/} + case $4 in + [a-zA-Z]*) unit="$unit $4" ;; + esac + unit + prefix= + errors=0 + signals=0 + style=regress + continue + ;; + 'pathname and options of item under test') + read -r line || break + results $tests $errors $signals + set '' $line + unit=${2##*/} + unit + tests=0 + errors=0 + signals=0 + style=script + continue + ;; + 'test heading '*) + if (( heading )) + then if (( heading > 1 )) + then print + else heading=2 + fi + set '' $line + shift 3 + print -r -- "==> $* <==" + fi + continue + ;; + 'test '*' begins at '????-??-??+??:??:??|'test '*' begins at '*' '*' '*' '*' '*) + results $tests $errors $signals + unit=${2##*/} + unit=${unit%.sh} + unit + prefix= + tests=-1 + errors=0 + signals=0 + style=shell + continue + ;; + 'test '*' at '????-??-??+??:??:??' [ '*' ]'|'test '*' at '*' '*' '*' '*' '*) + case $line in + *' [ '*test*error*' ]') + while : + do case $1 in + '[') tests=$2 + errors=$4 + if (( errors > 256 )) + then (( signals++ )) + fi + break + ;; + esac + shift + done + ;; + *' [ '*test*signal*' ]') + while : + do case $1 in + '[') tests=$2 + signals=$4 + if (( signals )) + then (( errors++ )) + fi + break + ;; + esac + shift + done + ;; + *) if [[ $3 != passed ]] + then (( errors )) || (( errors++ )) + fi + ;; + esac + results $tests $errors $signals + continue + ;; + '## ---'*(-)'--- ##') + (( ++lineno > skip )) || continue + read -r line || break + lower=$line + set '' $lower + case $lower in + '##'*'test suite:'*'##') + results $tests $errors $signals + set -- ${lower//*suite:} + set -- ${*//[.#]/} + unit=$* + if [[ $unit == *' tests' ]] + then unit=${unit/' tests'/} + fi + main=$unit + prefix= + tests=0 + errors=0 + signals=0 + category= + style=autotest + (( skip = lineno + 1 )) + unit + continue + ;; + esac + ;; + +(-)) case $style in + regress) continue ;; + esac + (( ++lineno > skip )) || continue + read -r line || break + set '' $line + case $line in + 'Running tests for '*) + results $tests $errors $signals + shift 4 + unit= + while (( $# )) + do if [[ $1 == on ]] + then break + fi + if [[ $unit ]] + then unit="$unit " + fi + unit=$unit${1##*/} + shift + done + main=$unit + prefix= + tests=-1 + errors=-1 + category= + style=perl + (( skip = lineno + 1 )) + continue + ;; + *' : '*)results $tests $errors $signals + unit=${2##*/} + unit=${unit%.sh} + unit + prefix= + tests=0 + errors=0 + signals=0 + style=timing + (( skip = lineno + 1 )) + continue + ;; + esac + ;; + +([0-9])*([a-zA-Z0-9])' '*) + case $style in + script) case $line in + *FAILED*|*failed*) + (( errors++ )) + ;; + *) (( tests++ )) + ;; + esac + ;; + esac + ;; + make:*|'make ['*']:'*) + case $line in + *': warning:'*|*'making test'*|*'action'?(s)' failed'*|*': *** '*) + ;; + *) results $tests $errors $signals + print -r -u2 -- "$line" + ;; + esac + continue + ;; + +([/a-zA-Z_0-9]):) + component=${line%:} + ;; + '') continue + ;; + esac + case $style in + autotest) + case $line in + +([0-9]):*ok) + (( tests++ )) + ;; + +([0-9]):*FAILED*) + (( tests++ )) + (( errors++ )) + if (( $verbose )) + then if [[ ! $prefix ]] + then prefix=$unit + print + fi + print -r -- " ${line//*'FAILED '/}" + fi + ;; + esac + continue + ;; + perl) case $line in + *'........ '*) + if [[ $1 == */* ]] + then cat=${1%%/*} + if [[ $cat != $category ]] + then results $tests $errors $signals + category=$cat + unit="$main $category" + unit + prefix= + tests=0 + errors=0 + signals=0 + fi + (( tests++ )) + case $line in + *' ok') ;; + *) (( errors++ )) + if (( $verbose )) + then if [[ ! $prefix ]] + then prefix=$unit + print + fi + print -r -- "$line" + fi + ;; + esac + else results $tests $errors $signals + case $line in + *' ok') errors=0 ;; + *) errors=1 ;; + esac + unit="$main $1" + unit + if (( $verbose && errors )) + then prefix=$unit + print + shift 2 + print -r -- "$@" + else prefix= + fi + results $tests $errors $signals + tests=-1 + errors=-1 + category= + fi + style=perl + ;; + esac + continue + ;; + esac + case $line in + *FAILED*|*failed*) + (( errors++ )) + ;; + *) case $style in + regress)case $line in + ['<>']*);; + *) continue ;; + esac + ;; + script) continue + ;; + shell) ((errors++ )) + ;; + timing) (( tests++ )) + continue + ;; + unknown)continue + ;; + esac + ;; + esac + if (( $verbose )) + then if [[ ! $prefix ]] + then prefix=$unit + print + fi + print -r -- "$line" + fi +done +results $tests $errors $signals diff --git a/src/cmd/INIT/silent.sh b/src/cmd/INIT/silent.sh new file mode 100644 index 0000000..be99aa6 --- /dev/null +++ b/src/cmd/INIT/silent.sh @@ -0,0 +1,42 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1994-2011 AT&T Intellectual Property # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# by AT&T Intellectual Property # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Information and Software Systems Research # +# AT&T Research # +# Florham Park NJ # +# # +# Glenn Fowler # +# # +######################################################################## +# non-ksh stub for the nmake silent prefix +# @(#)silent (AT&T Research) 1992-08-11 + +case $-:$BASH_VERSION in +*x*:[01234567899]*) : bash set -x is broken :; set +ex ;; +esac + +while : +do case $# in + 0) exit 0 ;; + esac + case $1 in + *=*) case $RANDOM in + $RANDOM)`echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; + *) export "$1" ;; + esac + shift + ;; + *) break + ;; + esac +done +"$@" diff --git a/src/cmd/INIT/socket.c b/src/cmd/INIT/socket.c new file mode 100644 index 0000000..51d74eb --- /dev/null +++ b/src/cmd/INIT/socket.c @@ -0,0 +1,33 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +/* + * small test for -lnsl + */ + +#ifndef socket +#include +#include +#endif + +int +main() +{ + return socket(0, 0, 0) < 0; +} diff --git a/src/cmd/INIT/w.c b/src/cmd/INIT/w.c new file mode 100644 index 0000000..0f6bc7d --- /dev/null +++ b/src/cmd/INIT/w.c @@ -0,0 +1,30 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#ifndef DONTCARE +#include +#include +#endif + +int +main() +{ + wchar_t w = ' '; + return iswspace(w) == 0; +} diff --git a/src/cmd/INIT/w2.c b/src/cmd/INIT/w2.c new file mode 100644 index 0000000..00efd25 --- /dev/null +++ b/src/cmd/INIT/w2.c @@ -0,0 +1,27 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1994-2011 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* Glenn Fowler * +* * +***********************************************************************/ +#include + +int +main() +{ + wchar_t w = ' '; + return iswspace(w) == 0; +} diff --git a/src/cmd/Makefile b/src/cmd/Makefile new file mode 100644 index 0000000..a046f68 --- /dev/null +++ b/src/cmd/Makefile @@ -0,0 +1 @@ +:MAKE: diff --git a/src/cmd/Mamfile b/src/cmd/Mamfile new file mode 100644 index 0000000..7b439a5 --- /dev/null +++ b/src/cmd/Mamfile @@ -0,0 +1,7 @@ +info mam static +note component level :MAKE: equivalent +make install +make all +exec - ${MAMAKE} -r '*' ${MAMAKEARGS} +done all virtual +done install virtual diff --git a/src/cmd/ksh93/COMPATIBILITY b/src/cmd/ksh93/COMPATIBILITY new file mode 100644 index 0000000..cf26076 --- /dev/null +++ b/src/cmd/ksh93/COMPATIBILITY @@ -0,0 +1,136 @@ + + KSH-93 VS. KSH-88 + + +The following is a list of known incompatibilities between ksh-93 and ksh-88. +I have not include cases that are clearly bugs in ksh-88. I also have +omitted features that are completely upward compatible. + +1. Functions, defined with name() with ksh-93 are compatible with + the POSIX standard, not with ksh-88. No local variables are + permitted, and there is no separate scope. Functions defined + with the function name syntax, maintain compatibility. + This also affects function traces. + +2. ! is now a reserved word. As a result, any command by that + name will no longer work with ksh-93. + +3. The -x attribute of alias and typeset -f is no longer + effective and the ENV file is only read for interactive + shells. You need to use FPATH to make function definitions + visible to scripts. + +4. A built-in command named command has been added which is + always found before the PATH search. Any script which uses + this name as the name of a command (or function) will not + be compatible. + +5. The output format for some built-ins has changed. In particular + the output format for set, typeset and alias now have single + quotes around values that have special characters. The output + for trap without arguments has a format that can be used as input. + +6. With ksh-88, a dollar sign ($') followed by a single quote was + interpreted literally. Now it is an ANSI-C string. You + must quote the dollar sign to get the previous behavior. + Also, a $ in front of a " indicates that the string needs + to be translated for locales other than C or POSIX. The $ + is ignored in the C and POSIX locale. + +7. With ksh-88, tilde expansion did not take place inside ${...}. + with ksh-93, ${foo-~} will cause tilde expansion if foo is + not set. You need to escape the ~ for the previous behavior. + +8. Some changes in the tokenizing rules where made that might + cause some scripts with previously ambiguous use of quoting + to produce syntax errors. + +9. Programs that rely on specific exit values for the shell, + (rather than 0 or non-zero) may not be compatible. The + exit status for many shell failures has been changed. + +10. Built-ins in ksh-88 were always executed before looking for + the command in the PATH variable. This is no longer true. + Thus, with ksh-93, if you have the current directory first + in your PATH, and you have a program named test in your + directory, it will be executed when you type test; the + built-in version will be run at the point /bin is found + in your PATH. + +11. Some undocumented combinations of argument passing to ksh + builtins no longer works since ksh-93 is getopts conforming + with respect to its built-ins. For example, typeset -8i + previously would work as a synonym for typeset -i8. + +12. Command substitution and arithmetic expansion are now performed + on PS1, PS3, and ENV when they are expanded. Thus, ` and $( + as part of the value of these variables must be preceded by a \ + to preserve their previous behavior. + +13. The ERRNO variable has been dropped. + +14. If the file name following a redirection symbol contain pattern + characters they will only be expanded for interactive shells. + +15. The arguments to a dot script will be restored when it completes. + +16. The list of tracked aliases is not displayed with alias unless + the -t option is specified. + +17. The POSIX standard requires that test "$arg" have exit status + of 0, if and only if $arg is null. However, since this breaks + programs that use test -t, ksh-93 treats an explicit test -t + as if the user had entered test -t 1. + +18. The ^T directive of emacs mode has been changed to work the + way it does in gnu-emacs. + +19. ksh-88 allowed unbalanced parenthes within ${name op val} whereas + ksh-93 does not. Thus, ${foo-(} needs to be written as ${foo-\(} + which works with both versions. + +20. kill -l in ksh-93 lists only the signal names, not their numerical + values. + +21. Local variables defined by typeset are statically scoped in + ksh-93. In ksh-88 they were dynamically scoped although this + behavior was never documented. + +22. The value of the variable given to getopts is set to ? when + the end-of-options is reached to conform to the POSIX standard. + +23. Since the POSIX standard requires that octal constants be + recongnized, doing arithmetic on typeset -Z variables can + yield different results that with ksh-88. Most of these + differences were eliminated in ksh-93o. Starting in ksh-93u+, the + let command no longer recognizes octal constants starting with 0 + for compatibility with ksh-88 unless the option letoctal is on. + +24. Starting after ksh-93l, If you run ksh name, where name does + not contain a /, the current directory will be searched + before doing a path search on name as required by the POSIX + shell standard. + +25. In ksh-93, cd - will output the directory that it changes + to on standard output as required by X/Open. With ksh-88, + this only happened for interactive shells. + +26. As an undocumented feature of ksh-88, a leading 0 to an + assignment of an integer variable caused that variable + to be treated as unsigned. This behavior was removed + starting in ksh-93p. + +27. The getopts builtin in ksh-93 requires that optstring contain + a leading + to allow options to begin with a +. + +28. In emacs/gmacs mode, control-v will not display the version when + the stty lnext character is set to control-v or is unset. + The sequence escape control-v will display the shell version. + +29. In ksh-88, DEBUG traps were executed. after each command. In ksh-93 + DEBUG traps are exeucted before each command. + +30. In ksh-88, a redirection to a file name given by an empty string was + ignored. In ksh-93, this is an error. +I am interested in expanding this list so please let me know if you +uncover any others. diff --git a/src/cmd/ksh93/DESIGN b/src/cmd/ksh93/DESIGN new file mode 100644 index 0000000..c11c0af --- /dev/null +++ b/src/cmd/ksh93/DESIGN @@ -0,0 +1,170 @@ +Here is an overview of the source code organization for ksh93. + +Directory layout: + + The directory include contains header files for ksh93. + The files nval.h and shell.h are intended to be public + headers and can be used to add runtime builtin command. + The remainder are private. + + The directory data contains readonly data files for ksh93. + The man pages for built-ins are in builtins.c rather + than included as statics with the implementations in the + bltins directory because some systems don't make static const + data readonly and we want these to be shared by all running + shells. + + The directory edit contains the code for command line + editing and history. + + The fun directory contains some shell function such as + pushd, popd, and dirs. + + The directory features contains files that are used to generate + header files in the FEATURE directory. Most of these files + are in a format that is processed by iffe. + + The directory bltins contains code for most of the built-in + commands. Additional built-in commands are part of libcmd. + + The directory sh contains most of the code for ksh93. + + The directory tests contains a number of regression tests. + In most cases, when a bug gets fixed, a test is added to + one of these files. The regression tests can be run by + going to this directory and running + SHELL=shell_path shell_path shtests + where shell_path is an absolute pathname for the shell to + be tested. + + The top level directory contains the nmake Makefile, a README, + and several documentation files. The RELEASE file contains + the list of bug fixes and new features since the original + ksh93 release. The file COMPATIBILITY is a list of all + known incompatibilities with ksh88. + + The bash_pre_rc.sh is a startup script used when emulating + bash if the shell is compiled with SHOPT_BASH and the shell + is invoked as bash. The bash emulation is not complete. + +Include directory: + 1. argnod.h contains the type definitions for command + nodes, io nodes, argument nodes, and for positional + parameters.a It defines the prototypes for + all the positional parameters functions. + 2. builtins.h contains prototypes for builtins as well + as symbolic constants that refer to the name-pairs + that are associated with some of the built-ins. + It also contains prototypes for many of the strings. + 3. defs.h is the catch all for all definitions that + don't fit elsewhere and it includes several other + headers. It defines a strucuture that contains ksh + global data, sh, and a structure that contains per + function data, sh.st. + 4. edit.h contains definitions that are common to both + vi and emacs edit modes. + 5. env.h contains interfaces for creating and modifying + environment variables. + 6. fault.h contains prototypes for signal related + functions and trap and fault handling. + 7. fcin.h contains macro and function definitions for + reading from a file or string. + 8. history.h contains macros and functions definitions + related to history file processing. + 9. jobs.h contains the definitions relating to job + processing and control. + 10. lexstates.h contains the states associated with + lexical processing. + 11. name.h contains the internal definitions related + to name-value pair processing. + 12. national.h contains a few I18N definitions, mostly + obsolete. + 13. nval.h is the public interface to the name-value + pair library that is documented with nval.3. + 14. path.h contains the interface for pathname processing + and pathname searching. + 15. shell.h is the public interface for shell functions + that are documented int shell.3. + 16. shlex.h contains the lexical token definitions and + interfaces for lexical analysis. + 17. shnodes.h contains the definition of the structures + for each of the parse nodes and flags for the attributes. + 18. shtable.h contains some interfaces and functions for + table lookup. + 19. streval.h contains the interface to the arithmetic + functions. + 20. terminal.h is a header file that includes the appropriate + terminal include. + 21. test.h contains the definitions for the test and [[...]] + commands. + 22. timeout.h contains the define constant for the maximum + shell timeout. + 23. ulimit.h includes the appropriate resource header. + 24. variables.h contains symbolic constants for the built-in + shell variables. + +sh directory: + 1. args.c contains functions for parsing shell options + and for processing positional parameters. + 2. arith.c contains callback functions for the streval.c + library and the interface to shell arithmetic. + 3. array.c contains the code for indexed and associative + arrays. + 4. bash.h contains code used when compiling with SHOPT_BASH + to add bash specific features such as shopt. + 5. defs.c contains the data definitions for global symbols. + 6. deparse.c contains code to generate shell script from + a parse tree. + 7. env.c contains code to add and delete environment variables + to an environment list. + 8. expand.c contains code for file name expansion and + file name generation. + 9. fault.c contains code for signal processing, trap + handling and termination. + 10. fcin.c contains code for reading and writing a character + at a time from a file or string. + 11. init.c contains initialization code and callbacks + for get and set functions for built-in variables. + 12. io.o contains code for redirections and managing file + descriptors and file streams. + 13. jobs.c contains the code for job management. + 14. lex.c contains the code for the lexical analyzer. + 15. macro.c contains code for the $ macro expansions, including + here-documents. + 16. main.c contains the calls to initialization, profile + processing and the main evaluation loop as well as + mail processing. + 17. name.c contains the name-value pair routines that are + built on the hash library in libast. + 18. nvdisc.c contains code related to name-value pair disciplines. + 19. nvtree.c contains code for compound variables and for + walking the namespace. + 20. nvtype.c contains most of the code related to types that + are created with typeset -T. + 21. parse.c contains the code for the shell parser. + 22. path.c contains the code for pathname lookup and + some path functions. It also contains the code + that executes commands and scripts. + 23. pmain.c is just a calls sh_main() so that all of the + rest of the shell can be in a shared library. + 24. shcomp.c contains the main program to the shell + compiler. This program parses a script and creates + a file that the shell can read containing the parse tree. + 25. streval.c is an C arithmetic evaluator. + 26. string.c contains some string related functions. + 27. subshell.c contains the code to save and restore + environments so that subshells can run without creating + a new process. + 28. suid_exec.c contains the program from running execute + only and/or setuid/setgid scripts. + 29. tdump.c contains the code to dump a parse tree into + a file. + 30. timers.c contains code for multiple event timeouts. + 31. trestore contians the code for restoring the parse + tree from the file created by tdump. + 32. userinit.c contains a dummy userinit() function. + This is now obsolete with the new version of sh_main(). + 33. waitevent.c contains the sh_waitnotify function so + that builtins can handle processing events when the + shell is waiting for input or for process completion. + 34. xec.c is the main shell executuion loop. diff --git a/src/cmd/ksh93/Makefile b/src/cmd/ksh93/Makefile new file mode 100644 index 0000000..3ad44c6 --- /dev/null +++ b/src/cmd/ksh93/Makefile @@ -0,0 +1,248 @@ +/* + * ksh makefile + */ + +SH := $(PWD:B:/[0-9]*$//:N=ksh*:-ksh) /* name of the shell program */ +VERSION = 1.1 +LICENSE = since=1982,author=dgk +CATALOG = libshell +ERROR_CONTEXT_T == Error_context_t /* workaround until switch from errorpush()/errorpop() => errorctx() */ +RELEASE := $(SH:/.*sh//) +SHCOMP := shcomp$(RELEASE) + +/* + * set these variables to 1 to enable, 0 to disable, null to probe + * override SHOPT_foo=1 can be placed one per line in the build dir Makeargs + */ + +SHOPT_2DMATCH == 1 /* two dimensional .sh.match for ${var//pat/str} */ +SHOPT_ACCT == /* accounting */ +SHOPT_ACCTFILE == /* per user accounting info */ +SHOPT_AUDIT == +SHOPT_AUDITFILE == "/etc/ksh_audit" /* auditing file */ +SHOPT_BASH == /* bash compatibility code */ +SHOPT_BGX == 1 /* one SIGCHLD trap per completed job */ +SHOPT_BRACEPAT == 1 /* C-shell {...,...} expansions (, required) */ +SHOPT_CMDLIB_HDR == /* -lcmd builtin list: */ +SHOPT_CMDLIB_DIR == /* SHOPT_CMDLIB_HDR prefix SH_CMDLIB_DIR + */ +SHOPT_COSHELL == 1 /* build with connection to coshell */ +SHOPT_CRNL == /* accept for */ +SHOPT_DYNAMIC == 1 /* dynamic loading for builtins */ +SHOPT_ECHOPRINT == /* make echo equivalent to print */ +SHOPT_EDPREDICT == 1 /* predictive editing */ +SHOPT_ESH == 1 /* emacs/gmacs edit mode */ +SHOPT_FILESCAN == 1 /* fast file scan */ +SHOPT_FIXEDARRAY == 1 /* fixed dimension indexed array */ +SHOPT_FS_3D == /* 3d file system */ +SHOPT_HISTEXPAND == 1 /* csh-style history file expansions */ +SHOPT_KIA == 1 /* shell information database generation */ +SHOPT_MULTIBYTE == 1 /* multibyte character handling */ +SHOPT_NAMESPACE == 1 /* allow namespaces */ +SHOPT_OLDTERMIO == /* support both TCGETA and TCGETS */ +SHOPT_OPTIMIZE == 1 /* optimize loop invariants */ +SHOPT_PFSH == 1 /* solaris exec_attr(4) profile execution */ +SHOPT_P_SUID == /* real uid's that require -p for set[ug]id */ +SHOPT_RAWONLY == 1 /* make viraw the only vi mode */ +SHOPT_REGRESS == /* enable __regress__ builtin and instrumented intercepts for testing */ +SHOPT_REMOTE == /* enable --rc if running as a remote shell */ +SHOPT_SEVENBIT == /* strip the eigth bit from characters */ +SHOPT_SPAWN == /* use spawnveg for fork/exec */ +SHOPT_STATS == 1 /* add .sh.stats variable */ +SHOPT_SUID_EXEC == 1 /* allow (safe) suid/sgid shell scripts */ +SHOPT_SYSRC == /* attempt . /etc/ksh.kshrc if interactive */ +SHOPT_TIMEOUT == /* number of seconds for shell timeout */ +SHOPT_TYPEDEF == 1 /* enable typeset type definitions */ +SHOPT_VSH == 1 /* vi edit mode */ + +if CC.HOSTTYPE == "linux.alpha" + /* workaround for "BUG IN DYNAMIC LINKER ld.so" */ + :PACKAGE: - m:static:noinclude /*noCC.EXPORT.DYNAMIC*/ +end + +if CC.HOSTTYPE == "*.s390-64" + CC.DLL = $(CC.DLLBIG) +end + +if SHOPT_DYNAMIC && ( "$(CC.DIALECT:N=EXPORT=DLL)" || "$(PACKAGE_OPTIONS:N=optimize-space)" ) + CCFLAGS += $$(CC.DLL) $$(CC.SUFFIX.DEBUG:+$$(CC.DEBUG)) + LIBS_req = -lshell$(RELEASE) +else + if VARIANT + SHOPT_DYNAMIC = 1 + else + libtype = :static + end + if SHOPT_DYNAMIC + CCLDFLAGS += $$(CC.EXPORT.DYNAMIC) + end + LIBS_req = +lshell$(RELEASE) +end + +:PACKAGE: ast$(libtype):20100309 coshell:order --clobber=!($(SH)) + +.SOURCE : edit sh bltins data tests fun +.SOURCE.h : include + +/* documentation files */ +DOCFILES = sh.memo builtins.mm README RELEASE TYPES PROMO.mm COMPATIBILITY \ + DESIGN OBSOLETE RELEASE93 RELEASE88 + +KSHELL == 1 /* this is ksh */ + +SH_CMDLIB_DIR == /* SHOPT_CMDLIB_DIR dir prefix */ +SH_DICT == /* message catalog */ +DEBUG == /* debugging purposes only */ + +if CC.HOSTTYPE == "win32*" + SHOPT_CRNL == 1 /* is eqivalent to */ +end + +if SHOPT_BASH + BASH_HOSTTYPE == "$(CC.HOSTTYPE:S:/\.//)" + BASH_MACHTYPE == "$(BASH_HOSTTYPE)-unknown-$(CC.HOSTTYPE:B)" +end + +/* use the following libraries only if they exist */ +LIBS_opt := +ljobs +li + +if CC.HOSTTYPE == "sol([89]|[1-9][0-9]).*" + LDFLAGS += $(CC.LD.LAZY) $(CC.LD.NORECORD) +end + +if "$(-mam:N=static*)" + LIBS_opt += -lsocket -lnsl +elif CC.HOSTTYPE == "sol?([789]|[1-9][0-9]).*" + LIBS_opt += +lsocket -lnsl +elif CC.HOSTTYPE != "sgi.mips*" + LIBS_opt += +lsocket +lnsl +end +if CC.HOSTTYPE == "linux.sparc*" + /* the linux.sparc linker still has some problems */ + LIBS_opt += -ldll +end +LIBS_opt += -lsecdb +if CC.HOSTTYPE == "sol.*" + LIBS_opt += +lw +end +$(LIBS_opt) : .DONTCARE + +LDLIBRARIES = $(LIBS_opt) + +FILES_opt = /* optional file list enabled by vars above */ +if SHOPT_ESH + FILES_opt += emacs.c +end +if SHOPT_VSH + FILES_opt += vi.c +end +if SHOPT_BASH + FILES_opt += bash.c bash_pre_rc.c + SHOPT_HISTEXPAND == 1 +end +if SHOPT_HISTEXPAND + FILES_opt += hexpand.c +end +if SHOPT_DYNAMIC + FILES_opt += -ldll +end +if SHOPT_X + LDFLAGS += -u _XtAppInitialize -L/usr/add-on/X11/lib +end + +:ALL: $(SH) $(SHCOMP) $(SHOPT_SUID_EXEC:+suid_exec) $(SHOPT_BASH:+bash$(RELEASE)) + +$(SH) :: sh.1 pmain.c $(LIBS_req) + +DATAFILES = limits.c msg.c strdata.c testops.c keywords.c options.c \ + signals.c aliases.c builtins.c variables.c lexstates.c + +shell$(RELEASE) $(VERSION) id=shell :LIBRARY: shell.3 nval.3 alarm.c cd_pwd.c cflow.c deparse.c \ + enum.c getopts.c hist.c misc.c print.c read.c sleep.c trap.c test.c \ + typeset.c ulimit.c umask.c whence.c main.c nvdisc.c nvtype.c \ + arith.c args.c array.c completion.c defs.c edit.c expand.c regress.c \ + fault.c fcin.c history.c init.c io.c jobs.c lex.c macro.c name.c \ + nvtree.c parse.c path.c string.c streval.c subshell.c tdump.c timers.c \ + trestore.c waitevent.c xec.c env.c $(DATAFILES) $(FILES_opt) \ + $(SHOPT_COSHELL:+-lcoshell) -lcmd -last -lm + +"sol*.i386*" :NOOPTIMIZE: main.c +"win32*" :NOOPTIMIZE: strdata.c trestore.c + +if CC.HOSTTYPE == "win32*" +:DLL: $(CC.DEBUG) +else +:DLL: $(CC.OPTIMIZE) +end + +:READONLY: $(DATAFILES) + +$(INCLUDEDIR) :INSTALLPROTO: nval.h shell.h history.h + +LIBCMD = $(.LIB.NAME. cmd:T=F) + +if SHOPT_SUID_EXEC && ! "$(RELEASE)" +suid_exec :: CC.DLL= suid_exec.c +last +end + +$(SHCOMP) :: CC.DLL= SH_DICT='"libshell"' shcomp.c $(LIBS_req) + +$(FUNDIR) :INSTALLDIR: mode=+x dirs popd pushd + +shcomp.o : _BLD_DLL= $(CC.HOSTTYPE:N=cygwin.*:??_BLD_shell=?) + +if SHOPT_BASH + +bash$(RELEASE) :LINK: $(SH) + +bash_pre_rc.c : bash_pre_rc.sh + echo "const char bash_pre_rc[] = " > $(<) + sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/'"'"'/\\'"'"'/g' -e 's/^[[:space:]]*\(.*\)$/\"\1\\n\"/' $(*) >> $(<) + echo ";" >> $(<) + +end + +:: math.tab syscall.s mamexec mamstate.c $(DOCFILES) \ + bash.c bash_pre_rc.sh hexpand.c mkservice.c \ + shopen.mk shopen.c + +:: shtests \ + alias.sh append.sh arith.sh arrays.sh arrays2.sh \ + attributes.sh basic.sh bracket.sh builtins.sh case.sh \ + comvar.sh comvario.sh coprocess.sh cubetype.sh enum.sh exit.sh \ + expand.sh functions.sh glob.sh grep.sh heredoc.sh io.sh \ + leaks.sh locale.sh math.sh nameref.sh options.sh path.sh \ + pointtype.sh pty.sh quoting.sh quoting2.sh readcsv.sh recttype.sh \ + restricted.sh return.sh select.sh shtests sigchld.sh \ + signal.sh statics.sh subshell.sh substring.sh tilde.sh \ + timetype.sh treemove.sh types.sh variables.sh \ + vartree1.sh vartree2.sh + +:: ksh-regress.rt ksh-regress.tst + +if "$(PWD:B:N=cc-*)" + +test : .NULL + +else + +test : test.ksh + +test.ksh : $(BINDIR)/$(SH) $(SH) shtests + $(SILENT) $(CMP) $(CMPFLAGS) $(*:O=1) $(*:O=2) 2>/dev/null || + echo "make install to run the tests on the latest $(SH)" >&2 + cd $(*:O=3:P=L!:D) + SHELL=$(*:O=1:P=A) $(*:O=1:P=A) $(*:O=3:B) $(SHTESTSFLAGS) + +test.% : %.sh COSHELL_OPTIONS=separate $(BINDIR)/$(SH) $(SH) shtests + $(SILENT) $(CMP) $(CMPFLAGS) $(*:O=2) $(*:O=3) 2>/dev/null || + echo "make install to run the tests on the latest $(SH)" >&2 + cd $(*:O=4:P=L!:D) + SHELL=$(*:O=2:P=A) $(*:O=2:P=A) $(*:O=4:B) $(SHTESTSFLAGS) $(*:O=1:P=A) + +if RELEASE + +.INSTALL : .CLEAR $(*.INSTALL:N=*$(RELEASE)*([!/])) + +end + +end diff --git a/src/cmd/ksh93/Mamfile b/src/cmd/ksh93/Mamfile new file mode 100644 index 0000000..5a55040 --- /dev/null +++ b/src/cmd/ksh93/Mamfile @@ -0,0 +1,1527 @@ +info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-02-29 +setv INSTALLROOT ../../.. +setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast +setv PACKAGE_ast_LIB ${INSTALLROOT}/lib +setv PACKAGEROOT ../../../../.. +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv ARFLAGS rc +setv AS as +setv ASFLAGS +setv CC cc +setv mam_cc_FLAGS +setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} +setv COTEMP $$ +setv CPIO cpio +setv CPIOFLAGS +setv CPP "${CC} -E" +setv F77 f77 +setv HOSTCC ${CC} +setv IGNORE +setv LD ld +setv LDFLAGS +setv LEX lex +setv LEXFLAGS +setv LPR lpr +setv LPRFLAGS +setv M4FLAGS +setv NMAKE nmake +setv NMAKEFLAGS +setv PR pr +setv PRFLAGS +setv SHELL /bin/sh +setv SILENT +setv TAR tar +setv YACC yacc +setv YACCFLAGS -d +make ${PACKAGEROOT}/lib/package/ast.lic +done ${PACKAGEROOT}/lib/package/ast.lic +make install +make ksh +make pmain.o +make sh/pmain.c +make FEATURE/externs implicit +meta FEATURE/externs features/%>FEATURE/% features/externs externs +make features/externs +done features/externs +exec - set - +exec - echo 'int main(){return 0;}' > 1.${COTEMP}.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c 1.${COTEMP}.c && +exec - x=`${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` && +exec - { +exec - case "" in +exec - *?) echo " " ;; +exec - esac +exec - for i in shell dll coshell cmd ast m jobs i socket nsl secdb +exec - do case $i in +exec - "shell"|shell) +exec - ;; +exec - *) if test -f ${INSTALLROOT}/lib/lib/$i +exec - then y=`cat ${INSTALLROOT}/lib/lib/$i` +exec - case $y in +exec - *-?*) echo "" $y ;; +exec - esac +exec - continue +exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a +exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in +exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in +exec - *$x*) continue ;; +exec - esac +exec - ;; +exec - esac +exec - fi +exec - ;; +exec - esac +exec - echo " -l$i" +exec - done +exec - } > shell.req +exec - rm -f 1.${COTEMP}.* +bind -ldll +bind -lcoshell +bind -lcmd +bind -last +bind -lm dontcare +bind -lnsl dontcare +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/externs +done FEATURE/externs generated +make include/shell.h implicit +make ${PACKAGE_ast_INCLUDE}/cmd.h implicit +make ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit +done ${PACKAGE_ast_INCLUDE}/dlldefs.h dontcare +make ${PACKAGE_ast_INCLUDE}/cmdext.h implicit +make ${PACKAGE_ast_INCLUDE}/shcmd.h implicit +make ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +make ${INSTALLROOT}/include/prototyped.h implicit +done ${INSTALLROOT}/include/prototyped.h dontcare +done ${PACKAGE_ast_INCLUDE}/prototyped.h dontcare +done ${PACKAGE_ast_INCLUDE}/shcmd.h dontcare +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/cmdext.h dontcare +prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit +make ${PACKAGE_ast_INCLUDE}/stak.h implicit +make ${PACKAGE_ast_INCLUDE}/stk.h implicit +make ${PACKAGE_ast_INCLUDE}/sfio.h implicit +make ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit +done ${PACKAGE_ast_INCLUDE}/sfio_s.h dontcare +make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_map.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_map.h dontcare +make ${PACKAGE_ast_INCLUDE}/endian.h implicit +make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit +done ${PACKAGE_ast_INCLUDE}/bytesex.h dontcare +done ${PACKAGE_ast_INCLUDE}/endian.h dontcare +done ${PACKAGE_ast_INCLUDE}/ast_common.h dontcare +make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit +make ${PACKAGE_ast_INCLUDE}/regex.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit +make ${PACKAGE_ast_INCLUDE}/wctype.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit +prev ${PACKAGE_ast_INCLUDE}/endian.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_wctype.h dontcare +done ${PACKAGE_ast_INCLUDE}/wctype.h dontcare +make ${PACKAGE_ast_INCLUDE}/stdio.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit +prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_stdio.h dontcare +done ${PACKAGE_ast_INCLUDE}/stdio.h dontcare +prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_wchar.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/regex.h dontcare +make ${PACKAGE_ast_INCLUDE}/getopt.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_getopt.h dontcare +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/getopt.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_botch.h dontcare +make ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_limits.h dontcare +make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_fs.h dontcare +done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit +prev ${PACKAGE_ast_INCLUDE}/getopt.h implicit +prev ${PACKAGE_ast_INCLUDE}/endian.h implicit +prev ${PACKAGE_ast_INCLUDE}/endian.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_sys.h dontcare +make ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_lib.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_std.h dontcare +done ${PACKAGE_ast_INCLUDE}/sfio.h dontcare +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/stk.h dontcare +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/stak.h dontcare +make ${PACKAGE_ast_INCLUDE}/error.h implicit +make ${PACKAGE_ast_INCLUDE}/option.h implicit +make ${PACKAGE_ast_INCLUDE}/ast.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_api.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_api.h dontcare +make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit +done ${PACKAGE_ast_INCLUDE}/vmalloc.h dontcare +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/ast.h dontcare +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/option.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/error.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/cmd.h dontcare +prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit +make include/nval.h implicit +prev ${PACKAGE_ast_INCLUDE}/option.h implicit +make ${PACKAGE_ast_INCLUDE}/cdt.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit +done ${PACKAGE_ast_INCLUDE}/cdt.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done include/nval.h dontcare +make include/name.h implicit +prev include/nval.h implicit +prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done include/name.h dontcare +prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done include/shell.h +done sh/pmain.c +meta pmain.o %.c>%.o sh/pmain.c pmain +prev sh/pmain.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_DYNAMIC -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -c sh/pmain.c +done pmain.o generated +make libshell.a archive +prev shell.req +make alarm.o +make bltins/alarm.c +make FEATURE/time implicit +meta FEATURE/time features/%>FEATURE/% features/time time +make features/time +done features/time +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/time +make ${PACKAGE_ast_INCLUDE}/times.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_time.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/times.h dontcare +done FEATURE/time generated +make include/builtins.h implicit +make include/shtable.h implicit +done include/shtable.h dontcare +make FEATURE/dynamic implicit +meta FEATURE/dynamic features/%>FEATURE/% features/dynamic dynamic +make features/dynamic +done features/dynamic +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/dynamic +make ${PACKAGE_ast_INCLUDE}/fs3d.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/fs3d.h dontcare +prev ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit +done FEATURE/dynamic dontcare generated +make FEATURE/options implicit +meta FEATURE/options features/%>FEATURE/% features/options options +make features/options +done features/options +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/options +done FEATURE/options dontcare generated +prev ${PACKAGE_ast_INCLUDE}/option.h implicit +done include/builtins.h +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +make include/defs.h implicit +make include/regress.h implicit +done include/regress.h dontcare +prev include/shtable.h implicit +prev include/shell.h implicit +make include/env.h implicit +done include/env.h dontcare +prev ${PACKAGE_ast_INCLUDE}/endian.h implicit +prev include/name.h implicit +make include/argnod.h implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +done include/argnod.h dontcare +make include/fault.h implicit +make FEATURE/sigfeatures implicit +meta FEATURE/sigfeatures features/%>FEATURE/% features/sigfeatures sigfeatures +make features/sigfeatures +done features/sigfeatures +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/sigfeatures +done FEATURE/sigfeatures dontcare generated +make FEATURE/setjmp implicit +meta FEATURE/setjmp features/%>FEATURE/% features/setjmp setjmp +make features/setjmp +done features/setjmp +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/setjmp +done FEATURE/setjmp dontcare generated +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +make ${PACKAGE_ast_INCLUDE}/sig.h implicit +done ${PACKAGE_ast_INCLUDE}/sig.h dontcare +done include/fault.h dontcare +make include/history.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done include/history.h dontcare +prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit +prev FEATURE/options implicit +prev FEATURE/externs implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done include/defs.h +done bltins/alarm.c +meta alarm.o %.c>%.o bltins/alarm.c alarm +prev bltins/alarm.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/alarm.c +done alarm.o generated +make cd_pwd.o +make bltins/cd_pwd.c +make ${PACKAGE_ast_INCLUDE}/ls.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_mode.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/ls.h +prev include/builtins.h implicit +prev include/name.h implicit +make include/path.h implicit +make FEATURE/acct implicit +meta FEATURE/acct >FEATURE/% acct +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def acct +done FEATURE/acct dontcare generated +prev include/defs.h implicit +prev include/nval.h implicit +prev FEATURE/options implicit +done include/path.h +make include/variables.h implicit +prev FEATURE/dynamic implicit +prev FEATURE/options implicit +prev ${PACKAGE_ast_INCLUDE}/option.h implicit +done include/variables.h +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev include/defs.h implicit +done bltins/cd_pwd.c +meta cd_pwd.o %.c>%.o bltins/cd_pwd.c cd_pwd +prev bltins/cd_pwd.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c bltins/cd_pwd.c +done cd_pwd.o generated +make cflow.o +make bltins/cflow.c +prev include/builtins.h implicit +make include/shnodes.h implicit +prev include/argnod.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done include/shnodes.h +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +prev include/defs.h implicit +done bltins/cflow.c +meta cflow.o %.c>%.o bltins/cflow.c cflow +prev bltins/cflow.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/cflow.c +done cflow.o generated +make deparse.o +make sh/deparse.c +make include/test.h implicit +prev include/shtable.h implicit +prev include/defs.h implicit +prev FEATURE/options implicit +done include/test.h +prev include/shnodes.h implicit +prev include/defs.h implicit +done sh/deparse.c +meta deparse.o %.c>%.o sh/deparse.c deparse +prev sh/deparse.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/deparse.c +done deparse.o generated +make enum.o +make bltins/enum.c +prev include/shell.h implicit +done bltins/enum.c +meta enum.o %.c>%.o bltins/enum.c enum +prev bltins/enum.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -Iinclude -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libshell"\" -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_DYNAMIC -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -c bltins/enum.c +done enum.o generated +make getopts.o +make bltins/getopts.c +prev include/builtins.h implicit +prev include/nval.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev include/variables.h implicit +prev include/defs.h implicit +done bltins/getopts.c +meta getopts.o %.c>%.o bltins/getopts.c getopts +prev bltins/getopts.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/getopts.c +done getopts.o generated +make hist.o +make bltins/hist.c +make include/edit.h implicit +make include/national.h implicit +done include/national.h dontcare +make include/terminal.h implicit +make FEATURE/ttys implicit +meta FEATURE/ttys features/%>FEATURE/% features/ttys ttys +make features/ttys +done features/ttys +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/ttys +done FEATURE/ttys dontcare generated +done include/terminal.h dontcare +prev FEATURE/setjmp implicit +prev ${PACKAGE_ast_INCLUDE}/sig.h implicit +make FEATURE/locale implicit +meta FEATURE/locale features/%>FEATURE/% features/locale locale +make features/locale +done features/locale +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/locale +done FEATURE/locale dontcare generated +prev FEATURE/options implicit +done include/edit.h dontcare +prev include/builtins.h implicit +prev include/history.h implicit +prev include/name.h implicit +make include/io.h implicit +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done include/io.h +prev include/variables.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev include/defs.h implicit +done bltins/hist.c +meta hist.o %.c>%.o bltins/hist.c hist +prev bltins/hist.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_BLD_shell -DSHOPT_DYNAMIC -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -c bltins/hist.c +done hist.o generated +make misc.o +make bltins/misc.c +make include/jobs.h implicit +prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit +prev include/terminal.h implicit +make ${PACKAGE_ast_INCLUDE}/coshell.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/coshell.h dontcare +prev FEATURE/options implicit +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done include/jobs.h +prev include/builtins.h implicit +prev include/history.h implicit +prev include/name.h implicit +prev include/io.h implicit +prev include/path.h implicit +prev include/shnodes.h implicit +prev include/variables.h implicit +prev include/defs.h implicit +done bltins/misc.c +meta misc.o %.c>%.o bltins/misc.c misc +prev bltins/misc.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -DSHOPT_BGX -D_API_ast=20100309 -DSHOPT_COSHELL -DSHOPT_MULTIBYTE -DSHOPT_PFSH -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_ESH -DSHOPT_FIXEDARRAY -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -c bltins/misc.c +done misc.o generated +make print.o +make bltins/print.c +make ${PACKAGE_ast_INCLUDE}/ccode.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_ccode.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_ccode.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/ccode.h +make ${PACKAGE_ast_INCLUDE}/tmx.h implicit +make ${PACKAGE_ast_INCLUDE}/tv.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done ${PACKAGE_ast_INCLUDE}/tv.h dontcare +make ${PACKAGE_ast_INCLUDE}/tm.h implicit +prev ${PACKAGE_ast_INCLUDE}/times.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/tm.h dontcare +done ${PACKAGE_ast_INCLUDE}/tmx.h +make include/streval.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_float.h implicit +prev ${PACKAGE_ast_INCLUDE}/endian.h implicit +prev ${PACKAGE_ast_INCLUDE}/endian.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_float.h dontcare +prev include/defs.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done include/streval.h +prev include/builtins.h implicit +prev include/history.h implicit +prev include/name.h implicit +prev include/io.h implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev include/defs.h implicit +done bltins/print.c +meta print.o %.c>%.o bltins/print.c print +prev bltins/print.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DKSHELL -c bltins/print.c +done print.o generated +make read.o +make bltins/read.c +prev include/edit.h implicit +prev include/terminal.h implicit +prev include/history.h implicit +prev include/builtins.h implicit +prev include/name.h implicit +prev include/io.h implicit +make include/lexstates.h implicit +prev ${PACKAGE_ast_INCLUDE}/wctype.h implicit +make ${PACKAGE_ast_INCLUDE}/wchar.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit +done ${PACKAGE_ast_INCLUDE}/wchar.h dontcare +prev FEATURE/locale implicit +done include/lexstates.h +prev include/variables.h implicit +prev include/defs.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done bltins/read.c +meta read.o %.c>%.o bltins/read.c read +prev bltins/read.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_FIXEDARRAY -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -c bltins/read.c +done read.o generated +make sleep.o +make bltins/sleep.c +make FEATURE/poll implicit +meta FEATURE/poll features/%>FEATURE/% features/poll poll +make features/poll +done features/poll +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/poll +done FEATURE/poll generated +prev FEATURE/time implicit +prev include/builtins.h implicit +prev ${PACKAGE_ast_INCLUDE}/tmx.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev include/defs.h implicit +done bltins/sleep.c +meta sleep.o %.c>%.o bltins/sleep.c sleep +prev bltins/sleep.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/sleep.c +done sleep.o generated +make trap.o +make bltins/trap.c +prev include/builtins.h implicit +prev include/jobs.h implicit +prev include/defs.h implicit +done bltins/trap.c +meta trap.o %.c>%.o bltins/trap.c trap +prev bltins/trap.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_BGX -DSHOPT_COSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/trap.c +done trap.o generated +make test.o +make bltins/test.c +prev ${PACKAGE_ast_INCLUDE}/tmx.h implicit +prev FEATURE/poll implicit +prev FEATURE/externs implicit +prev include/builtins.h implicit +prev include/test.h implicit +prev include/terminal.h implicit +prev include/io.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev include/defs.h implicit +done bltins/test.c +meta test.o %.c>%.o bltins/test.c test +prev bltins/test.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DKSHELL -c bltins/test.c +done test.o generated +make typeset.o +make bltins/typeset.c +prev FEATURE/dynamic implicit +prev include/variables.h implicit +prev include/builtins.h implicit +prev include/history.h implicit +prev include/name.h implicit +prev include/path.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev include/defs.h implicit +done bltins/typeset.c +meta typeset.o %.c>%.o bltins/typeset.c typeset +prev bltins/typeset.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FIXEDARRAY -DSHOPT_DYNAMIC -DSHOPT_NAMESPACE -DSHOPT_TYPEDEF -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_ESH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -c bltins/typeset.c +done typeset.o generated +make ulimit.o +make bltins/ulimit.c +make include/ulimit.h implicit +make FEATURE/rlimits implicit +meta FEATURE/rlimits features/%>FEATURE/% features/rlimits rlimits +make features/rlimits +done features/rlimits +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/rlimits +done FEATURE/rlimits dontcare generated +prev FEATURE/time implicit +done include/ulimit.h +prev include/name.h implicit +prev include/builtins.h implicit +prev include/defs.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done bltins/ulimit.c +meta ulimit.o %.c>%.o bltins/ulimit.c ulimit +prev bltins/ulimit.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_FIXEDARRAY -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c bltins/ulimit.c +done ulimit.o generated +make umask.o +make bltins/umask.c +prev include/builtins.h implicit +prev include/shell.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done bltins/umask.c +meta umask.o %.c>%.o bltins/umask.c umask +prev bltins/umask.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c bltins/umask.c +done umask.o generated +make whence.o +make bltins/whence.c +prev include/builtins.h implicit +make include/shlex.h implicit +prev include/lexstates.h implicit +prev include/shtable.h implicit +prev include/shnodes.h implicit +prev FEATURE/options implicit +prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit +done include/shlex.h +prev include/path.h implicit +prev include/name.h implicit +prev include/shtable.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev include/defs.h implicit +done bltins/whence.c +meta whence.o %.c>%.o bltins/whence.c whence +prev bltins/whence.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_KIA -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/whence.c +done whence.o generated +make main.o +make sh/main.c +make execargs.h implicit +done execargs.h dontcare virtual +make ${PACKAGE_ast_INCLUDE}/fts.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/fts.h dontcare +make nc.h implicit +done nc.h dontcare virtual +prev FEATURE/externs implicit +make FEATURE/execargs implicit +meta FEATURE/execargs >FEATURE/% execargs +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def execargs +done FEATURE/execargs generated +make FEATURE/pstat implicit +meta FEATURE/pstat >FEATURE/% pstat +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def pstat +done FEATURE/pstat generated +prev FEATURE/time implicit +make include/timeout.h implicit +done include/timeout.h +prev include/history.h implicit +prev include/shnodes.h implicit +prev include/shlex.h implicit +prev include/jobs.h implicit +prev include/io.h implicit +prev include/path.h implicit +prev include/variables.h implicit +prev include/defs.h implicit +make include/fcin.h implicit +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +done include/fcin.h +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done sh/main.c +meta main.o %.c>%.o sh/main.c main +prev sh/main.c +exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}} ${SHOPT_TIMEOUT+-DSHOPT_TIMEOUT=${SHOPT_TIMEOUT}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SH_DICT+-DSH_DICT=${SH_DICT}} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_BASH+-DSHOPT_BASH=${SHOPT_BASH}} ${SHOPT_REMOTE+-DSHOPT_REMOTE=${SHOPT_REMOTE}} ${SHOPT_OLDTERMIO+-DSHOPT_OLDTERMIO=${SHOPT_OLDTERMIO}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${SHOPT_FS_3D+-DSHOPT_FS_3D=${SHOPT_FS_3D}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_ESH -D_BLD_shell -DSHOPT_KIA -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_BGX -DSHOPT_COSHELL -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/main.c +done main.o generated +make nvdisc.o +make sh/nvdisc.c +prev include/path.h implicit +prev include/builtins.h implicit +prev include/variables.h implicit +prev include/defs.h implicit +done sh/nvdisc.c +meta nvdisc.o %.c>%.o sh/nvdisc.c nvdisc +prev sh/nvdisc.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_TYPEDEF -DSHOPT_SUID_EXEC -DSHOPT_PFSH -DSHOPT_BRACEPAT -D_BLD_shell -DSHOPT_STATS -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/nvdisc.c +done nvdisc.o generated +make nvtype.o +make sh/nvtype.c +prev include/variables.h implicit +prev include/io.h implicit +prev include/defs.h implicit +done sh/nvtype.c +meta nvtype.o %.c>%.o sh/nvtype.c nvtype +prev sh/nvtype.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_FIXEDARRAY -DSHOPT_NAMESPACE -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DKSHELL -DSHOPT_STATS -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/nvtype.c +done nvtype.o generated +make arith.o +make sh/arith.c +prev include/builtins.h implicit +prev include/variables.h implicit +prev include/streval.h implicit +prev include/name.h implicit +prev include/lexstates.h implicit +prev include/defs.h implicit +done sh/arith.c +meta arith.o %.c>%.o sh/arith.c arith +prev sh/arith.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FIXEDARRAY -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/arith.c +done arith.o generated +make args.o +make sh/args.c +prev include/io.h implicit +prev include/shlex.h implicit +prev FEATURE/poll implicit +prev include/edit.h implicit +prev include/terminal.h implicit +prev include/builtins.h implicit +prev include/path.h implicit +prev include/defs.h implicit +done sh/args.c +meta args.o %.c>%.o sh/args.c args +prev sh/args.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_OPTIMIZE -DSHOPT_RAWONLY -DSHOPT_HISTEXPAND -DSHOPT_PFSH -D_BLD_shell -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -DSHOPT_KIA -DSHOPT_MULTIBYTE -DSHOPT_EDPREDICT -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_DYNAMIC -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/args.c +done args.o generated +make array.o +make sh/array.c +prev include/name.h implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev include/defs.h implicit +done sh/array.c +meta array.o %.c>%.o sh/array.c array +prev sh/array.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_FIXEDARRAY -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/array.c +done array.o generated +make completion.o +make edit/completion.c +prev include/history.h implicit +prev include/edit.h implicit +prev include/io.h implicit +prev include/path.h implicit +prev include/lexstates.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit +prev include/defs.h implicit +done edit/completion.c +meta completion.o %.c>%.o edit/completion.c completion +prev edit/completion.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -DSHOPT_ESH -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DKSHELL -DSHOPT_VSH -DSHOPT_PFSH -D_BLD_shell -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/completion.c +done completion.o generated +make defs.o +make sh/defs.c +prev include/timeout.h implicit +prev include/edit.h implicit +prev include/shlex.h implicit +prev include/jobs.h implicit +prev include/defs.h implicit +done sh/defs.c +meta defs.o %.c>%.o sh/defs.c defs +prev sh/defs.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_KIA -D_BLD_shell -D_API_ast=20100309 -DSHOPT_BGX -DSHOPT_COSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/defs.c +done defs.o generated +make edit.o +make edit/edit.c +prev include/edit.h implicit +prev include/history.h implicit +prev include/terminal.h implicit +prev include/io.h implicit +prev include/variables.h implicit +prev include/defs.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +make FEATURE/cmds implicit +meta FEATURE/cmds features/%>FEATURE/% features/cmds cmds +make features/cmds +done features/cmds +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/cmds +done FEATURE/cmds generated +prev FEATURE/time implicit +prev FEATURE/options implicit +prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done edit/edit.c +meta edit.o %.c>%.o edit/edit.c edit +prev edit/edit.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_EDPREDICT -DSHOPT_RAWONLY -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_MULTIBYTE -DSHOPT_HISTEXPAND -DKSHELL -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/edit.c +done edit.o generated +make expand.o +make sh/expand.c +prev include/path.h implicit +prev include/io.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_dir.h implicit +make ${PACKAGE_ast_INCLUDE}/dirent.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_dirent.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_dirent.h dontcare +done ${PACKAGE_ast_INCLUDE}/dirent.h dontcare +make dirlib.h implicit +done dirlib.h dontcare virtual +prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_dir.h +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +make ${PACKAGE_ast_INCLUDE}/glob.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/glob.h +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +prev include/test.h implicit +prev include/variables.h implicit +prev include/defs.h implicit +done sh/expand.c +meta expand.o %.c>%.o sh/expand.c expand +prev sh/expand.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DSHOPT_SUID_EXEC -DSHOPT_PFSH -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DKSHELL -c sh/expand.c +done expand.o generated +make regress.o +make bltins/regress.c +prev ${PACKAGE_ast_INCLUDE}/tmx.h implicit +prev include/builtins.h implicit +prev include/io.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev include/defs.h implicit +done bltins/regress.c +meta regress.o %.c>%.o bltins/regress.c regress +prev bltins/regress.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DKSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/regress.c +done regress.o generated +make fault.o +make sh/fault.c +prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit +prev include/ulimit.h implicit +prev include/builtins.h implicit +prev include/path.h implicit +prev include/jobs.h implicit +prev include/variables.h implicit +prev include/shlex.h implicit +prev include/history.h implicit +prev include/io.h implicit +prev include/fcin.h implicit +prev include/defs.h implicit +done sh/fault.c +meta fault.o %.c>%.o sh/fault.c fault +prev sh/fault.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_KIA -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_TYPEDEF -DSHOPT_BGX -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DKSHELL -c sh/fault.c +done fault.o generated +make fcin.o +make sh/fcin.c +prev include/fcin.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done sh/fcin.c +meta fcin.o %.c>%.o sh/fcin.c fcin +prev sh/fcin.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -c sh/fcin.c +done fcin.o generated +make history.o +make edit/history.c +prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit +prev include/history.h implicit +prev include/io.h implicit +prev include/builtins.h implicit +prev include/path.h implicit +prev include/variables.h implicit +prev include/defs.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev FEATURE/time implicit +prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done edit/history.c +meta history.o %.c>%.o edit/history.c history +prev edit/history.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_VSH -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_AUDITFILE=\""/etc/ksh_audit"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DSHOPT_DYNAMIC -DSHOPT_PFSH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/history.c +done history.o generated +make init.o +make sh/init.c +prev ${PACKAGE_ast_INCLUDE}/wctype.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit +make include/version.h implicit +done include/version.h +prev include/lexstates.h implicit +prev FEATURE/externs implicit +prev FEATURE/dynamic implicit +prev FEATURE/time implicit +prev include/builtins.h implicit +prev include/shlex.h implicit +prev include/io.h implicit +prev include/jobs.h implicit +prev include/edit.h implicit +prev include/name.h implicit +prev include/fault.h implicit +prev include/path.h implicit +prev include/variables.h implicit +prev ${PACKAGE_ast_INCLUDE}/tmx.h implicit +prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev include/defs.h implicit +done sh/init.c +meta init.o %.c>%.o sh/init.c init +prev sh/init.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_2DMATCH -DSHOPT_PFSH -DSHOPT_MULTIBYTE -DSHOPT_BGX -DSHOPT_COSHELL -D_PACKAGE_ast -DSHOPT_DYNAMIC -D_API_ast=20100309 -D_BLD_shell -DSHOPT_KIA -DKSHELL -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_FIXEDARRAY -DERROR_CONTEXT_T=Error_context_t -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -c sh/init.c +done init.o generated +make io.o +make sh/io.c +prev ${PACKAGE_ast_INCLUDE}/endian.h implicit +prev FEATURE/poll implicit +prev FEATURE/dynamic implicit +prev FEATURE/externs implicit +prev include/timeout.h implicit +prev include/edit.h implicit +prev include/history.h implicit +prev include/shnodes.h implicit +prev include/jobs.h implicit +prev include/io.h implicit +prev include/path.h implicit +prev include/variables.h implicit +prev ${PACKAGE_ast_INCLUDE}/regex.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev include/fcin.h implicit +prev include/defs.h implicit +done sh/io.c +meta io.o %.c>%.o sh/io.c io +prev sh/io.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_RAWONLY -DSHOPT_VSH -DSHOPT_ESH -DSHOPT_HISTEXPAND -DSHOPT_COSHELL -DSHOPT_DYNAMIC -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_BGX -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/io.c +done io.o generated +make jobs.o +make sh/jobs.c +prev include/history.h implicit +prev include/jobs.h implicit +prev include/io.h implicit +make ${PACKAGE_ast_INCLUDE}/wait.h implicit +make ${PACKAGE_ast_INCLUDE}/ast_wait.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_wait.h dontcare +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit +done ${PACKAGE_ast_INCLUDE}/wait.h +prev include/defs.h implicit +done sh/jobs.c +meta jobs.o %.c>%.o sh/jobs.c jobs +prev sh/jobs.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_VSH -DSHOPT_COSHELL -DSHOPT_BGX -DSHOPT_ESH -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_MULTIBYTE -DSHOPT_PFSH -D_BLD_shell -DKSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/jobs.c +done jobs.o generated +make lex.o +make sh/lex.c +prev include/shlex.h implicit +prev include/io.h implicit +prev include/lexstates.h implicit +prev include/test.h implicit +prev include/argnod.h implicit +prev include/shell.h implicit +prev include/defs.h implicit +prev FEATURE/options implicit +prev include/nval.h implicit +prev include/fcin.h implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done sh/lex.c +meta lex.o %.c>%.o sh/lex.c lex +prev sh/lex.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_MULTIBYTE -DSHOPT_KIA -D_PACKAGE_ast -D_BLD_shell -D_API_ast=20100309 -DSHOPT_PFSH -DKSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c sh/lex.c +done lex.o generated +make macro.o +make sh/macro.c +prev include/streval.h implicit +prev include/national.h implicit +prev include/path.h implicit +prev include/shnodes.h implicit +prev include/jobs.h implicit +prev include/io.h implicit +prev include/shlex.h implicit +prev include/variables.h implicit +prev include/name.h implicit +prev include/fcin.h implicit +prev include/defs.h implicit +done sh/macro.c +meta macro.o %.c>%.o sh/macro.c macro +prev sh/macro.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DKSHELL -DSHOPT_COSHELL -DSHOPT_OPTIMIZE -DSHOPT_FIXEDARRAY -DSHOPT_TYPEDEF -DSHOPT_FILESCAN -DSHOPT_MULTIBYTE -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_ESH -DSHOPT_SUID_EXEC -DSHOPT_BGX -DSHOPT_KIA -c sh/macro.c +done macro.o generated +make name.o +make sh/name.c +prev include/builtins.h implicit +prev include/shnodes.h implicit +prev include/streval.h implicit +prev FEATURE/externs implicit +prev include/timeout.h implicit +prev include/lexstates.h implicit +prev include/path.h implicit +prev include/variables.h implicit +prev include/defs.h implicit +done sh/name.c +meta name.o %.c>%.o sh/name.c name +prev sh/name.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_OPTIMIZE -DSHOPT_FIXEDARRAY -DSHOPT_NAMESPACE -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_TYPEDEF -DSHOPT_STATS -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -c sh/name.c +done name.o generated +make nvtree.o +make sh/nvtree.c +prev include/lexstates.h implicit +prev include/argnod.h implicit +prev include/name.h implicit +prev include/defs.h implicit +done sh/nvtree.c +meta nvtree.o %.c>%.o sh/nvtree.c nvtree +prev sh/nvtree.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FIXEDARRAY -DSHOPT_MULTIBYTE -D_PACKAGE_ast -D_BLD_shell -D_API_ast=20100309 -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/nvtree.c +done nvtree.o generated +make parse.o +make sh/parse.c +prev include/path.h implicit +prev include/test.h implicit +prev include/builtins.h implicit +prev include/history.h implicit +prev include/shlex.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev include/fcin.h implicit +prev include/shell.h implicit +prev include/defs.h implicit +done sh/parse.c +meta parse.o %.c>%.o sh/parse.c parse +prev sh/parse.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_SUID_EXEC -DSHOPT_PFSH -DSHOPT_BRACEPAT -D_BLD_shell -DSHOPT_STATS -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_KIA -DKSHELL -c sh/parse.c +done parse.o generated +make path.o +make sh/path.c +prev FEATURE/time implicit +make ${PACKAGE_ast_INCLUDE}/ast_vfork.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_vfork.h dontcare +make exec_attr.h implicit +done exec_attr.h dontcare virtual +prev FEATURE/externs implicit +prev FEATURE/dynamic implicit +prev include/test.h implicit +prev include/history.h implicit +prev include/jobs.h implicit +prev include/io.h implicit +prev include/path.h implicit +prev include/variables.h implicit +prev include/nval.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev include/fcin.h implicit +prev include/defs.h implicit +done sh/path.c +meta path.o %.c>%.o sh/path.c path +prev sh/path.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_NAMESPACE -DSHOPT_DYNAMIC -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_BGX -DKSHELL -DSHOPT_BRACEPAT -c sh/path.c +done path.o generated +make string.o +make sh/string.c +prev ${PACKAGE_ast_INCLUDE}/wctype.h implicit +prev include/national.h implicit +prev include/lexstates.h implicit +prev include/shtable.h implicit +prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev include/defs.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done sh/string.c +meta string.o %.c>%.o sh/string.c string +prev sh/string.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c sh/string.c +done string.o generated +make streval.o +make sh/streval.c +prev include/defs.h implicit +prev FEATURE/externs implicit +prev ${PACKAGE_ast_INCLUDE}/stak.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev include/streval.h implicit +done sh/streval.c +meta streval.o %.c>%.o sh/streval.c streval +prev sh/streval.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/streval.c +done streval.o generated +make subshell.o +make sh/subshell.c +prev include/path.h implicit +prev include/variables.h implicit +prev include/jobs.h implicit +prev include/shlex.h implicit +prev include/shnodes.h implicit +prev include/fault.h implicit +prev include/io.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev include/defs.h implicit +done sh/subshell.c +meta subshell.o %.c>%.o sh/subshell.c subshell +prev sh/subshell.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_COSHELL -DSHOPT_SUID_EXEC -DSHOPT_PFSH -DSHOPT_BRACEPAT -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_BGX -DSHOPT_KIA -DKSHELL -c sh/subshell.c +done subshell.o generated +make tdump.o +make sh/tdump.c +prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit +prev include/io.h implicit +prev include/path.h implicit +prev include/shnodes.h implicit +prev include/defs.h implicit +done sh/tdump.c +meta tdump.o %.c>%.o sh/tdump.c tdump +prev sh/tdump.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -DSHOPT_SUID_EXEC -DSHOPT_PFSH -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/tdump.c +done tdump.o generated +make timers.o +make sh/timers.c +prev FEATURE/time implicit +prev FEATURE/sigfeatures implicit +prev include/defs.h implicit +prev include/fault.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/sig.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done sh/timers.c +meta timers.o %.c>%.o sh/timers.c timers +prev sh/timers.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/timers.c +done timers.o generated +make trestore.o +make sh/trestore.c +prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit +prev include/io.h implicit +prev include/path.h implicit +prev include/shnodes.h implicit +prev include/defs.h implicit +done sh/trestore.c +meta trestore.o %.c>%.o sh/trestore.c trestore +prev sh/trestore.c +exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SHOPT_BASH+-DSHOPT_BASH=${SHOPT_BASH}} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -DSHOPT_SUID_EXEC -DSHOPT_PFSH -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/trestore.c +done trestore.o generated +make waitevent.o +make sh/waitevent.c +prev include/defs.h implicit +done sh/waitevent.c +meta waitevent.o %.c>%.o sh/waitevent.c waitevent +prev sh/waitevent.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/waitevent.c +done waitevent.o generated +make xec.o +make sh/xec.c +prev ${PACKAGE_ast_INCLUDE}/ast_vfork.h implicit +prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit +prev include/streval.h implicit +prev FEATURE/locale implicit +prev FEATURE/externs implicit +prev FEATURE/time implicit +prev include/builtins.h implicit +prev include/test.h implicit +prev include/jobs.h implicit +prev include/shnodes.h implicit +prev include/io.h implicit +prev include/name.h implicit +prev include/path.h implicit +prev include/variables.h implicit +prev include/fcin.h implicit +prev include/defs.h implicit +done sh/xec.c +meta xec.o %.c>%.o sh/xec.c xec +prev sh/xec.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FILESCAN -DSHOPT_BGX -DSHOPT_TYPEDEF -DSHOPT_PFSH -DSHOPT_COSHELL -DSHOPT_NAMESPACE -DSHOPT_OPTIMIZE -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -c sh/xec.c +done xec.o generated +make env.o +make sh/env.c +prev include/env.h implicit +prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done sh/env.c +meta env.o %.c>%.o sh/env.c env +prev sh/env.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -c sh/env.c +done env.o generated +make limits.o +make data/limits.c +prev include/ulimit.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done data/limits.c +meta limits.o %.c>%.o data/limits.c limits +prev data/limits.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -c data/limits.c +done limits.o generated +make msg.o +make data/msg.c +prev FEATURE/cmds implicit +prev include/edit.h implicit +prev include/jobs.h implicit +prev include/builtins.h implicit +prev include/history.h implicit +prev include/timeout.h implicit +prev include/shlex.h implicit +prev include/io.h implicit +prev include/path.h implicit +prev include/defs.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done data/msg.c +meta msg.o %.c>%.o data/msg.c msg +prev data/msg.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_SUID_EXEC -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_BGX -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_KIA -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c data/msg.c +done msg.o generated +make strdata.o +make data/strdata.c +make FEATURE/math implicit +meta FEATURE/math features/%.sh>FEATURE/% features/math.sh math +make features/math.sh +make data/math.tab implicit +done data/math.tab +done features/math.sh dontcare +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/math.sh data/math.tab +make ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit +done ${PACKAGE_ast_INCLUDE}/ast_standards.h dontcare +done FEATURE/math generated +prev include/streval.h implicit +prev FEATURE/options implicit +prev ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit +done data/strdata.c +meta strdata.o %.c>%.o data/strdata.c strdata +prev data/strdata.c +exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SHOPT_BASH+-DSHOPT_BASH=${SHOPT_BASH}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/strdata.c +done strdata.o generated +make testops.o +make data/testops.c +prev include/test.h implicit +prev include/defs.h implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done data/testops.c +meta testops.o %.c>%.o data/testops.c testops +prev data/testops.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/testops.c +done testops.o generated +make keywords.o +make data/keywords.c +prev FEATURE/options implicit +prev include/shlex.h implicit +prev include/shell.h implicit +done data/keywords.c +meta keywords.o %.c>%.o data/keywords.c keywords +prev data/keywords.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_NAMESPACE -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_KIA -D_BLD_shell -D_API_ast=20100309 -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c data/keywords.c +done keywords.o generated +make options.o +make data/options.c +prev include/shtable.h implicit +prev include/name.h implicit +prev include/defs.h implicit +done data/options.c +meta options.o %.c>%.o data/options.c options +prev data/options.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/options.c +done options.o generated +make signals.o +make data/signals.c +prev include/defs.h implicit +done data/signals.c +meta signals.o %.c>%.o data/signals.c signals +prev data/signals.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/signals.c +done signals.o generated +make aliases.o +make data/aliases.c +prev FEATURE/dynamic implicit +prev FEATURE/options implicit +prev include/defs.h implicit +done data/aliases.c +meta aliases.o %.c>%.o data/aliases.c aliases +prev data/aliases.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c data/aliases.c +done aliases.o generated +make builtins.o +make data/builtins.c +prev FEATURE/cmds implicit +prev include/jobs.h implicit +prev include/builtins.h implicit +prev include/version.h implicit +prev include/name.h implicit +prev include/ulimit.h implicit +prev include/shtable.h implicit +prev include/defs.h implicit +done data/builtins.c +meta builtins.o %.c>%.o data/builtins.c builtins +prev data/builtins.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_KIA -DSHOPT_PFSH -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_BRACEPAT -DSHOPT_HISTEXPAND -DSHOPT_COSHELL -D_PACKAGE_ast -DSHOPT_BGX -D_API_ast=20100309 -DSHOPT_MULTIBYTE -D_BLD_shell -DSHOPT_DYNAMIC -DKSHELL -DSHOPT_FIXEDARRAY -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c data/builtins.c +done builtins.o generated +make variables.o +make data/variables.c +prev include/builtins.h implicit +prev include/variables.h implicit +prev include/defs.h implicit +prev include/name.h implicit +prev include/shtable.h implicit +prev include/shell.h implicit +prev FEATURE/dynamic implicit +prev FEATURE/options implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done data/variables.c +meta variables.o %.c>%.o data/variables.c variables +prev data/variables.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_MULTIBYTE -D_BLD_shell -DSHOPT_DYNAMIC -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c data/variables.c +done variables.o generated +make lexstates.o +make data/lexstates.c +prev include/lexstates.h implicit +prev FEATURE/options implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done data/lexstates.c +meta lexstates.o %.c>%.o data/lexstates.c lexstates +prev data/lexstates.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DSHOPT_TYPEDEF -DSHOPT_NAMESPACE -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -c data/lexstates.c +done lexstates.o generated +make emacs.o +make edit/emacs.c +prev include/terminal.h implicit +prev include/edit.h implicit +prev include/history.h implicit +prev include/io.h implicit +prev include/defs.h implicit +prev FEATURE/cmds implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done edit/emacs.c +meta emacs.o %.c>%.o edit/emacs.c emacs +prev edit/emacs.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DSHOPT_HISTEXPAND -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/emacs.c +done emacs.o generated +make vi.o +make edit/vi.c +prev include/lexstates.h implicit +prev FEATURE/time implicit +prev include/terminal.h implicit +prev include/edit.h implicit +prev include/history.h implicit +prev include/io.h implicit +prev FEATURE/options implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +prev include/defs.h implicit +done edit/vi.c +meta vi.o %.c>%.o edit/vi.c vi +prev edit/vi.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_EDPREDICT -DSHOPT_RAWONLY -DSHOPT_MULTIBYTE -D_PACKAGE_ast -D_API_ast=20100309 -DSHOPT_HISTEXPAND -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_PFSH -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/vi.c +done vi.o generated +make hexpand.o +make edit/hexpand.c +prev include/edit.h implicit +prev include/defs.h implicit +done edit/hexpand.c +meta hexpand.o %.c>%.o edit/hexpand.c hexpand +prev edit/hexpand.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_DYNAMIC -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -c edit/hexpand.c +done hexpand.o generated +exec - ${AR} rc libshell.a alarm.o cd_pwd.o cflow.o deparse.o enum.o getopts.o hist.o misc.o print.o read.o sleep.o trap.o test.o typeset.o ulimit.o umask.o whence.o main.o nvdisc.o nvtype.o arith.o args.o array.o completion.o defs.o edit.o expand.o regress.o fault.o fcin.o +exec - ${AR} rc libshell.a history.o init.o io.o jobs.o lex.o macro.o name.o nvtree.o parse.o path.o string.o streval.o subshell.o tdump.o timers.o trestore.o waitevent.o xec.o env.o limits.o msg.o strdata.o testops.o keywords.o options.o signals.o aliases.o builtins.o variables.o lexstates.o emacs.o vi.o hexpand.o +exec - (ranlib libshell.a) >/dev/null 2>&1 || true +done libshell.a generated +bind -lshell +prev +ljobs +prev +li +prev ${mam_libsocket} +prev ${mam_libsecdb} +exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh pmain.o ${mam_libshell} ${mam_libnsl} ${mam_libast} +done ksh generated +make shcomp +make shcomp.o +make sh/shcomp.c +prev include/shnodes.h implicit +prev include/defs.h implicit +prev include/shell.h implicit +done sh/shcomp.c +meta shcomp.o %.c>%.o sh/shcomp.c shcomp +prev sh/shcomp.c +setv CC.DLL -UCC.DLL +setv SH_DICT -DSH_DICT="\"libshell\"" +setv _BLD_shell -U_BLD_shell +setv _BLD_DLL -U_BLD_DLL +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DSH_DICT=\""libshell"\" -D_PACKAGE_ast -D_API_ast=20100309 -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -c sh/shcomp.c +done shcomp.o generated +prev libshell.a archive +prev +ljobs +prev +li +prev ${mam_libsocket} +prev ${mam_libsecdb} +setv CC.DLL -UCC.DLL +setv SH_DICT -DSH_DICT="\"libshell\"" +exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libnsl} ${mam_libast} +done shcomp generated +make suid_exec +make suid_exec.o +make sh/suid_exec.c +prev include/version.h implicit +prev ${PACKAGE_ast_INCLUDE}/error.h implicit +prev ${PACKAGE_ast_INCLUDE}/sig.h implicit +prev ${PACKAGE_ast_INCLUDE}/ls.h implicit +prev FEATURE/externs implicit +prev ${PACKAGE_ast_INCLUDE}/ast.h implicit +done sh/suid_exec.c +meta suid_exec.o %.c>%.o sh/suid_exec.c suid_exec +prev sh/suid_exec.c +setv CC.DLL -UCC.DLL +setv _BLD_shell -U_BLD_shell +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -D_PACKAGE_ast -c sh/suid_exec.c +done suid_exec.o generated +prev +ljobs +prev +li +prev ${mam_libsocket} +prev ${mam_libsecdb} +setv CC.DLL -UCC.DLL +exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o suid_exec suid_exec.o ${mam_libast} ${mam_libnsl} ${mam_libast} +done suid_exec generated +make shell +prev libshell.a archive +done shell virtual +prev libshell.a archive +make ${INSTALLROOT}/bin +exec - if silent test ! -d ${INSTALLROOT}/bin +exec - then mkdir -p ${INSTALLROOT}/bin +exec - fi +done ${INSTALLROOT}/bin generated +make ${INSTALLROOT}/bin/ksh +prev ${INSTALLROOT}/bin +prev ksh +exec - test '' = 'ksh' || ${STDCMP} 2>/dev/null -s ksh ${INSTALLROOT}/bin/ksh || { ${STDMV} ${INSTALLROOT}/bin/ksh ${INSTALLROOT}/bin/ksh.old 2>/dev/null || true; ${STDCP} ksh ${INSTALLROOT}/bin/ksh ;} +done ${INSTALLROOT}/bin/ksh generated +make ${INSTALLROOT}/man/man1 +exec - if silent test ! -d ${INSTALLROOT}/man/man1 +exec - then mkdir -p ${INSTALLROOT}/man/man1 +exec - fi +done ${INSTALLROOT}/man/man1 generated +make ${INSTALLROOT}/man/man1/sh.1 +prev ${INSTALLROOT}/man/man1 +make sh.1 +done sh.1 +exec - test '' = 'sh.1' || ${STDCMP} 2>/dev/null -s sh.1 ${INSTALLROOT}/man/man1/sh.1 || { ${STDMV} ${INSTALLROOT}/man/man1/sh.1 ${INSTALLROOT}/man/man1/sh.1.old 2>/dev/null || true; ${STDCP} sh.1 ${INSTALLROOT}/man/man1/sh.1 ;} +done ${INSTALLROOT}/man/man1/sh.1 generated +make ${INSTALLROOT}/lib +exec - if silent test ! -d ${INSTALLROOT}/lib +exec - then mkdir -p ${INSTALLROOT}/lib +exec - fi +done ${INSTALLROOT}/lib generated +make ${INSTALLROOT}/lib/libshell.a archive +prev ${INSTALLROOT}/lib +prev libshell.a archive +exec - test '' = 'libshell.a' || ${STDCMP} 2>/dev/null -s libshell.a ${INSTALLROOT}/lib/libshell.a || { ${STDMV} ${INSTALLROOT}/lib/libshell.a ${INSTALLROOT}/lib/libshell.a.old 2>/dev/null || true; ${STDCP} libshell.a ${INSTALLROOT}/lib/libshell.a ;} +exec - (ranlib ${INSTALLROOT}/lib/libshell.a) >/dev/null 2>&1 || true +done ${INSTALLROOT}/lib/libshell.a generated +make ${INSTALLROOT}/man/man3 +exec - if silent test ! -d ${INSTALLROOT}/man/man3 +exec - then mkdir -p ${INSTALLROOT}/man/man3 +exec - fi +done ${INSTALLROOT}/man/man3 generated +make ${INSTALLROOT}/man/man3/shell.3 +prev ${INSTALLROOT}/man/man3 +make shell.3 +done shell.3 +exec - test '' = 'shell.3' || ${STDCMP} 2>/dev/null -s shell.3 ${INSTALLROOT}/man/man3/shell.3 || { ${STDMV} ${INSTALLROOT}/man/man3/shell.3 ${INSTALLROOT}/man/man3/shell.3.old 2>/dev/null || true; ${STDCP} shell.3 ${INSTALLROOT}/man/man3/shell.3 ;} +done ${INSTALLROOT}/man/man3/shell.3 generated +make ${INSTALLROOT}/man/man3/nval.3 +make nval.3 +done nval.3 +exec - test '' = 'nval.3' || ${STDCMP} 2>/dev/null -s nval.3 ${INSTALLROOT}/man/man3/nval.3 || { ${STDMV} ${INSTALLROOT}/man/man3/nval.3 ${INSTALLROOT}/man/man3/nval.3.old 2>/dev/null || true; ${STDCP} nval.3 ${INSTALLROOT}/man/man3/nval.3 ;} +done ${INSTALLROOT}/man/man3/nval.3 generated +make ${INSTALLROOT}/lib/lib +exec - if silent test ! -d ${INSTALLROOT}/lib/lib +exec - then mkdir -p ${INSTALLROOT}/lib/lib +exec - fi +done ${INSTALLROOT}/lib/lib generated +make ${INSTALLROOT}/lib/lib/shell +prev ${INSTALLROOT}/lib/lib +prev shell.req +exec - test '' = 'shell.req' || ${STDCMP} 2>/dev/null -s shell.req ${INSTALLROOT}/lib/lib/shell || { ${STDMV} ${INSTALLROOT}/lib/lib/shell ${INSTALLROOT}/lib/lib/shell.old 2>/dev/null || true; ${STDCP} shell.req ${INSTALLROOT}/lib/lib/shell ;} +done ${INSTALLROOT}/lib/lib/shell generated +make ${PACKAGE_ast_INCLUDE} +exec - if silent test ! -d ${PACKAGE_ast_INCLUDE} +exec - then mkdir -p ${PACKAGE_ast_INCLUDE} +exec - fi +done ${PACKAGE_ast_INCLUDE} generated +make ${PACKAGE_ast_INCLUDE}/nval.h +prev ${PACKAGE_ast_INCLUDE} +prev include/nval.h +exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1982,author=dgk' include/nval.h > 1.${COTEMP}.x +exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/nval.h 1.${COTEMP}.x +exec - then rm -f 1.${COTEMP}.x +exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/nval.h +exec - fi +done ${PACKAGE_ast_INCLUDE}/nval.h generated +make ${PACKAGE_ast_INCLUDE}/shell.h +prev include/shell.h +exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1982,author=dgk' include/shell.h > 1.${COTEMP}.x +exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/shell.h 1.${COTEMP}.x +exec - then rm -f 1.${COTEMP}.x +exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/shell.h +exec - fi +done ${PACKAGE_ast_INCLUDE}/shell.h generated +make ${PACKAGE_ast_INCLUDE}/history.h +prev include/history.h +exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1982,author=dgk' include/history.h > 1.${COTEMP}.x +exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/history.h 1.${COTEMP}.x +exec - then rm -f 1.${COTEMP}.x +exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/history.h +exec - fi +done ${PACKAGE_ast_INCLUDE}/history.h generated +make ${INSTALLROOT}/bin/suid_exec +prev suid_exec +exec - test '' = 'suid_exec' || ${STDCMP} 2>/dev/null -s suid_exec ${INSTALLROOT}/bin/suid_exec || { ${STDMV} ${INSTALLROOT}/bin/suid_exec ${INSTALLROOT}/bin/suid_exec.old 2>/dev/null || true; ${STDCP} suid_exec ${INSTALLROOT}/bin/suid_exec ;} +done ${INSTALLROOT}/bin/suid_exec generated +make ${INSTALLROOT}/bin/shcomp +prev shcomp +exec - test '' = 'shcomp' || ${STDCMP} 2>/dev/null -s shcomp ${INSTALLROOT}/bin/shcomp || { ${STDMV} ${INSTALLROOT}/bin/shcomp ${INSTALLROOT}/bin/shcomp.old 2>/dev/null || true; ${STDCP} shcomp ${INSTALLROOT}/bin/shcomp ;} +done ${INSTALLROOT}/bin/shcomp generated +make ${INSTALLROOT}/fun +exec - if silent test ! -d ${INSTALLROOT}/fun +exec - then mkdir -p ${INSTALLROOT}/fun +exec - fi +done ${INSTALLROOT}/fun generated +make ${INSTALLROOT}/fun/dirs +prev ${INSTALLROOT}/fun +make fun/dirs +done fun/dirs +setv mode -Dmode="+x" +exec - test '' = 'fun/dirs' || ${STDCMP} 2>/dev/null -s fun/dirs ${INSTALLROOT}/fun/dirs || { ${STDMV} ${INSTALLROOT}/fun/dirs ${INSTALLROOT}/fun/dirs.old 2>/dev/null || true; ${STDCP} fun/dirs ${INSTALLROOT}/fun/dirs && chmod ugo+x ${INSTALLROOT}/fun/dirs ;} +done ${INSTALLROOT}/fun/dirs generated +make ${INSTALLROOT}/fun/popd +make fun/popd +done fun/popd +setv mode -Dmode="+x" +exec - test '' = 'fun/popd' || ${STDCMP} 2>/dev/null -s fun/popd ${INSTALLROOT}/fun/popd || { ${STDMV} ${INSTALLROOT}/fun/popd ${INSTALLROOT}/fun/popd.old 2>/dev/null || true; ${STDCP} fun/popd ${INSTALLROOT}/fun/popd && chmod ugo+x ${INSTALLROOT}/fun/popd ;} +done ${INSTALLROOT}/fun/popd generated +make ${INSTALLROOT}/fun/pushd +make fun/pushd +done fun/pushd +setv mode -Dmode="+x" +exec - test '' = 'fun/pushd' || ${STDCMP} 2>/dev/null -s fun/pushd ${INSTALLROOT}/fun/pushd || { ${STDMV} ${INSTALLROOT}/fun/pushd ${INSTALLROOT}/fun/pushd.old 2>/dev/null || true; ${STDCP} fun/pushd ${INSTALLROOT}/fun/pushd && chmod ugo+x ${INSTALLROOT}/fun/pushd ;} +done ${INSTALLROOT}/fun/pushd generated +done install virtual +make test +make test.ksh +prev ${INSTALLROOT}/bin/ksh +prev ksh +make tests/shtests +done tests/shtests +exec - silent cmp 2>/dev/null -s ${INSTALLROOT}/bin/ksh ksh 2>/dev/null || +exec - echo "make install to run the tests on the latest ksh" >&2 +exec - cd ${PACKAGEROOT}/src/cmd/ksh93/tests +exec - SHELL=${INSTALLROOT}/bin/ksh ${INSTALLROOT}/bin/ksh shtests +done test.ksh virtual +done test dontcare virtual diff --git a/src/cmd/ksh93/OBSOLETE b/src/cmd/ksh93/OBSOLETE new file mode 100644 index 0000000..c29cb8b --- /dev/null +++ b/src/cmd/ksh93/OBSOLETE @@ -0,0 +1,152 @@ +.sp 3 +.tl ''Ksh Features That Are Obsolete in Ksh93'' +.sp 2 +.AL 1 +.LI +Using a pair of grave accents \^\fB\(ga\fR ... \fB\(ga\fR\^ +for command substition. Use \fB$(\fR ... \fB)\fR instead. +.LI +.B FCEDIT +is an obsolete name for +the default editor name for the +.B hist +command. +.B FCEDIT +is not used when +.B HISTEDIT +is set. Use +.B HISTEDIT +instead. +.LI +The newtest (\fB[[\fR ... \fB]]\fR) operator +\fB\-a\fP \fIfile\fP +is obsolete. Use +\fB\-e\fP instead. +.LI +The newtest (\fB[[\fR ... \fB]]\fR) operator +.BR = , +as used in +\fIstring\fP \fB=\fP \fIpattern\fP +is obsolete. Use +\fB==\fP instead. +.LI +The following obsolete arithmetic comparisons are also permitted: +.in +5 +.VL 20 +.LI "\fIexp1\fP \fB\-eq\fP \fIexp2\fP" +True, if +.I exp1 +is equal to +.IR exp2 . +.LI "\fIexp1\fP \fB\-ne\fP \fIexp2\fP" +True, if +.I exp1 +is not equal to +.IR exp2 . +.LI "\fIexp1\fP \fB\-lt\fP \fIexp2\fP" +True, if +.I exp1 +is less than +.IR exp2 . +.LI "\fIexp1\fP \fB\-gt\fP \fIexp2\fP" +True, if +.I exp1 +is greater than +.IR exp2 . +.LI "\fIexp1\fP \fB\-le\fP \fIexp2\fP" +True, if +.I exp1 +is less than or equal to +.IR exp2 . +.LI "\fIexp1\fP \fB\-ge\fP \fIexp2\fP" +True, if +.I exp1 +is greater than or equal to +.IR exp2 . +.LE \" End .VL +.in -5 +.LI +Using test -t or [ -t ] without specifying the file unit number. +.LI +The +.B \-k +option to the \fBset\fR builtin is obsolete. It causes +.I all\^ +variable assignment arguments are placed in the environment, +even if they occur after the command name. +The following +first prints +.B "a=b c" +and then +.BR c : +There is no alternative. +.LI +The obsolete +.B \-xf +option of the +.B typeset +command allows a function to be exported +to scripts that are executed without a separate +invocation of the shell. +Functions that need to be defined across separate +invocations of the shell should +be placed in a directory and the +.B FPATH +variable should contains the name of this directory. +They may also +be specified in the +.B ENV +file with the +.B \-xf +option of +.BR typeset . +.LI +The shell environment variable +.B FCEDIT +is obsolete. Use +.B HISTEDIT +instead. +.LI +In the +.B \-s +option +(to \fBfc\fR or \fBhist\fR command???) +( +and in obsolete versions, the editor name +.B \- +) +is used to skip the editing phase and +to re-execute the command. +.LI +The +.B \-t +option to \fBalias\fR builtin is is obsolete. It +is used to set and list tracked aliases. +There is no replacement. +.LI +The shell command line option +.B \-t +is obsolete. This option cause the shell to exit after reading +and executing one command. The is no replacement (although ending +\&"command" with the exit builtin should have the same effect). +.LI +As an obsolete feature of the "set" builtin, +if the first +.I arg\^ +is +.B \- +then the +.B \-x +and +.B \-v +options are turned off and the next +.I arg +is treated as the first argument. +Using +.B \+ +rather than +.B \- +causes these options to be turned off. +These options can also be used upon invocation of the shell. +.LE + diff --git a/src/cmd/ksh93/PROMO.mm b/src/cmd/ksh93/PROMO.mm new file mode 100644 index 0000000..def4552 --- /dev/null +++ b/src/cmd/ksh93/PROMO.mm @@ -0,0 +1,141 @@ +.H 1 ksh93 +KSH-93 is the most recent version of the KornShell Language +described in +"The KornShell Command and Programming Language," +by Morris Bolsky and David Korn of AT&T Bell Laboratories, ISBN 0-13-182700-6. +The KornShell is a shell programming language, +which is upward compatible with "sh" (the Bourne Shell), +and is intended to conform to the IEEE P1003.2/ISO 9945.2 Shell and +Utilities standard. +KSH-93 provides an enhanced programming environment in +addition to the major command-entry features of the BSD +shell "csh". With KSH-93, medium-sized programming tasks can be +performed at shell-level without a significant loss in performance. +In addition, "sh" scripts can be run on KSH-93 without modification. +.P +The code should conform to the IEEE POSIX 1003.1 standard and to the +proposed ANSI-C standard so that it should be portable to all +such systems. Like the previous version, KSH-88, +it is designed to accept eight bit character sets +transparently, thereby making it internationally compatible. +It can support multi-byte characters sets with some characteristics +of the character set given at run time. +.P +KSH-93 provides the following features, many of which were also inherent +in KSH-88: +.BL +.LI +Enhanced Command Re-entry Capability: The KSH-93 history +function records commands entered at any shell level and stores +them, up to a user-specified limit, even after you log off. +This allows you to re-enter long commands with a few keystrokes +- even those commands you entered yesterday. +The history file allows for eight bit characters in +commands and supports essentially unlimited size histories. +.LI +In-line Editing: In "sh", the only way to fix mistyped +commands is to backspace or retype the line. KSH-93 allows you +to edit a command line using a choice of EMACS-TC or "vi" +functions. +You can use the in-line editors to complete filenames as +you type them. +You may also use this editing feature when entering +command lines from your history file. +A user can capture keystrokes and rebind keys to customize the +editing interface. +.LI +Extended I/O Capabilities: KSH-93 provides several I/O +capabilities not available in "sh", including the ability to: +.BL +.LI +specify a file descriptor for input and output +.LI +start up and run co-processes +.LI +produce a prompt at the terminal before a read +.LI +easily format and interpret responses to a menu +.LI +echo lines exactly as output without escape processing +.LI +format output using printf formats. +.LI +read and echo lines ending in "\e". +.LE +.LI +Improved performance: KSH-93 executes many scripts faster +than the System V Bourne shell. A major reason for this is +that many of the standard utilities are built-in. +To reduce the time to initiate a command, KSH-93 allows +commands to be added as built-ins at run time +on systems that support dynamic loading such as System V Release 4. +.LI +Arithmetic: KSH-93 allows you to do integer arithmetic in any +base from two to sixty-four. You can also do double +precision floating point arithmetic. +Almost the complete set of C language operators are available +with the same syntax and precedence. +Arithmetic expressions can be used to as an argument expansion +or as a separate command. +In addition there is an arithmetic for command that works +like the for statement in C. +.LI +Arrays: KSH-93 supports both indexed and associative arrays. +The subscript for an indexed array is an arithmetic expression, +whereas, the subscript for an associative array is a string. +.LI +Shell Functions and Aliases: Two mechanisms - functions and +aliases - can be used to assign a user-selected identifier to +an existing command or shell script. +Functions allow local variables and provide scoping +for exception handling. +Functions can be searched for and loaded on first reference the +way scripts are. +.LI +Substring Capabilities: KSH-93 allows you to create a +substring of any given string either by specifying the starting +offset and length, or by stripping off leading +or trailing substrings during parameter substitution. +You can also specify attributes, such as upper and lower case, +field width, and justification to shell variables. +.LI +More pattern matching capabilities: KSH-93 allows you to specify +extended regular expressions for file and string matches. +.LI +KSH-93 uses a hierarchal name space for variables. +Compound variables can be defined and variables can +be passed by reference. In addition, each variable +can have one or more disciplines associated with +it to intercept assignments and references. +.LI +Improved debugging: KSH-93 can generate line numbers on execution +traces. Also, I/O redirections are now traced. +There is a DEBUG trap that gets evaluated before each command +so that errors can be localized. +.LI +Job Control: On systems that support job control, including +System V Release 4, KSH-93 +provides a job-control mechanism almost identical to that of +the BSD "csh", version 4.1. +This feature allows you +to stop and restart programs, and to move programs between the +foreground and the background. +.LI +Added security: +KSH-93 can execute scripts which do not have read permission +and scripts which have the setuid and/or setgid set when +invoked by name, rather than as an argument to the shell. +It is possible to log or control the execution of setuid and/or +setgid scripts. +The noclobber option prevents you from accidentally erasing +a file by redirecting to an existing file. +.LI +KSH-93 can be extended by adding built-in commands at run time. +In addition, KSH-93 can be used as a library that can +be embedded into an application to allow scripting. +.LE +Documentation for KSH-93 consists of an "Introduction to KSH-93", +"Compatibility with the Bourne Shell" and a manual page and a +README file. In addition, the "New KornShell Command and Programming +Language," book is available from Prentice Hall. + diff --git a/src/cmd/ksh93/README b/src/cmd/ksh93/README new file mode 100644 index 0000000..1feeec8 --- /dev/null +++ b/src/cmd/ksh93/README @@ -0,0 +1,232 @@ +This directory, and its subdirectories contain the source code +for ksh-93; the language described in the second addition of +the book, "The KornShell Command and Programming Language," by +Morris Bolsky and David Korn which is published by Prentice Hall. +ksh-93 has been compiled and run on several machines with several +operating systems. The end of this file contains a partial list of +operating systems and machines that ksh-93 has been known to run on. + +The layout of files for ksh-93 has changed somewhat since ksh-88, +the last major release. Most of the source code for ksh remains in +the sh directory. However, the shell editing and history routines +are in the edit sub-directory. The code for shell built-ins is +in the bltins directory. The data directory contains read-only +data tables and messages that are used by the shell. The include +files remain in the include directory and the shlib directory +is gone. The features directory replaces the older install +directory. The method for generating systems specific feature +information has changed substantially. + +The Makefile file contains several compilation options that can be set +before compiling ksh. Options are of the form SHOPT_option and become +#define inside the code. These options are set to their recommended +value and some of these may disappear as options in future releases. +A value of 0, or no value represents off, 1 represents on. +Note that == is needed, not =, because these are nmake state variables +and changing their value will cause all modules that could be affected +by this change to be recompiled. +The options have the following defaults and meanings: + ACCT off Shell accounting. + ACCTFILE off Enable per user accounting info. + AUDIT off For auditing specific users + AUDITFILE "/etc/ksh_audit" + APPEND on Allows var+=val string and array append. + BASH off Bash compatibility mode. It is not fully implemented + and is experimental. + BRACEPAT on C-shell type abc{d,e}f style file generation + CMDLIB_BLTIN off Makes all commands in libcmd.a builtins. The + SH_CMDLIB_DIR nmake state variable can be used to + specify a directory. + CMDLIB_DIR off Sets CMDLIB_BLTIN=1 and provides a default value + of "/opt/ast/bin" for SH_CMDLIB_DIR. + COMPOUND_ARRAY + on Allows all components of compound variables except the + first to be any string by enclosing in [...]. It also + allows components other than the last to be arrays. + This is experimental and only partially complete. + CRNL off treated as in shell grammar. + DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.) + ECHOPRINT off Make echo equivalent to print. + ESH on Compile with emacs command line editing. The original + emacs line editor code was provided by Mike Veach at IH. + FILESCAN on Experimental option that allows fast reading of files + using while < file;do ...; done and allowing fields in + each line to be accessed as positional parameters. + FS_3D off For use with 3-D file system. Enabled automatically for + sytems with dynamic linking. + KIA off Allow generation of shell cross reference database with -I. + MULTIBYTE on Multibyte character handling. Requires mblen() and + mbctowc(). + NAMESPACE on Allows namespaces. This is experimental, incomplete + and undocumented. + OLDTERMIO off Use either termios or termio at runtime. + OO on Experimental object oriented extension. This option + should disappear soon. + OPTIMIZE on Optimize loop invariants for with for and while loops. + P_SUID off If set, all real uids, greater than or equal to this + value will require the -p flag to run suid/sgid scripts. + PFSH off Compile with support for profile shell. + RAWONLY off Turn on if the vi line mode doesn't work right unless + you do a set -o viraw. + SEVENBIT off Strip the eigth bit from characters. + SPAWN off Use spawn as combined fork/exec. May improve speed on + some systems. + STATS on Add .sh.stats compound variable. + SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script. + TIMEOUT off Set this to the number of seconds for timing out and + exiting the shell when you don't enter a command. If + non-zero, TMOUT can not be set larger than this value. + TYPEDEF on Enable typeset type definitions. + VSH on Compile with vi command line editing. The original vi + line editor code was provided by Pat Sullivan at CB. + +The following compile options are set automatically by the feature testing: + DEVFD Set when /dev/fd is a directory that names open files. + SHELLMAGIC + Set on systems that recognize script beginning with #! specially. + VPIX Set on systems the have /usr/bin/vpix program for running MS-DOS. + + +In most instances, you will generate ksh from a higher level directory +which also generates libcmd and libast libraries on which ksh depends. +However, it is possible to generate ksh, with by running make -f ksh.mk +in this directory. The ksh.mk file was generated from the nmake Makefile. +If you do not have make or nmake, but do have a Version 7 UNIX compatible +shell, then you can run the script mamexec < Mamfile to build ksh. +If you have nmake, version 2.3 or later, you can use it without the -f ksh.mk. +In either case, ksh relies on libraries libast and libcmd which must be +built first. The binary for ksh becomes the file named ./ksh which can +be copied to where ever you install it. + +If you use old make or the Mamfile, and you system has dynamic shared +libraries, then you should define the variables mam_cc_static and +mam_cc_dynanamic as the compiler options that request static linking +and dynamic linking respectively. This will decrease the number of +shared libraries that ksh need and cut startup time substantially. + +The makefile should also generate shcomp, a program that will precompile +a script. ksh93 is able to recognize files in this format and process +them as scripts. You can use shcomp to send out scripts when you +don't want to give away the original script source. + +It is advisable that you put the line PWD=$HOME;export PWD into the +/etc/profile file to reduce initialization time for ksh. + +To be able to run setuid/setgid shell scripts, or scripts without read +permission, the SUID_EXEC compile option must be on, and ksh must be installed +in the /bin directory, the /usr/bin directory, the /usr/lbin directory, +or the /usr/local/bin directory and the name must end in sh. The program +suid_exec must be installed in the /etc directory, must be owned by root, +and must be a suid program. If you must install ksh in some other directory +and want to be able to run setuid/setgid and execute only scripts, then +you will have to change the source code file sh/suid_exec.c explicitly. +If you do not have ksh in one of these secure locations, /bin/sh will +be invoked with the -p options and will fail when you execute a setuid/setgid +and/or execute only script. Note, that ksh does not read the .profile +or $ENV file when it the real and effective user/group id's are not +equal. + +The tests sub-directory contains a number of regression tests for ksh. +To run all these tests with the shell you just built, go to the tests +directory and run the command + SHELL=$dir/ksh $dir/ksh shtests +where dir is the directory of the ksh you want to test. + +The file PROMO.mm is an advertisement that extolls the virtues of ksh. +The file sh.1 contains the troff (man) description of this Shell. +The file nval.3 contains the troff (man) description of the name-value +pair library that is needed for writing built-ins that need to +access shell variables. + +The file sh.memo contains a draft troff (mm) memo describing ksh. The +file RELEASE88 contains the changes made for ksh88. The file RELEASE93 +contains the changes made in this release since ksh-88. The file +RELEASE contains bug fixes made in this release since ksh-88. The file +COMPATIBILITY contains a list of incompatibilities with ksh-88. The +file bltins.mm is a draft troff (mm) memo describing how to write +built-in commands that can be loaded at run time. + +Most of the work for internationalization has been done with ksh93. +The file ksh.msg is a generated file that contains error messages +that need to be translated. In addition, the function translate() +in sh/init.c has to be completed to interface with the dictionary +lookup. The translate function takes two argument, the string +that is to be translated and a type which is + 0 when a library string needs translation. + 1 when one of the error messages in ksh.msg needs translation. + 2 when a string in a script needs translation. You use a $ in front + of a double quoted string in a script to indicate that it + needs translation. The -D option for ksh builds the dictionary. +The translate routine needs to return the translated message. +For dictionaries that need to use a numeric key, it should be +possible to use the strhash() function to generate numbers to +go along with each of the messages and to use this number both +when generating the dictionary and when converting strings. +If you encounter error messages of type 1 that are not be translated via +this translate() function send mail to the address below. + +Please report any problems or suggestions to: + +dgk@research.att.com + + +ksh93 has been compiled and alpha tested on the following. An asterisk +signifies that ksh has been installed as /bin/sh on this machine. + +* Sun OS 4.1.[123] on sparc. + Sun OS 4.1.1 on sun. + Solaris 2.[1-9] on sparc. + Solaris 2.[4-8] on X86. + HP/UX 8 on HP-9000/730. + HP/UX 9 on HP-9000/730. + HP/UX 10 on HP-9000/857. + HP/UX 11 on pa-risc. + System V Release 3 on Counterpoint C19 + System V Release 4 on AT&T Intel 486. + System V Release 4 on NCR 4850 Intel 486. + IRIX Release 4.0.? System V on SGI-MIPS. + IRIX Release 5.1 System V on SGI-MIPS. + IRIX Release 6.[1-5] System V on SGI-MIPS. + System V Release 3.2 on 3B2. + UTS 5.2.6 on Amdahl 3090,5990,580. + System V Release 3.2 on i386. + SMP_DC.OSx olivetti dcosx MIServer-S 2/128. + SMP_DC.OSx Pyramid dcosx MIServer-S 2/160 r3000. + 4.3BSD on Vax 8650. + AIX release 2 on RS6000. + AIX 3.2 on RS6000. + Linux 1.X on Intel + Linux 2.X on Intel + Linux 2.X on Alpha + Linux 2.X on Alpha + Linux 2.X on OS/390 + Linux 2.X on sparc + Linux 2.4 on intel itanium 64 + Linux Slackware on sparc64 +* Linux ARM on i-PAQ + OSF1 on DEC alpha. + OSF4 on DEC alpha. + UMIPS 4.52 on mips. + BSD-i [2-4] on X86. + OpenBSD on X86 + NetBSD on X86 + FreeBSD on X86 + NeXT on Intel X86. + NeXT on HP. +* Windows NT using UWIN on X86 +* Windows NT using UWIN on alpha + Windows NT using Cygwin on X86 + Windows NT with NutCracker libraries. + Windows NT with Portage libraries. + Windows 3.1 using custom C library. + OpenEdition on MVS + Darwin OS X on PPC + MVS on OS 390 + SCO Openserver 3.2 on X86 + Unixware 7 on X86 + +Good luck!! + +David Korn +dgk@research.att.com + diff --git a/src/cmd/ksh93/RELEASE b/src/cmd/ksh93/RELEASE new file mode 100644 index 0000000..2f95505 --- /dev/null +++ b/src/cmd/ksh93/RELEASE @@ -0,0 +1,2888 @@ +12-02-29 --- Release ksh93u+ --- +12-02-29 A bug which could lead to a core dump when more that four shared + libraries were added with the builtin command has been fixed. +12-02-29 Fixed a few bugs which caused SIGCHLD to be blocked preventing + background jobs from being reaped until a foreground job was run. +12-02-27 A bug in which sh -c for a simple command caused a fork() has been + fixed. +12-02-27 A timing bug on systems such as AIX that doesn't support vfork() + that could cause the exist status to get lost has been fixed. +12-02-22 A private file descriptor that was not close-on-exec for a command + substitution and has been fixed. +12-02-14 A bug in which ^Z did not stop a pipeline when the last component + was a shell built-in has been fixed. +12-02-14 getconf("PATH") used to initialize ed(1) path. +12-02-13 +In earlier version read from standard input would fail when called + from the KEYBD trap. Now read options -N, -n, and -t should work + when called from a KEYBD trap. +12-02-13 If FCEDIT is not set and fc is invoked without the -e option, + ed will be invoked if found instead of /bin/ed. +12-02-10 Another bug in the saving and restoring of IFS in a subshell + that caused a core dump has been fixed. +12-02-08 A bug in which .sh.fun disciplines could be cleared after a + function completes has been fixed. +12-02-08 A bug in job control in which the foregroup process group was not + set correctly after restarting a stopped pipeline has been fixed. +12-02-07 A bug in which numbers with leading zeros could be treated as + octal constants outside of ((...)) has been fixed. +12-02-06 A bug in arithmetic with compound variables containing multiple + array elements has been fixed. +12-02-02 A bug in the ulimit option table was fixed. +12-01-26 A bug in which a set command that did not change monitor could + effect the behavior of the monitor when monitor mode is on is fixed. +12-01-21 +You can now test whether the shell implements a math function using + typeset -f .sh.math.name, where name is the name of the function. +12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte + characters correctly has been fixed. +12-01-20 A bug that could cause the shell to hang waiting for an incorrect + job pid has been fixed. +12-01-19 A memory leak which occured for a nested command subtiution has been + fixed. +12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute + for some other variables, for exampe, HISTFILE has been fixed. +12-01-16 A bug in which .sh.match was not correct after a substring match when + the replacement string contained a substring match has been fixed. +12-01-12 +Files that are sourced from profile files are now read and executed + one command at a time so that alias definitions take effect as they + do for profile files. +12-01-12 A bug in which whence -p would find a function if one existed and + there was no command of that name on PATH. +12-01-11 Change b_* prototype (int, char**, void*) => (int, char**, Shbltin_t*). +12-01-05 A bug in which read was not terminating for a signal that had a trap + set has been fixed. +12-01-01 A timing problem with >; has been fixed. +12-01-01 A macro expansion memory leak has been fixed. +11-12-26 A bug in array assignments of the form arr=( $arr[i] ...) in which + arr was not unset before the assignment has been fixed. +11-12-20 A number of code changes were made based on the results of errors + indicated by static code analysis. +11-12-13 In vi edit mode a lteral can now be entered by preceding it + with a backshash. +11-12-13 When tab is entered for completion after a ' or ", the ' and " + characters are no longer deleted. +11-12-07 A bug in which a program in the current direcotry with a . in the + name could fail to execute when both PATH and FPATH end with :. has + been fixed. +11-12-07 I fixed a bug in which a variable expansion in a large here-document + could be expanded to a null string. +11-12-06 An optimization to read was added in the case the the read command + was redirected from a file. +11-12-06 Changes were made to make the line limit for read unlimited by + default. +11-12-05 A bug in which unsetting an array variable did not completely clear + the variable in some cases has been fixed. +11-12-02 +The printf alternative character # when applied to the %q format will + quote argument in a form suitable for a field in a .csv format file. +11-12-02 +A -S option was added to read to be able to read .csv format files. +11-11-28 A bug in which redirection of standard error in a function called from + command substitution caused standard error to be lost has ben fixed. +11-11-21 [[ (-n foo) ]] no longer requires a space before (. +11-11-11 The readonly attribute for a variable now applies to compound + assignments to that variable. +11-11-07 Changes were made to reduce the stack size to allow deeper function + recursion. +11-10-10 +Added alternate flag to printf %H for encoding of URI's. +11-10-10 A bug which could lead to a core dump when the shell was invoked + with more than twenty five open files has been fixed. +11-10-06 A bug in the scoping of name references in functions called by other + functions has been fixed. +11-10-05 A bug in which wait on a pid may return the exit status of an + earlier background job with that pid instead has been fixed. +11-09-22 A bug in which a read timed out with TMOUT did not always restore + the terminal state has been fixed. +11-09-21 An optimization that allowed the last command in a script to use + the same process id as the script has been eliminated. +11-09-21 Added letoctal option that enables the let command to recognize + octal constants starting with 0. +11-09-20 A bug in which ${var.} could cause a core dump has been fixed. +11-09-20 A bug with SHOPT_EDPREDICT when neither vi or emacs was enabled for + lines beginning with # when in a multibyte locale has been fixed. +11-09-20 A bug in emacs edit mode with SHOPT_EDPREDICT that would cause + history searches matching comments lines to generate predictions + has been fixed. Only user typed comment lines generate predictions. +11-09-20 A bug in emacs edit mode with a search that matches a comment line + that could cause a core dump has been fixed. +11-09-16 A bug in which a command name ending in .. could cause the shell to + abort has been fixed. +11-09-16 The characters ! + - % and @ in file names are no longer escaped with + file name completion. +11-09-13 The let command no longer treats numbers starting with 0 as octal + constants. +11-09-08 A bug in which printf "%R" could cause a core dump for invalid shell + patterns has been fixed. +11-08-09 With set -u, ${var#pattern} reported that var was unset for special + variables. +11-08-03 A bug in which the shell did not preserve the exit status for a + coprocess has been fixed. +11-08-02 A bug in the saving and restoring of IFS in command substitution that + caused a core dump has been fixed. +11-07-21 Modified the 10-08-27 bug fix so that background jobs started in for + and while loops created interactively generate completion messages. +11-07-20 I fixed a bug in here documents in which multi-byte characters that + crossed buffer boundaries were not processed correctly. +11-06-22 The shell compiler now supports process substitution. +11-06-22 +Added code to support process substitution on systems that do + not supply the /dev/fd directory. +11-06-21 Fixed extraneous jobs Done messages when builtin is at the end of a + pipeline. +11-06-20 Fixed two regression tests. +11-06-20 Fixed a bug introduced on last update. +11-06-14 A bug with pipefail in which the shell would wait for background + jobs to complete has been fixed. +11-06-09 A bug which caused the options.sh regression test to fail on OS390 + Linux has been fixed. The bug could also have affected other systems. +11-06-07 +A number of changes to support the still undocuments namespace option + have been added. +11-06-06 A bug in which command substitution of eval would hang when it had + standard error redirected to standard output has been fixed. +11-06-01 A bug in case statement fall through (;&) ignoring set -e was fixed. +11-06-01 A bug in which creating a left or right justified upper or lowercase + variable with an empty string has been fixed. +11-06-01 A bug in which the .paths directory wasn't read when a subshell was + executed before any other command has been fixed. +11-05-31 The shell now gives an error when a type variable is assigned to + an array instance when the array has been declared a compound variable + array. +11-05-31 A bug in which typeset -m of an array instance did not remove the + original instance has been fixed. +11-05-28 A bug in which typeset -m dest=src fails when src and are passed as + name references was fixed. +11-05-28 A bug in which typeset -m "c.board[1][i]=el", where el is a compound + variable core dumps has been fixed. +11-05-28 Two bugs in the display of arrays of compound variables with print -v + have been fixed. +11-05-27 A bug with command substitution with the shift jis locale has been + fixed. +11-05-25 A bug in which unset -f foo, called within function foo could cause + the shell to core dump has been fixed. +11-05-24 A bug in unsetting arrays of compound variables that could lead to + a core dump has been fixed. +11-05-24 A scoping bug in with typeset -m for variables passed as references + has been fixed. +11-05-09 A bug in which 'typeset +p array[$i]' in a subshell could cause an + exception has been fixed. +11-05-03 Two more scoping bugs with name references and read -C were fixed. +11-05-03 A potential race condition which occurs when here-documents are + processed in asynchronous blocks has been eliminated. +11-05-02 Another scoping bug with name references defined in a function has + been fixed. +11-05-02 A bug in which the shell discards saved exit status of a job if it is + followed by a subshell execution has been fixed. +11-04-28 The shell now checks for numerical overflows with process ids. +11-04-28 Another scoping bug with compound variables defined by name references + inside a function has been fixed. +11-04-28 A bug which caused a core dump on 32 bit systems with the basic.sh + regression test has been fixed. +11-04-27 A scope binding error for name references has been fixed. +11-04-27 Assignment of compound variable to compound array element by name + is now working. +11-04-26 I fixed a bug with SHOPT_FIXEDARRAY compilation that could cause + an a core dump for not fixed arrays. +11-04-25 A bug in the references to two dimensional compound arrays has + been fixed. +11-04-20 A bug in which a name reference to a multidimentional index array + index, nameref x=foo[3][4], did not work correctly has been fixed. +11-04-18 Changes were added to allow fixed size arrays of variable sized + objects when the SHOPT_FIXEDARRAY compile option defined on 10-09-28. +11-04-18 A bug in which name references to array elements could fail has + been fixed. +11-04-15 +A compile option, SHOPT_2DMATCH, has been added which causes + .sh.match to be a two dimensional array after ${var//pat/str} + where the first dimension is the pattern number and the second is + the match instance. +11-04-11 A bug in which readonly var, where var is exported could cause var + to be unset has been fixed. +11-04-06 A tokenizer bug in which ${x/{3}(\d)/ } would cause in infinite + loop has been fixed. +11-04-05 A bug in which ${!x.} could cause a core dump has been fixed. +11-04-04 A bug in which cleaning out the history file could terminate before + keeping all the recent history events has been fixed. +11-03-29 A bug in which ${#array[@]} was 1 rather than 0 after issuing + typeset array[7] has been fixed. +11-03-29 The subscript out or range message for fixed arrays has been fixed. +11-03-29 A bug in which suspend could cause a core dump has been fixed. +11-03-24 For the showme option added 09-09-09, commands beginning with a ; + inside an arithmetic for loop, no longer produce syntax errors. +11-03-18 A bug in _WINIX ~domain/user expansion has been fixed. +11-03-16 A bug in the pipefail option which could cause a script to hang + has been fixed. +11-03-12 The shell no longer treats ${##pattern} as a syntax error. +11-03-11 A bug in typeset -u on systems that don't supply the towctrans() + function has been fixed. +11-03-11 A bug in which a compound assignment of the form var[sub]=(...) + would evaluate sub for each assignment has been fixed. +11-03-07 A bug in which reassigning a compound variable to an associative + array index could incorrectly increase the count of the number + of elements has been fixed. +11-03-04 +The tilde expansion on windows has been modified to handle user + names of the form domain/user so that ~domain/user now expands + to the home directory of that domain user. +11-03-03 A bug in which the width of the prompt was calculated incorectly + which cause the wrong line length for edit commands has been fixed. +11-03-02 A bug in which a global variables set from within a function inside + a subshell can leave side effects in parent shell has been fixed. +11-03-01 A bug in which whence -a could dump core when the first match + was due to : in PATH and the program was in the current directory. +11-02-28 A bug in emacs mode with SHOPT_EDPREDICT (added on 10-05-20) which + disabled prediction on a line starting with # when the cursor was not + at the end of line has been fixed. +11-02-28 The output format for compound variables with set has been fixed. +11-02-25 A bug which could lead to a core dump occurred when a shell script + without #! is invoked by name from a parent shell that has name + references defined and the script creates name references of the + same name. +11-02-21 The shell now fails with a syntax error when a here-document in a + command substition is not completed before the closing ), for + example, $( foobar <&- doesn't work has been fixed. +11-02-07 A bug on some systems for which a command subtitution could hang + has been fixed. +11-01-28 A bug in file name completion for files containing both multibyte + characters shell special characters has been fixed. +11-01-18 The .sh.match variable now shows elements that do not match as + as not set rather than an empty string. +11-01-18 A bug with typeset -m of an array into an element of an indexed + array has been fixed. +11-01-13 A bug in handling of arrays of compound variables inside ((...)) which + reported a syntax error been fixed. +11-01-10 A bug in arithmetic assignment operators of the form op= for array + variables when the same array was referenced on the left and the + right hand side with different indices has been fixed. +11-01-10 A bug in which the output of time was lost when { time...;} 2>&1 + occurred inside command substition has been fixed. +11-01-07 [[ -v sh.match[i] ]] was returning false when sh.match[i] was set. +11-01-05 Added and modified warning messages with sh -n. +11-01-02 Fixed bugs with typeset -l/-u/-M and arrays. +10-12-28 Fixed a bug with typeset -l/-u/-M values in arithmetic expressions. +10-12-26 Fixed a time parsing bug in sleep and localeconv() initialization. +10-12-23 Prevented the shell from generating a core dump when it sends itself + a termination signal because the last command terminated with that + signal. This prevents a core dump to be overwritten by the shell. +10-12-22 A bug in the expansion of ${A[@]} ${B[@]}, introduced in 10-12-01 + when A="" B=B has been fixed. +10-12-21 +Use MS_3D in b_vpath() for setting win32 WoW mount defaults. +10-12-17 A bug in the expansion of ${var:i:j} which caused a core dump when + i > ${#var} has been fixed. +10-12-16 +sleep now treats . as decimal point even in locales that use comma. +10-12-16 +typeset -M mapname was added to generalize on toupper and tolowwer + mapping as provided with wctrans(). +10-12-10 A bug in which typeset -l displayed namespaces as well as lower case + variables has been fixed. +10-12-06 A bug in which a pipeline could terminate prematurely for a pipeline + whose right hand side is a builtin, and whose left hand side ends in + a simple command that has standard output redirected has been fixed. +10-12-06 A bug in hexfloat assignments when the right hand side is a string + variable starting with 0x has been fixed. +10-12-01 A bug in the expansion of ${$1+"$@"} which causes the last positional + parameter to disappear when it is empty has been fixed. +10-12-01 A number of changes were made to reduce the startup time. +10-11-29 When wait is interrupted by a signal that is caught, it now exits + with a non-zero exit status. +10-11-29 When a variable is used directly in an arithmetic expression, + leading zeros no longer cause the value to be treated as an + octal constant. This was true in previous versions for justified + variables. +10-11-29 An incorrect warning message was eliminated with the -n option for + arithmetic expressions with associative arrays. +10-11-29 Some changes were made to slightly reduces startup time. +10-11-24 A bug in which a name reference is make to arr[0] when arr is not + an array has been fixed. +10-11-23 If a type definition is made without a compound variable assignment it + produces an error message and no longer shows up as a defined type. +10-11-22 The handling of \ inside [...] for for shell and ~(E) patterns has + been fixed. +10-11-22 A patch was made to pfsh to handle an error case. +10-11-22 +Modified types defined in namespace so that they do not clash with + types in other namespaces. Types can be referenced using + .namespace.typename. +10-11-22 A bug which caused functions addressed as .namespace.funct to not + work has been fixed. +10-11-22 A bug in which if nr was a name reference to an unset associative + array subscript, then ${!nr} did not output the subscript correctly + has been fixed. +10-11-18 A bug in which shcomp -n was not processing double quotes correctly + has been fixed. +10-11-18 Fixed a bug in which typeset -T foo; typeset -T could cause a + core dump. +10-11-17 Fixed a bug in which the error message for set -u could come out + garbelled. +10-11-17 Modified the parser so that typeset -a var=(...) no longer checks + the first index for aliases and reserved words. +10-11-17 A bug in which a subshell command consisted of only a for or until + command has been fixed. +10-11-16 Fixed a bug in which typeset -u would display namespace variables + as well as upper case variables. +10-11-16 A bug which could cause a core dump when unsetting a type variable + when there are references to type elements has been fixed. +10-11-15 A bug which could cause a core dump when unsetting a compound + array variable when there are references to array subscripts has + been fixed. +10-11-15 A bug in which using typeset -m to move an indexed array instance + to another array could cause the array to display incorrectly has + been fixed. +10-11-12 A bug in which the unset discipline function for a type is called + when the type is initialized has been fixed. +10-11-12 The sequences \< and \> are now preserved after patterns containing + ~(E) in ${var/pattern/string} expansions. +10-11-11 A bug in typeset -m when the variables were compound arrary instances + has been fixed. +10-11-10 A bug in output of a compound variable with types containing types + has been fixed. +10-11-10 Fixed ``name=value export [-p]'' to list environment. +10-11-09 shtests resets SIGPIPE to SIG_DFL for all tests. +10-11-09 Fixed a bug in expansion of $"..." when used in assignments. +10-11-09 Fixed a getaddrinfo() memory leak that didn't call freeaddrinfo() + after an interrupt. +10-11-08 Modified the behavior of set -u so that the shell terminates with + error message when when var is unset with ${!var} and ${#var}. +10-11-02 Fix a bug in which a signal received while in a subshell could be + ignored. +10-10-26 Fix a bug where terminal interrupt was ignored while in vi/emacs + edit search mode. +10-10-26 Fix $'a\0b'c to expand to 'ac'. +10-10-26 Provide user defined round() if not in . +10-10-26 Fix bug where $((undefined_function(1))) dumped core. +10-10-22 Provide user defined iszero() if not in . +10-10-22 Fixed a bug with BGX compile option that could cause the shell to + hang. +10-10-22 Fixed a bug with user define math function on systems for which + char is unsigned. +10-10-21 A bug in which function autoloaded in a function leaves a file open + has been fixed. +10-10-20 Modified the behavior of set -u so that the shell terminates when + when var is unset with ${var op string} when op is #, % or /. +10-10-20 Fixed a bug with the AUDIT option in which the audit file was not + not close-on-exec. +10-10-20 +Made a number of changes and fixes for the NAMESPACE compile option + which as added on 10-06-09 but some problems still remain. +10-10-15 Fixed a bug in which arithmetic functions (added on 10-03-24) did + not work when the function definition was in the same compound + command in which the function was referenced. +10-10-13 A bug in which creating an associative array of compound variables + with no members as an element of a compound variable did not work + has been fixed. +10-10-08 A bug in which killing the last command in a function defined + with function name, terminated the calling script has been fixed. +10-10-08 A bug which could cause a core dump if IFS is unset inside a function + has been fixed. +10-10-07 +To reduce unwanted side effects, invoking typeset without the export + option and without an assignment now causes the variables to be unset + if the variable is inherited from the environment. +10-10-06 The closing brace for ${ command } is now a token no matter what + character follows it. +10-10-04 The change for $'...' expansion on 10-08-09 did not expand parameters + contained in the error message and this has been fixed. +10-10-04 A bug in which a declaration of indexed array (-a_ in a type + definition would be displayed as a compound indexed array (-C -a) + has been fixed. +10-09-30 The C99 math function ldexp has been added. +10-09-30 A bug with two dimensional arrays with expansion of the form + ${ref[0..5]} where ref is a nameref to array[i] has been fixed. +10-09-29 A bug in which an eval with redirections invoked from a dot script + would not restore the file has been fixed. +10-09-29 A bug in which loading a function from FPATH could leave a file + descriptor open has been fixed. +10-09-28 +A new compile option SHOPT_FIXEDARRAY has been added and is being + evaluation. It allows fixed sized indexed arrays be to defined + using "typeset array[dim1][dim2]...[dimn]". Fixed sized arrays + are used the same way indexed arrays are. Currently, only fixed + arrays of fixed objects (float, int, and justifies objects) are + supported. +10-09-22 A bug which could cause an exception when a function with static + variables was redefined has been fixed. +10-09-21 A bug in the processing of (command&) which created a job in the + parent process has been fixed. +10-09-21 A for loop optimization bug with arithmetic expression evaluation + has been fixed. +10-09-21 A bug in which a recursive function containing a pipeline could + lead to an exception fixed after 8 levels of recursion has been + fixed. +10-09-18 A bug in which the count of elements in an array was wrong leading + to an exception has been fixed. +10-09-13 A bug which occurred when both xtrace and showme options where + specified in which the xtrace option disabled showme has been fixed. +10-09-13 A bug in which creating a reference to an array variable with any + elements could cause subsequent array elements to be treated as + compound variables has been fixed. +10-09-09 A bug which caused ((c.ar[x][y])) to be treated as a syntax error + has been fixed. +10-09-08 A bug in the processing of references to multidimensional arrays + in arithmetic expressions has been fixed. +10-09-08 A bug in the handling of multi-dimensional arrays which caused + the number of elements in each dimension to be incorrect has + been fixed. +10-09-07 The change for messages on 10-08-09 did not handle message in + assignments and this has been fixed. +10-09-07 A bug in the indentation of compound variables in arrays when + output with print -v has been fixed. +10-09-07 A rare bug with indexed arrays when assigned a null string that could + cause a core dump has been fixed. +10-09-03 A number of changes were made for jobs pools. +10-08-31 typeset -p was modified to output name references after other + variables so that the output could be used as input. +10-08-31 A bug with typeset -p in which variables with attributes but + without attributes were not displayed correctly has been fixed. +10-08-27 +When running a subshell, the current pool is unset. +10-08-27 A bug in which jobs started from within for or while lists in + interactive shells could generate completion messages has been fixed. +10-08-25 Fixed a couple of bugs related to job pools. +10-08-24 +[[ -e /dev/xxx/ ]] can be used to check whether special files of + those names are handled by the shell. +10-08-24 A bug in the running of a compiled dot script in which only the + first command was executed has been fixed. +10-08-23 A bug which sometimes caused a core dump with a configure script + has been fixed. +10-08-20 A bug in command substitution which caused a configure script to + hang has been fixed. +10-08-19 Eliminated unnecessary ; from output of compound variable with + typeset -p. +10-08-17 Fixed a bug in command substitution in which under certain + circumstances a file whose size is a power of 2 plus one, and the last + character was not a new-line, could cause memory corruption. +10-08-13 +Added static discipline functions to type similar to C++ static + class functions. +10-08-11 A bug in time when applied to a pipeline in which the shell did + not wait for all elements of the pipeline to complete has been fixed. +10-08-11 Restored sh_fmtq() quoting to not quote NAME= in NAME=VALUE. +10-08-09 +Modified the expansion of message strings, $"...", so that they + are expanded each time they are referenced rather than expanding + them when the script is compiled or read in. +10-08-06 +The process id for jobs in job pools is now of the form poolname.n + where n is the jobid in that pool. Commands that accept job names + or numbers now understand names in this format. +10-08-05 A bug in which an assignment from within an arithmetic expression + inside a function would create a local variable has been fixed. +10-08-04 A bug in the expanding of variables whose names contain multibyte + characters has been fixed. +10-08-04 A bug which caused an exception when processing scripts compiled + with shcomp -n has been fixed. +10-08-02 Tests using very small buffer sizes uncovered a number of bug most + connected with here documents which have been fixed. +10-07-27 The format modifier , used for digit grouping with d and f formats + has been documented. +10-07-26 cd '' now produces and error rather than changing to the current + directory. +10-07-26 A bug in multi-byte locales which the last character of a + multi-byte character is a \ or pattern character which could occur + when the character was the last character of a command substitution + has been fixed. +10-07-23 Another bug in the processing of ${var:offset;len} in multi-byte + locales when len is larger than the number of characters has been + fixed. +10-07-23 Many coding changes have been made to eliminate most of the uses + of global variables in the shell code. +10-07-22 Fixed a bug in which discipline functions were not being invoked + when it was invoked as ref.discipline where ref was a name reference + to an array instance. +10-07-22 Fixed a bug in which discipline functions were not being invoked it + was invoked on a two dimensional array, i.e., arr[5][9].discipline. +10-07-19 Fixed a buffering problem which occurred when running a script with + ssh and the parent ssh process is killed. +10-07-14 Modified the parser to treat ((...)) inside [[...]] as ( (...) ) to + that it is a nested (...). +10-07-09 A bug in the handling of process substitution inside command + substitution as part of a pipeline has been fixed. +10-07-07 A bug in the output for compound variables containing + multi-dimensional arrays has been fixed. +10-07-06 ksh now recovers from changes made by bash to the history file without + loosing history commands. +10-06-25 A bug in which a large here document containing command substitutions + of a dynamically loaded function that contained a here document + could get truncated has been fixed. +10-06-24 If after executing a script found in FPATH, if a function, builtin, + or type name corresponding to that script is not defined, the shell + now outputs an error message and returns value 126. +10-06-23 Floating point functions that happened to return integer values + were being treated as if the function returned integers so that + integer division could be used instead of floating point division. +10-06-22 Fixed a bug in earlier ksh93u in which an arithmetic assignment to a + variable in the global scope would instead create a local variable if + the variable had an attribute but did not have a value. +10-06-18 Modified trap handling so that if the same signal is received when + executing the handler, it is deferred until the handler completes. +10-06-16 Fixed a bug in which ulimit -v was setting the the cpu limit + on Linux. +10-06-14 +The command 'typeset -T' now generates the list of type definitions + in a format that can be used as input to the shell. +10-06-09 Put in patch from Solaris for output quoting with %q. +10-06-09 +Made changes to the NAMESPACE compile option so that it now seems + to work. With this option, namespace { command;} will + run command in the namespace .name so that all variables and + functions created by command are accessible outside the name + space via .name.var and .name.fun. Variables and functions that + are not in the namespace are not modified when running command. +10-06-07 Change most internal interfaces to take Sh_t* argument. +10-06-03 +Types can be loaded on first reference by putting definitions in + PFPATH. +10-06-03 +The shell is now able to parse commands which use type statements + before the typeset -T command to define the type executes. +10-06-03 A bug in the quoting for name reference declarations which did + not properly handle [ and ] in subscripts for associative arrays. +10-06-02 A bug in which a discipline function defined by a type instance to + override the default was not being registered has been fixed. +10-06-02 A bug in which read -C of an associative array of compound variables + was not working has been fixed. +10-06-02 A bug in which the error message for an unset parameter with set -u + did not contain the name of the variable has been fixed. +10-06-01 A bug in typeset -m for moving an indexed array instance to a variable + has been fixed. +10-06-01 A bug in which caused memory to be freed twice when unset was called + for an indexed array that had get or set disciplines has been fixed. +10-06-01 A bug in which the %b format of printf was not preserving NUL bytes + with \0 has been fixed. +10-06-01 A bug in the handling of name references to array variables in + arithmetic expressions has been fixed. +10-05-28 Fixed bugs in changing attributes for two dimensional arrays. +10-05-28 Eliminated a few unreferenced variables and a reference to + uninitialized memory. +10-05-27 Rewrote the subshell code to avoid using pipes an many cases. +10-05-24 Fixed a bug which cause an exception when both -l and -s were + specified with typeset -i. +10-05-21 Inputting of three dimensional indexed arrays with ( ( (...)...)...) + was not working and has been fixed. +10-05-21 A bug in which adding the attributes -Ai to a variable via a name + reference could cause the value to display incorrectly has been fixed. +10-05-21 A bug in which using $var inside ((...)) did not work when var was + a hex float variable. +10-05-20 +The compile option SHOPT_EDPREDICT has been added. When this option + is on, as you type a line beginning with a # the following characters + are treated as a shell pattern and cause matching lines from the + history file to be displayed as a numbered list as you type. + You can scroll up and down this list or you can use nTAB + to make this the current line (n defaults to 1 of omitted) or + n to execute. +10-05-20 A bug which caused an exception when multiple levels of composite + functions in arithemtic expressions has been fixed. +10-05-19 <<< with an empty string no longer gives an error. +10-05-19 A bug in arithmetic evaluation when a name reference to an array + instance was used has been fixed. +10-05-14 A bug in which the shell treats a valid index array assignment, + typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed. +10-05-13 A bug in creating name references to associative array variable + after a lookup of one of its elements has been fixed. +10-05-12 Two bugs in the handling of function static type variables in + subshells have been fixed. One could cause an exception and the + other would leave side effects in the parent shell. +10-05-10 A bug in which static variables in functions were not being saved and + restored properly when running subshells has been fixed. +10-05-05 A bug in which print -v did not work correctly when an operand was an + indexed array element referring to a compound variable has been fixed. +10-05-05 A change to improve performance by special casing empty string + assignments to avoid repeated malloc() and free(). +10-05-05 A bug in which creating a name reference to a non-existent associative + array element would create the array element has been fixed. +10-05-04 A bug in which name references to static variables in the static + scope were not found has been fixed. +10-04-30 Do not use socketpair() on systems that implement ioctl(I_PEEK) + on pipes. +10-04-29 +When the current job pool is set, coprocess are run in a job pool. +10-04-28 A type defined with a member foo that is an associative array without + elements followed by an expansion ${bar.foo[a]} and an assignment + bar.foo[a]=b, no longer indicates that ${#bar.foo[@]} has 0 members. +10-04-27 Another bug in which a nested command substitution could hang if it + generated too much data has been fixed. +10-04-26 A type defined with a member that is an indexed array without elements + would behave as if the 0th element of each instance was defined after + a non-zero element was specified and this has been fixed. +10-04-26 A bug in which types defined in a subshell were not undefined when + the subshell completed has been fixed. +10-04-23 For file completion in commmand line editing, file names starting + with # are now escaped so that they are not treated as comments. +10-04-23 A bug in which ${t.var:=value}, where t is an instance of a type + variable, could assign value to the type variable rather than to + the type instance has been fixed. +10-04-23 +Added &| which can be used in place of | to have portions of a + pipeline executed in the pool. +10-04-22 +The .sh.pool variable was added for use with job pools. +10-04-22 A bug in which a nested command substitution could hang if it + generated too much data has been fixed. +10-04-20 A bug which corrupted one byte of memory when read was called with + reads that did not use a delimiter has been fixed. +10-04-19 The display of a compound variable with an embedded array with + attributes was sometimes not working correctly and has been fixed. +10-04-16 A bug in which attributes were not be propagated to elements in + an associative array has been fixed. +10-04-15 A bug which caused scripts containing user defined math functions to + fail to compile with shcomp has been fixed. +10-04-15 +Job pools have been added with the SHOPT_COSHELL compilation option. + A job pool allows a collection of background jobs to run either locally + or remotely and to be managed as a unit. The command '& name ...' + creates or uses a named job pool for subsequent background jobs. + kill, wait, and jobs allow the pool name as operands. +10-04-14 A bug in which a coprocess connection could terminate prematurely + when running a nested subshell has been fixed. +10-04-12 +Enumeration constants can be used in arithmetic expressions with the + ==, != and = operators when the left hand side is an enum variable + and the right hand side is an enumeration constant. +10-04-07 A bug in which setting the trap on CHLD to ignore could cause + an incorrect exit status has been fixed. +10-04-06 A bug in which LINENO was not incremented for a here-document when + the here-document word was followed by a comment has been fixed. +10-04-06 The optimization that execs the last process of a script rather + than creating a new process has been removed when a trap on + interrupt has been set. +10-04-06 Unsetting the 'C', 'A' or 'a' typeset attribute now produces an + error message rather than generating an exception. +10-04-06 A bug in which .sh.name contained the subscript and .sh.subscript + was empty in some cases with discipline functions on array instances + has been fixed. +10-04-05 A bug in the edit modes where preceding the interrupt character with + the literal next character did not work has been fixed. +10-04-05 A bug in the creation of type instances of arrays which could cause + an exception has been fixed. +10-03-30 A bug in the display of a compound variable containing an indexed + array of compound variables has been fixed. +10-03-24 +Arithmetic functions can be defined using the shell function syntax, + 'function .sh.math.name x y z{...}' , where name is the function name + invoked within ((...)) and x y z are long double arguments passed + as name references. y and z are used for functions with two and + three arguments respectively. The value of the function is the value + of the long double .sh.value variable when the function returns. +10-03-24 A bug in which integer division was mistakenly used when the + numerator was a binary operator with the first operand floating + point and the second integer, e.g. (.1**3)/3, has been fixed. +10-03-24 The >; file operator was modified so that the temporary file is + created in the same physical directory as file. +10-03-23 A warning message was added to sh -n when $var was used inside + ((...)) instead of var. +10-03-19 fmin was added to the list of math function on the man page. +10-03-19 Fixed the return value for unalias when the alias did not + exist. +10-03-19 A bug in which the SHLVL variable exported the value it had on + input rather than the incremented value has been fixed. +10-03-19 A bug which causes whence -q to go into an infinite loop has been + fixed. +10-03-19 Removed space between Stopped message and (SIGTTIN) and (SIGTTOUT). +10-03-17 Modified profile shell execution so that when builtins that + correspond to executable have extended attributes, they are + executed by pfksh instead of being treated as built-ins. +10-03-16 A bug in whence -a which produced duplicate lines of output has + been fixed. +10-03-16 A bug in the handling of process groups in monitor mode for + command substitutions has been fixed. +10-03-15 Fixed a bug in which read -u[fd] could cause the shell to core + dump when fd was greater than open_max. +10-03-15 +Modified the shell I/O so that the shell will not fail if the + ulimit for open_max is increased as part of the script. +10-03-12 A bug in which a here-document containing command substitutions + that contained here-documents did not process correctly has been + fixed. +10-03-12 A bug in which the terminal is not restored to canonical mode + after read times out when in a multibyte locale with no edit mode + enabled has been fixed. + +10-03-05 --- Release ksh93t+ --- +10-03-05 A variable unset memory leak has been fixed and tests/leaks.sh + has been added to verify the fix. +10-03-04 Documentation, comment, and diagnostic spelling typos corrected. +10-02-14 Fix sh_getenv() initialization to cooperate with the 3d fs. +10-02-12 A bug in which the get discipline function was not invoked for + associative array subscripts for unset array elements has been fixed. +10-02-12 A bug which could occur if the last line of a script was an eval + that executed multiple commands has been fixed. +10-02-02 A buffer overflow in read and another in binary type base64 + encoding were fixed. +10-01-20 A bug in the evaluation of arithmetic expression in which the + subscript was evaluated twice for $((foo[x++]++)) has been fixed. +10-01-19 A workaround for a double-free of a trap in both a subshell and its + parent has been added. +10-01-18 A bug in type handling of typeset -H has been fixed. +10-01-15 The "adding empty subscript" warning now only emitted with -x set. +10-01-01 A bug in the parser in which '$((case i in i):;esac);:))' was not + parsed correctly was fixed. +10-01-01 A bug in the parser in which '$(( 2 , 3.6 ))' dumped core for locales + with radix char , and thousands separator . has been fixed. +09-12-28 A bug in the handling of SIGCLD on systems that generated SIGCLD + while blocked waiting for process to complete has been fixed. +09-12-24 ast setlocale() reworked to differentiate env var changes from user + override. +09-12-18 A bug with the SHOPT_BGX option set which disabled traps for signals + < SIGCHLD when a trap for a signal > SIGCHLD was set has been fixed. +09-12-18 A bug where [[ -v var ]] was incorrect for some variables (including + LC_* vars) has been fixed. +09-12-15 A bug that produced a syntax error when a multibyte character + straddled a buffer boundary has been fixed. +09-12-11 A bug where the subscript of an unset variable was not evaluated has + been fixed. +09-12-09 A bug where shcomp dumped core on certain syntax errors has been fixed. +09-12-07 A bug where a parent shell environment var reset in a subshell removed + the value in subsequent children of the parent shell has been fixed. +09-12-04 A bug in which in some cases a trap in a function executed in + a subshell could trigger twice has been fixed. +09-12-03 A bug in which SHLVL exported with some attributes could cause + the shell to abort at startup has been fixed. +09-12-02 A bug with pipefail in which the shell could hang waiting for the + writer to complete before the last reader command has been fixed. +09-11-30 A bug in which a trap could be inherited by the first element of + a pipeline when the command had more than 63 arguments that did + not contain any macro expansions has been fixed. +09-11-19 When read from a terminal was called from with a while or for loop, + and an edit mode was on, a backspace or erase no longer will + overwrite the prompt. +09-11-17 +Change .paths parse to handle BUILTIN_LIB=foo BUILTIN_LIB=foo-1.2. +09-11-17 Inside a function, typeset foo.bar will bind foo to global variable + foo if local variable foo does not exist, instead of creating a + local variable. +09-11-17 "read -n1" from the terminal has been fixed to read exactly one character. +09-11-11 Job control now works for subshell commands, (...). +09-11-11 If set -e is on for an interactive shell errors in special builtins + now cause the shell to exit. +09-11-11 A bug in which an interrupt handler processed during the read builtin + when IFS did not contain a new line has been fixed. +09-11-09 A bug in which a variable that has been unset in a subshell and then + exported from that subshell does not show up in the environment + has been fixed. +09-11-02 ``,2'' is now a valid numeric constant for locales with + decimal_point=','. +09-11-02 A bug where "return" in .profile did not restore the shell state + has been fixed. +09-10-31 A bug that corrupted saved exit status when pids wrapped around has + been fixed. +09-10-26 A bug in { LANG LC_ALL LC_category } ordering has been fixed in -last. +09-10-16 A bug where notification to libast that the environment has changed + has been fixed. +09-10-12 A bug in which a function loaded in a subshell could leave side + effects in the parent shell has been fixed. +09-10-12 A bug in converting a printf %d operand to a number when the operand + contains multiple subscripts for the same variable has been fixed. +09-10-09 A bug in the handling of the escape character \ in directory prefixes + in command completion has been fixed. +09-10-09 $PATH processing has been changed to delay dir stat() and .paths + lookup until the directory is needed in the path search. +09-09-28 Call the ast setlocale() intercept on unset too. +09-09-24 A bug in which LANG=foo; LC_ALL=foo; unset LC_ALL; did not revert + LC_CTYPE etc. to the LANG value has been fixed. +09-09-17 A bug in which unsetting SVLVL could cause a script invoked by + name without #! to core dump has been fixed. +09-09-16 A bug in which a pipeline in a here-document could hang when the + pipefail option was on has been fixed. +09-09-09 A bug in the processing of line joining in here documents which + occurred when a buffer began with has been fixed. +09-09-09 +A leading ; with commands in a brace group or parenthesis group + no longer causes an error. It now is used for the "showme" option. +09-09-09 A bug in which a subshell containing a background process could + block until the background process completed has been fixed. +09-09-04 A bug in handing ${var[sub]}, where var is a nameref has been fixed. +09-09-03 A bug which caused an index array to have the wrong number of elements + when it was converted from a compound variable by adding an another + element has been fixed. +09-09-03 Specifying export for a compound variable now generates an error. +09-09-02 $"..." localizations strings are no longer recognized inside `...`. +09-09-01 A bug in the for loop optimizer in the handling of type static + variables has been fixed. +09-09-01 An error message is not displayed when * and @ are used as subscripts. +09-09-01 Several bugs in the processing for types that included an associative + array of another type has been fixed. +09-09-01 A bug in the tracing of [[ a < b ]] and [[ a > b ]] has been fixed. +09-08-26 The .sh.file variable was not being set for a script that was run + by name and didn't start with #! and this has been fixed. +09-08-25 A bug in which a function called to deeply from command substitution + did not display an error message has been fixed. +09-08-24 +When processing profiles, ksh93 now violates the POSIX standard and + treats &> as a redirection operator similar to bash. +09-08-23 A bug in the handling of the trap on SIGPIPE that could lead to a + memory fault has been fixed. +09-08-21 A bug in the handling of the comma operator in arithmetic expressions + that could cause a core dump on some systems has been fixed. +09-08-20 A bug in which a compound variable containing an array of a type + that doesn't have any elements now expands correctly. +09-08-19 A bug which disabled function tracing inside a function after + a call to another function has been fixed. +09-08-19 A bug in which initializing a compound variable instance to another + compound variable by name has been fixed. +09-08-18 A bug in which compound variable instances could be lost after + an instance that invoked a type method discipline has been fixed. +09-08-18 A bug in which a discipline function for a type applied to an + array instance when invoked in a function ignored the subscript + has been fixed. +09-08-18 A scoping error with variables in arithmetic expression with + type variables when reference with a name reference has been fixed. +09-08-10 Several memory leaks were fixed primarily related to subshells. +09-08-06 A bug in which setting the trap on CHLD to ignore could cause + a script to hang has been fixed. +09-07-08 A bug in the processing of name reference assignments when it + contained pattern expansions with quoting has been fixed. +09-06-22 +The default width for typeset -X has been changed so that there + should be no loss of precision when converting to a string. +09-06-19 A bug in the printing of array elements for binary variables with + printf %B has been fixed. +09-06-19 A bug which caused a core dump with trap DEBUG set with an array + assignment with no elements has been fixed. +09-06-19 A bug with read with typeset -b -Z has been fixed. +09-06-19 Two bugs related to read -b for array variables has been fixed. +09-06-19 A bug with typeset for compound variables containing arrays of + compound variables has been fixed. +09-06-18 A bug in appending a compound variable to a an indexed array of + compound variables has been fixed. +09-06-18 A bug which occurs when appending a compound variable to an indexed + array element has been fixed. +09-06-18 Setting VISUAL to a value other than one ending in vi or emacs will + no longer unset the edit mode. +09-06-17 A bug in typeset -m when moving a local compound variable to a + global compound variable via a name reference has been fixed. +09-06-17 A bug in appending to nodes of an array of compound variables when + addressing them via nameref has been fixed. +09-06-17 A bug in typeset -p var, when var is an array of compound variables + in which the output only contained on array element has been fixed. +09-06-17 The prefix expansion ${!y.@} now works when y is a name + reference to an element of an array. +09-06-16 Traps on signals that are ignored when the shell is invoked + no longer display. Previously they were ignored as required but + would be listed with trap -p. +09-06-12 A bug in vi edit mode in which hitting the up arrow key at the + end of a line longer than 40 characters which caused a core dump + has been fixed. +09-06-11 A bug in which "eval non-builtin &" would create two processes, + one for the & and another for non-builtin has been fixed. +09-06-08 When var is an identifier and is unset, ${var} no longer tries to + run command substitution on the command var. +09-06-08 +Process substitution arguments of the form <(command) can now be + used following the < redirection operator to redirect from command. +09-05-13 A bug in which redirections of the form 2>&1 1>&5 inside command + substitution could cause the command substitution to hang has been + fixed. +09-05-12 To conform with POSIX, the -u option only checks for unset variables + and subscript elements rather than checking for all parameters. +09-05-12 A bug which could cause a core dump when a variable whose name + begins with a . was referenced as part of a name reference inside + a function has been fixed. +09-05-01 A bug that caused a core dump when SIGWINCH was received and + both vi and emacs mode were off has been fixed. +09-04-22 +Default alias compound='typeset -C' added. +09-04-15 A bug that caused ${...;} to hang for large files has been fixed. +09-04-08 A change was made in the -n option which printed out an incorrect + warning with <>. +09-04-07 The emacs edit command M-_ and M_. and the vi command _ was fixed + to handle the case there there is no history file. +09-04-05 A bug in handling new-lines with read -n has been fixed. +09-04-05 The ENV variable defaults the the file named by $HOME/.kshrc rather + then to the string $HOME/.kshrc. +09-03-31 A bug in which a nested command substitution with redirections could + leave a file descriptor open has been fixed. +09-03-24 +ksh now only uses the value of the _ variable on startup if it can + verify that it was set by the invoking process rather than being + inherited by some other ancestor. +09-03-24 +When ksh is invoked without -p and ruid!=euid, and the shell is + compiled without SHOPT_P_UID or ruid=SHOPT_P_UID then euid is set + to ruid. A bug that did the wrong test (ruid&1 inside a command substitution wasn't working + correctly has been fixed. +09-02-02 A bug in the call stack of arithmetic function with 2 args + returning int has been fixed. +09-01-30 A bug in which 'eval print \$0' inside a function was giving the + wrong value for $0 has been fixed. +09-01-28 A bug in which a command substitution could return an exit status + of 127 when the pipefail option is enabled has been fixed. +09-01-26 ksh93 now generates an error message if you attempt to create + a global name reference to a local variable. +09-01-26 +The [[ -v var ]] operator was modified to test for array elements. +09-01-23 +The redirection operator <>; was added. It is similar to <> + except that if the command it is applied to succeeds, the file + is truncated to the offset at the command completion. +09-01-23 The default file descriptor for <> was changed to 1. +09-01-20 A bug in which the exit status specified in an exit trap was + not used when a process terminated with a signal has been fixed. +09-01-19 A bug in which a signal whose default action is to terminate + a process could be ignored when the process is running a sub-shell + has been fixed. +09-01-19 A bug in which sending SIGWINCH to a process that reads from a pipe + could cause a memory fault has been fixed. +09-01-16 +The -R unary operator was added to [[...]] and test to check whether + a variable is a name reference. +09-01-16 +The -v unary operator was added to [[...]] and test to check whether + a variable is set. +09-01-14 The unset built-in was modified to return 0 exit status when + unsetting a variable that was unset to conform with the POSIX + standard. +09-01-14 The unset built-in was modified to continue to unset variables + after encountering a variable that it could not unset to + conform to the POSIX standard. +09-01-14 The parameter expansion ${x+value} no longer expands the value of + the variable x when determining whether x is set or not. +09-01-13 A bug in which background jobs and pipelines that were not waited + for could, in rare instances, cause the shell to go into an infinite + loop or fail has been fixed. +09-01-06 A bug in indexed arrays of compound variables in which referencing + non-existent sub-variable in an arithmetic expression could cause + the sub-variable to be created has been fixed. +09-01-05 A bug in which the \ character did not escape extended regular + expression pattern characters has been fixed. +08-12-24 A bug in which killing the last element of a pipe did not cause + a write to the pipe to generate a SIGPIPE has been fixed. +08-12-19 A bug which could cause command substitution to hang when the + last element of a pipeline in a command substitution was a built-in + and the output was more that PIPE_BUFF. +08-12-18 A bug which occurs when a here documented marker embedded in a + command substitution occurs on a buffer boundary has been fixed. +08-12-17 A bug in the output of typeset -p for variables that had attributes + but did not have a value has been fixed. +08-12-16 A bug in which a name reference to a name reference variable that + references an array element has been fixed. +08-12-16 A bug in which a variable given both the -A and -C attribute along + with an initial assignment didn't work correctly has been fixed. +08-12-10 The [[ -t fd ]] test was fixed to handle fd>9. +08-12-10 A bug where function stack misalignment could cause a bus error + has been fixed. +08-12-09 Command completion was changed to use \ to quote special characters + instead of quoting the argument in single quotes. +08-12-07 A bug in typeset -m which occurred when the target node was an + associative array element has been fixed. +08-12-07 A timing bug on some systems (for example darwin), that could + cause the last process of a pipeline entered interactively to fail + with an "Exec format error" has been fixed. +08-12-04 +SHOPT_BGX enables background job extensions. Noted by "J" in + the version string when enabled. (1) JOBMAX=n limits the number + of concurrent & jobs to n; the n+1 & job will block until a + running background job completes. (2) SIGCHLD traps are queued + so that each completing background job gets its own trap; $! is + set to the job pid and $? is set to the job exit status at the + beginning of the trap. (3) sleep -s added to sleep until the time + expires or until a signal is delivered. +08-12-04 The sign of floating point zero is preserved across arithmetic + function calls. +08-12-04 A bug that caused print(1) to produce garbled stdout/stderr + output has been fixed. +08-12-04 A bug in which printf "%d\n" "''" did not output the + numerical value of the EURO symbol, 8354, has been fixed. +08-11-24 + /dev/fd* and /dev/std* redirections are first attempted with + open() to preserve seek semantics; failing that the corresponding + file descriptors are dup()'d. +08-11-20 A bug which could cause a core dump if a function compiled with + shcomp was found has been fixed. +08-11-20 A bug in which jobs were not cleared from the jobs table for + interactive shells when the pipefail option is on has been fixed. +08-11-11 A bug in which a field that was unset in a type definition and later + set for an instance could appear twice when displaying the variable + has been fixed. +08-11-11 A bug in which running a simple command & inside a function would + not return the correct process id has been fixed. +08-11-10 A bug in which the exit status of a command could be lost if the pid + was that of the most recent command substitution that had completed + has been fixed. +08-11-10 The maximum depth for subshells has been increased from 256 to 65536. +08-11-06 A bug which could cause a core dump when the _ reference variable was + used as an embedded type with a compound assignment has been fixed. + +08-10-31 --- Release ksh93t --- +08-10-31 Variable scoping/initialization bugs that could dump core were fixed. +08-10-24 The lexer now accepts all RE characters for patterns prefixed + with a ksh ~(...) option expression. +08-10-24 +For ${var/pat/sub} \0 in sub expands to the text matched by pat. +08-10-18 A bug in array scoping that could dump core has been fixed. +08-10-10 read -n and -N fixed to count characters in multibyte locales. +08-10-10 A bug that mishandled _.array[] type references has been fixed. +08-10-09 +${.sh.version} now contains a concatenation of the following (after + 'Version') denoting compile time features: + A SHOPT_AUDIT + B SHOPT_BASH + L SHOPT_ACCT + M SHOPT_MULTIBYTE +08-10-09 A bug that caused subshell command substitution with redirection + to hang has been fixed. +08-10-08 Output errors, other than to stderr, now result in a diagnostic. +08-10-08 ksh93 now supports types that contain arrays of other types as + members. Earlier versions core dumped in this case. +08-10-05 A bug which caused the shell to emit a syntax error for an arithmetic + statement of the form (( var.name[sub] = value)) has been fixed. +08-10-01 A bug that caused subshell command substitution to hang has + been fixed. +08-09-29 When the -p export option of typeset is used with other options, + only those variables matching the specified options are displayed. +08-09-29 When the shell reads the environment and finds variables that are + not valid shell assignments, it now passes these on to subsequent + commands rather than deleting them. +08-09-29 A bug in the display of compound variables containing an indexed + array of compound variables has been fixed. +08-09-29 A bug in the display of compound variables containing an associative + array with a subscript containing a . in the name has been fixed. +08-09-26 A core dump in the subshell environment restore has been fixed. +08-09-24 $(...) has been fixed to properly set the exit status in $?. +08-09-23 $(<...) with IFS=$'\n\n' has been fixed to retain all but the last + of multiple trailing newlines. +08-09-23 The -p option to typeset when used with other attributes, restricts + the output to variables with the specified attributes. +08-09-22 A bug that sometimes lost the exit status of a job has been fixed. +08-09-21 A bug that retained trailing command substitution newlines in + cases where the command caused the shell to fork has been fixed. +08-09-19 type, whence -v, and command -v were fixed to comply with POSIX + by writing 'not found' diagnostics to the standard error. +08-09-18 test and [...] were fixed to comply with POSIX in the case + of test '(' binop ')' where binop is a valid binary test operator. +08-09-16 +If a method discipline named create is specified when defining a + type, this function will be called when an instance is created. +08-09-15 +The variable _ is now set as a reference to the compound variable + when defining a compound variable or a type. +08-09-10 The shell now prints an error message when the type name specified + for an indexed array subscript is not an enumeration type. +08-09-10 A bug in which a subshell that spawned a background process could + loose output that was produced after the foreground completed + has been fixed. +08-09-10 A timing bug on some systems that could cause coprocesses started by a + subshell to not clean up and prevent other coprocesses has been fixed. +08-09-09 The typeset -m option is now able to rename array elements from + the same array. +08-09-09 The exit status of 2 from the DEBUG trap causes the next command + to be skipped. An exit value of 255 from a DEBUG trap called from + a function causes the function to return. +08-09-08 A bug in which a coprocess created in a subshell that did not + complete when the subshell terminated could prevent a coprocess + from being created in the parent shell has been fixed. +08-09-05 An assignment of the form name1=name2 where name1 and name2 + are both compound variables causes name1 to get a copy of name2. + name1+=name2 causes name2 sub-variables to be appended to name1. +08-09-05 A bug in which unsetting a compound variable did not unset all + the sub-variables has been fixed. +08-09-01 A bug in the subshell cleanup code that could cause SIGSEGV has + been fixed. +06-08-26 +The SHLVL variable which is an environment variable used by bash + and zsh that gets incremented when the shell starts. +08-08-25 +For an indexed array, a negative subscript now refers to offsets + from the end so that -1 refers to the last element. +08-08-24 An alignment error for shorts on 64 bit architectures has been fixed. +08-08-22 If oldvar is a compound variable, typeset -C newvar=oldvar creates + newvar as a copy of oldvar. +08-08-19 +The ALRM signal no longer cause the sleep builtin to terminate. +08-08-13 When used in an arithmetic expression, the .sh.version variable + now produces a number that will be increasing for each release. +08-08-11 A bug in which type instantiation with a compound assignment in + a dot script in which the type is defined has been fixed. +08-08-07 +The -m option has been added to typeset to move or rename a + variable. Not documented yet. +08-08-06 A bug in read when used in a loop when a prompt was specified + when reading from a terminal has been fixed. +08-08-01 A bug with the pipefail option in which a nested pipeline could + cause an asynchronous command to block has been fixed. +08-08-01 A for loop optimizer bug that treats .sh.lineno as an invariant + has been fixed. +08-07-30 A bug in which expanding compound variable that had a get discipline + from with a here document could cause a syntax error has been fixed. +08-07-18 A bug in which a nameref caused a local variable to be created + rather than binding to an existing variable in the global scope + has been fixed. +08-07-17 A bug which occurred when a nameref was created from within a + function that was part of a pipeline has been fixed. +08-07-14 +The compile option SHOPT_STATS was added. With this option the + compound variable .sh.stats keeps usage statistics that could help + with performance tuning. +08-07-10 +The output of set now always uses a single line for each variable. + For array variables, the complete set of values is now displayed. +08-07-09 +The typeset -C option can be used with arrays to indicate that + each element should default to a compound variable. +08-07-08 +The %B format now outputs compound variables and arrays. The + alternate flag # can be used to cause output into a single line. +08-07-03 When the window change signal, WINCH, is received, the current + edit line is redrawn in place. +08-07-01 A bug in the handling of shared variables when inside an embedded + type has been fixed. +08-06-29 A bug in multiline edit mode which occurred when the prompt length + was three characters or less has been fixed. +08-06-23 A bug in which the SIGCLD was not be triggered when background + jobs completed has been fixed. +08-06-23 _KSH_VERSION added as a name reference to .sh.version. +08-06-20 type now outputs 'special builtin' for special builtins. +08-06-19 A couple of bugs in multi-dimensional arrays have been fixed. +08-06-19 A bug in which a syntax error in a dot script could generated + a syntax error in the next subsequent command has been fixed. +08-06-17 Reduced the maximum function call depth to 2048 to avoid exceptions + on some architectures. +08-06-16 A bug in which printf "%B" could generate an exception when the + specified variable was not set has been fixed. +08-06-16 +When typeset -p is followed by variable names, it now displays + the attributes names and values for the specific names. +08-06-14 A bug that could effect the drawing of the screen from multiline + emacs or gmacs mode when walking up the history file has been fixed. +08-06-13 A bug in which a compound variable defined in a subshell could + have side effects into the parent shell has been fixed. +08-06-13 A number of bugs related to using .sh.level to set the stack from + for DEBUG traps have been fixed. +08-06-13 +The .sh.lineno variable has been added. When .sh.level is changed + inside a DEBUG trap, the .sh.lineno contains the calling line number + for the specified stack frame. +08-06-13 The .sh.level variable has been documented and now works. +08-06-11 +The -C option has been added to read for reading compound command + definitions from a file. +08-06-11 +The . command is now permitted inside a compound command definition. + The dot script can contain declaration commands and dot commands. +08-06-09 +Add -C option to typeset so that typeset -C foo, is equivalent + to foo=(). +08-06-09 Added -n warning message for typeset option orderings that are valid + with ksh88 but not valid with ksh93, for example Lx5. +08-06-09 A bug in which the return value for an assignment command containing + a command substitution with that failed was zero when the assignment + contained redirections has been fixed. +08-06-09 A bug in the quoting of $ inside a ERE pattern ~(E)(pattern) + has been fixed. +08-06-06 A bug when processing `` command substitution with the character + sequence \$' has been fixed. +08-06-02 +When defining a type, the typeset -r attribute causes this field + to be required to be specified for each instance of the type and + does not allow a default value. +08-06-02 Several bugs in which compound variables were modified by + subshells have been fixed. +08-05-22 +The ceil function has been added to the math functions. +08-05-21 A bug in which a name reference defined in a function and passed + as an argument to another function could cause an incorrect binding. +08-05-21 A bug in freeing compound variables that are local to functions + has been fixed. +08-05-19 +The array expansions ${array[sub1..sub2]} and ${!array[sub1..sub2]} + to expand to the value (or subscripts) for array between sub1 and + sub2 inclusive. For associative arrays, the range is based on + location in the POSIX locale. The .. must be explicit and cannot + result from an expansion. +08-05-15 The trap on SIGCLD is no longer triggered by the completion of + the foreground job as with ksh88. +08-05-14 A bug in the implementation of the editing feature added on + 07-09-19 in emacs mode has been fixed. +08-05-12 A bug in processing the test built-in with parenthesis has been + fixed. +08-05-12 The unset built-in now returns non-zero when deleting an array + subscript that is not set. +08-05-08 +Changing the value of HISTFILE or HISTSIZE will cause the old + history file to be close and reopened with the new name or size. +08-05-08 When FPATH is changed functions that were found via a path search + will be searched for again. +08-05-08 A parser bug in which reserved words and labels were recognized + inside compound indexed array assignment after a new-line has + been fixed. +08-05-07 A bug in getopts when handling numerical option arguments has + been fixed. +08-05-07 +The typeset -S option was added for variables outside type + definitions to provide a storage class similar to C static + inside a function defined with function name. When outside + type definitions and outside a function, the -S option cause + the specified variable so be unset before the assignment and + before the remaining attributes are supplied. +08-05-07 A bug that affected the cursor movement in multiline mode when + a character was deleted from near the beginning of the any + line other than the first. +08-05-01 In multiline edit mode, the refresh operation will now clear + the remaining portion of the last line. +08-05-01 A bug in computing prompt widths for the edit modes for prompts + with multibyte characters has been fixed. +08-05-01 A bug in the multiline edit mode which could cause the current + line to be displayed incorrectly when moving backwards from third + or higher line to the previous line has been fixed. +08-05-01 A bug in which options set in functions declared with the function + name syntax were carried across into functions invoked by these + functions has been fixed. +08-04-30 A bug which could cause a coprocess to hang when the read end + is a builtin command has been fixed. +08-04-30 +The emacs and vi editors have been modified to handle window + change commands as soon as they happen rather than waiting for + the next command. +08-04-28 A bug in which ${!x} did not expand to x when x was unset has been + fixed. +08-04-27 A bug in which the assignment x=(typeset -a foo=([0]=abc)) created + x.foo as an associative array has been fixed. +08-04-25 A bug in which $# did not report correctly when there were more + than 32K positional parameters has been fixed. +08-04-04 Choose the name _ as the sub-variable that holds type or instance + specific data used by discipline functions. +08-03-27 A bug in which the terminal group was not given back to the parent + shell when the last part of a pipeline was handled by the parent shell + and the other parts of the pipeline complete has been fixed. + The symptom was that the pipeline became uninterruptable. +08-03-25 A bug in restricted mode introduced in ksh93s that caused scripts + that did not use #! to executed in restricted mode has been fixed. +08-03-25 A bug in which the pipefail option did not work for a pipeline + within a pipeline has been fixed. +08-03-24 A bug in which OPTIND was not set correctly in subshells has + been fixed. +08-03-24 A bug which could cause a memory exception when a compound variable + containing an indexed array with only element 0 defined was expanded. +08-03-20 A bug in which ${!var[sub].*} was treated as an error has been fixed. +08-03-20 Associative array assignments of the form ([name]=value ...) + now allow ; as well as space tab and new line to separate elements. +08-03-18 A buffering problem in which standard error was sometimes + not flushed before sleep has been fixed. +08-03-17 A bug in which a signal sent to $$ while in a subshell would be + sent to the subshell rather than the parent has been fixed. +08-03-17 + A --default option added to set(1) to handle set +o POSIX semantics. + set --state added as a long name alias for set +o. +08-03-14 A bug in which using monitor mode from within a script could + cause the terminal group to change has been fixed. +08-03-10 The new ${...} command substitution will treat the trailing } + as a reserved word even if it is not at the beginning of a command, + for example, ${ date }. +08-03-10 If the name of the ENV begins with /./ or ././ then the + /etc/ksh.kshrc file will not be executed on systems that support + this interactive initialization file. +08-03-07 A bug in which ksh -i did not run the ENV file has been fixed. +08-03-07 A bug in which ulimit did not always produce the same output as + ulimit -fS has been fixed. +08-03-04 A bug in multiline mode in emacs and vi mode which could cause the + cursor to be on the wrong line when interrupt was hit has been fixed. +08-03-03 The change made in ksh93s+ on 07-06-18 in which braces became + optional for ${a[i]} inside [[...]] was restored in the case + where the argument can be a pattern. +08-03-03 A bug in which creating a name reference to an associative array + instance would fail when the subscript contained characters [ or + ] has been fixed. +08-02-29 +The redirection operator >; has been added which for non-special + files, generates the output in a temporary file and writes the + specified file only of the command has completed successfully. +08-02-15 A bug in ${var/pattern/string} for patterns of the form ?(*) and +(*) + has bee fixed. +08-02-07 A bug in which test \( ! -e \) produced an error has been fixed. +08-02-14 +The typeset -a option can now optionally be followed by the name + of an enumeration type which allows subscripts to be enumerations. +08-02-14 +The enum builtin which creates enumeration types has been added. +08-02-12 The backoff logic when there are no more processes has been fixed. +08-02-07 The -X option has been added to typeset. The -X option creates + a double precision number that gets displayed using the C99 %a + format. It can be used along with -l for long double. +08-01-31 The -T option to typeset has been added for creating typed + variables. Also the -h and -S options have been added to + typeset that are only applicable when defining a type. +08-01-31 The prefix expansion operator @ has been added. ${@name} + expands to the type of name or yields the attributes. +07-11-15 A bug in the macro expander for multibyte characters in which + part of the character contains a file pattern byte has been fixed. +07-10-03 A bug in which : was not allowed as part of an alias name has been + fixed. +07-09-26 A bug in which appending a compound variable to a compound variable + or to an index array didn't work has been fixed. +07-09-19 In both emacs and vi edit mode, the escape sequence \E[A (usually + cursor up, when the cursor is at the end of the line will fetch + the most recent line starting with the current line. +07-09-18 The value of ${!var} was correct when var was a reference to an + array instance. +07-09-18 The value of ${!var[sub]} was not expanding to var[sub] and this + was fixed. It also fixed ${name} where name is a name reference + to var[sub]. +07-09-18 +It is now legal to create a name reference without an initialization. + It will be bound to a variable on the first assignment. +07-08-30 +A discipline function can be invoked as ${x.foo} and is equivalent + to ${ x.foo;} and can be invoked as x.foo inside ((...)). +07-07-09 A bug in which typeset -a did not list indexed arrays has been + fixed. +07-07-03 +The command substitution ${ command;} has been added. It behaves + like $(command) except that command is executed in the current + shell environment. The ${ must be followed by a blank or an + operator. + +08-04-17 --- Release ksh93s+ --- +08-04-17 A bug in which umask was not being restored correctly after a + subshell has been fixed. +08-04-15 A bug in which sending a STOP signal to a job control shell started + from within a shell function caused cause the invoking shell to + terminate has been fixed. +08-04-11 A bug which caused $(exec > /dev/null) to go into an infinite loop + has been fixed. +08-03-27 A bug in which typeset -LZ was being treated as -RZ has been fixed. +08-03-06 A bug with ksh -P on systems that support the the profile shell, + in which it would exit after running a non-builtin has been fixed. +08-01-31 A bug in which command substitution inside ((...)) could cause + syntax errors or lead to core dumps has been fixed. +08-01-17 A bug in which discipline functions could be deleted when invoked + from a subshell has been fixed. +08-01-17 A bug in which a command substitution consisting only of + assignments was treated as a noop has been fixed. +08-01-17 A bug in which discipline functions invoked from withing a + compound assignment could fail has been fixed. +08-01-16 Incomplete arithmetic assignments, for example ((x += )), now + generate an error message. +08-01-16 A bug in which a set discipline defined for a variable before + an array assignment could cause a core dump has been fixed. +08-01-03 A bug in on some systems in which exit status 0 is incorrectly + returned by a process that catches the SIGCONT signal is stopped + and then continued. +07-12-13 A race condition in which a program that has been stopped and then + continued could loose the exit status has been fixed. +07-12-12 Code to check for file system out of space write errors for all + writes has been added. +07-12-11 A bug in the macro expander for multibyte characters in which + part of the character contains a file pattern byte has been fixed. +07-12-06 A bug in the emacs edit mode when multiline was set that output + a backspace before the newline to the screen has been fixed. +07-12-04 A bug in which using TAB after a variable name listing expansion + in the edit modes would cause the $ to disappear has been fixed. +07-11-28 A bug in which setting IFS to readonly could cause a subsequent + command substitution to fail has been fixed. +07-11-27 A work around for a gcc 4.* C99 "feature" that could cause a job + control shell to go into an infinite loop by adding the volatile + attribute to some auto vars in functions that call setjmp(). +07-11-27 A bug in which the shell could read ahead on a pipe causing the + standard input to be incorrectly positioned has been fixed. +07-11-27 A bug in which compound variable UTF-8 multibyte values were not + expanded or traced properly has been fixed. +07-11-21 A bug where an unbalanced '[' in a command argument was not treated + properly has been fixed. +07-11-15 A bug in which compatibility mode (no long option names) getopts(1) + incorrectly set the value of OPTARG for flag options has been fixed. +07-11-15 A bug in which "hash -- name" treated "--" as an invalid name operand + has been fixed. +07-11-15 typeset now handles "-t -- [-r] [--]" for s5r4 hash(1) compatibility. +07-11-15 A bug in which the umask builtin mis-handled symbolic mode operands + has been fixed. +07-11-15 Bugs in which shell arithmetic and the printf builtin mis-handled the + signs of { -NaN -Inf -0.0 } have been fixed. +07-11-15 +The full { SIGRTMIN SIGRTMIN+1 ... SIGRTMAX-1 SIGRTMAX } range + of signals, determined at runtime, are now supported. +07-11-15 A bug in which creating an index array with only subscript 0 created + only a simple variable has been fixed. +07-11-14 A bug in which appending to an indexed array using the form + name+=([sub]=value) could cause the array to become an associative + array has been fixed. +07-11-14 A bug in which typeset without arguments could coredump if a + variable is declared as in indexed array and has no elements has + been fixed. +07-11-14 A bug in which creating a local SECONDS variable with typeset in + a function could corrupt memory has been fixed. +07-11-14 A bug which could cause a core dump when a script invoked by name + from a function used compound variables has been fixed. +07-11-05 A bug in which printf %d "'AB" did not diagnose unconverted characters + has been fixed. +07-11-05 printf %g "'A" support added for all floating point formats. +07-11-01 A bug in which typeset -f fun did not display the function definition + when invoked in a subshell has been fixed. +07-10-29 The sleep builtin was fixed so that all floating point constants + are valid operands. +07-10-10 A bug in which the locale was not being restored after + LANG=value command has been fixed. +07-09-20 A bug in which a nameref to a compound variable that was local + to the calling function would not expand correctly when displaying + is value has been fixed. +07-09-19 A bug which cause cause a core dump if .sh.edchar returned + 80 characters or more from a keyboard trap has been fixed. +07-09-14 A bug in which could cause a core dump when more than 8 file + descriptors were in use has been fixed. +07-09-10 A bug in which creating a name reference to an instance of + an array when the array name is itself a reference has been fixed. +07-09-10 The file completion code has been modified so that after an = in + any word, each : will be considered a path delimiter. +07-09-06 A bug in which subprocess cleanup could corrupt the malloc() heap + has been fixed. +07-08-26 A bug in which a name reference to an associative array instance + could cause the subscript to be evaluated as an arithmetic expression + has been fixed. +07-08-22 A bug in which the value of an array instance was of a compound + variable was not expanded correctly has been fixed. +07-08-14 A bug which could cause a core dump when a compound assignment was + made to a compound variable element with a typeset -a attribute + has been fixed. +07-08-08 A bug in which a trap ignored in a subshell caused it to be + ignored by the parent has been fixed. +07-08-07 A bug in which the set command would generated erroneous output + for a variable with the -RZ attribute if the variable name had been + passed to a function has been fixed. +07-08-02 A bug in which read x[1] could core dump has been fixed. +07-08-02 A second bug in which after read x[sub] into an associative array + of an element that hasn't been assigned could lead to a core dump + has been fixed. +07-07-31 A bug in which a pipeline that completed correctly could have + an exit status of 127 when pipefail was enabled has been fixed. +07-07-09 +The SHOPT_AUDIT compile option has been added for keyboard logging. +07-06-25 In vi insert mode, ksh no longer emits a backspace character + before the carriage return when the newline is entered. +07-06-25 A bug in which pipefail would cause a command to return 0 + when the pipeline was the last command and the failure happened + on a component other than the last has been fixed. +07-06-25 A bug in the expansion of ${var/pattern/rep} when pattern or rep + contained a left parenthesis in single quotes has been fixed. +07-06-18 The braces for a subscripted variable with ${var[sub]} are now + optional when inside [[...]], ((...)) or as a subscript. +07-05-28 A bug in brace expansion in which single and double quotes did + not treat the comma as a literal character has been fixed. +07-05-24 The -p option of whence now disables -v. +07-05-23 Several bug fixes in compound variables and arrays of arrays + have been made. +07-05-15 A bug in which the %B format of printf was affected by the + locale has been fixed. +07-05-14 A bug in which \ was not removed in the replacement pattern with + ${var/pattern/rep} when it was not followed by \ or a digit has + been fixed. +07-05-10 A bug in which ksh -R file core dumped if no script was specified + has been fixed. it not displays an error message. +07-05-07 Added additional Solaris signals to signal table. +07-04-30 A bug in which a pipeline with command substitution inside a + function could cause a pipeline that invokes this function to + hang when the pipefail option is on has been fixed. +07-04-30 +Added -q to whence. +07-04-18 A small memory leak with each redirection of a non-builtin has + been fixed. +07-03-08 A bug in which set +o output command line options has been fixed. +07-03-08 A bug in which an error in read (for example, an invalid variable + name), could leave the terminal in raw mode has been fixed. +07-03-06 A bug in which read could core dump when specified with an array + variable with a subscript that is an arithmetic expression has + been fixed. +07-03-06 Several serious bugs with the restricted shell were reported and + fixed. +07-03-02 If a job is stopped, and subsequently restarted with a CONT + signal and exits normally, ksh93 was incorrectly exiting with + the exit status of the stop signal number. +07-02-26 +M-^L added to emacs mode to clear the screen. +07-02-26 A bug in which setting a variable readonly in a subshell would + cause an unset error when the subshell completed has been fixed. +07-02-19 +The format with printf uses the new = flag to center the output. +07-02-19 A bug in which ksh93 did not allow multibyte characters in + identifier names has been fixed. +07-02-19 A bug introduced in ksh93 that causes global compound variable + definitions inside functions to exit with "no parent" has been fixed. +07-02-19 A bug in which using compound commands in process redirection + arguments would give syntax errors <(...) and >(...) has been fixed. +07-01-29 A bug which caused the shell to core dump which can occur when a + built-in exits without closing files that it opens has been fixed. +07-01-26 A bug in which ~(E) in patterns containing \ that are not inside () + has been fixed. + +06-12-29 --- Release ksh93s --- +06-12-29 A bug in which the value of IFS could be changed after a command + substitution has been fixed. +06-12-22 +/dev/(tcp|udp|sctp)/HOST/SEVRICE now handles IPv6 addresses on + systems that provide getaddrinfo(3). +06-12-19 +A -v option was added to read. With this option the value of + the first variable name argument will become the default value + when read from a terminal device. +06-11-20 A bug in which "${foo[@]:1}}" expands a null argument (instead of + no argument), when foo[0] is not empty has been fixed. +06-11-16 The discipline functions have been modified to allow each subscript + to act independently. Currently the discipline function will not + be called when called from a discipline function of the same variable. +06-11-14 A bug which could cause a core dump if a file descriptor for + an internal file was closed from with a subshell has been fixed. +06-10-30 +The redirections <# pattern, and <## pattern have been added. + Both seek forward to the beginning of the next line that contains + the pattern. The <## form copies the skipped portion to standard + output. +06-10-26 +On systems that support stream control transport, the virtual file + name /dev/sctp/host/port can now be used to establish connections. +06-10-26 +The printf modifier # when used with d produces units in thousands + with a single letter suffix added. The modifier # when used with + the i specification provides units of 1024 with a two letter suffix. +06-10-24 The value of $! is now set to the process id of a job put + into the background with the bg command as required by POSIX. +06-10-23 A bug in which the value of $! was affected by a background + job started from a subshell has been fixed. +06-10-23 A bug in ${var:offset:len} in multibyte locales has been fixed. +06-10-15 +The remaining math functions from C99 were added for any system + that supports them. +06-10-13 The klockwork.com software detected a few coding errors that + have been fixed. +06-10-12 A bug when skipping over `...` with ${x:=`...`} when x is set + has been fixed. +06-10-11 A bug in process floating constants produced by the %a format + of printf has been fixed. +06-10-06 A bug in which IFS was not being restored correctly in some + cases after a subshell has been fixed. +06-10-06 A bug in which pipefail was not detecting some failures in + pipelines with 3 or more states has been fixed. +06-10-03 A bug in the processing of >(...) with builtins which could + cause the builtin to hang has been fixed. +06-10-03 A bug in the for loop optimizer which causes >(...) process + substitution to be ignored has been fixed. +06-09-17 +The -a option was added to typeset for indexed arrays. This + is only needed when using the ([subscript]=value ...) form. +06-09-06 +The showme option was added. Each simple command not beginning + with a redirection and not occurring with in the while, until, if, + select condition can be preceded by a semi-colon which will + be ignored when showme is off. When showme is on, any command + preceded by a colon will be traced but not executed. +06-08-16 +As a new feature, a leading ~(N) on a pattern has no effect + except when used for file expansion. In this case if not + matches are found, the pattern is replaced by nothing rather + than itself. +06-08-11 A bug in the expansion of ${.sh.match[i]:${#.shmatch[i]}} has + been fixed. +06-08-10 +The read builtin options -n and -N have been modified to treat + the size as characters rather than bytes unless storing into a + binary (typeset -B) variable. +06-07-27 +When the here document operator << is followed directly by a # + rather than a -, the first line of the here-document determines + how much whitespace is removed for each line. +06-07-26 A bug in the C-shell history (enabled with set -H) in which the + history event !$ was not processed has been fixed. +06-07-21 A bug on some systems in which assigning PATH on a command line + would not take effect has been fixed. +06-07-20 Add ksh93 and rksh93 as allowable names for ksh binaries. +06-07-20 Removed the SHOPT_OO compilation option which was only partially + implemented. +06-07-20 The ability to use egrep, grep, and fgrep expressions within + shell patterns has been documented. +06-07-17 A bug with arithmetic command expressions for locales in which + the comma is a thousands separator has been fixed. +06-07-13 +The default HISTSIZE was increased from 128 to 512. +06-07-13 A multibyte problem with locales that use shift codes has been fixed. +06-06-23 A number of bug fixes for command, file, and variable completion + have been mode. +06-06-20 +Floating point division by zero now yields the constant Inf or -Inf + and floating functions with invalid arguments yield NaN. +06-06-20 +The floating point constants Inf and NaN can be used in arithmetic + expressions. +06-06-20 +The functions isinf(), isnan(), tanhl() have been added for + arithmetic expressions. +06-06-13 Internal change to use ordering for variables instead of hashing + to speed up prefix matching. +06-06-13 A window between fork/exec in which a signal could get lost + and cause a program to hang has been eliminated +06-06-13 A bug in edit completion with quoted strings has been fixed. +06-06-07 The restricted options can now be enabled by set as well as on + the command line. Once set, it can not be disabled. +06-06-04 Modified built-in binding so that for systems for which /bin + and /usr/bin are the same, a builtin bound to /bin will get + selected when either /bin or /usr/bin is scanned. +06-06-04 +Added literal-next character processing for emacs/gmacs mode. + This change is not compatible with earlier versions of ksh93 + and ksh88 when the stty lnext is control-v. The sequence + escape-control-v will display the shell version. +06-05-31 +Modified emacs and vi mode so that entering a TAB after a partial + TAB completion, generates a listing of possible completions. + After the second TAB, a number followed by a TAB will perform + the completion with the corresponding item. +06-05-19 +Modified arithmetic so that conversions to strings default to + the maximum number of precision digits. +06-05-16 Bug fixes for multibyte locales. +06-05-10 The =~ operator was added to [[...]] and [[ string ~= ERE ]] + is equivalent to [[ string == ~(E)ERE ]]. +06-04-25 A bug in the vi edit mode which could cause the shell to core dump + when switching from emacs mode. +06-04-17 A bug in which using LANG or LC_ in assignment lists with builtins + did not restore the localed correctly has been fixed. +06-04-04 A bug in which discipline functions could not be added to variables + whose names started with .sh has been fixed. +06-03-28 +The -s option to typeset was added to modify -i to indicate short + integers. +06-03-28 A bug in which variables assignment lists before functions + defined with function name were not passed on the functions + invoked by this function has been fixed. +06-03-28 A bug in which name references defined within a function defined + with function name could not be used with compound variables has + been fixed. +06-03-27 A bug in which read <&p (print >&p) would cause the coprocess input + (output) pipe to close before reading from (after writing to) + it has been fixed. +06-02-28 A bug in which stopping a job created with the hist builtin command + would create a job that could not be restarted has been fixed. + +06-01-24 --- Release ksh93r --- +06-01-24 A bug in which running commands with standard output closed would + not work as expected has been fixed. +06-01-23 A bug in which print -u could fail when file descriptor was + open for writing has been fixed. +06-01-19 The ?: arithmetic operator fixed to work when the operation after + the colon was an assignment. +05-12-24 A bug which could lead to a core dump when elements of a compound + variable were array elements, i.e. foo=(bar=(1 2)), has been fixed. +05-12-13 An arithmetic bug in which x+=y+=z was not working has been fixed. +05-12-13 An arithmetic bug in which x||y was returning x when x was non-zero + rather than 1 has been fixed. +05-12-07 +The aliases for integer and float have been changed to use attributes + -li and -lE to handle long long and long double types. +05-12-07 +The histexpand (-H) option has been added which allows C-shell + style history expansions using the history character !. +05-12-07 +The multiline option was added which changes that way the edit + modes handle lines longer than the window width. Instead of + horizontal scrolling, multiple lines on the screen are used. +05-12-05 The whence builtin now returns an absolute pathname when the + command is found in the current directory. +05-11-29 A bug which caused ksh -c '[[ ! ((' to core dump rather than + report a syntax error has been fixed. +05-11-29 A bug when reading fixed length records into typeset -b variables + which caused a zero byte to terminate the value has been fixed. +05-11-22 +The ability to seek to an offset within a file has been added + with the new I/O redirection operators, <# and >#. Currently, + these redirection operators must be followed by ((expr)) + but in a future release, it should be able to used to seek forward + to the specified shell pattern. In addition $(n<#) expands to the + current byte offset for file descriptor n. +05-11-22 +The .sh.match array variable is now set after each [[ ... ]] + pattern match. Previously it was only set for substring matches. +05-10-17 A bug in which the library path variable could be prefixed + with a directory when a .path file was not encountered in + the directory of the executable has been fixed. +05-09-15 A for/while loop optimizer bug in which $OPTIND was not + correctly expanded has been fixed. +05-09-05 A bug in which a history command that invoked a history + command could go into an infinite loop has been fixed. +05-08-31 +In the case that IFS contains to adjacent new-lines so that + new-line is not treated as a space delimiter, only a single + new-line is deleted at the end of a command substitution. +05-08-19 +When a tilde substitution expands to the / directory and is + followed by a /, it is replaced by the empty string. +05-08-16 A bug in which n<&m did not synchronize m has been fixed. +05-08-16 A bug in which process substitution ( <() and >() ) was not + working within for and while loops has been fixed. +05-07-24 A bug in which the pattern ~(E)(foo|bar) was treated as a syntax + error has been fixed. +05-07-24 A bug in completion with =, where n was the one of the + previous selection choices has been fixed. +05-07-21 A bug with multibyte input when no edit mode was specified which + caused the input line to shift left/right has been fixed. +05-06-24 A race condition which could cause the exit status to get lost + on some fast systems has been fixed. +05-06-21 A bug in which nested patterns of the form {m,n}(pat) would cause + syntax errors has been fixed. +05-06-21 A bug in the macro expander has been fixed which could cause a + syntax error for an expansion of the form ${x-$(...)} when + x is set and the command substitution contained certain strings. +05-06-08 +On systems for which echo does not do System V style \ expansions, + the -e option was added to enable these expansion. +05-06-08 A bug in which ${var op pattern} to not work when inside an + arithmetic expression has been fixed. +05-05-23 +An extension to shell patterns that allows matching of nested + groups while skipping over quoted strings has been added. +05-05-18 A bug in which the line number for errors was not correct for + functions loaded from FPATH has been fixed. +05-04-18 A bug in which the exit status $? is not set when a trap triggered + by the [[...]] command is executed has been fixed. +05-04-08 +Redirection operators can be directly preceded with {varname} + with no intervening space, where varname is a variable name which + allows the shell to select a file descriptor > 10 and store it + into varname. +05-04-08 +SHOPT_CMDLIB_BLTIN=1 now includes generated table. +05-04-07 +[[ -o ?option ]] is true if "option" is a supported option. +05-04-05 A bug in handling file completion with spaces in the names + has been fixed. +05-03-25 +The SIGWINCH signal is caught by default to keeps the LINES and + COLUMNS variables in sync with the actual window size. +05-03-25 +Building ksh with SHOPT_REMOTE=1 causes ksh to set --rc if stdin is + a socket (presumably part of a remote shell invocation.) +05-03-25 +Building ksh with SHOPT_SYSRC=1 causes interactive ksh to source + /etc/ksh.kshrc (if it exists) before sourcing the $ENV file. +05-03-25 +{first..last[..incr][%fmt]} sequences added to brace expansions + when braceexpand is enabled. +05-03-03 A bug where a SIGCHLD interrupt could cause a fifo open to fail has + been fixed. +05-02-25 A bug in which a builtin command run in the background could + keep a file descriptor open which could cause a foreground + process to hang has been fixed. +05-02-24 A bug where builtin library commands (e.g., date and TZ) failed to + detect environment variable changes has been fixed. +05-02-22 +The read builtin and word splitting are now consistent with respect + to IFS -- both treat IFS as field delimiters. +05-02-22 +The read builtin no longer strips off trailing delimiters that + are not space characters when there are fewer variables than fields. +05-02-17 A builtin bug on systems where dlsym(libcmd) returns link-time + bindings has been fixed. +05-02-12 A bug in which the lib_init() function for .paths BUILTIN_LIB + libraries was not called has been fixed. +05-02-06 A bug on some systems in which moving the write end of a co-process + to a numbered file descriptor could cause it to close has been fixed. +05-02-06 A bug in the vi-edit mode in which the character under the cursor + was not deleted in some cases with the d% directive has been fixed. +05-02-06 A bug where external builtin stdout/stderr redirection corrupted + stdout has been fixed. +05-02-04 A bug where times formatting assumed CLK_TCK==60 has been fixed. + +05-01-11 --- Release ksh93q --- +05-01-11 A bug in the integral divide by zero check has been fixed. +05-01-11 +The -l option has been added to read /etc/profile and + $HOME/.profile, if they exist, before the first command. +05-01-11 An argument parsing bug that caused `kill -s x -- n' to fail has + been fixed. +05-01-11 +The .paths file, introduced in ksh93m, which can appear in + any directory in PATH, now allows a line of the form 'BUILTIN_LIB=.' + When a command is searched for this directory, and the full path + matches the path of the built-in version of the command (listed + by the 'builtin' command) then the built-in version of the command + is used. When ksh is built with SHOPT_CMDLIB_DIR=1 then all libcmd + functions become builtins with the '/opt/ast/bin/' directory prefix. +05-01-10 A bug in which a nameref to a compound name caused a core dump has + been fixed. +05-01-09 A bug in which some SIGCHLD interrupts (from child processes exiting) + caused a fatal print/echo error diagnostic has been fixed. +04-12-24 A bug in which some SIGCHLD interrupts (from child processes exiting) + corrupted the internal process/job list, sometimes causing the shell + to hang, has been fixed. +04-12-01 A bug in which typeset -Fn truncated less than n digits for large + numbers has been fixed. +04-11-25 A bug in which standard error could be closed after a redirection + to /dev/stderr has been fixed. +04-11-17 A bug in which an expansion of the form ${array[@]:3} could expand + to ${array[0]} when ${array[3]} was not set has been fixed. +04-10-22 +The -E or -orc command line option reads ${ENV-$HOME/.kshrc} file. +04-10-22 +`-o foo' equivalent to `+o nofoo', `-o nobar' equivalent to `+o bar'. + `--foo' equivalent to `-o foo', `--nofoo' equivalent to `+o foo' +04-10-05 +The .paths file, introduced in ksh93m, which can appear in + any directory in PATH, now allows a line of the form + 'BUILTIN_LIB=libname'. When a command is searched for this directory, + the shared library named by libname will first be searched for a + built-in version of the command. +04-09-03 <<< here documents now handle quotes in the word token correctly. +04-08-08 +The maximum size for read -n and and read -N was increased from + 4095 to 32M. +04-08-04 +printf %q was modified so that if an no operand was supplied, no + no output would be generated rather than a quoted empty string. +04-08-01 +The -n and -N options of the read builtin has been modified + when reading variables with the binary attribute so that the + data is stored directly rather than through assignment. +04-08-01 +The shcomp command has been modified to process alias commands + under some conditions. +04-07-31 +The .sh.match variable added in ksh93l, now works like other + indexed arrays. +04-07-08 A loop optimizer bug which occurs when typeset is used in + a for or while loop inside a function has been fixed. +04-06-24 +The number of subexpressions in a pattern was increased to 64 + from the current number of 20. +04-06-17 +The -t option to read was modified to allow seconds to be + specified as any arithmetic expression rather than just + an integral number of seconds, for example even -t 'sin(.5)' + is now valid. +04-06-16 Two small memory leak problems were fixed. +04-06-15 A bug in ${var/pattern/"string"} which occurred when string + contained pattern matching characters has been fixed. +04-05-08 printf $'%d\n' produced an erroneous error message and has + been fixed. +04-05-24 A bug in which an associative array without any elements could + cause a core dump when a script with an associative array with + the same name was declared in a script invoked by name has + been fixed. +04-05-11 A bug in which an exec statement could close the script that + is being processed in a script that is run by name causing + a failure has been fixed. +04-04-28 +If the first character of assignment to an integer variable was 0, + the variable had been treated as unsigned. This behavior was + undocumented and has been removed. +04-04-05 A bug in which the positioning of standard input could be incorrect + after reading from standard input from a subshell has been fixed. +04-03-30 A bug in the for loop optimizer which in rare cases could cause + memory corruption has been fixed. +04-03-29 +The preset alias source='command .' has been added. +04-03-29 A bug introduced in ksh93p on some systems in which invoked by + name with #! on the first line would not get the signals handling + initialized correctly has been fixed. +04-03-29 A bug introduced in ksh93p in which a HUP signal received by + a shell that is a session group leader was not passed down to + its children has been fixed. + +04-02-28 --- Release ksh93p --- +04-02-28 +The ability to apply an append discipline to any variable has + been added. +04-02-14 A bug in which the exportall option (set -a) would cause incorrect + results for arrays has been fixed. +04-02-02 A bug in which an exported array would pass more than + the first element to a script invoked by name has been fixed. +04-02-02 A bug on some systems in which name=value pairs preceding a script + invoked by name was not getting passed to the script has been fixed. +04-01-20 A bug in which an unset discipline function could cause a core + dump on some systems has been fixed. +04-01-12 A bug in which a continue or break called outside a loop from + inside a function defined with name() syntax could affect + the invoking function has been fixed. +04-01-08 If a command name begins with ~, only filename completion will be + attempted rather than pathname completion using the builtin editors. +04-01-08 A bug in the vi edit mode in which the wrong repeat count on + multiple word replacements with the . directive has been fixed. +04-01-06 Backspace characters are now handled correctly in prompt strings. +04-01-06 +The getopts builtin has been modified to accept numerical + arguments of size long long on systems that support this. +04-01-06 A bug in which unsetting all elements of an associative array + would cause it to be treated as an indexed array has been fixed. +03-12-15 A bug in which a quoted string ending with an unescaped $ would + delete the ending $ in certain cases has been fixed. +03-12-05 A bug in which the shell could hang when set -x tracing a command + when an invalid multibyte character is encountered has been fixed. +03-12-05 On some systems, if the KEYBD trap is set, then commands that use + the meta key were not processed until return was hit. This + has been fixed. +03-12-05 A problem which occurred when the login shell was not a group + leader that could cause it to fail has been fixed. +03-12-05 A problem in which a shell could core dump after receiving a signal + that should cause it to terminate while it was in the process + of acquiring more space has been fixed. +03-12-05 +If ENV is not specified, the shell will default to $HOME/.kshrc + for interactive shells. +03-11-21 A bug introduced in ksh93o in which the DEBUG trap could get + disabled after it triggered has been fixed. +03-11-04 A bug in which using arithmetic prefix operators ++ or -- on a + non-lvalue could cause a core dump has been fixed. +03-11-04 A bug in which leading zeros were stripped from variable + expansions within arithmetic computation to avoid being treated + as octal constants when they should not have, has been fixed. +03-10-08 A bug introduced in ksh93o in which a large here document inside + a function definition could get corrupted has been fixed. +03-09-22 A bug in which the .get discipline function was not being + called when a string variable was implicitly referenced from + within a numerical expression has been fixed. +03-09-22 A bug in which a script without a leading #! could get executed + by /bin/sh rather than the current shell on some systems has + been fixed. +03-09-12 +To improve conformance with ksh88, leading zeros will be ignored + when getting the numerical value of a string variable so that + they will not be treated as octal constants. +03-09-03 +The builtin kill command now processes obsolete invocations + such as kill -1 -pid. +03-09-02 The restriction on modifying FPATH in a restricted shell (sh -r) + has been documented. +03-09-02 +The restricted shell (sh -r) has been modified to disallow + executing command -p. +03-08-07 A bug in which the KEYBD trap was not being invoked when + characters with the 8th bit set has been fixed. +03-08-02 A parser bug introduced in ksh93o which caused the character + after () in a Posix function definition to be skipped + when reading from standard input has been fixed. +03-08-01 A bug in which "${foo#pattern}(x)" treated (x) as if it were + part of the pattern has been fixed. +03-08-01 +The command -x option has been modified so that any trailing + arguments that do expand to a single word will be included + on each invocation, so that commands like command -x mv * dir + work as expected. + +03-07-20 --- Release ksh93o+ --- +03-07-20 A bug in which could cause memory corruption when a posix + function invoked another one has been fixed. +03-07-15 A bug in which a file descriptor>2 could be closed before + executing a script has been fixed. +03-07-15 A parsing error for <() and >() process substitutions inside + command substitution has been fixed. +03-07-15 A parsing error for patterns of the form {...}(...) when + used inside ${...} has been fixed. +03-07-15 An error in which expanding an indexed array inside a compound + variable could cause a core dump has been fixed. +03-07-15 A bug in which on rare occasions a job completion interrupt + could cause to core dump has been fixed. +03-06-26 A bug in which process substitution embedded within command + substitution would generate a syntax error has been fixed. +03-96-23 A bug in which ${@:offset:len} could core dump when there + were no arguments has been fixed. +03-96-23 A bug in which ${X[@]:offset:len} could core dump when X + was unset has been fixed. +03-06-22 +The -x option was added to the command builtin. If this + option is on, and the number of arguments would exceed ARG_MAX, + the command will be invoked multiple times with a subset of + the arguments. For example, with alias grep='command -x grep, + any number of arguments can be specified. +03-06-14 A bug in which could cause a core dump on some systems with + vi and emacs editors with the MULTIBYTE option has been fixed. +03-06-06 A bug in which the shell could core dump when a script was + run from its directory, and the script name a symlink to a file + beginning with .., has been fixed. +03-06-05 A bug in which the shell could core dump when a child process + that it is unaware of terminates while it is calling malloc() + has been fixed. +03-06-02 +An option named globstar (set -G) has been added. When enabled, + during pathname expansion, any component that consists only of ** is + matches all files and any number of directory levels. +03-05-30 A bug in which the PATH search could give incorrect results when + run from directory foo and PATH contained .:foo:xxx has been fixed. +03-05-29 +Some changes were made to the code that displays the prompt in edit + mode to better handle escape sequences in the prompt. +03-05-27 I added = to the list of characters that mark the beginning of + a word for edit completion so that filenames in assignments + can be completed. +03-05-20 A bug in which read -N could hang on some systems when reading + from a terminal or a pipe has been fixed. +03-05-19 A bug in which the output of uname from a command substitution + would go to the standard output of the invoking command when + uname was invoked with a non-standard option has been fixed. +03-05-19 A job control bug which would cause the shell to exit because + it hadn't take back the terminal has been fixed. The bug + could occur when running a function that contained a pipeline + whose last element was a function. +03-05-19 A job control timing bug introduced in ksh93o on some systems + which could cause a pipeline to hang if the first component + completed quickly has been fixed. +03-05-13 +The read builtin has been modified so that the builtin editors + will not overwrite output from a previous incomplete line. +03-05-13 A bug in which the name of an identifier could have the string + .sh. prefixed to it after expanding a variable whose name begins + with .sh. has been fixed. +03-05-13 A bug in the expansion of $var for compound variables in which + some elements would not be output when the name was a prefix + of another name in the compound variable has been fixed. +03-05-08 The last item in the ksh93o release on 03-01-02 has been + altered slightly to preserve the leading 0's when the + preceding character is a digit. Thus, with typeset -LZ3 x=10, + $(( 1$x)) will be 1010 whereas $(( $x) will be 10. +03-04-25 A bug in which if x is a name reference, then nameref y=x.foo + did not follow x has been fixed. + +03-03-18 --- Release ksh93o --- +03-03-18 +A -N unary operator was added to test and [[...]] which returns + true if the file exists and the file has been modified since it + was last read. +03-03-18 +The TIMEFORMAT variable was added to control the format for + the time compound command. The formatting description is + described in the man page. +03-03-06 +A -N n option was added to read which causes exactly n bytes + to be read unlike -n n which causes at most n bytes to be read. +03-03-03 +Three new shell variables were added. The variable .sh.file + stores the full pathname of the file that the current command + was found in. The variable .sh.fun names the current function + that is running. The variable .sh.subshell contains the depth + of the current subshell or command substitution. +03-03-03 +When the DEBUG trap is executed, the current command line after + expansions is placed in the variable .sh.command. The trap + is also now triggered before each iteration of a for, select, + and case command and before each assignment and redirection. +03-02-28 +Function definitions are no longer stored in the history file so + that set -o nolog no longer has any meaning. +03-02-28 +All function definitions can be displayed with typeset -f not + just those stored in the history file. In addition, typeset +f + displays the function name followed by a comment containing the + line number and the path name for the file that defined this function. +03-02-28 A bug in which the value of $LINENO was not correct when executing + command contained inside mult-line command substitutions has been + fixed. +03-02-19 +Since some existing ksh88 scripts use the undocumented and + unintended ability to insert a : in front of the % and # parameter + expansion operators, ksh93 was modified to accept :% as equivalent + to % and :# as equivalent to # with ${name op word}. +03-02-14 A bug which could cause a core dump when reading from standard + error when standard error was a pty has been fixed. +03-02-14 +The shell arithmetic was modified to use long double on systems + that provide this data type. +03-02-09 A bug in which a function located in the first directory in FPATH + would not be found when the last component of PATH was . and the + current directory was one of the directories in PATH has been fixed. +03-02-07 +The trap and kill builtin commands now accept a leading SIG prefix + on the signal names as documented. +03-02-05 A bug in the expansion of ${var/$pattern}, when pattern contained + \[ has been fixed. +03-02-05 A bug in which .sh.match[n], n>0, was not being set for substring + matches with % and %% has been fixed. +03-01-15 A bug in which getopts did not work for numerical arguments specified + as n#var in the getopts string has been fixed. +03-01-09 A bug in which using ${.sh.match} multiple times could lead to + a memory exception has been fixed. +03-01-06 A bug in the expansion of ${var/pattern/$string} in the case that + $string contains \digit has been fixed. +03-01-02 +A -P option was added for systems such as Solaris 8 that support + profile shell. +03-01-02 For backward compatibility with ksh88, arithmetic expansion + with ((...)) and let has been modified so that if x is a zero-filled + variable, $x will not be treated as an octal constant. + +02-12-05 --- Release ksh93n+ --- +02-11-30 A bug that can show up in evaluating arithmetic statements that + are in an autoloaded function when the function is autoload from + another function has been fixed. +02-11-30 An optimization bug in which an expansion of the form ${!name.@}, + which occurred inside a for or a while loop, when name is a name + reference, has been fixed. +02-11-18 A bug in which modifying array variables in a subshell could leave + side effects in the parent shell environment has been fixed. +02-11-18 A memory leak when unsetting an associative array has been fixed. +02-11-14 +The code to display compound objects was rewritten to make + it easier for runtime extensions to reuse this code. +02-11-14 +A change was made to allow runtime builtins to be notified when + a signal is received so that cleanup can be performed. +02-10-31 +User applications can now trap the ALRM signal. Previously, + the ALRM signal was used internally and could not be used + by applications. +02-10-31 A bug in which signals received while reading from a coprocess + for which traps were set was not handled correctly has been fixed. +02-10-31 A bug in which a file opened with exec inside a subshell could + be closed before the subshell completed has been fixed. +02-10-21 A bug in which setting PATH or FPATH inside a function might not + take effect has been fixed. +02-10-21 A bug which could cause a core dump when a local SECONDS variable + is defined in a function has been fixed. +02-10-15 A bug in which the associate array name operator ${!array[@]} + could return the same name multiple times has been fixed. +02-10-15 A bug in which the zero'th element of an associative array was + not getting set when an assignment was made without a subscript + specified has been fixed. + +02-09-30 --- Release ksh93n --- +02-09-30 +The maximum indexed array size was increased to 16Megs. +02-09-30 A bug which could cause a core dump when changing attributes + of associative array has been fixed. +02-09-30 A bug in which exporting an array variable would not export the + 0-th element has been fixed. +02-09-30 A bug in which an array assignment of the form a=($a ...) would unset + 'a' before the right hand side was evaluated has been fixed. +02-09-27 A bug in which the error message for ${var?message} when var was + null or unset did not contain the variable name var has been fixed. +02-09-27 A bug in which closing file descriptors 0 through 2 could + cause a subsequent here document to fail has been fixed. +02-09-14 A bug in whence which occurs when the specified name contained + a / has been fixed. +02-09-14 A bug in the parser for strings of the form name$((expr))=value + has been fixed. +02-09-14 A for loop optimization bug in which the number of elements in + an array was treated as an invariant has been fixed. +02-09-09 A bug in which redirection or closing of a file descriptor between + 3 and 9 could cause a subsequent here document to fail has been + fixed. +02-09-09 A bug in which a background job was not removed from the job list + when a subshell completed has been fixed, for example (prog&). +02-09-03 A bug in which an assignment of the form name=(integer x=3) + could be interpreted as an array assignment rather than a + compound variable assignment has been fixed. +02-08-19 A command completion bug which occurred on file systems that + are case insensitive has been fixed. +02-08-19 A bug which could lead to an exception on some systems (for + example FREEBSD) which occurred when setting PATH has been fixed. +02-08-11 A bug in arithmetic rounding in which a value input as a decimal + string would output as a rounded version of the string has + been fixed. +02-08-11 A bug in which the last character could be deleted from shell + traces and from whence when called from a multibyte locale + has been fixed. +02-08-01 A bug which could cause a core dump to occur when a shell script + is executed while a coprocess is running that has closed the + output pipe has been fixed. +02-08-01 A bug in which command completion in multibyte mode could + corrupt memory for long command lines has been fixed. + +02-06-17 --- Release ksh93n- --- +02-06-17 A bug in which user defined macros could cause a core dump in + with MULTIBYTE mode has been fixed. +02-06-17 A bug in which printf format specifiers of the form %2$s were causing + a core dump has been fixed. +02-06-17 A bug in which setting stty to noecho mode did not prevent the + echoing of characters by ksh when emacs or viraw mode + was enabled has been fixed. +02-06-17 A bug in which background job completion could cause the sleep + builtin to terminate prematurely has been fixed. +02-06-17 A bug in which the shell could core dump if getopts was called + when the OPTIND variable contained a negative value has been fixed. +02-06-10 +The edit mode prompt has been modified to handle escape sequences. +02-06-10 A bug which occurred for interactive shells in which the builtin + cat command was used in command substitution on a file whose + size was larger than PIPE_BUF has been fixed. +02-06-10 A bug in which the trap on ERR was not being processed when + set inside a function has been fixed. +02-06-07 A bug in which function definitions could cause the history count + to be decremented by one (and even become negative) has been fixed. +02-06-05 A bug in read in which share mode could be enabled has been fixed. +02-05-28 A bug which could occur when the last command of a script was + a case statement and the action selected ended in ;& instead of ;; + has been fixed. +02-05-23 A bug with unary + introduced in ksh93k has been fixed. +02-05-07 A bug in substitutions of the form ${var/pattern/string} in which + a backslash was inserted in the replacement string when it contained + a special pattern character has been fixed. +02-05-01 A bug in the emacs edit mode which occurred in versions compiled + for multibyte character sets which occurred when a repeated search + was requested after a long line had been returned for the previous + search has been fixed. +02-04-02 +vi and emacs edit modes were modified so that tab completion is + disabled when invoked from the read built-in. + +02-03-26 --- Release ksh93m+ --- +02-03-26 A bug in which \ was not handled correctly when used in file + expansion has been fixed. +02-02-18 A bug in which lines beginning with a # were deleted from here + documents when the here-document delimiter was followed by + a comment has been fixed. +02-12-06 An optimization bug in which ${!x[@]) was treated as invariant in + a for loop has been fixed. +02-02-06 A bug in which the ERR trap is not cleared for a script invoked + by name from within a function has been fixed. +02-01-08 A bug in which a shell script executed from within a subshell + could cause this script to have an invalid pointer leading + to a memory fault has been fixed. +02-01-07 +Added here documents of the form <<< word (as per zsh) which + is equivalent to << delim\nword\ndelim. +02-01-07 A bug in which the first word of a compound assignment, + x=(word ...), was treated as a reserved word has been fixed. +02-01-07 A bug in the handling of \ when noglob was enabled and a + substitution of the form ${word op pattern} occurred in the + same word has been fixed. +02-01-07 +A compilation option, CMDLIB_BLTIN in the file OPTION, has + been added. When this options is set, all commands implemented + in libcmd become shell builtin commands by default. +02-01-07 A bug in which builtin foo, where foo is already a builtin + would result in the builtin foo getting removed has been fixed. +02-01-07 A bug which the shell executed a command found in the current + directory when PATH have no valid directories has been fixed. +01-11-28 The value of $? was not being set when called with exit. +01-11-28 If the last command was of the form (...) and a trap on EXIT or + ERR was set, and the command inside () modified the trap, then + the original trap wasn't executed. +01-11-26 +The value for 0 is now preceded by the base number when + the base was not 10. +01-11-26 +The default has compilation mode has been changes so that + viraw mode will always be on. + +01-10-31 --- Release ksh93m --- +01-10-31 A for loop optimizer bug for subshells contained withing for + loops has been fixed. +01-10-16 typeset without arguments no longer outputs variable names + that do not have any attributes that are set. +01-10-16 A bug introduced in ksh93l in which assignments specified with + the exec built-in were not being expanded properly has been + fixed. +01-10-11 An optimization bug in which ${!x) was treated as invariant in + a for loop has been fixed. +01-10-11 Unsigned integer variables in bases other than 10 are printed now + expand in that base with the base prefix. +01-10-10 A number of typos in the self generating man pages for shell + built-ins have been fixed. +01-10-04 The self generated man pages for hist and fc were not working + correctly and have been fixed. +01-10-03 Yet another optimizer bug in which shell patterns were + treated as invariants has been fixed. +01-09-27 Two bugs relating to multibyte history searches and to find + have been fixed. +01-09-27 A bug introduced in ksh93k in which the PATH searching was + not restored after running a command with an assignment list + has been fixed. +01-09-26 A bug in which a zero filled field was treated as octal when + converted to integer has been fixed. +01-09-26 Yet another bug in the optimization of for loops related to + recursive functions with break or continue statements has been fixed. +01-09-25 +The exponentiation operator ** was added to the shell arithmetic + evaluation. It has higher precedence than * and is left + associative. +01-09-25 The code was modified to use the ast multibyte macros + and functions for handing multibyte locales. +01-09-25 +The expansion ${parameter:offset:length} now handles negative + offsets which cause offsets to be measured from the end. +01-09-25 Some spelling errors in the documentation were corrected. +01-09-24 +The /dev/tcp/host/port and /dev/udp/host/port now allow + the ports to be specified by service name. +01-09-24 +The change staring with ksh93g in which the the appropriate + library path variable is prepended with a corresponding library + directory has been modified. With the new method, only the + library path defined in the file named .paths in the directory + where the executable is found will be modified. See the + man page for more details. +01-09-23 +The .fpath file (see ksh93h) is no longer looked for in each + directory on the path to locate function directories. The + file named .paths is used instead. +01-09-23 A bug in which IFS was not being restored after being changed in + a subshell has been fixed. +01-09-16 +With the vi and emacs edit modes, after a list of command + or functions is generated with = or M-= respectively, + any element from the list can be pasted on the command line + by preceding the = or M-= with a numeric parameter specifying + the position on the list. +01-09-16 A bug in ksh93l caused command completion not to find aliases + and functions. Command listing from the edit mode was presented + in reverse order. This has been fixed. +01-09-13 Another bug in the optimization of for loops related to subshells + when traps were set has been fixed. +01-09-07 A change in ksh93l caused brace expansion to stop working + and this has been fixed. +01-09-04 A bug introduced in ksh93k in which an arithmetic statement + within a function that used name references did not follow the + reference has been fixed. +01-09-04 A bug introduced in ksh93l in which export -p did not prefix + each export with the word export has been fixed. +01-08-29 A bug in multibyte input which occurred when a partial multibyte + character was received has been fixed. +01-08-29 A bug introduced in ksh93l which could cause a core dump + when an assignment list containing PATH is specified inside + command substitution has been fixed. +01-08-09 Another bug in the optimization of for loops in ksh93l caused + errors in recursive functions using local variables that + contained for loops has been fixed. +01-07-27 A bug in which IFS would be unset after a command substitution + inside a here document has been fixed. +01-07-26 To conform to the POSIX standard, if you invoked ksh name, + and name does not contain a /, it will first try to run + one in the current directory whether it is executable or not + before doing a path search for an executable script. Earlier + versions first checked for an executable script using the + PATH variable. +01-07-23 A bug in which unset -f invoked in a subshell could unset a + function defined in the parent has been fixed. +01-07-16 A bug in the optimization of for loops in ksh93l caused + name references to be treated as invariants has been fixed. +01-07-09 A bug in which a discipline function applied to a local variable + could cause a shell exception has been fixed. Discipline + functions can only be specified for global variables. + +01-06-18 --- Release ksh93l --- +01-06-18 A bug in assigning integers larger than can be represented as + long integers to floating point variables has been fixed. +01-06-18 A bug in the handling of unsigned integers (typeset -ui) has + been fixed. +01-06-04 The evaluation of the PS1 prompt no longer effects the value + of the $? variable. +01-06-01 A small memory leak from subshells has been fixed. +01-05-22 A bug in which attributes for variables that did not have + values would be lost after a subshell has been fixed. +01-05-22 +The %R format has been added to convert a shell pattern into + an extended regular expression. +01-05-22 +The escape sequences \e, \cX, \C[.collating-element.], and + \x{hex} have been added to ASCII-C strings and to printf format + strings. +01-05-20 +Patterns of the form {n}(pattern) and {m,n}(pattern) are now + recognized. The first form matches exactly n of pattern whereas, + the second form matches from m to n instances of pattern. +01-05-20 +The shell allows *-(pattern), +-(pattern), ?-(pattern), + {m,n}-(pattern}, and @-(pattern) to cause the minimal + match of pattern to be selected whenever possible rather + than the maximal (greedy) match. +01-05-20 +The character class [:word:] has been added to patterns. + The word class is the union of [:alnum:] and the character _. +01-05-20 +Inside (...) pattern groups, the \ character is now treated + specially even when in an enclosing character class. The + sequences, \w, \d, \s are equivalent to the character classes + word, digit, and space respectively. The sequences \W, \D, + and \S are their complement sets. +01-05-20 +The shell now recognizes pattern groups of the form + ~(options:pattern) where options or :pattern can be omitted. + Options use the letters + and - to enable and disable options + respectively. The option letters g (greedy), i (ignore case) + are used to cause maximal matching and to cause case + insensitive matching respectively. If :pattern is also + specified, these options are only in effect while this + pattern is being processed. Otherwise, these options remain + in effect until the end of the pattern group that they are contained + in or until another ~(...) is encountered. These pattern groups + are not counted with respect to group numbering. +01-05-14 When edit completion, expansion, or listing occurs in the + middle of a quoted string, the leading quote is ignored when + performing the completion, expansion, or listing. +01-05-14 A small memory leak from subshells has been fixed. +01-05-10 A bug in which open files were not restored after a subshell + that had used exec to replace a file has been fixed. +01-05-10 +Redirection to a null file name now generates an error message. +01-05-09 The shell now rejects some invalid parameter substitutions that + were previously processed in undefined ways. +01-05-09 A bug in which the output of select was not flushed before the + read when input did not come from the terminal has been fixed. +01-05-08 A bug in which job ids would not be freed for interactive shells + when subshells ran built-ins in the background has been fixed. +01-05-08 +The FPATH variable now requires an explicit . to cause the + current directory to be treated as a function directory. +01-05-08 A bug in read -n when echo mode was disabled has been fixed. +01-05-07 A bug in which function definitions could be listed as part + of the history has been fixed. +01-04-30 +This release uses a new and often much faster pattern matcher than + earlier releases. +01-04-30 +An optimizer now eliminates invariant parameter expansions from + for while and until loops. +01-04-30 +The variable .sh.match is set after each pattern match (# % or /) + in a variable substitution. The variable .sh.match is an + indexed array with element 0 being the complete match. + The array is only valid until the next subsequent pattern + match or until the value of the variable changes which ever + comes first. +01-04-30 +A self generating man page has been added to shcomp. Also, + shcomp now stops compiling when it finds an exit or exec + command and copies the remainder so that it can be used + for standard input. +01-04-30 +The shcomp command was modified so that it can work in an + EBCIDIC environment and that binary scripts are portable + across environments. +01-04-30 A bug in the handling of a trailing : in PATH has been fixed. +01-04-30 A bug in which the builtin version of a command would get invoked + even though the full pathname for the command was specified + has been fixed. +01-04-30 A bug in which read would loose the last character when + reading the last line of a file that did not contain a new-line + character has been fixed. +01-04-23 A bug on some systems in which in vi mode the end of file + character and end of line character could be swapped has + been fixed. +01-04-23 A bug on some systems in which invoking a shell script that + did not have execute permission could set the exit value to + 127 rather than 126 has been fixed. +01-04-20 A bug in which read -n from a pipe would block if fewer than + n characters was received has been fixed. +01-04-09 A bug in which invalid patterns, for example, ) by itself, + was not treated as a string has been fixed so that if i=')', + then [[ $i == $i ]] is true. +01-04-09 +The shell arithmetic now interprets C character constants. +01-04-09 A bug in which a non-zero return from a function defined + with the function reserved word did not trigger the ERR + trap or exit with set -e has been fixed. +01-04-02 A bug on some systems, in which characters above 127 were + not displayed correctly in vi or emacs edit mode has been fixed. +01-04-02 A bug on some systems, introduced in the 'k' point release, in + which the erase character in viraw mode was moving the cursor + to the left without erasing the character has been fixed. +01-04-02 On some systems the wcwith() function was returning a wrong + value for characters and caused characters to be displayed + incorrectly from the shell edit modes. A work around for + this problem has been added. +01-03-26 A bug in which valid scripts could produce syntax errors + when run with locales that considered characters such as "'" + to be space characters has been fixed. +01-03-20 A bug in which an syntax error in an arithmetic expression + entered interactively could cause the shell to go into + an infinite loop outputting the error message has been fixed. +01-03-10 +ksh93 accepts -l as a synonym for -L in test on systems for + which /bin/test -l tests for symbolic links. +01-03-10 A bug in parsing scripts in which { and } are used in place of + in and esac in case statements embedded in compound commands + has been fixed. Use of { and } for in and esac is obsolete. +01-03-06 A bug in which an argument of the form foo=bar was not + being passed correctly to a traced function whose name + was foo has been fixed. +01-03-02 Using $(trap -p name) did not print the name of the current + trap setting for trap name. +01-02-26 Exported floating point variables gave incorrect results + when passing them to ksh88. This has been fixed. +01-02-25 A race condition in which a coprocess which completed too quickly + would not allow subsequent coprocesses to start has been fixed. +01-02-25 The 'g' format specifier is now handled by printf. It had + inadvertently been omitted. +01-02-20 The + was not being displayed during an execution trace + with the += assignment operator. +01-02-19 The error message which occurs when the interpreter name + defined on the #! line does not exist is more informative. +01-02-19 A bug in which $0 would not be set correctly when a + script with #! was invoked by full pathname from the + directory of the script has been fixed. +01-02-19 A shell script did not always pick up tty mode changes + made by external commands such as stty which could + effect the behavior of read. +01-02-19 The -u, -g, and -k unary tests did not give the correct + results when used with negation and this has been fixed. + +01-02-05 --- Release ksh93k+ --- +01-02-05 The sequence \ inside $'...' was not incrementing + the line count and this has been fixed. +01-02-05 +Modified expansion of "${@-}" so that if no arguments are set + it results in null string rather than nothing. +01-02-02 memory leak problem with local variables in functions fixed. +01-01-25 +allow arithmetic expressions with float%int and treat them + as ((int)float)%int rather than as an error. +01-01-19 read -n1 was not working and has been fixed. +01-01-17 +ksh now handles the case in which a here document in command + substitution $() is terminated by the trailing ). Previously, + a new-line was needed at the end of the delimiter word. +01-01-02 A bug in which a KEYBD trap would cause a multi-line token + to be processed incorrectly has been fixed. +00-12-10 +Arithmetic integer constants can now have L and U suffices. +00-12-10 A bug in the processing of arithmetic expressions with compound + variables when the -n option is on has been fixed. +00-12-08 A bug in M-f and M-b from emacs mode has been fixed. This + bug only occurs when ksh93 is compiled without MULTIBYTE enabled. +00-11-29 A bug in which jobs -p would yield 0 for background + jobs run in a script has been fixed. +00-11-21 A bug in integer arrays in which the number of elements is + incorrect when the ++ operator is applied to a non-existing + element has been fixed. For example, integer x; ((x[3]++)). +00-11-20 A timing bug in which the shell could reset the terminal + group to the wrong value in the case that the a new process + changes the terminal group during startup has been fixed. + +00-10-27 --- Release ksh93k --- +00-10-27 Using tab for completion now works only when applied + after a non-blank character at the end of the current line. + In other case a tab is inserted. +00-10-27 A bug in the emacs edit mode for ^X^E has been fixed. + The ^X^E sequence is supposed to invoke the full editor + on the current command. +00-10-18 A bug in which expansions of the form ${var//pattern/string} + did not work correctly when pattern was '/' or "/" has + been fixed. +00-10-18 +The output format for indexed arrays in compound variables + has been modified so that it can be used as input. +00-10-18 Assignments with name references (typeset -n) will now + implicitly unreference an existing name reference. +00-10-17 A bug the += append operator when a single array element + is appended to a variable that is not an array has been fixed. +00-10-16 A bug in which the SIGCONT signal was being sent to + each process will kill -0 or kill -n 0 has been fixed. +00-10-12 +The arithmetic evaluation portion has been rewritten to + perform a number of optimizations. +00-10-10 A bug in which name prefix matching ${!name.*} was not + checking name to see if it was a name reference has been fixed. +00-09-26 A bug in the multibyte version in which the width of for + non-printing characters was not correct has been fixed. +00-09-12 +Made changes to get multibyte editing work on UWIN for windows +00-09-12 A bug in which multibyte characters would be displayed incorrectly + has been fixed. +00-08-08 Removed build dependency on iswprint() and iswalph(). +00-07-20 In some cases the read builtin would read more than a single + line from a pipe on standard input and therefore leave the seek + position in the wrong location. +00-07-05 +If the directory / is on the path, a / will not be inserted + between the directory and the file name during path searching + to avoid searching // for systems that treat this specially. +00-06-26 A bug in which on rare occasions wait could return before all + jobs have completed has been fixed. +00-06-21 A bug in which backspace did not work correctly during the + R replace directive in vi-mode has been fixed. +00-06-12 +Added variable name completion/expansion/listing to the set of + completions. Variable name completions begin with $ or "$ followed + by a letter. +00-05-09 --- Release ksh93j --- +00-05-09 Modified command substitution to avoid using /tmp files when + run on read-only file systems. +00-04-17 +Modified printf to handle '%..Xc' and '%..Xs' options where X + is not an alpha character. Previous versions core dumped with this. +00-04-10 +Changes to multibyte editing code were made to use standard + ISO C functions rather than methods devised before the standard. +00-04-09 Add %H options to printf to output strings with <"'&\t> properly + converted for use in HTML and XML documents. +00-04-07 +Modified getopts builtin to handle \f...\f in usage string + by invoking specified function. +00-04-04 Added self generating man pages for bg, fc, fg, disown, jobs, + hist, let, ., and ulimit. +00-03-30 +The append operator += has been added and can be used + for all assignments, strings, arrays, and compound variables. +00-03-30 +Code was modified in several places to support automatic + generation of C locale dictionaries. +00-03-28 A bug in which the set and trap commands invoked with --name + type arguments would terminate the invoking script has + been fixed. +00-03-27 A bug in which the library path variable was not updated + correctly on some systems as described in the 'g' point + release has been fixed. +00-03-07 printf now returns a non-zero exit status when one of + its arguments cannot be converted to the given type. +00-03-05 The return value and error message for a command that + was found on the path but was not executable was set + incorrectly. +00-03-05 A prototype for ioctl() was removed from the vi edit mode. + +00-01-28 --- Release ksh93i --- +00-01-28 +Most of the built-in commands and ksh itself are now + self documenting. Running command --man will produce + screen output. Running command --html produces the + man page in html format. +00-01-28 +The getopts builtin can process command description + strings to produce man pages. +00-01-28 A bug in which a script could terminate when getopts + encountered an error when invoked inside a function + has been fixed. +00-01-28 When a symbolic link was specified as the name of + the script to invoke by name, the value of $0 was + set to the real file name rather than the link name + in some cases and this has been fixed. +00-01-28 A bug in which the precision given as an argument + to printf was not working has been fixed. + +99-03-31 --- Release ksh93h --- +99-03-31 +The PATH search algorithm has been modified to look + for a file named .fpath in each bin directory and if + found, to search for functions in this directory if + it cannot find the command in that directory. +99-03-31 +When performing pathname expansion, the shell checks + to see whether each directory it reads is case sensitive + or not, and performs the matching accordingly. +99-03-31 +The %T format for printing formatted date/time. +99-03-31 +The emacs and vi modes now handle arrow keys when + they use standard ANSI escape sequences. +99-03-31 +The TAB key can be used for completion in emacs and viraw mode. +99-03-31 A bug in setting .sh.editchar during the KEYBD trap + for the MULTIBYTE option was fixed in release ksh93h. +99-03-31 A bug in shcomp for compilation of unary operators with [[...]] + has been fixed. +99-03-31 A bug in which the value of $? was changed when executing + a keyboard trap has been fixed. +99-03-31 The handling of SIGCHLD has been changed so that the + trap is not triggered while executing trap commands + to avoid recursive trap calls. +99-03-31 A bug in which a local variable in a function declared readonly + would generated an error when the function went out of + scope has been fixed. +99-03-31 A bug in which \ entered from the keyboard + with the KEYBD trap enabled has been fixed. +99-03-31 The error message for a misplaced ((, for example print ((3), + was often garbled and has been fixed. +99-03-31 A bug in the KEYBD trap in which escape sequences of the form + [#~ were not being handled as a unit has been fixed. +99-03-31 A bug in which ksh would consider expressions like [[ (a) ]] + as syntax errors has been fixed. +99-03-31 A function defined as foo() without a function body + was not reported as a syntax error. +99-03-31 A bug in which ksh could run out of file descriptors when + a stream was repeatedly opened with exec and read from + has been fixed. + +98-04-30 --- Release ksh93g --- +98-04-30 +The pipefail option has been added. With pipefail + enabled, a pipeline will not complete until all + commands are complete, and the return value will + be that of the last command to fail, or zero if + all complete successfully. +98-04-30 +The name-value pair library uses the cdt library rather + than the hash library. This change should be transparent + to applications. +98-04-30 +On the U/WIN version for Window 95 and Windows NT, + when a directory beginning with a letter followed by + a colon is given to cd, it is assumed to be an absolute + directory +98-04-30 +When an executable is found on a given path, + the appropriate library path variable is prepended + with a corresponding library directory. +98-04-30 A bug in which a name reference could be created to + itself and later cause the shell to get into an infinite + loop has been fixed. +98-04-30 A bug in shcomp relating to compound variables was fixed. +98-04-30 A bug introduced in ksh93e in which leading 0's in -Z + fields caused the value to be treated as octal for arithmetic + evaluation has been fixed. +98-04-30 A bug when a name reference with a shorter name than + the variable it references was the subject of a compound + assignment has been fixed. +98-04-30 A bug which in which assignment to array variables in + a subshell could effect the parent shell has been + fixed. +98-04-30 read name?prompt was putting a 0 byte at the end of the + prompt on standard error. +98-04-30 A bug in [[ string1 > string2 ]] when ksh was run with -x + has been fixed. +98-04-30 A bug in which the escape character was not processed + correctly inside {...} when brace expansion is enabled + has been fixed, for example {\$foo}. +98-04-30 A bug in line continuation in here-documents has been + fixed. +98-04-30 The default base when not specified with typeset -i is + 10 in accordance with the documentation. Previously, + the value was determined by the first assignment. +98-04-30 A parsing bug in which a # preceded alphanumeric + characters inside a command substitution caused + a syntax error to be reported has been fixed. +98-04-30 A bug in which a decimal constant represented as 10#ddd + where ddd was more than five digits generated a syntax + error has been fixed. +98-04-30 A bug in here document expansion in which ${...} expansions + were split across buffer boundaries has been fixed. +98-04-30 +The sh_fun() function now takes third argument which + is an argument list for the invoked discipline function + or built-in. +98-04-30 +A callback function can be installed which will give + notification of file duplications and file closes. +98-04-30 When ksh is compiled on systems that do not use fork() + current option settings where not propagated to sub-shells. + +97-06-30 --- Release ksh93f --- +97-06-30 +Hostnames in addition to host addresses can be given in + /dev/tcp/host/port virtual file names. +97-06-30 File name completion and expansion now quotes special + characters in file names from both emacs and vi edit modes. +97-06-30 An empty for list behave like a for list with null expansions. + It produces a warning message with sh -n. +97-06-30 +The code has been modified to work with EBCDIC as well as ASCII. +97-06-30 A bug which would cause the secondary prompt to be + displayed when a user entered a literal carriage + return has been fixed. +97-06-30 A bug which caused ksh read -s name to core dump was + fixed. +97-06-30 A bug with the expansion of \} and \] inside double + quoted strings that also contained variable expansions + has been fixed +97-06-30 Changes in the ksh93e point release caused autoload + functions invoked from within command substitution + to fail. This has been fixed. +97-06-30 A bug in the processing of here-documents that could + prevent variable substitution to occur after $(...) command + substitution for long here documents has been fixed. +97-06-30 A bug caused by a race condition that could cause SIGTERM + to be ignored by a child process has been fixed. +97-06-30 A bug which prevented the startup of a coprocess immediately + after killing a running coprocess has been fixed. +97-06-30 ulimit foobar, where foobar is not an arithmetic + expression, now gives an error message as it did with ksh88 + instead of setting the file size limit to 0. +97-06-30 A bug which could cause an interactive shell to terminate when + the last process of a pipeline was a POSIX function was fixed. +97-06-30 A bug which could cause command substitution of a shell script + to core dump has been fixed. +97-06-30 A security hole was fixed in suid_exec. +97-06-30 Arithmetic functions such as pow() that take more than + one argument, did not work if arguments other than the + first contained parenthesized sub-expression. +97-06-30 The error message from a script containing an incomplete + arithmetic expression has been corrected. +97-06-30 A bug which caused a core dump on some machines when + the value of a name reference contained a positional + parameter and the name reference was not defined inside + a function has been fixed. +97-06-30 Arithmetic expressions now correctly handle hexadecimal + constants. +97-06-30 A bug in which integer variables could be expanded + with a leading 10# when declared with typeset -i + multiple times has been corrected. +97-06-30 A bug in which IFS wasn't correctly restored when + set within command substitution has been fixed. +97-06-30 The _ character is now considered as part of a word + with the M-f and M-b emacs directives as it was in ksh88. +97-06-30 A bug in brace pattern expansions that caused expressions + such as {foo\,bar,bam} to expand incorrectly have been fixed. + + +96-07-31 --- Release ksh93e --- +96-07-31 +The math functions, atan2, hypot, fmod, and pow were added. +96-07-31 +When a shared library is loaded, if the function lib_init() + is defined in the library, it is invoked the first time that + the library is loaded with builtin -f library. +96-07-31 The k-shell information abstraction database option, KIA, + has been revamped. +96-07-31 Empty command substitutions of the form $() now work. + whence -v foo now gives the correct result after calling + builtin -d foo. +96-07-31 A bug in right to left arithmetic assignment for which + the arithmetic expression (( y = x = 1.5 )) did not + yield 1 for y when x was declared typeset -i was fixed. +96-07-31 printf has been fixed to handle format containing \0 + and/or \0145 correctly. In addition, characters following + %b in the format string are no longer displayed when + the operand contains \c. +96-07-31 A bug in printf that could cause the %E format to + produce unnormalized results has been fixed. +96-07-31 A bug which causes some arithmetic expressions to be + incorrectly evaluated as integer expressions rather + that floating point has been fixed. +96-07-31 Functions defined inside a subshell no longer remain + defined when the subshell completes. +96-07-31 The error message from sh -c ';echo foo' has been + corrected. +96-07-31 The format for umask -S has been changed to agree + with the specification in the POSIX standard. +96-07-31 A bug that caused side effects in subscript evaluation + when tracing was enabled for subscripts using ++ or -- + has been fixed. +96-07-31 To conform to the Posix standard getopts has been changed + so that the option char is set to ? when it returns with + a non-zero exit status. +96-07-31 The handling of \} inside ${name...} has been fixed so + that the \ quotes the }. +96-07-31 A bug that caused the read builtin to resume execution + after processing a trap has been fixed. +96-07-31 [[ -s file ]] has been fixed so that if file is open + by ksh, it is flushed first. +96-07-31 In some cases attributes and sizes for non exported + variables weren't being reset before running a script. +96-07-31 The value of TMOUT was affected by changes make to + it in a subshell. +96-07-31 The jobs command did not reflect changes make by + sending the CONT signal to a command. +96-07-31 The error message for ksh -o unknown was incorrect. +96-07-31 Functions invoked as name=value name, did not use + values from the calling scope when evaluating value. +96-07-31 A bug in which the shell would reexecute previously + executed code when a shell script or coprocess was + run in the background has been fixed. +96-07-31 A bug in which an empty here-document would leave + a file descriptor open has been fixed. +96-07-31 A bug in which $(set -A array ...) would leave a + side effect has been fixed. +96-07-31 A discipline function for a global variable defined + within a function defined with the function keyword, + incorrectly created a local variable of the same name + and applied the discipline to it. + +95-08-28 --- Release ksh93d --- +95-08-28 The \ character was not handled correctly in replacement + patterns with ${x/pattern/replace}. +95-08-28 A bug with read in which the line did not end with + a new-line has been fixed. +95-08-28 A bug in file name generation which sometimes + appended a . for filenames that ended in / has + been fixed. +95-08-28 +If a process is waited for after a status has + been returned by a previous wait, wait now + returns 127. +95-08-28 A bug with hist (fc) -e which prevented a command + to re-executed after it had been edited has been fixed. +95-08-28 A bug which prevented quoting from removing the meaning + of unary test operators has been fixed. +95-08-28 A bug with typeahead and KEYBOARD traps with the + MULTIBYTE option set has been fixed. +95-08-28 +Builtin functions can take a third argument which is + a void*. +95-08-28 The nv_scan() function can restrict the scope of a walk + to the top scope. + +95-04-31 --- Release ksh93c --- +95-04-31 The expansion of "$@" was incorrect when $1 was the null + string. +95-04-31 A bug which could incorrectly report a syntax error in + a backquoted expression when a $ was preceded by \\ + has been fixed. +95-04-31 A bug which prevented the shell from exiting after + reporting an error when failing to open a script + has been fixed. +95-04-31 A bug that could lead to memory corruption when a + large here document that required parameter or command + substitution was expanded has been fixed. +95-04-31 A bug that could cause a core dump on some systems + after ksh detected an error when reading a function + has been fixed. +95-04-31 A bug which could cause a coprocess to hang when + reading from a process that has terminated has been fixed. +95-04-31 A bug which caused a script to terminate when set -e + was on and the first command of and && or || list + failed has been fixed. +95-04-31 A bug with here documents inside $(...) when the delimiter + word is an identifier has been fixed. +95-04-31 A bug which caused $0 to display the wrong value when + a script was invoked as an argument to the . command + and the eval command has been fixed. +95-04-31 A bug that could cause the built-in sleep to hang + has been fixed. +95-04-31 A bug introduces in 12/28/93b which caused the backslash + to be removed when it was followed by digit inside double + quotes in some instances has been fixed. +95-04-31 A bug which could cause a core dump if ksh was invoked with + standard input closed has been fixed. +95-04-31 A bug which could cause a core dump if typeset -A was + specified for an existing variable has been fixed. +95-04-31 Variables that were unset but had attributes such as readonly + and export were not listed with readonly, export and typeset. +95-04-31 Several problems with signals have been fixed. +95-04-31 A bug which prevented ulimit -t from working has been fixed. + Also, a bug in which failed ulimits could cause a core dump + has also been fixed. +95-04-31 A bug in expansion of the form ${name/#pattern/string} and + ${name/%pattern/string} has been fixed. +95-04-31 A bug which caused read -r on a line that contained only + blanks to get a non-null value has been fixed. +95-04-31 A bug introduced in the 'a' point release in which + ${x='\\'} expanded to \ when x was unset has been fixed. +95-04-31 A bug which prevented a trap on EXIT from being executed + when the last command in a script was a function invocation + has been fixed. +95-04-31 A bug which caused an interactive shell ignore input when + standard error was redirected to a file with exec, + and then restored with exec 2>&1 has been fixed. +95-04-31 An interactive shell turns on monitor mode even when + standard error has been redirected to a file. +95-04-31 A bug which could cause standard input to be incorrectly + positioned for the last command of a script has been fixed. +95-04-31 A bug in the edit modes which allowed walking back in + the history file for more than HISTSIZE commands has + been fixed. +95-04-31 A bug which could cause a core dump if variable TMPDIR was + changed between two command substitutions has been fixed. +95-04-31. A bug which prevented a trap on EXIT from being cleared + has been fixed. +95-04-31 A bug fixed for the v directive in vi MULTIBYTE has been + fixed. +95-04-31 Code to for IFS handling of multibyte characters has + been added. +95-04-31 The displaying of multibyte strings in export, readonly, + typeset, and execution traces has been fixed. +95-04-31 Variables inside functions are now statically scoped. + The previous behavior was never documented. +95-04-31 Variables inside functions are now statically scoped. + The previous behavior was never documented. +95-04-31 A few changes have been made to the name-value library + that affect built-ins that use disciplines. The + changes allow disciplines to be shared by variables + and should make it possible to add new disciplines + without recompilation. +95-04-31 +The name-value library interface has undergone significant + change for this revision. See the new nval.3 man page. + +94-12-31 --- Release ksh93b --- +94-12-31 +Variables inside functions are now statically scoped. + The previous behavior was never documented. +94-12-31 +If IFS contains two consecutive identical characters belonging + to the [:space:] class, then this character is treated as + a non-space delimiter so that each instance will delimit + a field. For example, IFS=$'\t\t' will cause two consecutive + tabs to delimit a null field. +94-12-31 +The getopts command has a -a name option that specifies a + name that will be used for usage messages. +94-12-31 A bug which caused unset RANDOM to dump core has been + fixed. +94-12-31 A bug which prevented return for terminating a profile + or ENV file has been fixed. +94-12-31 A bug which prevented standard input from being + directed to /dev/null for background jobs when + monitor mode was turned off has been fixed. +94-12-31 Statements of the form typeset -options var[expr]=value + did not perform substitutions on expr as expected. +94-12-31 A bug which prevented the shell from sending a HUP + signal to some background jobs that were not disowned + has been fixed. +94-12-31 A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked by exec + has been fixed. +94-12-31 A bug which could cause a core dump when a discipline + function was unset within a discipline was fixed. +94-12-31 The typeset builtin now accepts a first argument of + + or - for compatibility with ksh88. +94-12-31 For compatibility with ksh88, the results of expansions + of command arguments will treat the extended character + match characters ()|& as ordinary characters. +94-12-31 A bug which caused read to fail on a file that was + open for read/write with <> when the first operation + was print or printf has been fixed. +94-12-31 When a job is suspended, it is put on the top of + the job list as required by the POSIX standard. +94-12-31 The value of OPTARG when an option that required + an argument but didn't have one was incorrect in the + case the the option string began with a :. +94-12-31 A bug which caused the terminal to get into a bad + state with some KEYBD traps in vi-mode has been fixed. +94-12-31 A bug which caused an invalid trap to cause a script + to terminate, rather than just return an error, has + been fixed. +94-12-31 Backreferencing sub-expressions in patterns and replacement + strings now works. +94-12-31 A bug in chmod which caused the -R option to fail has + been fixed. +94-12-31 +More signal names have been added for Solaris + +94-06-30 --- Release ksh93a --- +94-06-30 An expansion bug which causes portions of a word after + a $((...)) expansion that contains a nested $var expansion + to be lost has been fixed. +94-06-30 A bug that caused a core dump when a script that did not + have PWD set and did a cd inside command substitution + has been fixed. +94-06-30 A bug which caused a core dump on some machines when + the LANG variable was assigned to has been fixed. +94-06-30 A bug which incorrectly handled set disciplines that + performed arithmetic evaluation when the discipline + was called from the arithmetic evaluator has been fixed. +94-06-30 A bug caused by an EXIT trap inside a function that + was executed in a subshell was fixed. +94-06-30 If foo is a function, and not a program, then command foo + now reports that foo isn't found rather than invoking foo. +94-06-30 The previous version incorrectly listed -A as an + invocation option. The -A option is only for set. +94-06-30 A bug was fixed which caused ksh to loop when execution trace + was enabled and the PS4 prompt required command substitution. +94-06-30 A bug which could cause the job control switch character + to be disabled when a script that enabled monitor mode + terminated was fixed. +94-06-30 A bug in the macro expansion global replacement operator //, + when the pattern began with a [ or +( has been fixed. +94-06-30 A bug which prevented ~ expansion from occurring when + it was terminated with a colon inside an assignment + has been fixed. +94-06-30 A bug in the dot command which prevented autoload functions + from working has been fixed. +94-06-30 A bug which caused a variable to be unset if the + its value were expanded inside a set discipline has + been fixed. +94-06-30 Whence -a now longer reports that a defined function + is undefined. +94-06-30 A bug on some systems in which $0 would be incorrect + in scripts invoked by name has been fixed. +94-06-30 Here documents with an empty body now work. +94-06-30 A bug which disabled argument passing and resetting + of options for a script invoked by name inside a + function has been fixed. +94-06-30 A bug in which an EXIT trap set the caller of a function + would be executed if a command called inside a function + was not found has been fixed. +94-06-30 A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked has + been fixed. +94-06-30 A bug which caused 2<&1- when applied to a shell built-in + to leave standard input closed has been fixed. +94-06-30 A bug which caused the shell to incorrectly parse + $() command substitutions with nested case statements + has been fixed. + diff --git a/src/cmd/ksh93/RELEASE88 b/src/cmd/ksh93/RELEASE88 new file mode 100644 index 0000000..2466e39 --- /dev/null +++ b/src/cmd/ksh93/RELEASE88 @@ -0,0 +1,422 @@ +This is a list of changes that have been made since the 11/16/88 version +of ksh. + +1. New features in 12/28/93 + a. Associative arrays. The new version of ksh supports both + associate arrays and the older indexed arrays with the same + array syntax. A new -A option of typeset is used to declare + an array to be associative. As with indexed arrays, $name is + equivalent to ${name[0]}. The prefix operator ! was added + to the parameter expansion syntax to expand to the list of + indices. For example, ${!name[@]} expands to the list of array + indices for variable name. + + b. Several additions have been made to shell arithmetic: + 1. The shell now performs floating point arithmetic. The + typeset options -F and -E have been added for floating + point and scientific notation respectively. + 2. The prefix and postfix ++ and -- operators. + 3. The comma and ?: operators. + 4. The math library functions. + 5. An arithmetic for statement of the form + for ((expr1; expr2; expr3)) + do ... + done + 6. Integer arithmetic extended up to base 64. + + c. Some additions to the macro expansion syntax have been made + to specify substrings and sub-arrays: + 1. ${name:expr} expands to the substring of ${name} starting at + the character position defined by arithmetic expression expr. + 2. ${name:expr1:expr2} expands to the substring of ${name} starting + at expr1 and consisting of at most expr2 characters. + 3. ${name[@]:expr} expands to the values of ${name[@]} starting at + the element defined by arithmetic expression expr. + 4. ${name[@]:expr1:expr2} expands to at most expr2 values of + ${name} starting at expr1. + 5. ${@:expr} expands the positional parameters starting at expr. + 6. ${@:expr1:expr2} expands to at most expr2 positional parameters + starting at expr1. + 7. ${!name} expands to the name of the variable named by name. + It will expand to name unless name is reference variable. + 8. ${!name[sub]} expands to the name of the subscript of the + given variable. If sub is @ or * the list of subscripts + is generated. + 9. ${!prefix*} and ${!prefix@} expand to the list of variable + names beginning with prefix. + 10. The substring operators, # and % can be now be applied + with aggregates (@ or *) and are applied to each. + 11. ${name/pattern/string} expands to the value of name with + the first occurrence of pattern replaced by string. + With aggregates (@ or *) this operation is applied to each. + 12. ${name/#pattern/string} Same as above but the pattern + to be replaced must match at the beginning. + 13. ${name/%pattern/string} Same as above but the pattern + to be replaced must match at the end. + 14. ${name//pattern/string} expands to the value of name with + the each occurrence of pattern replaced by string. + With aggregates (@ or *) this operation is applied to each. + + d. The name space for variables has been extended. The character '.' + can be used at the beginning of a name, and to separate identifiers + within a name. However, to create a name of the form, foo.bar, + the variable foo must exist. The namespace starting with .sh + is reserved for shell implementation variables. Exported + variable cannot contain a '.'. + + e. Compound assignments. The assignment syntax, varname=value, + has been extended to allow assignments of the form + varname=(assignment_list). As elsewhere in the shell + spaces or tabs are optional around the parentheses, and + no space is permitted between the varname and the =. The + assignment_list can be one of the following: + 1. A list of words. In this case each word is expanded as + in a for list and the resulting items become elements + of the indexed array varname. + 2. A list of subscript assignments in the form + [subscript]=value. In this, these elements become + elements of the associative array varname. + 3. A list of assignments; simple or compound. In this + case, each assignment is made to varname.name, where + name is the name of the enclosed assignment. + 4. Assignments in the form of readonly or typeset + statements. In this case each assignment is made as + in 3 above, and the attributes are given to the + corresponding variable. + In case 3 and 4 above, the value of "$varname" after + the above assignment is (assignment_list), where the + assignment_list produced would reproduce all of the + variables under varname.*. + + f. Function names of the form variable.action (called discipline + functions) can be defined where variable is any valid variable + name and action is get, set, or unset. The function variable.get + is invoked each time the variable is referenced. The set + discipline is invoked each time the variable is assigned to. + The unset discipline is invoked when a variable is unset. + The new variables .sh.name, .sh.subscript, and .sh.value are + defined inside the function body. Other shell extensions + may have their own set of discipline functions. + + g. The compound command !, which negates the return value of the + following pipeline, has been added. + + h. On systems that support dynamic loading with dlopen(), it is + now possible to add built-in commands at runtime with the + a builtin command named builtin. + + i. The following builtins have been added: + 1. command name [ ... ] + 2. sleep [decimal-seconds] + 3. builtin [-ds] [-f file] [name...] + 4. getconf name [pathname] + 5. disown [job...] + + j. An addition format for literal strings, $'....' can + be used where ever literal strings are valid. The string + inside the single quotes will be converted using the ANSI-C + escape conventions. Additionally, the escape sequence \E + expands to the escape character (default \033) whenever ANSI-C + escape sequences are recognized. + + k. A typeset -n option has been added which causes the value of a + variable to be treated as a reference to another variable so that + variables can be indirectly named. For example, if $1 contains + the name of a variable, then typeset -n foo=$1 causes the variable + foo to be synonymous with the variable whose name is $1. A builtin + alias, nameref='typeset -n' has been added to aid mnemonics. + Reference names cannot contain a '.'. Whenever that portion of + a variable up to the first '.' matches a reference name, the + reference value is substituted. For example, with nameref foo=.top, + then ${foo.bar} is equivalent to ${.top.bar}. When used as the + index of a for or select loop, each assignment causes a + new name reference to occur. + + l. The KEYBD trap has been added which is triggered when a key + or escape sequence is typed while reading from the keyboard + in an edit mode. This, combined with some new variables + makes it possible to program your key bindings in ksh. + + m. New variables have been added: + 1. FIGNORE defines a set of file names to be ignored in each + directory when performing pathname expansion, replacing + the rule that requires that a leading . be matched explicitly. + 2. Variable sh.edchar contains the value of the keyboard character + that has been entered when processing a KEYBD trap. If the value + is changed as part of the trap action, then the new value replaces + the key or keys that caused the trap. + 3. Variable sh.edcol is set to the character position of the cursor + within the input buffer during a KEYBD trap. + 4. Variable sh.edmode is set to the escape character when in vi + insert mode. + 5. Variable sh.edtext is set to the contents of the input buffer + during a KEYBD trap. + 6. HISTEDIT is checked before FCEDIT. FCEDIT is obsolete. + 7. HISTCMD is the number of the current command in the history + file. + 8. Variable .sh.version is set to the version string for + this shell. + 9. Variable .sh.name is set to the name of the variable + that that was referenced or assigned to when executing a get + or set discipline function. + 10. Variable .sh.subscript is set to the subscript for the variable + that was referenced or assign to when executing a get or + set discipline function. + 11. Variable .sh.value is set to the new value for the variable + that was assigned to when executing the set discipline function. + + n. New invocation and set -o options have been added: + 1. set -o notify (or set -b) causes background completion messages + to be displayed as soon as the job completes. + 2. There is a compile time option named KIA which enables + creation of a relational database for commands, variables + and functions defined and referenced by a script. The + option -I , causes the database to be generated + in . The database format can be queried via + the cql command. + o. ksh93 can read and evaluate pre-compiled scripts generated by + a separate program called shcomp. + p. More work on internationalization has been added: + 1. The decimal point character is processed per locale + 2. A $ can be placed in front of each string to indicate + that the string needs translation but is otherwise ignored. + This means that if a message catalog of all $"..." strings + is generated, then a program such as print $"hello world" + could display "bonjour monde" in the french locale. + q. Backreferences have been added to pattern matching. The sequence + \d, where d is a digit from 1-9, matches the same string as + the d-th previous parenthesis group. Backreferences + can be used within patterns, and within replacement strings + with any of the ${name/...} operators. + +2. Changes made in 12/28/93 + a. The output format of many commands has changed as follows: + 1. System error messages are displayed whenever a failure + is caused by a system call. + 2. The exit status has changed in many cases: + a. USAGE messages cause an exit status of 2. + b. Commands not found cause exit - 127. + c. Command found, but not executable - 126. + d. Terminated because of signal - 256+sig + 3. The output of values from built-ins that contain special + characters are quoted in a manner that then can be re-input. + 4. The trace output puts quotes around the output so that it + can be reused as input. + 5. The output for trap is in a format that can be reinput the + the shell to restore the traps. + 6. kill -l lists the signal names without numbers as + required by the POSIX standard. + + b. The following changes have been made to shell functions: + 1. The semantics of functions declared with name() has changed + to conform with the IEEE-POSIX 1003.2 standard. In particular, + these functions are executed in a dot script environment rather + than a separated function environment so that there are no + local variables and no scoping for traps. + 2. Functions declared as function name, preserve the old ksh + semantics can be also used as the first argument to the dot (.) + command to have them executed in a dot script environment. + + c. The command search rules have changed as follows: + 1. Special built-ins (those with a dagger in front of them) are + executed first. + 2. Functions are executed next. + 3. Other built-ins that do not require an executable version + (for example cd and read) come next. + 4. If the command name contains a slash, the pathname corresponding + to the command name is executed. + 5. If name corresponds to a previously encountered pathname + on the PATH variable, the corresponding command is executed. + 6. If the command name does not contain a slash, then the PATH + variable is used to find an executable by that name. If + the directory that the command is found is also contained in + the FPATH variable, then the command treated as a function. + If the shell has a built-in version of the command corresponding + to this command, then the built-in version of this command + is executed. Otherwise, the shell remembers that pathname + corresponding to this command name and executes this pathname. + 7. If the name is not found on PATH, then the directories in + FPATH are searched. If found, then the command is executed + as a function. + + d. Built-in commands options now conform to the IEEE-POSIX 1003.2 + conventions with some additions. In particular, + name -? + will now print a Usage line for name, except for true, false, + colon, login, newgrp, echo, [, and command. + + e. Tilde expansion is now performed as part of the word expansions. + The effect of this is that if word begins with ~ in ${name op word}, + it will be expanded unless escaped. + + f. Pathname expansion is no longer performed on redirection words + unless the shell is interactive. + + g. Changes to shell and options: + 1. The -n option has been enhanced to produce more warning and + portability messages. + 2. The -C option is equivalent to -o noclobber. Files are + created with O_EXCL when -C is on. + + h. The following changes have been made to [[...]]: + 1. A string by itself is equivalent to -n string. + 2. -e has been added as equivalent to -a. + 3. == has been added as equivalent =. + 4. -a and = are now considered obsolete. + 5. Arithmetic comparisons are now considered obsolete. + + i. kill has been changed as follows: + 1. Signal names can be upper case or lower case. + 2. Numerical arguments to kill -l cause the given signal names to + be displayed. + 3. String arguments to kill -l cause the given signal numbers to + be displayed. + 4. Synopsis changed for getopts conformance. + + j. print has a -f format option which is equivalent to + the IEEE POSIX printf. Both print -f format, and + printf have the following extensions from IEEE POSIX: + 1. Floating point formats are supported. + 2. Size and precision specifications can be *. + 3. The %d option can take an argument after precision to + specify the base that the number will be displayed. + 4. A %q format can be used to output a string quoted so + that it can be re-input to the shell. + 5. A %P format can be used to output the shell pattern which + corresponds to the give extended regular expression. + 6. For numerical fields, the arguments can be arithmetic + expressions which will be evaluated. + 7. The %n format works as described in ANSI-C. + + k. The following changes have been made to fc: + 1. It has been renamed hist. fc is now a predefined alias. + 2. hist uses ${HISTEDIT:-$FCEDIT}. FCEDIT is obsolete. + 3. A new -s option is equivalent to the obsolete -e -. + 4. If the first argument refers to a command earlier than the + first accessible command, it now implies the first accessible + command, so that hist -l 1 lists all accessible history commands. + + l. The dot command (.) has changed as follows: + 1. The argument can be the name of a function declared as + function name. The function will execute without creating a + new scope. + 2. If there are arguments to the given script or function, + the positional parameters are restored to their original + value when . completes. + + m. The read built-in has been changed as follows: + 1. A -A option to read has been added to allow the fields to be + read into an indexed array. + 2. A -t n option has been added which causes read to + timeout after n seconds when reading from a slow device. + 3. A -d char option has been added which causes the read + to terminate at char rather than at new-line. + + n. The trap command has been changed as follows: + 1. Trap names can be either upper case or lower case. + 2. Trap -p cause only the specified trap values to be displayed. + 3. The value of trap in a subshell will be the value in the parent + shell until a call to trap which changes the trap settings has + been made. Thus, savetraps=$(trap) works as required by the + POSIX standard. + + o. The exec command has been extended as follows: + 1. The -c option clears the environment first. + 2. The -a name option sets argv[0] to name for the program. + + p. true and false are built-ins, not aliases to built-ins. + + q. test has been modified to conform to the IEEE-POSIX 1003.2 + standard when there are three or less arguments. + + r. umask -S option displays the mask in a symbolic format. + + s. wait now returns the correct exit status of any previous + background job that has not been waited for, not just + the most recent one. + + t. The whence built-in has an option -a which causes all + uses for the given command name to be reported. + + u. unalias has -a option to clear all the aliases. + + v. The times built-in command has been removed. The time + reserved word, without a command, gives time cumulative + time for the shell and its children. A built-in alias + for times should enable scripts using times to continue + to run. + + w. Command substitution and arithmetic substitution will now be + performed for PS1, ENV, and PS4 evaluation in addition to + parameter expansion. + + x. The SECONDS variable now displays elapsed time in floating + point seconds with 3 places after the decimal point by + default. + + y. The getopts built-in now handles the complete libast optget + functionality. If any errors have occurred with getopts + when it has reached the end of arguments, then the Usage + message will be generated from the option string and the + exit status from getopts will be 2 rather than 1. The + usage message will be stored in the OPTARG variable if + the option string contains a leading colon; otherwise + it will be printed on standard error automatically. + + z. THE ENV file is only processed for interactive shell + invocations. In addition, the -x attributes for + aliases and functions is ignored. + + aa. The built-in edit modes have been changed as follows: + 1. The pathname completion and pathname listing options + now perform command completion and command listing + when applied to a word in the command position. + 2. In emacs mode ^N as the first related command after + the prompt will move to the next command relative to the + last known history position. + 3. In emacs mode, successive kill and delete commands will + accumulate their data in the kill buffer, by appending or + prepending as appropriate. This mode will be reset by any + command not adding something to the kill buffer. + 4. The control-T of emacs mode has been changed to behave like + control-T in gnu-emacs. + bb. The TMOUT variable also sets a limit for select timeouts + and default timeouts for read. + + +4. The source code has undergone significant modification. + a. Much of the code has been rewritten, In many cases this has + resulted in significant performance improvement. + + b. The code is organized differently. See the README files + for more details. + + c. Most configuration parameters now get generated using + the FEATURE mechanism of nmake. Other options are set + in the OPTIONS file. + + c. The are several new compile time options. See the README + file for details. Some of the old ones have been removed. + + d. The install script is a Mamfile that is generated by + nmake and processed by a script that comes with the + distribution. + + e. There are far fewer global names. This should make it + must easier to add built-in commands without worrying + about conflicts. + + f. The code uses the sfio library which makes it possible + to mix with stdio. + + g. The code is written in ANSI C with full prototypes. + The code is based on the IEEE POSIX 1003.1 standard. + The code can be compiled with K&R C and with C++ by + using the ANSI cpp that comes with nmake or running + the code through the proto filter before pre-processing. + This happens automatically with our shipping system. + + h. There is a programming interface for capturing references + and assignment to shell variables. It is also possible + to intercept variable creation and supply the array processing + function for that variable. See nval.3 for a description. diff --git a/src/cmd/ksh93/RELEASE93 b/src/cmd/ksh93/RELEASE93 new file mode 100644 index 0000000..e99c878 --- /dev/null +++ b/src/cmd/ksh93/RELEASE93 @@ -0,0 +1,455 @@ +This is a list of changes that have been made since the 12/28/93 version +of ksh. + +1. New features in 12/28/93b + a. If IFS contains two consecutive identical characters belonging + to the [:space:] class, then this character is treated as + a non-space delimiter so that each instance will delimit + a field. For example, IFS=$'\t\t' will cause two consecutive + tabs to delimit a null field. + b. The getopts command has a -a name option that specifies a + name that will be used for usage messages. + +2. New features in 12/28/93e + a. The math functions, atan2, hypot, fmod, and pow were added. + b. When a shared library is loaded, if the function lib_init() + is defined in the library, it is invoked the first time that + the library is loaded with builtin -f library. + +3. New features in 12/28/93f + a. Hostnames in addition to host addresses can be given in + /dev/tcp/host/port virtual file names. + b. File name completion and expansion now quotes special + characters in file names from both emacs and vi edit modes. + +4. New features in 12/28/93g + a. The pipefail option has been added. With pipefail + enabled, a pipeline will not complete until all + commands are complete, and the return value will + be that of the last command to fail, or zero if + all complete successfully. + b. When an executable is found on a given path, + the appropriate library path variable is prepended + with a corresponding library directory. +5. New features in 12/28/93h + a. The PATH search algorithm has been modified to look + for a file named .fpath in each bin directory and if + found, to search for functions in this directory if + it cannot find the command in that directory. + b. When performing pathname expansion, the shell checks + to see whether each directory it reads is case sensitive + or not, and performs the matching accordingly. + c. The %T format for printing formatted date/time. +6. New features in 12/28/93i + a. Most of the built-in commands and ksh itself are now + self documenting. Running command --man will produce + screen output. Running command --html produces the + man page in html format. + b. The getopts builtin can process command description + strings to produce man pages. + +7. Bugs fixed in 12/28/93a for default OPTIONS + a. An expansion bug which causes portions of a word after + a $((...)) expansion that contains a nested $var expansion + to be lost has been fixed. + b. A bug that caused a core dump when a script that did not + have PWD set and did a cd inside command substitution + has been fixed. + c. A bug which caused a core dump on some machines when + the LANG variable was assigned to has been fixed. + d. A bug which incorrectly handled set disciplines that + performed arithmetic evaluation when the discipline + was called from the arithmetic evaluator has been fixed. + e. A bug caused by an EXIT trap inside a function that + was executed in a subshell was fixed. + f. If foo is a function, and not a program, then command foo + now reports that foo isn't found rather than invoking foo. + g. The previous version incorrectly listed -A as an + invocation option. The -A option is only for set. + h. A bug was fixed which caused ksh to loop when execution trace + was enabled and the PS4 prompt required command substitution. + i. A bug which could cause the job control switch character + to be disabled when a script that enabled monitor mode + terminated was fixed. + j. A bug in the macro expansion global replacement operator //, + when the pattern began with a [ or +( has been fixed. + k. A bug which prevented ~ expansion from occurring when + it was terminated with a colon inside an assignment + has been fixed. + l. A bug in the dot command which prevented autoload functions + from working has been fixed. + m. A bug which caused a variable to be unset if the + its value were expanded inside a set discipline has + been fixed. + n. Whence -a now longer reports that a defined function + is undefined. + o. A bug on some systems in which $0 would be incorrect + in scripts invoked by name has been fixed. + p. Here documents with an empty body now work. + 1. A bug which disabled argument passing and resetting + of options for a script invoked by name inside a + function has been fixed. + r. A bug in which an EXIT trap set the caller of a function + would be executed if a command called inside a function + was not found has been fixed. + s. A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked has + been fixed. + t. A bug which caused 2<&1- when applied to a shell built-in + to leave standard input closed has been fixed. + u. A bug which caused the shell to incorrectly parse + $() command substitutions with nested case statements + has been fixed. + +8. Bugs fixed in 12/28/93b for default OPTIONS + a. A bug which caused unset RANDOM to dump core has been + fixed. + b. A bug which prevented return for terminating a profile + or ENV file has been fixed. + c. A bug which prevented standard input from being + directed to /dev/null for background jobs when + monitor mode was turned off has been fixed. + d. Statements of the form typeset -options var[expr]=value + did not perform substitutions on expr as expected. + e. A bug which prevented the shell from sending a HUP + signal to some background jobs that were not disowned + has been fixed. + f. A bug which allowed a script to trap signals that are + ignored at the time that the shell was invoked by exec + has been fixed. + g. A bug which could cause a core dump when a discipline + function was unset within a discipline was fixed. + h. The typeset builtin now accepts a first argument of + + or - for compatibility with ksh88. + i. For compatibility with ksh88, the results of expansions + of command arguments will treat the extended character + match characters ()|& as ordinary characters. + j. A bug which caused read to fail on a file that was + open for read/write with <> when the first operation + was print or printf has been fixed. + k. When a job is suspended, it is put on the top of + the job list as required by the POSIX standard. + l. The value of OPTARG when an option that required + an argument but didn't have one was incorrect in the + case the the option string began with a :. + m. A bug which caused the terminal to get into a bad + state with some KEYBD traps in vi-mode has been fixed. + n. A bug which caused an invalid trap to cause a script + to terminate, rather than just return an error, has + been fixed. + o. Backreferencing sub-expressions in patterns and replacement + strings now works. + p. A bug in chmod which caused the -R option to fail has + been fixed. + +9. Bugs fixed in 12/28/93c for default OPTIONS + a. The expansion of "$@" was incorrect when $1 was the null + string. + b. A bug which could incorrectly report a syntax error in + a backquoted expression when a $ was preceded by \\ + has been fixed. + c. A bug which prevented the shell from exiting after + reporting an error when failing to open a script + has been fixed. + d. A bug that could lead to memory corruption when a + large here document that required parameter or command + substitution was expanded has been fixed. + e. A bug that could cause a core dump on some systems + after ksh detected an error when reading a function + has been fixed. + f. A bug which could cause a coprocess to hang when + reading from a process that has terminated has been fixed. + g. A bug which caused a script to terminate when set -e + was on and the first command of and && or || list + failed has been fixed. + h. A bug with here documents inside $(...) when the delimiter + word is an identifier has been fixed. + i. A bug which caused $0 to display the wrong value when + a script was invoked as an argument to the . command + and the eval command has been fixed. + j. A bug that could cause the built-in sleep to hang + has been fixed. + k. A bug introduces in 12/28/93b which caused the backslash + to be removed when it was followed by digit inside double + quotes in some instances has been fixed. + l. A bug which could cause a core dump if ksh was invoked with + standard input closed has been fixed. + m. A bug which could cause a core dump if typeset -A was + specified for an existing variable has been fixed. + n. Variables that were unset but had attributes such as readonly + and export were not listed with readonly, export and typeset. + o. Several problems with signals have been fixed. + p. A bug which prevented ulimit -t from working has been fixed. + Also, a bug in which failed ulimits could cause a core dump + has also been fixed. + q. A bug in expansion of the form ${name/#pattern/string} and + ${name/%pattern/string} has been fixed. + r. A bug which caused read -r on a line that contained only + blanks to get a non-null value has been fixed. + s. A bug introduced in the 'a' point release in which + ${x='\\'} expanded to \ when x was unset has been fixed. + t. A bug which prevented a trap on EXIT from being executed + when the last command in a script was a function invocation + has been fixed. + u. A bug which caused an interactive shell ignore input when + standard error was redirected to a file with exec, + and then restored with exec 2>&1 has been fixed. + v. An interactive shell turns on monitor mode even when + standard error has been redirected to a file. + w. A bug which could cause standard input to be incorrectly + positioned for the last command of a script has been fixed. + y. A bug in the edit modes which allowed walking back in + the history file for more than HISTSIZE commands has + beed fixed. + z. A bug which could cause a core dump if variable TMPDIR was + changed between two command substitutions has been fixed. + aa. A bug which prevented a trap on EXIT from being cleared + has been fixed. + +10. Bugs fixed in 12/28/93d for default OPTIONS + a. The \ character was not handled correctly in replacement + patterns with ${x/pattern/replace}. + b. A bug with read in which the line did not end with + a new-line has been fixed. + c. A bug in file name generation which sometimes + appended a . for filenames that ended in / has + been fixed. + d. If a process is waited for after a status has + been returned by a previous wait, wait now + returns 127. + e. A bug with hist (fc) -e which prevented a command + to re-executed after it had been edited has been fixed. + f. A bug which prevented quoting from removing the meaning + of unary test operators has been fixed. + +11. Bugs fixed in 12/28/93e for default OPTIONS + a. Empty command substitutions of the form $() now work. + b. whence -v foo now gives the correct result after calling + builtin -d foo. + c. A bug in right to left arithmetic assignment for which + the arithmetic expression (( y = x = 1.5 )) did not + yield 1 for y when x was declared typeset -i was fixed. + d. printf has been fixed to handle format containing \0 + and/or \0145 correctly. In addition, characters following + %b in the format string are no longer displayed when + the operand contains \c. + e. A bug in printf that could cause the %E format to + produce unnormalized results has been fixed. + f. A bug which causes some arithmetic expressions to be + incorrectly evaluated as integer expressions rather + that floating point has been fixed. + g. Functions defined inside a subshell no longer remain + defined when the subshell completes. + h. The error message from sh -c ';echo foo' has been + corrected. + i. The format for umask -S has been changed to agree + with the specification in the POSIX standard. + j. A bug that caused side effects in subscript evaluation + when tracing was enabled for subscripts using ++ or -- + has been fixed. + k. To conform to the Posix standard getopts has been changed + so that the option char is set to ? when it returns with + a non-zero exit status. + l. The handling of \} inside ${name...} has been fixed so + that the \ quotes the }. + m. A bug that caused the read builtin to resume execution + after processing a trap has been fixed. + n. [[ -s file ]] has been fixed so that if file is open + by ksh, it is flushed first. + o. In some cases attributes and sizes for non exported + variables weren't being reset before running a script. + p. The value of TMOUT was affected by changes make to + it in a subshell. + q. The jobs command did not reflect changes make by + sending the CONT signal to a command. + r. The error message for ksh -o unknown was incorrect. + s. Functions invoked as name=value name, did not use + values from the calling scope when evaluating value. + t. A bug in which the shell would reexecute previously + executed code when a shell script or coprocess was + run in the background has been fixed. + u. A bug in which an empty here-document would leave + a file descriptor open has been fixed. + v. A bug in which $(set -A array ...) would leave a + side effect has been fixed. + w. A discipline function for a global variable defined + within a function defined with the function keyword, + incorrectly created a local variable of the same name + and applied the discipline to it. + +12. Bugs fixed in 12/28/93f for default OPTIONS + a. A bug which would cause the secondary prompt to be + displayed when a user entered a literal carriage + return has been fixed. + b. I bug which caused ksh read -s name to core dump was + fixed. + c. I bug with the expansion of \} and \] inside double + quoted strings that also contained variable expansions + has been fixed + d. Changes in the 'e' point release caused autoload + functions invoked from within command substitution + to fail. This has been fixed. + e. A bug in the processing of here-documents that could + prevent variable substitution to occur after $(...) command + substitution for long here documents has been fixed. + f. A bug caused by a race condition that could cause SIGTERM + to be ignored by a child process has been fixed. + g. A bug which prevented the startup of a coprocess immediately + after killing a running coprocess has been fixed. + h. ulimit foobar, where foobar is not an arithmetic + expression, now gives an error message as it did with ksh88 + instead of setting the file size limit to 0. + i. A bug which could cause an interactive shell to terminate when + the last process of a pipeline was a POSIX function was fixed. + j. A bug which could cause command substitution of a shell script + to core dump has been fixed. + k. A security hole was fixed in suid_exec. + l. Arithmetic functions such as pow() that take more than + one argument, did not work if arguments other than the + first contained parenthesized sub-expression. + m. The error message from a script containing an incomplete + arithmetic expression has been corrected. + n. A bug which caused a core dump on some machines when + the value of a name reference contained a positional + parameter and the name reference was not defined inside + a function has been fixed. + o. Arithmetic expressions now correctly handle hexidecimal + constants. + p. A bug in which integer variables could be expanded + with a leading 10# when declared with typeset -i + multiple times has been corrected. + q. A bug in which IFS wasn't correctly restored when + set within command substitution has been fixed. + r. The _ character is now considered as part of a word + with the M-f and M-b emacs directives as it was in ksh88. + +13. Bugs fixed in 12/28/93g for default OPTIONS + a. A bug in which a name reference could be created to + itself and later cause the shell to get into an infinite + loop has been fixed. + b. A bug in shcomp relating to compound variables was fixed. + c. A bug introduced in 'e' in which leading 0's in -Z + fields caused the value to be treated as octal for arithmetic + evaluation has been fixed. + d. A bug when a name reference with a shorter name than + the variable it references was the subject of a compound + assignment has been fixed. + e. A bug which in which assignment to array variables in + a subshell could effect the parent shell has been + fixed. + f. read name?prompt was putting a 0 byte at the end of the + prompt on standard error. + g. A bug in [[ string1 > string2 ]] when ksh was run with -x + has been fixed. + k. A bug in which the escape character was not processed + correctly inside {...} when brace expansion is enabled + has been fixed, for example {\$foo}. + l. A bug in line continuation in here-documents has been + fixed. + m. The default base when not specified with typeset -i is + 10 in accordance with the documentation. Previously, + the value was determined by the first assignment. + n. A parsing bug in which a # preceded alphanumeric + characters inside a command substitution caused + a syntax error to be reported has been fixed. + o. A bug in which a decimal constant represented as 10#ddd + where ddd was more than five digits generated a syntax + error has been fixed. + p. A bug in here document expansion in which ${...} expansions + were split across buffer boundaries has been fixed. + +14. Bugs fixed in 12/28/93h for default OPTIONS + a. I bug in shcomp for compilation of unary operators with [[...]] + has been fixed. + b. A bug in which the value of $? was changed when executing + a keyboard trap has been fixed. + c. The handling of SIGCHLD has been changed so that the + trap is not triggered while executing trap commands + to avoid recursive trap calls. + d. I bug in which a local variable in a function declared readonly + would generated an error when the function went out of + scope has been fixed. + e. I bug in which \ entered from the keyboard + with the KEYBD trap enabled has been fixed. + f. The error message for a misplaced ((, for example print ((3), + was often garbled and has been fixed. + g. I bug in the KEYBD trap in which escape sequences of the form + [#~ were not being handled as a unit has been fixed. + h. A bug in which ksh would consider expressions like [[ (a) ]] + as syntax errors has been fixed. + i. A function defined as foo() without a function body + was not reported as a syntax error. + j. A bug in which ksh could run out of file descriptors when + a stream was repeatedly opened with exec and read from + has been fixed. + k. A bug introduced when fixing item n from the 'g' point + release has been fixed. + +15. Bugs fixed in 12/28/93i for default OPTIONS + a. A bug in which a script could terminate when getopts + encountered an error when invoked inside a function + has been fixed. + b. When a symbolic link was specified as the name of + the script to invoke by name, the value of $0 was + set to the real file name rather than the link name + in some cases and this has been fixed. + +16. Bug fixes for specific non-default option combinations. + a. More signal names have been added for Solaris + b. A bug fixed for the v directive in vi MULTIBYTE has been + fixed. + c. Code to for IFS handling of multibyte characters has + been added. + d. The displaying of multibyte strings in export, readonly, + typeset, and execution traces has been fixed. + e. A bug with type ahead and KEYBOARD traps with the + MULTIBYTE option set has been fixed. + f. The k-shell information abstraction database option, KIA, + has been revamped for the 'e' point release. + g. A bug in brace pattern expansions that caused expressions + such as {foo\,bar,bam} to expand incorrectly have been fixed. + h. On the U/WIN version for Window 95 and Windows NT, + when a directory beginning with a letter followed by + a colon is given to cd, it is assumed to be an absolute + directory. + i. There was a bug in the compile option that does not + use fork() in which the current option settings where + not propagated to sub-shells. + j. A bug in setting .sh.editchar during the KEYBD trap + for the MULTIBYTE option was fixed in release 'h'. + k. A bug in which the precision given as an argument + to printf was not working has been fixed. + +17. Other changes to 12/28/93[abcdefghi] + a. A couple of minor changes to make adding built-ins easier. + b. Variables inside functions are now statically scoped. + The previous behavior was never documented. + c. A few changes have been made to the name-value library + that affect built-ins that use disciplines. The + changes allow disciplines to be shared by variables + and should make it possible to add new disciplines + without recompilation. + d. The name-value library interface has undergone significant + change for this revision. See the new nval.3 man page. + e. Builtin functions can take a third argument which is + a void*. + f. The nv_scan() function can restrict the scope of a walk + to the top scope. Starting in 'f', nv_scan() has an + additional pointer argument that is passed to each invoked + function. + g. Starting with release 'f', an empty for list behave like + a for list with null expansions. It produces a warning + message with sh -n. + h. Starting with release 'f' the code has been modified to + work with EBCDIC as well as ASCII. + i. Starting with the release 'g', the name-value pair library + uses the cdt library rather than the hash library. + j. The sh_fun() function now takes third argument which + is an argument list for the invoked discipline function + or built-in. + k. A callback function can be installed which will give + notification of file duplications and file closes. + +18. Incompatibilities with 12/28/93 version. + None intentional. + diff --git a/src/cmd/ksh93/TYPES b/src/cmd/ksh93/TYPES new file mode 100644 index 0000000..6eb6f41 --- /dev/null +++ b/src/cmd/ksh93/TYPES @@ -0,0 +1,182 @@ + +The ability for users to define types has been added to ksh93t. +Here is a quick summary of how types are defined and used in ksh93t. +This is still a work in progress so some changes and additions +are likely. + +A type can be defined either by a shared library or by using the new +typeset -T option to the shell. The method for defining types via +a shared library is not described here. However, the source file +bltins/enum.c is an example of a builtin that creates enumeration types. + +By convention, typenames begin with a capitol letter and end in _t. +To define a type, use + typeset -T Type_t=( + definition + ) +where definition contains assignment commands, declaration commands, +and function definitions. A declaration command (for example typeset, +readonly, and export), is a built-in that differs from other builtins in +that tilde substitution is performed on arguments after an =, assignments +do not have to precede the command name, and field splitting and pathname +expansion is not performed on the arguments. +For example, + typeset -T Pt_t=( + float -h 'length in inches' x=1 + float -h 'width in inches' y=0 + integer -S count=0 + len() + { + print -r $((sqrt(_.x*_.x + _.y*_.y))) + } + set() + { + (( _.count++)) + } + ) + +defines a type Pt_t that has three variables x, y, and count defined as well +as the discipline functions len and set. The variable x has an initial value +of 1 and the variable y has an initial value of 0. The new -h option argument, +is used for documentations purposes as described later and is ignored outside +of a type definition. + + +The variable count has the new -S attribute which means that it is shared +between all instances of the type. The -S option to typeset is ignored +outside of a type definition. Note the variable named _ that is used inside +the function definition for len and set. It will be a reference to the +instance of Pt_t that invoked the function. The functions len and set +could also have been defined with function len and function set, but +since there are no local variables, the len() and set() form are more +efficient since they don't need to set up a context for local variables +and for saving and restoring traps. + +If the discipline function named create is defined it will be +invoked when creating each instance for that type. A function named +create cannot be defined by any instance. + +When a type is defined, a declaration built-in command by this name +is added to ksh. As with other shell builtins, you can get the man page +for this newly added command by invoking Pt_t --man. The information from +the -h options will be embedded in this man page. Any functions that +use getopts to process arguments will be cross referenced on the generated +man page. + +Since Pt_t is now a declaration command it can be used in the definition +of other types, for example + typeset -T Rect_t=( Pt_t ur ll) + +Because a type definition is a command, it can be loaded on first reference +by putting the definition into a file that is found on FPATH. +Thus, if this definition is in a file named Pt_t on FPATH, then +a program can create instances of Pt_t without first including +the definition. + +A type definition is readonly and cannot be unset. Unsetting non-shared +elements of a type restores them to their default value. Unsetting a +shared element has no effect. + +The Pt_t command is used to create an instance of Pt_t. + Pt_t p1 +creates an instance named p1 with the initial value for p1.x set to 1 +and the initial value of p1.y set to 0. + Pt_t p2=(x=3 y=4) +creates an instance with the specified initial values. The len function +gives the distance of the point to the origin. Thus, p1.len will output +1 and p2.len will output 5. + +ksh93t also introduces a more efficient command substitution mechanism. +Instead of $(command), the new command substitution ${ command;} +can be used. Unlike (and ) which are always special, the { and } are +reserved words and require the space after { and a newline or ; before }. +Unlike $(), the ${ ;} command substitution executes the command in +the current shell context saving the need to save and restore +changes, therefore also allowing side effects. + +When trying to expand an element of a type, if the element does not exist, +ksh will look for a discipline function with that name and treat this as if +it were the ${ ;} command substitution. Thus, ${p1.len} is equivalent to +${ p1.len;} and within an arithmetic expression, p1.len will be expanded +via the new command substitution method. + +The type of any variable can be obtained from the new prefix +operator @. Thus, ${@p1} will output Pt_t. + +By default, each instance inherits all the discipline functions defined +by the type definition other than create. However, each instance can define +a function by the same name that will override this definition. +However, only discipline functions with the same name as those defined +by the type or the standard get, set, append, and unset disciplines +can be defined by each instance. + +Each instance of the type Pt_t behaves like a compound variable except +that only the variables defined by the type can be referenced or set. +Thus, p2.x=9 is valid, but p2.z=9 is not. Unless a set discipline function +does otherwise, the value of $p1 will be expanded to the form of a compound +variable that can be used for reinput into ksh. + +If the variables var1 and var2 are of the same type, then the assignment + var2=var1 +will create a copy of the variable var1 into var2. This is equivalent to + eval var2="$var1" +but is faster since the variable does not need to get expanded or reparsed. + +The type Pt_t can be referenced as if it were a variable using the name +.sh.type.Pt_t. To change the default point location for subsequent +instances of Pt_t, you can do + .sh.type.Pt_t=(x=5 y=12) +so that + Pt_t p3 + p3.len +would be 13. + +Types can be defined for simple variables as well as for compound +objects such as Pt_t. In this case, the variable named . inside +the definition refers to the real value for the variable. For example, +the type definition + typeset -T Time_t=( + integer .=0 + _='%H:%M:%S' + get() + { + .sh.value=$(printf "%(${_._})T" "#$((_))" ) + } + set() + { + .sh.value=$(printf "%(%#)T" "${.sh.value}") + + } + ) + +The sub-variable name _ is reserved for data used by discipline functions +and will not be included with data written with the %B option to printf. +In this case it is used to specify a date format. + +In this case + Time_t t1 t2=now +will define t1 as the time at the beginning of the epoch and t2 +as the current time. Unlike the previous case, $t2 will output +the current time in the date format specified by the value t2._. +However, the value of ${t2.} will expand the instance to a form +that can be used as input to the shell. + +Finally, types can be derived from an existing type. If the first +element in a type definition is named _, then the new type +consists of all the elements and discipline functions from the +type of _ extended by elements and discipline functions defined +by new type definition. For example, + + typeset -T Pq_t=( + Pt_t _ + float z=0. + len() + { + print -r $((sqrt(_.x*_.x + _.y*_.y + _.z*_.z))) + } + ) + +defines a new type Pq_t which is based on Pq_t and contains an additional +field z and a different len discipline function. It is also possible +to create a new type Pt_t based on the original Pt_t. In this case +the original Pt_t is no longer accessible. diff --git a/src/cmd/ksh93/bltins/alarm.c b/src/cmd/ksh93/bltins/alarm.c new file mode 100644 index 0000000..50261c6 --- /dev/null +++ b/src/cmd/ksh93/bltins/alarm.c @@ -0,0 +1,276 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * alarm [-r] [varname [+]when] + * + * David Korn + * AT&T Labs + * + */ + +#include "defs.h" +#include +#include +#include "builtins.h" +#include "FEATURE/time" + +#define R_FLAG 1 +#define L_FLAG 2 + +struct tevent +{ + Namfun_t fun; + Namval_t *node; + Namval_t *action; + struct tevent *next; + long milli; + int flags; + void *timeout; + Shell_t *sh; +}; + +static const char ALARM[] = "alarm"; + +static void trap_timeout(void*); + +/* + * insert timeout item on current given list in sorted order + */ +static void *time_add(struct tevent *item, void *list) +{ + register struct tevent *tp = (struct tevent*)list; + if(!tp || item->milli < tp->milli) + { + item->next = tp; + list = (void*)item; + } + else + { + while(tp->next && item->milli > tp->next->milli) + tp = tp->next; + item->next = tp->next; + tp->next = item; + } + tp = item; + tp->timeout = (void*)sh_timeradd(tp->milli,tp->flags&R_FLAG,trap_timeout,(void*)tp); + return(list); +} + +/* + * delete timeout item from current given list, delete timer + */ +static void *time_delete(register struct tevent *item, void *list) +{ + register struct tevent *tp = (struct tevent*)list; + if(item==tp) + list = (void*)tp->next; + else + { + while(tp && tp->next != item) + tp = tp->next; + if(tp) + tp->next = item->next; + } + if(item->timeout) + timerdel((void*)item->timeout); + return(list); +} + +static void print_alarms(void *list) +{ + register struct tevent *tp = (struct tevent*)list; + while(tp) + { + if(tp->timeout) + { + register char *name = nv_name(tp->node); + if(tp->flags&R_FLAG) + { + double d = tp->milli; + sfprintf(sfstdout,e_alrm1,name,d/1000.); + } + else + sfprintf(sfstdout,e_alrm2,name,nv_getnum(tp->node)); + } + tp = tp->next; + } +} + +static void trap_timeout(void* handle) +{ + register struct tevent *tp = (struct tevent*)handle; + tp->sh->trapnote |= SH_SIGALRM; + if(!(tp->flags&R_FLAG)) + tp->timeout = 0; + tp->flags |= L_FLAG; + tp->sh->sigflag[SIGALRM] |= SH_SIGALRM; + if(sh_isstate(SH_TTYWAIT)) + sh_timetraps(tp->sh); +} + +void sh_timetraps(Shell_t *shp) +{ + register struct tevent *tp, *tpnext; + register struct tevent *tptop; + while(1) + { + shp->sigflag[SIGALRM] &= ~SH_SIGALRM; + tptop= (struct tevent*)shp->st.timetrap; + for(tp=tptop;tp;tp=tpnext) + { + tpnext = tp->next; + if(tp->flags&L_FLAG) + { + tp->flags &= ~L_FLAG; + if(tp->action) + sh_fun(tp->action,tp->node,(char**)0); + tp->flags &= ~L_FLAG; + if(!tp->flags) + { + nv_unset(tp->node); + nv_close(tp->node); + } + } + } + if(!(shp->sigflag[SIGALRM]&SH_SIGALRM)) + break; + } +} + + +/* + * This trap function catches "alarm" actions only + */ +static char *setdisc(Namval_t *np, const char *event, Namval_t* action, Namfun_t + *fp) +{ + register struct tevent *tp = (struct tevent*)fp; + if(!event) + return(action?"":(char*)ALARM); + if(strcmp(event,ALARM)!=0) + { + /* try the next level */ + return(nv_setdisc(np, event, action, fp)); + } + if(action==np) + action = tp->action; + else + tp->action = action; + return(action?(char*)action:""); +} + +/* + * catch assignments and set alarm traps + */ +static void putval(Namval_t* np, const char* val, int flag, Namfun_t* fp) +{ + register struct tevent *tp = (struct tevent*)fp; + register double d; + Shell_t *shp = tp->sh; + if(val) + { + double now; +#ifdef timeofday + struct timeval tmp; + timeofday(&tmp); + now = tmp.tv_sec + 1.e-6*tmp.tv_usec; +#else + now = (double)time(NIL(time_t*)); +#endif /* timeofday */ + nv_putv(np,val,flag,fp); + d = nv_getnum(np); + if(*val=='+') + { + double x = d + now; + nv_putv(np,(char*)&x,NV_INTEGER|NV_DOUBLE,fp); + } + else + d -= now; + tp->milli = 1000*(d+.0005); + if(tp->timeout) + shp->st.timetrap = time_delete(tp,shp->st.timetrap); + if(tp->milli > 0) + shp->st.timetrap = time_add(tp,shp->st.timetrap); + } + else + { + tp = (struct tevent*)nv_stack(np, (Namfun_t*)0); + shp->st.timetrap = time_delete(tp,shp->st.timetrap); + if(tp->action) + nv_close(tp->action); + nv_unset(np); + free((void*)fp); + } +} + +static const Namdisc_t alarmdisc = +{ + sizeof(struct tevent), + putval, + 0, + 0, + setdisc, +}; + +int b_alarm(int argc,char *argv[],Shbltin_t *context) +{ + register int n,rflag=0; + register Namval_t *np; + register struct tevent *tp; + register Shell_t *shp = context->shp; + while (n = optget(argv, sh_optalarm)) switch (n) + { + case 'r': + rflag = R_FLAG; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + argc -= opt_info.index; + argv += opt_info.index; + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),optusage((char*)0)); + if(argc==0) + { + print_alarms(shp->st.timetrap); + return(0); + } + if(argc!=2) + errormsg(SH_DICT,ERROR_usage(2),optusage((char*)0)); + np = nv_open(argv[0],shp->var_tree,NV_NOARRAY|NV_VARNAME|NV_NOASSIGN); + if(!nv_isnull(np)) + nv_unset(np); + nv_setattr(np, NV_DOUBLE); + if(!(tp = newof(NIL(struct tevent*),struct tevent,1,0))) + errormsg(SH_DICT,ERROR_exit(1),e_nospace); + tp->fun.disc = &alarmdisc; + tp->flags = rflag; + tp->node = np; + tp->sh = shp; + nv_stack(np,(Namfun_t*)tp); + nv_putval(np, argv[1], 0); + return(0); +} + diff --git a/src/cmd/ksh93/bltins/cd_pwd.c b/src/cmd/ksh93/bltins/cd_pwd.c new file mode 100644 index 0000000..fb0dcda --- /dev/null +++ b/src/cmd/ksh93/bltins/cd_pwd.c @@ -0,0 +1,250 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * cd [-LP] [dirname] + * cd [-LP] [old] [new] + * pwd [-LP] + * + * David Korn + * AT&T Labs + * research!dgk + * + */ + +#include "defs.h" +#include +#include +#include "variables.h" +#include "path.h" +#include "name.h" +#include "builtins.h" +#include + +/* + * Invalidate path name bindings to relative paths + */ +static void rehash(register Namval_t *np,void *data) +{ + Pathcomp_t *pp = (Pathcomp_t*)np->nvalue.cp; + NOT_USED(data); + if(pp && *pp->name!='/') + _nv_unset(np,0); +} + +int b_cd(int argc, char *argv[],Shbltin_t *context) +{ + register char *dir; + Pathcomp_t *cdpath = 0; + register const char *dp; + register Shell_t *shp = context->shp; + int saverrno=0; + int rval,flag=0; + char *oldpwd; + Namval_t *opwdnod, *pwdnod; + if(sh_isoption(SH_RESTRICTED)) + errormsg(SH_DICT,ERROR_exit(1),e_restricted+4); + while((rval = optget(argv,sh_optcd))) switch(rval) + { + case 'L': + flag = 0; + break; + case 'P': + flag = 1; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + argv += opt_info.index; + argc -= opt_info.index; + dir = argv[0]; + if(error_info.errors>0 || argc >2) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + oldpwd = (char*)shp->pwd; + opwdnod = (shp->subshell?sh_assignok(OLDPWDNOD,1):OLDPWDNOD); + pwdnod = (shp->subshell?sh_assignok(PWDNOD,1):PWDNOD); + if(argc==2) + dir = sh_substitute(oldpwd,dir,argv[1]); + else if(!dir) + dir = nv_getval(HOME); + else if(*dir == '-' && dir[1]==0) + dir = nv_getval(opwdnod); + if(!dir || *dir==0) + errormsg(SH_DICT,ERROR_exit(1),argc==2?e_subst+4:e_direct); +#if _WINIX + if(*dir != '/' && (dir[1]!=':')) +#else + if(*dir != '/') +#endif /* _WINIX */ + { + if(!(cdpath = (Pathcomp_t*)shp->cdpathlist) && (dp=sh_scoped(shp,CDPNOD)->nvalue.cp)) + { + if(cdpath=path_addpath(shp,(Pathcomp_t*)0,dp,PATH_CDPATH)) + { + shp->cdpathlist = (void*)cdpath; + cdpath->shp = shp; + } + } + if(!oldpwd) + oldpwd = path_pwd(shp,1); + } + if(*dir=='.') + { + /* test for pathname . ./ .. or ../ */ + if(*(dp=dir+1) == '.') + dp++; + if(*dp==0 || *dp=='/') + cdpath = 0; + } + rval = -1; + do + { + dp = cdpath?cdpath->name:""; + cdpath = path_nextcomp(shp,cdpath,dir,0); +#if _WINIX + if(*stakptr(PATH_OFFSET+1)==':' && isalpha(*stakptr(PATH_OFFSET))) + { + *stakptr(PATH_OFFSET+1) = *stakptr(PATH_OFFSET); + *stakptr(PATH_OFFSET)='/'; + } +#endif /* _WINIX */ + if(*stakptr(PATH_OFFSET)!='/') + + { + char *last=(char*)stakfreeze(1); + stakseek(PATH_OFFSET); + stakputs(oldpwd); + /* don't add '/' of oldpwd is / itself */ + if(*oldpwd!='/' || oldpwd[1]) + stakputc('/'); + stakputs(last+PATH_OFFSET); + stakputc(0); + } + if(!flag) + { + register char *cp; + stakseek(PATH_MAX+PATH_OFFSET); +#if SHOPT_FS_3D + if(!(cp = pathcanon(stakptr(PATH_OFFSET),PATH_DOTDOT))) + continue; + /* eliminate trailing '/' */ + while(*--cp == '/' && cp>stakptr(PATH_OFFSET)) + *cp = 0; +#else + if(*(cp=stakptr(PATH_OFFSET))=='/') + if(!pathcanon(cp,PATH_DOTDOT)) + continue; +#endif /* SHOPT_FS_3D */ + } + if((rval=chdir(path_relative(shp,stakptr(PATH_OFFSET)))) >= 0) + goto success; + if(errno!=ENOENT && saverrno==0) + saverrno=errno; + } + while(cdpath); + if(rval<0 && *dir=='/' && *(path_relative(shp,stakptr(PATH_OFFSET)))!='/') + rval = chdir(dir); + /* use absolute chdir() if relative chdir() fails */ + if(rval<0) + { + if(saverrno) + errno = saverrno; + errormsg(SH_DICT,ERROR_system(1),"%s:",dir); + } +success: + if(dir == nv_getval(opwdnod) || argc==2) + dp = dir; /* print out directory for cd - */ + if(flag) + { + dir = stakptr(PATH_OFFSET); + if (!(dir=pathcanon(dir,PATH_PHYSICAL))) + { + dir = stakptr(PATH_OFFSET); + errormsg(SH_DICT,ERROR_system(1),"%s:",dir); + } + stakseek(dir-stakptr(0)); + } + dir = (char*)stakfreeze(1)+PATH_OFFSET; + if(*dp && (*dp!='.'||dp[1]) && strchr(dir,'/')) + sfputr(sfstdout,dir,'\n'); + if(*dir != '/') + return(0); + nv_putval(opwdnod,oldpwd,NV_RDONLY); + if(oldpwd) + free(oldpwd); + flag = strlen(dir); + /* delete trailing '/' */ + while(--flag>0 && dir[flag]=='/') + dir[flag] = 0; + nv_putval(pwdnod,dir,NV_RDONLY); + nv_onattr(pwdnod,NV_NOFREE|NV_EXPORT); + shp->pwd = pwdnod->nvalue.cp; + nv_scan(shp->track_tree,rehash,(void*)0,NV_TAGGED,NV_TAGGED); + path_newdir(shp,shp->pathlist); + path_newdir(shp,shp->cdpathlist); + return(0); +} + +int b_pwd(int argc, char *argv[],Shbltin_t *context) +{ + register int n, flag = 0; + register char *cp; + register Shell_t *shp = context->shp; + NOT_USED(argc); + while((n = optget(argv,sh_optpwd))) switch(n) + { + case 'L': + flag = 0; + break; + case 'P': + flag = 1; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + if(*(cp = path_pwd(shp,0)) != '/') + errormsg(SH_DICT,ERROR_system(1), e_pwd); + if(flag) + { +#if SHOPT_FS_3D + if(shp->gd->lim.fs3d && (flag = mount(e_dot,NIL(char*),FS3D_GET|FS3D_VIEW,0))>=0) + { + cp = (char*)stakseek(++flag+PATH_MAX); + mount(e_dot,cp,FS3D_GET|FS3D_VIEW|FS3D_SIZE(flag),0); + } + else +#endif /* SHOPT_FS_3D */ + cp = strcpy(stakseek(strlen(cp)+PATH_MAX),cp); + pathcanon(cp,PATH_PHYSICAL); + } + sfputr(sfstdout,cp,'\n'); + return(0); +} + diff --git a/src/cmd/ksh93/bltins/cflow.c b/src/cmd/ksh93/bltins/cflow.c new file mode 100644 index 0000000..c78659f --- /dev/null +++ b/src/cmd/ksh93/bltins/cflow.c @@ -0,0 +1,117 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * break [n] + * continue [n] + * return [n] + * exit [n] + * + * David Korn + * AT&T Labs + * dgk@research.att.com + * + */ + +#include "defs.h" +#include +#include +#include "shnodes.h" +#include "builtins.h" + +/* + * return and exit + */ +#if 0 + /* for the dictionary generator */ + int b_exit(int n, register char *argv[],Shbltin_t *context){} +#endif +int b_return(register int n, register char *argv[],Shbltin_t *context) +{ + register char *arg; + register Shell_t *shp = context->shp; + struct checkpt *pp = (struct checkpt*)shp->jmplist; + const char *options = (**argv=='r'?sh_optreturn:sh_optexit); + while((n = optget(argv,options))) switch(n) + { + case ':': + if(!strmatch(argv[opt_info.index],"[+-]+([0-9])")) + errormsg(SH_DICT,2, "%s", opt_info.arg); + goto done; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s", opt_info.arg); + return(2); + } +done: + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + pp->mode = (**argv=='e'?SH_JMPEXIT:SH_JMPFUN); + argv += opt_info.index; + n = (((arg= *argv)?(int)strtol(arg, (char**)0, 10)&SH_EXITMASK:shp->oldexit)); + /* return outside of function, dotscript and profile is exit */ + if(shp->fn_depth==0 && shp->dot_depth==0 && !sh_isstate(SH_PROFILE)) + pp->mode = SH_JMPEXIT; + sh_exit(shp->savexit=n); + return(1); +} + + +/* + * break and continue + */ +#if 0 + /* for the dictionary generator */ + int b_continue(int n, register char *argv[],Shbltin_t *context){} +#endif +int b_break(register int n, register char *argv[],Shbltin_t *context) +{ + char *arg; + register int cont= **argv=='c'; + register Shell_t *shp = context->shp; + while((n = optget(argv,cont?sh_optcont:sh_optbreak))) switch(n) + { + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s", opt_info.arg); + return(2); + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + argv += opt_info.index; + n=1; + if(arg= *argv) + { + n = strtol(arg,&arg,10); + if(n<=0 || *arg) + errormsg(SH_DICT,ERROR_exit(1),e_nolabels,*argv); + } + if(shp->st.loopcnt) + { + shp->st.execbrk = shp->st.breakcnt = n; + if(shp->st.breakcnt > shp->st.loopcnt) + shp->st.breakcnt = shp->st.loopcnt; + if(cont) + shp->st.breakcnt = -shp->st.breakcnt; + } + return(0); +} + diff --git a/src/cmd/ksh93/bltins/enum.c b/src/cmd/ksh93/bltins/enum.c new file mode 100644 index 0000000..5cc749c --- /dev/null +++ b/src/cmd/ksh93/bltins/enum.c @@ -0,0 +1,284 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +#include + +static const char enum_usage[] = +"[-?@(#)$Id: enum (AT&T Research) 2008-01-08 $\n]" +USAGE_LICENSE +"[+NAME?enum - create an enumeration type]" +"[+DESCRIPTION?\benum\b is a declaration command that creates an enumeration " + "type \atypename\a that can only store any one of the values in the indexed " + "array variable \atypename\a.]" +"[+?If the list of \avalue\as is omitted, then \atypename\a must name an " + "indexed array variable with at least two elements.]" +"[i:ignorecase?The values are case insensitive.]" +"\n" +"\n\atypename\a[\b=(\b \avalue\a ... \b)\b]\n" +"\n" +"[+EXIT STATUS]" + "{" + "[+0?Successful completion.]" + "[+>0?An error occurred.]" + "}" +"[+SEE ALSO?\bksh\b(1), \btypeset\b(1).]" +; + +static const char enum_type[] = +"[-1c?\n@(#)$Id: type (AT&T Labs Research) 2008-01-08 $\n]" +USAGE_LICENSE +"[+NAME?\f?\f - create an instance of type \b\f?\f\b]" +"[+DESCRIPTION?\b\f?\f\b creates a variable for each \aname\a with " + "enumeration type \b\f?\f\b where \b\f?\f\b is a type that has been " + "created with the \benum\b(1) command.]" +"[+?The variable can have one of the following values\fvalues\f. " + "The the values are \fcase\fcase sensitive.]" +"[+?If \b=\b\avalue\a is omitted, the default is \fdefault\f.]" +"[+?If no \aname\as are specified then the names and values of all " + "variables of this type are written to standard output.]" +"[+?\b\f?\f\b is built-in to the shell as a declaration command so that " + "field splitting and pathname expansion are not performed on " + "the arguments. Tilde expansion occurs on \avalue\a.]" +"[r?Enables readonly. Once enabled, the value cannot be changed or unset.]" +"[a?index array. Each \aname\a will converted to an index " + "array of type \b\f?\f\b. If a variable already exists, the current " + "value will become index \b0\b.]" +"[A?Associative array. Each \aname\a will converted to an associate " + "array of type \b\f?\f\b. If a variable already exists, the current " + "value will become subscript \b0\b.]" +"[h]:[string?Used within a type definition to provide a help string " + "for variable \aname\a. Otherwise, it is ignored.]" +"[S?Used with a type definition to indicate that the variable is shared by " + "each instance of the type. When used inside a function defined " + "with the \bfunction\b reserved word, the specified variables " + "will have function static scope. Otherwise, the variable is " + "unset prior to processing the assignment list.]" +#if 0 +"[p?Causes the output to be in a form of \b\f?\f\b commands that can be " + "used as input to the shell to recreate the current type of " + "these variables.]" +#endif +"\n" +"\n[name[=value]...]\n" +"\n" +"[+EXIT STATUS?]{" + "[+0?Successful completion.]" + "[+>0?An error occurred.]" +"}" + +"[+SEE ALSO?\benum\b(1), \btypeset\b(1)]" +; + +struct Enum +{ + Namfun_t hdr; + short nelem; + short iflag; + const char *values[1]; +}; + +static int enuminfo(Opt_t* op, Sfio_t *out, const char *str, Optdisc_t *fp) +{ + Namval_t *np; + struct Enum *ep; + int n=0; + const char *v; + np = *(Namval_t**)(fp+1); + ep = (struct Enum*)np->nvfun; + if(strcmp(str,"default")==0) +#if 0 + sfprintf(out,"\b%s\b%c",ep->values[0],0); +#else + sfprintf(out,"\b%s\b",ep->values[0]); +#endif + else if(strcmp(str,"case")==0) + { + if(ep->iflag) + sfprintf(out,"not "); + } + else while(v=ep->values[n++]) + { + sfprintf(out,", \b%s\b",v); + } + return(0); +} + +static Namfun_t *clone_enum(Namval_t* np, Namval_t *mp, int flags, Namfun_t *fp) +{ + struct Enum *ep, *pp=(struct Enum*)fp; + ep = newof(0,struct Enum,1,pp->nelem*sizeof(char*)); + memcpy((void*)ep,(void*)pp,sizeof(struct Enum)+pp->nelem*sizeof(char*)); + return(&ep->hdr); +} + +static void put_enum(Namval_t* np,const char *val,int flags,Namfun_t *fp) +{ + struct Enum *ep = (struct Enum*)fp; + register const char *v; + unsigned short i=0, n; + if(!val) + { + nv_putv(np, val, flags,fp); + nv_disc(np,&ep->hdr,NV_POP); + if(!ep->hdr.nofree) + free((void*)ep); + return; + } + if(flags&NV_INTEGER) + { + nv_putv(np,val,flags,fp); + return; + } + while(v=ep->values[i]) + { + if(ep->iflag) + n = strcasecmp(v,val); + else + n = strcmp(v,val); + if(n==0) + { + nv_putv(np, (char*)&i, NV_UINT16, fp); + return; + } + i++; + } + if(nv_isattr(np,NV_NOFREE)) + error(ERROR_exit(1), "%s: invalid value %s",nv_name(np),val); +} + +static char* get_enum(register Namval_t* np, Namfun_t *fp) +{ + static char buff[6]; + struct Enum *ep = (struct Enum*)fp; + long n = nv_getn(np,fp); + if(n < ep->nelem) + return((char*)ep->values[n]); + sfsprintf(buff,sizeof(buff),"%u%c",n,0); + return(buff); +} + +static Sfdouble_t get_nenum(register Namval_t* np, Namfun_t *fp) +{ + return(nv_getn(np,fp)); +} + +const Namdisc_t ENUM_disc = { 0, put_enum, get_enum, get_nenum, 0,0,clone_enum }; + +#ifdef STANDALONE +static int enum_create(int argc, char** argv, Shbltin_t *context) +#else +int b_enum(int argc, char** argv, Shbltin_t *context) +#endif +{ + int sz,i,n,iflag = 0; + Namval_t *np, *tp; + Namarr_t *ap; + char *cp,*sp; + struct Enum *ep; + Shell_t *shp = context->shp; + struct { + Optdisc_t opt; + Namval_t *np; + } optdisc; + + cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY); + for (;;) + { + switch (optget(argv, enum_usage)) + { + case 'i': + iflag = 'i'; + continue; + case '?': + error(ERROR_USAGE|4, "%s", opt_info.arg); + break; + case ':': + error(2, "%s", opt_info.arg); + break; + } + break; + } + argv += opt_info.index; + if (error_info.errors || !*argv || *(argv + 1)) + { + error(ERROR_USAGE|2, "%s", optusage(NiL)); + return 1; + } + while(cp = *argv++) + { + if(!(np = nv_open(cp, (void*)0, NV_VARNAME|NV_NOADD)) || !(ap=nv_arrayptr(np)) || ap->fun || (sz=ap->nelem&(((1L<nvname,0); + tp = nv_open(stakptr(n), shp->var_tree, NV_VARNAME); + stakseek(n); + n = sz; + i = 0; + nv_onattr(tp, NV_UINT16); + nv_putval(tp, (char*)&i, NV_INTEGER); + nv_putsub(np, (char*)0, ARRAY_SCAN); + do + { + sz += strlen(nv_getval(np)); + } + while(nv_nextsub(np)); + sz += n*sizeof(char*); + if(!(ep = newof(0,struct Enum,1,sz))) + error(ERROR_system(1), "out of space"); + ep->iflag = iflag; + ep->nelem = n; + cp = (char*)&ep->values[n+1]; + nv_putsub(np, (char*)0, ARRAY_SCAN); + ep->values[n] = 0; + i = 0; + do + { + ep->values[i++] = cp; + sp = nv_getval(np); + n = strlen(sp); + memcpy(cp,sp,n+1); + cp += n+1; + } + while(nv_nextsub(np)); + ep->hdr.dsize = sizeof(struct Enum)+sz; + ep->hdr.disc = &ENUM_disc; + ep->hdr.type = tp; + nv_onattr(tp, NV_RDONLY); + nv_disc(tp, &ep->hdr,NV_FIRST); + memset(&optdisc,0,sizeof(optdisc)); + optdisc.opt.infof = enuminfo; + optdisc.np = tp; + nv_addtype(tp, enum_type, &optdisc.opt, sizeof(optdisc)); + } + return error_info.errors != 0; +} + +#ifdef STANDALONE +void lib_init(int flag, void* context) +{ + Shell_t *shp = ((Shbltin_t*)context)->shp; + Namval_t *mp,*bp; + if(flag) + return; + bp = sh_addbuiltin("Enum", enum_create, (void*)0); + mp = nv_search("typeset",shp->bltin_tree,0); + nv_onattr(bp,nv_isattr(mp,NV_PUBLIC)); +} +#endif diff --git a/src/cmd/ksh93/bltins/getopts.c b/src/cmd/ksh93/bltins/getopts.c new file mode 100644 index 0000000..8b92b73 --- /dev/null +++ b/src/cmd/ksh93/bltins/getopts.c @@ -0,0 +1,199 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * getopts optstring name [arg...] + * + * David Korn + * AT&T Labs + * research!dgk + * + */ + +#include "defs.h" +#include "variables.h" +#include +#include +#include "builtins.h" + +static int infof(Opt_t* op, Sfio_t* sp, const char* s, Optdisc_t* dp) +{ + Shell_t *shp = *(Shell_t**)(dp+1); + Stk_t *stkp = shp->stk; + if(nv_search(s,shp->fun_tree,0)) + { + int savtop = stktell(stkp); + char *savptr = stkfreeze(stkp,0); + sfputc(stkp,'$'); + sfputc(stkp,'('); + sfputr(stkp,s,')'); + sfputr(sp,sh_mactry(shp,stkfreeze(stkp,1)),-1); + stkset(stkp,savptr,savtop); + } + return(1); +} + +int b_getopts(int argc,char *argv[],Shbltin_t *context) +{ + register char *options=error_info.context->id; + register Namval_t *np; + register int flag, mode; + register Shell_t *shp = context->shp; + char value[2], key[2]; + int jmpval,extended; + volatile int r= -1; + struct checkpt buff, *pp; + struct { + Optdisc_t hdr; + Shell_t *sh; + } disc; + memset(&disc, 0, sizeof(disc)); + disc.hdr.version = OPT_VERSION; + disc.hdr.infof = infof; + disc.sh = shp; + value[1] = 0; + key[1] = 0; + while((flag = optget(argv,sh_optgetopts))) switch(flag) + { + case 'a': + options = opt_info.arg; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + argv += opt_info.index; + argc -= opt_info.index; + if(error_info.errors || argc<2) + errormsg(SH_DICT,ERROR_usage(2), "%s", optusage((char*)0)); + error_info.context->flags |= ERROR_SILENT; + error_info.id = options; + options = argv[0]; + np = nv_open(argv[1],shp->var_tree,NV_NOASSIGN|NV_VARNAME); + if(argc>2) + { + argv +=1; + argc -=1; + } + else + { + argv = shp->st.dolv; + argc = shp->st.dolc; + } + opt_info.index = shp->st.optindex; + opt_info.offset = shp->st.optchar; + if(mode= (*options==':')) + options++; + extended = *options=='\n' && *(options+1)=='[' || *options=='[' && *(options+1)=='-'; + sh_pushcontext(shp,&buff,1); + jmpval = sigsetjmp(buff.buff,0); + if(jmpval) + { + sh_popcontext(shp,&buff); + shp->st.opterror = 1; + if(r==0) + return(2); + pp = (struct checkpt*)shp->jmplist; + pp->mode = SH_JMPERREXIT; + sh_exit(2); + } + opt_info.disc = &disc.hdr; + switch(opt_info.index>=0 && opt_info.index<=argc?(opt_info.num= LONG_MIN,flag=optget(argv,options)):0) + { + case '?': + if(mode==0) + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + opt_info.option[1] = '?'; + /* FALL THRU */ + case ':': + key[0] = opt_info.option[1]; + if(strmatch(opt_info.arg,"*unknown*")) + flag = '?'; + if(mode) + opt_info.arg = key; + else + { + errormsg(SH_DICT,2, "%s", opt_info.arg); + opt_info.arg = 0; + flag = '?'; + } + *(options = value) = flag; + shp->st.opterror = 1; + if (opt_info.offset != 0 && !argv[opt_info.index][opt_info.offset]) + { + opt_info.offset = 0; + opt_info.index++; + } + break; + case 0: + if(shp->st.opterror) + { + char *com[2]; + com[0] = "-?"; + com[1] = 0; + flag = opt_info.index; + opt_info.index = 0; + optget(com,options); + opt_info.index = flag; + if(!mode && strchr(options,' ')) + errormsg(SH_DICT,ERROR_usage(2), "%s", optusage((char*)0)); + } + opt_info.arg = 0; + options = value; + *options = '?'; + r=1; + opt_info.offset = 0; + break; + default: + options = opt_info.option + (*opt_info.option!='+'); + } + if(r<0) + r = 0; + error_info.context->flags &= ~ERROR_SILENT; + shp->st.optindex = opt_info.index; + shp->st.optchar = opt_info.offset; + nv_putval(np, options, 0); + nv_close(np); + np = nv_open(nv_name(OPTARGNOD),shp->var_tree,NV_NOSCOPE); + if(opt_info.num == LONG_MIN) + nv_putval(np, opt_info.arg, NV_RDONLY); + else if (opt_info.arg && opt_info.num > 0 && isalpha((char)opt_info.num) && !isdigit(opt_info.arg[0]) && opt_info.arg[0] != '-' && opt_info.arg[0] != '+') + { + key[0] = (char)opt_info.num; + key[1] = 0; + nv_putval(np, key, NV_RDONLY); + } + else if(extended) + { + Sfdouble_t d; + d = opt_info.number; + nv_putval(np, (char*)&d, NV_LDOUBLE|NV_RDONLY); + } + else + nv_putval(np, opt_info.arg, NV_RDONLY); + nv_close(np); + sh_popcontext(shp,&buff); + opt_info.disc = 0; + return(r); +} + diff --git a/src/cmd/ksh93/bltins/hist.c b/src/cmd/ksh93/bltins/hist.c new file mode 100644 index 0000000..1c2bc72 --- /dev/null +++ b/src/cmd/ksh93/bltins/hist.c @@ -0,0 +1,312 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +#include "defs.h" +#include +#include +#include +#include "variables.h" +#include "io.h" +#include "name.h" +#include "history.h" +#include "builtins.h" +#if SHOPT_HISTEXPAND +# include "edit.h" +#endif + +#define HIST_RECURSE 5 + +static void hist_subst(const char*, int fd, char*); + +#if 0 + /* for the benefit of the dictionary generator */ + int b_fc(int argc,char *argv[], Shbltin_t *context){} +#endif +int b_hist(int argc,char *argv[], Shbltin_t *context) +{ + register History_t *hp; + register char *arg; + register int flag,fdo; + register Shell_t *shp = context->shp; + Sfio_t *outfile; + char *fname; + int range[2], incr, index2, indx= -1; + char *edit = 0; /* name of editor */ + char *replace = 0; /* replace old=new */ + int lflag = 0, nflag = 0, rflag = 0; +#if SHOPT_HISTEXPAND + int pflag = 0; +#endif + Histloc_t location; + NOT_USED(argc); + if(!sh_histinit((void*)shp)) + errormsg(SH_DICT,ERROR_system(1),e_histopen); + hp = shp->gd->hist_ptr; + while((flag = optget(argv,sh_opthist))) switch(flag) + { + case 'e': + edit = opt_info.arg; + break; + case 'n': + nflag++; + break; + case 'l': + lflag++; + break; + case 'r': + rflag++; + break; + case 's': + edit = "-"; + break; +#if SHOPT_HISTEXPAND + case 'p': + pflag++; + break; +#endif + case 'N': + if(indx<=0) + { + if((flag = hist_max(hp) - opt_info.num-1) < 0) + flag = 1; + range[++indx] = flag; + break; + } + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + argv += (opt_info.index-1); +#if SHOPT_HISTEXPAND + if(pflag) + { + hist_cancel(hp); + pflag = 0; + while(arg=argv[1]) + { + flag = hist_expand(arg,&replace); + if(!(flag & HIST_ERROR)) + sfputr(sfstdout, replace, '\n'); + else + pflag = 1; + if(replace) + free(replace); + argv++; + } + return pflag; + } +#endif + flag = indx; + while(flag<1 && (arg=argv[1])) + { + /* look for old=new argument */ + if(!replace && strchr(arg+1,'=')) + { + replace = arg; + argv++; + continue; + } + else if(isdigit(*arg) || *arg == '-') + { + /* see if completely numeric */ + do arg++; + while(isdigit(*arg)); + if(*arg==0) + { + arg = argv[1]; + range[++flag] = (int)strtol(arg, (char**)0, 10); + if(*arg == '-') + range[flag] += (hist_max(hp)-1); + argv++; + continue; + } + } + /* search for last line starting with string */ + location = hist_find(hp,argv[1],hist_max(hp)-1,0,-1); + if((range[++flag] = location.hist_command) < 0) + errormsg(SH_DICT,ERROR_exit(1),e_found,argv[1]); + argv++; + } + if(flag <0) + { + /* set default starting range */ + if(lflag) + { + flag = hist_max(hp)-16; + if(flag<1) + flag = 1; + } + else + flag = hist_max(hp)-2; + range[0] = flag; + flag = 0; + } + index2 = hist_min(hp); + if(range[0]=(flag=(hist_max(hp) - !lflag))) + range[1] = flag; + /* check for valid ranges */ + if(range[1]=flag) + errormsg(SH_DICT,ERROR_exit(1),e_badrange,range[0],range[1]); + if(edit && *edit=='-' && range[0]!=range[1]) + errormsg(SH_DICT,ERROR_exit(1),e_eneedsarg); + /* now list commands from range[rflag] to range[1-rflag] */ + incr = 1; + flag = rflag>0; + if(range[1-flag] < range[flag]) + incr = -1; + if(lflag) + { + outfile = sfstdout; + arg = "\n\t"; + } + else + { + if(!(fname=pathtmp(NIL(char*),0,0,NIL(int*)))) + errormsg(SH_DICT,ERROR_exit(1),e_create,""); + if((fdo=open(fname,O_CREAT|O_RDWR,S_IRUSR|S_IWUSR)) < 0) + errormsg(SH_DICT,ERROR_system(1),e_create,fname); + outfile= sfnew(NIL(Sfio_t*),shp->outbuff,IOBSIZE,fdo,SF_WRITE); + arg = "\n"; + nflag++; + } + while(1) + { + if(nflag==0) + sfprintf(outfile,"%d\t",range[flag]); + else if(lflag) + sfputc(outfile,'\t'); + hist_list(shp->gd->hist_ptr,outfile,hist_tell(shp->gd->hist_ptr,range[flag]),0,arg); + if(lflag) + sh_sigcheck(shp); + if(range[flag] == range[1-flag]) + break; + range[flag] += incr; + } + if(lflag) + return(0); + sfclose(outfile); + hist_eof(hp); + arg = edit; + if(!arg && !(arg=nv_getval(sh_scoped(shp,HISTEDIT))) && !(arg=nv_getval(sh_scoped(shp,FCEDNOD)))) + { + arg = (char*)e_defedit; + if(*arg!='/') + errormsg(SH_DICT,ERROR_exit(1),"ed not found set FCEDIT"); + } +#ifdef apollo + /* + * Code to support the FC using the pad editor. + * Exampled of how to use: HISTEDIT=pad + */ + if (strcmp (arg, "pad") == 0) + { + extern int pad_create(char*); + sh_close(fdo); + fdo = pad_create(fname); + pad_wait(fdo); + unlink(fname); + strcat(fname, ".bak"); + unlink(fname); + lseek(fdo,(off_t)0,SEEK_SET); + } + else + { +#endif /* apollo */ + if(*arg != '-') + { + char *com[3]; + com[0] = arg; + com[1] = fname; + com[2] = 0; + error_info.errors = sh_eval(sh_sfeval(com),0); + } + fdo = sh_chkopen(fname); + unlink(fname); + free((void*)fname); +#ifdef apollo + } +#endif /* apollo */ + /* don't history fc itself unless forked */ + error_info.flags |= ERROR_SILENT; + if(!sh_isstate(SH_FORKED)) + hist_cancel(hp); + sh_onstate(SH_HISTORY); + sh_onstate(SH_VERBOSE); /* echo lines as read */ + if(replace) + hist_subst(error_info.id,fdo,replace); + else if(error_info.errors == 0) + { + char buff[IOBSIZE+1]; + Sfio_t *iop = sfnew(NIL(Sfio_t*),buff,IOBSIZE,fdo,SF_READ); + /* read in and run the command */ + if(shp->hist_depth++ > HIST_RECURSE) + errormsg(SH_DICT,ERROR_exit(1),e_toodeep,"history"); + sh_eval(iop,1); + shp->hist_depth--; + } + else + { + sh_close(fdo); + if(!sh_isoption(SH_VERBOSE)) + sh_offstate(SH_VERBOSE); + sh_offstate(SH_HISTORY); + } + return(shp->exitval); +} + + +/* + * given a file containing a command and a string of the form old=new, + * execute the command with the string old replaced by new + */ + +static void hist_subst(const char *command,int fd,char *replace) +{ + register char *newp=replace; + register char *sp; + register int c; + off_t size; + char *string; + while(*++newp != '='); /* skip to '=' */ + if((size = lseek(fd,(off_t)0,SEEK_END)) < 0) + return; + lseek(fd,(off_t)0,SEEK_SET); + c = (int)size; + string = stakalloc(c+1); + if(read(fd,string,c)!=c) + return; + string[c] = 0; + *newp++ = 0; + if((sp=sh_substitute(string,replace,newp))==0) + errormsg(SH_DICT,ERROR_exit(1),e_subst,command); + *(newp-1) = '='; + sh_eval(sfopen(NIL(Sfio_t*),sp,"s"),1); +} + diff --git a/src/cmd/ksh93/bltins/misc.c b/src/cmd/ksh93/bltins/misc.c new file mode 100644 index 0000000..d810a05 --- /dev/null +++ b/src/cmd/ksh93/bltins/misc.c @@ -0,0 +1,590 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * exec [arg...] + * eval [arg...] + * jobs [-lnp] [job...] + * login [arg...] + * let expr... + * . file [arg...] + * :, true, false + * vpath [top] [base] + * vmap [top] [base] + * wait [job...] + * shift [n] + * + * David Korn + * AT&T Labs + * + */ + +#include "defs.h" +#include "variables.h" +#include "shnodes.h" +#include "path.h" +#include "io.h" +#include "name.h" +#include "history.h" +#include "builtins.h" +#include "jobs.h" + +#define DOTMAX MAXDEPTH /* maximum level of . nesting */ + +static void noexport(Namval_t*,void*); + +struct login +{ + Shell_t *sh; + int clear; + char *arg0; +}; + +int b_exec(int argc,char *argv[], Shbltin_t *context) +{ + struct login logdata; + register int n; + logdata.clear = 0; + logdata.arg0 = 0; + logdata.sh = context->shp; + logdata.sh->st.ioset = 0; + while (n = optget(argv, sh_optexec)) switch (n) + { + case 'a': + logdata.arg0 = opt_info.arg; + argc = 0; + break; + case 'c': + logdata.clear=1; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s", opt_info.arg); + return(2); + } + argv += opt_info.index; + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + if(*argv) + B_login(0,argv,(Shbltin_t*)&logdata); + return(0); +} + +static void noexport(register Namval_t* np, void *data) +{ + NOT_USED(data); + nv_offattr(np,NV_EXPORT); +} + +int B_login(int argc,char *argv[],Shbltin_t *context) +{ + struct checkpt *pp; + register struct login *logp=0; + register Shell_t *shp; + const char *pname; + if(argc) + shp = context->shp; + else + { + logp = (struct login*)context; + shp = logp->sh; + } + pp = (struct checkpt*)shp->jmplist; + if(sh_isoption(SH_RESTRICTED)) + errormsg(SH_DICT,ERROR_exit(1),e_restricted,argv[0]); + else + { + register struct argnod *arg=shp->envlist; + register Namval_t* np; + register char *cp; + if(shp->subshell && !shp->subshare) + sh_subfork(); + if(logp && logp->clear) + { +#ifdef _ENV_H + env_close(shp->env); + shp->env = env_open((char**)0,3); +#else + nv_scan(shp->var_tree,noexport,0,NV_EXPORT,NV_EXPORT); +#endif + } + while(arg) + { + if((cp=strchr(arg->argval,'=')) && + (*cp=0,np=nv_search(arg->argval,shp->var_tree,0))) + { + nv_onattr(np,NV_EXPORT); + sh_envput(shp->env,np); + } + if(cp) + *cp = '='; + arg=arg->argnxt.ap; + } + pname = argv[0]; + if(logp && logp->arg0) + argv[0] = logp->arg0; +#ifdef JOBS + if(job_close(shp) < 0) + return(1); +#endif /* JOBS */ + /* force bad exec to terminate shell */ + pp->mode = SH_JMPEXIT; + sh_sigreset(2); + sh_freeup(shp); + path_exec(shp,pname,argv,NIL(struct argnod*)); + sh_done(shp,0); + } + return(1); +} + +int b_let(int argc,char *argv[],Shbltin_t *context) +{ + register int r; + register char *arg; + Shell_t *shp = context->shp; + NOT_USED(argc); + while (r = optget(argv,sh_optlet)) switch (r) + { + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + argv += opt_info.index; + if(error_info.errors || !*argv) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + while(arg= *argv++) + r = !sh_arith(shp,arg); + return(r); +} + +int b_eval(int argc,char *argv[], Shbltin_t *context) +{ + register int r; + register Shell_t *shp = context->shp; + NOT_USED(argc); + while (r = optget(argv,sh_opteval)) switch (r) + { + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s",opt_info.arg); + return(2); + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + argv += opt_info.index; + if(*argv && **argv) + { + sh_offstate(SH_MONITOR); + sh_eval(sh_sfeval(argv),0); + } + return(shp->exitval); +} + +int b_dot_cmd(register int n,char *argv[],Shbltin_t *context) +{ + register char *script; + register Namval_t *np; + register int jmpval; + register Shell_t *shp = context->shp; + struct sh_scoped savst, *prevscope = shp->st.self; + char *filename=0; + int fd; + struct dolnod *argsave=0, *saveargfor; + struct checkpt buff; + Sfio_t *iop=0; + short level; + while (n = optget(argv,sh_optdot)) switch (n) + { + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s",opt_info.arg); + return(2); + } + argv += opt_info.index; + script = *argv; + if(error_info.errors || !script) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + if(shp->dot_depth+1 > DOTMAX) + errormsg(SH_DICT,ERROR_exit(1),e_toodeep,script); + if(!(np=shp->posix_fun)) + { + /* check for KornShell style function first */ + np = nv_search(script,shp->fun_tree,0); + if(np && is_afunction(np) && !nv_isattr(np,NV_FPOSIX)) + { + if(!np->nvalue.ip) + { + path_search(shp,script,NIL(Pathcomp_t**),0); + if(np->nvalue.ip) + { + if(nv_isattr(np,NV_FPOSIX)) + np = 0; + } + else + errormsg(SH_DICT,ERROR_exit(1),e_found,script); + } + } + else + np = 0; + if(!np) + { + if((fd=path_open(shp,script,path_get(shp,script))) < 0) + errormsg(SH_DICT,ERROR_system(1),e_open,script); + filename = path_fullname(shp,stkptr(shp->stk,PATH_OFFSET)); + } + } + *prevscope = shp->st; + shp->st.lineno = np?((struct functnod*)nv_funtree(np))->functline:1; + shp->st.var_local = shp->st.save_tree = shp->var_tree; + if(filename) + { + shp->st.filename = filename; + shp->st.lineno = 1; + } + level = shp->fn_depth+shp->dot_depth+1; + nv_putval(SH_LEVELNOD,(char*)&level,NV_INT16); + shp->st.prevst = prevscope; + shp->st.self = &savst; + shp->topscope = (Shscope_t*)shp->st.self; + prevscope->save_tree = shp->var_tree; + if(np) + shp->st.filename = np->nvalue.rp->fname; + nv_putval(SH_PATHNAMENOD, shp->st.filename ,NV_NOFREE); + shp->posix_fun = 0; + if(np || argv[1]) + argsave = sh_argnew(shp,argv,&saveargfor); + sh_pushcontext(shp,&buff,SH_JMPDOT); + jmpval = sigsetjmp(buff.buff,0); + if(jmpval == 0) + { + shp->dot_depth++; + if(np) + sh_exec((Shnode_t*)(nv_funtree(np)),sh_isstate(SH_ERREXIT)); + else + { + char buff[IOBSIZE+1]; + iop = sfnew(NIL(Sfio_t*),buff,IOBSIZE,fd,SF_READ); + sh_offstate(SH_NOFORK); + sh_eval(iop,sh_isstate(SH_PROFILE)?SH_FUNEVAL:0); + } + } + sh_popcontext(shp,&buff); + if(!np) + free((void*)shp->st.filename); + shp->dot_depth--; + if((np || argv[1]) && jmpval!=SH_JMPSCRIPT) + sh_argreset(shp,argsave,saveargfor); + else + { + prevscope->dolc = shp->st.dolc; + prevscope->dolv = shp->st.dolv; + } + if (shp->st.self != &savst) + *shp->st.self = shp->st; + /* only restore the top Shscope_t portion for posix functions */ + memcpy((void*)&shp->st, (void*)prevscope, sizeof(Shscope_t)); + shp->topscope = (Shscope_t*)prevscope; + nv_putval(SH_PATHNAMENOD, shp->st.filename ,NV_NOFREE); + if(jmpval && jmpval!=SH_JMPFUN) + siglongjmp(*shp->jmplist,jmpval); + return(shp->exitval); +} + +/* + * null, true command + */ +int b_true(int argc,register char *argv[],Shbltin_t *context) +{ + NOT_USED(argc); + NOT_USED(argv[0]); + NOT_USED(context); + return(0); +} + +/* + * false command + */ +int b_false(int argc,register char *argv[], Shbltin_t *context) +{ + NOT_USED(argc); + NOT_USED(argv[0]); + NOT_USED(context); + return(1); +} + +int b_shift(register int n, register char *argv[], Shbltin_t *context) +{ + register char *arg; + register Shell_t *shp = context->shp; + while((n = optget(argv,sh_optshift))) switch(n) + { + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s",opt_info.arg); + return(2); + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + argv += opt_info.index; + n = ((arg= *argv)?(int)sh_arith(shp,arg):1); + if(n<0 || shp->st.dolcst.dolv += n; + shp->st.dolc -= n; + } + return(0); +} + +int b_wait(int n,register char *argv[],Shbltin_t *context) +{ + register Shell_t *shp = context->shp; + while((n = optget(argv,sh_optwait))) switch(n) + { + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s",opt_info.arg); + break; + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + argv += opt_info.index; + job_bwait(argv); + return(shp->exitval); +} + +#ifdef JOBS +# if 0 + /* for the dictionary generator */ + int b_fg(int n,char *argv[],Shbltin_t *context){} + int b_disown(int n,char *argv[],Shbltin_t *context){} +# endif +int b_bg(register int n,register char *argv[],Shbltin_t *context) +{ + register int flag = **argv; + register Shell_t *shp = context->shp; + register const char *optstr = sh_optbg; + if(*argv[0]=='f') + optstr = sh_optfg; + else if(*argv[0]=='d') + optstr = sh_optdisown; + while((n = optget(argv,optstr))) switch(n) + { + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s",opt_info.arg); + break; + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + argv += opt_info.index; + if(!sh_isoption(SH_MONITOR) || !job.jobcontrol) + { + if(sh_isstate(SH_INTERACTIVE)) + errormsg(SH_DICT,ERROR_exit(1),e_no_jctl); + return(1); + } + if(flag=='d' && *argv==0) + argv = (char**)0; + if(job_walk(sfstdout,job_switch,flag,argv)) + errormsg(SH_DICT,ERROR_exit(1),e_no_job); + return(shp->exitval); +} + +int b_jobs(register int n,char *argv[],Shbltin_t *context) +{ + register int flag = 0; + register Shell_t *shp = context->shp; + while((n = optget(argv,sh_optjobs))) switch(n) + { + case 'l': + flag = JOB_LFLAG; + break; + case 'n': + flag = JOB_NFLAG; + break; + case 'p': + flag = JOB_PFLAG; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s",opt_info.arg); + break; + } + argv += opt_info.index; + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + if(*argv==0) + argv = (char**)0; + if(job_walk(sfstdout,job_list,flag,argv)) + errormsg(SH_DICT,ERROR_exit(1),e_no_job); + job_wait((pid_t)0); + return(shp->exitval); +} +#endif + +#ifdef _cmd_universe +/* + * There are several universe styles that are masked by the getuniv(), + * setuniv() calls. + */ +int b_universe(int argc, char *argv[],Shbltin_t *context) +{ + register char *arg; + register int n; + NOT_USED(context); + while((n = optget(argv,sh_optuniverse))) switch(n) + { + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s",opt_info.arg); + break; + } + argv += opt_info.index; + argc -= opt_info.index; + if(error_info.errors || argc>1) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + if(arg = argv[0]) + { + if(!astconf("UNIVERSE",0,arg)) + errormsg(SH_DICT,ERROR_exit(1), e_badname,arg); + } + else + { + if(!(arg=astconf("UNIVERSE",0,0))) + errormsg(SH_DICT,ERROR_exit(1),e_nouniverse); + else + sfputr(sfstdout,arg,'\n'); + } + return(0); +} +#endif /* cmd_universe */ + +#if SHOPT_FS_3D +#if _UWIN +#include +#endif +# if 0 + /* for the dictionary generator */ + int b_vmap(int argc,char *argv[], Shbltin_t *context){} +# endif + int b_vpath(register int argc,char *argv[], Shbltin_t *context) + { + register int flag, n; + register const char *optstr; + register char *vend; + register Shell_t *shp = context->shp; + if(argv[0][1]=='p') + { + optstr = sh_optvpath; + flag = FS3D_VIEW; + } + else + { + optstr = sh_optvmap; + flag = FS3D_VERSION; + } + while(n = optget(argv, optstr)) switch(n) + { + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s",opt_info.arg); + break; + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); +#ifdef MS_3D + flag |= MS_3D; +#else + if(!shp->gd->lim.fs3d) + goto failed; +#endif + argv += opt_info.index; + argc -= opt_info.index; + switch(argc) + { + case 0: + case 1: + flag |= FS3D_GET; + if((n = mount(*argv,(char*)0,flag,0)) >= 0) + { + vend = stkalloc(shp->stk,++n); + n = mount(*argv,vend,flag|FS3D_SIZE(n),0); + } + if(n < 0) + goto failed; + if(argc==1) + { + sfprintf(sfstdout,"%s\n",vend); + break; + } + n = 0; + while(flag = *vend++) + { + if(flag==' ') + { + flag = e_sptbnl[n+1]; + n = !n; + } + sfputc(sfstdout,flag); + } + if(n) + sfputc(sfstdout,'\n'); + break; + default: + if((argc&1)) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + /*FALLTHROUGH*/ + case 2: + if(shp->subshell && !shp->subshare) + sh_subfork(); + for(n=0;n1)?e_cantset:e_cantget,(flag&FS3D_VIEW)?e_mapping:e_versions); + return(1); + } +#endif /* SHOPT_FS_3D */ + diff --git a/src/cmd/ksh93/bltins/mkservice.c b/src/cmd/ksh93/bltins/mkservice.c new file mode 100644 index 0000000..0cbba25 --- /dev/null +++ b/src/cmd/ksh93/bltins/mkservice.c @@ -0,0 +1,494 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * mkservice varname pathname + * eloop [-t timeout] + * Written by David Korn + * AT&T Labs + */ + +static const char mkservice_usage[] = +"[-?\n@(#)$Id: mkservice (AT&T Research) 2001-06-13 $\n]" +USAGE_LICENSE +"[+NAME? mkservice - create a shell server ]" +"[+DESCRIPTION?\bmkservice\b creates a tcp or udp server that is " + "implemented by shell functions.]" +"[+?The \aservice_path\a must be of the form \b/dev/tcp/localhost/\b\aportno\a " + "or \b/dev/udp/localhost/\b\aportno\a depending on whether the " + "\btcp\b or \budp\b protocol is used. \aportno\a is the port " + "number that the service will use.]" +"[+?The shell variable \avarname\a is associated with the service. This " + "variable can have subvariables that keeps the state of all " + "active connections. The functions \avarname\a\b.accept\b, " + "\avarname\a\b.action\b and \avarname\a\b.close\b implement the " + "service as follows:]{" + "[+accept?This function is invoked when a client tries to connect " + "to the service. It is called with an argument which " + "is the file descriptor number associated with the " + "accepted connection. If the function returns a non-zero " + "value, this connection will be closed.]" + "[+action?This function is invoked when there is data waiting " + "to be read from one of the active connections. It is " + "called with the file descriptor number that has data " + "to be read. If the function returns a non-zero " + "value, this connection will be closed.]" + "[+close?This function is invoked when the connection is closed.]" + "}" +"[+?If \avarname\a is unset, then all active connection, and the service " + "itself will be closed.]" +"" +"\n" +"\nvarname service_path\n" +"\n" +"[+EXIT STATUS?]{" + "[+0?Success.]" + "[+>0?An error occurred.]" +"}" +"[+SEE ALSO?\beloop\b(1)]" +; + + +static const char eloop_usage[] = +"[-?\n@(#)$Id: eloop (AT&T Research) 2001-06-13 $\n]" +USAGE_LICENSE +"[+NAME? eloop - process event loop]" +"[+DESCRIPTION?\beloop\b causes the shell to block waiting for events " + "to process. By default, \beloop\b does not return.]" +"[t]#[timeout?\atimeout\a is the number of milliseconds to wait " + "without receiving any events to process.]" +"\n" +"\n\n" +"\n" +"[+EXIT STATUS?If no timeout is specified, \beloop\b will not return " + "unless interrupted. Otherwise]{" + "[+0?The specified timeout interval occurred.]" + "[+>0?An error occurred.]" +"}" +"[+SEE ALSO?\bmkservice\b(1)]" +; + + +#include "defs.h" + +#include +#include +#include +#include +#include + +#define ACCEPT 0 +#define ACTION 1 +#define CLOSE 2 + +#ifndef O_SERVICE +# define O_SERVICE O_NOCTTY +#endif + +static const char* disctab[] = +{ + "accept", + "action", + "close", + 0 +}; + +typedef struct Service_s Service_t; + +struct Service_s +{ + Namfun_t fun; + short fd; + int refcount; + int (*acceptf)(Service_t*,int); + int (*actionf)(Service_t*,int,int); + int (*errorf)(Service_t*,int,const char*, ...); + void *context; + Namval_t* node; + Namval_t* disc[elementsof(disctab)-1]; +}; + +static short *file_list; +static Sfio_t **poll_list; +static Service_t **service_list; +static int npoll; +static int nready; +static int ready; +static int (*covered_fdnotify)(int, int); + +static int fdclose(Service_t *sp, register int fd) +{ + register int i; + service_list[fd] = 0; + if(sp->fd==fd) + sp->fd = -1; + for(i=0; i < npoll; i++) + { + if(file_list[i]==fd) + { + file_list[i] = file_list[npoll--]; + if(sp->actionf) + (*sp->actionf)(sp, fd, 1); + return(1); + } + } + return(0); +} + +static int fdnotify(int fd1, int fd2) +{ + Service_t *sp; + if (covered_fdnotify) + (*covered_fdnotify)(fd1, fd2); + if(fd2!=SH_FDCLOSE) + { + register int i; + service_list[fd2] = service_list[fd1]; + service_list[fd1] = 0; + for(i=0; i < npoll; i++) + { + if(file_list[i]==fd1) + { + file_list[i] = fd2; + return(0); + } + } + } + else if(sp = service_list[fd1]) + { + fdclose(sp,fd1); + if(--sp->refcount==0) + nv_unset(sp->node); + } + return(0); +} + +static void process_stream(Sfio_t* iop) +{ + int r=0, fd = sffileno(iop); + Service_t * sp = service_list[fd]; + if(fd==sp->fd) /* connection socket */ + { + struct sockaddr addr; + socklen_t addrlen = sizeof(addr); + fd = accept(fd, &addr, &addrlen); + service_list[fd] = sp; + sp->refcount++; + file_list[npoll++] = fd; + if(fd>=0) + { + if(sp->acceptf) + r = (*sp->acceptf)(sp,fd); + } + } + else if(sp->actionf) + { + service_list[fd] = 0; + r = (*sp->actionf)(sp, fd, 0); + service_list[fd] = sp; + if(r<0) + close(fd); + } +} + +static int waitnotify(int fd, long timeout, int rw) +{ + Sfio_t *special=0, **pstream; + register int i; + + if (fd >= 0) + special = sh_fd2sfio(fd); + while(1) + { + pstream = poll_list; + while(ready < nready) + process_stream(pstream[ready++]); + if(special) + *pstream++ = special; + for(i=0; i < npoll; i++) + { + if(service_list[file_list[i]]) + *pstream++ = sh_fd2sfio(file_list[i]); + } +#if 1 + for(i=0; i < pstream-poll_list; i++) + sfset(poll_list[i],SF_WRITE,0); +#endif + nready = ready = 0; + errno = 0; +#ifdef DEBUG + sfprintf(sfstderr,"before poll npoll=%d",pstream-poll_list); + for(i=0; i < pstream-poll_list; i++) + sfprintf(sfstderr," %d",sffileno(poll_list[i])); + sfputc(sfstderr,'\n'); +#endif + nready = sfpoll(poll_list,pstream-poll_list,timeout); +#ifdef DEBUG + sfprintf(sfstderr,"after poll nready=%d",nready); + for(i=0; i < nready; i++) + sfprintf(sfstderr," %d",sffileno(poll_list[i])); + sfputc(sfstderr,'\n'); +#endif +#if 1 + for(i=0; i < pstream-poll_list; i++) + sfset(poll_list[i],SF_WRITE,1); +#endif + if(nready<=0) + return(errno? -1: 0); + if(special && poll_list[0]==special) + { + ready = 1; + return(fd); + } + } +} + +static int service_init(void) +{ + file_list = newof(NULL,short,n,0); + poll_list = newof(NULL,Sfio_t*,n,0); + service_list = newof(NULL,Service_t*,n,0); + covered_fdnotify = sh_fdnotify(fdnotify); + sh_waitnotify(waitnotify); + return(1); +} + +void service_add(Service_t *sp) +{ + static int init; + if (!init) + init = service_init(); + service_list[sp->fd] = sp; + file_list[npoll++] = sp->fd; +} + +static int Accept(register Service_t *sp, int accept_fd) +{ + register Namval_t* nq = sp->disc[ACCEPT]; + int fd; + + fd = fcntl(accept_fd, F_DUPFD, 10); + if (fd >= 0) + { + close(accept_fd); + if (nq) + { + char* av[3]; + char buff[20]; + + av[1] = buff; + av[2] = 0; + sfsprintf(buff, sizeof(buff), "%d", fd); + if (sh_fun(nq, sp->node, av)) + { + close(fd); + return -1; + } + } + } + sfsync(NiL); + return fd; +} + +static int Action(Service_t *sp, int fd, int close) +{ + register Namval_t* nq; + int r=0; + + if(close) + nq = sp->disc[CLOSE]; + else + nq = sp->disc[ACTION]; + if (nq) + { + char* av[3]; + char buff[20]; + + av[1] = buff; + av[2] = 0; + sfsprintf(buff, sizeof(buff), "%d", fd); + r=sh_fun(nq, sp->node, av); + } + sfsync(NiL); + return r > 0 ? -1 : 1; +} + +static int Error(Service_t *sp, int level, const char* arg, ...) +{ + va_list ap; + + va_start(ap, arg); + if(sp->node) + nv_unset(sp->node); + free((void*)sp); + errorv(NiL, ERROR_exit(1), ap); + va_end(ap); + return 0; +} + +static char* setdisc(Namval_t* np, const char* event, Namval_t* action, Namfun_t* fp) +{ + register Service_t* sp = (Service_t*)fp; + register const char* cp; + register int i; + register int n = strlen(event) - 1; + register Namval_t* nq; + + for (i = 0; cp = disctab[i]; i++) + { + if (memcmp(event, cp, n)) + continue; + if (action == np) + action = sp->disc[i]; + else + { + if (nq = sp->disc[i]) + free((void*)nq); + if (action) + sp->disc[i] = action; + else + sp->disc[i] = 0; + } + return action ? (char*)action : ""; + } + /* try the next level */ + return nv_setdisc(np, event, action, fp); +} + +static void putval(Namval_t* np, const char* val, int flag, Namfun_t* fp) +{ + register Service_t* sp = (Service_t*)fp; + if (!val) + fp = nv_stack(np, NiL); + nv_putv(np, val, flag, fp); + if (!val) + { + register int i; + for(i=0; i< sh.lim.open_max; i++) + { + if(service_list[i]==sp) + { + close(i); + if(--sp->refcount<=0) + break; + } + } + free((void*)fp); + return; + } +} + +static const Namdisc_t servdisc = +{ + sizeof(Service_t), + putval, + 0, + 0, + setdisc +}; + +int b_mkservice(int argc, char** argv, Shbltin_t *context) +{ + register char* var; + register char* path; + register Namval_t* np; + register Service_t* sp; + register int fd; + + NOT_USED(argc); + NOT_USED(context); + for (;;) + { + switch (optget(argv, mkservice_usage)) + { + case 0: + break; + case ':': + error(2, opt_info.arg); + continue; + case '?': + error(ERROR_usage(2), opt_info.arg); + continue; + } + break; + } + argv += opt_info.index; + if (error_info.errors || !(var = *argv++) || !(path = *argv++) || *argv) + error(ERROR_usage(2), optusage(NiL)); + if (!(sp = newof(0, Service_t, 1, 0))) + error(ERROR_exit(1), "out of space"); + sp->acceptf = Accept; + sp->actionf = Action; + sp->errorf = Error; + sp->refcount = 1; + sp->context = context; + sp->node = 0; + sp->fun.disc = &servdisc; + if((fd = sh_open(path, O_SERVICE|O_RDWR))<=0) + { + free((void*)sp); + error(ERROR_exit(1), "%s: cannot start service", path); + } + if((sp->fd = fcntl(fd, F_DUPFD, 10))>=10) + close(fd); + else + sp->fd = fd; + np = nv_open(var,sh.var_tree,NV_ARRAY|NV_VARNAME|NV_NOASSIGN); + sp->node = np; + nv_putval(np, path, 0); + nv_stack(np, (Namfun_t*)sp); + service_add(sp); + return(0); +} + +int b_eloop(int argc, char** argv, Shbltin_t *context) +{ + register long timeout = -1; + NOT_USED(argc); + NOT_USED(context); + for (;;) + { + switch (optget(argv, eloop_usage)) + { + case 0: + break; + case 't': + timeout = opt_info.num; + continue; + case ':': + error(2, opt_info.arg); + continue; + case '?': + error(ERROR_usage(2), opt_info.arg); + continue; + } + break; + } + argv += opt_info.index; + if (error_info.errors || *argv) + error(ERROR_usage(2), optusage(NiL)); + while(1) + { + if(waitnotify(-1, timeout, 0)==0) + break; + sfprintf(sfstderr,"interrupted\n"); + } + return(errno != 0); +} diff --git a/src/cmd/ksh93/bltins/print.c b/src/cmd/ksh93/bltins/print.c new file mode 100644 index 0000000..011bccd --- /dev/null +++ b/src/cmd/ksh93/bltins/print.c @@ -0,0 +1,1058 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * echo [arg...] + * print [-nrps] [-f format] [-u filenum] [arg...] + * printf format [arg...] + * + * David Korn + * AT&T Labs + */ + +#include "defs.h" +#include +#include +#include "io.h" +#include "name.h" +#include "history.h" +#include "builtins.h" +#include "streval.h" +#include +#include + +union types_t +{ + unsigned char c; + short h; + int i; + long l; + Sflong_t ll; + Sfdouble_t ld; + double d; + float f; + char *s; + int *ip; + char **p; +}; + +struct printf +{ + Sffmt_t hdr; + int argsize; + int intvar; + char **nextarg; + char *lastarg; + char cescape; + char err; + Shell_t *sh; +}; + +static int extend(Sfio_t*,void*, Sffmt_t*); +static const char preformat[] = ""; +static char *genformat(char*); +static int fmtvecho(const char*, struct printf*); +static ssize_t fmtbase64(Sfio_t*, char*, int); + +struct print +{ + Shell_t *sh; + const char *options; + char raw; + char echon; +}; + +static char* nullarg[] = { 0, 0 }; + +#if !SHOPT_ECHOPRINT + int B_echo(int argc, char *argv[],Shbltin_t *context) + { + static char bsd_univ; + struct print prdata; + prdata.options = sh_optecho+5; + prdata.raw = prdata.echon = 0; + prdata.sh = context->shp; + NOT_USED(argc); + /* This mess is because /bin/echo on BSD is different */ + if(!prdata.sh->universe) + { + register char *universe; + if(universe=astconf("UNIVERSE",0,0)) + bsd_univ = (strcmp(universe,"ucb")==0); + prdata.sh->universe = 1; + } + if(!bsd_univ) + return(b_print(0,argv,(Shbltin_t*)&prdata)); + prdata.options = sh_optecho; + prdata.raw = 1; + while(argv[1] && *argv[1]=='-') + { + if(strcmp(argv[1],"-n")==0) + prdata.echon = 1; +#if !SHOPT_ECHOE + else if(strcmp(argv[1],"-e")==0) + prdata.raw = 0; + else if(strcmp(argv[1],"-ne")==0 || strcmp(argv[1],"-en")==0) + { + prdata.raw = 0; + prdata.echon = 1; + } +#endif /* SHOPT_ECHOE */ + else + break; + argv++; + } + return(b_print(0,argv,(Shbltin_t*)&prdata)); + } +#endif /* SHOPT_ECHOPRINT */ + +int b_printf(int argc, char *argv[],Shbltin_t *context) +{ + struct print prdata; + NOT_USED(argc); + memset(&prdata,0,sizeof(prdata)); + prdata.sh = context->shp; + prdata.options = sh_optprintf; + return(b_print(-1,argv,(Shbltin_t*)&prdata)); +} + +/* + * argc==0 when called from echo + * argc==-1 when called from printf + */ + +int b_print(int argc, char *argv[], Shbltin_t *context) +{ + register Sfio_t *outfile; + register int exitval=0,n, fd = 1; + register Shell_t *shp = context->shp; + const char *options, *msg = e_file+4; + char *format = 0; + int sflag = 0, nflag=0, rflag=0, vflag=0; + if(argc>0) + { + options = sh_optprint; + nflag = rflag = 0; + format = 0; + } + else + { + struct print *pp = (struct print*)context; + shp = pp->sh; + options = pp->options; + if(argc==0) + { + nflag = pp->echon; + rflag = pp->raw; + argv++; + goto skip; + } + } + while((n = optget(argv,options))) switch(n) + { + case 'n': + nflag++; + break; + case 'p': + fd = shp->coutpipe; + msg = e_query; + break; + case 'f': + format = opt_info.arg; + break; + case 's': + /* print to history file */ + if(!sh_histinit((void*)shp)) + errormsg(SH_DICT,ERROR_system(1),e_history); + fd = sffileno(shp->gd->hist_ptr->histfp); + sh_onstate(SH_HISTORY); + sflag++; + break; + case 'e': + rflag = 0; + break; + case 'r': + rflag = 1; + break; + case 'u': + fd = (int)strtol(opt_info.arg,&opt_info.arg,10); + if(*opt_info.arg) + fd = -1; + else if(!sh_iovalidfd(shp,fd)) + fd = -1; + else if(!(shp->inuse_bits&(1<gd->hist_ptr && fd==sffileno(shp->gd->hist_ptr->histfp)))) + + fd = -1; + break; + case 'v': + vflag='v'; + break; + case 'C': + vflag='C'; + break; + case ':': + /* The following is for backward compatibility */ +#if OPT_VERSION >= 19990123 + if(strcmp(opt_info.name,"-R")==0) +#else + if(strcmp(opt_info.option,"-R")==0) +#endif + { + rflag = 1; + if(error_info.errors==0) + { + argv += opt_info.index+1; + /* special case test for -Rn */ + if(strchr(argv[-1],'n')) + nflag++; + if(*argv && strcmp(*argv,"-n")==0) + { + + nflag++; + argv++; + } + goto skip2; + } + } + else + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + argv += opt_info.index; + if(error_info.errors || (argc<0 && !(format = *argv++))) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0)); + if(vflag && format) + errormsg(SH_DICT,ERROR_usage(2),"-%c and -f are mutually exclusive",vflag); +skip: + if(format) + format = genformat(format); + /* handle special case of '-' operand for print */ + if(argc>0 && *argv && strcmp(*argv,"-")==0 && strcmp(argv[-1],"--")) + argv++; +skip2: + if(fd < 0) + { + errno = EBADF; + n = 0; + } + else if(!(n=shp->fdstatus[fd])) + n = sh_iocheckfd(shp,fd); + if(!(n&IOWRITE)) + { + /* don't print error message for stdout for compatibility */ + if(fd==1) + return(1); + errormsg(SH_DICT,ERROR_system(1),msg); + } + if(!(outfile=shp->sftable[fd])) + { + sh_onstate(SH_NOTRACK); + n = SF_WRITE|((n&IOREAD)?SF_READ:0); + shp->sftable[fd] = outfile = sfnew(NIL(Sfio_t*),shp->outbuff,IOBSIZE,fd,n); + sh_offstate(SH_NOTRACK); + sfpool(outfile,shp->outpool,SF_WRITE); + } + /* turn off share to guarantee atomic writes for printf */ + n = sfset(outfile,SF_SHARE|SF_PUBLIC,0); + if(format) + { + /* printf style print */ + Sfio_t *pool; + struct printf pdata; + memset(&pdata, 0, sizeof(pdata)); + pdata.sh = shp; + pdata.hdr.version = SFIO_VERSION; + pdata.hdr.extf = extend; + pdata.nextarg = argv; + sh_offstate(SH_STOPOK); + pool=sfpool(sfstderr,NIL(Sfio_t*),SF_WRITE); + do + { + if(shp->trapnote&SH_SIGSET) + break; + pdata.hdr.form = format; + sfprintf(outfile,"%!",&pdata); + } while(*pdata.nextarg && pdata.nextarg!=argv); + if(pdata.nextarg == nullarg && pdata.argsize>0) + sfwrite(outfile,stakptr(staktell()),pdata.argsize); + if(sffileno(outfile)!=sffileno(sfstderr)) + sfsync(outfile); + sfpool(sfstderr,pool,SF_WRITE); + exitval = pdata.err; + } + else if(vflag) + { + while(*argv) + { + fmtbase64(outfile,*argv++,vflag=='C'); + if(!nflag) + sfputc(outfile,'\n'); + } + } + else + { + /* echo style print */ + if(nflag && !argv[0]) + sfsync((Sfio_t*)0); + else if(sh_echolist(shp,outfile,rflag,argv) && !nflag) + sfputc(outfile,'\n'); + } + if(sflag) + { + hist_flush(shp->gd->hist_ptr); + sh_offstate(SH_HISTORY); + } + else if(n&SF_SHARE) + { + sfset(outfile,SF_SHARE|SF_PUBLIC,1); + sfsync(outfile); + } + return(exitval); +} + +/* + * echo the argument list onto + * if is non-zero then \ is not a special character. + * returns 0 for \c otherwise 1. + */ + +int sh_echolist(Shell_t *shp,Sfio_t *outfile, int raw, char *argv[]) +{ + register char *cp; + register int n; + struct printf pdata; + pdata.cescape = 0; + pdata.err = 0; + while(!pdata.cescape && (cp= *argv++)) + { + if(!raw && (n=fmtvecho(cp,&pdata))>=0) + { + if(n) + sfwrite(outfile,stakptr(staktell()),n); + } + else + sfputr(outfile,cp,-1); + if(*argv) + sfputc(outfile,' '); + sh_sigcheck(shp); + } + return(!pdata.cescape); +} + +/* + * modified version of stresc for generating formats + */ +static char strformat(char *s) +{ + register char* t; + register int c; + char* b; + char* p; +#if SHOPT_MULTIBYTE && defined(FMT_EXP_WIDE) + int w; +#endif + + b = t = s; + for (;;) + { + switch (c = *s++) + { + case '\\': + if(*s==0) + break; +#if SHOPT_MULTIBYTE && defined(FMT_EXP_WIDE) + c = chrexp(s - 1, &p, &w, FMT_EXP_CHAR|FMT_EXP_LINE|FMT_EXP_WIDE); +#else + c = chresc(s - 1, &p); +#endif + s = p; +#if SHOPT_MULTIBYTE +#if defined(FMT_EXP_WIDE) + if(w) + { + t += mbwide() ? mbconv(t, c) : wc2utf8(t, c); + continue; + } +#else + if(c>UCHAR_MAX && mbwide()) + { + t += mbconv(t, c); + continue; + } +#endif /* FMT_EXP_WIDE */ +#endif /* SHOPT_MULTIBYTE */ + if(c=='%') + *t++ = '%'; + else if(c==0) + { + *t++ = '%'; + c = 'Z'; + } + break; + case 0: + *t = 0; + return(t - b); + } + *t++ = c; + } +} + + +static char *genformat(char *format) +{ + register char *fp; + stakseek(0); + stakputs(preformat); + stakputs(format); + fp = (char*)stakfreeze(1); + strformat(fp+sizeof(preformat)-1); + return(fp); +} + +static char *fmthtml(const char *string, int flags) +{ + register const char *cp = string; + register int c, offset = staktell(); + if(!(flags&SFFMT_ALTER)) + { + while(c= *(unsigned char*)cp++) + { +#if SHOPT_MULTIBYTE + register int s; + if((s=mbsize(cp-1)) > 1) + { + cp += (s-1); + continue; + } +#endif /* SHOPT_MULTIBYTE */ + if(c=='<') + stakputs("<"); + else if(c=='>') + stakputs(">"); + else if(c=='&') + stakputs("&"); + else if(c=='"') + stakputs("""); + else if(c=='\'') + stakputs("'"); + else if(c==' ') + stakputs(" "); + else if(!isprint(c) && c!='\n' && c!='\r') + sfprintf(stkstd,"&#%X;",CCMAPC(c,CC_NATIVE,CC_ASCII)); + else + stakputc(c); + } + } + else + { + while(c= *(unsigned char*)cp++) + { + if(strchr("!*'();@&+$,#[]<>~.\"{}|\\-`^% ",c) || (!isprint(c) && c!='\n' && c!='\r')) + sfprintf(stkstd,"%%%02X",CCMAPC(c,CC_NATIVE,CC_ASCII)); + else + stakputc(c); + } + } + stakputc(0); + return(stakptr(offset)); +} + +#if 1 +static ssize_t fmtbase64(Sfio_t *iop, char *string, int alt) +#else +static void *fmtbase64(char *string, ssize_t *sz, int alt) +#endif +{ + char *cp; + Sfdouble_t d; + ssize_t size; + Namval_t *np = nv_open(string, NiL, NV_VARNAME|NV_NOASSIGN|NV_NOADD); + Namarr_t *ap; + static union types_t number; + if(!np || nv_isnull(np)) + { + if(sh_isoption(SH_NOUNSET)) + errormsg(SH_DICT,ERROR_exit(1),e_notset,string); + return(0); + } + if(nv_isattr(np,NV_INTEGER)) + { + d = nv_getnum(np); + if(nv_isattr(np,NV_DOUBLE)) + { + if(nv_isattr(np,NV_LONG)) + { + size = sizeof(Sfdouble_t); + number.ld = d; + } + else if(nv_isattr(np,NV_SHORT)) + { + size = sizeof(float); + number.f = (float)d; + } + else + { + size = sizeof(double); + number.d = (double)d; + } + } + else + { + if(nv_isattr(np,NV_LONG)) + { + size = sizeof(Sflong_t); + number.ll = (Sflong_t)d; + } + else if(nv_isattr(np,NV_SHORT)) + { + size = sizeof(short); + number.h = (short)d; + } + else + { + size = sizeof(short); + number.i = (int)d; + } + } +#if 1 + return(sfwrite(iop, (void*)&number, size)); +#else + if(sz) + *sz = size; + return((void*)&number); +#endif + } + if(nv_isattr(np,NV_BINARY)) +#if 1 + { + Namfun_t *fp; + for(fp=np->nvfun; fp;fp=fp->next) + { + if(fp->disc && fp->disc->writef) + break; + } + if(fp) + return (*fp->disc->writef)(np, iop, 0, fp); + else + { + int n = nv_size(np); + if(nv_isarray(np)) + { + nv_onattr(np,NV_RAW); + cp = nv_getval(np); + nv_offattr(np,NV_RAW); + } + else + cp = (char*)np->nvalue.cp; + if((size = n)==0) + size = strlen(cp); + size = sfwrite(iop, cp, size); + return(n?n:size); + } + } + else if(nv_isarray(np) && (ap=nv_arrayptr(np)) && array_elem(ap) && (ap->nelem&(ARRAY_UNDEF|ARRAY_SCAN))) + { + nv_outnode(np,iop,(alt?-1:0),0); + sfputc(iop,')'); + return(sftell(iop)); + } + else + { + if(alt && nv_isvtree(np)) + nv_onattr(np,NV_EXPORT); + else + alt = 0; + cp = nv_getval(np); + if(alt) + nv_offattr(np,NV_EXPORT); + if(!cp) + return(0); + size = strlen(cp); + return(sfwrite(iop,cp,size)); + } +#else + nv_onattr(np,NV_RAW); + cp = nv_getval(np); + if(nv_isattr(np,NV_BINARY)) + nv_offattr(np,NV_RAW); + if((size = nv_size(np))==0) + size = strlen(cp); + if(sz) + *sz = size; + return((void*)cp); +#endif +} + +static int varname(const char *str, int n) +{ + register int c,dot=1,len=1; + if(n < 0) + { + if(*str=='.') + str++; + n = strlen(str); + } + for(;n > 0; n-=len) + { +#ifdef SHOPT_MULTIBYTE + len = mbsize(str); + c = mbchar(str); +#else + c = *(unsigned char*)str++; +#endif + if(dot && !(isalpha(c)||c=='_')) + break; + else if(dot==0 && !(isalnum(c) || c=='_' || c == '.')) + break; + dot = (c=='.'); + } + return(n==0); +} + +static int extend(Sfio_t* sp, void* v, Sffmt_t* fe) +{ + char* lastchar = ""; + register int neg = 0; + Sfdouble_t d; + Sfdouble_t longmin = LDBL_LLONG_MIN; + Sfdouble_t longmax = LDBL_LLONG_MAX; + int format = fe->fmt; + int n; + int fold = fe->base; + union types_t* value = (union types_t*)v; + struct printf* pp = (struct printf*)fe; + Shell_t *shp = pp->sh; + register char* argp = *pp->nextarg; + char *w,*s; + + if(fe->n_str>0 && varname(fe->t_str,fe->n_str) && (!argp || varname(argp,-1))) + { + if(argp) + pp->lastarg = argp; + else + argp = pp->lastarg; + if(argp) + { + sfprintf(pp->sh->strbuf,"%s.%.*s%c",argp,fe->n_str,fe->t_str,0); + argp = sfstruse(pp->sh->strbuf); + } + } + else + pp->lastarg = 0; + fe->flags |= SFFMT_VALUE; + if(!argp || format=='Z') + { + switch(format) + { + case 'c': + value->c = 0; + fe->flags &= ~SFFMT_LONG; + break; + case 'q': + format = 's'; + /* FALL THROUGH */ + case 's': + case 'H': + case 'B': + case 'P': + case 'R': + case 'Z': + case 'b': + fe->fmt = 's'; + fe->size = -1; + fe->base = -1; + value->s = ""; + fe->flags &= ~SFFMT_LONG; + break; + case 'a': + case 'e': + case 'f': + case 'g': + case 'A': + case 'E': + case 'F': + case 'G': + if(SFFMT_LDOUBLE) + value->ld = 0.; + else + value->d = 0.; + break; + case 'n': + value->ip = &pp->intvar; + break; + case 'Q': + value->ll = 0; + break; + case 'T': + fe->fmt = 'd'; + value->ll = tmxgettime(); + break; + default: + if(!strchr("DdXxoUu",format)) + errormsg(SH_DICT,ERROR_exit(1),e_formspec,format); + fe->fmt = 'd'; + value->ll = 0; + break; + } + } + else + { + switch(format) + { + case 'p': + value->p = (char**)strtol(argp,&lastchar,10); + break; + case 'n': + { + Namval_t *np; + np = nv_open(argp,shp->var_tree,NV_VARNAME|NV_NOASSIGN|NV_NOARRAY); + _nv_unset(np,0); + nv_onattr(np,NV_INTEGER); + if (np->nvalue.lp = new_of(int32_t,0)) + *np->nvalue.lp = 0; + nv_setsize(np,10); + if(sizeof(int)==sizeof(int32_t)) + value->ip = (int*)np->nvalue.lp; + else + { + int32_t sl = 1; + value->ip = (int*)(((char*)np->nvalue.lp) + (*((char*)&sl) ? 0 : sizeof(int))); + } + nv_close(np); + break; + } + case 'q': + case 'b': + case 's': + case 'B': + case 'H': + case 'P': + case 'R': + fe->fmt = 's'; + fe->size = -1; + if(format=='s' && fe->base>=0) + { + value->p = pp->nextarg; + pp->nextarg = nullarg; + } + else + { + fe->base = -1; + value->s = argp; + } + fe->flags &= ~SFFMT_LONG; + break; + case 'c': + if(mbwide() && (n = mbsize(argp)) > 1) + { + fe->fmt = 's'; + fe->size = n; + value->s = argp; + } + else if(fe->base >=0) + value->s = argp; + else + value->c = *argp; + fe->flags &= ~SFFMT_LONG; + break; + case 'o': + case 'x': + case 'X': + case 'u': + case 'U': + longmax = LDBL_ULLONG_MAX; + case '.': + if(fe->size==2 && strchr("bcsqHPRQTZ",*fe->form)) + { + value->ll = ((unsigned char*)argp)[0]; + break; + } + case 'd': + case 'D': + case 'i': + switch(*argp) + { + case '\'': + case '"': + w = argp + 1; + if(mbwide() && mbsize(w) > 1) + value->ll = mbchar(w); + else + value->ll = *(unsigned char*)w++; + if(w[0] && (w[0] != argp[0] || w[1])) + { + errormsg(SH_DICT,ERROR_warn(0),e_charconst,argp); + pp->err = 1; + } + break; + default: + d = sh_strnum(argp,&lastchar,0); + if(derr = 1; + d = longmin; + } + else if(d>longmax) + { + errormsg(SH_DICT,ERROR_warn(0),e_overflow,argp); + pp->err = 1; + d = longmax; + } + value->ll = (Sflong_t)d; + if(lastchar == *pp->nextarg) + { + value->ll = *argp; + lastchar = ""; + } + break; + } + if(neg) + value->ll = -value->ll; + fe->size = sizeof(value->ll); + break; + case 'a': + case 'e': + case 'f': + case 'g': + case 'A': + case 'E': + case 'F': + case 'G': + d = sh_strnum(*pp->nextarg,&lastchar,0); + switch(*argp) + { + case '\'': + case '"': + d = ((unsigned char*)argp)[1]; + if(argp[2] && (argp[2] != argp[0] || argp[3])) + { + errormsg(SH_DICT,ERROR_warn(0),e_charconst,argp); + pp->err = 1; + } + break; + default: + d = sh_strnum(*pp->nextarg,&lastchar,0); + break; + } + if(SFFMT_LDOUBLE) + { + value->ld = d; + fe->size = sizeof(value->ld); + } + else + { + value->d = d; + fe->size = sizeof(value->d); + } + break; + case 'Q': + value->ll = (Sflong_t)strelapsed(*pp->nextarg,&lastchar,1); + break; + case 'T': + value->ll = (Sflong_t)tmxdate(*pp->nextarg,&lastchar,TMX_NOW); + break; + default: + value->ll = 0; + fe->fmt = 'd'; + fe->size = sizeof(value->ll); + errormsg(SH_DICT,ERROR_exit(1),e_formspec,format); + break; + } + if (format == '.') + value->i = value->ll; + if(*lastchar) + { + errormsg(SH_DICT,ERROR_warn(0),e_argtype,format); + pp->err = 1; + } + pp->nextarg++; + } + switch(format) + { + case 'Z': + fe->fmt = 'c'; + fe->base = -1; + value->c = 0; + break; + case 'b': + if((n=fmtvecho(value->s,pp))>=0) + { + if(pp->nextarg == nullarg) + { + pp->argsize = n; + return -1; + } + value->s = stakptr(staktell()); + fe->size = n; + } + break; + case 'B': + if(!shp->strbuf2) + shp->strbuf2 = sfstropen(); + fe->size = fmtbase64(shp->strbuf2,value->s, fe->flags&SFFMT_ALTER); + value->s = sfstruse(shp->strbuf2); + fe->flags |= SFFMT_SHORT; + break; + case 'H': + value->s = fmthtml(value->s, fe->flags); + break; + case 'q': + value->s = sh_fmtqf(value->s, !!(fe->flags & SFFMT_ALTER), fold); + break; + case 'P': + s = fmtmatch(value->s); + if(!s || *s==0) + errormsg(SH_DICT,ERROR_exit(1),e_badregexp,value->s); + value->s = s; + break; + case 'R': + s = fmtre(value->s); + if(!s || *s==0) + errormsg(SH_DICT,ERROR_exit(1),e_badregexp,value->s); + value->s = s; + break; + case 'Q': + if (fe->n_str>0) + { + fe->fmt = 'd'; + fe->size = sizeof(value->ll); + } + else + { + value->s = fmtelapsed(value->ll, 1); + fe->fmt = 's'; + fe->size = -1; + } + break; + case 'T': + if(fe->n_str>0) + { + n = fe->t_str[fe->n_str]; + fe->t_str[fe->n_str] = 0; + value->s = fmttmx(fe->t_str, value->ll); + fe->t_str[fe->n_str] = n; + } + else value->s = fmttmx(NIL(char*), value->ll); + fe->fmt = 's'; + fe->size = -1; + break; + } + return 0; +} + +/* + * construct System V echo string out of + * If there are not escape sequences, returns -1 + * Otherwise, puts null terminated result on stack, but doesn't freeze it + * returns length of output. + */ + +static int fmtvecho(const char *string, struct printf *pp) +{ + register const char *cp = string, *cpmax; + register int c; + register int offset = staktell(); +#if SHOPT_MULTIBYTE + int chlen; + if(mbwide()) + { + while(1) + { + if ((chlen = mbsize(cp)) > 1) + /* Skip over multibyte characters */ + cp += chlen; + else if((c= *cp++)==0 || c == '\\') + break; + } + } + else +#endif /* SHOPT_MULTIBYTE */ + while((c= *cp++) && (c!='\\')); + if(c==0) + return(-1); + c = --cp - string; + if(c>0) + stakwrite((void*)string,c); + for(; c= *cp; cp++) + { +#if SHOPT_MULTIBYTE + if (mbwide() && ((chlen = mbsize(cp)) > 1)) + { + stakwrite(cp,chlen); + cp += (chlen-1); + continue; + } +#endif /* SHOPT_MULTIBYTE */ + if( c=='\\') switch(*++cp) + { + case 'E': + c = ('a'==97?'\033':39); /* ASCII/EBCDIC */ + break; + case 'a': + c = '\a'; + break; + case 'b': + c = '\b'; + break; + case 'c': + pp->cescape++; + pp->nextarg = nullarg; + goto done; + case 'f': + c = '\f'; + break; + case 'n': + c = '\n'; + break; + case 'r': + c = '\r'; + break; + case 'v': + c = '\v'; + break; + case 't': + c = '\t'; + break; + case '\\': + c = '\\'; + break; + case '0': + c = 0; + cpmax = cp + 4; + while(++cp='0' && *cp<='7') + { + c <<= 3; + c |= (*cp-'0'); + } + default: + cp--; + } + stakputc(c); + } +done: + c = staktell()-offset; + stakputc(0); + stakseek(offset); + return(c); +} diff --git a/src/cmd/ksh93/bltins/read.c b/src/cmd/ksh93/bltins/read.c new file mode 100644 index 0000000..75fc478 --- /dev/null +++ b/src/cmd/ksh93/bltins/read.c @@ -0,0 +1,802 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * read [-ACprs] [-d delim] [-u filenum] [-t timeout] [-n n] [-N n] [name...] + * + * David Korn + * AT&T Labs + * + */ + +#include +#include +#include "defs.h" +#include "variables.h" +#include "lexstates.h" +#include "io.h" +#include "name.h" +#include "builtins.h" +#include "history.h" +#include "terminal.h" +#include "edit.h" + +#define R_FLAG 1 /* raw mode */ +#define S_FLAG 2 /* save in history file */ +#define A_FLAG 4 /* read into array */ +#define N_FLAG 8 /* fixed size read at most */ +#define NN_FLAG 0x10 /* fixed size read exact */ +#define V_FLAG 0x20 /* use default value */ +#define C_FLAG 0x40 /* read into compound variable */ +#define D_FLAG 8 /* must be number of bits for all flags */ +#define SS_FLAG 0x80 /* read .csv format file */ + +struct read_save +{ + char **argv; + char *prompt; + short fd; + short plen; + int flags; + long timeout; +}; + +int b_read(int argc,char *argv[], Shbltin_t *context) +{ + Sfdouble_t sec; + register char *name; + register int r, flags=0, fd=0; + register Shell_t *shp = context->shp; + long timeout = 1000*shp->st.tmout; + int save_prompt, fixargs=context->invariant; + struct read_save *rp; + static char default_prompt[3] = {ESC,ESC}; + rp = (struct read_save*)(context->data); + if(argc==0) + { + if(rp) + free((void*)rp); + return(0); + } + if(rp) + { + flags = rp->flags; + timeout = rp->timeout; + fd = rp->fd; + argv = rp->argv; + name = rp->prompt; + r = rp->plen; + goto bypass; + } + while((r = optget(argv,sh_optread))) switch(r) + { + case 'A': + flags |= A_FLAG; + break; + case 'C': + flags |= C_FLAG; + break; + case 't': + sec = sh_strnum(opt_info.arg, (char**)0,1); + timeout = sec ? 1000*sec : 1; + break; + case 'd': + if(opt_info.arg && *opt_info.arg!='\n') + { + char *cp = opt_info.arg; + flags &= ~((1<cpipe[0])<=0) + errormsg(SH_DICT,ERROR_exit(1),e_query); + break; + case 'n': case 'N': + flags &= ((1< (1<<((8*sizeof(int))-D_FLAG))-1) + errormsg(SH_DICT,ERROR_exit(1),e_overlimit,opt_info.name); + flags |= (r<< D_FLAG); + break; + case 'r': + flags |= R_FLAG; + break; + case 's': + /* save in history file */ + flags |= S_FLAG; + break; + case 'S': + flags |= SS_FLAG; + break; + case 'u': + fd = (int)opt_info.num; + if(sh_inuse(shp,fd)) + fd = -1; + break; + case 'v': + flags |= V_FLAG; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + argv += opt_info.index; + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2), "%s", optusage((char*)0)); + if(!((r=shp->fdstatus[fd])&IOREAD) || !(r&(IOSEEK|IONOSEEK))) + r = sh_iocheckfd(shp,fd); + if(fd<0 || !(r&IOREAD)) + errormsg(SH_DICT,ERROR_system(1),e_file+4); + /* look for prompt */ + if((name = *argv) && (name=strchr(name,'?')) && (r&IOTTY)) + r = strlen(name++); + else + r = 0; + if(argc==fixargs && (rp=newof(NIL(struct read_save*),struct read_save,1,0))) + { + context->data = (void*)rp; + rp->fd = fd; + rp->flags = flags; + rp->timeout = timeout; + rp->argv = argv; + rp->prompt = name; + rp->plen = r; + } +bypass: + shp->prompt = default_prompt; + if(r && (shp->prompt=(char*)sfreserve(sfstderr,r,SF_LOCKR))) + { + memcpy(shp->prompt,name,r); + sfwrite(sfstderr,shp->prompt,r-1); + } + shp->timeout = 0; + save_prompt = shp->nextprompt; + shp->nextprompt = 0; + r=sh_readline(shp,argv,fd,flags,timeout); + shp->nextprompt = save_prompt; + if(r==0 && (r=(sfeof(shp->sftable[fd])||sferror(shp->sftable[fd])))) + { + if(fd == shp->cpipe[0] && errno!=EINTR) + sh_pclose(shp->cpipe); + } + return(r); +} + +/* + * here for read timeout + */ +static void timedout(void *handle) +{ + sfclrlock((Sfio_t*)handle); + sh_exit(1); +} + +/* + * This is the code to read a line and to split it into tokens + * is an array of variable names + * is the file descriptor + * is union of -A, -r, -s, and contains delimiter if not '\n' + * is number of milli-seconds until timeout + */ + +int sh_readline(register Shell_t *shp,char **names, int fd, int flags,long timeout) +{ + register ssize_t c; + register unsigned char *cp; + register Namval_t *np; + register char *name, *val; + register Sfio_t *iop; + Namfun_t *nfp; + char *ifs; + unsigned char *cpmax; + unsigned char *del; + char was_escape = 0; + char use_stak = 0; + volatile char was_write = 0; + volatile char was_share = 1; + int rel, wrd, keytrap; + long array_index = 0; + void *timeslot=0; + int delim = '\n'; + int jmpval=0; + ssize_t size = 0; + int binary; + int oflags=NV_ASSIGN|NV_VARNAME; + char inquote = 0; + struct checkpt buff; + Edit_t *ep = (struct edit*)shp->gd->ed_context; + if(!(iop=shp->sftable[fd]) && !(iop=sh_iostream(shp,fd))) + return(1); + sh_stats(STAT_READS); + if(names && (name = *names)) + { + Namval_t *mp; + if(val= strchr(name,'?')) + *val = 0; + if(flags&C_FLAG) + oflags |= NV_ARRAY; + np = nv_open(name,shp->var_tree,oflags); + if(np && nv_isarray(np) && (mp=nv_opensub(np))) + np = mp; + if((flags&V_FLAG) && shp->gd->ed_context) + ((struct edit*)shp->gd->ed_context)->e_default = np; + if(flags&A_FLAG) + { + flags &= ~A_FLAG; + array_index = 1; + nv_unset(np); + nv_putsub(np,NIL(char*),0L); + } + else if(flags&C_FLAG) + { + char *sp = np->nvenv; + delim = -1; + nv_unset(np); + if(!nv_isattr(np,NV_MINIMAL)) + np->nvenv = sp; + nv_setvtree(np); + } + else + name = *++names; + if(val) + *val = '?'; + } + else + { + name = 0; + if(dtvnext(shp->var_tree) || shp->namespace) + np = nv_open(nv_name(REPLYNOD),shp->var_tree,0); + else + np = REPLYNOD; + } + keytrap = ep?ep->e_keytrap:0; + if(flags>>D_FLAG) /* delimiter not new-line or fixed size read */ + { + if(flags&(N_FLAG|NN_FLAG)) + size = ((unsigned)flags)>>D_FLAG; + else + delim = ((unsigned)flags)>>D_FLAG; + if((shp->fdstatus[fd]&IOTTY) && !keytrap) + tty_raw(fd,1); + } + binary = nv_isattr(np,NV_BINARY); + if(!binary && !(flags&(N_FLAG|NN_FLAG))) + { + Namval_t *mp; + /* set up state table based on IFS */ + ifs = nv_getval(mp=sh_scoped(shp,IFSNOD)); + if((flags&R_FLAG) && shp->ifstable['\\']==S_ESC) + shp->ifstable['\\'] = 0; + else if(!(flags&R_FLAG) && shp->ifstable['\\']==0) + shp->ifstable['\\'] = S_ESC; + if(delim>0) + shp->ifstable[delim] = S_NL; + if(delim!='\n') + { + shp->ifstable['\n'] = 0; + nv_putval(mp, ifs, NV_RDONLY); + } + shp->ifstable[0] = S_EOF; + if((flags&SS_FLAG)) + { + shp->ifstable['"'] = S_QUOTE; + shp->ifstable['\r'] = S_ERR; + } + } + sfclrerr(iop); + for(nfp=np->nvfun; nfp; nfp = nfp->next) + { + if(nfp->disc && nfp->disc->readf) + { + Namval_t *mp = nv_open(name,shp->var_tree,oflags|NV_NOREF); + if((c=(*nfp->disc->readf)(mp,iop,delim,nfp))>=0) + return(c); + } + } + if(binary && !(flags&(N_FLAG|NN_FLAG))) + { + flags |= NN_FLAG; + size = nv_size(np); + } + was_write = (sfset(iop,SF_WRITE,0)&SF_WRITE)!=0; + if(fd==0) + was_share = (sfset(iop,SF_SHARE,shp->redir0!=2)&SF_SHARE)!=0; + if(timeout || (shp->fdstatus[fd]&(IOTTY|IONOSEEK))) + { + sh_pushcontext(shp,&buff,1); + jmpval = sigsetjmp(buff.buff,0); + if(jmpval) + goto done; + if(timeout) + timeslot = (void*)sh_timeradd(timeout,0,timedout,(void*)iop); + } + if(flags&(N_FLAG|NN_FLAG)) + { + char buf[256],*var=buf,*cur,*end,*up,*v; + /* reserved buffer */ + if((c=size)>=sizeof(buf)) + { + if(!(var = (char*)malloc(c+1))) + sh_exit(1); + end = var + c; + } + else + end = var + sizeof(buf) - 1; + up = cur = var; + if((sfset(iop,SF_SHARE,1)&SF_SHARE) && fd!=0) + was_share = 1; + if(size==0) + { + cp = sfreserve(iop,0,0); + c = 0; + } + else + { + ssize_t m; + int f; + for (;;) + { + c = size; + if(keytrap) + { + cp = 0; + f = 0; + m = 0; + while(c-->0 && (buf[m]=ed_getchar(ep,0))) + m++; + if(m>0) + cp = (unsigned char*)buf; + } + else + { + f = 1; + if(cp = sfreserve(iop,c,SF_LOCKR)) + m = sfvalue(iop); + else if(flags&NN_FLAG) + { + c = size; + m = (cp = sfreserve(iop,c,0)) ? sfvalue(iop) : 0; + f = 0; + } + else + { + c = sfvalue(iop); + m = (cp = sfreserve(iop,c,SF_LOCKR)) ? sfvalue(iop) : 0; + } + } + if(m>0 && (flags&N_FLAG) && !binary && (v=memchr(cp,'\n',m))) + { + *v++ = 0; + m = v-(char*)cp; + } + if((c=m)>size) + c = size; + if(c>0) + { + if(c > (end-cur)) + { + ssize_t cx = cur - var, ux = up - var; + m = (end - var) + (c - (end - cur)); + if (var == buf) + { + v = (char*)malloc(m+1); + var = memcpy(v, var, cur - var); + } + else + var = newof(var, char, m, 1); + end = var + m; + cur = var + cx; + up = var + ux; + } + if(cur!=(char*)cp) + memcpy((void*)cur,cp,c); + if(f) + sfread(iop,cp,c); + cur += c; +#if SHOPT_MULTIBYTE + if(!binary && mbwide()) + { + int x; + int z; + + mbinit(); + *cur = 0; + x = z = 0; + while (up < cur && (z = mbsize(up)) > 0) + { + up += z; + x++; + } + if((size -= x) > 0 && (up >= cur || z < 0) && ((flags & NN_FLAG) || z < 0 || m > c)) + continue; + } +#endif + } +#if SHOPT_MULTIBYTE + if(!binary && mbwide() && (up == var || (flags & NN_FLAG) && size)) + cur = var; +#endif + *cur = 0; + if(c>=size || (flags&N_FLAG) || m==0) + { + if(m) + sfclrerr(iop); + break; + } + size -= c; + } + } + if(timeslot) + timerdel(timeslot); + if(binary && !((size=nv_size(np)) && nv_isarray(np) && c!=size)) + { + if((c==size) && np->nvalue.cp && !nv_isarray(np)) + memcpy((char*)np->nvalue.cp,var,c); + else + { + Namval_t *mp; + if(var==buf) + var = memdup(var,c+1); + nv_putval(np,var,NV_RAW); + nv_setsize(np,c); + if(!nv_isattr(np,NV_IMPORT|NV_EXPORT) && (mp=(Namval_t*)np->nvenv)) + nv_setsize(mp,c); + } + } + else + { + nv_putval(np,var,0); + if(var!=buf) + free((void*)var); + } + goto done; + } + else if(cp = (unsigned char*)sfgetr(iop,delim,0)) + c = sfvalue(iop); + else if(cp = (unsigned char*)sfgetr(iop,delim,-1)) + { + c = sfvalue(iop)+1; + if(!sferror(iop) && sfgetc(iop) >=0) + errormsg(SH_DICT,ERROR_exit(1),e_overlimit,"line length"); + } + if(timeslot) + timerdel(timeslot); + if((flags&S_FLAG) && !shp->gd->hist_ptr) + { + sh_histinit((void*)shp); + if(!shp->gd->hist_ptr) + flags &= ~S_FLAG; + } + if(cp) + { + cpmax = cp + c; +#if SHOPT_CRNL + if(delim=='\n' && c>=2 && cpmax[-2]=='\r') + cpmax--; +#endif /* SHOPT_CRNL */ + if(*(cpmax-1) != delim) + *(cpmax-1) = delim; + if(flags&S_FLAG) + sfwrite(shp->gd->hist_ptr->histfp,(char*)cp,c); + c = shp->ifstable[*cp++]; +#if !SHOPT_MULTIBYTE + if(!name && (flags&R_FLAG)) /* special case single argument */ + { + /* skip over leading blanks */ + while(c==S_SPACE) + c = shp->ifstable[*cp++]; + /* strip trailing delimiters */ + if(cpmax[-1] == '\n') + cpmax--; + if(cpmax>cp) + { + while((c=shp->ifstable[*--cpmax])==S_DELIM || c==S_SPACE); + cpmax[1] = 0; + } + else + *cpmax =0; + if(nv_isattr(np, NV_RDONLY)) + { + errormsg(SH_DICT,ERROR_warn(0),e_readonly, nv_name(np)); + jmpval = 1; + } + else + nv_putval(np,(char*)cp-1,0); + goto done; + } +#endif /* !SHOPT_MULTIBYTE */ + } + else + c = S_NL; + shp->nextprompt = 2; + rel= staktell(); + /* val==0 at the start of a field */ + val = 0; + del = 0; + while(1) + { + switch(c) + { +#if SHOPT_MULTIBYTE + case S_MBYTE: + if(val==0) + val = (char*)(cp-1); + if(sh_strchr(ifs,(char*)cp-1)>=0) + { + c = mbsize((char*)cp-1); + if(name) + cp[-1] = 0; + if(c>1) + cp += (c-1); + c = S_DELIM; + } + else + c = 0; + continue; +#endif /*SHOPT_MULTIBYTE */ + case S_QUOTE: + c = shp->ifstable[*cp++]; + inquote = !inquote; + goto skip; + case S_ESC: + /* process escape character */ + if((c = shp->ifstable[*cp++]) == S_NL) + was_escape = 1; + else + c = 0; + skip: + if(val) + { + stakputs(val); + use_stak = 1; + *val = 0; + } + continue; + + case S_ERR: + cp++; + case S_EOF: + /* check for end of buffer */ + if(val && *val) + { + stakputs(val); + use_stak = 1; + } + val = 0; + if(cp>=cpmax) + { + c = S_NL; + break; + } + /* eliminate null bytes */ + c = shp->ifstable[*cp++]; + if(!name && val && (c==S_SPACE||c==S_DELIM||c==S_MBYTE)) + c = 0; + continue; + case S_NL: + if(was_escape) + { + was_escape = 0; + if(cp = (unsigned char*)sfgetr(iop,delim,0)) + c = sfvalue(iop); + else if(cp=(unsigned char*)sfgetr(iop,delim,-1)) + c = sfvalue(iop)+1; + if(cp) + { + if(flags&S_FLAG) + sfwrite(shp->gd->hist_ptr->histfp,(char*)cp,c); + cpmax = cp + c; + c = shp->ifstable[*cp++]; + val=0; + if(!name && (c==S_SPACE || c==S_DELIM || c==S_MBYTE)) + c = 0; + continue; + } + } + c = S_NL; + break; + + case S_SPACE: + /* skip over blanks */ + while((c=shp->ifstable[*cp++])==S_SPACE); + if(!val) + continue; +#if SHOPT_MULTIBYTE + if(c==S_MBYTE) + { + if(sh_strchr(ifs,(char*)cp-1)>=0) + { + if((c = mbsize((char*)cp-1))>1) + cp += (c-1); + c = S_DELIM; + } + else + c = 0; + } +#endif /* SHOPT_MULTIBYTE */ + if(c!=S_DELIM) + break; + /* FALL THRU */ + + case S_DELIM: + if(!del) + del = cp - 1; + if(name) + { + /* skip over trailing blanks */ + while((c=shp->ifstable[*cp++])==S_SPACE); + break; + } + /* FALL THRU */ + + case 0: + if(val==0 || was_escape) + { + val = (char*)(cp-1); + was_escape = 0; + } + /* skip over word characters */ + wrd = -1; + while(1) + { + while((c=shp->ifstable[*cp++])==0) + if(!wrd) + wrd = 1; + if(inquote) + { + if(c==S_QUOTE) + { + if(shp->ifstable[*cp]==S_QUOTE) + { + if(val) + { + stakwrite(val,cp-(unsigned char*)val); + use_stak = 1; + } + val = (char*)++cp; + } + else + break; + } + if(c && c!=S_EOF) + { + if(c==S_NL) + { + if(val) + { + stakwrite(val,cp-(unsigned char*)val); + use_stak=1; + } + if(cp = (unsigned char*)sfgetr(iop,delim,0)) + c = sfvalue(iop); + else if(cp = (unsigned char*)sfgetr(iop,delim,-1)) + c = sfvalue(iop)+1; + val = (char*)cp; + } + continue; + } + } + if(!del&&c==S_DELIM) + del = cp - 1; + if(name || c==S_NL || c==S_ESC || c==S_EOF || c==S_MBYTE) + break; + if(wrd<0) + wrd = 0; + } + if(wrd>0) + del = (unsigned char*)""; + if(c!=S_MBYTE) + cp[-1] = 0; + continue; + } + /* assign value and advance to next variable */ + if(!val) + val = ""; + if(use_stak) + { + stakputs(val); + stakputc(0); + val = stakptr(rel); + } + if(!name && *val) + { + /* strip off trailing space delimiters */ + register unsigned char *vp = (unsigned char*)val + strlen(val); + while(shp->ifstable[*--vp]==S_SPACE); + if(vp==del) + { + if(vp==(unsigned char*)val) + vp--; + else + while(shp->ifstable[*--vp]==S_SPACE); + } + vp[1] = 0; + } + if(nv_isattr(np, NV_RDONLY)) + { + errormsg(SH_DICT,ERROR_warn(0),e_readonly, nv_name(np)); + jmpval = 1; + } + else + nv_putval(np,val,0); + val = 0; + del = 0; + if(use_stak) + { + stakseek(rel); + use_stak = 0; + } + if(array_index) + { + nv_putsub(np, NIL(char*), array_index++); + if(c!=S_NL) + continue; + name = *++names; + } + while(1) + { + if(sh_isoption(SH_ALLEXPORT)&&!strchr(nv_name(np),'.') && !nv_isattr(np,NV_EXPORT)) + { + nv_onattr(np,NV_EXPORT); + sh_envput(shp->env,np); + } + if(name) + { + nv_close(np); + np = nv_open(name,shp->var_tree,NV_NOASSIGN|NV_VARNAME); + name = *++names; + } + else + np = 0; + if(c!=S_NL) + break; + if(!np) + goto done; + if(nv_isattr(np, NV_RDONLY)) + { + errormsg(SH_DICT,ERROR_warn(0),e_readonly, nv_name(np)); + jmpval = 1; + } + else + nv_putval(np, "", 0); + } + } +done: + if(timeout || (shp->fdstatus[fd]&(IOTTY|IONOSEEK))) + sh_popcontext(shp,&buff); + if(was_write) + sfset(iop,SF_WRITE,1); + if(!was_share) + sfset(iop,SF_SHARE,0); + nv_close(np); + if((shp->fdstatus[fd]&IOTTY) && !keytrap) + tty_cooked(fd); + if(flags&S_FLAG) + hist_flush(shp->gd->hist_ptr); + if(jmpval > 1) + siglongjmp(*shp->jmplist,jmpval); + return(jmpval); +} + diff --git a/src/cmd/ksh93/bltins/regress.c b/src/cmd/ksh93/bltins/regress.c new file mode 100644 index 0000000..25f3c25 --- /dev/null +++ b/src/cmd/ksh93/bltins/regress.c @@ -0,0 +1,343 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * regression test intercept control + * enable with SHOPT_REGRESS==1 in Makefile + * not for production use + * see --man for details + * all string constants inline here instead of in data/... + * + * David Korn + * at&t research + */ + +#include "defs.h" + +#if SHOPT_REGRESS + +#include +#include +#include "io.h" +#include "builtins.h" +#include + +#define REGRESS_HEADER "ksh:REGRESS:" + +#define TRACE(r,i,f) sh_regress(REGRESS_##r, i, sfprints f, __LINE__, __FILE__) + +static const char usage[] = +"[-1p0?\n@(#)$Id: __regress__ (AT&T Research) 2009-03-29 $\n]" +USAGE_LICENSE +"[+NAME?__regress__ - shell regression test intercept control]" +"[+DESCRIPTION?\b__regress__\b controls the regression test intercepts " + "for shells compiled with SHOPT_REGRESS==1. Shells compiled this way are " + "for testing only. In addition to \b__regress__\b and the \b--regress\b " + "command line option, these shells may contain system library function " + "intercepts that behave different from the native counterparts.]" +"[+?Each option controls a different test and possibly a different set " + "of intercepts. The options are interpreted \bdd\b(1) style -- '-' or " + "'--' prefix not required. This simplifies the specification of the " + "command line \b--regress\b=\avalue\a option, where \avalue\a is passed " + "as an option to the \b__regress__\b builtin. Typically regression test " + "intercepts are enabled with one or more command line \b--regress\b " + "options, with optional specific calls to \b__regress__\b in test " + "scripts to enable/disable intercepts as the test progresses.]" +"[+?Each enabled intercept may result in trace lines of the form \b" REGRESS_HEADER + "\aoption\a:\aintercept\a:\ainfo\a on the standard error, where " + "\aoption\a is one of the options below, \aintercept\a is the name of " + "the specific intercept for \aoption\a, and \ainfo\a is \aoption\a " + "specific information. Unless noted otherwise, one regression test trace " + "line is produced each time an enabled intercept is called.]" +"[101:egid?The intercept effective gid is set to \aoriginal-egid\a. The " + "effective gid of the underlying system process is not affected. The " + "trace line info is either \begid==rgid\b or \begid!=rgid\b. The " + "intercepts are:]#?[original-egid:=1]" + "{" + "[+getegid()?The intercept effecive gid is returned. The " + "\bsetgid\b() intercept may change this between the real gid and " + "\aoriginal-egid\a.]" + "[+setgid(gid)?Sets the intercept effective gid to \agid\a. " + "Fails if \agid\a is neither the real gid nor " + "\aoriginal-egid\a.]" + "}" +"[102:euid?The intercept effective uid is set to \aoriginal-euid\a. The " + "effective uid of the underlying system process is not affected. The " + "trace line info is either \beuid==ruid\b or \beuid!=ruid\b. The " + "intercepts are:]#?[original-euid:=1]" + "{" + "[+geteuid()?The intercept effecive uid is returned. The " + "\bsetuid\b() intercept may change this between the real uid and " + "\aoriginal-euid\a.]" + "[+setuid(uid)?Sets the intercept effective uid to \auid\a. " + "Fails if \auid\a is neither the real uid nor " + "\aoriginal-euid\a.]" + "}" +"[103:p_suid?Specifies a value for SHOPT_P_SUID. Effective uids greater " + "than the non-privileged-uid disable the priveleged mode. The intercepts " + "are:]#?[non-privileged-uid:=1]" + "{" + "[+SHOPT_P_SUID?The SHOPT_P_SUID macro value is overridden by " + "\bp_suid\b. A trace line is output for each SHOPT_P_SUID " + "access.]" + "}" +"[104:source?The intercepts are:]" + "{" + "[+sh_source()?The trace line info is the path of the script " + "being sourced. Used to trace shell startup scripts.]" + "}" +"[105:etc?Map file paths matching \b/etc/\b* to \aetc-dir\a/*. The " + "intercepts are:]:[etc-dir:=/etc]" + "{" + "[+sh_open()?Paths matching \b/etc/\b* are changed to " + "\aetc-dir\a/*.]" + "}" +"[+SEE ALSO?\bksh\b(1), \bregress\b(1), \brt\b(1)]" +; + +static const char* regress_options[] = +{ + "ERROR", + "egid", + "euid", + "p_suid", + "source", + "etc", +}; + +void sh_regress_init(Shell_t* shp) +{ + static Regress_t state; + + shp->regress = &state; +} + +/* + * regress info trace output + */ + +void sh_regress(unsigned int index, const char* intercept, const char* info, unsigned int line, const char* file) +{ + char* name; + char buf[16]; + + if (index >= 1 && index <= elementsof(regress_options)) + name = (char*)regress_options[index]; + else + sfsprintf(name = buf, sizeof(buf), "%u", index); + sfprintf(sfstderr, REGRESS_HEADER "%s:%s:%s\n", name, intercept, fmtesc(info)); +} + +/* + * egid intercepts + */ + +static gid_t intercept_sgid = 0; +static gid_t intercept_egid = -1; +static gid_t intercept_rgid = -1; + +gid_t getegid(void) +{ + if (intercept_rgid == -1) + intercept_rgid = getgid(); + if (sh_isregress(REGRESS_egid)) + { + TRACE(egid, "getegid", ("%s", intercept_egid == intercept_rgid ? "egid==rgid" : "egid!=rgid")); + return intercept_egid; + } + return intercept_rgid; +} + +int setgid(gid_t gid) +{ + if (intercept_rgid == -1) + intercept_rgid = getgid(); + if (sh_isregress(REGRESS_egid)) + { + if (gid != intercept_rgid && gid != intercept_sgid) + { + TRACE(egid, "setgid", ("%s", "EPERM")); + errno = EPERM; + return -1; + } + intercept_egid = gid; + TRACE(egid, "setgid", ("%s", intercept_egid == intercept_rgid ? "egid==rgid" : "egid!=rgid")); + } + else if (gid != intercept_rgid) + { + errno = EPERM; + return -1; + } + return 0; +} + +/* + * euid intercepts + */ + +static uid_t intercept_suid = 0; +static uid_t intercept_euid = -1; +static uid_t intercept_ruid = -1; + +uid_t geteuid(void) +{ + if (intercept_ruid == -1) + intercept_ruid = getuid(); + if (sh_isregress(REGRESS_euid)) + { + TRACE(euid, "geteuid", ("%s", intercept_euid == intercept_ruid ? "euid==ruid" : "euid!=ruid")); + return intercept_euid; + } + return intercept_ruid; +} + +int setuid(uid_t uid) +{ + if (intercept_ruid == -1) + intercept_ruid = getuid(); + if (sh_isregress(REGRESS_euid)) + { + if (uid != intercept_ruid && uid != intercept_suid) + { + TRACE(euid, "setuid", ("%s", "EPERM")); + errno = EPERM; + return -1; + } + intercept_euid = uid; + TRACE(euid, "setuid", ("%s", intercept_euid == intercept_ruid ? "euid==ruid" : "euid!=ruid")); + } + else if (uid != intercept_ruid) + { + errno = EPERM; + return -1; + } + return 0; +} + +/* + * p_suid intercept + */ + +static uid_t intercept_p_suid = 0x7fffffff; + +uid_t sh_regress_p_suid(unsigned int line, const char* file) +{ + REGRESS(p_suid, "SHOPT_P_SUID", ("%d", intercept_p_suid)); + return intercept_p_suid; +} + +/* + * p_suid intercept + */ + +static char* intercept_etc = 0; + +char* sh_regress_etc(const char* path, unsigned int line, const char* file) +{ + REGRESS(etc, "sh_open", ("%s => %s%s", path, intercept_etc, path+4)); + return intercept_etc; +} + +/* + * __regress__ builtin + */ + +int b___regress__(int argc, char** argv, Shbltin_t *context) +{ + register Shell_t* shp = context->shp; + int n; + + for (;;) + { + switch (n = optget(argv, usage)) + { + case '?': + errormsg(SH_DICT, ERROR_usage(2), "%s", opt_info.arg); + break; + case ':': + errormsg(SH_DICT, 2, "%s", opt_info.arg); + break; + case 0: + break; + default: + if (n < -100) + { + n = -(n + 100); + if (opt_info.arg || opt_info.number) + sh_onregress(n); + else + sh_offregress(n); + switch (n) + { + case REGRESS_egid: + if (sh_isregress(n)) + { + intercept_egid = intercept_sgid = (gid_t)opt_info.number; + TRACE(egid, argv[0], ("%d", intercept_egid)); + } + else + TRACE(egid, argv[0], ("%s", "off")); + break; + case REGRESS_euid: + if (sh_isregress(n)) + { + intercept_euid = intercept_suid = (uid_t)opt_info.number; + TRACE(euid, argv[0], ("%d", intercept_euid)); + } + else + TRACE(euid, argv[0], ("%s", "off")); + break; + case REGRESS_p_suid: + if (sh_isregress(n)) + { + intercept_p_suid = (uid_t)opt_info.number; + TRACE(p_suid, argv[0], ("%d", intercept_p_suid)); + } + else + TRACE(p_suid, argv[0], ("%s", "off")); + break; + case REGRESS_source: + TRACE(source, argv[0], ("%s", sh_isregress(n) ? "on" : "off")); + break; + case REGRESS_etc: + if (sh_isregress(n)) + { + intercept_etc = opt_info.arg; + TRACE(etc, argv[0], ("%s", intercept_etc)); + } + else + TRACE(etc, argv[0], ("%s", "off")); + break; + } + } + continue; + } + break; + } + if (error_info.errors || *(argv + opt_info.index)) + errormsg(SH_DICT, ERROR_usage(2), "%s", optusage(NiL)); + return 0; +} + +#else + +NoN(regress) + +#endif diff --git a/src/cmd/ksh93/bltins/sleep.c b/src/cmd/ksh93/bltins/sleep.c new file mode 100644 index 0000000..ca9d055 --- /dev/null +++ b/src/cmd/ksh93/bltins/sleep.c @@ -0,0 +1,235 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * sleep delay + * + * David Korn + * AT&T Labs + * + */ + +#define sleep ______sleep +#include "defs.h" +#undef sleep +#include +#include +#include +#include "builtins.h" +#include "FEATURE/time" +#include "FEATURE/poll" +#ifdef _NEXT_SOURCE +# define sleep _ast_sleep +#endif /* _NEXT_SOURCE */ +#ifdef _lib_poll_notimer +# undef _lib_poll +#endif /* _lib_poll_notimer */ + +int b_sleep(register int argc,char *argv[],Shbltin_t *context) +{ + register char *cp; + register double d=0; + register Shell_t *shp = context->shp; + int sflag=0; + time_t tloc = 0; + char *last; + if(!(shp->sigflag[SIGALRM]&(SH_SIGFAULT|SH_SIGOFF))) + sh_sigtrap(SIGALRM); + while((argc = optget(argv,sh_optsleep))) switch(argc) + { + case 's': + sflag=1; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + argv += opt_info.index; + if(cp = *argv) + { + d = strtod(cp, &last); + if(*last) + { + Time_t now,ns; + char* pp; + now = TMX_NOW; + if(*cp == 'P' || *cp == 'p') + ns = tmxdate(cp, &last, now); + else if(*last=='.' && shp->decomma && d==(unsigned long)d) + { + *(pp=last) = ','; + if(!strchr(cp,'.')) + d = strtod(cp,&last); + *pp = '.'; + if(*last==0) + goto skip; + } + else if(*last!='.' && *last!=',') + { + if(pp = sfprints("exact %s", cp)) + ns = tmxdate(pp, &last, now); + if(*last && (pp = sfprints("p%s", cp))) + ns = tmxdate(pp, &last, now); + } + if(*last) + errormsg(SH_DICT,ERROR_exit(1),e_number,*argv); + d = ns - now; + d /= TMX_RESOLUTION; + } +skip: + if(argv[1]) + errormsg(SH_DICT,ERROR_exit(1),e_oneoperand); + } + else if(!sflag) + errormsg(SH_DICT,ERROR_exit(1),e_oneoperand); + if(d > .10) + { + time(&tloc); + tloc += (time_t)(d+.5); + } + if(sflag && d==0) + pause(); + else while(1) + { + time_t now; + errno = 0; + shp->lastsig=0; + sh_delay(d); + if(sflag || tloc==0 || errno!=EINTR || shp->lastsig) + break; + sh_sigcheck(shp); + if(tloc < (now=time(NIL(time_t*)))) + break; + d = (double)(tloc-now); + if(shp->sigflag[SIGALRM]&SH_SIGTRAP) + sh_timetraps(shp); + } + return(0); +} + +static void completed(void * handle) +{ + char *expired = (char*)handle; + *expired = 1; +} + +unsigned int sleep(unsigned int sec) +{ + Shell_t *shp = sh_getinterp(); + pid_t newpid, curpid=getpid(); + void *tp; + char expired = 0; + shp->lastsig = 0; + tp = (void*)sh_timeradd(1000*sec, 0, completed, (void*)&expired); + do + { + if(!shp->gd->waitevent || (*shp->gd->waitevent)(-1,-1L,0)==0) + pause(); + if(shp->sigflag[SIGALRM]&SH_SIGTRAP) + sh_timetraps(shp); + if((newpid=getpid()) != curpid) + { + curpid = newpid; + shp->lastsig = 0; + shp->trapnote &= ~SH_SIGSET; + if(expired) + expired = 0; + else + timerdel(tp); + tp = (void*)sh_timeradd(1000*sec, 0, completed, (void*)&expired); + } + } + while(!expired && shp->lastsig==0); + if(!expired) + timerdel(tp); + sh_sigcheck(shp); + return(0); +} + +/* + * delay execution for time + */ + +void sh_delay(double t) +{ + register int n = (int)t; + Shell_t *shp = sh_getinterp(); +#ifdef _lib_poll + struct pollfd fd; + if(t<=0) + return; + else if(n > 30) + { + sleep(n); + t -= n; + } + if(n=(int)(1000*t)) + { + if(!shp->gd->waitevent || (*shp->gd->waitevent)(-1,(long)n,0)==0) + poll(&fd,0,n); + } +#else +# if defined(_lib_select) && defined(_mem_tv_usec_timeval) + struct timeval timeloc; + if(t<=0) + return; + if(n=(int)(1000*t) && shp->gd->waitevent && (*shp->gd->waitevent)(-1,(long)n,0)) + return; + n = (int)t; + timeloc.tv_sec = n; + timeloc.tv_usec = 1000000*(t-(double)n); + select(0,(fd_set*)0,(fd_set*)0,(fd_set*)0,&timeloc); +# else +# ifdef _lib_select + /* for 9th edition machines */ + if(t<=0) + return; + if(n > 30) + { + sleep(n); + t -= n; + } + if(n=(int)(1000*t)) + { + if(!shp->gd->waitevent || (*shp->gd->waitevent)(-1,(long)n,0)==0) + select(0,(fd_set*)0,(fd_set*)0,n); + } +# else + struct tms tt; + if(t<=0) + return; + sleep(n); + t -= n; + if(t) + { + clock_t begin = times(&tt); + if(begin==0) + return; + t *= shp->gd->lim.clk_tck; + n += (t+.5); + while((times(&tt)-begin) < n); + } +# endif +# endif +#endif /* _lib_poll */ +} diff --git a/src/cmd/ksh93/bltins/test.c b/src/cmd/ksh93/bltins/test.c new file mode 100644 index 0000000..52cb7cd --- /dev/null +++ b/src/cmd/ksh93/bltins/test.c @@ -0,0 +1,667 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * test expression + * [ expression ] + * + * David Korn + * AT&T Labs + * + */ + + +#include "defs.h" +#include +#include +#include "io.h" +#include "terminal.h" +#include "test.h" +#include "builtins.h" +#include "FEATURE/externs" +#include "FEATURE/poll" +#include + +#if !_lib_setregid +# undef _lib_setreuid +#endif /* _lib_setregid */ + +#ifdef S_ISSOCK +# if _pipe_socketpair +# if _socketpair_shutdown_mode +# define isapipe(f,p) (test_stat(f,p)>=0&&S_ISFIFO((p)->st_mode)||S_ISSOCK((p)->st_mode)&&(p)->st_ino&&((p)->st_mode&(S_IRUSR|S_IWUSR))!=(S_IRUSR|S_IWUSR)) +# else +# define isapipe(f,p) (test_stat(f,p)>=0&&S_ISFIFO((p)->st_mode)||S_ISSOCK((p)->st_mode)&&(p)->st_ino) +# endif +# else +# define isapipe(f,p) (test_stat(f,p)>=0&&S_ISFIFO((p)->st_mode)||S_ISSOCK((p)->st_mode)&&(p)->st_ino) +# endif +# define isasock(f,p) (test_stat(f,p)>=0&&S_ISSOCK((p)->st_mode)) +#else +# define isapipe(f,p) (test_stat(f,p)>=0&&S_ISFIFO((p)->st_mode)) +# define isasock(f,p) (0) +#endif + +#define permission(a,f) (sh_access(a,f)==0) +static time_t test_time(const char*, const char*); +static int test_stat(const char*, struct stat*); +static int test_mode(const char*); + +/* single char string compare */ +#define c_eq(a,c) (*a==c && *(a+1)==0) +/* two character string compare */ +#define c2_eq(a,c1,c2) (*a==c1 && *(a+1)==c2 && *(a+2)==0) + +struct test +{ + Shell_t *sh; + int ap; + int ac; + char **av; +}; + +static char *nxtarg(struct test*,int); +static int expr(struct test*,int); +static int e3(struct test*); + +static int test_strmatch(Shell_t *shp,const char *str, const char *pat) +{ + int match[2*(MATCH_MAX+1)],n; + register int c, m=0; + register const char *cp=pat; + while(c = *cp++) + { + if(c=='(') + m++; + if(c=='\\' && *cp) + cp++; + } + if(m) + m++; + else + match[0] = 0; + if(m > elementsof(match)/2) + m = elementsof(match)/2; + n = strgrpmatch(str, pat, match, m, STR_GROUP|STR_MAXIMAL|STR_LEFT|STR_RIGHT); + if(m==0 && n==1) + match[1] = strlen(str); + if(n) + sh_setmatch(shp, str, -1, n, match, 0); + return(n); +} + +int b_test(int argc, char *argv[],Shbltin_t *context) +{ + struct test tdata; + register char *cp = argv[0]; + register int not; + tdata.sh = context->shp; + tdata.av = argv; + tdata.ap = 1; + if(c_eq(cp,'[')) + { + cp = argv[--argc]; + if(!c_eq(cp, ']')) + errormsg(SH_DICT,ERROR_exit(2),e_missing,"']'"); + } + if(argc <= 1) + return(1); + cp = argv[1]; + if(c_eq(cp,'(') && argc<=6 && c_eq(argv[argc-1],')')) + { + /* special case ( binop ) to conform with standard */ + if(!(argc==4 && (not=sh_lookup(cp=argv[2],shtab_testops)))) + { + cp = (++argv)[1]; + argc -= 2; + } + } + not = c_eq(cp,'!'); + /* posix portion for test */ + switch(argc) + { + case 5: + if(!not) + break; + argv++; + /* fall through */ + case 4: + { + register int op = sh_lookup(cp=argv[2],shtab_testops); + if(op&TEST_BINOP) + break; + if(!op) + { + if(argc==5) + break; + if(not && cp[0]=='-' && cp[2]==0) + return(test_unop(tdata.sh,cp[1],argv[3])!=0); + else if(argv[1][0]=='-' && argv[1][2]==0) + return(!test_unop(tdata.sh,argv[1][1],cp)); + errormsg(SH_DICT,ERROR_exit(2),e_badop,cp); + } + return(test_binop(tdata.sh,op,argv[1],argv[3])^(argc!=5)); + } + case 3: + if(not) + return(*argv[2]!=0); + if(cp[0] != '-' || cp[2] || cp[1]=='?') + { + if(cp[0]=='-' && (cp[1]=='-' || cp[1]=='?') && + strcmp(argv[2],"--")==0) + { + char *av[3]; + av[0] = argv[0]; + av[1] = argv[1]; + av[2] = 0; + optget(av,sh_opttest); + errormsg(SH_DICT,ERROR_usage(2), "%s",opt_info.arg); + return(2); + } + break; + } + return(!test_unop(tdata.sh,cp[1],argv[2])); + case 2: + return(*cp==0); + } + tdata.ac = argc; + return(!expr(&tdata,0)); +} + +/* + * evaluate a test expression. + * flag is 0 on outer level + * flag is 1 when in parenthesis + * flag is 2 when evaluating -a + */ +static int expr(struct test *tp,register int flag) +{ + register int r; + register char *p; + r = e3(tp); + while(tp->ap < tp->ac) + { + p = nxtarg(tp,0); + /* check for -o and -a */ + if(flag && c_eq(p,')')) + { + tp->ap--; + break; + } + if(*p=='-' && *(p+2)==0) + { + if(*++p == 'o') + { + if(flag==2) + { + tp->ap--; + break; + } + r |= expr(tp,3); + continue; + } + else if(*p == 'a') + { + r &= expr(tp,2); + continue; + } + } + if(flag==0) + break; + errormsg(SH_DICT,ERROR_exit(2),e_badsyntax); + } + return(r); +} + +static char *nxtarg(struct test *tp,int mt) +{ + if(tp->ap >= tp->ac) + { + if(mt) + { + tp->ap++; + return(0); + } + errormsg(SH_DICT,ERROR_exit(2),e_argument); + } + return(tp->av[tp->ap++]); +} + + +static int e3(struct test *tp) +{ + register char *arg, *cp; + register int op; + char *binop; + arg=nxtarg(tp,0); + if(arg && c_eq(arg, '!')) + return(!e3(tp)); + if(c_eq(arg, '(')) + { + op = expr(tp,1); + cp = nxtarg(tp,0); + if(!cp || !c_eq(cp, ')')) + errormsg(SH_DICT,ERROR_exit(2),e_missing,"')'"); + return(op); + } + cp = nxtarg(tp,1); + if(cp!=0 && (c_eq(cp,'=') || c2_eq(cp,'!','='))) + goto skip; + if(c2_eq(arg,'-','t')) + { + if(cp) + { + op = strtol(cp,&binop, 10); + return(*binop?0:tty_check(op)); + } + else + { + /* test -t with no arguments */ + tp->ap--; + return(tty_check(1)); + } + } + if(*arg=='-' && arg[2]==0) + { + op = arg[1]; + if(!cp) + { + /* for backward compatibility with new flags */ + if(op==0 || !strchr(test_opchars+10,op)) + return(1); + errormsg(SH_DICT,ERROR_exit(2),e_argument); + } + if(strchr(test_opchars,op)) + return(test_unop(tp->sh,op,cp)); + } + if(!cp) + { + tp->ap--; + return(*arg!=0); + } +skip: + op = sh_lookup(binop=cp,shtab_testops); + if(!(op&TEST_BINOP)) + cp = nxtarg(tp,0); + if(!op) + errormsg(SH_DICT,ERROR_exit(2),e_badop,binop); + if(op==TEST_AND || op==TEST_OR) + tp->ap--; + return(test_binop(tp->sh,op,arg,cp)); +} + +int test_unop(Shell_t *shp,register int op,register const char *arg) +{ + struct stat statb; + int f; + switch(op) + { + case 'r': + return(permission(arg, R_OK)); + case 'w': + return(permission(arg, W_OK)); + case 'x': + return(permission(arg, X_OK)); + case 'V': +#if SHOPT_FS_3D + { + register int offset = staktell(); + if(stat(arg,&statb)<0 || !S_ISREG(statb.st_mode)) + return(0); + /* add trailing / */ + stakputs(arg); + stakputc('/'); + stakputc(0); + arg = (const char*)stakptr(offset); + stakseek(offset); + /* FALL THRU */ + } +#else + return(0); +#endif /* SHOPT_FS_3D */ + case 'd': + return(test_stat(arg,&statb)>=0 && S_ISDIR(statb.st_mode)); + case 'c': + return(test_stat(arg,&statb)>=0 && S_ISCHR(statb.st_mode)); + case 'b': + return(test_stat(arg,&statb)>=0 && S_ISBLK(statb.st_mode)); + case 'f': + return(test_stat(arg,&statb)>=0 && S_ISREG(statb.st_mode)); + case 'u': + return(test_mode(arg)&S_ISUID); + case 'g': + return(test_mode(arg)&S_ISGID); + case 'k': +#ifdef S_ISVTX + return(test_mode(arg)&S_ISVTX); +#else + return(0); +#endif /* S_ISVTX */ +#if SHOPT_TEST_L + case 'l': +#endif + case 'L': + case 'h': /* undocumented, and hopefully will disappear */ + if(*arg==0 || arg[strlen(arg)-1]=='/' || lstat(arg,&statb)<0) + return(0); + return(S_ISLNK(statb.st_mode)); + + case 'C': +#ifdef S_ISCTG + return(test_stat(arg,&statb)>=0 && S_ISCTG(statb.st_mode)); +#else + return(0); +#endif /* S_ISCTG */ + case 'H': +#ifdef S_ISCDF + { + register int offset = staktell(); + if(test_stat(arg,&statb)>=0 && S_ISCDF(statb.st_mode)) + return(1); + stakputs(arg); + stakputc('+'); + stakputc(0); + arg = (const char*)stakptr(offset); + stakseek(offset); + return(test_stat(arg,&statb)>=0 && S_ISCDF(statb.st_mode)); + } +#else + return(0); +#endif /* S_ISCDF */ + + case 'S': + return(isasock(arg,&statb)); + case 'N': + return(test_stat(arg,&statb)>=0 && tmxgetmtime(&statb) > tmxgetatime(&statb)); + case 'p': + return(isapipe(arg,&statb)); + case 'n': + return(*arg != 0); + case 'z': + return(*arg == 0); + case 's': + sfsync(sfstdout); + case 'O': + case 'G': + if(*arg==0 || test_stat(arg,&statb)<0) + return(0); + if(op=='s') + return(statb.st_size>0); + else if(op=='O') + return(statb.st_uid==shp->gd->userid); + return(statb.st_gid==shp->gd->groupid); + case 'a': + case 'e': + if(memcmp(arg,"/dev/",5)==0 && sh_open(arg,O_NONBLOCK)) + return(1); + return(permission(arg, F_OK)); + case 'o': + f=1; + if(*arg=='?') + return(sh_lookopt(arg+1,&f)>0); + op = sh_lookopt(arg,&f); + return(op && (f==(sh_isoption(op)!=0))); + case 't': + { + char *last; + op = strtol(arg,&last, 10); + return(*last?0:tty_check(op)); + } + case 'v': + case 'R': + { + Namval_t *np; + Namarr_t *ap; + int isref; + if(!(np = nv_open(arg,shp->var_tree,NV_VARNAME|NV_NOFAIL|NV_NOADD|NV_NOREF))) + return(0); + isref = nv_isref(np); + if(op=='R') + return(isref); + if(isref) + { + if(np->nvalue.cp) + np = nv_refnode(np); + else + return(0); + + } + if(ap = nv_arrayptr(np)) + return(nv_arrayisset(np,ap)); + return(!nv_isnull(np) || nv_isattr(np,NV_INTEGER)); + } + default: + { + static char a[3] = "-?"; + a[1]= op; + errormsg(SH_DICT,ERROR_exit(2),e_badop,a); + /* NOTREACHED */ + return(0); + } + } +} + +int test_binop(Shell_t *shp,register int op,const char *left,const char *right) +{ + register double lnum,rnum; + if(op&TEST_ARITH) + { + while(*left=='0') + left++; + while(*right=='0') + right++; + lnum = sh_arith(shp,left); + rnum = sh_arith(shp,right); + } + switch(op) + { + /* op must be one of the following values */ + case TEST_AND: + case TEST_OR: + return(*left!=0); + case TEST_PEQ: + return(test_strmatch(shp, left, right)); + case TEST_PNE: + return(!test_strmatch(shp, left, right)); + case TEST_SGT: + return(strcoll(left, right)>0); + case TEST_SLT: + return(strcoll(left, right)<0); + case TEST_SEQ: + return(strcmp(left, right)==0); + case TEST_SNE: + return(strcmp(left, right)!=0); + case TEST_EF: + return(test_inode(left,right)); + case TEST_NT: + return(test_time(left,right)>0); + case TEST_OT: + return(test_time(left,right)<0); + case TEST_EQ: + return(lnum==rnum); + case TEST_NE: + return(lnum!=rnum); + case TEST_GT: + return(lnum>rnum); + case TEST_LT: + return(lnum=rnum); + case TEST_LE: + return(lnum<=rnum); + } + /* NOTREACHED */ + return(0); +} + +/* + * returns the modification time of f1 - modification time of f2 + */ + +static time_t test_time(const char *file1,const char *file2) +{ + Time_t t1, t2; + struct stat statb1,statb2; + int r=test_stat(file2,&statb2); + if(test_stat(file1,&statb1)<0) + return(r<0?0:-1); + if(r<0) + return(1); + t1 = tmxgetmtime(&statb1); + t2 = tmxgetmtime(&statb2); + if (t1 > t2) + return(1); + if (t1 < t2) + return(-1); + return(0); +} + +/* + * return true if inode of two files are the same + */ + +int test_inode(const char *file1,const char *file2) +{ + struct stat stat1,stat2; + if(test_stat(file1,&stat1)>=0 && test_stat(file2,&stat2)>=0) + if(stat1.st_dev == stat2.st_dev && stat1.st_ino == stat2.st_ino) + return(1); + return(0); +} + + +/* + * This version of access checks against effective uid/gid + * The static buffer statb is shared with test_mode. + */ + +int sh_access(register const char *name, register int mode) +{ + Shell_t *shp = sh_getinterp(); + struct stat statb; + if(*name==0) + return(-1); + if(sh_isdevfd(name)) + return(sh_ioaccess((int)strtol(name+8, (char**)0, 10),mode)); + /* can't use access function for execute permission with root */ + if(mode==X_OK && shp->gd->euserid==0) + goto skip; + if(shp->gd->userid==shp->gd->euserid && shp->gd->groupid==shp->gd->egroupid) + return(access(name,mode)); +#ifdef _lib_setreuid + /* swap the real uid to effective, check access then restore */ + /* first swap real and effective gid, if different */ + if(shp->gd->groupid==shp->gd->euserid || setregid(shp->gd->egroupid,shp->gd->groupid)==0) + { + /* next swap real and effective uid, if needed */ + if(shp->gd->userid==shp->gd->euserid || setreuid(shp->gd->euserid,shp->gd->userid)==0) + { + mode = access(name,mode); + /* restore ids */ + if(shp->gd->userid!=shp->gd->euserid) + setreuid(shp->gd->userid,shp->gd->euserid); + if(shp->gd->groupid!=shp->gd->egroupid) + setregid(shp->gd->groupid,shp->gd->egroupid); + return(mode); + } + else if(shp->gd->groupid!=shp->gd->egroupid) + setregid(shp->gd->groupid,shp->gd->egroupid); + } +#endif /* _lib_setreuid */ +skip: + if(test_stat(name, &statb) == 0) + { + if(mode == F_OK) + return(mode); + else if(shp->gd->euserid == 0) + { + if(!S_ISREG(statb.st_mode) || mode!=X_OK) + return(0); + /* root needs execute permission for someone */ + mode = (S_IXUSR|S_IXGRP|S_IXOTH); + } + else if(shp->gd->euserid == statb.st_uid) + mode <<= 6; + else if(shp->gd->egroupid == statb.st_gid) + mode <<= 3; +#ifdef _lib_getgroups + /* on some systems you can be in several groups */ + else + { + static int maxgroups; + gid_t *groups; + register int n; + if(maxgroups==0) + { + /* first time */ + if((maxgroups=getgroups(0,(gid_t*)0)) <= 0) + { + /* pre-POSIX system */ + maxgroups=NGROUPS_MAX; + } + } + groups = (gid_t*)stakalloc((maxgroups+1)*sizeof(gid_t)); + n = getgroups(maxgroups,groups); + while(--n >= 0) + { + if(groups[n] == statb.st_gid) + { + mode <<= 3; + break; + } + } + } +# endif /* _lib_getgroups */ + if(statb.st_mode & mode) + return(0); + } + return(-1); +} + +/* + * Return the mode bits of file + * If is null, then the previous stat buffer is used. + * The mode bits are zero if the file doesn't exist. + */ + +static int test_mode(register const char *file) +{ + struct stat statb; + statb.st_mode = 0; + if(file && (*file==0 || test_stat(file,&statb)<0)) + return(0); + return(statb.st_mode); +} + +/* + * do an fstat() for /dev/fd/n, otherwise stat() + */ +static int test_stat(const char *name,struct stat *buff) +{ + if(*name==0) + { + errno = ENOENT; + return(-1); + } + if(sh_isdevfd(name)) + return(fstat((int)strtol(name+8, (char**)0, 10),buff)); + else + return(stat(name,buff)); +} diff --git a/src/cmd/ksh93/bltins/trap.c b/src/cmd/ksh93/bltins/trap.c new file mode 100644 index 0000000..f5dbedc --- /dev/null +++ b/src/cmd/ksh93/bltins/trap.c @@ -0,0 +1,420 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * trap [-p] action sig... + * kill [-l] [sig...] + * kill [-s sig] pid... + * + * David Korn + * AT&T Labs + * research!dgk + * + */ + +#include "defs.h" +#include "jobs.h" +#include "builtins.h" + +#define L_FLAG 1 +#define S_FLAG 2 + +static const char trapfmt[] = "trap -- %s %s\n"; + +static int sig_number(Shell_t*,const char*); +static void sig_list(Shell_t*,int); + +int b_trap(int argc,char *argv[],Shbltin_t *context) +{ + register char *arg = argv[1]; + register int sig, clear = 0, dflag = 0, pflag = 0; + register Shell_t *shp = context->shp; + NOT_USED(argc); + while (sig = optget(argv, sh_opttrap)) switch (sig) + { + case 'p': + pflag=1; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s", opt_info.arg); + return(2); + break; + } + argv += opt_info.index; + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s", optusage((char*)0)); + if(arg = *argv) + { + char *action = arg; + if(!dflag && !pflag) + { + /* first argument all digits or - means clear */ + while(isdigit(*arg)) + arg++; + clear = (arg!=action && *arg==0); + if(!clear) + { + ++argv; + if(*action=='-' && action[1]==0) + clear++; + /* + * NOTE: 2007-11-26: workaround for tests/signal.sh + * if function semantics can be worked out then it + * may merit a -d,--default option + */ + else if(*action=='+' && action[1]==0 && shp->st.self == &shp->global) + { + clear++; + dflag++; + } + } + if(!argv[0]) + errormsg(SH_DICT,ERROR_exit(1),e_condition); + } + while(arg = *argv++) + { + sig = sig_number(shp,arg); + if(sig<0) + { + errormsg(SH_DICT,2,e_trap,arg); + return(1); + } + /* internal traps */ + if(sig&SH_TRAP) + { + sig &= ~SH_TRAP; + if(sig>SH_DEBUGTRAP) + { + errormsg(SH_DICT,2,e_trap,arg); + return(1); + } + if(pflag) + { + if(arg=shp->st.trap[sig]) + sfputr(sfstdout,sh_fmtq(arg),'\n'); + continue; + } + if(shp->st.trap[sig]) + free(shp->st.trap[sig]); + shp->st.trap[sig] = 0; + if(!clear && *action) + shp->st.trap[sig] = strdup(action); + if(sig == SH_DEBUGTRAP) + { + if(shp->st.trap[sig]) + shp->trapnote |= SH_SIGTRAP; + else + shp->trapnote = 0; + } + continue; + } + if(sig>shp->gd->sigmax) + { + errormsg(SH_DICT,2,e_trap,arg); + return(1); + } + else if(pflag) + { + char **trapcom = (shp->st.otrapcom?shp->st.otrapcom:shp->st.trapcom); + if(arg=trapcom[sig]) + sfputr(sfstdout,arg,'\n'); + } + else if(clear) + { + sh_sigclear(sig); + if(dflag) + signal(sig,SIG_DFL); + } + else + { + if(sig >= shp->st.trapmax) + shp->st.trapmax = sig+1; + arg = shp->st.trapcom[sig]; + sh_sigtrap(sig); + shp->st.trapcom[sig] = (shp->sigflag[sig]&SH_SIGOFF) ? Empty : strdup(action); + if(arg && arg != Empty) + free(arg); + } + } + } + else /* print out current traps */ + sig_list(shp,-1); + return(0); +} + +int b_kill(int argc,char *argv[],Shbltin_t *context) +{ + register char *signame; + register int sig=SIGTERM, flag=0, n; + register Shell_t *shp = context->shp; + NOT_USED(argc); + while((n = optget(argv,sh_optkill))) switch(n) + { + case ':': + if((signame=argv[opt_info.index++]) && (sig=sig_number(shp,signame+1))>=0) + goto endopts; + opt_info.index--; + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case 'n': + sig = (int)opt_info.num; + goto endopts; + case 's': + flag |= S_FLAG; + signame = opt_info.arg; + goto endopts; + case 'l': + flag |= L_FLAG; + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } +endopts: + argv += opt_info.index; + if(*argv && strcmp(*argv,"--")==0 && strcmp(*(argv-1),"--")!=0) + argv++; + if(error_info.errors || flag==(L_FLAG|S_FLAG) || (!(*argv) && !(flag&L_FLAG))) + errormsg(SH_DICT,ERROR_usage(2),"%s", optusage((char*)0)); + /* just in case we send a kill -9 $$ */ + sfsync(sfstderr); + if(flag&L_FLAG) + { + if(!(*argv)) + sig_list(shp,0); + else while(signame = *argv++) + { + if(isdigit(*signame)) + sig_list(shp,((int)strtol(signame, (char**)0, 10)&0177)+1); + else + { + if((sig=sig_number(shp,signame))<0) + { + shp->exitval = 2; + errormsg(SH_DICT,ERROR_exit(1),e_nosignal,signame); + } + sfprintf(sfstdout,"%d\n",sig); + } + } + return(shp->exitval); + } + if(flag&S_FLAG) + { + if((sig=sig_number(shp,signame)) < 0 || sig > shp->gd->sigmax) + errormsg(SH_DICT,ERROR_exit(1),e_nosignal,signame); + } + if(job_walk(sfstdout,job_kill,sig,argv)) + shp->exitval = 1; + return(shp->exitval); +} + +/* + * Given the name or number of a signal return the signal number + */ + +static int sig_number(Shell_t *shp,const char *string) +{ + const Shtable_t *tp; + register int n,o,sig=0; + char *last, *name; + if(isdigit(*string)) + { + n = strtol(string,&last,10); + if(*last) + n = -1; + } + else + { + register int c; + o = staktell(); + do + { + c = *string++; + if(islower(c)) + c = toupper(c); + stakputc(c); + } + while(c); + stakseek(o); + if(memcmp(stakptr(o),"SIG",3)==0) + { + sig = 1; + o += 3; + if(isdigit(*stakptr(o))) + { + n = strtol(stakptr(o),&last,10); + if(!*last) + return(n); + } + } + tp = sh_locate(stakptr(o),(const Shtable_t*)shtab_signals,sizeof(*shtab_signals)); + n = tp->sh_number; + if(sig==1 && (n>=(SH_TRAP-1) && n < (1<sh_name)==0) + n = tp->sh_number; + } + if((n>>SH_SIGBITS)&SH_SIGRUNTIME) + n = shp->gd->sigruntime[(n&((1<gd->sigruntime[1] && (name=stakptr(o)) && *name++=='R' && *name++=='T') + { + if(name[0]=='M' && name[1]=='I' && name[2]=='N' && name[3]=='+') + { + if((sig=(int)strtol(name+4,&name,10)) >= 0 && !*name) + n = shp->gd->sigruntime[SH_SIGRTMIN] + sig; + } + else if(name[0]=='M' && name[1]=='A' && name[2]=='X' && name[3]=='-') + { + if((sig=(int)strtol(name+4,&name,10)) >= 0 && !*name) + n = shp->gd->sigruntime[SH_SIGRTMAX] - sig; + } + else if((sig=(int)strtol(name,&name,10)) > 0 && !*name) + n = shp->gd->sigruntime[SH_SIGRTMIN] + sig - 1; + if(ngd->sigruntime[SH_SIGRTMIN] || n>shp->gd->sigruntime[SH_SIGRTMAX]) + n = -1; + } + } + return(n); +} + +/* + * synthesize signal name for sig in buf + * pfx!=0 prepends SIG to default signal number + */ +static char* sig_name(Shell_t *shp,int sig, char* buf, int pfx) +{ + register int i; + + i = 0; + if(sig>shp->gd->sigruntime[SH_SIGRTMIN] && siggd->sigruntime[SH_SIGRTMAX]) + { + buf[i++] = 'R'; + buf[i++] = 'T'; + buf[i++] = 'M'; + if(sig>shp->gd->sigruntime[SH_SIGRTMIN]+(shp->gd->sigruntime[SH_SIGRTMAX]-shp->gd->sigruntime[SH_SIGRTMIN])/2) + { + buf[i++] = 'A'; + buf[i++] = 'X'; + buf[i++] = '-'; + sig = shp->gd->sigruntime[SH_SIGRTMAX]-sig; + } + else + { + buf[i++] = 'I'; + buf[i++] = 'N'; + buf[i++] = '+'; + sig = sig-shp->gd->sigruntime[SH_SIGRTMIN]; + } + } + else if(pfx) + { + buf[i++] = 'S'; + buf[i++] = 'I'; + buf[i++] = 'G'; + } + i += sfsprintf(buf+i, 8, "%d", sig); + buf[i] = 0; + return buf; +} + +/* + * if is positive, then print signal name corresponding to + * if is zero, then print all signal names + * if is negative, then print all traps + */ +static void sig_list(register Shell_t *shp,register int flag) +{ + register const struct shtable2 *tp; + register int sig; + register char *sname; + char name[10]; + const char *names[SH_TRAP]; + const char *traps[SH_DEBUGTRAP+1]; + tp=shtab_signals; + if(flag<=0) + { + /* not all signals may be defined, so initialize */ + for(sig=shp->gd->sigmax; sig>=0; sig--) + names[sig] = 0; + for(sig=SH_DEBUGTRAP; sig>=0; sig--) + traps[sig] = 0; + } + for(; *tp->sh_name; tp++) + { + sig = tp->sh_number&((1<sh_number>>SH_SIGBITS) & SH_SIGRUNTIME) && (sig = shp->gd->sigruntime[sig-1]+1) == 1) + continue; + if(sig==flag) + { + sfprintf(sfstdout,"%s\n",tp->sh_name); + return; + } + else if(sig&SH_TRAP) + traps[sig&~SH_TRAP] = (char*)tp->sh_name; + else if(sig-- && sig < elementsof(names)) + names[sig] = (char*)tp->sh_name; + } + if(flag > 0) + sfputr(sfstdout, sig_name(shp,flag-1,name,0), '\n'); + else if(flag<0) + { + /* print the traps */ + register char *trap,**trapcom; + sig = shp->st.trapmax; + /* use parent traps if otrapcom is set (for $(trap) */ + trapcom = (shp->st.otrapcom?shp->st.otrapcom:shp->st.trapcom); + while(--sig >= 0) + { + if(!(trap=trapcom[sig])) + continue; + if(sig > shp->gd->sigmax || !(sname=(char*)names[sig])) + sname = sig_name(shp,sig,name,1); + sfprintf(sfstdout,trapfmt,sh_fmtq(trap),sname); + } + for(sig=SH_DEBUGTRAP; sig>=0; sig--) + { + if(!(trap=shp->st.trap[sig])) + continue; + sfprintf(sfstdout,trapfmt,sh_fmtq(trap),traps[sig]); + } + } + else + { + /* print all the signal names */ + for(sig=1; sig <= shp->gd->sigmax; sig++) + { + if(!(sname=(char*)names[sig])) + sname = sig_name(shp,sig,name,1); + sfputr(sfstdout,sname,'\n'); + } + } +} diff --git a/src/cmd/ksh93/bltins/typeset.c b/src/cmd/ksh93/bltins/typeset.c new file mode 100644 index 0000000..f5618a1 --- /dev/null +++ b/src/cmd/ksh93/bltins/typeset.c @@ -0,0 +1,1471 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1982-2012 AT&T Intellectual Property * +* and is licensed under the * +* Eclipse Public License, Version 1.0 * +* by AT&T Intellectual Property * +* * +* A copy of the License is available at * +* http://www.eclipse.org/org/documents/epl-v10.html * +* (with md5 checksum b35adb5213ca9657e911e9befb180842) * +* * +* Information and Software Systems Research * +* AT&T Research * +* Florham Park NJ * +* * +* David Korn * +* * +***********************************************************************/ +#pragma prototyped +/* + * export [-p] [arg...] + * readonly [-p] [arg...] + * typeset [options] [arg...] + * alias [-ptx] [arg...] + * unalias [arg...] + * builtin [-sd] [-f file] [name...] + * set [options] [name...] + * unset [-fnv] [name...] + * + * David Korn + * AT&T Labs + * + */ + +#include "defs.h" +#include +#include "path.h" +#include "name.h" +#include "history.h" +#include "builtins.h" +#include "variables.h" +#include "FEATURE/dynamic" + +struct tdata +{ + Shell_t *sh; + Namval_t *tp; + const char *wctname; + Sfio_t *outfile; + char *prefix; + char *tname; + char *help; + short aflag; + short pflag; + int argnum; + int scanmask; + Dt_t *scanroot; + char **argnam; + int indent; + int noref; +}; + + +static int print_namval(Sfio_t*, Namval_t*, int, struct tdata*); +static void print_attribute(Namval_t*,void*); +static void print_all(Sfio_t*, Dt_t*, struct tdata*); +static void print_scan(Sfio_t*, int, Dt_t*, int, struct tdata*); +static int unall(int, char**, Dt_t*, Shell_t*); +static int setall(char**, int, Dt_t*, struct tdata*); +static void pushname(Namval_t*,void*); +static void(*nullscan)(Namval_t*,void*); + +static Namval_t *load_class(const char *name) +{ + errormsg(SH_DICT,ERROR_exit(1),"%s: type not loadable",name); + return(0); +} + +/* + * Note export and readonly are the same + */ +#if 0 + /* for the dictionary generator */ + int b_export(int argc,char *argv[],Shbltin_t *context){} +#endif +int b_readonly(int argc,char *argv[],Shbltin_t *context) +{ + register int flag; + char *command = argv[0]; + struct tdata tdata; + NOT_USED(argc); + memset((void*)&tdata,0,sizeof(tdata)); + tdata.sh = context->shp; + tdata.aflag = '-'; + while((flag = optget(argv,*command=='e'?sh_optexport:sh_optreadonly))) switch(flag) + { + case 'p': + tdata.prefix = command; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s", opt_info.arg); + return(2); + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),optusage(NIL(char*))); + argv += (opt_info.index-1); + if(*command=='r') + flag = (NV_ASSIGN|NV_RDONLY|NV_VARNAME); +#ifdef _ENV_H + else if(!argv[1]) + { + char *cp,**env=env_get(tdata.sh->env); + while(cp = *env++) + { + if(tdata.prefix) + sfputr(sfstdout,tdata.prefix,' '); + sfprintf(sfstdout,"%s\n",sh_fmtq(cp)); + } + return(0); + } +#endif + else + { + flag = (NV_ASSIGN|NV_EXPORT|NV_IDENT); + if(!tdata.sh->prefix) + tdata.sh->prefix = ""; + } + return(setall(argv,flag,tdata.sh->var_tree, &tdata)); +} + + +int b_alias(int argc,register char *argv[],Shbltin_t *context) +{ + register unsigned flag = NV_NOARRAY|NV_NOSCOPE|NV_ASSIGN; + register Dt_t *troot; + register int n; + struct tdata tdata; + NOT_USED(argc); + memset((void*)&tdata,0,sizeof(tdata)); + tdata.sh = context->shp; + troot = tdata.sh->alias_tree; + if(*argv[0]=='h') + flag = NV_TAGGED; + if(argv[1]) + { + opt_info.offset = 0; + opt_info.index = 1; + *opt_info.option = 0; + tdata.argnum = 0; + tdata.aflag = *argv[1]; + while((n = optget(argv,sh_optalias))) switch(n) + { + case 'p': + tdata.prefix = argv[0]; + break; + case 't': + flag |= NV_TAGGED; + break; + case 'x': + flag |= NV_EXPORT; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s", opt_info.arg); + return(2); + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage(NIL(char*))); + argv += (opt_info.index-1); + if(flag&NV_TAGGED) + { + /* hacks to handle hash -r | -- */ + if(argv[1] && argv[1][0]=='-') + { + if(argv[1][1]=='r' && argv[1][2]==0) + { + Namval_t *np = nv_search((char*)PATHNOD,tdata.sh->var_tree,HASH_BUCKET); + nv_putval(np,nv_getval(np),NV_RDONLY); + argv++; + if(!argv[1]) + return(0); + } + if(argv[1][0]=='-') + { + if(argv[1][1]=='-' && argv[1][2]==0) + argv++; + else + errormsg(SH_DICT, ERROR_exit(1), e_option, argv[1]); + } + } + troot = tdata.sh->track_tree; + } + } + return(setall(argv,flag,troot,&tdata)); +} + + +#if 0 + /* for the dictionary generator */ + int b_local(int argc,char *argv[],Shbltin_t *context){} +#endif +int b_typeset(int argc,register char *argv[],Shbltin_t *context) +{ + register int n, flag = NV_VARNAME|NV_ASSIGN; + struct tdata tdata; + const char *optstring = sh_opttypeset; + Namdecl_t *ntp = (Namdecl_t*)context->ptr; + Dt_t *troot; + int isfloat=0, shortint=0, sflag=0; + NOT_USED(argc); + memset((void*)&tdata,0,sizeof(tdata)); + tdata.sh = context->shp; + if(ntp) + { + tdata.tp = ntp->tp; + opt_info.disc = (Optdisc_t*)ntp->optinfof; + optstring = ntp->optstring; + } + troot = tdata.sh->var_tree; + while((n = optget(argv,optstring))) + { + if(tdata.aflag==0) + tdata.aflag = *opt_info.option; + switch(n) + { + case 'a': + flag |= NV_IARRAY; + if(opt_info.arg && *opt_info.arg!='[') + { + opt_info.index--; + goto endargs; + } + tdata.tname = opt_info.arg; + break; + case 'A': + flag |= NV_ARRAY; + break; + case 'C': + flag |= NV_COMVAR; + break; + case 'E': + /* The following is for ksh88 compatibility */ + if(opt_info.offset && !strchr(argv[opt_info.index],'E')) + { + tdata.argnum = (int)opt_info.num; + break; + } + case 'F': + case 'X': + if(!opt_info.arg || (tdata.argnum = opt_info.num) <0) + tdata.argnum = (n=='X'?2*sizeof(Sfdouble_t):10); + isfloat = 1; + if(n=='E') + { + flag &= ~NV_HEXFLOAT; + flag |= NV_EXPNOTE; + } + else if(n=='X') + { + flag &= ~NV_EXPNOTE; + flag |= NV_HEXFLOAT; + } + break; + case 'b': + flag |= NV_BINARY; + break; + case 'm': + flag |= NV_MOVE; + break; + case 'n': + flag &= ~NV_VARNAME; + flag |= (NV_REF|NV_IDENT); + break; + case 'H': + flag |= NV_HOST; + break; + case 'T': + flag |= NV_TYPE; + tdata.prefix = opt_info.arg; + break; + case 'L': case 'Z': case 'R': + if(tdata.argnum==0) + tdata.argnum = (int)opt_info.num; + if(tdata.argnum < 0) + errormsg(SH_DICT,ERROR_exit(1), e_badfield, tdata.argnum); + if(n=='Z') + flag |= NV_ZFILL; + else + { + flag &= ~(NV_LJUST|NV_RJUST); + flag |= (n=='L'?NV_LJUST:NV_RJUST); + } + break; + case 'M': + if((tdata.wctname = opt_info.arg) && !nv_mapchar((Namval_t*)0,tdata.wctname)) + errormsg(SH_DICT, ERROR_exit(1),e_unknownmap, tdata.wctname); + if(tdata.wctname && strcmp(tdata.wctname,e_tolower)==0) + flag |= NV_UTOL; + else + flag |= NV_LTOU; + if(!tdata.wctname) + flag |= NV_UTOL; + break; + case 'f': + flag &= ~(NV_VARNAME|NV_ASSIGN); + troot = tdata.sh->fun_tree; + break; + case 'i': + if(!opt_info.arg || (tdata.argnum = opt_info.num) <0) + tdata.argnum = 10; + flag |= NV_INTEGER; + break; + case 'l': + tdata.wctname = e_tolower; + flag |= NV_UTOL; + break; + case 'p': + tdata.prefix = argv[0]; + tdata.pflag = 1; + flag &= ~NV_ASSIGN; + break; + case 'r': + flag |= NV_RDONLY; + break; +#ifdef SHOPT_TYPEDEF + case 'S': + sflag=1; + break; + case 'h': + tdata.help = opt_info.arg; + break; +#endif /*SHOPT_TYPEDEF*/ + case 's': + shortint=1; + break; + case 't': + flag |= NV_TAGGED; + break; + case 'u': + tdata.wctname = e_toupper; + flag |= NV_LTOU; + break; + case 'x': + flag &= ~NV_VARNAME; + flag |= (NV_EXPORT|NV_IDENT); + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s", opt_info.arg); + opt_info.disc = 0; + return(2); + } + } +endargs: + argv += opt_info.index; + opt_info.disc = 0; + /* handle argument of + and - specially */ + if(*argv && argv[0][1]==0 && (*argv[0]=='+' || *argv[0]=='-')) + tdata.aflag = *argv[0]; + else + argv--; + if((flag&NV_ZFILL) && !(flag&NV_LJUST)) + flag |= NV_RJUST; + if((flag&NV_INTEGER) && (flag&(NV_LJUST|NV_RJUST|NV_ZFILL))) + error_info.errors++; + if((flag&NV_BINARY) && (flag&(NV_LJUST|NV_UTOL|NV_LTOU))) + error_info.errors++; + if((flag&NV_MOVE) && (flag&~(NV_MOVE|NV_VARNAME|NV_ASSIGN))) + error_info.errors++; + if((flag&NV_REF) && (flag&~(NV_REF|NV_IDENT|NV_ASSIGN))) + error_info.errors++; + if((flag&NV_TYPE) && (flag&~(NV_TYPE|NV_VARNAME|NV_ASSIGN))) + error_info.errors++; + if(troot==tdata.sh->fun_tree && ((isfloat || flag&~(NV_FUNCT|NV_TAGGED|NV_EXPORT|NV_LTOU)))) + error_info.errors++; + if(sflag && troot==tdata.sh->fun_tree) + { + /* static function */ + sflag = 0; + flag |= NV_STATICF; + } + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s", optusage(NIL(char*))); + if(isfloat) + flag |= NV_DOUBLE; + if(shortint) + { + flag &= ~NV_LONG; + flag |= NV_SHORT|NV_INTEGER; + } + if(sflag) + { + if(tdata.sh->mktype) + flag |= NV_REF|NV_TAGGED; + else if(!tdata.sh->typeinit) + flag |= NV_STATIC|NV_IDENT; + } + if(tdata.sh->fn_depth && !tdata.pflag) + flag |= NV_NOSCOPE; + if(tdata.help) + tdata.help = strdup(tdata.help); + if(flag&NV_TYPE) + { + Stk_t *stkp = tdata.sh->stk; + int off=0,offset = stktell(stkp); + if(!tdata.prefix) + return(sh_outtype(tdata.sh,sfstdout)); + sfputr(stkp,NV_CLASS,-1); +#if SHOPT_NAMESPACE + if(tdata.sh->namespace) + { + off = stktell(stkp)+1; + sfputr(stkp,nv_name(tdata.sh->namespace),'.'); + } + else +#endif /* SHOPT_NAMESPACE */ + if(NV_CLASS[sizeof(NV_CLASS)-2]!='.') + sfputc(stkp,'.'); + sfputr(stkp,tdata.prefix,0); + tdata.tp = nv_open(stkptr(stkp,offset),tdata.sh->var_tree,NV_VARNAME|NV_NOARRAY|NV_NOASSIGN); +#if SHOPT_NAMESPACE + if(!tdata.tp && off) + { + *stkptr(stkp,off)=0; + tdata.tp = nv_open(stkptr(stkp,offset),tdata.sh->var_tree,NV_VARNAME|NV_NOARRAY|NV_NOASSIGN); + } +#endif /* SHOPT_NAMESPACE */ + stkseek(stkp,offset); + if(!tdata.tp) + errormsg(SH_DICT,ERROR_exit(1),"%s: unknown type",tdata.prefix); + else if(nv_isnull(tdata.tp)) + nv_newtype(tdata.tp); + tdata.tp->nvenv = tdata.help; + flag &= ~NV_TYPE; + } + else if(tdata.aflag==0 && ntp && ntp->tp) + tdata.aflag = '-'; + if(!tdata.sh->mktype) + tdata.help = 0; + if(tdata.aflag=='+' && (flag&(NV_ARRAY|NV_IARRAY|NV_COMVAR))) + errormsg(SH_DICT,ERROR_exit(1),e_nounattr); + return(setall(argv,flag,troot,&tdata)); +} + +static void print_value(Sfio_t *iop, Namval_t *np, struct tdata *tp) +{ + char *name; + int aflag=tp->aflag; + if(nv_isnull(np)) + { + if(!np->nvflag) + return; + aflag = '+'; + } + else if(nv_istable(np)) + { + Dt_t *root = tp->sh->last_root; + Namval_t *nsp = tp->sh->namespace; + char *cp = name = nv_name(np); + if(*name=='.') + name++; + if(tp->indent) + sfnputc(iop,'\t',tp->indent); + sfprintf(iop,"namespace %s\n", name); + if(tp->indent) + sfnputc(iop,'\t',tp->indent); + sfprintf(iop,"{\n", name); + tp->indent++; + /* output types from namespace */ + tp->sh->namespace = 0; + tp->sh->prefix = nv_name(np)+1; + sh_outtype(tp->sh,iop); + tp->sh->prefix = 0; + tp->sh->namespace = np; + tp->sh->last_root = root; + /* output variables from namespace */ + print_scan(iop,NV_NOSCOPE,nv_dict(np),aflag=='+',tp); + tp->wctname = cp; + tp->sh->namespace = 0; + /* output functions from namespace */ + print_scan(iop,NV_FUNCTION|NV_NOSCOPE,tp->sh->fun_tree,aflag=='+',tp); + tp->wctname = 0; + tp->sh->namespace = nsp; + if(--tp->indent) + sfnputc(iop,'\t',tp->indent); + sfwrite(iop,"}\n",2); + return; + } + sfputr(iop,nv_name(np),aflag=='+'?'\n':'='); + if(aflag=='+') + return; + if(nv_isarray(np) && nv_arrayptr(np)) + { + nv_outnode(np,iop,-1,0); + sfwrite(iop,")\n",2); + } + else + { + if(nv_isvtree(np)) + nv_onattr(np,NV_EXPORT); + if(!(name = nv_getval(np))) + name = Empty; + if(!nv_isvtree(np)) + name = sh_fmtq(name); + sfputr(iop,name,'\n'); + } +} + +static int setall(char **argv,register int flag,Dt_t *troot,struct tdata *tp) +{ + register char *name; + char *last = 0; + int nvflags=(flag&(NV_ARRAY|NV_NOARRAY|NV_VARNAME|NV_IDENT|NV_ASSIGN|NV_STATIC|NV_MOVE)); + int r=0, ref=0, comvar=(flag&NV_COMVAR),iarray=(flag&NV_IARRAY); + Shell_t *shp =tp->sh; + if(!shp->prefix) + { + if(!tp->pflag) + nvflags |= NV_NOSCOPE; + } + else if(*shp->prefix==0) + shp->prefix = 0; + if(*argv[0]=='+') + nvflags |= NV_NOADD; + flag &= ~(NV_NOARRAY|NV_NOSCOPE|NV_VARNAME|NV_IDENT|NV_STATIC|NV_COMVAR|NV_IARRAY); + if(argv[1]) + { + if(flag&NV_REF) + { + flag &= ~NV_REF; + ref=1; + if(tp->aflag!='-') + nvflags |= NV_NOREF; + } + if(tp->pflag) + nvflags |= NV_NOREF; + while(name = *++argv) + { + register unsigned newflag; + register Namval_t *np; + Namarr_t *ap; + Namval_t *mp; + unsigned curflag; + if(troot == shp->fun_tree) + { + /* + *functions can be exported or + * traced but not set + */ + flag &= ~NV_ASSIGN; + if(flag&NV_LTOU) + { + /* Function names cannot be special builtin */ + if((np=nv_search(name,shp->bltin_tree,0)) && nv_isattr(np,BLT_SPC)) + errormsg(SH_DICT,ERROR_exit(1),e_badfun,name); +#if SHOPT_NAMESPACE + if(shp->namespace) + np = sh_fsearch(shp,name,NV_ADD|HASH_NOSCOPE); + else +#endif /* SHOPT_NAMESPACE */ + np = nv_open(name,sh_subfuntree(1),NV_NOARRAY|NV_IDENT|NV_NOSCOPE); + } + else + { + if(shp->prefix) + { + sfprintf(shp->strbuf,"%s.%s%c",shp->prefix,name,0); + name = sfstruse(shp->strbuf); + } +#if SHOPT_NAMESPACE + np = 0; + if(shp->namespace) + np = sh_fsearch(shp,name,HASH_NOSCOPE); + if(!np) +#endif /* SHOPT_NAMESPACE */ + if(np=nv_search(name,troot,0)) + { + if(!is_afunction(np)) + np = 0; + } + else if(memcmp(name,".sh.math.",9)==0 && sh_mathstd(name+9)) + continue; + } + if(np && ((flag&NV_LTOU) || !nv_isnull(np) || nv_isattr(np,NV_LTOU))) + { + if(flag==0 && !tp->help) + { + print_namval(sfstdout,np,tp->aflag=='+',tp); + continue; + } + if(shp->subshell && !shp->subshare) + sh_subfork(); + if(tp->aflag=='-') + nv_onattr(np,flag|NV_FUNCTION); + else if(tp->aflag=='+') + nv_offattr(np,flag); + } + else + r++; + if(tp->help) + { + int offset = stktell(shp->stk); + if(!np) + { + sfputr(shp->stk,shp->prefix,'.'); + sfputr(shp->stk,name,0); + np = nv_search(stkptr(shp->stk,offset),troot,0); + stkseek(shp->stk,offset); + } + if(np && np->nvalue.cp) + np->nvalue.rp->help = tp->help; + } + continue; + } + /* tracked alias */ + if(troot==shp->track_tree && tp->aflag=='-') + { + np = nv_search(name,troot,NV_ADD); + path_alias(np,path_absolute(shp,nv_name(np),NIL(Pathcomp_t*))); + continue; + } + np = nv_open(name,troot,nvflags|((nvflags&NV_ASSIGN)?0:NV_ARRAY)|((iarray|(nvflags&NV_REF))?NV_FARRAY:0)); + if(!np) + continue; + if(nv_isnull(np) && !nv_isarray(np) && nv_isattr(np,NV_NOFREE)) + nv_offattr(np,NV_NOFREE); + else if(tp->tp && !nv_isattr(np,NV_MINIMAL|NV_EXPORT) && (mp=(Namval_t*)np->nvenv) && (ap=nv_arrayptr(mp)) && (ap->nelem&ARRAY_TREE)) +#if 0 + errormsg(SH_DICT,ERROR_exit(1),e_typecompat,nv_name(np)); +#else + errormsg(SH_DICT,ERROR_exit(1),"%s: typecompat",nv_name(np)); +#endif + else if((ap=nv_arrayptr(np)) && nv_aindex(np)>0 && ap->nelem==1 && nv_getval(np)==Empty) + { + ap->nelem++; + _nv_unset(np,0); + ap->nelem--; + } + if(tp->pflag) + { + if(!nv_istable(np)) + nv_attribute(np,sfstdout,tp->prefix,1); + print_value(sfstdout,np,tp); + continue; + } + if(flag==NV_ASSIGN && !ref && tp->aflag!='-' && !strchr(name,'=')) + { + if(troot!=shp->var_tree && (nv_isnull(np) || !print_namval(sfstdout,np,0,tp))) + { + sfprintf(sfstderr,sh_translate(e_noalias),name); + r++; + } + if(!comvar && !iarray) + continue; + } + if(!nv_isarray(np) && !strchr(name,'=') && !(shp->envlist && nv_onlist(shp->envlist,name))) + { + if(comvar || (shp->last_root==shp->var_tree && (tp->tp || (!shp->st.real_fun && (nvflags&NV_STATIC)) || (!(flag&(NV_EXPORT|NV_RDONLY)) && nv_isattr(np,(NV_EXPORT|NV_IMPORT))==(NV_EXPORT|NV_IMPORT))))) +{ + _nv_unset(np,0); +} + } + if(troot==shp->var_tree) + { + if(iarray) + { + if(tp->tname) + nv_atypeindex(np,tp->tname+1); + else if(nv_isnull(np)) + nv_onattr(np,NV_ARRAY|(comvar?NV_NOFREE:0)); + else + { + if(ap && comvar) + ap->nelem |= ARRAY_TREE; + nv_putsub(np, (char*)0, 0); + } + } + else if(nvflags&NV_ARRAY) + { + if(comvar) + { + Namarr_t *ap=nv_arrayptr(np); + if(ap) + ap->nelem |= ARRAY_TREE; + else + { + _nv_unset(np,NV_RDONLY); + nv_onattr(np,NV_NOFREE); + } + } + nv_setarray(np,nv_associative); + } + else if(comvar && !nv_isvtree(np) && !nv_rename(np,flag|NV_COMVAR)) + nv_setvtree(np); + } + if(flag&NV_MOVE) + { + nv_rename(np, flag); + nv_close(np); + continue; + } + if(tp->tp && nv_type(np)!=tp->tp) + { + nv_settype(np,tp->tp,tp->aflag=='-'?0:NV_APPEND); + flag = (np->nvflag&NV_NOCHANGE); + } + flag &= ~NV_ASSIGN; + if(last=strchr(name,'=')) + *last = 0; + if (shp->typeinit) + continue; + curflag = np->nvflag; + if(!(flag&NV_INTEGER) && (flag&(NV_LTOU|NV_UTOL))) + { + Namfun_t *fp; + char *cp; + if(!tp->wctname) + errormsg(SH_DICT,ERROR_exit(1),e_mapchararg,nv_name(np)); + cp = (char*)nv_mapchar(np,0); + if(fp=nv_mapchar(np,tp->wctname)) + { + if(tp->aflag=='+') + { + if(cp && strcmp(cp,tp->wctname)==0) + { + nv_disc(np,fp,NV_POP); + if(!(fp->nofree&1)) + free((void*)fp); + nv_offattr(np,flag&(NV_LTOU|NV_UTOL)); + } + } + else if(!cp || strcmp(cp,tp->wctname)) + { + nv_disc(np,fp,NV_LAST); + nv_onattr(np,flag&(NV_LTOU|NV_UTOL)); + } + } + } + if (tp->aflag == '-') + { + if((flag&NV_EXPORT) && (strchr(name,'.') || nv_isvtree(np))) + errormsg(SH_DICT,ERROR_exit(1),e_badexport,name); +#if SHOPT_BSH + if(flag&NV_EXPORT) + nv_offattr(np,NV_IMPORT); +#endif /* SHOPT_BSH */ + newflag = curflag; + if(flag&~NV_NOCHANGE) + newflag &= NV_NOCHANGE; + newflag |= flag; + if (flag & (NV_LJUST|NV_RJUST)) + { + if(!(flag&NV_RJUST)) + newflag &= ~NV_RJUST; + + else if(!(flag&NV_LJUST)) + newflag &= ~NV_LJUST; + } + } + else + { + if((flag&NV_RDONLY) && (curflag&NV_RDONLY)) + errormsg(SH_DICT,ERROR_exit(1),e_readonly,nv_name(np)); + newflag = curflag & ~flag; + } + if (tp->aflag && (tp->argnum>0 || (curflag!=newflag))) + { + if(shp->subshell) + sh_assignok(np,1); + if(troot!=shp->var_tree) + nv_setattr(np,newflag&~NV_ASSIGN); + else + { + char *oldname=0; + int len=strlen(name); + if(tp->argnum==1 && newflag==NV_INTEGER && nv_isattr(np,NV_INTEGER)) + tp->argnum = 10; + /* use reference name for export */ + if((newflag^curflag)&NV_EXPORT) + { + oldname = np->nvname; + np->nvname = name; + } + if(np->nvfun && !nv_isarray(np) && name[len-1]=='.') + newflag |= NV_NODISC; + nv_newattr (np, newflag&~NV_ASSIGN,tp->argnum); + if(oldname) + np->nvname = oldname; + } + } + if(tp->help && !nv_isattr(np,NV_MINIMAL|NV_EXPORT)) + { + np->nvenv = tp->help; + nv_onattr(np,NV_EXPORT); + } + if(last) + *last = '='; + /* set or unset references */ + if(ref) + { + if(tp->aflag=='-') + { + Dt_t *hp=0; + if(nv_isattr(np,NV_PARAM) && shp->st.prevst) + { + if(!(hp=(Dt_t*)shp->st.prevst->save_tree)) + hp = dtvnext(shp->var_tree); + } + if(tp->sh->mktype) + nv_onattr(np,NV_REF|NV_FUNCT); + else + nv_setref(np,hp,NV_VARNAME); + } + else + nv_unref(np); + } + nv_close(np); + } + } + else + { + if(shp->prefix) + errormsg(SH_DICT,2, e_subcomvar,shp->prefix); + if(tp->aflag) + { + if(troot==shp->fun_tree) + { + flag |= NV_FUNCTION; + tp->prefix = 0; + } + else if(troot==shp->var_tree) + { + flag |= (nvflags&NV_ARRAY); + if(flag&NV_IARRAY) + flag |= NV_ARRAY; + if(!(flag&~NV_ASSIGN)) + tp->noref = 1; + } + if((flag&(NV_UTOL|NV_LTOU)) ==(NV_UTOL|NV_LTOU)) + { + print_scan(sfstdout,flag&~NV_UTOL,troot,tp->aflag=='+',tp); + flag &= ~NV_LTOU; + } + print_scan(sfstdout,flag,troot,tp->aflag=='+',tp); + if(tp->noref) + { + tp->noref = 0; + print_scan(sfstdout,flag|NV_REF,troot,tp->aflag=='+',tp); + } + } + else if(troot==shp->alias_tree) + print_scan(sfstdout,0,troot,0,tp); + else + print_all(sfstdout,troot,tp); + sfsync(sfstdout); + } + return(r); +} + +typedef void (*Iptr_t)(int,void*); + +#define GROWLIB 4 + +static void **liblist; +static unsigned short *libattr; +static int nlib; +static int maxlib; + +/* + * This allows external routines to load from the same library */ +void **sh_getliblist(void) +{ + return(liblist); +} + +/* + * add library to loaded list + * call (*lib_init)() on first load if defined + * always move to head of search list + * return: 0: already loaded 1: first load + */ +#if SHOPT_DYNAMIC +int sh_addlib(Shell_t *shp,void* library) +{ + register int n; + register int r; + Iptr_t initfn; + Shbltin_t *sp = &shp->bltindata; + + sp->nosfio = 0; + for (n = r = 0; n < nlib; n++) + { + if (r) + { + liblist[n-1] = liblist[n]; + libattr[n-1] = libattr[n]; + } + else if (liblist[n] == library) + r++; + } + if (r) + nlib--; + else if ((initfn = (Iptr_t)dlllook(library, "lib_init"))) + (*initfn)(0,sp); + if (nlib >= maxlib) + { + maxlib += GROWLIB; + if (liblist) + { + liblist = (void**)realloc((void*)liblist, (maxlib+1)*sizeof(void*)); + libattr = (unsigned short*)realloc((void*)libattr, (maxlib+1)*sizeof(unsigned short)); + } + else + { + liblist = (void**)malloc((maxlib+1)*sizeof(void*)); + libattr = (unsigned short*)malloc((maxlib+1)*sizeof(unsigned short)); + } + } + libattr[nlib] = (sp->nosfio?BLT_NOSFIO:0); + liblist[nlib++] = library; + liblist[nlib] = 0; + return !r; +} +#else +int sh_addlib(Shell_t *shp,void* library) +{ + return 0; +} +#endif /* SHOPT_DYNAMIC */ + +/* + * add change or list built-ins + * adding builtins requires dlopen() interface + */ +int b_builtin(int argc,char *argv[],Shbltin_t *context) +{ + register char *arg=0, *name; + register int n, r=0, flag=0; + register Namval_t *np; + long dlete=0; + struct tdata tdata; + Shbltin_f addr; + Stk_t *stkp; + void *library=0; + char *errmsg; +#ifdef SH_PLUGIN_VERSION + unsigned long ver; + int list = 0; + char path[1024]; +#endif + NOT_USED(argc); + memset(&tdata,0,sizeof(tdata)); + tdata.sh = context->shp; + stkp = tdata.sh->stk; + if(!tdata.sh->pathlist) + path_absolute(tdata.sh,argv[0],NIL(Pathcomp_t*)); + while (n = optget(argv,sh_optbuiltin)) switch (n) + { + case 's': + flag = BLT_SPC; + break; + case 'd': + dlete=1; + break; + case 'f': +#if SHOPT_DYNAMIC + arg = opt_info.arg; +#else + errormsg(SH_DICT,2, "adding built-ins not supported"); + error_info.errors++; +#endif /* SHOPT_DYNAMIC */ + break; + case 'l': +#ifdef SH_PLUGIN_VERSION + list = 1; +#endif + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); + break; + } + argv += opt_info.index; + if(error_info.errors) + errormsg(SH_DICT,ERROR_usage(2),"%s", optusage(NIL(char*))); + if(arg || *argv) + { + if(sh_isoption(SH_RESTRICTED)) + errormsg(SH_DICT,ERROR_exit(1),e_restricted,argv[-opt_info.index]); + if(sh_isoption(SH_PFSH)) + errormsg(SH_DICT,ERROR_exit(1),e_pfsh,argv[-opt_info.index]); + if(tdata.sh->subshell && !tdata.sh->subshare) + sh_subfork(); + } +#if SHOPT_DYNAMIC + if(arg) + { +#ifdef SH_PLUGIN_VERSION + if(!(library = dllplugin(SH_ID, arg, NiL, SH_PLUGIN_VERSION, &ver, RTLD_LAZY, path, sizeof(path)))) + { + errormsg(SH_DICT,ERROR_exit(0),"%s: %s",arg,dllerror(0)); + return(1); + } + if(list) + sfprintf(sfstdout, "%s %08lu %s\n", arg, ver, path); +#else +#if (_AST_VERSION>=20040404) + if(!(library = dllplug(SH_ID,arg,NIL(char*),RTLD_LAZY,NIL(char*),0))) +#else + if(!(library = dllfind(arg,NIL(char*),RTLD_LAZY,NIL(char*),0))) +#endif + { + errormsg(SH_DICT,ERROR_exit(0),"%s: %s",arg,dlerror()); + return(1); + } +#endif + sh_addlib(tdata.sh,library); + } + else +#endif /* SHOPT_DYNAMIC */ + if(*argv==0 && !dlete) + { + print_scan(sfstdout, flag, tdata.sh->bltin_tree, 1, &tdata); + return(0); + } + r = 0; + flag = stktell(stkp); + while(arg = *argv) + { + name = path_basename(arg); + sfwrite(stkp,"b_",2); + sfputr(stkp,name,0); + errmsg = 0; + addr = 0; + for(n=(nlib?nlib:dlete); --n>=0;) + { + /* (char*) added for some sgi-mips compilers */ +#if SHOPT_DYNAMIC + if(dlete || (addr = (Shbltin_f)dlllook(liblist[n],stkptr(stkp,flag)))) +#else + if(dlete) +#endif /* SHOPT_DYNAMIC */ + { + if(np = sh_addbuiltin(arg, addr,pointerof(dlete))) + { + if(dlete || nv_isattr(np,BLT_SPC)) + errmsg = "restricted name"; + else + nv_onattr(np,libattr[n]); + } + break; + } + } + if(!dlete && !addr) + { + np = sh_addbuiltin(arg, 0 ,0); + if(np && nv_isattr(np,BLT_SPC)) + errmsg = "restricted name"; + else if(!np) + errmsg = "not found"; + } + if(errmsg) + { + errormsg(SH_DICT,ERROR_exit(0),"%s: %s",*argv,errmsg); + r = 1; + } + stkseek(stkp,flag); + argv++; + } + return(r); +} + +int b_set(int argc,register char *argv[],Shbltin_t *context) +{ + struct tdata tdata; + int was_monitor = sh_isoption(SH_MONITOR); + memset(&tdata,0,sizeof(tdata)); + tdata.sh = context->shp; + tdata.prefix=0; + if(argv[1]) + { + if(sh_argopts(argc,argv,tdata.sh) < 0) + return(2); + if(sh_isoption(SH_VERBOSE)) + sh_onstate(SH_VERBOSE); + else + sh_offstate(SH_VERBOSE); + if(sh_isoption(SH_MONITOR) && !was_monitor) + sh_onstate(SH_MONITOR); + else if(!sh_isoption(SH_MONITOR) && was_monitor) + sh_offstate(SH_MONITOR); + } + else + /*scan name chain and print*/ + print_scan(sfstdout,0,tdata.sh->var_tree,0,&tdata); + return(0); +} + +/* + * The removing of Shell variable names, aliases, and functions + * is performed here. + * Unset functions with unset -f + * Non-existent items being deleted give non-zero exit status + */ + +int b_unalias(int argc,register char *argv[],Shbltin_t *context) +{ + Shell_t *shp = context->shp; + return(unall(argc,argv,shp->alias_tree,shp)); +} + +int b_unset(int argc,register char *argv[],Shbltin_t *context) +{ + Shell_t *shp = context->shp; + return(unall(argc,argv,shp->var_tree,shp)); +} + +static int unall(int argc, char **argv, register Dt_t *troot, Shell_t* shp) +{ + register Namval_t *np; + register const char *name; + register int r; + Dt_t *dp; + int nflag=0,all=0,isfun,jmpval; + struct checkpt buff; + NOT_USED(argc); + if(troot==shp->alias_tree) + { + name = sh_optunalias; + if(shp->subshell) + troot = sh_subaliastree(0); + } + else + name = sh_optunset; + while(r = optget(argv,name)) switch(r) + { + case 'f': + troot = sh_subfuntree(1); + break; + case 'a': + all=1; + break; + case 'n': + nflag = NV_NOREF; + case 'v': + troot = shp->var_tree; + break; + case ':': + errormsg(SH_DICT,2, "%s", opt_info.arg); + break; + case '?': + errormsg(SH_DICT,ERROR_usage(0), "%s", opt_info.arg); + return(2); + } + argv += opt_info.index; + if(error_info.errors || (*argv==0 &&!all)) + errormsg(SH_DICT,ERROR_usage(2),"%s",optusage(NIL(char*))); + if(!troot) + return(1); + r = 0; + if(troot==shp->var_tree) + nflag |= NV_VARNAME; + else + nflag = NV_NOSCOPE; + if(all) + { + dtclear(troot); + return(r); + } + sh_pushcontext(shp,&buff,1); + while(name = *argv++) + { + jmpval = sigsetjmp(buff.buff,0); + np = 0; + if(jmpval==0) + { +#if SHOPT_NAMESPACE + if(shp->namespace && troot!=shp->var_tree) + np = sh_fsearch(shp,name,nflag?HASH_NOSCOPE:0); + if(!np) +#endif /* SHOPT_NAMESPACE */ + np=nv_open(name,troot,NV_NOADD|nflag); + } + else + { + r = 1; + continue; + } + if(np) + { + if(is_abuiltin(np) || nv_isattr(np,NV_RDONLY)) + { + if(nv_isattr(np,NV_RDONLY)) + errormsg(SH_DICT,ERROR_warn(0),e_readonly, nv_name(np)); + r = 1; + continue; + } + isfun = is_afunction(np); + if(troot==shp->var_tree) + { + Namarr_t *ap; +#if SHOPT_FIXEDARRAY + if((ap=nv_arrayptr(np)) && !ap->fixed && name[strlen(name)-1]==']' && !nv_getsub(np)) +#else + if(nv_isarray(np) && name[strlen(name)-1]==']' && !nv_getsub(np)) +#endif /* SHOPT_FIXEDARRAY */ + { + r=1; + continue; + } + + if(shp->subshell) + np=sh_assignok(np,0); + } + if(!nv_isnull(np)) + _nv_unset(np,0); + if(troot==shp->var_tree && shp->st.real_fun && (dp=shp->var_tree->walk) && dp==shp->st.real_fun->sdict) + nv_delete(np,dp,NV_NOFREE); + else if(isfun) + nv_delete(np,troot,NV_NOFREE); +#if 0 + /* causes unsetting local variable to expose global */ + else if(shp->var_tree==troot && shp->var_tree!=shp->var_base && nv_search((char*)np,shp->var_tree,HASH_BUCKET|HASH_NOSCOPE)) + nv_delete(np,shp->var_tree,0); +#endif + else + nv_close(np); + + } + else if(troot==shp->alias_tree) + r = 1; + } + sh_popcontext(shp,&buff); + return(r); +} + +/* + * print out the name and value of a name-value pair + */ + +static int print_namval(Sfio_t *file,register Namval_t *np,register int flag, struct tdata *tp) +{ + register char *cp; + int indent=tp->indent, outname=0, isfun; + sh_sigcheck(tp->sh); + if(flag) + flag = '\n'; + if(tp->noref && nv_isref(np)) + return(0); + if(nv_istable(np)) + { + print_value(file,np,tp); + return(0); + } + if(nv_isattr(np,NV_NOPRINT|NV_INTEGER)==NV_NOPRINT) + { + if(is_abuiltin(np)) + sfputr(file,nv_name(np),'\n'); + return(0); + } + isfun = is_afunction(np); + if(tp->prefix) + { + outname = (*tp->prefix=='t' && (!nv_isnull(np) || nv_isattr(np,NV_FLOAT|NV_RDONLY|NV_BINARY|NV_RJUST|NV_NOPRINT))); + if(indent && (isfun || outname || *tp->prefix!='t')) + { + sfnputc(file,'\t',indent); + indent = 0; + } + if(!isfun) + { + if(*tp->prefix=='t') + nv_attribute(np,tp->outfile,tp->prefix,tp->aflag); + else + sfputr(file,tp->prefix,' '); + } + } + if(isfun) + { + Sfio_t *iop=0; + char *fname=0; + if(nv_isattr(np,NV_NOFREE)) + return(0); + if(!flag && !np->nvalue.ip) + sfputr(file,"typeset -fu",' '); + else if(!flag && !nv_isattr(np,NV_FPOSIX)) + sfputr(file,"function",' '); + cp = nv_name(np); + if(tp->wctname) + cp += strlen(tp->wctname)+1; + sfputr(file,cp,-1); + if(nv_isattr(np,NV_FPOSIX)) + sfwrite(file,"()",2); + if(np->nvalue.ip && np->nvalue.rp->hoffset>=0) + fname = np->nvalue.rp->fname; + else + flag = '\n'; + if(flag) + { + if(tp->pflag && np->nvalue.ip && np->nvalue.rp->hoffset>=0) + sfprintf(file," #line %d %s\n",np->nvalue.rp->lineno,fname?sh_fmtq(fname):""); + else + sfputc(file, '\n'); + } + else + { + if(nv_isattr(np,NV_FTMP)) + { + fname = 0; + iop = tp->sh->heredocs; + } + else if(fname) + iop = sfopen(iop,fname,"r"); + else if(tp->sh->gd->hist_ptr) + iop = (tp->sh->gd->hist_ptr)->histfp; + if(iop && sfseek(iop,(Sfoff_t)np->nvalue.rp->hoffset,SEEK_SET)>=0) + sfmove(iop,file, nv_size(np), -1); + else + flag = '\n'; + if(fname) + sfclose(iop); + } + return(nv_size(np)+1); + } + if(nv_arrayptr(np)) + { + if(indent) + sfnputc(file,'\t',indent); + print_value(file,np,tp); + return(0); + } + if(nv_isvtree(np)) + nv_onattr(np,NV_EXPORT); + if(cp=nv_getval(np)) + { + if(indent) + sfnputc(file,'\t',indent); + sfputr(file,nv_name(np),-1); + if(!flag) + flag = '='; + sfputc(file,flag); + if(flag != '\n') + { + if(nv_isref(np) && nv_refsub(np)) + { + sfputr(file,sh_fmtq(cp),-1); + sfprintf(file,"[%s]\n", sh_fmtq(nv_refsub(np))); + } + else +#if SHOPT_TYPEDEF + sfputr(file,nv_isvtree(np)?cp:sh_fmtq(cp),'\n'); +#else + sfputr(file,sh_fmtq(cp),'\n'); +#endif /* SHOPT_TYPEDEF */ + } + return(1); + } + else if(outname || (tp->scanmask && tp->scanroot==tp->sh->var_tree)) + sfputr(file,nv_name(np),'\n'); + return(0); +} + +/* + * print attributes at all nodes + */ +static void print_all(Sfio_t *file,Dt_t *root, struct tdata *tp) +{ + tp->outfile = file; + nv_scan(root, print_attribute, (void*)tp, 0, 0); +} + +/* + * print the attributes of name value pair give by + */ +static void print_attribute(register Namval_t *np,void *data) +{ + register struct tdata *dp = (struct tdata*)data; + nv_attribute(np,dp->outfile,dp->prefix,dp->aflag); +} + +/* + * print the nodes in tree which have attributes set + * of