1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

more package and iffe tweaks/cleanups

I've reconsidered excluding build system internals (and also '*.o'
files) from the flat view. Really the only thing that should be
excluded are *.old files.

bin/package, src/cmd/INIT/package.sh:
- Do not exclude anything except *.old files from the flat view.
- This would delete bin/package when cleaning up the flat view,
  so explicitly keep bin/package in the clean routine.
- Be much faster about updating an existing flat view by checking
  if a link already exists before creating one.
- Add silent cleanup for dozens of orphaned macOS *.dSYM bundles
  belonging to deleted temporary feature test executables.

src/cmd/INIT/{iffe,ignore,silent}.sh, bin/{ignore,silent}:
- Remove obsolete Bourne shell fallbacks.
- Modernise command substitutions.
- Remove unused literal() function.
- Update copy() function to use printf.
- Distinguish just two shell types now: ksh and POSIX.
- compile(): Remove obsolete/incorrect grepping for signal messages.
  Add a POSIX-compiliant check with 'kill -l' to see if the
  compiler was terminated by a signal.
This commit is contained in:
Martijn Dekker 2021-12-31 21:00:32 +00:00
parent d9fc61c022
commit aeda350298
8 changed files with 337 additions and 569 deletions

View file

@ -19,20 +19,14 @@
# # # #
######################################################################## ########################################################################
# non-ksh script for the nmake ignore prefix # non-ksh script for the nmake ignore prefix
# @(#)ignore (AT&T Research) 1992-08-11 # @(#)ignore (ksh 93u+m) 2021-12-31
(command set -o posix) 2>/dev/null && set -o posix
modern_export=`v=; export v=ok 2>/dev/null; echo "$v"`
while : while :
do case $# in do case $# in
0) exit 0 ;; 0) exit 0 ;;
esac esac
case $1 in case $1 in
*=*) case $modern_export in *=*) export "$1"
ok) export "$1" ;;
*) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;;
esac
shift shift
;; ;;
*) break *) break

View file

@ -142,8 +142,8 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
[+debug|environment?Show environment and actions but do not [+debug|environment?Show environment and actions but do not
execute.] execute.]
[+flat?With the \bmake\b action, create a flat view by linking all [+flat?With the \bmake\b action, create a flat view by linking all
files from \b$INSTALLROOT\b, minus build system internals, onto files from \b$INSTALLROOT\b, minus \b*.old\b files,
their corresponding path under \b$PACKAGEROOT\b. onto their corresponding path under \b$PACKAGEROOT\b.
Only one architecture can have a flat view. Only one architecture can have a flat view.
If \bflat\b is specified with the \bclean\b action, then If \bflat\b is specified with the \bclean\b action, then
only clean up this flat view and do not delete \b$INSTALLROOT\b.] only clean up this flat view and do not delete \b$INSTALLROOT\b.]
@ -405,10 +405,10 @@ DESCRIPTION
debug|environment debug|environment
Show environment and actions but do not execute. Show environment and actions but do not execute.
flat With the make action, create a flat view by linking all files from flat With the make action, create a flat view by linking all files from
$INSTALLROOT, minus build system internals, onto their corresponding $INSTALLROOT, minus *.old files, onto their corresponding path under
path under $PACKAGEROOT. Only one architecture can have a flat view. $PACKAGEROOT. Only one architecture can have a flat view. If flat is
If flat is specified with the clean action, then only clean up this specified with the clean action, then only clean up this flat view
flat view and do not delete $INSTALLROOT. and do not delete $INSTALLROOT.
force Force the action to override saved state. force Force the action to override saved state.
never Run make -N and show other actions. never Run make -N and show other actions.
only Only operate on the specified packages. only Only operate on the specified packages.
@ -609,7 +609,7 @@ do case $i in
*:*=*) args="$args $i" *:*=*) args="$args $i"
continue continue
;; ;;
*=*) eval $(echo ' ' "$i" | sed 's,^[ ]*\([^=]*\)=\(.*\),n=\1 v='\''\2'\'',') *=*) n=${i%%=*} v=${i#*=}
;; ;;
esac esac
case $i in case $i in
@ -2763,13 +2763,20 @@ case $action in
clean|clobber) clean|clobber)
cd "$PACKAGEROOT" || exit cd "$PACKAGEROOT" || exit
note "cleaning up flat view" note "cleaning up flat view"
$exec find "arch/$HOSTTYPE" -name src -prune -o -type f -exec "$SHELL" -c ' # clean up all links with arch dir except bin/package
for h $exec find "arch/$HOSTTYPE" -path "arch/$HOSTTYPE/bin/package" -o -type f -exec "$SHELL" -c '
do p=${h#"arch/$HOSTTYPE/"} first=y
if test "$p" -ef "$h" for h # loop through the PPs
then rm -f "$p" do case $first in
y) set -- # clear PPs ("for" uses a copy)
first=n ;;
esac
p=${h#"arch/$HOSTTYPE/"} # get flat view path
if test "$p" -ef "$h" # is it part of the flat view?
then set -- "$@" "$p" # add to new PPs
fi fi
done done
exec rm -f "$@" # rm all at once: fast
' "$0" {} + ' "$0" {} +
case $flat in case $flat in
0) note "deleting arch/$HOSTTYPE" 0) note "deleting arch/$HOSTTYPE"
@ -3326,15 +3333,34 @@ cat $j $k
esac esac
eval capture mamake \$makeflags \$noexec \$target $assign eval capture mamake \$makeflags \$noexec \$target $assign
case $flat in case $HOSTTYPE in
1) note "creating flat view" darwin.*)
# clean up macOS .dSYM bundles belonging to deleted temps
cd "$PACKAGEROOT" || exit cd "$PACKAGEROOT" || exit
# exclude build system internals $exec find "arch/$HOSTTYPE" -type d -name '*.dSYM' -exec "$SHELL" -c '
$exec find "arch/$HOSTTYPE" -name package -prune -o -name probe -prune -o -name FEATURE -prune \ first=y
-o -name ok -prune -o -name src -prune -o -name '*.dSYM' -prune -o -path "*/lib/lib" -prune \ for d # loop through the PPs
-o -type f ! -name '*.old' -exec "$SHELL" -c ' do case $first in
y) set -- # clear PPs ("for" uses a copy)
first=n ;;
esac
e=${d%.dSYM} # get exe name
if ! test -f "$e" # nonexistent?
then set -- "$@" "$d" # add to new PPs
fi
done
exec rm -rf "$@" # rm all at once: fast
' "$0" {} +
;;
esac
case $flat in
1) note "updating flat view"
cd "$PACKAGEROOT" || exit
$exec find "arch/$HOSTTYPE" -type f ! -name '*.old' -exec "$SHELL" -c '
for h for h
do p=${h#"arch/$HOSTTYPE/"} do p=${h#"arch/$HOSTTYPE/"}
test "$h" -ef "$p" && continue # already created
d=${p%/*} d=${p%/*}
test -d "$d" || mkdir -p "$d" || exit test -d "$d" || mkdir -p "$d" || exit
ln -f "$h" "$p" 2>/dev/null || ln -sf "$h" "$p" || exit ln -f "$h" "$p" 2>/dev/null || ln -sf "$h" "$p" || exit

View file

@ -19,20 +19,14 @@
# # # #
######################################################################## ########################################################################
# non-ksh stub for the nmake silent prefix # non-ksh stub for the nmake silent prefix
# @(#)silent (AT&T Research) 1992-08-11 # @(#)silent (ksh 93u+m) 2021-12-31
(command set -o posix) 2>/dev/null && set -o posix
modern_export=`v=; export v=ok 2>/dev/null; echo "$v"`
while : while :
do case $# in do case $# in
0) exit 0 ;; 0) exit 0 ;;
esac esac
case $1 in case $1 in
*=*) case $modern_export in *=*) export "$1"
ok) export "$1" ;;
*) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;;
esac
shift shift
;; ;;
*) break *) break

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,7 @@ TEST 01 'command line basics'
ERROR - $'iffe: test: is sys/types.h a header ... yes ERROR - $'iffe: test: is sys/types.h a header ... yes
iffe: test: is stdio.h a header ... yes' iffe: test: is stdio.h a header ... yes'
EXEC -r -v -s bsh - hdr stdio EXEC -r -v -s posix - hdr stdio
EXEC -r -v - hdr stdio,limits EXEC -r -v - hdr stdio,limits
OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */
@ -26,7 +26,7 @@ iffe: test: is stdio.h a header ... yes'
iffe: test: is stdio.h a header ... yes iffe: test: is stdio.h a header ... yes
iffe: test: is limits.h a header ... yes' iffe: test: is limits.h a header ... yes'
EXEC -r -v -s bsh - hdr stdio,limits EXEC -r -v -s posix - hdr stdio,limits
EXEC -r -v - hdr,lib no_foo_bar,no_bar_foo stdio.h EXEC -r -v - hdr,lib no_foo_bar,no_bar_foo stdio.h
OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */ OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */
@ -42,11 +42,11 @@ iffe: test: is no_bar_foo.h a header ... no
iffe: test: is no_foo_bar a library function ... no iffe: test: is no_foo_bar a library function ... no
iffe: test: is no_bar_foo a library function ... no' iffe: test: is no_bar_foo a library function ... no'
EXEC -r -v -s bsh - hdr,lib no_foo_bar,no_bar_foo stdio.h EXEC -r -v -s posix - hdr,lib no_foo_bar,no_bar_foo stdio.h
EXEC -r -v - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h EXEC -r -v - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h
EXEC -r -v -s bsh - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h EXEC -r -v -s posix - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h
TEST 02 'file input basics' TEST 02 'file input basics'
@ -61,7 +61,7 @@ TEST 02 'file input basics'
ERROR - $'iffe: test: is sys/types.h a header ... yes ERROR - $'iffe: test: is sys/types.h a header ... yes
iffe: test: is stdio.h a header ... yes' iffe: test: is stdio.h a header ... yes'
EXEC -r -v -s bsh - t1.iffe EXEC -r -v -s posix - t1.iffe
EXEC -r -v - t2.iffe EXEC -r -v - t2.iffe
INPUT t2.iffe $'hdr stdio,limits' INPUT t2.iffe $'hdr stdio,limits'
@ -76,7 +76,7 @@ iffe: test: is stdio.h a header ... yes'
iffe: test: is stdio.h a header ... yes iffe: test: is stdio.h a header ... yes
iffe: test: is limits.h a header ... yes' iffe: test: is limits.h a header ... yes'
EXEC -r -v -s bsh - t2.iffe EXEC -r -v -s posix - t2.iffe
EXEC -r -v - t3.iffe EXEC -r -v - t3.iffe
INPUT t3.iffe $'hdr,lib no_foo_bar,no_bar_foo stdio.h' INPUT t3.iffe $'hdr,lib no_foo_bar,no_bar_foo stdio.h'
@ -93,13 +93,13 @@ iffe: test: is no_bar_foo.h a header ... no
iffe: test: is no_foo_bar a library function ... no iffe: test: is no_foo_bar a library function ... no
iffe: test: is no_bar_foo a library function ... no' iffe: test: is no_bar_foo a library function ... no'
EXEC -r -v -s bsh - t3.iffe EXEC -r -v -s posix - t3.iffe
EXEC -r -v - t3.iffe EXEC -r -v - t3.iffe
INPUT t3.iffe $'hdr no_foo_bar,no_bar_foo stdio.h INPUT t3.iffe $'hdr no_foo_bar,no_bar_foo stdio.h
lib no_foo_bar,no_bar_foo stdio.h' lib no_foo_bar,no_bar_foo stdio.h'
EXEC -r -v -s bsh - t3.iffe EXEC -r -v -s posix - t3.iffe
TEST 03 'nested if' TEST 03 'nested if'
@ -136,7 +136,7 @@ endif'
iffe: test: is stdio.h a header ... yes iffe: test: is stdio.h a header ... yes
iffe: test: is open a library function ... yes' iffe: test: is open a library function ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff ifelse INPUT t.iffe $'iff ifelse
@ -170,7 +170,7 @@ HIT 4
iffe: test: is _XXX_stdio.h a header ... no iffe: test: is _XXX_stdio.h a header ... no
iffe: test: is limits.h a header ... yes' iffe: test: is limits.h a header ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff ifelse INPUT t.iffe $'iff ifelse
@ -203,7 +203,7 @@ HIT 5
iffe: test: is _XXX_stdio.h a header ... no iffe: test: is _XXX_stdio.h a header ... no
iffe: test: is _XXX_limits.h a header ... no' iffe: test: is _XXX_limits.h a header ... no'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff ifelse INPUT t.iffe $'iff ifelse
@ -239,7 +239,7 @@ iffe: test: is stdio.h a header ... yes
iffe: test: is _XXX_open a library function ... no iffe: test: is _XXX_open a library function ... no
iffe: test: is close a library function ... yes' iffe: test: is close a library function ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff ifelse INPUT t.iffe $'iff ifelse
@ -274,7 +274,7 @@ iffe: test: is stdio.h a header ... yes
iffe: test: is _XXX_open a library function ... no iffe: test: is _XXX_open a library function ... no
iffe: test: is _XXX_close a library function ... no' iffe: test: is _XXX_close a library function ... no'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff ifelse INPUT t.iffe $'iff ifelse
@ -312,7 +312,7 @@ iffe: test: is stat a type or typedef ... no
iffe: test: is st_atime a member of struct stat ... yes iffe: test: is st_atime a member of struct stat ... yes
iffe: test: is ( !no_stat_time ) true ... yes' iffe: test: is ( !no_stat_time ) true ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff ifelse INPUT t.iffe $'iff ifelse
@ -352,7 +352,7 @@ iffe: test: is stat a type or typedef ... no
iffe: test: is st_ctime a member of struct stat ... yes iffe: test: is st_ctime a member of struct stat ... yes
iffe: test: is ( !no_stat_time ) true ... yes' iffe: test: is ( !no_stat_time ) true ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff ifelse INPUT t.iffe $'iff ifelse
@ -393,7 +393,7 @@ iffe: test: is stat a type or typedef ... no
iffe: test: is st_mtime a member of struct stat ... yes iffe: test: is st_mtime a member of struct stat ... yes
iffe: test: is ( !no_stat_time ) true ... yes' iffe: test: is ( !no_stat_time ) true ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff ifelse INPUT t.iffe $'iff ifelse
@ -430,7 +430,7 @@ iffe: test: is st_ctime a member of struct foo_stat ... no
iffe: test: is st_mtime a member of struct foo_stat ... no iffe: test: is st_mtime a member of struct foo_stat ... no
iffe: test: is ( !no_stat_time ) true ... no' iffe: test: is ( !no_stat_time ) true ... no'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'set explicit INPUT t.iffe $'set explicit
@ -453,7 +453,7 @@ OK
ERROR - $'iffe: test: is sys/types.h a header ... yes ERROR - $'iffe: test: is sys/types.h a header ... yes
iffe: test: is stdio.h a header ... yes' iffe: test: is stdio.h a header ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
TEST 04 'test variable/macro override' TEST 04 'test variable/macro override'
@ -469,7 +469,7 @@ HAVE_STDIO = hdr stdio'
ERROR - $'iffe: test: is sys/types.h a header ... yes ERROR - $'iffe: test: is sys/types.h a header ... yes
iffe: test: is stdio.h a header ... yes' iffe: test: is stdio.h a header ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -485,7 +485,7 @@ endif'
#endif' #endif'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -494,7 +494,7 @@ if - hdr stdio {
} }
endif' endif'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -503,7 +503,7 @@ if ? hdr stdio {
} }
endif' endif'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -512,7 +512,7 @@ if hdr - stdio {
} }
endif' endif'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -538,7 +538,7 @@ endif'
iffe: test: is stdio.h a header ... yes iffe: test: is stdio.h a header ... yes
iffe: test: is ( HAVE_STDIO ) true ... yes' iffe: test: is ( HAVE_STDIO ) true ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -560,7 +560,7 @@ exp ALSO HAVE_STDIO'
iffe: test: is stdio.h a header ... yes iffe: test: is stdio.h a header ... yes
iffe: test: is HAVE_STDIO true ... yes' iffe: test: is HAVE_STDIO true ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -582,7 +582,7 @@ ALSO = ( HAVE_STDIO )'
iffe: test: is stdio.h a header ... yes iffe: test: is stdio.h a header ... yes
iffe: test: is ( HAVE_STDIO ) true ... yes' iffe: test: is ( HAVE_STDIO ) true ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
TEST 05 'test code option sequence' TEST 05 'test code option sequence'
@ -605,7 +605,7 @@ tst seq - -DA=1 - -DB=1 note{ long int type }end compile{
ERROR - 'iffe: test: is sys/types.h a header ... yes ERROR - 'iffe: test: is sys/types.h a header ... yes
iffe: test: long int type ... yes' iffe: test: long int type ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -618,7 +618,7 @@ tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
t n = 0; t n = 0;
}end' }end'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -634,7 +634,7 @@ tst seq - -DA=1 - -DB=1 note{ long int type }end compile{
iffe: test: long int type ... iffe: test: long int type ...
iffe: test: long int type ... yes' iffe: test: long int type ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -647,7 +647,7 @@ tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
t n = 0; t n = 0;
}end' }end'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -668,7 +668,7 @@ tst seq - -DA=1 - -DB=1 note{ long int type }end compile{
iffe: test: long int type ... iffe: test: long int type ...
iffe: test: long int type ... no' iffe: test: long int type ... no'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -681,7 +681,7 @@ tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
t n = 0; t n = 0;
}end' }end'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -707,7 +707,7 @@ endif'
ERROR - 'iffe: test: is sys/types.h a header ... yes ERROR - 'iffe: test: is sys/types.h a header ... yes
iffe: test: long int type ... yes' iffe: test: long int type ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -723,7 +723,7 @@ if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
} }
endif' endif'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -742,7 +742,7 @@ endif'
iffe: test: long int type ... iffe: test: long int type ...
iffe: test: long int type ... yes' iffe: test: long int type ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -758,7 +758,7 @@ if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
} }
endif' endif'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -782,7 +782,7 @@ endif'
iffe: test: long int type ... iffe: test: long int type ...
iffe: test: long int type ... no' iffe: test: long int type ... no'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -798,7 +798,7 @@ if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
} }
endif' endif'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -824,7 +824,7 @@ endif'
ERROR - 'iffe: test: is sys/types.h a header ... yes ERROR - 'iffe: test: is sys/types.h a header ... yes
iffe: test: long int type ... yes' iffe: test: long int type ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -843,7 +843,7 @@ endif'
iffe: test: long int type ... iffe: test: long int type ...
iffe: test: long int type ... yes' iffe: test: long int type ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -863,7 +863,7 @@ iffe: test: long int type ...
iffe: test: long int type ... iffe: test: long int type ...
iffe: test: long int type ... yes' iffe: test: long int type ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v - t.iffe EXEC -r -v - t.iffe
INPUT t.iffe $'iff macro INPUT t.iffe $'iff macro
@ -888,7 +888,7 @@ iffe: test: long int type ...
iffe: test: long int type ... iffe: test: long int type ...
iffe: test: long int type ... no' iffe: test: long int type ... no'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
TEST 06 'block side effects' TEST 06 'block side effects'
@ -906,7 +906,7 @@ tst output{
#define _sys_types 1 /* #include <sys/types.h> ok */ #define _sys_types 1 /* #include <sys/types.h> ok */
HIT' HIT'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'iff INPUT t.iffe $'iff
@ -919,7 +919,7 @@ tst - output{
} }
}end' }end'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'iff INPUT t.iffe $'iff
@ -934,7 +934,7 @@ tst - output{
OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */
#define _sys_types 1 /* #include <sys/types.h> ok */' #define _sys_types 1 /* #include <sys/types.h> ok */'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'iff INPUT t.iffe $'iff
@ -950,7 +950,7 @@ tst - nooutput{
#define _sys_types 1 /* #include <sys/types.h> ok */ #define _sys_types 1 /* #include <sys/types.h> ok */
HIT' HIT'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
TEST 07 'diagnostics' TEST 07 'diagnostics'
@ -964,7 +964,7 @@ TEST 07 'diagnostics'
ERROR - $'iffe: t.iffe:1: tst: unknown feature test' ERROR - $'iffe: t.iffe:1: tst: unknown feature test'
EXIT 1 EXIT 1
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'if (1)' INPUT t.iffe $'if (1)'
@ -975,7 +975,7 @@ TEST 07 'diagnostics'
ERROR - $'iffe: t.iffe:1: missing endif' ERROR - $'iffe: t.iffe:1: missing endif'
EXIT 1 EXIT 1
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'if' INPUT t.iffe $'if'
@ -985,20 +985,20 @@ TEST 07 'diagnostics'
#define _sys_types 1 /* #include <sys/types.h> ok */' #define _sys_types 1 /* #include <sys/types.h> ok */'
ERROR - $'iffe: t.iffe:1: missing endif' ERROR - $'iffe: t.iffe:1: missing endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'endif' INPUT t.iffe $'endif'
ERROR - $'iffe: t.iffe:1: endif: no matching if' ERROR - $'iffe: t.iffe:1: endif: no matching if'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'if { INPUT t.iffe $'if {
}end' }end'
ERROR - $'iffe: t.iffe:2: missing }' ERROR - $'iffe: t.iffe:2: missing }'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
TEST 08 'negation consternation' TEST 08 'negation consternation'
@ -1121,7 +1121,7 @@ ONE
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1146,7 +1146,7 @@ exp _tst_hit !_tst_hit&_tst_true {
TWO 0 1 TWO 0 1
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1173,7 +1173,7 @@ THREE
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1196,7 +1196,7 @@ exp _tst_hit !_tst_hit&_tst_false {
#define _tst_true 1 /* ( 1 ) is true */ #define _tst_true 1 /* ( 1 ) is true */
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1223,7 +1223,7 @@ ONE
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1248,7 +1248,7 @@ exp _tst_hit !_tst_hit&&_tst_true {
TWO 0 1 TWO 0 1
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1275,7 +1275,7 @@ THREE
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1298,7 +1298,7 @@ exp _tst_hit !_tst_hit&&_tst_false {
#define _tst_true 1 /* ( 1 ) is true */ #define _tst_true 1 /* ( 1 ) is true */
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1324,7 +1324,7 @@ ONE
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1349,7 +1349,7 @@ endif'
TWO TWO
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1375,7 +1375,7 @@ THREE
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1394,7 +1394,7 @@ endif'
#define _tst_true 1 /* ( 1 ) is true */ #define _tst_true 1 /* ( 1 ) is true */
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1418,7 +1418,7 @@ OK
#endif' #endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
EXEC -r - t.iffe EXEC -r - t.iffe
INPUT t.iffe $'_tst_false = ( 0 ) INPUT t.iffe $'_tst_false = ( 0 )
@ -1434,7 +1434,7 @@ else {
} }
endif' endif'
EXEC -r -s bsh - t.iffe EXEC -r -s posix - t.iffe
TEST 10 'exp details' TEST 10 'exp details'
@ -1471,7 +1471,7 @@ iffe: test: is ( ! _aaa ) true ... yes
iffe: test: is ( _zzz ) true ... yes iffe: test: is ( _zzz ) true ... yes
iffe: test: is ( ! _zzz ) true ... no' iffe: test: is ( ! _zzz ) true ... no'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
TEST 11 'set [no]define' TEST 11 'set [no]define'
@ -1505,7 +1505,7 @@ iffe: test: is st_mode a member of struct stat ... yes
iffe: test: is ( _mem_st_mtime_stat ) true ... yes iffe: test: is ( _mem_st_mtime_stat ) true ... yes
iffe: test: is ( _mem_st_mode_stat ) true ... yes' iffe: test: is ( _mem_st_mode_stat ) true ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
TEST 12 'non-opaque mem' TEST 12 'non-opaque mem'
@ -1567,7 +1567,7 @@ iffe: test: is huh a reserved keyword ... no
iffe: test: is chr a reserved keyword ... no iffe: test: is chr a reserved keyword ... no
iffe: test: is char a reserved keyword ... yes' iffe: test: is char a reserved keyword ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -u -r -v - t.iffe EXEC -u -r -v - t.iffe
OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */
@ -1585,7 +1585,7 @@ iffe: test: is char a reserved keyword ... yes'
#define chr char /* alternate for reserved keyword chr */ #define chr char /* alternate for reserved keyword chr */
#endif' #endif'
EXEC -u -r -v -s bsh - t.iffe EXEC -u -r -v -s posix - t.iffe
EXEC -a -r -v - t.iffe EXEC -a -r -v - t.iffe
OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */
@ -1603,7 +1603,7 @@ iffe: test: is char a reserved keyword ... yes'
#define chr char /* alternate for reserved keyword chr */ #define chr char /* alternate for reserved keyword chr */
#endif' #endif'
EXEC -a -r -v -s bsh - t.iffe EXEC -a -r -v -s posix - t.iffe
EXEC -C -r -v - t.iffe EXEC -C -r -v - t.iffe
OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */ OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */
@ -1621,7 +1621,7 @@ iffe: test: is char a reserved keyword ... yes'
#define chr char /* alternate for reserved keyword chr */ #define chr char /* alternate for reserved keyword chr */
#endif' #endif'
EXEC -C -r -v -s bsh - t.iffe EXEC -C -r -v -s posix - t.iffe
TEST 14 'inc file' TEST 14 'inc file'
@ -1739,9 +1739,7 @@ iffe: test: is ( 1 ) true ... yes
iffe: test: is ( 2 ) true ... yes iffe: test: is ( 2 ) true ... yes
iffe: test: cat{ ... }end ... yes' iffe: test: cat{ ... }end ... yes'
EXEC -r -v -s bsh - t.iffe EXEC -r -v -s posix - t.iffe
EXEC -r -v -s osh - t.iffe
TEST 16 '{ define extern include print }' TEST 16 '{ define extern include print }'

View file

@ -19,20 +19,14 @@
# # # #
######################################################################## ########################################################################
# non-ksh script for the nmake ignore prefix # non-ksh script for the nmake ignore prefix
# @(#)ignore (AT&T Research) 1992-08-11 # @(#)ignore (ksh 93u+m) 2021-12-31
(command set -o posix) 2>/dev/null && set -o posix
modern_export=`v=; export v=ok 2>/dev/null; echo "$v"`
while : while :
do case $# in do case $# in
0) exit 0 ;; 0) exit 0 ;;
esac esac
case $1 in case $1 in
*=*) case $modern_export in *=*) export "$1"
ok) export "$1" ;;
*) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;;
esac
shift shift
;; ;;
*) break *) break

View file

@ -142,8 +142,8 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
[+debug|environment?Show environment and actions but do not [+debug|environment?Show environment and actions but do not
execute.] execute.]
[+flat?With the \bmake\b action, create a flat view by linking all [+flat?With the \bmake\b action, create a flat view by linking all
files from \b$INSTALLROOT\b, minus build system internals, onto files from \b$INSTALLROOT\b, minus \b*.old\b files,
their corresponding path under \b$PACKAGEROOT\b. onto their corresponding path under \b$PACKAGEROOT\b.
Only one architecture can have a flat view. Only one architecture can have a flat view.
If \bflat\b is specified with the \bclean\b action, then If \bflat\b is specified with the \bclean\b action, then
only clean up this flat view and do not delete \b$INSTALLROOT\b.] only clean up this flat view and do not delete \b$INSTALLROOT\b.]
@ -405,10 +405,10 @@ DESCRIPTION
debug|environment debug|environment
Show environment and actions but do not execute. Show environment and actions but do not execute.
flat With the make action, create a flat view by linking all files from flat With the make action, create a flat view by linking all files from
$INSTALLROOT, minus build system internals, onto their corresponding $INSTALLROOT, minus *.old files, onto their corresponding path under
path under $PACKAGEROOT. Only one architecture can have a flat view. $PACKAGEROOT. Only one architecture can have a flat view. If flat is
If flat is specified with the clean action, then only clean up this specified with the clean action, then only clean up this flat view
flat view and do not delete $INSTALLROOT. and do not delete $INSTALLROOT.
force Force the action to override saved state. force Force the action to override saved state.
never Run make -N and show other actions. never Run make -N and show other actions.
only Only operate on the specified packages. only Only operate on the specified packages.
@ -609,7 +609,7 @@ do case $i in
*:*=*) args="$args $i" *:*=*) args="$args $i"
continue continue
;; ;;
*=*) eval $(echo ' ' "$i" | sed 's,^[ ]*\([^=]*\)=\(.*\),n=\1 v='\''\2'\'',') *=*) n=${i%%=*} v=${i#*=}
;; ;;
esac esac
case $i in case $i in
@ -2763,13 +2763,20 @@ case $action in
clean|clobber) clean|clobber)
cd "$PACKAGEROOT" || exit cd "$PACKAGEROOT" || exit
note "cleaning up flat view" note "cleaning up flat view"
$exec find "arch/$HOSTTYPE" -name src -prune -o -type f -exec "$SHELL" -c ' # clean up all links with arch dir except bin/package
for h $exec find "arch/$HOSTTYPE" -path "arch/$HOSTTYPE/bin/package" -o -type f -exec "$SHELL" -c '
do p=${h#"arch/$HOSTTYPE/"} first=y
if test "$p" -ef "$h" for h # loop through the PPs
then rm -f "$p" do case $first in
y) set -- # clear PPs ("for" uses a copy)
first=n ;;
esac
p=${h#"arch/$HOSTTYPE/"} # get flat view path
if test "$p" -ef "$h" # is it part of the flat view?
then set -- "$@" "$p" # add to new PPs
fi fi
done done
exec rm -f "$@" # rm all at once: fast
' "$0" {} + ' "$0" {} +
case $flat in case $flat in
0) note "deleting arch/$HOSTTYPE" 0) note "deleting arch/$HOSTTYPE"
@ -3326,15 +3333,34 @@ cat $j $k
esac esac
eval capture mamake \$makeflags \$noexec \$target $assign eval capture mamake \$makeflags \$noexec \$target $assign
case $flat in case $HOSTTYPE in
1) note "creating flat view" darwin.*)
# clean up macOS .dSYM bundles belonging to deleted temps
cd "$PACKAGEROOT" || exit cd "$PACKAGEROOT" || exit
# exclude build system internals $exec find "arch/$HOSTTYPE" -type d -name '*.dSYM' -exec "$SHELL" -c '
$exec find "arch/$HOSTTYPE" -name package -prune -o -name probe -prune -o -name FEATURE -prune \ first=y
-o -name ok -prune -o -name src -prune -o -name '*.dSYM' -prune -o -path "*/lib/lib" -prune \ for d # loop through the PPs
-o -type f ! -name '*.old' -exec "$SHELL" -c ' do case $first in
y) set -- # clear PPs ("for" uses a copy)
first=n ;;
esac
e=${d%.dSYM} # get exe name
if ! test -f "$e" # nonexistent?
then set -- "$@" "$d" # add to new PPs
fi
done
exec rm -rf "$@" # rm all at once: fast
' "$0" {} +
;;
esac
case $flat in
1) note "updating flat view"
cd "$PACKAGEROOT" || exit
$exec find "arch/$HOSTTYPE" -type f ! -name '*.old' -exec "$SHELL" -c '
for h for h
do p=${h#"arch/$HOSTTYPE/"} do p=${h#"arch/$HOSTTYPE/"}
test "$h" -ef "$p" && continue # already created
d=${p%/*} d=${p%/*}
test -d "$d" || mkdir -p "$d" || exit test -d "$d" || mkdir -p "$d" || exit
ln -f "$h" "$p" 2>/dev/null || ln -sf "$h" "$p" || exit ln -f "$h" "$p" 2>/dev/null || ln -sf "$h" "$p" || exit

View file

@ -19,20 +19,14 @@
# # # #
######################################################################## ########################################################################
# non-ksh stub for the nmake silent prefix # non-ksh stub for the nmake silent prefix
# @(#)silent (AT&T Research) 1992-08-11 # @(#)silent (ksh 93u+m) 2021-12-31
(command set -o posix) 2>/dev/null && set -o posix
modern_export=`v=; export v=ok 2>/dev/null; echo "$v"`
while : while :
do case $# in do case $# in
0) exit 0 ;; 0) exit 0 ;;
esac esac
case $1 in case $1 in
*=*) case $modern_export in *=*) export "$1"
ok) export "$1" ;;
*) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;;
esac
shift shift
;; ;;
*) break *) break