mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 03:32:24 +00:00
Remove ksh 1.0.0beta
This commit is contained in:
parent
3449ea6767
commit
4bea26e4b7
1217 changed files with 0 additions and 345256 deletions
|
@ -1,32 +0,0 @@
|
||||||
name: CI
|
|
||||||
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
Linux:
|
|
||||||
name: Linux
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout sources
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Build
|
|
||||||
run: bin/package make
|
|
||||||
- name: Regression tests
|
|
||||||
run: |
|
|
||||||
PS4="$PS4[ci.yml] "
|
|
||||||
set -o xtrace
|
|
||||||
export TZ=UTC
|
|
||||||
ulimit -n 1024
|
|
||||||
: default regression tests &&
|
|
||||||
script -q -e -c "bin/shtests" &&
|
|
||||||
: regression tests with OS-provided multibyte locales &&
|
|
||||||
LANG=nl_NL.UTF-8 script -q -e -c "bin/shtests --locale --nocompile" &&
|
|
||||||
LANG=ja_JP.SJIS script -q -e -c "bin/shtests --locale --nocompile" &&
|
|
||||||
: disable most SHOPTs, rebuild ksh &&
|
|
||||||
sed --regexp-extended --in-place=.orig \
|
|
||||||
'/^SHOPT (2DMATCH|AUDIT|BGX|BRACEPAT|DEVFD|DYNAMIC|EDPREDICT|ESH|FIXEDARRAY|HISTEXPAND|MULTIBYTE|NAMESPACE|OPTIMIZE|STATS|SUID_EXEC|VSH)=/ s/=1?/=0/' \
|
|
||||||
src/cmd/ksh93/SHOPT.sh &&
|
|
||||||
bin/package make &&
|
|
||||||
: default regression tests with SHOPTs disabled &&
|
|
||||||
script -q -e -c "bin/shtests"
|
|
42
cde/programs/dtksh/ksh93/.gitignore
vendored
42
cde/programs/dtksh/ksh93/.gitignore
vendored
|
@ -1,42 +0,0 @@
|
||||||
# Project-specific files
|
|
||||||
arch
|
|
||||||
tgz
|
|
||||||
lcl
|
|
||||||
|
|
||||||
# Flat make libs, binaries, etc
|
|
||||||
/bin/.paths
|
|
||||||
/bin/crossexec
|
|
||||||
/bin/execrate
|
|
||||||
/bin/filter
|
|
||||||
/bin/iffe
|
|
||||||
/bin/ksh
|
|
||||||
/bin/mamake
|
|
||||||
/bin/proto
|
|
||||||
/bin/mktest
|
|
||||||
/bin/pty
|
|
||||||
/bin/regress
|
|
||||||
/bin/rt
|
|
||||||
/bin/shcomp
|
|
||||||
/bin/suid_exec
|
|
||||||
/fun/
|
|
||||||
/include/
|
|
||||||
/lib/file/
|
|
||||||
/lib/*.a
|
|
||||||
/man/
|
|
||||||
|
|
||||||
# Miscellaneous artefacts
|
|
||||||
*.bak
|
|
||||||
*.sav
|
|
||||||
*.old
|
|
||||||
*.orig
|
|
||||||
.*.swp
|
|
||||||
*.DS_Store
|
|
||||||
*~
|
|
||||||
.nfs*
|
|
||||||
*.tmp
|
|
||||||
*.rej
|
|
||||||
*.project
|
|
||||||
*.core
|
|
||||||
core
|
|
||||||
**/#*#
|
|
||||||
tags
|
|
|
@ -1,249 +0,0 @@
|
||||||
Announcing: KornShell 93u+m 1.0.0-beta.2
|
|
||||||
https://github.com/ksh93/ksh
|
|
||||||
|
|
||||||
In May 2020, when every KornShell (ksh93) development project was
|
|
||||||
abandoned, development was rebooted in a new fork based on the last
|
|
||||||
stable AT&T version: ksh 93u+. This new fork is called ksh 93u+m as a
|
|
||||||
permanent nod to its origin. We're restarting it at version 1.0. Seven
|
|
||||||
months after the first beta, the second one is ready. Please test this
|
|
||||||
second beta and report any bugs you find, or help us fix known bugs.
|
|
||||||
|
|
||||||
We're now the default ksh93 in some OS distributions, at least Debian
|
|
||||||
and Slackware! Even though we don't think it's stable release quality
|
|
||||||
yet, the consensus seems to be that 93u+m is already much better than
|
|
||||||
the last AT&T release.
|
|
||||||
|
|
||||||
Main developers: Martijn Dekker, Johnothan King, hyenias
|
|
||||||
|
|
||||||
Contributors: Andy Fiddaman, Anuradha Weeraman, Chase, Gordon Woodhull,
|
|
||||||
Govind Kamat, Harald van Dijk, Lev Kujawski, Marc Wilson, Ryan Schmidt,
|
|
||||||
Sterling Jensen
|
|
||||||
|
|
||||||
HOW TO GET IT
|
|
||||||
|
|
||||||
Please download the source code tarball from our GitHub releases page:
|
|
||||||
|
|
||||||
https://github.com/ksh93/ksh/releases
|
|
||||||
|
|
||||||
To build, follow the instructions in README.md or src/cmd/ksh93/README.
|
|
||||||
|
|
||||||
HOW TO GET INVOLVED
|
|
||||||
|
|
||||||
To report a bug, please open an issue at our GitHub page (see above).
|
|
||||||
Alternatively, email me at martijn@inlv.org with your report.
|
|
||||||
To get involved in development, read the brief policy information in
|
|
||||||
README.md and then jump right in with a pull request or email a patch.
|
|
||||||
See the TODO file in the top-level directory for a to-do list.
|
|
||||||
|
|
||||||
### MAIN CHANGES between 1.0.0-beta.2 and 1.0.0-(unreleased) ###
|
|
||||||
|
|
||||||
New features in built-in commands:
|
|
||||||
|
|
||||||
- Two bash-like flags for 'whence' were backported from ksh 93v-:
|
|
||||||
- 'whence -P/type -P' is an alias to the existing -p flag.
|
|
||||||
- 'whence -t/type -t' will print only the type of a command in a simple
|
|
||||||
format that is designed to be easy to use for scripts. Example:
|
|
||||||
$ type -t typeset; whence -t sh
|
|
||||||
builtin
|
|
||||||
file
|
|
||||||
|
|
||||||
- Added three options to the ulimit builtin with the same names and
|
|
||||||
functionality as in Bash:
|
|
||||||
- 'ulimit -k' sets the maximum number of kqueues.
|
|
||||||
- 'ulimit -P' sets the maximum number of pseudo-terminals.
|
|
||||||
- 'ulimit -R' sets the maximum time in microseconds a real-time process
|
|
||||||
can run before blocking.
|
|
||||||
Note that to use these options the operating system must support the
|
|
||||||
corresponding resource limit.
|
|
||||||
|
|
||||||
### MAIN CHANGES between 1.0.0-beta.1 and 1.0.0-beta.2 ###
|
|
||||||
|
|
||||||
New features in built-in commands:
|
|
||||||
|
|
||||||
- 'cd' now supports an -e option that, when combined with -P, verifies
|
|
||||||
that $PWD is correct after changing directories; this helps detect
|
|
||||||
access permission problems. See:
|
|
||||||
https://www.austingroupbugs.net/view.php?id=253
|
|
||||||
|
|
||||||
- 'printf' now supports a -v option as in bash. This assigns formatted
|
|
||||||
output directly to variables, which is very fast and will not strip
|
|
||||||
final newline (\n) characters.
|
|
||||||
|
|
||||||
- The 'return' command, when used to return from a function, can now
|
|
||||||
return any status value in the 32-bit signed integer range, like on
|
|
||||||
zsh. However, due to a traditional Unix kernel limitation, $? is
|
|
||||||
still trimmed to its least significant 8 bits whenever leaving a
|
|
||||||
(sub)shell environment.
|
|
||||||
|
|
||||||
- 'test'/'[' now supports all the same operators as [[ (including =~,
|
|
||||||
\<, \>) except for the different 'and'/'or' operators. Note that
|
|
||||||
'test'/'[' remains deprecated due to its unfixable pitfalls;
|
|
||||||
[[ ... ]] is recommended instead.
|
|
||||||
|
|
||||||
Shell language changes:
|
|
||||||
|
|
||||||
- Several improvements were made to the --noexec shell code linter.
|
|
||||||
|
|
||||||
- Arithmetic expressions in native ksh mode no longer interpret a
|
|
||||||
number with a leading zero as octal in any context. Use 8#octalnumber
|
|
||||||
instead (e.g. 8#400 == 256). Arithmetic expressions now also behave
|
|
||||||
identically within and outside ((...)) and $((...)).
|
|
||||||
|
|
||||||
- POSIX compatibility mode fixes (only applicable with the --posix shell
|
|
||||||
option on):
|
|
||||||
- A leading zero is now consistently recognised as introducing an octal
|
|
||||||
number in all arithmetic contexts.
|
|
||||||
- $((inf)) and $((nan)) are now interpreted as regular variables.
|
|
||||||
- The '.' built-in no longer runs ksh functions and now only runs
|
|
||||||
files.
|
|
||||||
|
|
||||||
Bugs fixed:
|
|
||||||
|
|
||||||
- '.' and '..' are now once again completed by tab completion.
|
|
||||||
|
|
||||||
- If SIGINT is set to ignore, the interactive shell no longer exits on
|
|
||||||
Ctrl+C.
|
|
||||||
|
|
||||||
- ksh now builds and runs on Apple's new M1 hardware.
|
|
||||||
|
|
||||||
- The 'return' and 'exit' commands no longer risk triggering actual
|
|
||||||
signals by returning or exiting with a status > 256.
|
|
||||||
|
|
||||||
- Ksh no longer behaves badly when parsing a type definition command
|
|
||||||
('typeset -T' or 'enum') without executing it or when executing it in
|
|
||||||
a subshell. Types can now safely be defined in subshells and defined
|
|
||||||
conditionally as in 'if condition; then enum ...; fi'.
|
|
||||||
|
|
||||||
- Discipline functions, especially those applied to PS2 or .sh.tilde,
|
|
||||||
will no longer crash your shell upon being interrupted or throwing an
|
|
||||||
error.
|
|
||||||
|
|
||||||
- Fixed a bug that could corrupt output if standard output is closed
|
|
||||||
upon initialising the shell.
|
|
||||||
|
|
||||||
- Fixed a bug in the [[ ... ]] compound command: the '!' logical
|
|
||||||
negation operator now correctly negates another '!', e.g.,
|
|
||||||
[[ ! ! 1 -eq 1 ]] now returns 0/true. Note that this has always been
|
|
||||||
the case for 'test'/'['.
|
|
||||||
|
|
||||||
- Fixed SHLVL so that replacing ksh by itself (exec ksh) will not
|
|
||||||
increase it.
|
|
||||||
|
|
||||||
- Arithmetic expressions are no longer allowed to assign out-of-range
|
|
||||||
values to variables of types declared with enum.
|
|
||||||
|
|
||||||
- The 'time' keyword no longer makes the --errexit shell option
|
|
||||||
ineffective.
|
|
||||||
|
|
||||||
- Various bugs in libcmd built-in commands (those bound to the
|
|
||||||
/opt/ast/bin path by default) have been fixed.
|
|
||||||
|
|
||||||
- Various other crashing bugs have been fixed.
|
|
||||||
|
|
||||||
Fixes for the shcomp byte code compiler:
|
|
||||||
|
|
||||||
- shcomp is now able to compile scripts that define types using enum.
|
|
||||||
|
|
||||||
- shcomp now refuses to mess up your terminal by writing bytecode
|
|
||||||
to it.
|
|
||||||
|
|
||||||
### MAIN CHANGES between ksh 93u+ 2012-08-01 and 93u+m 1.0.0-beta.1 ###
|
|
||||||
|
|
||||||
Hundreds of bugs have been fixed, including many serious/critical bugs.
|
|
||||||
This includes upstreamed patches from OpenSUSE, Red Hat, and Solaris, fixes
|
|
||||||
backported from the abandoned 93v- beta and ksh2020 fork, as well as many
|
|
||||||
new fixes from the community. See the NEWS file for more information, and
|
|
||||||
the git commit log for complete documentation of every fix. Incompatible
|
|
||||||
changes have been minimised, but not at the expense of fixing bugs. For a
|
|
||||||
list of potentially incompatible changes, see src/cmd/ksh93/COMPATIBILITY.
|
|
||||||
|
|
||||||
Though there was a "no new features, bugfixes only" policy, some new
|
|
||||||
features were found necessary, either to fix serious design flaws or to
|
|
||||||
complete functionality that was evidently intended, but not finished.
|
|
||||||
Below is a summary of these new features.
|
|
||||||
|
|
||||||
New command line editor features:
|
|
||||||
|
|
||||||
- The forward-delete and End keys are now handled as expected in the
|
|
||||||
emacs and vi built-in line editors.
|
|
||||||
|
|
||||||
- In the vi and emacs line editors, repeat count parameters can now also
|
|
||||||
be used for the arrow keys and the forward-delete key. E.g., in emacs
|
|
||||||
mode, <ESC> 7 <left-arrow> will now move the cursor seven positions to
|
|
||||||
the left. In vi control mode, this would be entered as: 7 <left-arrow>.
|
|
||||||
|
|
||||||
New shell language features:
|
|
||||||
|
|
||||||
- The &>file redirection shorthand (for >file 2>&1) is now available for
|
|
||||||
all scripts and interactive sessions and not only for profile/login
|
|
||||||
scripts, bringing ksh 93u+m in line with mksh, bash, and zsh.
|
|
||||||
|
|
||||||
- File name generation (a.k.a. pathname expansion, a.k.a. globbing) now
|
|
||||||
never matches the special navigational names '.' (current directory)
|
|
||||||
and '..' (parent directory). This change makes a pattern like .*
|
|
||||||
useful; it now matches all hidden files (dotfiles) in the current
|
|
||||||
directory, without the harmful inclusion of '.' and '..'.
|
|
||||||
|
|
||||||
- Tilde expansion can now be extended or modified by defining a
|
|
||||||
.sh.tilde.get or .sh.tilde.set discipline function. This replaces a
|
|
||||||
2004 undocumented attempt to add this functionality via a .sh.tilde
|
|
||||||
command, which never worked and crashed the shell. See the manual for
|
|
||||||
details on the new method.
|
|
||||||
|
|
||||||
New features in built-in commands:
|
|
||||||
|
|
||||||
- Usage error messages now show the --help/--man self-documentation options.
|
|
||||||
|
|
||||||
- Path-bound built-ins (such as /opt/ast/bin/cat) can now be executed by
|
|
||||||
invoking the canonical path, so the following will now work as expected:
|
|
||||||
$ /opt/ast/bin/cat --version
|
|
||||||
version cat (AT&T Research) 2012-05-31
|
|
||||||
|
|
||||||
- 'command -x' now looks for external commands only, skipping built-ins.
|
|
||||||
In addition, its xargs-like functionality no longer freezes the shell on
|
|
||||||
Linux and macOS, making it effectively a new feature on these systems.
|
|
||||||
|
|
||||||
- 'redirect' now checks if all arguments are valid redirections before
|
|
||||||
performing them. If an error occurs, it issues an error message instead
|
|
||||||
of terminating the shell.
|
|
||||||
|
|
||||||
- 'suspend' now refuses to suspend a login shell, as there is probably no
|
|
||||||
parent shell to return to and the login session would freeze.
|
|
||||||
|
|
||||||
- 'times' now gives high precision output in a POSIX compliant format.
|
|
||||||
|
|
||||||
- 'typeset' now gives an informative error message if an incompatible
|
|
||||||
combination of options is given.
|
|
||||||
|
|
||||||
- 'whence -v/-a' now reports the location of autoloadable functions.
|
|
||||||
|
|
||||||
New features in shell options:
|
|
||||||
|
|
||||||
- A new --globcasedetect shell option is added on OSs where we can
|
|
||||||
check for a case-insensitive file system (currently Windows/Cygwin,
|
|
||||||
macOS, Linux and QNX 7.0+). When this option is turned on, file name
|
|
||||||
generation (globbing), as well as file name tab completion on
|
|
||||||
interactive shells, automatically become case-insensitive on file
|
|
||||||
systems where the difference between upper and lower case is ignored
|
|
||||||
for file names. This is transparently determined for each directory, so
|
|
||||||
a path pattern that spans multiple file systems can be part
|
|
||||||
case-sensitive and part case-insensitive.
|
|
||||||
|
|
||||||
- A new --nobackslashctrl shell option disables the special escaping
|
|
||||||
behaviour of the backslash character in the emacs and vi built-in
|
|
||||||
editors. Particularly in the emacs editor, this makes it much easier to
|
|
||||||
go backward, insert a forgotten backslash into a command, and then
|
|
||||||
continue editing without having your next cursor key replace your
|
|
||||||
backslash with garbage. Note that Ctrl+V (or whatever other character
|
|
||||||
was set using 'stty lnext') always escapes all control characters in
|
|
||||||
either editing mode.
|
|
||||||
|
|
||||||
- A new --posix shell option has been added to ksh 93u+m that makes the
|
|
||||||
ksh language more compatible with other shells by following the POSIX
|
|
||||||
standard more closely. See the manual page for details. It is enabled by
|
|
||||||
default if ksh is invoked as sh, otherwise it is disabled by default.
|
|
||||||
|
|
||||||
- Enhancement to -G/--globstar: symbolic links to directories are now
|
|
||||||
followed if they match a normal (non-**) glob pattern. For example, if
|
|
||||||
'/lnk' is a symlink to a directory, '/lnk/**' and '/l?k/**' now work as
|
|
||||||
you would expect.
|
|
|
@ -1,146 +0,0 @@
|
||||||
ksh 93u+m general copyright notice
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# The KornShell 93u+m distribution #
|
|
||||||
# Copyright (c) 2021 Contributors to ksh 93u+m #
|
|
||||||
# <https://github.com/ksh93/ksh> #
|
|
||||||
# Derived from AT&T's ast package (see below) #
|
|
||||||
# Licensed under the Eclipse Public License, Version 1.0 #
|
|
||||||
# #
|
|
||||||
# A copy of the License is available at #
|
|
||||||
# http://www.eclipse.org/org/documents/epl-v10.html #
|
|
||||||
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
|
||||||
# #
|
|
||||||
# CONTRIBUTORS #
|
|
||||||
# #
|
|
||||||
# Martijn Dekker <martijn@inlv.org> #
|
|
||||||
# Johnothan King <johnothanking@protonmail.com> #
|
|
||||||
# hyenias <58673227+hyenias@users.noreply.github.com> #
|
|
||||||
# Anuradha Weeraman <anuradha@weeraman.com> #
|
|
||||||
# Chase <nicetrynsa@protonmail.ch> #
|
|
||||||
# Govind Kamat <govind_kamat@yahoo.com> #
|
|
||||||
# Harald van Dijk <harald@gigawatt.nl> #
|
|
||||||
# Lev Kujawski <int21h@mailbox.org> #
|
|
||||||
# Marc Wilson <posguy99@gmail.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
ast package general copyright notice
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1986-2014 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 #
|
|
||||||
# #
|
|
||||||
# CONTRIBUTORS #
|
|
||||||
# #
|
|
||||||
# Glenn Fowler <gsf@research.att.com> #
|
|
||||||
# David Korn <dgk@research.att.com> #
|
|
||||||
# Phong Vo <kpv@research.att.com> #
|
|
||||||
# Adam Edgar <aedgar@research.att.com> #
|
|
||||||
# Adam Buchsbaum <alb@adambuchsbaum.com> #
|
|
||||||
# Aman Shaikh <ashaikh@research.att.com> #
|
|
||||||
# Bala Krishnamurthy <bala@research.att.com> #
|
|
||||||
# Brian Russell <brussell@research.att.com> #
|
|
||||||
# Robin Chen <chen@research.att.com> #
|
|
||||||
# Don Caldwell <dfwc@research.att.com> #
|
|
||||||
# Lefty Koutsofios <ek@research.att.com> #
|
|
||||||
# Bob Gruber <bob.gruber@gmail.com> #
|
|
||||||
# Jia Wang <jiawang@research.att.com> #
|
|
||||||
# Jeff Fellin <jkf@research.att.com> #
|
|
||||||
# Jeff Korn <@google.com> #
|
|
||||||
# Kathleen Fisher <kfisher@research.att.com> #
|
|
||||||
# Ken Church <@microsoft.com> #
|
|
||||||
# Brian Kernigham <bwk@research.bell-labs.com> #
|
|
||||||
# Dennis Ritchie <dmr@research.bell-labs.com> #
|
|
||||||
# Doug McIlroy <doug@research.bell-labs.com> #
|
|
||||||
# Eduardo Krell <ekrell@adexus.cl> #
|
|
||||||
# John Snyder <jjs@adexus.cl> #
|
|
||||||
# Herman Rao <rao@fareastone.att.com.tw> #
|
|
||||||
# AST users mailgroup <ast-users@research.att.com> #
|
|
||||||
# AST developers mailgroup <ast-developers@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
bsd package general copyright notice
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the BSD package #
|
|
||||||
# Copyright (c) 1979-2012 The Regents of the University of California #
|
|
||||||
# #
|
|
||||||
# Redistribution and use in source and binary forms, with or #
|
|
||||||
# without modification, are permitted provided that the following #
|
|
||||||
# conditions are met: #
|
|
||||||
# #
|
|
||||||
# 1. Redistributions of source code must retain the above #
|
|
||||||
# copyright notice, this list of conditions and the #
|
|
||||||
# following disclaimer. #
|
|
||||||
# #
|
|
||||||
# 2. Redistributions in binary form must reproduce the above #
|
|
||||||
# copyright notice, this list of conditions and the #
|
|
||||||
# following disclaimer in the documentation and/or other #
|
|
||||||
# materials provided with the distribution. #
|
|
||||||
# #
|
|
||||||
# 3. Neither the name of The Regents of the University of California#
|
|
||||||
# names of its contributors may be used to endorse or #
|
|
||||||
# promote products derived from this software without #
|
|
||||||
# specific prior written permission. #
|
|
||||||
# #
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND #
|
|
||||||
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, #
|
|
||||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF #
|
|
||||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
|
|
||||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS #
|
|
||||||
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
|
|
||||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED #
|
|
||||||
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, #
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
|
|
||||||
# POSSIBILITY OF SUCH DAMAGE. #
|
|
||||||
# #
|
|
||||||
# Redistribution and use in source and binary forms, with or without #
|
|
||||||
# modification, are permitted provided that the following conditions #
|
|
||||||
# are met: #
|
|
||||||
# 1. Redistributions of source code must retain the above copyright #
|
|
||||||
# notice, this list of conditions and the following disclaimer. #
|
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright #
|
|
||||||
# notice, this list of conditions and the following disclaimer in #
|
|
||||||
# the documentation and/or other materials provided with the #
|
|
||||||
# distribution. #
|
|
||||||
# 3. Neither the name of the University nor the names of its #
|
|
||||||
# contributors may be used to endorse or promote products derived #
|
|
||||||
# from this software without specific prior written permission. #
|
|
||||||
# #
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" #
|
|
||||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
|
|
||||||
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
|
|
||||||
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS #
|
|
||||||
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, #
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT #
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF #
|
|
||||||
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 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 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF #
|
|
||||||
# SUCH DAMAGE. #
|
|
||||||
# #
|
|
||||||
# CONTRIBUTORS #
|
|
||||||
# #
|
|
||||||
# Bill Joy #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
|
@ -1,87 +0,0 @@
|
||||||
## 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.
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,222 +0,0 @@
|
||||||
![](https://github.com/ksh93/ksh/workflows/CI/badge.svg)
|
|
||||||
|
|
||||||
# KornShell 93u+m
|
|
||||||
|
|
||||||
This repository is used to develop bugfixes
|
|
||||||
to the last stable release (93u+ 2012-08-01) of
|
|
||||||
[ksh93](http://www.kornshell.com/),
|
|
||||||
formerly developed by AT&T Software Technology (AST).
|
|
||||||
The sources in this repository were forked from the
|
|
||||||
GitHub [AST repository](https://github.com/att/ast)
|
|
||||||
which is no longer under active development.
|
|
||||||
|
|
||||||
For user-visible fixes, see [NEWS](https://github.com/ksh93/ksh/blame/master/NEWS)
|
|
||||||
and click on commit messages for full details.
|
|
||||||
For all fixes, see [the commit log](https://github.com/ksh93/ksh/commits/).
|
|
||||||
To see what's left to fix, see [the issue tracker](https://github.com/ksh93/ksh/issues).
|
|
||||||
|
|
||||||
## Policy
|
|
||||||
|
|
||||||
1. Fixing bugs is main focus of the 1.x series.
|
|
||||||
Major feature development is for future versions (2.x and up).
|
|
||||||
2. No major rewrites. No refactoring code that is not fully understood.
|
|
||||||
3. No changes in documented behaviour, except if required for compliance with the
|
|
||||||
[POSIX shell language standard](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html)
|
|
||||||
which David Korn [intended](http://www.kornshell.com/info/) for ksh to follow.
|
|
||||||
4. No 100% bug compatibility. Broken and undocumented behaviour gets fixed.
|
|
||||||
5. No bureaucracy, no formalities. Just fix it, or report it: create issues,
|
|
||||||
send pull requests. Every interested party is invited to contribute.
|
|
||||||
6. To help increase everyone's understanding of this code base, fixes and
|
|
||||||
significant changes should be fully documented in commit messages.
|
|
||||||
7. Code style varies somewhat in this historic code base.
|
|
||||||
Your changes should match the style of the code surrounding them.
|
|
||||||
Indent with tabs, assuming an 8-space tab width.
|
|
||||||
Opening braces are on a line of their own, at the same indentation level
|
|
||||||
as their corresponding closing brace.
|
|
||||||
Comments always use `/*`...`*/`.
|
|
||||||
8. Good judgment may override this policy.
|
|
||||||
|
|
||||||
## Why?
|
|
||||||
|
|
||||||
Between 2017 and 2020 there was an ultimately unsuccessful
|
|
||||||
[attempt](https://github.com/att/ast/tree/2020.0.1)
|
|
||||||
to breathe new life into the KornShell by extensively refactoring the last
|
|
||||||
unstable AST beta version (93v-).
|
|
||||||
While that ksh2020 branch is now abandoned and still has many critical bugs,
|
|
||||||
it also had a lot of bugs fixed. More importantly, the AST issue tracker
|
|
||||||
now contains a lot of documentation on how to fix those bugs, which made
|
|
||||||
it possible to backport many of them to the last stable release instead.
|
|
||||||
This ksh 93u+m reboot now incorporates many of these bugfixes,
|
|
||||||
plus patches from
|
|
||||||
[OpenSUSE](https://github.com/ksh93/ksh/wiki/Patch-Upstream-Report:-OpenSUSE),
|
|
||||||
[Red Hat](https://github.com/ksh93/ksh/wiki/Patch-Upstream-Report:-Red-Hat),
|
|
||||||
and
|
|
||||||
[Solaris](https://github.com/ksh93/ksh/wiki/Patch-Upstream-Report:-Solaris),
|
|
||||||
as well as many new fixes from the community
|
|
||||||
([1](https://github.com/ksh93/ksh/pulls?q=is%3Apr+is%3Amerged),
|
|
||||||
[2](https://github.com/ksh93/ksh/issues?q=is%3Aissue+is%3Aclosed+label%3Abug)).
|
|
||||||
Though there are many
|
|
||||||
[bugs left to fix](https://github.com/ksh93/ksh/issues),
|
|
||||||
we are confident at this point that 93u+m is already the least buggy branch
|
|
||||||
of ksh93 ever released.
|
|
||||||
|
|
||||||
## Build
|
|
||||||
|
|
||||||
To build ksh with a custom configuration of features, edit
|
|
||||||
[`src/cmd/ksh93/SHOPT.sh`](https://github.com/ksh93/ksh/blob/master/src/cmd/ksh93/SHOPT.sh).
|
|
||||||
|
|
||||||
Then `cd` to the top directory and run:
|
|
||||||
```sh
|
|
||||||
bin/package make
|
|
||||||
```
|
|
||||||
|
|
||||||
The compiled binaries are stored in the `arch` directory, in a subdirectory
|
|
||||||
that corresponds to your architecture. The command `bin/package host type`
|
|
||||||
outputs the name of this subdirectory.
|
|
||||||
|
|
||||||
If you have trouble or want to tune the binaries, you may pass additional
|
|
||||||
compiler and linker flags. It is usually best to export these as environment
|
|
||||||
variables *before* running `bin/package` as they could change the name of
|
|
||||||
the build subdirectory of the `arch` directory, so exporting them is a
|
|
||||||
convenient way to keep them consistent between build and test commands.
|
|
||||||
**Note that this system uses `CCFLAGS` instead of the usual `CFLAGS`.**
|
|
||||||
An example that makes Solaris Studio cc produce a 64-bit binary:
|
|
||||||
```sh
|
|
||||||
export CCFLAGS="-m64 -O" LDFLAGS="-m64"
|
|
||||||
bin/package make
|
|
||||||
```
|
|
||||||
Alternatively you can append these to the command, and they will only be
|
|
||||||
used for that command. You can also specify an alternative shell in which
|
|
||||||
to run the build scripts this way. For example:
|
|
||||||
```sh
|
|
||||||
bin/package make SHELL=/bin/bash CCFLAGS="-O2 -I/opt/local/include" LDFLAGS="-L/opt/local/lib"
|
|
||||||
```
|
|
||||||
|
|
||||||
For more information run
|
|
||||||
```sh
|
|
||||||
bin/package help
|
|
||||||
```
|
|
||||||
Many other commands in this repo self-document via the `--help`, `--man` and
|
|
||||||
`--html` options; those that do have no separate manual page.
|
|
||||||
|
|
||||||
### Test
|
|
||||||
|
|
||||||
After compiling, you can run the regression tests.
|
|
||||||
Start by reading the information printed by:
|
|
||||||
```sh
|
|
||||||
bin/shtests --man
|
|
||||||
```
|
|
||||||
|
|
||||||
### Install
|
|
||||||
|
|
||||||
Automated installation is not supported yet.
|
|
||||||
To install manually:
|
|
||||||
```sh
|
|
||||||
cp arch/$(bin/package host type)/bin/ksh /usr/local/bin/
|
|
||||||
cp src/cmd/ksh93/sh.1 /usr/local/share/man/man1/ksh.1
|
|
||||||
```
|
|
||||||
(adapting the destination directories as required).
|
|
||||||
|
|
||||||
## What is ksh93?
|
|
||||||
|
|
||||||
The following is the official AT&T description from 1993 that came with the
|
|
||||||
ast-open distribution. The text is original, but hyperlinks were added here.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
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](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html).
|
|
||||||
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](http://www.opengroup.org/austin/papers/posix_faq.html)
|
|
||||||
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 hierarchical 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.
|
|
|
@ -1,124 +0,0 @@
|
||||||
TODO for ksh 93u+m
|
|
||||||
|
|
||||||
See the issue tracker for up-to-date information:
|
|
||||||
https://github.com/ksh93/ksh/issues
|
|
||||||
|
|
||||||
______
|
|
||||||
Enhancements to do:
|
|
||||||
|
|
||||||
* Add -T (-o functrace) option as in bash
|
|
||||||
https://github.com/ksh93/ksh/issues/162
|
|
||||||
|
|
||||||
* History pattern search menu (SHOPT_EDPREDICT) needs work
|
|
||||||
https://github.com/ksh93/ksh/issues/233
|
|
||||||
|
|
||||||
* Use real pipes instead of sockets
|
|
||||||
https://github.com/ksh93/ksh/issues/327
|
|
||||||
|
|
||||||
______
|
|
||||||
Known bugs in ksh 93u+m 1.0.0-beta.2 (HELP IS WANTED to fix these):
|
|
||||||
|
|
||||||
* Memory leak when initialising associative array in subshell
|
|
||||||
https://github.com/ksh93/ksh/issues/94
|
|
||||||
|
|
||||||
* command substitution botches output of non-waited-for child processes
|
|
||||||
https://github.com/ksh93/ksh/issues/124
|
|
||||||
|
|
||||||
* Intermittent coprocess hang on Debian/Ubuntu and Solaris
|
|
||||||
https://github.com/ksh93/ksh/issues/132
|
|
||||||
|
|
||||||
* wrong typeset -p output after unsetting multidimensional array elements
|
|
||||||
https://github.com/ksh93/ksh/issues/148
|
|
||||||
|
|
||||||
* File descriptor is unexpectedly closed after exec in subshell
|
|
||||||
https://github.com/ksh93/ksh/issues/161
|
|
||||||
|
|
||||||
* printf %T date parsing: GNU-style "ago" date spec completely broken
|
|
||||||
https://github.com/ksh93/ksh/issues/182
|
|
||||||
|
|
||||||
* typeset -L/-R: string length breaks on multibyte characters
|
|
||||||
https://github.com/ksh93/ksh/issues/189
|
|
||||||
|
|
||||||
* Linux i386: variable expansion corruption in single-line function
|
|
||||||
https://github.com/ksh93/ksh/issues/203
|
|
||||||
|
|
||||||
* Segfault with very large extended glob patterns
|
|
||||||
https://github.com/ksh93/ksh/issues/207
|
|
||||||
|
|
||||||
* funcname.ksh crashes under standard malloc
|
|
||||||
https://github.com/ksh93/ksh/issues/212
|
|
||||||
|
|
||||||
* process substitution cannot be part of a larger argument
|
|
||||||
https://github.com/ksh93/ksh/issues/215
|
|
||||||
|
|
||||||
* Compound array regression on OpenBSD with standard malloc
|
|
||||||
https://github.com/ksh93/ksh/issues/229
|
|
||||||
|
|
||||||
* 'typeset -m'-related crash on OpenBSD compiled with standard malloc
|
|
||||||
https://github.com/ksh93/ksh/issues/231
|
|
||||||
|
|
||||||
* Freeze/crash on OpenBSD with -D_std_malloc involving typeset and command substitution
|
|
||||||
https://github.com/ksh93/ksh/issues/264
|
|
||||||
|
|
||||||
* Nested compound assignment misparsed in $(...) command substitution
|
|
||||||
https://github.com/ksh93/ksh/issues/269
|
|
||||||
|
|
||||||
* Crash on bin/shtests -px heredoc
|
|
||||||
https://github.com/ksh93/ksh/issues/306
|
|
||||||
|
|
||||||
* Multibyte characters get corrupted when KEYBD trap is set
|
|
||||||
https://github.com/ksh93/ksh/issues/307
|
|
||||||
|
|
||||||
* .sh.match index array result issues, crash after unset
|
|
||||||
https://github.com/ksh93/ksh/issues/308
|
|
||||||
|
|
||||||
* Builtins don't handle I/O errors
|
|
||||||
https://github.com/ksh93/ksh/issues/313
|
|
||||||
|
|
||||||
* block devices not seekable when open on fd 0, 1 or 2
|
|
||||||
https://github.com/ksh93/ksh/issues/318
|
|
||||||
|
|
||||||
* bug in printf when %b and %x$ are used in same format
|
|
||||||
https://github.com/ksh93/ksh/issues/324
|
|
||||||
|
|
||||||
* namespaces don't work properly when defined within functions
|
|
||||||
https://github.com/ksh93/ksh/issues/325
|
|
||||||
|
|
||||||
* Associative arrays of various types fail to be unset
|
|
||||||
https://github.com/ksh93/ksh/issues/345
|
|
||||||
|
|
||||||
* types survive exec of hashbangless script
|
|
||||||
https://github.com/ksh93/ksh/issues/350
|
|
||||||
|
|
||||||
* Backtick command substitutions can't nest double quotes
|
|
||||||
https://github.com/ksh93/ksh/issues/352
|
|
||||||
|
|
||||||
* Line continuation breakage within $(comsub)
|
|
||||||
https://github.com/ksh93/ksh/issues/367
|
|
||||||
|
|
||||||
______
|
|
||||||
Fix regression test failures:
|
|
||||||
|
|
||||||
- There are some serious regression test failures on OpenBSD when ksh
|
|
||||||
is compiled with AST vmalloc disabled, so the system standard malloc(3)
|
|
||||||
is used. These probably represent real ksh93 bugs exposed by OpenBSD's
|
|
||||||
security hardening mechanisms.
|
|
||||||
|
|
||||||
- Several known memory leaks have their tests disabled in tests/leaks.sh
|
|
||||||
and are marked TODO. These need tracking down and fixing.
|
|
||||||
|
|
||||||
______
|
|
||||||
Fix currently known bugs affecting shell scripting. These are identified by
|
|
||||||
their modernish IDs. For exact details, see code/comments in:
|
|
||||||
https://github.com/modernish/modernish/tree/0.16/lib/modernish/cap/
|
|
||||||
|
|
||||||
- BUG_BRACQUOT: shell quoting within bracket patterns has no effect. This
|
|
||||||
bug means the '-' retains it special meaning of 'character range', and an
|
|
||||||
initial ! (and, on some shells, ^) retains the meaning of negation, even
|
|
||||||
in quoted strings within bracket patterns, including quoted variables.
|
|
||||||
|
|
||||||
- BUG_IFSGLOBS: In glob pattern matching (as in case or parameter
|
|
||||||
substitution with # and %), if IFS starts with ? or * and the "$*"
|
|
||||||
parameter expansion inserts any IFS separator characters, those characters
|
|
||||||
are erroneously interpreted as wildcards when quoted "$*" is used as the
|
|
||||||
glob pattern.
|
|
|
@ -1,33 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches
|
|
||||||
let() { return $((!($1))); }
|
|
||||||
|
|
||||||
# Automatically (re-)indent make...done blocks in a Mamfile.
|
|
||||||
# Usage: Mamfile_indent <Mamfile >Mamfile.new
|
|
||||||
#
|
|
||||||
# Should work on all current POSIX compliant shells.
|
|
||||||
# By Martijn Dekker <martijn@inlv.org>, 2021. Public domain.
|
|
||||||
|
|
||||||
# Spacing per indentation level. Edit to change style.
|
|
||||||
indent=' ' # one tab
|
|
||||||
|
|
||||||
# Remove existing indentation, add new indentation.
|
|
||||||
indentlvl=0
|
|
||||||
sed 's/^[[:space:]]*//' \
|
|
||||||
| while read -r line
|
|
||||||
do case $line in
|
|
||||||
'') continue ;;
|
|
||||||
done*) let "indentlvl -= 1" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
spc=
|
|
||||||
i=0
|
|
||||||
while let "(i += 1) <= indentlvl"
|
|
||||||
do spc=$indent$spc
|
|
||||||
done
|
|
||||||
printf '%s\n' $spc$line
|
|
||||||
|
|
||||||
case $line in
|
|
||||||
make*) let "indentlvl += 1" ;;
|
|
||||||
esac
|
|
||||||
done
|
|
|
@ -1,30 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches
|
|
||||||
CCn='
|
|
||||||
' # newline
|
|
||||||
let() { return $((!($1))); }
|
|
||||||
|
|
||||||
# Remove unused variable definitions from a Mamfile.
|
|
||||||
# Usage: Mamfile_rm_unused_vars <Mamfile >Mamfile.new
|
|
||||||
#
|
|
||||||
# Should work on all current POSIX compliant shells.
|
|
||||||
# By Martijn Dekker <martijn@inlv.org>, 2021. Public domain.
|
|
||||||
#
|
|
||||||
# All variables are declared with 'setv' and they are used if an expansion
|
|
||||||
# of the form ${varname} exists (the braces are mandatory in Mamfiles).
|
|
||||||
|
|
||||||
mamfile=$(let $# && cat "$1" || cat)
|
|
||||||
vars=$(printf '%s\n' $mamfile | awk '$1 == "setv" { print $2; }')
|
|
||||||
rm_unused_ere=
|
|
||||||
IFS=$CCn; for varname in $vars; do IFS=
|
|
||||||
case $mamfile in
|
|
||||||
*"\${$varname}"* )
|
|
||||||
;;
|
|
||||||
* ) # add with '|' separator for Extended Regular Expression
|
|
||||||
rm_unused_ere="${rm_unused_ere:+$rm_unused_ere|}setv[[:blank:]]+$varname([[:blank:]]|$)" ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
case $rm_unused_ere in
|
|
||||||
'') printf '%s\n' $mamfile ;;
|
|
||||||
*) printf '%s\n' $mamfile | grep -vE $rm_unused_ere ;;
|
|
||||||
esac
|
|
|
@ -1,37 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
# non-ksh script for the nmake ignore prefix
|
|
||||||
# @(#)ignore (ksh 93u+m) 2021-12-31
|
|
||||||
|
|
||||||
while :
|
|
||||||
do case $# in
|
|
||||||
0) exit 0 ;;
|
|
||||||
esac
|
|
||||||
case $1 in
|
|
||||||
*=*) export "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*) break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
"$@"
|
|
||||||
exit 0
|
|
|
@ -1,274 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
### this script contains archaic constructs that work with all sh variants ###
|
|
||||||
# mamprobe - generate MAM cc probe info
|
|
||||||
# Glenn Fowler <gsf@research.att.com>
|
|
||||||
|
|
||||||
(command set -o posix) 2>/dev/null && set -o posix
|
|
||||||
|
|
||||||
command=mamprobe
|
|
||||||
|
|
||||||
bins=`
|
|
||||||
(
|
|
||||||
userPATH=$PATH
|
|
||||||
PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH
|
|
||||||
getconf PATH 2>/dev/null && echo "$userPATH" || echo /bin:/usr/bin:/sbin:/usr/sbin:"$userPATH"
|
|
||||||
) | sed 's/:/ /g'
|
|
||||||
` || exit
|
|
||||||
|
|
||||||
# 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=${TMPDIR:-/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 <<!
|
|
||||||
q
|
|
||||||
!
|
|
||||||
) < /dev/null > /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 $bins
|
|
||||||
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
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,54 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
# Wrapper script to run the ksh93 regression tests without requiring nmake.
|
|
||||||
# By Martijn Dekker <martijn@inlv.org> 2020-05-14
|
|
||||||
# Public domain. http://creativecommons.org/publicdomain/zero/1.0/
|
|
||||||
#
|
|
||||||
# The manual: bin/shtests --man
|
|
||||||
# Brief help: bin/shtests --help
|
|
||||||
#
|
|
||||||
# By default, this runs your compiled arch/*/bin/ksh.
|
|
||||||
#
|
|
||||||
# Note: The test suite actually uses $SHELL to indicate the shell to test. But
|
|
||||||
# we cannot use the $SHELL environment value on entry to this wrapper script,
|
|
||||||
# as that is already used for the user's default login shell on most systems.
|
|
||||||
|
|
||||||
# Process and remove any assignment-argument indicating the shell to test
|
|
||||||
for arg do
|
|
||||||
case $arg in
|
|
||||||
( SHELL=* | KSH=* )
|
|
||||||
KSH=${arg#*=} ;;
|
|
||||||
( * ) set -- "$@" "$1" ;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
# Find root dir of ksh source
|
|
||||||
mydir=$(dirname "$0") \
|
|
||||||
&& mydir=$(CDPATH='' cd -P -- "$mydir/.." && printf '%sX' "$PWD") \
|
|
||||||
&& mydir=${mydir%X} \
|
|
||||||
|| exit
|
|
||||||
myarch=$("$mydir/bin/package" host type) || exit
|
|
||||||
|
|
||||||
# Check if there is a ksh to test.
|
|
||||||
case ${KSH+set} in
|
|
||||||
( '' ) KSH=$mydir/arch/$myarch/bin/ksh ;;
|
|
||||||
esac
|
|
||||||
if ! test -x "$KSH" || ! test -f "$KSH"; then
|
|
||||||
printf '%s: shell not found: %s\n' "${0##*/}" "$KSH" >&2
|
|
||||||
printf 'Specify a shell like: KSH=path/to/ksh bin/shtests\n' >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure absolute path to ksh
|
|
||||||
KSH=$(CDPATH='' cd -P -- "$(dirname "$KSH")" \
|
|
||||||
&& printf '%s/%sX' "$PWD" "${KSH##*/}") \
|
|
||||||
&& KSH=${KSH%X}
|
|
||||||
|
|
||||||
# Run the test suite
|
|
||||||
CDPATH='' cd -P -- "$mydir/src/cmd/ksh93/tests" || exit
|
|
||||||
SHELL=$KSH
|
|
||||||
INSTALLROOT=${INSTALLROOT:-$mydir/arch/$myarch}
|
|
||||||
export SHELL INSTALLROOT
|
|
||||||
unset -v KSH
|
|
||||||
printf '#### Regression-testing %s ####\n' "$SHELL"
|
|
||||||
exec "$SHELL" shtests "$@"
|
|
|
@ -1,36 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
# non-ksh stub for the nmake silent prefix
|
|
||||||
# @(#)silent (ksh 93u+m) 2021-12-31
|
|
||||||
|
|
||||||
while :
|
|
||||||
do case $# in
|
|
||||||
0) exit 0 ;;
|
|
||||||
esac
|
|
||||||
case $1 in
|
|
||||||
*=*) export "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*) break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
"$@"
|
|
|
@ -1,6 +0,0 @@
|
||||||
<html>
|
|
||||||
<head><title>AST Software</title></head>
|
|
||||||
<body>
|
|
||||||
<a href='ksh/index.html'>The KornShell</a><br>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,710 +0,0 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
||||||
<HTML>
|
|
||||||
<HEAD>
|
|
||||||
<META name="generator" content="mm2html (AT&T Research) 2012-01-11">
|
|
||||||
<TITLE> www/ksh/builtins.mm mm document </TITLE>
|
|
||||||
<META name="author" content="gsf+dgk+kpv">
|
|
||||||
<STYLE type="text/css">
|
|
||||||
div.FI { padding-left:2em; text-indent:0em; }
|
|
||||||
div.HI { padding-left:4em; text-indent:-2em; }
|
|
||||||
dt { float:left; clear:both; }
|
|
||||||
dd { margin-left:3em; }
|
|
||||||
</STYLE>
|
|
||||||
</HEAD>
|
|
||||||
<BODY bgcolor=white link=slateblue vlink=teal >
|
|
||||||
<TABLE border=0 align=center width=96%>
|
|
||||||
<TBODY><TR><TD valign=top align=left>
|
|
||||||
<!--INDEX--><!--/INDEX-->
|
|
||||||
<P>
|
|
||||||
<CENTER>
|
|
||||||
<H3><CENTER><FONT color=red><FONT face=courier>Guidelines for writing <TT>ksh-93</TT> built-in commands</FONT></FONT></CENTER></H3>
|
|
||||||
<BR>David G. Korn
|
|
||||||
<P><I></I>
|
|
||||||
</CENTER>
|
|
||||||
<P>
|
|
||||||
<CENTER><FONT color=red><FONT face=courier><H3 align=center><A name="Abstract">Abstract</A></H3></FONT></FONT></CENTER>
|
|
||||||
One of the features of <TT>ksh93</TT>, the latest version of <TT>ksh</TT>,
|
|
||||||
is the ability to add built-in commands at run time.
|
|
||||||
This feature only works on operating systems that have the ability
|
|
||||||
to load and link code into the current process at run time.
|
|
||||||
Some examples of the systems that have this feature
|
|
||||||
are Linux, System V Release 4, Solaris, Sun OS, HP-UX Release 8 and above,
|
|
||||||
AIX 3.2 and above, and Microsoft Windows systems.
|
|
||||||
<P>
|
|
||||||
This memo describes how to write and compile programs
|
|
||||||
that can be loaded into <TT>ksh</TT> at run time as built-in
|
|
||||||
commands.
|
|
||||||
<P>
|
|
||||||
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="INTRODUCTION">INTRODUCTION</A></H3></FONT></FONT></CENTER>
|
|
||||||
A built-in command is executed without creating a separate process.
|
|
||||||
Instead, the command is invoked as a C function by <TT>ksh</TT>.
|
|
||||||
If this function has no side effects in the shell process,
|
|
||||||
then the behavior of this built-in is identical to that of
|
|
||||||
the equivalent stand-alone command. The primary difference
|
|
||||||
in this case is performance. The overhead of process creation
|
|
||||||
is eliminated. For commands of short duration, the effect
|
|
||||||
can be dramatic. For example, on SUN OS 4.1, the time to
|
|
||||||
run <TT>wc</TT> on a small file of about 1000 bytes, runs
|
|
||||||
about 50 times faster as a built-in command.
|
|
||||||
<P>
|
|
||||||
In addition, built-in commands may have side effects on the
|
|
||||||
shell environment.
|
|
||||||
This is usually done to extend the application domain for
|
|
||||||
shell programming. For example, there is a group of X-windows extension
|
|
||||||
built-ins that make heavy use of the shell variable namespace.
|
|
||||||
These built-ins are added at run time and
|
|
||||||
result in a windowing shell that can be used to write
|
|
||||||
X-windows applications.
|
|
||||||
<P>
|
|
||||||
While there are definite advantages to adding built-in
|
|
||||||
commands, there are some disadvantages as well.
|
|
||||||
Since the built-in command and <TT>ksh</TT> share the same
|
|
||||||
address space, a coding error in the built-in program
|
|
||||||
may affect the behavior of <TT>ksh</TT>; perhaps causing
|
|
||||||
it to core dump or hang.
|
|
||||||
Debugging is also more complex since your code is now
|
|
||||||
a part of a larger entity.
|
|
||||||
The isolation provided by a separate process
|
|
||||||
guarantees that all resources used by the command
|
|
||||||
will be freed when the command completes.
|
|
||||||
Resources used by a built-in must be meticulously maintained and freed.
|
|
||||||
Also, since the address space of <TT>ksh</TT> will be larger when built-in are loaded,
|
|
||||||
it may increase the time it takes <TT>ksh</TT> to fork() and
|
|
||||||
exec() non-built-in commands.
|
|
||||||
It makes no sense to add a built-in command that takes
|
|
||||||
a long time to run or that is run only once, since the performance
|
|
||||||
benefits will be negligible.
|
|
||||||
Built-ins that have side effects in the current shell
|
|
||||||
environment have the disadvantage of increasing the
|
|
||||||
coupling between the built-in and <TT>ksh</TT>, making
|
|
||||||
the overall system less modular and more monolithic.
|
|
||||||
<P>
|
|
||||||
Despite these drawbacks, in many cases extending
|
|
||||||
<TT>ksh</TT> by adding built-in
|
|
||||||
commands makes sense and allows reuse of the shell
|
|
||||||
scripting ability in an application specific domain.
|
|
||||||
This memo describes how to write <TT>ksh</TT> extensions.
|
|
||||||
<P>
|
|
||||||
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="WRITING BUILT-IN COMMANDS">WRITING BUILT-IN COMMANDS</A></H3></FONT></FONT></CENTER>
|
|
||||||
There is a development kit available for writing <TT>ksh</TT>
|
|
||||||
built-ins as part of the AST (AT&T Software Technology) Toolkit.
|
|
||||||
The development kit has three directories,
|
|
||||||
<TT>include</TT>, <TT>lib</TT>, and <TT>bin</TT>.
|
|
||||||
It is best to set the value of the environment variable
|
|
||||||
<TT>PACKAGE_ast</TT> to the pathname of the directory
|
|
||||||
containing the development kit.
|
|
||||||
The <TT>include</TT> directory contains a subdirectory
|
|
||||||
named <TT>ast</TT> that contains interface prototypes
|
|
||||||
for functions that you can call from built-ins. The <TT>lib</TT>
|
|
||||||
directory contains the <TT>ast</TT> library
|
|
||||||
and a library named <TT>cmd</TT> that contains a version
|
|
||||||
of several of the standard POSIX<FONT SIZE=-6>[1]</FONT>
|
|
||||||
utilities that can be made run time built-ins.
|
|
||||||
The <TT>lib/ksh</TT> directory contains shared libraries
|
|
||||||
that implement other <TT>ksh</TT> built-ins.
|
|
||||||
The <TT>bin</TT> directory contains build tools such as <TT>nmake</TT><FONT SIZE=-6>[2]</FONT>.
|
|
||||||
To add built-ins at runtime, it is necessary to build a shared library
|
|
||||||
containing one or more built-ins that you wish to add.
|
|
||||||
The built-ins are then added by running <TT>builtin -f</TT> <EM>shared_lib</EM>.
|
|
||||||
Since the procedure for building share libraries is system dependent,
|
|
||||||
it is best to use
|
|
||||||
<TT>nmake</TT>
|
|
||||||
using the sample nmake makefile below as a prototype.
|
|
||||||
The AST Toolkit also contains some examples of built-in libraries under
|
|
||||||
the <TT>src/cmd/kshlib</TT> directory.
|
|
||||||
<P>
|
|
||||||
There are two ways to code adding built-ins. One method is to replace
|
|
||||||
the function <TT>main</TT> with a function
|
|
||||||
<TT>b_</TT><EM>name</EM>, where <EM>name</EM> is the name
|
|
||||||
of the built-in you wish to define.
|
|
||||||
A built-in command has a calling convention similar to
|
|
||||||
the <TT>main</TT> function of a program,
|
|
||||||
<TT>int main(int argc, char *argv[])</TT>.
|
|
||||||
except that it takes a third argument of type <TT>Shbltin_t*</TT> which can
|
|
||||||
be passed as <TT><FONT SIZE=-1>NULL</FONT></TT> if it is not used. The definition for
|
|
||||||
<TT>Shbltin_t*</TT> is in <TT><ast/shcmd.h></TT>.
|
|
||||||
Instead of <TT>exit</TT>, you need to use <TT>return</TT>
|
|
||||||
to terminate your command.
|
|
||||||
The return value will become the exit status of the command.
|
|
||||||
The <TT>open</TT> built-in, installed in <TT>lib/ksh</TT> in the AST Toolkit, uses this method.
|
|
||||||
The <TT>Shbltin_t</TT> structure contains a field named <TT>shp</TT> which is
|
|
||||||
a pointer to the shell data that is needed for <TT>shell</TT> library callbacks.
|
|
||||||
It also contains the fields, <TT>shrun</TT>, <TT>shtrap</TT>, <TT>shexit</TT>,
|
|
||||||
and <TT>shbltin</TT>
|
|
||||||
that are function pointers to the <TT>shell</TT> library functions <TT>sh_run</TT>, <TT>sh_trap</TT>
|
|
||||||
<TT>sh_exit</TT>, and <TT>sh_addbuiltin</TT>, respectively. These functions
|
|
||||||
can be invoked without the need for runtime symbol lookup when the
|
|
||||||
shell is statically linked with <TT>libshell</TT>.
|
|
||||||
<P>
|
|
||||||
The alternative method is to create a function <TT>lib_init</TT> and
|
|
||||||
use the <TT>Shbltin_t.shbltin()</TT> function to add one or more built-ins.
|
|
||||||
The <TT>lib_init</TT> function will be called with two arguments. The
|
|
||||||
first argument will be 0 when the library is loaded and the second
|
|
||||||
argument will be of type <TT>Shbltin_t*</TT>.
|
|
||||||
The <TT>dbm_t</TT> and <TT>dss</TT> shell built-ins use this method.
|
|
||||||
<P>
|
|
||||||
No matter which way you add built-ins you should add the line
|
|
||||||
<TT>SHLIB(</TT><EM>identifier</EM><TT>)</TT> as the last line of one
|
|
||||||
of the built-in source file, where <EM>identifier</EM> is any C identifier.
|
|
||||||
This line provides version information to the shell <TT>builtin</TT> command
|
|
||||||
that it uses to verify compatibility between the built-in and <TT>ksh</TT>
|
|
||||||
implementation versions. <TT>builtin</TT> fails with a diagnostic on version
|
|
||||||
mismatch. The diagnostic helps determine whether <TT>ksh</TT> is out of
|
|
||||||
date and requires an upgrade or the built-in is out of date and requires
|
|
||||||
recompilation.
|
|
||||||
<P>
|
|
||||||
The steps necessary to create and add a run time built-in are
|
|
||||||
illustrated in the following simple example.
|
|
||||||
Suppose you wish to add a built-in command named <TT>hello</TT>
|
|
||||||
which requires one argument and prints the word hello followed
|
|
||||||
by its argument. First, write the following program in the file
|
|
||||||
<TT>hello.c</TT>:
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
#include <stdio.h>
|
|
||||||
int b_hello(int argc, char *argv[], void *context)
|
|
||||||
{
|
|
||||||
if(argc != 2)
|
|
||||||
{
|
|
||||||
fprintf(stderr,"Usage: hello arg\n");
|
|
||||||
return(2);
|
|
||||||
}
|
|
||||||
printf("hello %s\n",argv[1]);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
SHLIB(hello)
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
<P>
|
|
||||||
Next, the program needs to be compiled.
|
|
||||||
If you are building with AT&T <TT>nmake</TT> use the following <TT>Makefile</TT>:
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
:PACKAGE: --shared ast
|
|
||||||
hello plugin=ksh :LIBRARY: hello.c
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
and run <TT>nmake install</TT> to compile, link, and install the built-in shared library
|
|
||||||
in <TT>lib/ksh/</TT> under <TT>PACKAGE_ast</TT>.
|
|
||||||
If the built-in extension uses several <TT>.c</TT> files, list all of these on
|
|
||||||
the <TT>:LIBRARY:</TT> line.
|
|
||||||
<P>
|
|
||||||
Otherwise you will have to compile <TT>hello.c</TT> with an option
|
|
||||||
to pick up the AST include directory
|
|
||||||
(since the AST <TT><stdio.h></TT> is required for <TT>ksh</TT> compatibility)
|
|
||||||
and options required for generating shared libraries.
|
|
||||||
For example, on Linux use this to compile:
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
cc -fpic -I$PACKAGE_ast/include/ast -c hello.c
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
and use the appropriate link line.
|
|
||||||
It really is best to use <TT>nmake</TT> because the 2 line Makefile above
|
|
||||||
will work on all systems that have <TT>ksh</TT> installed.
|
|
||||||
<P>
|
|
||||||
If you have several built-ins, it is desirable
|
|
||||||
to build a shared library that contains them all.
|
|
||||||
<P>
|
|
||||||
The final step is using the built-in.
|
|
||||||
This can be done with the <TT>ksh</TT> command <TT>builtin</TT>.
|
|
||||||
To load the shared library <TT>libhello.so</TT> from the current directory
|
|
||||||
and add the built-in <TT>hello</TT>, invoke the command,
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
builtin -f ./libhello.so hello
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
The shared library prefix (<TT>lib</TT> here) and suffix (<TT>.so</TT> here) be omitted;
|
|
||||||
the shell will add an appropriate suffix
|
|
||||||
for the system that it is loading from.
|
|
||||||
If you install the shared library in <TT>lib/ksh/</TT>, where <TT>../lib/ksh/</TT> is
|
|
||||||
a directory on <STRONG>$PATH</STRONG>, the command
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
builtin -f hello hello
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
will automatically find, load and install the built-in on any system.
|
|
||||||
Once this command has been invoked, you can invoke <TT>hello</TT>
|
|
||||||
as you do any other command.
|
|
||||||
If you are using <TT>lib_init</TT> method to add built-ins then no arguments
|
|
||||||
follow the <TT>-f</TT> option.
|
|
||||||
<P>
|
|
||||||
It is often desirable to make a command <EM>built-in</EM>
|
|
||||||
the first time that it is referenced. The first
|
|
||||||
time <TT>hello</TT> is invoked, <TT>ksh</TT> should load and execute it,
|
|
||||||
whereas for subsequent invocations <TT>ksh</TT> should just execute the built-in.
|
|
||||||
This can be done by creating a file named <TT>hello</TT>
|
|
||||||
with the following contents:
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
function hello
|
|
||||||
{
|
|
||||||
unset -f hello
|
|
||||||
builtin -f hello hello
|
|
||||||
hello "$@"
|
|
||||||
}
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
This file <TT>hello</TT> needs to be placed in a directory that is
|
|
||||||
in your <STRONG><FONT SIZE=-1>FPATH</FONT></STRONG> variable, and the built-in shared library
|
|
||||||
should be installed in <TT>lib/ksh/</TT>, as described above.
|
|
||||||
<P>
|
|
||||||
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="CODING REQUIREMENTS AND CONVENTIONS">CODING REQUIREMENTS AND CONVENTIONS</A></H3></FONT></FONT></CENTER>
|
|
||||||
As mentioned above, the entry point for built-ins must either be of
|
|
||||||
the form <TT>b_</TT><EM>name</EM> or else be loaded from a function named
|
|
||||||
<TT>lib_init</TT>.
|
|
||||||
Your built-ins can call functions from the standard C library,
|
|
||||||
the <TT>ast</TT> library, interface functions provided by <TT>ksh</TT>,
|
|
||||||
and your own functions.
|
|
||||||
You should avoid using any global symbols beginning with
|
|
||||||
<STRONG>sh_</STRONG>,
|
|
||||||
<STRONG>nv_</STRONG>,
|
|
||||||
and
|
|
||||||
<STRONG>ed_</STRONG>
|
|
||||||
since these are used by <TT>ksh</TT> itself.
|
|
||||||
<TT>#define</TT> constants in <TT>ksh</TT> interface
|
|
||||||
files use symbols beginning with <TT>SH_</TT> and <TT>NV_</TT>,
|
|
||||||
so avoid using names beginning with these too.
|
|
||||||
<P>
|
|
||||||
<H4><A name="Header Files">Header Files</A></H4>
|
|
||||||
The development kit provides a portable interface
|
|
||||||
to the C library and to libast.
|
|
||||||
The header files in the development kit are compatible with
|
|
||||||
K&R C<FONT SIZE=-6>[3]</FONT>,
|
|
||||||
ANSI C<FONT SIZE=-6>[4]</FONT>,
|
|
||||||
and C++<FONT SIZE=-6>[5]</FONT>.
|
|
||||||
<P>
|
|
||||||
The best thing to do is to include the header file <TT><shell.h></TT>.
|
|
||||||
This header file causes the <TT><ast.h></TT> header, the
|
|
||||||
<TT><error.h></TT> header and the <TT><stak.h></TT>
|
|
||||||
header to be included as well as defining prototypes
|
|
||||||
for functions that you can call to get shell
|
|
||||||
services for your builtins.
|
|
||||||
The header file <TT><ast.h></TT>
|
|
||||||
provides prototypes for many <STRONG>libast</STRONG> functions
|
|
||||||
and all the symbol and function definitions from the
|
|
||||||
ANSI C headers, <TT><stddef.h></TT>,
|
|
||||||
<TT><stdlib.h></TT>, <TT><stdarg.h></TT>, <TT><limits.h></TT>,
|
|
||||||
and <TT><string.h></TT>.
|
|
||||||
It also provides all the symbols and definitions for the
|
|
||||||
POSIX<FONT SIZE=-6>[6]</FONT>
|
|
||||||
headers <TT><sys/types.h></TT>, <TT><fcntl.h></TT>, and
|
|
||||||
<TT><unistd.h></TT>.
|
|
||||||
You should include <TT><ast.h></TT> instead of one or more of
|
|
||||||
these headers.
|
|
||||||
The <TT><error.h></TT> header provides the interface to the error
|
|
||||||
and option parsing routines defined below.
|
|
||||||
The <TT><stak.h></TT> header provides the interface to the memory
|
|
||||||
allocation routines described below.
|
|
||||||
<P>
|
|
||||||
Programs that want to use the information in <TT><sys/stat.h></TT>
|
|
||||||
should include the file <TT><ls.h></TT> instead.
|
|
||||||
This provides the complete POSIX interface to <TT>stat()</TT>
|
|
||||||
related functions even on non-POSIX systems.
|
|
||||||
<P>
|
|
||||||
<P>
|
|
||||||
<H4><A name="Input/Output">Input/Output</A></H4>
|
|
||||||
<TT>ksh</TT> uses <STRONG>sfio</STRONG>,
|
|
||||||
the Safe/Fast I/O library<FONT SIZE=-6>[7]</FONT>,
|
|
||||||
to perform all I/O operations.
|
|
||||||
The <STRONG>sfio</STRONG> library, which is part of <STRONG>libast</STRONG>,
|
|
||||||
provides a superset of the functionality provided by the standard
|
|
||||||
I/O library defined in ANSI C.
|
|
||||||
If none of the additional functionality is required,
|
|
||||||
and if you are not familiar with <STRONG>sfio</STRONG> and
|
|
||||||
you do not want to spend the time learning it,
|
|
||||||
then you can use <TT>sfio</TT> via the <TT>stdio</TT> library
|
|
||||||
interface. The development kit contains the header <TT><stdio.h></TT>
|
|
||||||
which maps <TT>stdio</TT> calls to <TT>sfio</TT> calls.
|
|
||||||
In most instances the mapping is done
|
|
||||||
by macros or inline functions so that there is no overhead.
|
|
||||||
The man page for the <TT>sfio</TT> library is in an Appendix.
|
|
||||||
<P>
|
|
||||||
However, there are some very nice extensions and
|
|
||||||
performance improvements in <TT>sfio</TT>
|
|
||||||
and if you plan any major extensions I recommend
|
|
||||||
that you use it natively.
|
|
||||||
<P>
|
|
||||||
<H4><A name="Error Handling">Error Handling</A></H4>
|
|
||||||
For error messages it is best to use the <TT>ast</TT> library
|
|
||||||
function <TT>errormsg()</TT> rather that sending output to
|
|
||||||
<TT>stderr</TT> or the equivalent <TT>sfstderr</TT> directly.
|
|
||||||
Using <TT>errormsg()</TT> will make error message appear
|
|
||||||
more uniform to the user.
|
|
||||||
Furthermore, using <TT>errormsg()</TT> should make it easier
|
|
||||||
to do error message translation for other locales
|
|
||||||
in future versions of <TT>ksh</TT>.
|
|
||||||
<P>
|
|
||||||
The first argument to
|
|
||||||
<TT>errormsg()</TT> specifies the dictionary in which the string
|
|
||||||
will be searched for translation.
|
|
||||||
The second argument to <TT>errormsg()</TT> contains that error type
|
|
||||||
and value. The third argument is a <EM>printf</EM> style format
|
|
||||||
and the remaining arguments are arguments to be printed
|
|
||||||
as part of the message. A new-line is inserted at the
|
|
||||||
end of each message and therefore, should not appear as
|
|
||||||
part of the format string.
|
|
||||||
The second argument should be one of the following:
|
|
||||||
<DIV class=SH>
|
|
||||||
<DL>
|
|
||||||
<DT><TT>ERROR_exit(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
|
|
||||||
If <EM>n</EM> is not-zero, the builtin will exit value <EM>n</EM> after
|
|
||||||
printing the message.
|
|
||||||
<DT><TT>ERROR_system(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
|
|
||||||
Exit builtin with exit value <EM>n</EM> after printing the message.
|
|
||||||
The message will display the message corresponding to <TT>errno</TT>
|
|
||||||
enclosed within <TT>[ ]</TT> at the end of the message.
|
|
||||||
<DT><TT>ERROR_usage(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
|
|
||||||
Will generate a usage message and exit. If <EM>n</EM> is non-zero,
|
|
||||||
the exit value will be 2. Otherwise the exit value will be 0.
|
|
||||||
<DT><TT>ERROR_debug(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
|
|
||||||
Will print a level <EM>n</EM> debugging message and will then continue.
|
|
||||||
<DT><TT>ERROR_warn(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
|
|
||||||
Prints a warning message. <EM>n</EM> is ignored.
|
|
||||||
</DL><P>
|
|
||||||
<H4><A name="Option Parsing">Option Parsing</A></H4>
|
|
||||||
The first thing that a built-in should do is to check
|
|
||||||
the arguments for correctness and to print any usage
|
|
||||||
messages on standard error.
|
|
||||||
For consistency with the rest of <TT>ksh</TT>, it is best
|
|
||||||
to use the <TT>libast</TT> functions <TT>optget()</TT> and
|
|
||||||
<TT>optusage()</TT>for this
|
|
||||||
purpose.
|
|
||||||
The header <TT><error.h></TT> includes prototypes for
|
|
||||||
these functions.
|
|
||||||
The <TT>optget()</TT> function is similar to the
|
|
||||||
System V C library function <TT>getopt()</TT>,
|
|
||||||
but provides some additional capabilities.
|
|
||||||
Built-ins that use <TT>optget()</TT> provide a more
|
|
||||||
consistent user interface.
|
|
||||||
<P>
|
|
||||||
The <TT>optget()</TT> function is invoked as
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
int optget(char *<EM>argv</EM>[], const char *<EM>optstring</EM>)
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
where <TT>argv</TT> is the argument list and <TT>optstring</TT>
|
|
||||||
is a string that specifies the allowable arguments and
|
|
||||||
additional information that is used to format <EM>usage</EM>
|
|
||||||
messages.
|
|
||||||
In fact a complete man page in <TT>troff</TT> or <TT>html</TT>
|
|
||||||
can be generated by passing a usage string as described
|
|
||||||
by the <TT>getopts</TT> command.
|
|
||||||
Like <TT>getopt()</TT>,
|
|
||||||
single letter options are represented by the letter itself,
|
|
||||||
and options that take a string argument are followed by the <TT>:</TT>
|
|
||||||
character.
|
|
||||||
Option strings have the following special characters:
|
|
||||||
<DIV class=SH>
|
|
||||||
<DL>
|
|
||||||
<DT><TT>:</TT><DD>
|
|
||||||
Used after a letter option to indicate that the option
|
|
||||||
takes an option argument.
|
|
||||||
The variable <TT>opt_info.arg</TT> will point to this
|
|
||||||
value after the given argument is encountered.
|
|
||||||
<DT><TT>#</TT><DD>
|
|
||||||
Used after a letter option to indicate that the option
|
|
||||||
can only take a numerical value.
|
|
||||||
The variable <TT>opt_info.num</TT> will contain this
|
|
||||||
value after the given argument is encountered.
|
|
||||||
<DT><TT>?</TT><DD>
|
|
||||||
Used after a <TT>:</TT> or <TT>#</TT> (and after the optional <TT>?</TT>)
|
|
||||||
to indicate the
|
|
||||||
preceding option argument is not required.
|
|
||||||
<DT><TT>[</TT>...<TT>]</TT><DD><BR>
|
|
||||||
After a <TT>:</TT> or <TT>#</TT>, the characters contained
|
|
||||||
inside the brackets are used to identify the option
|
|
||||||
argument when generating a <EM>usage</EM> message.
|
|
||||||
<DT><EM>space</EM><DD><BR>
|
|
||||||
The remainder of the string will only be used when generating
|
|
||||||
usage messages.
|
|
||||||
</DL>
|
|
||||||
</DIV>
|
|
||||||
<P>
|
|
||||||
The <TT>optget()</TT> function returns the matching option letter if
|
|
||||||
one of the legal option is matched.
|
|
||||||
Otherwise, <TT>optget()</TT> returns
|
|
||||||
<DIV class=SH>
|
|
||||||
<DL>
|
|
||||||
<DT><TT>':'</TT><DD>
|
|
||||||
If there is an error. In this case the variable <TT>opt_info.arg</TT>
|
|
||||||
contains the error string.
|
|
||||||
<DT><TT>0</TT><DD>
|
|
||||||
Indicates the end of options.
|
|
||||||
The variable <TT>opt_info.index</TT> contains the number of arguments
|
|
||||||
processed.
|
|
||||||
<DT><TT>'?'</TT><DD>
|
|
||||||
A usage message has been required.
|
|
||||||
You normally call <TT>optusage()</TT> to generate and display
|
|
||||||
the usage message.
|
|
||||||
</DL>
|
|
||||||
</DIV>
|
|
||||||
<P>
|
|
||||||
The following is an example of the option parsing portion
|
|
||||||
of the <TT>wc</TT> utility.
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
#include <shell.h>
|
|
||||||
while(1) switch(n=optget(argv,"xf:[file]"))
|
|
||||||
{
|
|
||||||
case 'f':
|
|
||||||
file = opt_info.arg;
|
|
||||||
break;
|
|
||||||
case ':':
|
|
||||||
error(ERROR_exit(0), opt_info.arg);
|
|
||||||
break;
|
|
||||||
case '?':
|
|
||||||
error(ERROR_usage(2), opt_info.arg);
|
|
||||||
UNREACHABLE();
|
|
||||||
}
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
<P>
|
|
||||||
<H4><A name="Storage Management">Storage Management</A></H4>
|
|
||||||
It is important that any memory used by your built-in
|
|
||||||
be returned. Otherwise, if your built-in is called frequently,
|
|
||||||
<TT>ksh</TT> will eventually run out of memory.
|
|
||||||
You should avoid using <TT>malloc()</TT> for memory that must
|
|
||||||
be freed before returning from you built-in, because by default,
|
|
||||||
<TT>ksh</TT> will terminate you built-in in the event of an
|
|
||||||
interrupt and the memory will not be freed.
|
|
||||||
<P>
|
|
||||||
The best way to allocate variable sized storage is
|
|
||||||
through calls to the <STRONG>stak</STRONG> library
|
|
||||||
which is included in <STRONG>libast</STRONG>
|
|
||||||
and which is used extensively by <TT>ksh</TT> itself.
|
|
||||||
Objects allocated with the <TT>stakalloc()</TT>
|
|
||||||
function are freed when you function completes
|
|
||||||
or aborts.
|
|
||||||
The <STRONG>stak</STRONG> library provides a convenient way to
|
|
||||||
build variable length strings and other objects dynamically.
|
|
||||||
The man page for the <STRONG>stak</STRONG> library is contained
|
|
||||||
in the Appendix.
|
|
||||||
<P>
|
|
||||||
Before <TT>ksh</TT> calls each built-in command, it saves
|
|
||||||
the current stack location and restores it after
|
|
||||||
it returns.
|
|
||||||
It is not necessary to save and restore the stack
|
|
||||||
location in the <TT>b_</TT> entry function,
|
|
||||||
but you may want to write functions that use this stack
|
|
||||||
are restore it when leaving the function.
|
|
||||||
The following coding convention will do this in
|
|
||||||
an efficient manner:
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
<EM>yourfunction</EM>()
|
|
||||||
{
|
|
||||||
char *savebase;
|
|
||||||
int saveoffset;
|
|
||||||
if(saveoffset=staktell())
|
|
||||||
savebase = stakfreeze(0);
|
|
||||||
...
|
|
||||||
if(saveoffset)
|
|
||||||
stakset(savebase,saveoffset);
|
|
||||||
else
|
|
||||||
stakseek(0);
|
|
||||||
}
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
<P>
|
|
||||||
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="CALLING <TT>ksh</TT> SERVICES">CALLING <TT>ksh</TT> SERVICES</A></H3></FONT></FONT></CENTER>
|
|
||||||
Some of the more interesting applications are those that extend
|
|
||||||
the functionality of <TT>ksh</TT> in application specific directions.
|
|
||||||
A prime example of this is the X-windows extension which adds
|
|
||||||
builtins to create and delete widgets.
|
|
||||||
The <STRONG>nval</STRONG> library is used to interface with the shell
|
|
||||||
name space.
|
|
||||||
The <STRONG>shell</STRONG> library is used to access other shell services.
|
|
||||||
<P>
|
|
||||||
<H4><A name="The nval library">The nval library</A></H4>
|
|
||||||
A great deal of power is derived from the ability to use
|
|
||||||
portions of the hierarchical variable namespace provided by <TT>ksh-93</TT>
|
|
||||||
and turn these names into active objects.
|
|
||||||
<P>
|
|
||||||
The <STRONG>nval</STRONG> library is used to interface with shell
|
|
||||||
variables.
|
|
||||||
A man page for this file is provided in an Appendix.
|
|
||||||
You need to include the header <TT><nval.h></TT>
|
|
||||||
to access the functions defined in the <STRONG>nval</STRONG> library.
|
|
||||||
All the functions provided by the <STRONG>nval</STRONG> library begin
|
|
||||||
with the prefix <TT>nv_</TT>.
|
|
||||||
Each shell variable is an object in an associative table
|
|
||||||
that is referenced by name.
|
|
||||||
The type <TT>Namval_t*</TT> is pointer to a shell variable.
|
|
||||||
To operate on a shell variable, you first get a handle
|
|
||||||
to the variable with the <TT>nv_open()</TT> function
|
|
||||||
and then supply the handle returned as the first
|
|
||||||
argument of the function that provides an operation
|
|
||||||
on the variable.
|
|
||||||
You must call <TT>nv_close()</TT> when you are finished
|
|
||||||
using this handle so that the space can be freed once
|
|
||||||
the value is unset.
|
|
||||||
The two most frequent operations are to get the value of
|
|
||||||
the variable, and to assign value to the variable.
|
|
||||||
The <TT>nv_getval()</TT> function returns a pointer to the
|
|
||||||
value of the variable.
|
|
||||||
In some cases the pointer returned is to a region that
|
|
||||||
will be overwritten by the next <TT>nv_getval()</TT> call
|
|
||||||
so that if the value isn't used immediately, it should
|
|
||||||
be copied.
|
|
||||||
Many variables can also generate a numeric value.
|
|
||||||
The <TT>nv_getnum()</TT> function returns a numeric
|
|
||||||
value for the given variable pointer, calling the
|
|
||||||
arithmetic evaluator if necessary.
|
|
||||||
<P>
|
|
||||||
The <TT>nv_putval()</TT> function is used to assign a new
|
|
||||||
value to a given variable.
|
|
||||||
The second argument to <TT>putval()</TT> is the value
|
|
||||||
to be assigned
|
|
||||||
and the third argument is a <EM>flag</EM> which
|
|
||||||
is used in interpreting the second argument.
|
|
||||||
<P>
|
|
||||||
Each shell variable can have one or more attributes.
|
|
||||||
The <TT>nv_isattr()</TT> is used to test for the existence
|
|
||||||
of one or more attributes.
|
|
||||||
See the appendix for a complete list of attributes.
|
|
||||||
<P>
|
|
||||||
By default, each shell variable passively stores the string you
|
|
||||||
give with with <TT>nv_putval()</TT>, and returns the value
|
|
||||||
with <TT>getval()</TT>. However, it is possible to turn
|
|
||||||
any node into an active entity by assigning functions
|
|
||||||
to it that will be called whenever <TT>nv_putval()</TT>
|
|
||||||
and/or <TT>nv_getval()</TT> is called.
|
|
||||||
In fact there are up to five functions that can
|
|
||||||
associated with each variable to override the
|
|
||||||
default actions.
|
|
||||||
The type <TT>Namfun_t</TT> is used to define these functions.
|
|
||||||
Only those that are non-<TT>NULL</TT> override the
|
|
||||||
default actions.
|
|
||||||
To override the default actions, you must allocate an
|
|
||||||
instance of <TT>Namfun_t</TT>, and then assign
|
|
||||||
the functions that you wish to override.
|
|
||||||
The <TT>putval()</TT>
|
|
||||||
function is called by the <TT>nv_putval()</TT> function.
|
|
||||||
A <TT>NULL</TT> for the <EM>value</EM> argument
|
|
||||||
indicates a request to unset the variable.
|
|
||||||
The <EM>type</EM> argument might contain the <TT>NV_INTEGER</TT>
|
|
||||||
bit so you should be prepared to do a conversion if
|
|
||||||
necessary.
|
|
||||||
The <TT>getval()</TT>
|
|
||||||
function is called by <TT>nv_getval()</TT>
|
|
||||||
value and must return a string.
|
|
||||||
The <TT>getnum()</TT>
|
|
||||||
function is called by the arithmetic evaluator
|
|
||||||
and must return double.
|
|
||||||
If omitted, then it will call <TT>nv_getval()</TT> and
|
|
||||||
convert the result to a number.
|
|
||||||
<P>
|
|
||||||
The functionality of a variable can further be increased
|
|
||||||
by adding discipline functions that
|
|
||||||
can be associated with the variable.
|
|
||||||
A discipline function allows a script that uses your
|
|
||||||
variable to define functions whose name is
|
|
||||||
<EM>varname</EM><TT>.</TT><EM>discname</EM>
|
|
||||||
where <EM>varname</EM> is the name of the variable, and <EM>discname</EM>
|
|
||||||
is the name of the discipline.
|
|
||||||
When the user defines such a function, the <TT>settrap()</TT>
|
|
||||||
function will be called with the name of the discipline and
|
|
||||||
a pointer to the parse tree corresponding to the discipline
|
|
||||||
function.
|
|
||||||
The application determines when these functions are actually
|
|
||||||
executed.
|
|
||||||
By default, <TT>ksh</TT> defines <TT>get</TT>,
|
|
||||||
<TT>set</TT>, and <TT>unset</TT> as discipline functions.
|
|
||||||
<P>
|
|
||||||
In addition, it is possible to provide a data area that
|
|
||||||
will be passed as an argument to
|
|
||||||
each of these functions whenever any of these functions are called.
|
|
||||||
To have private data, you need to define and allocate a structure
|
|
||||||
that looks like
|
|
||||||
<DIV class=FI>
|
|
||||||
<PRE>
|
|
||||||
struct <EM>yours</EM>
|
|
||||||
{
|
|
||||||
Namfun_t fun;
|
|
||||||
<EM>your_data_fields</EM>;
|
|
||||||
};
|
|
||||||
</DIV>
|
|
||||||
</PRE>
|
|
||||||
<P>
|
|
||||||
<H4><A name="The shell library">The shell library</A></H4>
|
|
||||||
There are several functions that are used by <TT>ksh</TT> itself
|
|
||||||
that can also be called from built-in commands.
|
|
||||||
The man page for these routines are in the Appendix.
|
|
||||||
<P>
|
|
||||||
The <TT>sh_addbuiltin()</TT> function can be used to add or delete
|
|
||||||
builtin commands. It takes the name of the built-in, the
|
|
||||||
address of the function that implements the built-in, and
|
|
||||||
a <TT>void*</TT> pointer that will be passed to this function
|
|
||||||
as the third argument whenever it is invoked.
|
|
||||||
If the function address is <TT>NULL</TT>, the specified built-in
|
|
||||||
will be deleted. However, special built-in functions cannot
|
|
||||||
be deleted or modified.
|
|
||||||
<P>
|
|
||||||
The <TT>sh_fmtq()</TT> function takes a string and returns
|
|
||||||
a string that is quoted as necessary so that it can
|
|
||||||
be used as shell input.
|
|
||||||
This function is used to implement the <TT>%q</TT> option
|
|
||||||
of the shell built-in <TT>printf</TT> command.
|
|
||||||
<P>
|
|
||||||
The <TT>sh_parse()</TT> function returns a parse tree corresponding
|
|
||||||
to a give file stream. The tree can be executed by supplying
|
|
||||||
it as the first argument to
|
|
||||||
the <TT>sh_trap()</TT> function and giving a value of <TT>1</TT> as the
|
|
||||||
second argument.
|
|
||||||
Alternatively, the <TT>sh_trap()</TT> function can parse and execute
|
|
||||||
a string by passing the string as the first argument and giving <TT>0</TT>
|
|
||||||
as the second argument.
|
|
||||||
<P>
|
|
||||||
The <TT>sh_isoption()</TT> function can be used to set to see whether one
|
|
||||||
or more of the option settings is enabled.
|
|
||||||
</DIV>
|
|
||||||
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="References">References</A></H3></FONT></FONT></CENTER>
|
|
||||||
<P>
|
|
||||||
<DL compact>
|
|
||||||
|
|
||||||
<DT>[1]<DD>
|
|
||||||
<EM>POSIX - Part 2: Shell and Utilities,</EM>
|
|
||||||
IEEE Std 1003.2-1992, ISO/IEC 9945-2:1993.
|
|
||||||
<DT>[2]<DD>
|
|
||||||
Glenn Fowler,
|
|
||||||
<EM>A Case for make</EM>,
|
|
||||||
Software - Practice and Experience, Vol. 20 No. S1, pp. 30-46, June 1990.
|
|
||||||
<DT>[3]<DD>
|
|
||||||
Brian W. Kernighan and Dennis M. Ritchie,
|
|
||||||
<EM>The C Programming Language</EM>,
|
|
||||||
Prentice Hall, 1978.
|
|
||||||
<DT>[4]<DD>
|
|
||||||
American National Standard for Information Systems - Programming
|
|
||||||
Language - C, ANSI X3.159-1989.
|
|
||||||
<DT>[5]<DD>
|
|
||||||
Bjarne Stroustroup,
|
|
||||||
<EM>C++</EM>,
|
|
||||||
Addison Wesley, xxxx
|
|
||||||
<DT>[6]<DD>
|
|
||||||
<EM>POSIX - Part 1: System Application Program Interface,</EM>
|
|
||||||
IEEE Std 1003.1-1990, ISO/IEC 9945-1:1990.
|
|
||||||
<DT>[7]<DD>
|
|
||||||
David Korn and Kiem-Phong Vo,
|
|
||||||
<EM>SFIO - A Safe/Fast Input/Output library,</EM>
|
|
||||||
Proceedings of the Summer Usenix,
|
|
||||||
pp. , 1991.
|
|
||||||
</DL>
|
|
||||||
<P>
|
|
||||||
<HR>
|
|
||||||
<TABLE border=0 align=center width=96%>
|
|
||||||
<TR>
|
|
||||||
<TD align=left></TD>
|
|
||||||
<TD align=center></TD>
|
|
||||||
<TD align=right>March 13, 2012</TD>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
<P>
|
|
||||||
|
|
||||||
</TD></TR></TBODY></TABLE>
|
|
||||||
|
|
||||||
</BODY>
|
|
||||||
</HTML>
|
|
|
@ -1,55 +0,0 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
||||||
<HTML>
|
|
||||||
<HEAD>
|
|
||||||
<META name="generator" content="mm2html (AT&T Research) 2012-01-11">
|
|
||||||
<TITLE> www/ksh/examples.mm mm document </TITLE>
|
|
||||||
<META name="author" content="gsf+dgk+kpv">
|
|
||||||
<STYLE type="text/css">
|
|
||||||
div.FI { padding-left:2em; text-indent:0em; }
|
|
||||||
div.HI { padding-left:4em; text-indent:-2em; }
|
|
||||||
dt { float:left; clear:both; }
|
|
||||||
dd { margin-left:3em; }
|
|
||||||
</STYLE>
|
|
||||||
</HEAD>
|
|
||||||
<BODY bgcolor=white link=slateblue vlink=teal >
|
|
||||||
<TABLE border=0 align=center width=96%>
|
|
||||||
<TBODY><TR><TD valign=top align=left>
|
|
||||||
<!--INDEX--><!--/INDEX-->
|
|
||||||
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<P><CENTER><FONT color=red><FONT face=courier><H3><A name="Sample Functions">Sample Functions</A></H3></FONT></FONT></CENTER>
|
|
||||||
<P></P><TABLE border=0 frame=void rules=none width=100%><TBODY><TR><TD>
|
|
||||||
<TABLE align=center bgcolor=papayawhip border=0 bordercolor=white cellpadding=2 cellspacing=2 frame=void rules=none >
|
|
||||||
<TBODY>
|
|
||||||
<TR><TD align=left>
|
|
||||||
<A href="functions/dirs.txt">dirs</A> </TD><TD align=left> <A href="functions/getopt.txt">getopt</A> </TD><TD align=left> <A href="functions/popd.txt">popd</A> </TD><TD align=left> <A href="functions/title.txt">title</A></TD></TR>
|
|
||||||
<TR><TD align=left>
|
|
||||||
<A href="functions/emacs_keybind.txt">emacs_keybind</A> </TD><TD align=left> <A href="functions/keybind.txt">keybind</A> </TD><TD align=left> <A href="functions/pushd.txt">pushd</A> </TD><TD align=left> <A href="functions/vi_keybind.txt">vi_keybind</A></TD></TR>
|
|
||||||
</TBODY></TABLE></TD></TR></TBODY></TABLE>
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="Sample Scripts">Sample Scripts</A></H3></FONT></FONT></CENTER>
|
|
||||||
<P></P><TABLE border=0 frame=void rules=none width=100%><TBODY><TR><TD>
|
|
||||||
<TABLE align=center bgcolor=papayawhip border=0 bordercolor=white cellpadding=2 cellspacing=2 frame=void rules=none >
|
|
||||||
<TBODY>
|
|
||||||
<TR><TD align=left>
|
|
||||||
<A href="scripts/cgi-lib.ksh.txt">cgi-lib.ksh</A> </TD><TD align=left> <A href="scripts/env.txt">env</A> </TD><TD align=left> <A href="scripts/which.txt">which</A> </TD><TD align=left> </TD></TR>
|
|
||||||
<TR><TD align=left>
|
|
||||||
<A href="scripts/dump-cgi.ksh.txt">dump-cgi.ksh</A> </TD><TD align=left> <A href="scripts/line.txt">line</A> </TD><TD align=left> </TD><TD align=left> </TD></TR>
|
|
||||||
</TBODY></TABLE></TD></TR></TBODY></TABLE>
|
|
||||||
<P>
|
|
||||||
<HR>
|
|
||||||
<TABLE border=0 align=center width=96%>
|
|
||||||
<TR>
|
|
||||||
<TD align=left></TD>
|
|
||||||
<TD align=center></TD>
|
|
||||||
<TD align=right>March 13, 2012</TD>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
<P>
|
|
||||||
|
|
||||||
</TD></TR></TBODY></TABLE>
|
|
||||||
|
|
||||||
</BODY>
|
|
||||||
</HTML>
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,207 +0,0 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
||||||
<HTML>
|
|
||||||
<HEAD>
|
|
||||||
<META name="generator" content="mm2html (AT&T Research) 2012-01-11">
|
|
||||||
<TITLE> www/ksh/features.mm mm document </TITLE>
|
|
||||||
<META name="author" content="gsf+dgk+kpv">
|
|
||||||
<STYLE type="text/css">
|
|
||||||
div.FI { padding-left:2em; text-indent:0em; }
|
|
||||||
div.HI { padding-left:4em; text-indent:-2em; }
|
|
||||||
dt { float:left; clear:both; }
|
|
||||||
dd { margin-left:3em; }
|
|
||||||
</STYLE>
|
|
||||||
</HEAD>
|
|
||||||
<BODY bgcolor=white link=slateblue vlink=teal >
|
|
||||||
<TABLE border=0 align=center width=96%>
|
|
||||||
<TBODY><TR><TD valign=top align=left>
|
|
||||||
<!--INDEX--><!--/INDEX-->
|
|
||||||
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<P><CENTER><FONT color=red><FONT face=courier><H3><A name="ksh features">ksh features</A></H3></FONT></FONT></CENTER>
|
|
||||||
KSH-93 is the most recent version of the KornShell Language described in
|
|
||||||
<EM>The KornShell Command and Programming Language</EM>,
|
|
||||||
by Morris Bolsky and David Korn of AT&T Research.
|
|
||||||
The KornShell is a shell programming language,
|
|
||||||
which is upward compatible with
|
|
||||||
<EM>sh</EM>
|
|
||||||
(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
|
|
||||||
<EM>csh</EM>.
|
|
||||||
With KSH-93, medium-sized programming tasks can be
|
|
||||||
performed at shell-level without a significant loss in performance.
|
|
||||||
In addition,
|
|
||||||
<EM>sh</EM>
|
|
||||||
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:
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Enhanced Command Re-entry Capability">Enhanced Command Re-entry Capability</A></H4>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="In-line Editing">In-line Editing</A></H4>
|
|
||||||
In
|
|
||||||
<EM>sh</EM>
|
|
||||||
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
|
|
||||||
<EM>vi</EM>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Extended I/O Capabilities">Extended I/O Capabilities</A></H4>
|
|
||||||
KSH-93 provides several I/O
|
|
||||||
capabilities not available in
|
|
||||||
<EM>sh</EM>,
|
|
||||||
including the ability to:
|
|
||||||
<UL type=square>
|
|
||||||
<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".
|
|
||||||
</UL>
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Improved performance">Improved performance</A></H4>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Arithmetic">Arithmetic</A></H4>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Arrays">Arrays</A></H4>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Functions and Aliases">Functions and Aliases</A></H4>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Substring Capabilities">Substring Capabilities</A></H4>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Enhanced pattern matching capabilities">Enhanced pattern matching capabilities</A></H4>
|
|
||||||
KSH-93 allows you to specify
|
|
||||||
regular expressions for file and string matches.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Improved debugging">Improved debugging</A></H4>
|
|
||||||
KSH-93 can generate line numbers on execution traces.
|
|
||||||
Also, I/O redirections are now traced.
|
|
||||||
There is a DEBUG trap that gets evaluated after each command
|
|
||||||
so that errors can be localized.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Job Control">Job Control</A></H4>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Added security">Added security</A></H4>
|
|
||||||
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.
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<H4><A name="Documentation">Documentation</A></H4>
|
|
||||||
Documentation for KSH-93 consists of an
|
|
||||||
<EM>Introduction to KSH-93,</EM>
|
|
||||||
<EM>Compatibility with the Bourne Shell</EM>,
|
|
||||||
a manual page and a
|
|
||||||
README file.
|
|
||||||
In addition, the
|
|
||||||
<EM>New KornShell Command and Programming Language</EM>
|
|
||||||
book is available from Prentice Hall.
|
|
||||||
<P>
|
|
||||||
<HR>
|
|
||||||
<TABLE border=0 align=center width=96%>
|
|
||||||
<TR>
|
|
||||||
<TD align=left></TD>
|
|
||||||
<TD align=center></TD>
|
|
||||||
<TD align=right>March 13, 2012</TD>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
<P>
|
|
||||||
|
|
||||||
</TD></TR></TBODY></TABLE>
|
|
||||||
|
|
||||||
</BODY>
|
|
||||||
</HTML>
|
|
|
@ -1,111 +0,0 @@
|
||||||
#
|
|
||||||
# DIRECTORY MANIPULATION FUNCTIONS PUSHD, POPD AND DIRS
|
|
||||||
#
|
|
||||||
# Uses global parameters _push_max _push_top _push_stack
|
|
||||||
integer _push_max=100 _push_top=100
|
|
||||||
# Display directory stack -- $HOME displayed as ~
|
|
||||||
function dirs
|
|
||||||
{
|
|
||||||
typeset dir="${PWD#$HOME/}"
|
|
||||||
case $dir in
|
|
||||||
$HOME)
|
|
||||||
dir=\~
|
|
||||||
;;
|
|
||||||
/*) ;;
|
|
||||||
*) dir=\~/$dir
|
|
||||||
esac
|
|
||||||
print -r - "$dir ${_push_stack[@]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Change directory and put directory on front of stack
|
|
||||||
function pushd
|
|
||||||
{
|
|
||||||
typeset dir= type=0
|
|
||||||
integer i
|
|
||||||
case $1 in
|
|
||||||
"") # pushd
|
|
||||||
if ((_push_top >= _push_max))
|
|
||||||
then print pushd: No other directory.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
type=1 dir=${_push_stack[_push_top]}
|
|
||||||
;;
|
|
||||||
+[1-9]|+[1-9][0-9]) # pushd +n
|
|
||||||
integer i=_push_top$1-1
|
|
||||||
if ((i >= _push_max))
|
|
||||||
then print pushd: Directory stack not that deep.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
type=2 dir=${_push_stack[i]}
|
|
||||||
;;
|
|
||||||
*) if ((_push_top <= 0))
|
|
||||||
then print pushd: Directory stack overflow.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
esac
|
|
||||||
case $dir in
|
|
||||||
\~*) dir=$HOME${dir#\~}
|
|
||||||
esac
|
|
||||||
cd "${dir:-$1}" > /dev/null || return 1
|
|
||||||
dir=${OLDPWD#$HOME/}
|
|
||||||
case $dir in
|
|
||||||
$HOME)
|
|
||||||
dir=\~
|
|
||||||
;;
|
|
||||||
/*) ;;
|
|
||||||
*) dir=\~/$dir
|
|
||||||
esac
|
|
||||||
case $type in
|
|
||||||
0) # pushd name
|
|
||||||
_push_stack[_push_top=_push_top-1]=$dir
|
|
||||||
;;
|
|
||||||
1) # pushd
|
|
||||||
_push_stack[_push_top]=$dir
|
|
||||||
;;
|
|
||||||
2) # push +n
|
|
||||||
type=${1#+} i=_push_top-1
|
|
||||||
set -- "${_push_stack[@]}" "$dir" "${_push_stack[@]}"
|
|
||||||
shift $type
|
|
||||||
for dir
|
|
||||||
do (((i=i+1) < _push_max)) || break
|
|
||||||
_push_stack[i]=$dir
|
|
||||||
done
|
|
||||||
esac
|
|
||||||
dirs
|
|
||||||
}
|
|
||||||
|
|
||||||
# Pops the top directory
|
|
||||||
function popd
|
|
||||||
{
|
|
||||||
typeset dir
|
|
||||||
if ((_push_top >= _push_max))
|
|
||||||
then print popd: Nothing to pop.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
case $1 in
|
|
||||||
"")
|
|
||||||
dir=${_push_stack[_push_top]}
|
|
||||||
case $dir in
|
|
||||||
\~*) dir=$HOME${dir#\~}
|
|
||||||
esac
|
|
||||||
cd "$dir" || return 1
|
|
||||||
;;
|
|
||||||
+[1-9]|+[1-9][0-9])
|
|
||||||
typeset savedir
|
|
||||||
integer i=_push_top$1-1
|
|
||||||
if ((i >= _push_max))
|
|
||||||
then print pushd: Directory stack not that deep.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
while ((i > _push_top))
|
|
||||||
do _push_stack[i]=${_push_stack[i-1]}
|
|
||||||
i=i-1
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
*) print pushd: Bad directory.
|
|
||||||
return 1
|
|
||||||
esac
|
|
||||||
unset '_push_stack[_push_top]'
|
|
||||||
_push_top=_push_top+1
|
|
||||||
dirs
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
typeset -A Keytable
|
|
||||||
trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD
|
|
||||||
function emacs_keybind
|
|
||||||
{
|
|
||||||
keybind $'\E[A' $'\020' # Up key
|
|
||||||
keybind $'\E[B' $'\016' # Down key
|
|
||||||
keybind $'\E[C' $'\06' # Right key
|
|
||||||
keybind $'\E[D' $'\02' # Left key
|
|
||||||
keybind $'\E[H' $'\01' # Home key
|
|
||||||
keybind $'\E[Y' $'\05' # End key
|
|
||||||
keybind $'\t' $'\E\E' # Tab for command-line completion
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
function getopt
|
|
||||||
{
|
|
||||||
typeset c optstring=$1 options= sep=
|
|
||||||
shift
|
|
||||||
while getopts $optstring c
|
|
||||||
do case $c in
|
|
||||||
[:?])
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
options="$options$sep-$c"
|
|
||||||
sep=' '
|
|
||||||
if [[ $optstring == *$c:* ]]
|
|
||||||
then options=" $options $OPTARG"
|
|
||||||
fi
|
|
||||||
#then print -rn -- " -$c" "$OPTARG"
|
|
||||||
#else print -rn -- " -$c"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
print -rn -- "$options"
|
|
||||||
if [[ ${@:$OPTIND-1} != -- ]]
|
|
||||||
then print -rn -- " --"
|
|
||||||
fi
|
|
||||||
if [[ -n ${@:$OPTIND} ]]
|
|
||||||
then print -r -- " ${@:$OPTIND}"
|
|
||||||
fi
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
typeset -A Keytable
|
|
||||||
trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD
|
|
||||||
function keybind # key action
|
|
||||||
{
|
|
||||||
typeset key=$(print -f "%q" "$2")
|
|
||||||
case $# in
|
|
||||||
2) Keytable[$1]='.sh.edchar=${.sh.edmode}'"$key"
|
|
||||||
;;
|
|
||||||
1) unset Keytable[$1]
|
|
||||||
;;
|
|
||||||
*) print -u2 "Usage: $0 key [action]"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
|
@ -1,111 +0,0 @@
|
||||||
#
|
|
||||||
# DIRECTORY MANIPULATION FUNCTIONS PUSHD, POPD AND DIRS
|
|
||||||
#
|
|
||||||
# Uses global parameters _push_max _push_top _push_stack
|
|
||||||
integer _push_max=100 _push_top=100
|
|
||||||
# Display directory stack -- $HOME displayed as ~
|
|
||||||
function dirs
|
|
||||||
{
|
|
||||||
typeset dir="${PWD#$HOME/}"
|
|
||||||
case $dir in
|
|
||||||
$HOME)
|
|
||||||
dir=\~
|
|
||||||
;;
|
|
||||||
/*) ;;
|
|
||||||
*) dir=\~/$dir
|
|
||||||
esac
|
|
||||||
print -r - "$dir ${_push_stack[@]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Change directory and put directory on front of stack
|
|
||||||
function pushd
|
|
||||||
{
|
|
||||||
typeset dir= type=0
|
|
||||||
integer i
|
|
||||||
case $1 in
|
|
||||||
"") # pushd
|
|
||||||
if ((_push_top >= _push_max))
|
|
||||||
then print pushd: No other directory.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
type=1 dir=${_push_stack[_push_top]}
|
|
||||||
;;
|
|
||||||
+[1-9]|+[1-9][0-9]) # pushd +n
|
|
||||||
integer i=_push_top$1-1
|
|
||||||
if ((i >= _push_max))
|
|
||||||
then print pushd: Directory stack not that deep.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
type=2 dir=${_push_stack[i]}
|
|
||||||
;;
|
|
||||||
*) if ((_push_top <= 0))
|
|
||||||
then print pushd: Directory stack overflow.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
esac
|
|
||||||
case $dir in
|
|
||||||
\~*) dir=$HOME${dir#~}
|
|
||||||
esac
|
|
||||||
cd "${dir:-$1}" > /dev/null || return 1
|
|
||||||
dir=${OLDPWD#$HOME/}
|
|
||||||
case $dir in
|
|
||||||
$HOME)
|
|
||||||
dir=\~
|
|
||||||
;;
|
|
||||||
/*) ;;
|
|
||||||
*) dir=\~/$dir
|
|
||||||
esac
|
|
||||||
case $type in
|
|
||||||
0) # pushd name
|
|
||||||
_push_stack[_push_top=_push_top-1]=$dir
|
|
||||||
;;
|
|
||||||
1) # pushd
|
|
||||||
_push_stack[_push_top]=$dir
|
|
||||||
;;
|
|
||||||
2) # push +n
|
|
||||||
type=${1#+} i=_push_top-1
|
|
||||||
set -- "${_push_stack[@]}" "$dir" "${_push_stack[@]}"
|
|
||||||
shift $type
|
|
||||||
for dir
|
|
||||||
do (((i=i+1) < _push_max)) || break
|
|
||||||
_push_stack[i]=$dir
|
|
||||||
done
|
|
||||||
esac
|
|
||||||
dirs
|
|
||||||
}
|
|
||||||
|
|
||||||
# Pops the top directory
|
|
||||||
function popd
|
|
||||||
{
|
|
||||||
typeset dir
|
|
||||||
if ((_push_top >= _push_max))
|
|
||||||
then print popd: Nothing to pop.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
case $1 in
|
|
||||||
"")
|
|
||||||
dir=${_push_stack[_push_top]}
|
|
||||||
case $dir in
|
|
||||||
\~*) dir=$HOME${dir#~}
|
|
||||||
esac
|
|
||||||
cd "$dir" || return 1
|
|
||||||
;;
|
|
||||||
+[1-9]|+[1-9][0-9])
|
|
||||||
typeset savedir
|
|
||||||
integer i=_push_top$1-1
|
|
||||||
if ((i >= _push_max))
|
|
||||||
then print pushd: Directory stack not that deep.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
while ((i > _push_top))
|
|
||||||
do _push_stack[i]=${_push_stack[i-1]}
|
|
||||||
i=i-1
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
*) print pushd: Bad directory.
|
|
||||||
return 1
|
|
||||||
esac
|
|
||||||
unset '_push_stack[_push_top]'
|
|
||||||
_push_top=_push_top+1
|
|
||||||
dirs
|
|
||||||
}
|
|
|
@ -1,111 +0,0 @@
|
||||||
#
|
|
||||||
# DIRECTORY MANIPULATION FUNCTIONS PUSHD, POPD AND DIRS
|
|
||||||
#
|
|
||||||
# Uses global parameters _push_max _push_top _push_stack
|
|
||||||
integer _push_max=100 _push_top=100
|
|
||||||
# Display directory stack -- $HOME displayed as ~
|
|
||||||
function dirs
|
|
||||||
{
|
|
||||||
typeset dir="${PWD#$HOME/}"
|
|
||||||
case $dir in
|
|
||||||
$HOME)
|
|
||||||
dir=\~
|
|
||||||
;;
|
|
||||||
/*) ;;
|
|
||||||
*) dir=\~/$dir
|
|
||||||
esac
|
|
||||||
print -r - "$dir ${_push_stack[@]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Change directory and put directory on front of stack
|
|
||||||
function pushd
|
|
||||||
{
|
|
||||||
typeset dir= type=0
|
|
||||||
integer i
|
|
||||||
case $1 in
|
|
||||||
"") # pushd
|
|
||||||
if ((_push_top >= _push_max))
|
|
||||||
then print pushd: No other directory.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
type=1 dir=${_push_stack[_push_top]}
|
|
||||||
;;
|
|
||||||
+[1-9]|+[1-9][0-9]) # pushd +n
|
|
||||||
integer i=_push_top$1-1
|
|
||||||
if ((i >= _push_max))
|
|
||||||
then print pushd: Directory stack not that deep.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
type=2 dir=${_push_stack[i]}
|
|
||||||
;;
|
|
||||||
*) if ((_push_top <= 0))
|
|
||||||
then print pushd: Directory stack overflow.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
esac
|
|
||||||
case $dir in
|
|
||||||
\~*) dir=$HOME${dir#\~}
|
|
||||||
esac
|
|
||||||
cd "${dir:-$1}" > /dev/null || return 1
|
|
||||||
dir=${OLDPWD#$HOME/}
|
|
||||||
case $dir in
|
|
||||||
$HOME)
|
|
||||||
dir=\~
|
|
||||||
;;
|
|
||||||
/*) ;;
|
|
||||||
*) dir=\~/$dir
|
|
||||||
esac
|
|
||||||
case $type in
|
|
||||||
0) # pushd name
|
|
||||||
_push_stack[_push_top=_push_top-1]=$dir
|
|
||||||
;;
|
|
||||||
1) # pushd
|
|
||||||
_push_stack[_push_top]=$dir
|
|
||||||
;;
|
|
||||||
2) # push +n
|
|
||||||
type=${1#+} i=_push_top-1
|
|
||||||
set -- "${_push_stack[@]}" "$dir" "${_push_stack[@]}"
|
|
||||||
shift $type
|
|
||||||
for dir
|
|
||||||
do (((i=i+1) < _push_max)) || break
|
|
||||||
_push_stack[i]=$dir
|
|
||||||
done
|
|
||||||
esac
|
|
||||||
dirs
|
|
||||||
}
|
|
||||||
|
|
||||||
# Pops the top directory
|
|
||||||
function popd
|
|
||||||
{
|
|
||||||
typeset dir
|
|
||||||
if ((_push_top >= _push_max))
|
|
||||||
then print popd: Nothing to pop.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
case $1 in
|
|
||||||
"")
|
|
||||||
dir=${_push_stack[_push_top]}
|
|
||||||
case $dir in
|
|
||||||
\~*) dir=$HOME${dir#\~}
|
|
||||||
esac
|
|
||||||
cd "$dir" || return 1
|
|
||||||
;;
|
|
||||||
+[1-9]|+[1-9][0-9])
|
|
||||||
typeset savedir
|
|
||||||
integer i=_push_top$1-1
|
|
||||||
if ((i >= _push_max))
|
|
||||||
then print pushd: Directory stack not that deep.
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
while ((i > _push_top))
|
|
||||||
do _push_stack[i]=${_push_stack[i-1]}
|
|
||||||
i=i-1
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
*) print pushd: Bad directory.
|
|
||||||
return 1
|
|
||||||
esac
|
|
||||||
unset '_push_stack[_push_top]'
|
|
||||||
_push_top=_push_top+1
|
|
||||||
dirs
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
# add to (+), delete from (-), print (.), or set ([=]) window title
|
|
||||||
# arguments are eval'd before printing
|
|
||||||
# title text string exported in TITLE_TEXT
|
|
||||||
|
|
||||||
function title # [+ | - | =] title ...
|
|
||||||
{
|
|
||||||
typeset x t="$TITLE_TEXT"
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
+) shift
|
|
||||||
case $# in
|
|
||||||
0) ;;
|
|
||||||
*) for x
|
|
||||||
do case " $t " in
|
|
||||||
*" $x "*) ;;
|
|
||||||
" ") t=$x ;;
|
|
||||||
*) t="$t $x" ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
case $t in
|
|
||||||
$TITLE_TEXT) return 1 ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
-) shift
|
|
||||||
case $# in
|
|
||||||
0) ;;
|
|
||||||
*) for x
|
|
||||||
do case " $t " in
|
|
||||||
*" $x "*) t="${t%?( )$x*}${t##*$x?( )}" ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
case $t in
|
|
||||||
$TITLE_TEXT) return 1 ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
.) print -r -- "$TITLE_TEXT"
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
*) t="$*"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
export TITLE_TEXT="$t"
|
|
||||||
eval x=\"$t\"
|
|
||||||
case $TERM in
|
|
||||||
630*) print -nr -- "[?${#x};0v$x" ;;
|
|
||||||
vt100|xterm*) print -nr -- "]0;$x" ;;
|
|
||||||
*) return 1 ;;
|
|
||||||
esac
|
|
||||||
return 0
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
typeset -A Keytable
|
|
||||||
trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD
|
|
||||||
function vi_keybind
|
|
||||||
{
|
|
||||||
keybind $'\E[A' k # Up key
|
|
||||||
keybind $'\E[B' j # Down key
|
|
||||||
keybind $'\E[C' l # Right key
|
|
||||||
keybind $'\E[D' h # Left key
|
|
||||||
keybind $'\t' '\' # Tab for command-line completion
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
<html>
|
|
||||||
<head><title>KSH93</title></head>
|
|
||||||
<body>
|
|
||||||
<a href='ksh.html'>Overview</a><br>
|
|
||||||
<a href='faq.html'>FAQ</a><br>
|
|
||||||
<a href='features.html'>Features</a><br>
|
|
||||||
<a href='builtins.html'>Builtins</a><br>
|
|
||||||
<a href='examples.html'>Examples</a>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,118 +0,0 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
||||||
<HTML>
|
|
||||||
<HEAD>
|
|
||||||
<META name="generator" content="mm2html (AT&T Research) 2012-01-11">
|
|
||||||
<TITLE> www/ksh/ksh.mm mm document </TITLE>
|
|
||||||
<META name="author" content="gsf+dgk+kpv">
|
|
||||||
<STYLE type="text/css">
|
|
||||||
div.FI { padding-left:2em; text-indent:0em; }
|
|
||||||
div.HI { padding-left:4em; text-indent:-2em; }
|
|
||||||
dt { float:left; clear:both; }
|
|
||||||
dd { margin-left:3em; }
|
|
||||||
</STYLE>
|
|
||||||
</HEAD>
|
|
||||||
<BODY bgcolor=white link=slateblue vlink=teal >
|
|
||||||
<TABLE border=0 align=center width=96%>
|
|
||||||
<TBODY><TR><TD valign=top align=left>
|
|
||||||
<!--INDEX--><!--/INDEX-->
|
|
||||||
|
|
||||||
|
|
||||||
<P>
|
|
||||||
<P><CENTER><FONT color=red><FONT face=courier><H3><A name="ksh overview">ksh overview</A></H3></FONT></FONT></CENTER>
|
|
||||||
The
|
|
||||||
<STRONG>KornShell</STRONG>
|
|
||||||
language was designed and developed by David G. Korn at AT&T Bell Laboratories and AT&T Research.
|
|
||||||
It is an interactive command language that provides access to the UNIX system and to many other systems,
|
|
||||||
on the many different computers and workstations on which it is implemented.
|
|
||||||
The
|
|
||||||
<STRONG>KornShell</STRONG>
|
|
||||||
language is also a complete, powerful, high-level programming language for writing applications,
|
|
||||||
often more easily and quickly than with other high-level languages.
|
|
||||||
This makes it especially suitable for prototyping.
|
|
||||||
There are two other widely used shells, the Bourne shell developed by Steven Bourne at AT&T Bell Laboratories,
|
|
||||||
and the C shell developed by Bill Joy at the University of California.
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
has the best features of both, plus many new features of its own.
|
|
||||||
Thus
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
can do much to enhance your productivity and the quality of your work,
|
|
||||||
both in interacting with the system, and in programming.
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
programs are easier to write, and are more concise and readable than programs written in a lower level language such as C.
|
|
||||||
<P>
|
|
||||||
The new version of
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
has the functionality of other scripting languages such as awk, icon, perl, rexx, and tcl.
|
|
||||||
For this and many other reasons,
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
is a much better scripting language than any of the other popular shells.
|
|
||||||
The code size for
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
is larger than the Bourne shell or C shell programs.
|
|
||||||
The revised version is even larger.
|
|
||||||
<P>
|
|
||||||
In spite of its increased size,
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
provides better performance.
|
|
||||||
You can write programs to run faster with
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
than with either the Bourne shell or the C shell, sometimes an order of magnitude faster.
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
has evolved and matured with extensive user feedback.
|
|
||||||
It has been used by many thousands of people at AT&T since 1982, and at many other companies and universities.
|
|
||||||
A survey conducted at one of the largest AT&T Bell Laboratories computer centers showed that 80% of their customers, both programmers and non-programmers, use
|
|
||||||
<STRONG>ksh.</STRONG>
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
is compatible with the Bourne shell.
|
|
||||||
Virtually all programs written for the Bourne shell run with
|
|
||||||
<STRONG>ksh.</STRONG>
|
|
||||||
If you are familiar with the Bourne shell, you can use
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
immediately, without retraining.
|
|
||||||
The new version of
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
is compatible with earlier versions of
|
|
||||||
<STRONG>ksh.</STRONG>
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
is readily available.
|
|
||||||
It is sold (source and binary) by AT&T and Novell, and by other companies under license from AT&T both in the USA and abroad.
|
|
||||||
It has been purchased by dozens of major corporations, and by many individuals for use on home computers.
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
is extensible.
|
|
||||||
<P>
|
|
||||||
The
|
|
||||||
<STRONG>KornShell</STRONG>
|
|
||||||
language uses the same syntax for built-in commands as for non built-in commands.
|
|
||||||
Therefore, system developers can add new commands "transparently" to the
|
|
||||||
<STRONG>KornShell</STRONG>
|
|
||||||
language; that is, with minimum effort and with no differences visible to users other than faster execution.
|
|
||||||
On systems with dynamic linking, it is possible to add new built-in commands at run time.
|
|
||||||
Novell has extended the new version of
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
to enable X-windows programming for their desktop
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
product,
|
|
||||||
<STRONG>dtksh</STRONG>.
|
|
||||||
<STRONG>dtksh</STRONG>
|
|
||||||
is a standard part of CDE, the Common Desktop Environment defined by COSE (Common Operating System Environment), supported by most major UNIX system hardware vendors.
|
|
||||||
An extended version of
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
that enables Tk programming, called tksh, is available as well.
|
|
||||||
<P>
|
|
||||||
<STRONG>ksh</STRONG>
|
|
||||||
is intended to conform to the Shell Language Standard developed by the IEEE POSIX 1003.2 Shell and Utilities Language Committee.
|
|
||||||
<P>
|
|
||||||
<HR>
|
|
||||||
<TABLE border=0 align=center width=96%>
|
|
||||||
<TR>
|
|
||||||
<TD align=left></TD>
|
|
||||||
<TD align=center></TD>
|
|
||||||
<TD align=right>March 13, 2012</TD>
|
|
||||||
</TR>
|
|
||||||
</TABLE>
|
|
||||||
<P>
|
|
||||||
|
|
||||||
</TD></TR></TBODY></TABLE>
|
|
||||||
|
|
||||||
</BODY>
|
|
||||||
</HTML>
|
|
|
@ -1,129 +0,0 @@
|
||||||
typeset -A COOKIE HEADER
|
|
||||||
typeset Cgi _CGI_c _CGI_multipart
|
|
||||||
|
|
||||||
function cgi_header
|
|
||||||
{
|
|
||||||
typeset h
|
|
||||||
for h in "${!HEADER[@]}"
|
|
||||||
do printf '%s: %s\n' "$h" "${HEADER[$h]}"
|
|
||||||
done
|
|
||||||
print
|
|
||||||
}
|
|
||||||
|
|
||||||
function cgi_url
|
|
||||||
{
|
|
||||||
if [[ $SERVER_PORT != 80 ]]
|
|
||||||
then print "http://$SERVER_NAME:$SERVER_PORT$SCRIPT_NAME"
|
|
||||||
else print "http://$SERVER_NAME$SCRIPT_NAME"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function cgi_parse
|
|
||||||
{
|
|
||||||
if [[ $REQUEST_METHOD == POST ]]
|
|
||||||
then if [[ $CONTENT_TYPE == multipart/form-data* ]]
|
|
||||||
then _CGI_multipart=${TMPDIR-/tmp}/cgi-form-$$
|
|
||||||
trap 'rm -rf "$_CGI_multipart"' EXIT
|
|
||||||
mkdir $_CGI_multipart
|
|
||||||
unset -f Cgi.set
|
|
||||||
typeset -A Cgi.file
|
|
||||||
typeset i b v
|
|
||||||
pax --nosummary --read --edit ",.*/,," --edit ",^,$_CGI_multipart/,"
|
|
||||||
for i in $_CGI_multipart/*
|
|
||||||
do b=${i##*/}
|
|
||||||
if [[ $b == +([a-z]) ]]
|
|
||||||
then v=$(<$i)
|
|
||||||
eval Cgi.$b='$v'
|
|
||||||
else Cgi.file[$b]=$i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
else Cgi=$(<&0) # Read from stdin
|
|
||||||
fi
|
|
||||||
else Cgi="$QUERY_STRING"
|
|
||||||
fi
|
|
||||||
cgi_cookie "$HTTP_COOKIE"
|
|
||||||
HEADER["Content-type"]="text/html"
|
|
||||||
}
|
|
||||||
|
|
||||||
function cgi_cookie
|
|
||||||
{
|
|
||||||
typeset cookie=$1 name val c IFS=';'
|
|
||||||
set -- $cookie
|
|
||||||
for c
|
|
||||||
do
|
|
||||||
IFS='='
|
|
||||||
set -- $c
|
|
||||||
name=${1##' '} val=${2##' '} # trim white space
|
|
||||||
name=${name%%' '} val=${val%%' '}
|
|
||||||
COOKIE[$name]=$val
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function cgi_setcookie # name value
|
|
||||||
{
|
|
||||||
HEADER["Set-Cookie"]="$1=$2; path=$SCRIPT_NAME"
|
|
||||||
}
|
|
||||||
|
|
||||||
## Cgi variable disciplines
|
|
||||||
|
|
||||||
function Cgi.set
|
|
||||||
{
|
|
||||||
set -f
|
|
||||||
typeset i j n val IFS='&'
|
|
||||||
set -- ${.sh.value}
|
|
||||||
for i
|
|
||||||
do n=${i%%=*}
|
|
||||||
[[ $n == [[:alpha:]_]*([[:alnum:]_]) ]] || continue
|
|
||||||
val=${i#$n=}
|
|
||||||
val=${val//+/ }
|
|
||||||
val=${val//@([\'\\])/'\'\1}
|
|
||||||
eval j=\${#${.sh.name}.${n}[@]} \
|
|
||||||
"${.sh.name}.${n}[j]=\$'${val//'%'@(??)/'\x'\1"'\$'"}'"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function cgi_C_init
|
|
||||||
{
|
|
||||||
integer i
|
|
||||||
for ((i=1; i < 256; i++))
|
|
||||||
do if (( i!=16#22 && i!=16#27 && i!=16#5C && i!=16#5B && i!=16#5D ))
|
|
||||||
then printf $'_CGI_c[$\'\\\\x%.2X\']=%%%.2X\n' $i $i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
print
|
|
||||||
}
|
|
||||||
|
|
||||||
function cgi_encode
|
|
||||||
{
|
|
||||||
typeset v=$1
|
|
||||||
var=${v//' '/+}
|
|
||||||
cbrace='}'
|
|
||||||
eval var=${var//@([!a-zA-Z0-9_+])/\${_CGI_c[\\\1]$cbrace}
|
|
||||||
print -r -- "$var"
|
|
||||||
}
|
|
||||||
|
|
||||||
function Cgi.get
|
|
||||||
{
|
|
||||||
typeset i val name vname
|
|
||||||
if [[ ! ${_CGI_c[\\]} ]]
|
|
||||||
then val='"'
|
|
||||||
_CGI_c[""]=%00
|
|
||||||
_CGI_c[$var]=%22
|
|
||||||
_CGI_c[\']=%27
|
|
||||||
_CGI_c[\]]=%5B
|
|
||||||
_CGI_c[\[]=%5D
|
|
||||||
_CGI_c[\\]=%5C
|
|
||||||
eval $(cgi_C_init)
|
|
||||||
unset -f cgi_C_init
|
|
||||||
fi
|
|
||||||
vname=${.sh.name} # .sh.name contains variable name
|
|
||||||
.sh.value= # .sh.value stores value
|
|
||||||
for i in ${!Cgi.@}
|
|
||||||
do
|
|
||||||
name=${i#$vname.}
|
|
||||||
nameref v=${i}
|
|
||||||
val=$(cgi_encode "$v")
|
|
||||||
.sh.value="${.sh.value}${.sh.value:+&}$name=$val"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
#!/bin/ksh
|
|
||||||
|
|
||||||
. ./cgi-lib.ksh
|
|
||||||
|
|
||||||
cgi_parse
|
|
||||||
cgi_header
|
|
||||||
|
|
||||||
print "<html>"
|
|
||||||
print "<pre>"
|
|
||||||
print -r "Url: $(cgi_url)"
|
|
||||||
for i in ${!Cgi.*}
|
|
||||||
do
|
|
||||||
nameref val=$i
|
|
||||||
print -r "$i = $val"
|
|
||||||
done
|
|
||||||
print "</pre>"
|
|
||||||
print "</html>"
|
|
|
@ -1,66 +0,0 @@
|
||||||
#! /usr/bin/ksh
|
|
||||||
# shell version of env command
|
|
||||||
case $(getopts '[-]' opt '--???man' 2>&1) in
|
|
||||||
version=[0-9]*)
|
|
||||||
usage=$'[-?@(#)env (AT&T Labs Research) 1999-05-20\n]
|
|
||||||
[-author?David Korn <dgkorn@gmail.com>]
|
|
||||||
[-license?http://www.research.att.com/sw/tools/reuse]
|
|
||||||
[+NAME?env - set environment for command invocation]
|
|
||||||
[+DESCRIPTION?\benv\b modifies the current environment according
|
|
||||||
to the \aname\a\b=\b\avalue\a arguments, and then
|
|
||||||
invokes \acommand\a with the modified environment.]
|
|
||||||
[+?If \acommand\a is not specified, the resulting environment
|
|
||||||
is written to standard output quoted as required for
|
|
||||||
reading by the \bsh\b.]
|
|
||||||
[i:ignore-environment?Invoke \acommand\a with the exact environment
|
|
||||||
specified by the \aname\a\b=\b\avalue\a arguments; inherited
|
|
||||||
environment variables are ignored. As an obsolete feature,
|
|
||||||
\b-\b by itself can be specified instead of \b-i\b.]
|
|
||||||
[u:unset]:[name?Unset the environment variable \aname\a if it was
|
|
||||||
in the environment. This option can be repeated to unset
|
|
||||||
additional variables.]
|
|
||||||
|
|
||||||
[name=value]... [command ...]
|
|
||||||
|
|
||||||
[+EXIT STATUS?If \acommand\a is invoked, the exit status of \benv\b
|
|
||||||
will be that of \acommand\a. Otherwise, it will be one of
|
|
||||||
the following:]{
|
|
||||||
[+0?\benv\b completed successfully.]
|
|
||||||
[+126?\acommand\a was found but could not be invoked.]
|
|
||||||
[+127?\acommand\a could not be found.]
|
|
||||||
}
|
|
||||||
[+SEE ALSO?\bsh\b(1), \bexport\b(1)]
|
|
||||||
'
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
usage='iu:[name] [name=value]... [command ...]'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
clear=
|
|
||||||
while getopts "$usage" var
|
|
||||||
do case $var in
|
|
||||||
i) clear=1;;
|
|
||||||
u) command unset $OPTARG 2> /dev/null;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
#[[ $var == "" ]] || exit 1
|
|
||||||
shift $((OPTIND-1))
|
|
||||||
if [[ $1 == - ]] # obsolete form
|
|
||||||
then clear=1
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
if [[ $clear == 1 ]]
|
|
||||||
then typeset +x $(typeset +x)
|
|
||||||
fi
|
|
||||||
while true
|
|
||||||
do case $1 in
|
|
||||||
*=*) export "$1";;
|
|
||||||
*) break;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
if (( $# >0 ))
|
|
||||||
then exec "$@"
|
|
||||||
else export
|
|
||||||
exit 0
|
|
||||||
fi
|
|
|
@ -1,2 +0,0 @@
|
||||||
#! /bin/ksh
|
|
||||||
read -r && print -r -- "$REPLY"
|
|
|
@ -1,2 +0,0 @@
|
||||||
#! /bin/ksh
|
|
||||||
whence -p "$@"
|
|
|
@ -1,16 +0,0 @@
|
||||||
info mam static
|
|
||||||
note *
|
|
||||||
note * This build file is in the Make Abstract Machine (MAM) language. It was
|
|
||||||
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
|
|
||||||
note * it manually because nmake had too many problems to keep using. The
|
|
||||||
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
|
|
||||||
note * support for indentation to improve readability. The language is
|
|
||||||
note * documented in Glenn Fowler's paper "A Make Abstract Machine":
|
|
||||||
note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html
|
|
||||||
note *
|
|
||||||
note source level :MAKE: equivalent
|
|
||||||
make install
|
|
||||||
make all
|
|
||||||
exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS}
|
|
||||||
done all virtual
|
|
||||||
done install virtual
|
|
|
@ -1,870 +0,0 @@
|
||||||
:
|
|
||||||
### 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
|
|
||||||
case $debug in
|
|
||||||
"") exec >/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 <stdio.h>
|
|
||||||
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 <sys/types.h>" > 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 <cc/$1>" > 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
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,934 +0,0 @@
|
||||||
12-07-17 iffe.sh: add C code NOTE("...") to amend --verbose output
|
|
||||||
12-06-26 iffe.sh: fix "npt foo" to handle function-like macro foo()
|
|
||||||
12-06-20 package.sh: use $KSH for rt in "results test"
|
|
||||||
12-06-15 Makefile: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB
|
|
||||||
12-06-15 package.sh: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB
|
|
||||||
12-06-13 package.sh: handle admin.db column output
|
|
||||||
12-06-08 iffe.sh: fix 12-06-06 typo
|
|
||||||
12-06-06 iffe.sh: check for -l* in reverse and accumulative order (e.g., for -last & -lm)
|
|
||||||
12-06-04 package.sh: always check $INSTALLROOT/lib/package/profile
|
|
||||||
12-05-31 Makefile: ID=ast; $(INSTALLROOT)/prototyped.h => $(INSTALLROOT)/$(ID)/prototyped.h
|
|
||||||
12-05-28 iffe.sh: API foo YYYYMMDD => FOOAPI(rel) test macro
|
|
||||||
12-05-24 package.sh: change admin.db comment => owner attributes
|
|
||||||
12-04-25 ratz.c: add sear -k option to keep installation tmp dir on exit
|
|
||||||
12-04-17 package.sh: skip sh version logic for ``use''
|
|
||||||
12-04-17 cc.ibm.risc*: _LARGEFILE64_SOURCE => _LARGE_FILE_API moved to libast/features
|
|
||||||
12-04-09 cc.ibm.risc*: speak aixese for _LARGEFILE64_SOURCE
|
|
||||||
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 ###.*archaic.*###
|
|
||||||
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 windows 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 changed 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: DIAGNOSTICS [ 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 <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 (Mac OS X 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 \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 <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 multiple 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 disambiguate
|
|
||||||
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 comparison still done
|
|
||||||
regress.sh: rm -rfu to handle test dirs w/o u+rwx
|
|
||||||
03-08-14 Makefile: 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 it's *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 uninitialized 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 it's 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 variable 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 it's 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 <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 it's 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 disappearing 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 OS X 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: verify 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: strengthen -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 ---
|
|
|
@ -1,9 +0,0 @@
|
||||||
: 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" "$@"
|
|
|
@ -1,13 +0,0 @@
|
||||||
: 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 subpar /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 "$@"
|
|
|
@ -1,13 +0,0 @@
|
||||||
: 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 "$@"
|
|
|
@ -1,11 +0,0 @@
|
||||||
: 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 "$@"
|
|
|
@ -1,63 +0,0 @@
|
||||||
: cc wrapper for AIX RISC xlc : 2012-04-17 :
|
|
||||||
|
|
||||||
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
|
|
|
@ -1,36 +0,0 @@
|
||||||
: cc wrapper for AIX RISC gcc : 2012-04-17 :
|
|
||||||
|
|
||||||
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 "$@"
|
|
|
@ -1,81 +0,0 @@
|
||||||
: 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
|
|
|
@ -1,85 +0,0 @@
|
||||||
: 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
|
|
|
@ -1,279 +0,0 @@
|
||||||
: 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
|
|
|
@ -1,158 +0,0 @@
|
||||||
: 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 <sys/dirent.h> 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 <dirent.h>" > 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
|
|
|
@ -1,9 +0,0 @@
|
||||||
: 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 "$@"
|
|
|
@ -1,9 +0,0 @@
|
||||||
: 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_ "$@"
|
|
|
@ -1,26 +0,0 @@
|
||||||
: 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 "$@"
|
|
|
@ -1,9 +0,0 @@
|
||||||
: 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 "$@"
|
|
|
@ -1,68 +0,0 @@
|
||||||
: sgi.mips2 cc wrapper that generates MIPS II 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
|
|
|
@ -1,110 +0,0 @@
|
||||||
: sgi.mips3 cc wrapper that generates MIPS III 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
|
|
|
@ -1,65 +0,0 @@
|
||||||
: sgi.mips3-o32 cc wrapper that generates MIPS III 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 "$@"
|
|
|
@ -1,90 +0,0 @@
|
||||||
: sgi.mips4 cc wrapper that generates MIPS IV 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
|
|
|
@ -1,65 +0,0 @@
|
||||||
: sgi.mips4-n32 cc wrapper that generates MIPS IV 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 "$@"
|
|
|
@ -1,35 +0,0 @@
|
||||||
: -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 "$@"
|
|
|
@ -1,76 +0,0 @@
|
||||||
: 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 "$@"
|
|
|
@ -1,9 +0,0 @@
|
||||||
: unixware.i386 cc wrapper
|
|
||||||
|
|
||||||
HOSTTYPE=unixware.i386
|
|
||||||
|
|
||||||
case " $* " in
|
|
||||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
/bin/cc -D_XOPEN_UNIX -D_XOPEN_SOURCE_EXTENDED "$@"
|
|
|
@ -1,144 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
: cross compiler a.out execution
|
|
||||||
|
|
||||||
(command set -o posix) 2>/dev/null && set -o posix
|
|
||||||
|
|
||||||
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 $
|
|
||||||
]
|
|
||||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
|
||||||
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
|
|
||||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
|
||||||
[+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 || exit 1
|
|
||||||
cmd=./${cmd##*/}
|
|
||||||
$exec $sh $shu $hostname "cd $dir; LD_LIBRARY_PATH=: $cmd $@ </dev/null 2>/dev/null; code=\$?; rm -f $cmd; echo $command: exit \$code >&2" </dev/null 2>$tmp
|
|
||||||
exit `sed -e '/^'$command': exit [0-9][0-9]*$/!d' -e 's/.* //' $tmp`
|
|
|
@ -1,38 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* small test for sleepycat dbm compatibility
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define DB_DBM_HSEARCH 1
|
|
||||||
|
|
||||||
#if DB_DBM_HSEARCH
|
|
||||||
#include <db.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
DBM* dbm = 0;
|
|
||||||
|
|
||||||
dbm_close(dbm);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* small test for -ldl
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef dlopen
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
dlopen("libdl.so",0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,190 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
: wrapper for .exe challenged Win32 systems/commands
|
|
||||||
|
|
||||||
(command set -o posix) 2>/dev/null && set -o posix
|
|
||||||
|
|
||||||
command=execrate
|
|
||||||
|
|
||||||
bins=`
|
|
||||||
(
|
|
||||||
userPATH=$PATH
|
|
||||||
PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH
|
|
||||||
getconf PATH 2>/dev/null && echo "$userPATH" || echo /bin:/usr/bin:/sbin:/usr/sbin:"$userPATH"
|
|
||||||
) | sed 's/:/ /g'
|
|
||||||
` || exit
|
|
||||||
|
|
||||||
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 $
|
|
||||||
]
|
|
||||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
|
||||||
[-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property]
|
|
||||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
|
||||||
[+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 "$@"
|
|
|
@ -1,105 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
: convert command that operates on file args to pipeline filter
|
|
||||||
|
|
||||||
(command set -o posix) 2>/dev/null && set -o posix
|
|
||||||
|
|
||||||
command=filter
|
|
||||||
|
|
||||||
TMPDIR=${TMPDIR:-/tmp}
|
|
||||||
export TMPDIR
|
|
||||||
tmp=$TMPDIR/$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 $
|
|
||||||
]
|
|
||||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
|
||||||
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
|
|
||||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
|
||||||
[+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
|
|
|
@ -1,38 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* small test for -lgdbm
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define _hdr_gdbm_ndbm 1
|
|
||||||
|
|
||||||
#if _hdr_gdbm_ndbm
|
|
||||||
#include <gdbm/ndbm.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
DBM* dbm = 0;
|
|
||||||
|
|
||||||
dbm_close(dbm);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* small test for -lgdbm
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define _hdr_gdbm_ndbm 1
|
|
||||||
|
|
||||||
#if _hdr_gdbm_ndbm
|
|
||||||
#include <gdbm-ndbm.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
DBM* dbm = 0;
|
|
||||||
|
|
||||||
dbm_close(dbm);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* small test for -lgdbm
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define _hdr_ndbm 1
|
|
||||||
|
|
||||||
#if _hdr_ndbm
|
|
||||||
#include <ndbm.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
DBM* dbm = 0;
|
|
||||||
|
|
||||||
dbm_close(dbm);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
#ifndef printf
|
|
||||||
#include <stdio.h>
|
|
||||||
#endif
|
|
||||||
int main() { int new = 0; printf("hello world\n"); return new;}
|
|
|
@ -1,6 +0,0 @@
|
||||||
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
|
|
|
@ -1,30 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
#ifndef iconv
|
|
||||||
#include <iconv.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
iconv(0, 0, 0, 0, 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,37 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
# non-ksh script for the nmake ignore prefix
|
|
||||||
# @(#)ignore (ksh 93u+m) 2021-12-31
|
|
||||||
|
|
||||||
while :
|
|
||||||
do case $# in
|
|
||||||
0) exit 0 ;;
|
|
||||||
esac
|
|
||||||
case $1 in
|
|
||||||
*=*) export "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*) break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
"$@"
|
|
||||||
exit 0
|
|
|
@ -1,30 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
#ifndef gettext
|
|
||||||
#include <libintl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
gettext(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
: hp.pa ld wrapper for reasonable warning defaults
|
|
||||||
|
|
||||||
# @(#)ld.hp.pa (AT&T Labs Research) 1998-01-23
|
|
||||||
|
|
||||||
/bin/ld +s +vnocompatwarnings "$@"
|
|
|
@ -1,22 +0,0 @@
|
||||||
#!/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
|
|
|
@ -1,2 +0,0 @@
|
||||||
: Mac OS X ldd
|
|
||||||
otool -L "$@"
|
|
|
@ -1,21 +0,0 @@
|
||||||
: 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
|
|
|
@ -1,16 +0,0 @@
|
||||||
: 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
|
|
|
@ -1 +0,0 @@
|
||||||
elflook -L "$@" | sed -e '/^NEEDED:/!d' -e 's/.*: *//'
|
|
|
@ -1,18 +0,0 @@
|
||||||
: 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
|
|
|
@ -1,2 +0,0 @@
|
||||||
: sgi.mips ldd
|
|
||||||
odump -Dl "$@"
|
|
|
@ -1,35 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* -lm test #1
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef sin
|
|
||||||
#include <math.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
sin(0.0);
|
|
||||||
fmod(100.234, 11.0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* -lm test #2
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
double value = 0;
|
|
||||||
int exp = 0;
|
|
||||||
int r = 0;
|
|
||||||
|
|
||||||
r |= ldexp(value, exp) != 0;
|
|
||||||
r |= frexp(value, &exp) != 0;
|
|
||||||
return r;
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* -lm test #3
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
long double value = 0;
|
|
||||||
int exp = 0;
|
|
||||||
int r = 0;
|
|
||||||
|
|
||||||
r |= ldexpl(value, exp) != 0;
|
|
||||||
r |= frexpl(value, &exp) != 0;
|
|
||||||
return r;
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* -lm test #4
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
double value = 0;
|
|
||||||
|
|
||||||
return isnan(value);
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* -lm test #5
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
long double value = 0;
|
|
||||||
|
|
||||||
return isnanl(value);
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* -lm test #6
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define _ISOC99_SOURCE 1
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
double value = -0.0;
|
|
||||||
|
|
||||||
return !signbit(value);
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,40 +0,0 @@
|
||||||
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
|
|
|
@ -1,63 +0,0 @@
|
||||||
# : : 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 -
|
|
|
@ -1,274 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
### this script contains archaic constructs that work with all sh variants ###
|
|
||||||
# mamprobe - generate MAM cc probe info
|
|
||||||
# Glenn Fowler <gsf@research.att.com>
|
|
||||||
|
|
||||||
(command set -o posix) 2>/dev/null && set -o posix
|
|
||||||
|
|
||||||
command=mamprobe
|
|
||||||
|
|
||||||
bins=`
|
|
||||||
(
|
|
||||||
userPATH=$PATH
|
|
||||||
PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH
|
|
||||||
getconf PATH 2>/dev/null && echo "$userPATH" || echo /bin:/usr/bin:/sbin:/usr/sbin:"$userPATH"
|
|
||||||
) | sed 's/:/ /g'
|
|
||||||
` || exit
|
|
||||||
|
|
||||||
# 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=${TMPDIR:-/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 <<!
|
|
||||||
q
|
|
||||||
!
|
|
||||||
) < /dev/null > /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 $bins
|
|
||||||
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
|
|
|
@ -1,83 +0,0 @@
|
||||||
#!/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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
: mkdir for systems that do not support -p : 2002-09-01 :
|
|
||||||
|
|
||||||
(command set -o posix) 2>/dev/null && set -o posix
|
|
||||||
|
|
||||||
MKDIR=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
|
|
|
@ -1,644 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
: 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 $
|
|
||||||
]
|
|
||||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
|
||||||
[-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property]
|
|
||||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
|
||||||
[+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 \adescription\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 <<!
|
|
||||||
ACCEPT=0
|
|
||||||
while :
|
|
||||||
do case \$1 in
|
|
||||||
-a|--accept)
|
|
||||||
ACCEPT=1
|
|
||||||
;;
|
|
||||||
--help|--man)
|
|
||||||
cat 1>&2 <<!!
|
|
||||||
Usage: \\\$SHELL $PREFIX${UNIT[0]}.sh [ --accept ] [ unit ... ]
|
|
||||||
|
|
||||||
${UNIT[0]} regression test script. Run this script to generate new
|
|
||||||
results in $PREFIX${UNIT[0]}.tmp and compare with expected results in
|
|
||||||
$PREFIX${UNIT[0]}.out. The --accept option generates $PREFIX${UNIT[0]}.tmp
|
|
||||||
and moves it to $PREFIX${UNIT[0]}.out.
|
|
||||||
!!
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
-*) echo \$0: \$1: invalid option >&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
|
|
|
@ -1,31 +0,0 @@
|
||||||
########################################################################
|
|
||||||
# #
|
|
||||||
# This software is part of the ast package #
|
|
||||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
|
||||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
|
||||||
# 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 <gsf@research.att.com> #
|
|
||||||
# #
|
|
||||||
########################################################################
|
|
||||||
: mam probe script
|
|
||||||
opt=
|
|
||||||
while :
|
|
||||||
do case $1 in
|
|
||||||
-d) opt=-d ;;
|
|
||||||
-*) ;;
|
|
||||||
*) break ;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
mamprobe $opt - "$1"
|
|
|
@ -1,32 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* small test for -lnsl
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
extern void* gethostbyname();
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
return gethostbyname(0) == 0;
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
/***********************************************************************
|
|
||||||
* *
|
|
||||||
* This software is part of the ast package *
|
|
||||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
|
||||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
|
||||||
* 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 <gsf@research.att.com> *
|
|
||||||
* *
|
|
||||||
***********************************************************************/
|
|
||||||
/*
|
|
||||||
* small test for prototyping cc
|
|
||||||
*/
|
|
||||||
|
|
||||||
int main(int argc, char** argv) { return argc || argv; }
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue