mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Squashed 'cde/programs/dtksh/ksh93/' content from commit 66e1d4464
git-subtree-dir: cde/programs/dtksh/ksh93
git-subtree-split: 66e1d44642
This commit is contained in:
commit
c9b8687604
1269 changed files with 369117 additions and 0 deletions
870
src/cmd/INIT/C+probe
Normal file
870
src/cmd/INIT/C+probe
Normal file
|
|
@ -0,0 +1,870 @@
|
|||
:
|
||||
### this script contains archaic constructs that work with all sh variants ###
|
||||
# Glenn Fowler
|
||||
# AT&T Research
|
||||
#
|
||||
# @(#)C probe (AT&T Research) 2012-02-29
|
||||
#
|
||||
# probe [ -d ] c-compiler-path [ attributes ]
|
||||
#
|
||||
# common C probe preamble for the tool specific probes
|
||||
#
|
||||
# NOTE: some cc -E's do syntax analysis!
|
||||
|
||||
#
|
||||
# probe_* are first eval'd and then attempted from left to right
|
||||
#
|
||||
|
||||
probe_binding="-dy -dn -Bdynamic -Bstatic '-Wl,-ashared -Wl,+s' -Wl,-aarchive -call_shared -non_shared -dynamic -static -bshared -bstatic '' -static"
|
||||
probe_env="CC_OPTIONS CCOPTS LD_OPTIONS LDOPTS LIBPATH LPATH"
|
||||
probe_include="stdio.h iostream.h complex.h ctype.h plot.h stdarg.h varargs.h ranlib.h hash.h sys/types.h stab.h cmath cstdio iostream string"
|
||||
probe_longlong="long 'long long'"
|
||||
probe_longlong_t="__int64_t _int64_t __int64 _int64 int64"
|
||||
probe_l="l yyreject m sin mopt sin"
|
||||
probe_lxx="C exit ++ exit g++ exit"
|
||||
probe_ppprefix="a n"
|
||||
probe_size="size"
|
||||
probe_src="cxx C cc c"
|
||||
probe_sa=".sa"
|
||||
probe_sd=".dll .lib .dll .x"
|
||||
probe_sdb=".pdb"
|
||||
probe_so=".dylib .so .sl"
|
||||
probe_symprefix="_"
|
||||
probe_verbose="'-v -v' '-# -#' '-d -d' -dryrun '-V -V'"
|
||||
probe_version="--version -V -version -v"
|
||||
|
||||
#
|
||||
# the following are set by the preamble for the tool specific probe
|
||||
#
|
||||
|
||||
cc=cc
|
||||
debug=
|
||||
dir=.
|
||||
dll=.dll
|
||||
dynamic=
|
||||
exe=exe
|
||||
executable="test -x"
|
||||
hosted=
|
||||
ifs=${IFS-'
|
||||
'}
|
||||
obj=o
|
||||
ppenv=
|
||||
ppopt=
|
||||
predef=
|
||||
prepred=
|
||||
sa=
|
||||
sd=
|
||||
sdb=
|
||||
so=
|
||||
sov=
|
||||
static=
|
||||
stdlib=
|
||||
stdpp=
|
||||
suffix_command=
|
||||
if test "" != "$TMPDIR" -a -d "$TMPDIR"
|
||||
then tmpdir=$TMPDIR
|
||||
else tmpdir=/tmp
|
||||
fi
|
||||
tmpdir=$tmpdir/probe$$
|
||||
undef="define defined elif else endif error if ifdef ifndef include line pragma undef __STDC__ __STDPP__ __ARGC__ __BASE__ __BASE_FILE__ __DATE__ __FILE__ __FUNCTION__ __INCLUDE_LEVEL__ __LINE__ __PATH__ __TIME__ __TIMESTAMP__ __VERSION__"
|
||||
version_flags=
|
||||
version_stamp=
|
||||
version_string=
|
||||
|
||||
#
|
||||
# constrain the environment
|
||||
#
|
||||
|
||||
DISPLAY=
|
||||
LC_ALL=C
|
||||
export DISPLAY LC_ALL
|
||||
|
||||
#
|
||||
# now the common probes
|
||||
#
|
||||
|
||||
while :
|
||||
do case $1 in
|
||||
-d) debug=1 ;;
|
||||
-*) set ''; break ;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
cc=$1
|
||||
case $cc in
|
||||
[\\/]*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\*)
|
||||
;;
|
||||
*) echo "Usage: $0 [ -d ] c-compiler-path [ attributes ]" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
ATTRIBUTES=
|
||||
eval $2
|
||||
_probe_PATH=$PATH
|
||||
PATH=/usr/bin:/bin:$PATH
|
||||
|
||||
case $0 in
|
||||
*[\\/]*) dir=`echo $0 | sed -e 's,[\\/][\\/]*[^\\/]*\$,,'` ;;
|
||||
esac
|
||||
|
||||
$executable . 2>/dev/null || executable='test -r'
|
||||
|
||||
case $SHELL in
|
||||
[\\/]*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\*)
|
||||
sh=$SHELL
|
||||
;;
|
||||
*) sh=/bin/sh
|
||||
;;
|
||||
esac
|
||||
|
||||
trap 'code=$?; cd ..; rm -rf $tmpdir; exit $code' 0 1 2 3
|
||||
mkdir $tmpdir
|
||||
cd $tmpdir
|
||||
|
||||
exec 3>&1 4>&2 </dev/null
|
||||
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
|
||||
260
src/cmd/INIT/CONVERT.mk
Normal file
260
src/cmd/INIT/CONVERT.mk
Normal file
|
|
@ -0,0 +1,260 @@
|
|||
/*
|
||||
* {automake|configure} => {nmake|iffe} conversion support
|
||||
*
|
||||
* The first command line target overrides the default original source
|
||||
* directory name $(MAKEFILE:D). The hard work is in the makefile using
|
||||
* these assertions, since it must (manually) provide the nmake makefiles
|
||||
* and config equivalent iffe scripts. The conversion makefile is typically
|
||||
* named lib/package/PACKAGE.cvt in an ast package $PACKAGEROOT directory,
|
||||
* and the conversion is run from the $PACKAGEROOT directory, e.g.:
|
||||
*
|
||||
* nmake -I lib/package -f PACKAGE-VERSION/PACKAGE.cvt
|
||||
*
|
||||
* The conversion requires the ast nmake, pax and tw commands.
|
||||
*
|
||||
* After the conversion you will be liberated from ./configure, *.in,
|
||||
* *.am, automake, autom4te, libtool, make depend, and makefile
|
||||
* recursion ordering. You can build from $PACKAGEROOT using the ast
|
||||
* package(1) (which sets up the { HOSTTYPE PATH VPATH } environment):
|
||||
*
|
||||
* package make
|
||||
*
|
||||
* or cd into any arch/$HOSTTYPE/src subdirectory and rebuild that portion
|
||||
* of the hierarchy with the ast nmake(1) (after setting PATH and VPATH):
|
||||
*
|
||||
* nmake
|
||||
*
|
||||
* The conversion assertions are:
|
||||
*
|
||||
* package :CONVERT: file ...
|
||||
*
|
||||
* files in the original source directory are copied
|
||||
* and converted into the ./src and ./lib subdirectories
|
||||
* the default original source directory is ./original
|
||||
*
|
||||
* package package name
|
||||
* file original source file that must exist
|
||||
*
|
||||
* :OMIT: pattern
|
||||
*
|
||||
* files matching pattern are not copied into the converted
|
||||
* directory
|
||||
*
|
||||
* pattern ksh pattern of files to omit
|
||||
*
|
||||
* :COPY: from to [ file ... ]
|
||||
*
|
||||
* files in the from directory are copied to the to directory
|
||||
* the action may contain :MOVE: exceptions to the copy
|
||||
*
|
||||
* from original directory subdirectory
|
||||
* . names the original directory
|
||||
* .. names the
|
||||
* to converted subdirectory
|
||||
* libNAME => src/lib/libNAME
|
||||
* NAME => src/cmd/NAME
|
||||
* file files or files in subdirectories to be copied;
|
||||
* explicit files are copied to the to directory;
|
||||
* if no files are specified then the from hierarchy
|
||||
* is recursively copied to the converted directory
|
||||
*
|
||||
* :MOVE: to file ...
|
||||
*
|
||||
* :COPY: assertion exceptions placed in the assertion's action
|
||||
*
|
||||
* to files or subdirectory files are copied to this directory
|
||||
* file file or files in subdirectories to be copied
|
||||
*
|
||||
* :FILE: to file <<!
|
||||
* contents
|
||||
* !
|
||||
*
|
||||
* the :FILE: action is copied to the named file in the to directory
|
||||
* the :FILE: action is usually specified using the here syntax to
|
||||
* avoid make comment, quote and variable expansion
|
||||
*
|
||||
* :EDIT: to file ... | - pattern <<!
|
||||
* edit script
|
||||
* !
|
||||
*
|
||||
* the :EDIT: action is an ed(1) script applied to each file in the
|
||||
* to directory after it has been copied from the original source
|
||||
* directory; if to is - then the :EDIT: action is a sed(1) script
|
||||
* that is applied to all files matching the file pattern during the
|
||||
* copy from the original source directory; a file may be subject to
|
||||
* both a sed(1) and ed(1) :EDIT:; the :EDIT: action is usually
|
||||
* specified using the here syntax to avoid make comment, quote and
|
||||
* variable expansion
|
||||
*/
|
||||
|
||||
.CONVERT.ID. = "@(#)$Id: CONVERT (AT&T Research) 2004-03-19 $"
|
||||
|
||||
set nojobs noscan nowriteobject writestate=$$(MAKEFILE).ms
|
||||
|
||||
package = $(PWD:B)
|
||||
here = !-=-=-=-=-!
|
||||
hierarchy = src src/cmd src/lib
|
||||
omit = .*|*.?(l)[ao]
|
||||
original = $(MAKEFILE:D)
|
||||
showedit = $(-debug:?p??)
|
||||
|
||||
CPFLAGS = -u
|
||||
PAXFLAGS = -u -v
|
||||
STDEDFLAGS = -
|
||||
TW = tw
|
||||
TWFLAGS = -CP
|
||||
|
||||
all : .VIRTUAL file
|
||||
file : .VIRTUAL edit
|
||||
edit : .VIRTUAL copy
|
||||
copy : .VIRTUAL init
|
||||
init : .VIRTUAL
|
||||
|
||||
.MAKEINIT : .cvt.init
|
||||
|
||||
.cvt.init : .MAKE .VIRTUAL .FORCE
|
||||
local D
|
||||
if D = "$(~.ARGS:O=1)"
|
||||
if "$(D:T>FD)"
|
||||
original := $(D)
|
||||
.ARGS : .CLEAR $(~.ARGS:O>1)
|
||||
end
|
||||
end
|
||||
|
||||
.cvt.filter =
|
||||
.cvt.package =
|
||||
|
||||
.cvt.atom : .FUNCTION
|
||||
local N V
|
||||
V := $(%:O=1)
|
||||
let .cvt.$(V) = .cvt.$(V) + 1
|
||||
return .cvt.$(V).$(.cvt.$(V))
|
||||
|
||||
.cvt.omit : .FUNCTION
|
||||
return -s',^\(\(?K)?(*/)($(omit))?(/*))$,,$(showedit)'
|
||||
|
||||
.cvt.to : .FUNCTION
|
||||
if "$(%)" == "."
|
||||
return src
|
||||
end
|
||||
if "$(%)" == "*/*"
|
||||
return src/$(%)
|
||||
end
|
||||
if "$(%)" == "lib*"
|
||||
return src/lib/$(%)
|
||||
end
|
||||
return src/cmd/$(%)
|
||||
|
||||
":CONVERT:" : .MAKE .OPERATOR
|
||||
local I
|
||||
package := $(<)
|
||||
I := $(hierarchy:C,$,/Makefile)
|
||||
init : .cvt.verify $(I)
|
||||
$(I) : .ACCEPT
|
||||
test -d $(<:D) || $(MKDIR) -p $(<:D)
|
||||
echo :MAKE: > $(<)
|
||||
.cvt.verify : .MAKE .FORCE .REPEAT
|
||||
local I
|
||||
if I = "$(.cvt.package:T!=F)"
|
||||
error 3 $(original): not a $(package) source directory: missing $(I)
|
||||
end
|
||||
.cvt.package := $(>:C,^,$$(original)/,)
|
||||
|
||||
":COPY:" : .MAKE .OPERATOR
|
||||
local F T I A
|
||||
F := $(>:O=1)
|
||||
T := $(.cvt.to $(>:O=2))
|
||||
A := $(.cvt.atom copy)
|
||||
copy : $(A)
|
||||
$(A) : .VIRTUAL
|
||||
if F == "."
|
||||
$(A) : $(T)
|
||||
$(T) :
|
||||
test -d $(<) || $(MKDIR) -p $(<)
|
||||
for I $(>:O>2)
|
||||
eval
|
||||
$$(A) : $(I:D=$(T):B:S)
|
||||
$(I:D=$(T):B:S) : $$(original)/$(I)
|
||||
$$(CP) $$(CPFLAGS) $$(*) $$(<)
|
||||
end
|
||||
end
|
||||
elif "$(F:T=FF)" || "$(F:N=*.(pax|t[bg]z))"
|
||||
eval
|
||||
$$(A) : $$(F)
|
||||
test -d $(T) || $$(MKDIR) -p $(T)
|
||||
cd $(T)
|
||||
$$(PAX) $$(PAXFLAGS) -rf $$(*:P=A) -s ',^$(>:O=2)/*,,' $(.cvt.omit) $(.cvt.filter)
|
||||
end
|
||||
else
|
||||
F := $$(original)/$(F)
|
||||
if ! "$(@:V)"
|
||||
eval
|
||||
$$(A) : .FORCE
|
||||
test -d $(T) || $$(MKDIR) -p $(T)
|
||||
cd $(F:V)
|
||||
$$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.filter) $(T:P=A)
|
||||
end
|
||||
else
|
||||
.cvt.move =
|
||||
: $(@:V:@R)
|
||||
eval
|
||||
$$(A) : .FORCE
|
||||
test -d $(T) || $$(MKDIR) -p $(T)
|
||||
cd $(F:V)
|
||||
$$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.move) $(.cvt.filter) $(T:P=A)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
":EDIT:" : .MAKE .OPERATOR
|
||||
local A D F
|
||||
D := $(>:O=1)
|
||||
if D == "-"
|
||||
A := ^$(>:O=2)^$$(SED) -e $(@:Q:/'\n'/ -e /G)
|
||||
.cvt.filter += --action=$(A:@Q)
|
||||
else
|
||||
D := $(.cvt.to $(D))
|
||||
F := $(>:O>1:C,^,$(D)/,)
|
||||
edit : $(F)
|
||||
eval
|
||||
$$(F) :
|
||||
$$(STDED) $$(STDEDFLAGS) $$(<) <<'$(here)'
|
||||
$(@:V)
|
||||
w
|
||||
q
|
||||
$(here)
|
||||
end
|
||||
end
|
||||
|
||||
":FILE:" : .MAKE .OPERATOR
|
||||
local ( D F ) $(>)
|
||||
local A
|
||||
A := $(.cvt.atom file)
|
||||
$(A) := $(@:V)
|
||||
D := $(.cvt.to $(D))
|
||||
file : $(D)/$(F)
|
||||
eval
|
||||
$$(D)/$$(F) :
|
||||
test -d $$(<:D) || $$(MKDIR) -p $$(<:D)
|
||||
cat > $$(<) <<'$(here)'
|
||||
$$($(A):V)
|
||||
$(here)
|
||||
end
|
||||
|
||||
":MOVE:" : .MAKE .OPERATOR
|
||||
local T I
|
||||
T := ../../../$(.cvt.to $(>:O=1))
|
||||
for I $(>:O>1)
|
||||
if I == "*/"
|
||||
.cvt.move += -s',^\(\(?K)$(I)),$(T)/,$(showedit)'
|
||||
.cvt.move += -s',^\(\(?K)$(I:C%/$%%))$,,$(showedit)'
|
||||
else
|
||||
.cvt.move += -s',^\(\(?K)$(I))$,$(T)/$(I:B:S),$(showedit)'
|
||||
end
|
||||
end
|
||||
|
||||
":OMIT:" : .MAKE .OPERATOR
|
||||
local P
|
||||
for P $(>)
|
||||
omit := $(omit)|$(P)
|
||||
end
|
||||
45
src/cmd/INIT/MAPLIB.mk
Normal file
45
src/cmd/INIT/MAPLIB.mk
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* normalize local -l* library conventions
|
||||
*
|
||||
* L [ [ G11 ... G1n ] ... [ Gg1 ... Ggn ] ] :MAPLIB: T1.c ... Tn.c
|
||||
*
|
||||
* if Giji not specified then G11 == L
|
||||
* the first Ti.c that compiles/links with group -lGi1 ... -lGin
|
||||
* but does not compile/link with no libraries maps
|
||||
* -lL to require -lGi1 ... -lGin
|
||||
* otherwise -lL is not required and maps to "no library required"
|
||||
*/
|
||||
|
||||
":MAPLIB:" : .MAKE .OPERATOR
|
||||
local L P
|
||||
L := $(<:B:O=1)
|
||||
if ! ( P = "$(<:B:O>1)" )
|
||||
P := $(L)
|
||||
end
|
||||
$(LIBDIR)/lib/$(L) :INSTALL: $(L).req
|
||||
eval
|
||||
$(L).req : (CC) $$(>)
|
||||
set -
|
||||
r='-'
|
||||
for i in $$(*)
|
||||
do if $$(CC) -c $i > /dev/null
|
||||
then g=
|
||||
for p in $(P) -
|
||||
do case $p in
|
||||
-) if $$(CC) -o $$(<:B:S=.exe) $i $g > /dev/null 2>&1
|
||||
then $$(CC) -o $$(<:B:S=.exe) $i > /dev/null 2>&1 || {
|
||||
r="$g"
|
||||
break 2
|
||||
}
|
||||
fi
|
||||
g=
|
||||
;;
|
||||
*) g="$g -l$p"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
done 2>/dev/null
|
||||
echo " $r" > $$(<)
|
||||
rm -f $$(<:B:S=.exe) $$(*:B:S=$$(CC.SUFFIX.OBJECT))
|
||||
end
|
||||
2
src/cmd/INIT/MSGFUN.mk
Normal file
2
src/cmd/INIT/MSGFUN.mk
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/* stub for pre-2000-05-01 nmake */
|
||||
":MSGFUN:" : .MAKE .OPERATOR
|
||||
2
src/cmd/INIT/MSGKEY.mk
Normal file
2
src/cmd/INIT/MSGKEY.mk
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/* stub for pre-2000-05-01 nmake */
|
||||
":MSGKEY:" : .MAKE .OPERATOR
|
||||
1393
src/cmd/INIT/Mamfile
Normal file
1393
src/cmd/INIT/Mamfile
Normal file
File diff suppressed because it is too large
Load diff
13
src/cmd/INIT/PROBE.mk
Normal file
13
src/cmd/INIT/PROBE.mk
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* @(#)probe (AT&T Bell Laboratories) 11/11/91
|
||||
*
|
||||
* <lang> <tool> :PROBE: *.probe *.sh *
|
||||
*
|
||||
* common probe script installation
|
||||
* generates probe.sh and probe in .
|
||||
*/
|
||||
|
||||
":PROBE:" : .MAKE .OPERATOR
|
||||
probe.sh : $(LIBDIR)/probe/$(<:O=1)/probe $(>:N=*.(probe|sh))
|
||||
cat $(*) > $(<)
|
||||
$(LIBDIR)/probe/$(<:O=1)/$(<:O=2) :INSTALLDIR: probe $(>:N!=*.(probe|sh))
|
||||
934
src/cmd/INIT/RELEASE
Normal file
934
src/cmd/INIT/RELEASE
Normal file
|
|
@ -0,0 +1,934 @@
|
|||
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 (macos ld workaround)
|
||||
08-04-01 package.sh: handle multiple admin HOSTTYPEs per HOST
|
||||
08-03-28 C+probe: add C++ #include <iostream> (no extension) dir probes
|
||||
08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally
|
||||
08-02-28 make.probe: fix probe_warn to include ld!
|
||||
08-02-02 make.probe: add CC.RUNPATH to match default -L order
|
||||
08-01-31 package.sh: check lib64 for LD_LIBRARY_PATH
|
||||
08-01-31 iffe.sh: tweak ancient /bin/sh workarounds
|
||||
08-01-28 make.probe: darwin ld export dynamic is -force_flat_namespace
|
||||
08-01-28 C+probe: handle sgi cc error message but exit 0 botch(es)
|
||||
08-01-23 package.sh: fix checksum doc typo
|
||||
08-01-09 C+probe: add __FUNCTION__ to the undef (don't check) list
|
||||
07-12-14 iffe.sh: add set nooptimize
|
||||
07-12-03 package.sh: add LC_ALL=C
|
||||
07-11-27 package.sh: fix overaggressive *.md5 cleanup
|
||||
07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal
|
||||
07-11-05 package.sh: fix write op error count pattern
|
||||
07-11-05 package.mk: fix $(~req) .ver binding
|
||||
07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING]
|
||||
07-08-01 package.sh: handle 'package read lcl|tgz'
|
||||
07-05-08 regress.sh: execute basename instead of absolute path for short $0
|
||||
07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer
|
||||
07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh
|
||||
07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...}
|
||||
07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG
|
||||
07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe
|
||||
07-03-28 package.sh: fix binary tgz architecture type duplication
|
||||
07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst
|
||||
07-03-28 iffe.sh: add -F header to mac test
|
||||
07-03-23 make.probe: handle file(1) that returns 'archive' for .so
|
||||
07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF
|
||||
07-03-11 package.sh: add nocopyright and tst => nocopyright
|
||||
07-03-11 package.mk: add copyright=0
|
||||
07-03-08 C+probe: restore IFS after probe.ini
|
||||
07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR}
|
||||
07-01-05 package.sh: fix "admin write binary" logic
|
||||
07-01-01 iffe.sh: add "cmd" --verbose trace
|
||||
07-01-01 iffe.sh: sort => LC_ALL=C sort
|
||||
07-01-01 C+probe: LC_ALL=C
|
||||
06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local!
|
||||
06-11-23 package.sh: *.md5 are not tarballs -- doh
|
||||
06-11-23 iffe.sh: add -F, --features=feature-test-header
|
||||
06-11-11 make.probe: favor lib64 over lib for hosttype==*64
|
||||
06-10-31 make.probe: add "-ignore-source-dir -iquote" test
|
||||
06-10-31 iffe.sh: add status{...} code block
|
||||
06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?)
|
||||
06-10-11 package.sh: handle already gunzip'd *.tgz
|
||||
06-10-06 iffe.sh: add reference for header content tests
|
||||
06-09-27 regress.sh: fix UMASK to do DO too (duh)
|
||||
06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics)
|
||||
06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together
|
||||
06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too
|
||||
06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io
|
||||
06-09-05 C+probe: add { probe_version version_stamp version_string }
|
||||
06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING]
|
||||
06-08-27 regress.sh,mktest.sh: add UMASK
|
||||
06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE
|
||||
06-08-25 mktest.sh: add IGNORESPACE
|
||||
06-08-24 mktest.sh: handle \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 disambuguate
|
||||
04-05-11 package.sh: package verbose update lists closure for package setup
|
||||
package.sh: add src/lib/libardir to nmake proto bootstrap
|
||||
regress.sh: probe for rm -u vs. chmod -R u+rwx
|
||||
04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH
|
||||
04-04-15 make.probe: check probe_libdir false positives
|
||||
package.sh: add lib/package/*.lic src package subdirs
|
||||
package.mk: add mamfile=0 to inhibit Mamfile generation
|
||||
iffe.sh: config name_DECLARED => HAVE_name_DECL
|
||||
iffe.sh: fix mac to handle default value
|
||||
04-04-11 iffe.sh: normalize sed [\\\\/] quoting
|
||||
04-04-04 package.mk: only checksum generated tarballs
|
||||
mamprobe.sh: add STDCHMOD
|
||||
04-04-01 C+probe: set export LANG=C for uniform error messages
|
||||
make.probe: another CC.STDLIB tweak
|
||||
package.sh: fix regress core dump pattern, expand [a-z] match ranges
|
||||
04-03-31 Makefile: add intl :MAPLIB: test
|
||||
make.probe: fix CC.STDLIB search; drop CC.* path duplicates
|
||||
04-03-28 iffe.sh: drop unused exec $stdin<&0 dup
|
||||
04-03-25 Makefile: add iconv :MAPLIB:
|
||||
package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override
|
||||
04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz)
|
||||
package.sh: update base change on md5 sum instead of size
|
||||
iffe.sh: adjust case label \ and keyword quoting for ancient /bin/sh
|
||||
04-03-22 probe.win32: ncc => nld
|
||||
04-03-19 CONVERT.mk: change the instructions and old source dir default
|
||||
package.mk: fix recurse=list check
|
||||
package.mk: add *.md5 checksum for each *.(c|exe|tgz)
|
||||
package.sh: fix update base/delta/sync existence check
|
||||
04-03-18 iffe.sh: -d2 does not remove core dumps on exit
|
||||
04-03-17 package.sh: fix make recurse arg/action order
|
||||
04-02-29 package.sh: add regress action to compare current and previous tests
|
||||
package.sh: fix sgi.mips[23] HOSTTYPE test for old irix cc
|
||||
package.sh: add `export variable ...'
|
||||
package.sh: admin action now handles host name with non-id chars
|
||||
package.sh: non-numeric M T W in admin.db disables that action
|
||||
package.sh: fix admin write binary local vs. shared clash
|
||||
cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable
|
||||
cc.hp.pa64: sync with cc.hp.pa
|
||||
cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib
|
||||
probe.win32: sync with make.probe
|
||||
make.probe: fix last chance dynamic test
|
||||
make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E
|
||||
make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall
|
||||
make.probe: move probe_dll_def to the end of probe_dll
|
||||
package.mk: capture subcomponent mamfile recursion
|
||||
04-02-24 make.probe: strip "..." from cc/ld traces
|
||||
iffe.sh: add ``set [no]define'' to disable macro #define/#undef
|
||||
04-02-23 make.probe: rework CC.LD search
|
||||
04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export
|
||||
make.probe: resurrect CC.PIC with separate semantics from CC.DLL
|
||||
make.probe: add CC.SHARED.LD for CC.SHARED linker
|
||||
C+probe: clear DISPLAY to stifle interactive windows
|
||||
04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end
|
||||
make.probe: add { CC.AR CC.SIZE }, fix cross command search
|
||||
cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug
|
||||
04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++
|
||||
04-02-04 package.sh: fix cross compilation bug that mixed binary formats
|
||||
04-02-02 package.sh: package admin now ditto's bin/package too
|
||||
04-01-30 cc.sgi.mips3: drop warning 3421
|
||||
04-01-11 regress.sh: output label#count for tests in loops
|
||||
04-01-05 regress.sh: fix bug that ignored the first SAME
|
||||
04-01-04 crossexec.sh: fix typo that did not recognize rcp
|
||||
03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse()
|
||||
03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency
|
||||
03-09-23 ratz.c: fix tar header number parse bug that skipped to next number
|
||||
regress.sh: rm cleanup now handles files matching -*
|
||||
03-09-11 iffe.sh: add unnamed { ... } blocks
|
||||
regress.sh: add COPY from to, like MOVE but comprison still done
|
||||
regress.sh: rm -rfu to handle test dirs w/o u+rwx
|
||||
03-08-14 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 unuinitialized time in make()
|
||||
ratz.c: fix meter buffer overflow
|
||||
02-10-20 package.sh: fix lib/probe/C/make/probe update test
|
||||
02-10-18 probe.win32: update for mingw
|
||||
make.probe: add bash workaround to SHELLMAGIC test
|
||||
package.sh: work around yet another cygwin hassle
|
||||
02-10-17 iffe.sh: short circuit id check for *[-+/\\]*
|
||||
02-10-08 regress.sh: unset FIGNORE to avoid rm . errors
|
||||
package.sh: unset FIGNORE to avoid rm . errors
|
||||
package.sh: $CC must at least compile and executable hello world
|
||||
02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz
|
||||
package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS)
|
||||
iffe.sh: add identifier checks for tests that (implicitly) require them
|
||||
iffe.sh: disambiguate a few --config macros
|
||||
02-10-02 iffe.sh: fix shell=bsh `hdr a/b'
|
||||
02-09-30 package.sh: handle chmod of -* files
|
||||
package.sh: verify that $SHELL is Bourne compatible
|
||||
package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation
|
||||
iffe.sh: fix bug that didn't define mac variable on success
|
||||
02-09-22 package.sh: handle admin_action=ditto
|
||||
iffe.sh: --config sizeof(foo) macro is SIZEOF_foo
|
||||
iffe.sh: fix long.long test so it doesn't defeat uwin "typ long.long"
|
||||
mamprobe.sh: convert $("foo") nmake string constants
|
||||
02-09-21 mamprobe.sh: "-" info-path writes probe info to stdout
|
||||
02-09-11 make.probe: move from nmake src to be part of mamprobe.sh
|
||||
mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end
|
||||
mamake.c: pass cc absolute path to mamprobe
|
||||
package.sh: generate mamprobe -- yuk (at least 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 vaibale from sccs,cvs ident strings -- duh
|
||||
02-01-24 C+probe: check CC.DYNAMIC to handle cc that accept but ignore -B*
|
||||
iffe.sh: handle 'mem struct.a.b'
|
||||
02-01-22 iffe.sh: cache (internal) `foo vs. struct foo' test results
|
||||
package.sh: uts.370 => uts.390
|
||||
02-01-18 package.sh: fix uts hosttype
|
||||
02-01-17 package.sh: add 'results failed ...' to list failures only
|
||||
package.sh: change ARCH internal var to all_types to avoid env conflict
|
||||
iffe.sh: fix hdr/lib precheck that missed some -- ouch
|
||||
iffe.sh: fix noexecute test that forgot to check compile first!
|
||||
02-01-15 ratz.c: fix path[] type typo
|
||||
02-01-01 package.mk: tighten license search
|
||||
02-01-08 package.sh: `pwd` => ${PWD:-`pwd`}
|
||||
package.mk: expand license file pattern match
|
||||
02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value"
|
||||
iffe.sh: fix initial <sys/types.h> check to honor --config
|
||||
01-12-25 iffe.sh: fix bug where -o file restored old file
|
||||
01-12-23 package.mk: uniq the closure lists
|
||||
01-12-07 ratz.c: fix --meter to retain paths containing " -- "
|
||||
01-11-30 ratz.c: use sear_system() to execute; should work on all windows
|
||||
01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status
|
||||
01-11-26 ditto.sh: drop n+=v for ksh compatibility
|
||||
01-11-21 ditto.sh: add rsync script replacement [hey, it works!]
|
||||
package.sh: add [ditto]:directory notation to admin.db
|
||||
01-10-31 package.sh: handle *.sum paths with embedded space
|
||||
package.sh: change executable() to onpath()
|
||||
package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack)
|
||||
package.sh: add os2 fix to `host type'
|
||||
mamake.c: add .exe hack
|
||||
iffe.sh: fix intrinsic function lib test
|
||||
mamprobe.sh: update pic probe to match make.probe for linux.ia64
|
||||
01-10-30 package.sh: make action skeleton view now checks subdirs
|
||||
01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP
|
||||
package.mk: tarball package.notice replaces `license accepted' prompt
|
||||
package.sh: eliminate `license accepted' prompt
|
||||
package.sh: add update to download latest from a url
|
||||
package.sh: use builtin arithmetic when we know 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 os10 additions
|
||||
package: add DYLD_LIBRARY_PATH initialization
|
||||
add ldd.$(CC.HOSTTYPE)
|
||||
00-10-01 iffe: handle -I* -L* options
|
||||
00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs
|
||||
00-09-19 C+probe: add probe_longlong
|
||||
00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake
|
||||
00-09-08 iffe: 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: strengthed -lm probe
|
||||
98-01-23 Makefile: check for -ldl -lm
|
||||
C.probe: handle gcc -v -E phony include dirs
|
||||
iffe: fix lcl by dropping sort -u -- we need the real first
|
||||
iffe: `mem x' to test if x is a non-opaque struct
|
||||
98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3
|
||||
$(INSTALLROOT)/lib64 for sgi.mips4
|
||||
add cc.hp.pa
|
||||
98-01-01 cc.sgi.mips*: turn off ld library multiply defined
|
||||
97-10-11 regress: add VIEW function for locating data
|
||||
97-10-01 Makefile: -ldl test moved to libdll Makefile
|
||||
97-08-11 regress: add MOVE
|
||||
regress: add SAME
|
||||
regress: use getopts
|
||||
regress: `EXEC' repeats previous test
|
||||
97-07-17 use: tweak PATH and LIBPATH bootstrap order
|
||||
iffe: fix lcl bug that botched pathnames with embedded spaces
|
||||
97-06-12 iffe: add npt `needs prototype' test
|
||||
97-05-09 hostinfo: mvs.* => mvs.390
|
||||
Makefile: cc.$(_hosttype_) workaround installed here
|
||||
iffe: fix nolink{ ... }end
|
||||
iffe: add [no]static{ ... }end for static link test
|
||||
C.probe: _probe_PATH => _probe_export which must be eval'd
|
||||
97-04-01 use: _RLD_ROOT set too
|
||||
97-03-17 mm2html: changed inner loop
|
||||
mm2html: handle .if|.ie|.el, .so
|
||||
mm2html: handle different man styles
|
||||
mm2html: differentiate mm/man in some non-obvious cases
|
||||
hostinfo: r5000 is not mips4
|
||||
97-02-14 hostinfo: validate type with cc
|
||||
96-12-25 C.probe: uwin tweaks
|
||||
iffe: use `...` instead of $(...) for alpha /bin/sh
|
||||
iffe: fix `typ' divide by 0
|
||||
iffe: `lcl' now drops X: prefix
|
||||
iffe: +l* -> -l*
|
||||
iffe: eval around ${...#%...} for bsd /bin/sh
|
||||
use: add sgi.mips LD_LIBRARY<abi>_PATH variants
|
||||
use: add -e to list exports
|
||||
iffe: lcl leaves leading [a-zA-Z]: for dos
|
||||
iffe: fix no{link|output|execute} logic
|
||||
C.probe: don't automatically add /usr/include for non-hosted compilers
|
||||
C.probe: don't automatically place /usr/include last
|
||||
C.probe: check gcc style -v -E for stdinclude usrinclude
|
||||
96-11-28 iffe: check BASH_VERSION for IFS botch
|
||||
iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx)
|
||||
hostinfo: fix sgi.mips[234] tests
|
||||
hostinfo: fix ncr.i386 tests
|
||||
96-10-31 iffe: work around old bsh here doc bug by running separate sh
|
||||
96-10-11 iffe: *.iffe and *.iff for iffe src files
|
||||
hostinfo: tighten sgi.mips cpu type check
|
||||
96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib
|
||||
96-09-17 iffe: fix typ bug that failed for single id types!
|
||||
96-08-31 hostinfo: handle recent sgi hinv cpu changes
|
||||
96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx
|
||||
96-05-09 C.probe: drop multiple / in stdinclude
|
||||
96-02-29 use: package root must have bin and lib subdir
|
||||
mm2html: add
|
||||
C.probe: probe_members += -whole-archive for gcc
|
||||
iffe: add + fix the blasted `...'...\\...'...`
|
||||
96-01-31 use: add pkg dir
|
||||
hostinfo: add tandem
|
||||
96-01-01 hostinfo: windows_nt|windows[0-9][0-9] -> win32
|
||||
95-11-24 hostinfo: linux-aout.* for non-elf linux
|
||||
95-11-11 use: add aix LIBPATH
|
||||
95-10-11 hostinfo: no args prints type
|
||||
95-08-11 use: add
|
||||
95-05-09 save original PATH in _probe_PATH
|
||||
beef up library dir probe
|
||||
95-04-01 use c source suffix if it still preserves the dialect
|
||||
add hostinfo
|
||||
add lib/hostinfo/typemap user type map
|
||||
add sol.sun4 cpu count
|
||||
fix C.probe to properly handle C/C++ combined compiler drivers
|
||||
add NeXT to hostinfo
|
||||
bummer: mach has /usr/bin/hostinfo
|
||||
95-03-19 fix dialect executable test
|
||||
95-03-19 --- release 0.0 ---
|
||||
197
src/cmd/INIT/TEST.mk
Normal file
197
src/cmd/INIT/TEST.mk
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
/*
|
||||
* regression test support
|
||||
*
|
||||
* @(#)TEST.mk (AT&T Research) 2010-05-19
|
||||
*
|
||||
* test management is still in the design phase
|
||||
*/
|
||||
|
||||
/*
|
||||
* three forms for :TEST:
|
||||
*
|
||||
* :TEST: xxx yyy ...
|
||||
*
|
||||
* $(REGRESS) $(REGRESSFLAGS) xxx.tst
|
||||
* $(REGRESS) $(REGRESSFLAGS) yyy.tst
|
||||
*
|
||||
* :TEST: xxx.tst yyy ...
|
||||
*
|
||||
* $(REGRESS) $(REGRESSFLAGS) xxx.tst yyy ...
|
||||
*
|
||||
* :TEST: xxx.c [ :: test-prereq ... :: ] [ args [ : args ... ] ]
|
||||
*
|
||||
* :TEST: xxx.sh [ :: test-prereq ... :: ] [ args [ : args ... ] ]
|
||||
*
|
||||
* xxx :TEST: prereq ...
|
||||
* [ action ]
|
||||
*
|
||||
* $(*) if no action
|
||||
*/
|
||||
|
||||
":TEST:" : .MAKE .OPERATOR
|
||||
local B G P S T
|
||||
test : .INSERT .TESTINIT
|
||||
if "$("tests":T=FD)"
|
||||
.SOURCE : tests
|
||||
end
|
||||
P := $(>:O=1)
|
||||
if "$(P:N=*.tst)" && ! "$(@:V)"
|
||||
B := $(P:B)
|
||||
if ! ( T = "$(<:V)" )
|
||||
T := $(B)
|
||||
end
|
||||
test : - test.$(T)
|
||||
eval
|
||||
test.$$(T) : $$(B).tst
|
||||
$$(REGRESS) $$(REGRESSFLAGS) $$(*) $(>:V:O>1)
|
||||
:SAVE: $$(B).tst
|
||||
end
|
||||
elif "$(P:N=*@(.sh|$(.SUFFIX.c:/ /|/G)|$(.SUFFIX.C:/ /|/G)))"
|
||||
B := $(P:B)
|
||||
if ! ( T = "$(<:V)" )
|
||||
T := $(B)
|
||||
end
|
||||
:INSTALLDIR: $(B)
|
||||
$(B) :: $(P) $(*:-l*|*$(CC.SUFFIX.ARCHIVE))
|
||||
if "$(P:N=*.sh)"
|
||||
TESTCC == $(CC)
|
||||
$(B) : (TESTCC)
|
||||
end
|
||||
test : - test.$(T)
|
||||
if "$(@:V)"
|
||||
eval
|
||||
test.$$(T) : $$(B) $(>:V:O>1)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$(@:V)
|
||||
end
|
||||
elif "$(>:V:O>1)"
|
||||
local I A V X S R=0
|
||||
for A $(>:V:O>1)
|
||||
if A == "::"
|
||||
let R = !R
|
||||
elif A == ":"
|
||||
let I = I + 1
|
||||
test.$(T).$(I) := $(V:V)
|
||||
V =
|
||||
X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*)
|
||||
S = $("\n")
|
||||
elif A != "-l*|*$(CC.SUFFIX.ARCHIVE)"
|
||||
if R
|
||||
test.$(A) : .VIRTUAL .FORCE
|
||||
test.$(T) : test.$(A)
|
||||
else
|
||||
V += $(A:V)
|
||||
end
|
||||
end
|
||||
end
|
||||
if V
|
||||
let I = I + 1
|
||||
test.$(T).$(I) := $(V:V)
|
||||
X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*)
|
||||
end
|
||||
eval
|
||||
test.$$(T) : $$(B)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$(X:V)
|
||||
end
|
||||
else
|
||||
eval
|
||||
test.$$(T) : $$(B)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$$(*)
|
||||
end
|
||||
end
|
||||
elif ! "$(<:V)"
|
||||
G = 1
|
||||
for B $(>)
|
||||
if B == "-|--"
|
||||
let G = !G
|
||||
else
|
||||
if ! G
|
||||
T =
|
||||
elif ! ( T = "$(B:A=.COMMAND)" ) && ! "$(B:A=.TARGET)"
|
||||
for S .c .sh
|
||||
if "$(B:B:S=$(S):T=F)"
|
||||
:INSTALLDIR: $(B)
|
||||
$(B) :: $(B:B:S=$(S))
|
||||
T := $(B)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
test : - test.$(B)
|
||||
test.$(B) : $(T) - $(B).tst
|
||||
$(REGRESS) $(REGRESSFLAGS) $(*:N=*.tst) $(*:N!=*.tst)
|
||||
:SAVE: $(B).tst
|
||||
end
|
||||
end
|
||||
else
|
||||
if "$(>:V)" || "$(@:V)"
|
||||
P := $(>)
|
||||
T := $(P:O=1)
|
||||
B := $(T:B)
|
||||
if "$(T)" != "$(B)" && "$(T:G=$(B))"
|
||||
:INSTALLDIR: $(B)
|
||||
$(B) :: $(T) $(P:O>1:N=-*)
|
||||
T := $(B)
|
||||
P := $(B) $(P:O>1:N!=-*)
|
||||
end
|
||||
if "$(<:V)"
|
||||
T := $(<:V)
|
||||
end
|
||||
test : - test.$(T)
|
||||
if "$(@:V)"
|
||||
eval
|
||||
test.$$(T) : $$(P) $(>:V:O>1)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$(@:V)
|
||||
end
|
||||
else
|
||||
test.$(T) : $(P)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$(*)
|
||||
end
|
||||
else
|
||||
test : - test.$(<)
|
||||
test.$(<) : $(<).tst $(<:A=.COMMAND)
|
||||
$(REGRESS) $(REGRESSFLAGS) $(*)
|
||||
end
|
||||
end
|
||||
|
||||
.TESTINIT : .MAKE .VIRTUAL .FORCE .REPEAT
|
||||
if VARIANT == "DLL"
|
||||
error 1 :DLL: tests skipped
|
||||
exit 0
|
||||
end
|
||||
set keepgoing
|
||||
REGRESSFLAGS &= $(TESTS:@/ /|/G:/.*/--test=&/:@Q)
|
||||
|
||||
.SCAN.tst : .SCAN
|
||||
$(@.SCAN.sh)
|
||||
I| INCLUDE@ % |
|
||||
|
||||
.ATTRIBUTE.%.tst : .SCAN.tst
|
||||
|
||||
MKTEST = mktest
|
||||
MKTESTFLAGS = --style=regress
|
||||
|
||||
/*
|
||||
* test scripts are only regenerated from *.rt when --force
|
||||
* is specified or the .rt file is newer than the script
|
||||
* otherwise the script is accepted if it exists
|
||||
*
|
||||
* this avoids the case where a fresh build with no state
|
||||
* would regenerate the test script and capture current
|
||||
* behavior instead of expected behavior
|
||||
*/
|
||||
|
||||
%.tst : %.rt
|
||||
if [[ "$(-force)" || "$(>)" -nt "$(^|<)" ]]
|
||||
then $(MKTEST) $(MKTESTFLAGS) $(>) > $(<)
|
||||
fi
|
||||
|
||||
test%.sh test%.out : %.rt
|
||||
if [[ "$(-force)" || "$(>)" -nt "$(^|<:O=1)" ]]
|
||||
then $(MKTEST) --style=shell $(>) > $(<:N=*.sh)
|
||||
$(SHELL) $(<:N=*.sh) --accept > $(<:N=*.out)
|
||||
fi
|
||||
450
src/cmd/INIT/WWW.mk
Normal file
450
src/cmd/INIT/WWW.mk
Normal file
|
|
@ -0,0 +1,450 @@
|
|||
/*
|
||||
* post stuff to WWWDIR for web access
|
||||
* index generated from *.mm
|
||||
*/
|
||||
|
||||
WWWDIR = wwwfiles public_html
|
||||
WWWSAVE =
|
||||
WWWSTYLE =
|
||||
WWWTYPES =
|
||||
|
||||
.WWW.semaphore : .SEMAPHORE
|
||||
|
||||
.EXPORT : WWWSTYLE WWWTYPES
|
||||
|
||||
/*
|
||||
* item :WWW: [style=frame] [save=pattern] file ...
|
||||
*
|
||||
* `item'.mm generates index.html
|
||||
* other files copied to $(WWWDIR)/`item'
|
||||
* sets up www.bin
|
||||
*/
|
||||
|
||||
":WWW:" : .MAKE .OPERATOR
|
||||
local A B D I J L X E P R M
|
||||
.WWW.LOCAL .WWW.REMOTE : .DO.NOTHING
|
||||
WWWDIR := $(HOME:X=$(WWWDIR):T=F:O=1)
|
||||
B := $(*:N=*.mm::O=1:B)
|
||||
D := $(WWWDIR)/$(B)
|
||||
M := $(WWWDIR)/man/man1
|
||||
R := $(>:N!=*=*)
|
||||
for I $(>:N=*=*)
|
||||
A := WWW$(I:/=.*//:F=%(upper)s)
|
||||
$(A) := $(I:/.*=//)
|
||||
end
|
||||
(html_info) : $$(MM2HTMLINFO) $$(MM2HTMLINIT)
|
||||
if WWWSTYLE == "frame"
|
||||
%.html %-index.html : %.mm (html_info)
|
||||
$(MM2HTML) $(MM2HTMLFLAGS) $(%:N=faq.*:?> $(<:O=1)?-f $(%) -x?) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(WWWSOURCE.$(%)) $(>)
|
||||
else
|
||||
%.html : %.mm (html_info)
|
||||
$(MM2HTML) $(MM2HTMLFLAGS) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(>) $(WWWSOURCE.$(%)) > $(<)
|
||||
end
|
||||
%.html : %.1 (html_info)
|
||||
$(MM2HTML) $(MM2HTMLFLAGS) $(>) $(WWWSOURCE.$(%)) > $(<)
|
||||
%-man.html : $(BINDIR)/% (html_info)
|
||||
ignore $(>) --html 2> $(<)
|
||||
.DO.WWW.MAN : .USE
|
||||
if { test '' = '$(*)' || { strings $(*) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.' ;} ;} && [[ "$( $(<:B) '--???html' -- 2>&1 )" == version=[1-9]* ]]
|
||||
then ( $(<:B) '--??html' -- 2>$(<) ) || true
|
||||
fi
|
||||
if 0
|
||||
$(M)/%.html : .DONTCARE $(INSTALLROOT)/bin/%
|
||||
$(@.DO.WWW.MAN)
|
||||
end
|
||||
if "$(<)"
|
||||
D := $(<)
|
||||
elif ! "$(R)"
|
||||
return
|
||||
end
|
||||
.WWW .WWW.BIN : $(D) $(M) -
|
||||
$(D) $(M) :
|
||||
$(SILENT) test -d $(<) || mkdir $(<)
|
||||
if ( J = "$(R:N=*.mm)" )
|
||||
for I $(J:G=%.html)
|
||||
if I == "*-index.html"
|
||||
O := $(D)/index.html
|
||||
else
|
||||
O := $(I:D=$(D):B:S)
|
||||
end
|
||||
.WWW : $(O)
|
||||
$(O) :COPY: $(I)
|
||||
end
|
||||
end
|
||||
.WWW.req : .FUNCTION
|
||||
return $(*$(%:T=SR):N=-l*:T=F:P=B:N!=-l*|/*)
|
||||
A = 0
|
||||
for I $(R:N!=*.mm)
|
||||
if I == "-"
|
||||
let A = ! A
|
||||
elif I == "-l*"
|
||||
L := $(I:/-l//)
|
||||
if J = "$(.DLL.NAME. $(L) $($(L).VERSION):T=F)"
|
||||
X += $(J)
|
||||
end
|
||||
elif A || "$(I:A=.COMMAND|.ARCHIVE)" || "$(I:D:D:N=$(INSTALLROOT))" || "$(I:N=*-www)"
|
||||
X += $(I)
|
||||
if "$(I:A=.COMMAND)"
|
||||
X += $$(.WWW.req $(I))
|
||||
J := $(I:/-www$//)
|
||||
eval
|
||||
.WWW : $(J:D=$(M):B:S=.html)
|
||||
$(J:D=$(M):B:S=.html) : $(I) $(I:B:S=.1:T=F:?$(I:B:S=.1)??)
|
||||
if strings $$(*:O=1) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.'
|
||||
then $$(IGNORE) $$(*:O=1) '--??html' -- 2>&1
|
||||
elif test '' != '$$(*:N=*.1)'
|
||||
then $$(MM2HTML) $$(*:N=*.1)
|
||||
fi > $$(<)
|
||||
end
|
||||
end
|
||||
else
|
||||
if I == "*.html"
|
||||
$(I) : .TERMINAL
|
||||
end
|
||||
.WWW : $(D)/$(I)
|
||||
$(D)/$(I) :COPY: $(I)
|
||||
end
|
||||
end
|
||||
if "$(X:V)"
|
||||
.WWW.EDIT. : .FUNCTION
|
||||
local E I J
|
||||
for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*)
|
||||
for J $(%)
|
||||
if "$(I:B:S)" == "$(J:B:S)"
|
||||
E += -s ',^$(J)$,$(I),'
|
||||
end
|
||||
end
|
||||
end
|
||||
return $(E)
|
||||
.WWW.LIST. : .FUNCTION
|
||||
local E I J
|
||||
for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*)
|
||||
for J $(%)
|
||||
if "$(I:B:S)" == "$(J:B:S)"
|
||||
E += $(I)
|
||||
end
|
||||
end
|
||||
end
|
||||
return $(E)
|
||||
.WWW .WWW.BIN : $(D)/$(B)-$(CC.HOSTTYPE).tgz
|
||||
$(D)/$(B)-$(CC.HOSTTYPE).tgz : $(X:V)
|
||||
cat > X.$(tmp).X <<!
|
||||
This archive contains $(CC.HOSTTYPE) binaries for
|
||||
$(.WWW.LIST. $(*))
|
||||
Add the bin directory to PATH and the lib directory
|
||||
to LD_LIBRARY_PATH or its equivalent for your system.
|
||||
Use the --?help and --man options for online help,
|
||||
documentation and contact info.
|
||||
!
|
||||
$(PAX) -wvf $(<) -x tar:gzip -s "/X.$(tmp).X/README/" $(.WWW.EDIT. $(*)) -s ',\(.*\)-www$,bin/\1,' -s ',.*/lib/,lib/,' X.$(tmp).X $(*:N!=-l*)
|
||||
$(RM) -f X.$(tmp).X
|
||||
end
|
||||
|
||||
/*
|
||||
* item ... :WWWBIN: index.mm file ... host:arch ...
|
||||
*
|
||||
* home page control
|
||||
* `host' of type `arch' for www.bin files
|
||||
*/
|
||||
|
||||
":WWWBIN:" : .MAKE .OPERATOR
|
||||
local HOST ITEM ARCH BINS DIRS G
|
||||
.WWW.NOMAN. += $(<)
|
||||
for HOST $(>)
|
||||
TYPE := $(HOST:/.*://)
|
||||
HOST := $(HOST:/:.*//)
|
||||
WWWTYPES += $(TYPE)
|
||||
ARCH := $(PWD:D:C,/$(CC.HOSTTYPE)/,/$(TYPE)/)
|
||||
BINS :=
|
||||
DIRS :=
|
||||
for ITEM $(<)
|
||||
if TYPE == "$(CC.HOSTTYPE)"
|
||||
G := $("index.mm":G=%.html:D=$(WWWDIR)/$(ITEM):B:S)
|
||||
.WWW.LOCAL : $(G)
|
||||
eval
|
||||
$(G) : .JOINT $(ARCH)/$(ITEM)/$(ITEM).mm (html_info) .WWW.semaphore .FORCE
|
||||
cd $$(*:D)
|
||||
$$(MAKE) $$(-) $$(=) www
|
||||
end
|
||||
else
|
||||
BINS += $(WWWDIR)/$(ITEM)/$(ITEM)-$(TYPE).tgz
|
||||
DIRS += $(ARCH)/$(ITEM)
|
||||
end
|
||||
end
|
||||
.WWW.REMOTE : $(BINS)
|
||||
ARCH := $(ARCH:C,/src/.*,,)
|
||||
eval
|
||||
$(BINS) :JOINT: .FORCE .WWW.semaphore
|
||||
rsh $(HOST) "
|
||||
eval \"\`bin/package debug use\`\"
|
||||
PATH=\$PATH:$(PATH):/usr/ccs/bin
|
||||
umask 022
|
||||
for dir in $(DIRS)
|
||||
do cd \$dir
|
||||
$(MAKE) $(-) $(=) --errorid=\$dir www.bin
|
||||
done
|
||||
"
|
||||
end
|
||||
end
|
||||
|
||||
/*
|
||||
* :WWWPOST: [ host [ dir [ tmp ] ] ]
|
||||
*
|
||||
* post local $(WWWDIR) to host:dir putting archives in host:tmp/www-*.pax
|
||||
* defaults: host=www dir=$(WWWDIR) tmp=tmp
|
||||
*/
|
||||
|
||||
":WWWPOST:" : .MAKE .OPERATOR
|
||||
local ( host dir tmp ignore ... ) $(>) www $(WWWDIR:B:S) tmp ignore
|
||||
:ALL: delta.pax
|
||||
.WWW.ALL : .WWW.REMOTE - .WWW.LOCAL
|
||||
eval
|
||||
.POST : .VIRTUAL base.pax delta.pax
|
||||
case "$$(>)" in
|
||||
'') ;;
|
||||
*) $$(>:C,.*,rcp & $(host):$(tmp)/$(dir)-&;,)
|
||||
rsh $(host) '
|
||||
umask 022
|
||||
PATH=$HOME/bin:$PATH
|
||||
cd $(dir)
|
||||
pax -rvf $HOME/$(tmp)/$(dir)-delta.pax -z $HOME/$(tmp)/$(dir)-base.pax
|
||||
'
|
||||
;;
|
||||
esac
|
||||
end
|
||||
base.pax :
|
||||
cd $(WWWDIR)
|
||||
pax -wvf $(<:P=A) .
|
||||
.base.list. : .FUNCTION
|
||||
local X
|
||||
X := $(sh pax -f $(%:N=*.pax):C,\n, ,G:C,^,$$(WWWDIR)/,)
|
||||
$(X) : .DONTCARE
|
||||
return $(X)
|
||||
delta.pax : .WWW.ALL base.pax $$(.base.list. $$(*))
|
||||
cd $(WWWDIR)
|
||||
pax -wvf $(<:P=A) -z $(*:N=*.pax:P=A) .
|
||||
|
||||
.WWW.FAQ : .USE
|
||||
{
|
||||
set -o noglob
|
||||
print .xx title=\"$(<:B:/\..*//) FAQ index\"
|
||||
print .MT 4
|
||||
print .TL
|
||||
print
|
||||
print .H 1 \"$(<:B:/\..*//) FAQ index\"
|
||||
print .BL
|
||||
for i in $(*)
|
||||
do exec < $i || exit 1
|
||||
e=0 l=0 x=y
|
||||
while read -r op a1 a2
|
||||
do case $op in
|
||||
.H) case $e in
|
||||
0) e=1 ;;
|
||||
1) print .LE ;;
|
||||
esac
|
||||
print .sp
|
||||
print .LI
|
||||
a2=${a2//\"/}
|
||||
a2=${a2%\ [Ff][Aa][Qq]}
|
||||
f=${i%.*}.html
|
||||
f=${f#*/}
|
||||
print .xx link=\"$f' '$a2\"
|
||||
print .sp
|
||||
print .NL
|
||||
;;
|
||||
.AL|.BL|.NL)
|
||||
case $x in
|
||||
y) x=x ;;
|
||||
*) x=xx$x ;;
|
||||
esac
|
||||
;;
|
||||
.LE) x=${x%xx}
|
||||
;;
|
||||
.LI) case $x in
|
||||
x) x=
|
||||
print .LI
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
.sp) case $x in
|
||||
'') x=x ;;
|
||||
esac
|
||||
;;
|
||||
*) case $x in
|
||||
'') print -r -- $op $a1 $a2 ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
case $e in
|
||||
1) print .LE ;;
|
||||
esac
|
||||
done
|
||||
print .LE
|
||||
} > $(<)
|
||||
|
||||
/*
|
||||
* [ dir ] :WWWPAGE: [ source ... ] file.mm file
|
||||
*
|
||||
* *.mm generates *.html
|
||||
* faq.*.mm generates faq.mm
|
||||
* other files copied to $(WWWDIR)[/dir]
|
||||
* files after - (toggle) are just asserted on ::
|
||||
*/
|
||||
|
||||
":WWWPAGE:" : .MAKE .OPERATOR
|
||||
local B D I J O P Q S X G A
|
||||
A = 0
|
||||
D := $(<:O=1)
|
||||
P := $(>:N!=*=*)
|
||||
S := $(>:N=*=*)
|
||||
if X = "$(P:B:S:N=faq.*.mm)"
|
||||
Q := $(D:+$(D).)faq.mm
|
||||
$(Q) : .WWW.FAQ $(X)
|
||||
P += $(Q)
|
||||
end
|
||||
if D
|
||||
B := $(D:B)
|
||||
if D != "/*"
|
||||
D := $(WWWDIR)/$(D)
|
||||
$(D) :INSTALLDIR:
|
||||
.WWW.LOCAL : $(D)
|
||||
end
|
||||
for I $(<:B)
|
||||
.WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html
|
||||
$(WWWDIR)/man/man1/$(I).html : .DONTCARE
|
||||
end
|
||||
for I $(P)
|
||||
if I == "-"
|
||||
let A = !A
|
||||
continue
|
||||
end
|
||||
if A || I == "$(WWWSAVE)"
|
||||
:: $(I)
|
||||
continue
|
||||
end
|
||||
if "$(I:T=FD)"
|
||||
.SOURCE : $(I)
|
||||
if "$(<)"
|
||||
WWWSOURCE.$(<:O=1) += $(I:T=F:P=L=*)
|
||||
end
|
||||
continue
|
||||
end
|
||||
if I == "*.html"
|
||||
$(I) : .TERMINAL
|
||||
O := $(I)
|
||||
X := $(I)
|
||||
elif ( G = "$(I:G=%.html)" )
|
||||
$(G) : .IMPLICIT $(S) $(I)
|
||||
if $(G:O) > 1
|
||||
for J $(G)
|
||||
if J == "*-index.html"
|
||||
if J == "faq.*.*"
|
||||
continue
|
||||
end
|
||||
O := index.html
|
||||
else
|
||||
O := $(J)
|
||||
end
|
||||
.WWW.LOCAL : $(D)/$(O)
|
||||
$(D)/$(O) :INSTALL: $(J)
|
||||
end
|
||||
continue
|
||||
end
|
||||
if X
|
||||
X := $(I)
|
||||
else
|
||||
X := index
|
||||
end
|
||||
I := $(I:B:S=.html)
|
||||
O := $(X:B:S=.html)
|
||||
else
|
||||
O := $(I)
|
||||
end
|
||||
$(D)/$(O) :INSTALL: $(I)
|
||||
.WWW.LOCAL : $(D)/$(O)
|
||||
end
|
||||
else
|
||||
for I $(P)
|
||||
if I == "-"
|
||||
let A = !A
|
||||
continue
|
||||
end
|
||||
if A || I == "$(WWWSAVE)"
|
||||
:: $(I)
|
||||
continue
|
||||
end
|
||||
if "$(I:T=FD)"
|
||||
.SOURCE : $(I)
|
||||
continue
|
||||
end
|
||||
if I == "*.html"
|
||||
$(I) : .TERMINAL
|
||||
O := $(I)
|
||||
elif ( O = "$(I:G=%.html)" )
|
||||
$(O) : $(S) .IMPLICIT $(I)
|
||||
end
|
||||
for J $(O)
|
||||
if J == "*-index.html"
|
||||
X := index.html
|
||||
else
|
||||
X := $(J)
|
||||
end
|
||||
X := $(WWWDIR)/$(X)
|
||||
.WWW.LOCAL : $(X)
|
||||
$(X) :COPY: $(J)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
/*
|
||||
* rhs done by default
|
||||
*/
|
||||
|
||||
":WWWALL:" : .MAKE .OPERATOR
|
||||
.WWW.ALL : $(>)
|
||||
|
||||
":WWWMAN:" : .MAKE .OPERATOR
|
||||
.INIT : .WWW.MAN
|
||||
.WWW.MAN. := $(>)
|
||||
.WWW.MAN : .MAKE .FORCE
|
||||
local H I
|
||||
for I $(.WWW.MAN.)
|
||||
.WWW.LOCAL : $(WWWDIR)/man/man1/$(I:B).html
|
||||
$(WWWDIR)/man/man1/$(I:B).html : .DO.WWW.MAN $(I)
|
||||
end
|
||||
for I $(sh builtin:B)
|
||||
.WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html
|
||||
$(WWWDIR)/man/man1/$(I).html : .DO.WWW.MAN -
|
||||
end
|
||||
for I $("$(BINDIR)/*([!-.])":P=G:B)
|
||||
if I != "*_*"
|
||||
H := $(WWWDIR)/man/man1/$(I).html
|
||||
if ! "$(*$(H))" && I != "$(.WWW.NOMAN.:/ /|/G)"
|
||||
.WWW.LOCAL : $(H)
|
||||
end
|
||||
elif "$(PATH:/:/ /G:X=$(I:/.*_//):T=F:O=1)"
|
||||
H := $(WWWDIR)/man/man1/$(I:/.*_//).html
|
||||
.WWW.LOCAL : $(H)
|
||||
$(H) : .DO.WWW.MAN $(BINDIR)/$(I)
|
||||
end
|
||||
end
|
||||
|
||||
.WWW.SED. : .FUNCTION
|
||||
local E T
|
||||
E = s/^\(\.xx.link=.*\)%HOSTTYPE%\(.*\)%HOSTTYPE%\(.*\)/
|
||||
for T $(%)
|
||||
E := $(E:V)\$$("\n").LI\$$("\n")\1$(T)\2$(T)\3
|
||||
end
|
||||
return $(E:V)/
|
||||
|
||||
/*
|
||||
* mm scan support
|
||||
*/
|
||||
|
||||
.SCAN.mm : .SCAN
|
||||
O|S|
|
||||
I|.sn %|A.DONTCARE|M$$(%)|
|
||||
I|.so %|A.DONTCARE|M$$(%)|
|
||||
|
||||
.ATTRIBUTE.%.mm : .SCAN.mm
|
||||
6
src/cmd/INIT/ar.freebsd12.amd64
Executable file
6
src/cmd/INIT/ar.freebsd12.amd64
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
: linux.i386-64 ar wrapper
|
||||
|
||||
case $1 in
|
||||
*x*) /usr/bin/ar "$@" ;;
|
||||
*) /usr/bin/ar U"$@" ;;
|
||||
esac
|
||||
9
src/cmd/INIT/ar.ibm.risc
Executable file
9
src/cmd/INIT/ar.ibm.risc
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
: stupid stupid stupid to require a non-standard option for ar to work : 2009-10-06 :
|
||||
|
||||
op=$1
|
||||
shift
|
||||
case $op in
|
||||
-*) ;;
|
||||
*) op=-$op ;;
|
||||
esac
|
||||
/usr/bin/ar -Xany "$op" "$@"
|
||||
6
src/cmd/INIT/ar.linux.i386-64
Executable file
6
src/cmd/INIT/ar.linux.i386-64
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
: linux.i386-64 ar wrapper
|
||||
|
||||
case $1 in
|
||||
*x*) /usr/bin/ar "$@" ;;
|
||||
*) /usr/bin/ar U"$@" ;;
|
||||
esac
|
||||
52
src/cmd/INIT/cc.darwin
Executable file
52
src/cmd/INIT/cc.darwin
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
: unix wrapper for macOS cc : 2020-07-17 :
|
||||
|
||||
HOSTTYPE=darwin.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
CC=/usr/bin/cc
|
||||
op=init
|
||||
for arg
|
||||
do case $op in
|
||||
init) op=ld
|
||||
set ''
|
||||
;;
|
||||
esac
|
||||
case $arg in
|
||||
-c) op=cc
|
||||
;;
|
||||
-E) op=cpp
|
||||
continue
|
||||
;;
|
||||
-G) op=dll
|
||||
continue
|
||||
;;
|
||||
-lc) continue
|
||||
;;
|
||||
-lm) continue
|
||||
;;
|
||||
esac
|
||||
set "$@" "$arg"
|
||||
done
|
||||
case $# in
|
||||
0) ;;
|
||||
*) shift ;;
|
||||
esac
|
||||
case $* in
|
||||
-v) $CC "$@"; exit ;;
|
||||
esac
|
||||
case $op in
|
||||
init) echo "cc: arguments expected" >&2
|
||||
exit 1
|
||||
;;
|
||||
cpp) $CC -E "$@"
|
||||
;;
|
||||
cc) $CC -D_ast_int8_t=int64_t -D_lib_memccpy "$@"
|
||||
;;
|
||||
dll) $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@"
|
||||
;;
|
||||
ld) $CC -Wl,-search_paths_first "$@"
|
||||
;;
|
||||
esac
|
||||
71
src/cmd/INIT/cc.darwin07
Executable file
71
src/cmd/INIT/cc.darwin07
Executable file
|
|
@ -0,0 +1,71 @@
|
|||
: unix wrapper for Mac OS X 10.3-10.6 (Darwin 7-10) cc : 2020-07-17 :
|
||||
|
||||
HOSTTYPE=darwin07.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
CC=/usr/bin/cc
|
||||
op=init
|
||||
for arg
|
||||
do case $op in
|
||||
init) op=ld
|
||||
set ''
|
||||
;;
|
||||
esac
|
||||
case $arg in
|
||||
-c) op=cc
|
||||
;;
|
||||
-E) op=cpp
|
||||
continue
|
||||
;;
|
||||
-G) op=dll
|
||||
continue
|
||||
;;
|
||||
-lc) continue
|
||||
;;
|
||||
-lm) continue
|
||||
;;
|
||||
esac
|
||||
set "$@" "$arg"
|
||||
done
|
||||
case $# in
|
||||
0) ;;
|
||||
*) shift ;;
|
||||
esac
|
||||
case $* in
|
||||
-v) $CC "$@"; exit ;;
|
||||
esac
|
||||
case $op in
|
||||
init) echo "cc: arguments expected" >&2
|
||||
exit 1
|
||||
;;
|
||||
cpp) $CC -E "$@"
|
||||
;;
|
||||
cc) $CC -DCLK_TCK=100 "$@"
|
||||
;;
|
||||
dll) # what a compatibility mess -- surely they can get the apis to play nice
|
||||
tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
|
||||
trap "rm -f $tmp" EXIT
|
||||
case `MACOSX_DEPLOYMENT_TARGET=10.3 ld -undefined dynamic_lookup 2>&1` in
|
||||
*undefined*dynamic_lookup*)
|
||||
ld -m -flat_namespace -undefined suppress -dylib -dynamic \
|
||||
-ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1
|
||||
status=$?
|
||||
;;
|
||||
*) MACOSX_DEPLOYMENT_TARGET=10.3 $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" >$tmp 2>&1
|
||||
status=$?
|
||||
;;
|
||||
esac
|
||||
egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2
|
||||
exit $status
|
||||
;;
|
||||
ld) tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
|
||||
trap "rm -f $tmp" EXIT
|
||||
$CC -Wl,-m -DCLK_TCK=100 "$@" >$tmp 2>&1
|
||||
status=$?
|
||||
egrep -v ' (warning .*multiple definitions of|definition of|as lazy binding|not from earlier dynamic) ' $tmp >&2
|
||||
exit $status
|
||||
;;
|
||||
esac
|
||||
71
src/cmd/INIT/cc.darwin11
Executable file
71
src/cmd/INIT/cc.darwin11
Executable file
|
|
@ -0,0 +1,71 @@
|
|||
: unix wrapper for Mac OS X 10.7 (Darwin 11) cc : 2020-07-17 :
|
||||
|
||||
HOSTTYPE=darwin11.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
CC=/usr/bin/cc
|
||||
op=init
|
||||
for arg
|
||||
do case $op in
|
||||
init) op=ld
|
||||
set ''
|
||||
;;
|
||||
esac
|
||||
case $arg in
|
||||
-c) op=cc
|
||||
;;
|
||||
-E) op=cpp
|
||||
continue
|
||||
;;
|
||||
-G) op=dll
|
||||
continue
|
||||
;;
|
||||
-lc) continue
|
||||
;;
|
||||
-lm) continue
|
||||
;;
|
||||
esac
|
||||
set "$@" "$arg"
|
||||
done
|
||||
case $# in
|
||||
0) ;;
|
||||
*) shift ;;
|
||||
esac
|
||||
case $* in
|
||||
-v) $CC "$@"; exit ;;
|
||||
esac
|
||||
case $op in
|
||||
init) echo "cc: arguments expected" >&2
|
||||
exit 1
|
||||
;;
|
||||
cpp) $CC -E "$@"
|
||||
;;
|
||||
cc) $CC -DCLK_TCK=100 "$@"
|
||||
;;
|
||||
dll) # what a compatibility mess -- surely they can get the apis to play nice
|
||||
tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
|
||||
trap "rm -f $tmp" EXIT
|
||||
case `MACOSX_DEPLOYMENT_TARGET=10.7 ld -undefined dynamic_lookup 2>&1` in
|
||||
*undefined*dynamic_lookup*)
|
||||
ld -m -flat_namespace -undefined suppress -dylib -dynamic \
|
||||
-ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1
|
||||
status=$?
|
||||
;;
|
||||
*) MACOSX_DEPLOYMENT_TARGET=10.7 $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" >$tmp 2>&1
|
||||
status=$?
|
||||
;;
|
||||
esac
|
||||
egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2
|
||||
exit $status
|
||||
;;
|
||||
ld) tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
|
||||
trap "rm -f $tmp" EXIT
|
||||
$CC -Wl,-m -DCLK_TCK=100 "$@" >$tmp 2>&1
|
||||
status=$?
|
||||
egrep -v ' (warning .*multiple definitions of|definition of|as lazy binding|not from earlier dynamic) ' $tmp >&2
|
||||
exit $status
|
||||
;;
|
||||
esac
|
||||
9
src/cmd/INIT/cc.freebsd
Executable file
9
src/cmd/INIT/cc.freebsd
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
: FreeBSD cc wrapper
|
||||
|
||||
HOSTTYPE=freebsd.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
exec /usr/bin/cc -P "$@"
|
||||
13
src/cmd/INIT/cc.hp.ia64
Executable file
13
src/cmd/INIT/cc.hp.ia64
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
: hp.ia64 cc wrapper for reasonable ansi C defaults : 2011-01-25 :
|
||||
|
||||
[ /usr/bin/cc -ef /usr/ccs/bin/cc ] || exit 1
|
||||
|
||||
: bundled cc -- really, in the face of gcc you ship a sub-par /usr/bin/cc? :
|
||||
|
||||
HOSTTYPE=hp.ia64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/usr/bin/cc -D_HPUX_SOURCE -D_INCLUDE__STDC_A1_SOURCE -D_INCLUDE_XOPEN_SOURCE_500 "$@"
|
||||
13
src/cmd/INIT/cc.hp.pa
Executable file
13
src/cmd/INIT/cc.hp.pa
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
: hp.pa cc wrapper for reasonable ansi C defaults : 2004-02-29 :
|
||||
|
||||
HOSTTYPE=hp.pa
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
_AST_CC_hp_pa_DEFAULT=${_AST_CC_hp_pa_DEFAULT-"+DAportable"}
|
||||
|
||||
/opt/ansic/bin/cc -Ae +e -Wl,+s $_AST_CC_hp_pa_DEFAULT \
|
||||
${INSTALLROOT:+-Wl,+cdp,${INSTALLROOT}/lib/:} \
|
||||
-Wl,+vnocompatwarnings "$@"
|
||||
11
src/cmd/INIT/cc.hp.pa64
Executable file
11
src/cmd/INIT/cc.hp.pa64
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
: hp.pa64 cc wrapper for reasonable ansi C defaults : 2001-02-11 :
|
||||
|
||||
HOSTTYPE=hp.pa64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/opt/ansic/bin/cc +D2.0W -Ae +e -Wl,+s \
|
||||
${INSTALLROOT:+-Wl,+cdp,${INSTALLROOT}/lib/:} \
|
||||
-Wl,+vnocompatwarnings "$@"
|
||||
63
src/cmd/INIT/cc.ibm.risc
Executable file
63
src/cmd/INIT/cc.ibm.risc
Executable file
|
|
@ -0,0 +1,63 @@
|
|||
: 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
|
||||
36
src/cmd/INIT/cc.ibm.risc.gcc
Executable file
36
src/cmd/INIT/cc.ibm.risc.gcc
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
: 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 "$@"
|
||||
9
src/cmd/INIT/cc.linux.aarch64
Executable file
9
src/cmd/INIT/cc.linux.aarch64
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
: linux.aarch64 cc wrapper : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=linux.aarch64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/usr/bin/cc -P "$@"
|
||||
9
src/cmd/INIT/cc.linux.i386-64
Executable file
9
src/cmd/INIT/cc.linux.i386-64
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
: linux.i386-64 cc wrapper : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=linux.i386-64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/usr/bin/cc -P "$@"
|
||||
22
src/cmd/INIT/cc.linux.i386-64-icc
Executable file
22
src/cmd/INIT/cc.linux.i386-64-icc
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
: linux.i386-64 icc wrapper : 2011-10-18 :
|
||||
|
||||
HOSTTYPE=linux.i386-64-icc
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") if test -f /etc/profile.d/icc.sh
|
||||
then . /etc/profile.d/icc.sh
|
||||
fi
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") echo icc: not found >&2
|
||||
exit 127
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
$icc "$@"
|
||||
22
src/cmd/INIT/cc.linux.i386-icc
Executable file
22
src/cmd/INIT/cc.linux.i386-icc
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
: linux.ia64 icc wrapper : 2011-10-18 :
|
||||
|
||||
HOSTTYPE=linux.ia64-icc
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") if test -f /etc/profile.d/icc.sh
|
||||
then . /etc/profile.d/icc.sh
|
||||
fi
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") echo icc: not found >&2
|
||||
exit 127
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
$icc "$@"
|
||||
22
src/cmd/INIT/cc.linux.ia64-icc
Executable file
22
src/cmd/INIT/cc.linux.ia64-icc
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
: linux.ia64 icc wrapper : 2011-10-18 :
|
||||
|
||||
HOSTTYPE=linux.ia64-icc
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") if test -f /etc/profile.d/icc.sh
|
||||
then . /etc/profile.d/icc.sh
|
||||
fi
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") echo icc: not found >&2
|
||||
exit 127
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
$icc "$@"
|
||||
81
src/cmd/INIT/cc.lynxos.i386
Executable file
81
src/cmd/INIT/cc.lynxos.i386
Executable file
|
|
@ -0,0 +1,81 @@
|
|||
: lynxos.i386 cc wrapper with -dynamic default : 2005-02-14 :
|
||||
|
||||
HOSTTYPE=lynxos.i386
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
cc=gcc
|
||||
|
||||
link=1
|
||||
static=0
|
||||
set . "$@" /../
|
||||
while :
|
||||
do shift
|
||||
case $1 in
|
||||
/../) break ;;
|
||||
esac
|
||||
case $1 in
|
||||
*.[cChHiI]|*.[cChHiI][pPxX][pPxX])
|
||||
set . -D__NO_INCLUDE_WARN__ -I/sys/include/kernel -I/sys/include/family/x86 "$@"
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-o) case $2 in
|
||||
/../) ;;
|
||||
*) x=$1
|
||||
shift
|
||||
set . "$@" "$x"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-static)static=1
|
||||
;;
|
||||
-l*) case $static in
|
||||
0) static=n
|
||||
set . -L/lib/shlib "$@"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-[cE]) link=0
|
||||
;;
|
||||
esac
|
||||
x=$1
|
||||
shift
|
||||
set . "$@" "$x"
|
||||
done
|
||||
while :
|
||||
do case $1 in
|
||||
/../) shift
|
||||
break
|
||||
;;
|
||||
-l*) case $static in
|
||||
0) static=n
|
||||
set . -L/lib/shlib "$@"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-[cE]) link=0
|
||||
;;
|
||||
esac
|
||||
x=$1
|
||||
shift
|
||||
set . "$@" "$x"
|
||||
shift
|
||||
done
|
||||
case $link:$static in
|
||||
1:0) static=n ;;
|
||||
esac
|
||||
case $static in
|
||||
n) specs=/tmp/cc$$.specs
|
||||
trap 'status=$?; rm -f $specs; exit $status' 0 1 2
|
||||
echo '*link: %{shared:-shared} %{static:-static} %{mshared|shared: %{static: %eerror: -shared and -static may not be combined. }}' > $specs
|
||||
$cc -specs=$specs "$@"
|
||||
;;
|
||||
*) $cc "$@"
|
||||
;;
|
||||
esac
|
||||
85
src/cmd/INIT/cc.lynxos.ppc
Executable file
85
src/cmd/INIT/cc.lynxos.ppc
Executable file
|
|
@ -0,0 +1,85 @@
|
|||
: lynxos.ppc cc wrapper with -mshared default : 2005-06-01 :
|
||||
|
||||
HOSTTYPE=lynxos.ppc
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
cc=gcc
|
||||
|
||||
link=1
|
||||
static=0
|
||||
set . "$@" /../
|
||||
while :
|
||||
do shift
|
||||
case $1 in
|
||||
/../) break ;;
|
||||
esac
|
||||
case $1 in
|
||||
*.[cChHiI]|*.[cChHiI][pPxX][pPxX])
|
||||
set . -D__NO_INCLUDE_WARN__ -I/sys/include/kernel -I/sys/include/family/ppc "$@"
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-o) case $2 in
|
||||
/../) ;;
|
||||
*) x=$1
|
||||
shift
|
||||
set . "$@" "$x"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-static)static=1
|
||||
;;
|
||||
-mshared)
|
||||
static=n
|
||||
continue
|
||||
;;
|
||||
-l*) case $static in
|
||||
0) static=n
|
||||
set . -L/lib/shlib "$@"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-[cE]) link=0
|
||||
;;
|
||||
esac
|
||||
x=$1
|
||||
shift
|
||||
set . "$@" "$x"
|
||||
done
|
||||
while :
|
||||
do case $1 in
|
||||
/../) shift
|
||||
break
|
||||
;;
|
||||
-l*) case $static in
|
||||
0) static=n
|
||||
set . -L/lib/shlib "$@"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-[cE]) link=0
|
||||
;;
|
||||
esac
|
||||
x=$1
|
||||
shift
|
||||
set . "$@" "$x"
|
||||
shift
|
||||
done
|
||||
case $link:$static in
|
||||
1:0) static=n ;;
|
||||
esac
|
||||
case $static in
|
||||
n) specs=/tmp/cc$$.specs
|
||||
trap 'status=$?; rm -f $specs; exit $status' 0 1 2
|
||||
echo '*link: %{shared:-shared} %{static:-static} %{mshared|shared: %{static: %eerror: -shared and -static may not be combined. }}' > $specs
|
||||
$cc -specs=$specs -mshared "$@"
|
||||
;;
|
||||
*) $cc "$@"
|
||||
;;
|
||||
esac
|
||||
279
src/cmd/INIT/cc.mvs.390
Executable file
279
src/cmd/INIT/cc.mvs.390
Executable file
|
|
@ -0,0 +1,279 @@
|
|||
: mvs.390 cc wrapper for unix message and exit code semantics : 2012-01-20 :
|
||||
|
||||
HOSTTYPE=mvs.390
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
ar=ar
|
||||
cc=/bin/c89
|
||||
CC=/bin/c++
|
||||
ccflags="-D_ALL_SOURCE -Wc,dll"
|
||||
objmax=60
|
||||
tmpfiles=
|
||||
unbotch=
|
||||
|
||||
# -n as *first* arg shows but does not do
|
||||
# -Wc,exportall => -Wl,dll
|
||||
# -Bdynamic => .c,.o dynamic
|
||||
# -Bstatic => .c,.o static
|
||||
# *.C => cc=$CC
|
||||
# *.cpp => cc=$CC
|
||||
# *.cxx => cc=$CC
|
||||
# no optimization until the optimizer is fixed:
|
||||
# -O dropped (no optimization)
|
||||
# -0 dropped (no optimization)
|
||||
# -1 -O (default level 1 optimization)
|
||||
# -2 -2 (maximal level 2 optimization)
|
||||
|
||||
let argc=0 cmp=0 dll=0 libc=0 dynamic=1 dynamic_objc=0 static_objc=0 relc=0 botched=0
|
||||
case $1 in
|
||||
-n) exec=print
|
||||
shift
|
||||
;;
|
||||
*) exec=
|
||||
;;
|
||||
esac
|
||||
export _CC_ACCEPTABLE_RC=1
|
||||
export _C89_ACCEPTABLE_RC=$_CC_ACCEPTABLE_RC
|
||||
export _CXX_ACCEPTABLE_RC=$_CC_ACCEPTABLE_RC
|
||||
case " $* " in
|
||||
*.C" "*)let dll=2
|
||||
cc=$CC
|
||||
export _CXXSUFFIX=C
|
||||
;;
|
||||
*.cpp" "*)let dll=2
|
||||
cc=$CC
|
||||
export _CXXSUFFIX=cpp
|
||||
;;
|
||||
*.cxx" "*)let dll=2
|
||||
cc=$CC
|
||||
export _CXXSUFFIX=cxx
|
||||
;;
|
||||
esac
|
||||
exe=
|
||||
xxx=
|
||||
while :
|
||||
do case $# in
|
||||
0) break ;;
|
||||
esac
|
||||
arg=$1
|
||||
case $arg in
|
||||
-1) arg=-O
|
||||
;;
|
||||
-Bdynamic)
|
||||
let dynamic=1
|
||||
;;
|
||||
-Bstatic)
|
||||
let dynamic=0
|
||||
;;
|
||||
-c) let cmp=1
|
||||
;;
|
||||
-D_ALL_SOURCE|-D_ALL_SOURCE=*)
|
||||
arg=
|
||||
;;
|
||||
-D*[\ \(\)]*)
|
||||
arg=${arg#-D}
|
||||
botch_macro[botched]=${arg%%=*}
|
||||
botch_value[botched]=${arg#*=}
|
||||
let botched=botched+1
|
||||
arg=
|
||||
;;
|
||||
-o) argv[argc]=$arg
|
||||
let argc=argc+1
|
||||
shift
|
||||
arg=$1
|
||||
exe=$arg
|
||||
rm -f "$exe"
|
||||
;;
|
||||
-[O0]) arg=
|
||||
;;
|
||||
-Wc,dll)arg=
|
||||
;;
|
||||
-Wc,exportall)
|
||||
let dll=1
|
||||
;;
|
||||
-Wl,dll)arg=
|
||||
let dll=1
|
||||
;;
|
||||
*.c) if [[ $botched != 0 ]]
|
||||
then src=$arg
|
||||
arg=${arg##*/}
|
||||
unbotch="$unbotch ${arg%.c}.o"
|
||||
arg=__$arg
|
||||
tmpfiles="$tmpfiles $arg"
|
||||
{
|
||||
while [[ $botched != 0 ]]
|
||||
do let botched=botched-1
|
||||
print -r -- "#define ${botch_macro[botched]} ${botch_value[botched]}"
|
||||
done
|
||||
cat $src
|
||||
} > $arg
|
||||
fi
|
||||
;;
|
||||
*.o) if test 0 != $dynamic
|
||||
then let dynamic_objc=dynamic_objc+1
|
||||
else let static_objc=static_objc+1
|
||||
fi
|
||||
;;
|
||||
*.x) a=${arg%.x}.a
|
||||
if test -f $a
|
||||
then argv[argc]=$a
|
||||
let argc=argc+1
|
||||
xxx=-Wl,dll
|
||||
case $a in
|
||||
ast.a|*/ast.a)
|
||||
cc="$CC -u_ast_init"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
case $arg in
|
||||
?*) argv[argc]=$arg
|
||||
let argc=argc+1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
|
||||
tmpfiles="$tmp $tmpfiles"
|
||||
|
||||
# if any dll .o's are in .a then a .x gets generated
|
||||
# but the native cc doesn't jcl for the .x
|
||||
# -Wl,dll does that, so we nuke the .x and keep the exe
|
||||
|
||||
test 0 != $dll && xxx=
|
||||
case $xxx in
|
||||
?*) case $exe in
|
||||
?*) a=${exe##*/}
|
||||
a=${a%.*}
|
||||
case $exe in
|
||||
*/*) tmpfiles="$tmpfiles ${exe%/*}/${a}.x" ;;
|
||||
*) tmpfiles="$tmpfiles ${a}.x" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
if test 0 != $dll
|
||||
then if test 0 != $cmp
|
||||
then xxx="-D_SHARE_EXT_VARS $xxx"
|
||||
else xxx="-Wl,dll $xxx"
|
||||
fi
|
||||
fi
|
||||
set -- $xxx "${argv[@]}"
|
||||
|
||||
# can't handle more than objmax .o's
|
||||
# -r into intermediates doesn't work, but the cat trick does
|
||||
# also, the runtime dll file must be executable but cc -Wl,dll forgets
|
||||
|
||||
if test 0 != $dll -a \( $dynamic_objc -ge $objmax -o 0 != $static_objc \)
|
||||
then unset argv
|
||||
argc=0 libc=0 dynamic=1 dynamic_objc=0 static_objc=0 endc=0
|
||||
while :
|
||||
do case $# in
|
||||
0) break ;;
|
||||
esac
|
||||
case $1 in
|
||||
-Bdynamic)
|
||||
let dynamic=1
|
||||
;;
|
||||
-Bstatic)
|
||||
let dynamic=0
|
||||
;;
|
||||
*.o) if test 0 != $dynamic
|
||||
then dynamic_objv[dynamic_objc]=$1
|
||||
let dynamic_objc=dynamic_objc+1
|
||||
else static_objv[static_objc]=$1
|
||||
let static_objc=static_objc+1
|
||||
fi
|
||||
;;
|
||||
-l*) libv[libc]=$1
|
||||
let libc=libc+1
|
||||
;;
|
||||
-o) argv[argc]=$1
|
||||
let argc=argc+1
|
||||
shift
|
||||
argv[argc]=$1
|
||||
let argc=argc+1
|
||||
exe=$1
|
||||
;;
|
||||
*) argv[argc]=$1
|
||||
let argc=argc+1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if test 0 != $static_objc
|
||||
then case $exe in
|
||||
?*) $exec $ar cr ${exe%.*}.a "${static_objv[@]}" ;;
|
||||
esac
|
||||
fi
|
||||
if test 0 != $dynamic_objc
|
||||
then cat=0.0.o
|
||||
tmpfiles="$tmpfiles $cat"
|
||||
cat "${dynamic_objv[@]}" > $cat || exit
|
||||
else cat=
|
||||
fi
|
||||
set -- "${argv[@]}" $cat "${libv[@]}"
|
||||
fi
|
||||
|
||||
# grep through the warning/error messages to get the true exit code
|
||||
# some annoying messages are dropped while we're at it
|
||||
|
||||
trap 'rm -f $tmpfiles' 0 1 2 15
|
||||
$exec $cc $ccflags "$@" 2> $tmp
|
||||
code=$?
|
||||
for i in $unbotch
|
||||
do test -f __$i && mv __$i $i
|
||||
done
|
||||
typeset -l lc
|
||||
while :
|
||||
do if read line
|
||||
then lc=$line
|
||||
case $lc in
|
||||
*'#include file'*'not found'*)
|
||||
code=1
|
||||
;;
|
||||
*'#pragma ignored'*)
|
||||
continue
|
||||
;;
|
||||
*'definition side file is not defined'*)
|
||||
continue
|
||||
;;
|
||||
*'step ended with return code 4'*)
|
||||
code=0
|
||||
continue
|
||||
;;
|
||||
*'step ended with return code'*)
|
||||
code=1
|
||||
continue
|
||||
;;
|
||||
*'try again'*)
|
||||
code=1
|
||||
continue
|
||||
;;
|
||||
*'unknown preprocessing directive'*)
|
||||
code=1
|
||||
case $lc in
|
||||
'warning '*)
|
||||
set -- $line
|
||||
shift
|
||||
line=$*
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*'unresolved writable static references are detected'*)
|
||||
test 0 != $dll && continue
|
||||
;;
|
||||
esac
|
||||
else case $code:$exe in
|
||||
0:?*) $exec chmod +x $exe ;;
|
||||
esac
|
||||
exit $code
|
||||
fi
|
||||
echo "$line" >&2
|
||||
done < $tmp
|
||||
158
src/cmd/INIT/cc.next.i386
Executable file
158
src/cmd/INIT/cc.next.i386
Executable file
|
|
@ -0,0 +1,158 @@
|
|||
: next.i386 cc wrapper for unix message and exit code semantics : 1995-05-09 :
|
||||
|
||||
HOSTTYPE=next.i386
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# 1995-05-09 -lposix termios.o waitpid.o setpgid.o *do* work
|
||||
# 1994-11-04 -posix has old redirection hole bug
|
||||
# -D_POSIX_SOURCE requires <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
|
||||
9
src/cmd/INIT/cc.next.m68k
Executable file
9
src/cmd/INIT/cc.next.m68k
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
: next.m68k cc wrapper that enables posix : 2000-12-15 :
|
||||
|
||||
HOSTTYPE=next.m68k
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/bin/cc -posix -Xlinker -m "$@"
|
||||
9
src/cmd/INIT/cc.openbsd
Executable file
9
src/cmd/INIT/cc.openbsd
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
: OpenBSD cc wrapper
|
||||
|
||||
HOSTTYPE=openbsd.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
exec /usr/bin/cc -P "$@"
|
||||
9
src/cmd/INIT/cc.osf.alpha
Executable file
9
src/cmd/INIT/cc.osf.alpha
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
: osf.alpha cc wrapper with reasonable namespace defaults : 1998-02-04 :
|
||||
|
||||
HOSTTYPE=osf.alpha
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/usr/bin/cc -std -Dnoshare=_noshare_ -Dreadonly=_readonly_ "$@"
|
||||
26
src/cmd/INIT/cc.pentium4
Executable file
26
src/cmd/INIT/cc.pentium4
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
: linux.pentium4 gcc wrapper : 2005-10-24 :
|
||||
|
||||
HOSTTYPE=linux.pentium4
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
case " $* " in
|
||||
*" -O "*)
|
||||
set -A argv -- "$@"
|
||||
set -A nargv
|
||||
integer i j
|
||||
for ((i = j = 0; i < ${#argv[@]}; i++))
|
||||
do if [[ ${argv[i]} == -O ]]
|
||||
then nargv[j++]=-O3
|
||||
nargv[j++]=-march=pentium4
|
||||
else nargv[j++]=${argv[i]}
|
||||
fi
|
||||
done
|
||||
gcc "${nargv[@]}"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
gcc "$@"
|
||||
9
src/cmd/INIT/cc.sco.i386
Executable file
9
src/cmd/INIT/cc.sco.i386
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
: sco.i386 cc wrapper with reasonable binary and namespace : 1998-02-04 :
|
||||
|
||||
HOSTTYPE=sco.i386
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/bin/cc -b elf -D_SVID3 "$@"
|
||||
68
src/cmd/INIT/cc.sgi.mips2
Executable file
68
src/cmd/INIT/cc.sgi.mips2
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
: sgi.mips2 cc wrapper that generates mips2 binaries : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=sgi.mips2
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
cc=/usr/bin/cc
|
||||
debug=
|
||||
dynamic=-G0
|
||||
flags=-OPT:Olimit=0
|
||||
ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433
|
||||
ldignore=15,84,85,13
|
||||
optimize=
|
||||
|
||||
case $_AST_cc_OPTIONS in
|
||||
?*) eval $_AST_cc_OPTIONS ;;
|
||||
esac
|
||||
case $ignore in
|
||||
?*) ignore="-woff $ignore" ;;
|
||||
esac
|
||||
case $ldignore in
|
||||
?*) ifs=$IFS
|
||||
IFS=,
|
||||
v=$ldignore
|
||||
ldignore=
|
||||
for i in $v
|
||||
do ldignore="$ldignore -Wl,-woff,$i"
|
||||
done
|
||||
IFS=$ifs
|
||||
;;
|
||||
esac
|
||||
case $debug in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-g*) case $debug in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$debug
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
case $optimize in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-O*) case $optimize in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$optimize
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -d /usr/lib32
|
||||
then LD_LIBRARYN32_PATH=/lib32 $cc -32 -mips2 $flags $dynamic $ldignore $ignore "$@"
|
||||
else $cc -mips2 $flags $ignore "$@"
|
||||
fi
|
||||
110
src/cmd/INIT/cc.sgi.mips3
Executable file
110
src/cmd/INIT/cc.sgi.mips3
Executable file
|
|
@ -0,0 +1,110 @@
|
|||
: sgi.mips3 cc wrapper that generates mips3 binaries : 2007-04-27 :
|
||||
|
||||
HOSTTYPE=sgi.mips3
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# ld:
|
||||
# 15
|
||||
# 84
|
||||
# 85
|
||||
# 134
|
||||
# cc:
|
||||
# 1685 (first!!) Invalid error number: X.
|
||||
# 1035 cpp #error -- 0 exit status by default - botch botch botch
|
||||
# 1048
|
||||
# 1155
|
||||
# 1171 The indicated expression has no effect.
|
||||
# 1184 "=" is used where where "==" may have been intended.
|
||||
# 1209 The controlling expression is constant.
|
||||
# 1343
|
||||
# 3169 X not marked as intrinsic because it is not yet declared
|
||||
# 3170 X not marked as intrinsic because it is not yet declared
|
||||
# 3421 expecting function name #pragma intrinsic (X)
|
||||
# 3433 X not marked as intrinsic because it is not yet declared
|
||||
# 3434 X not marked as intrinsic because it is not yet declared
|
||||
|
||||
cc=/usr/bin/cc
|
||||
debug=
|
||||
dynamic=-G0
|
||||
flags=-OPT:Olimit=0
|
||||
fatal=1035
|
||||
ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3421,3433,3434
|
||||
ldignore=15,84,85,13
|
||||
optimize=
|
||||
|
||||
case $_AST_cc_OPTIONS in
|
||||
?*) eval $_AST_cc_OPTIONS ;;
|
||||
esac
|
||||
case $fatal in
|
||||
?*) fatal="-diag_error $fatal" ;;
|
||||
esac
|
||||
case $ignore in
|
||||
?*) ignore="-woff $ignore" ;;
|
||||
esac
|
||||
case $ldignore in
|
||||
?*) ifs=$IFS
|
||||
IFS=,
|
||||
v=$ldignore
|
||||
ldignore=
|
||||
for i in $v
|
||||
do ldignore="$ldignore -Wl,-woff,$i"
|
||||
done
|
||||
IFS=$ifs
|
||||
;;
|
||||
esac
|
||||
case $debug in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-g*) case $debug in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$debug
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
case $optimize in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-O*) case $optimize in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$optimize
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
-mips2) if test -d /usr/lib32
|
||||
then LD_LIBRARYN32_PATH=/lib32 $cc -32 -mips2 $flags $dynamic $ldignore $ignore "$@"
|
||||
else $cc -mips2 $flags $ignore "$@"
|
||||
fi
|
||||
;;
|
||||
-mips4) case " $* " in
|
||||
*" -ldl "*)
|
||||
integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-ldl) ;;
|
||||
*) a[n++]=$i ;;
|
||||
esac
|
||||
done
|
||||
set -- ${a[@]}
|
||||
esac
|
||||
$cc -64 -mips4 $flags $dynamic $fatal $ldignore $ignore "$@"
|
||||
;;
|
||||
*) $cc -n32 -mips3 $flags $dynamic $fatal $ldignore $ignore "$@"
|
||||
;;
|
||||
esac
|
||||
65
src/cmd/INIT/cc.sgi.mips3-o32
Executable file
65
src/cmd/INIT/cc.sgi.mips3-o32
Executable file
|
|
@ -0,0 +1,65 @@
|
|||
: sgi.mips3-o32 cc wrapper that generates mips3 o32 binaries : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=sgi.mips3-o32
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
cc=/usr/bin/cc
|
||||
debug=
|
||||
dynamic=-G0
|
||||
flags=
|
||||
ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433
|
||||
ldignore=15,84,85,13
|
||||
optimize=
|
||||
|
||||
case $_AST_cc_OPTIONS in
|
||||
?*) eval $_AST_cc_OPTIONS ;;
|
||||
esac
|
||||
case $ignore in
|
||||
?*) ignore="-woff $ignore" ;;
|
||||
esac
|
||||
case $ldignore in
|
||||
?*) ifs=$IFS
|
||||
IFS=,
|
||||
v=$ldignore
|
||||
ldignore=
|
||||
for i in $v
|
||||
do ldignore="$ldignore -Wl,-woff,$i"
|
||||
done
|
||||
IFS=$ifs
|
||||
;;
|
||||
esac
|
||||
case $debug in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-g*) case $debug in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$debug
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
case $optimize in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-O*) case $optimize in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$optimize
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
|
||||
$cc -o32 -mips3 $flags $dynamic $ldignore $ignore "$@"
|
||||
90
src/cmd/INIT/cc.sgi.mips4
Executable file
90
src/cmd/INIT/cc.sgi.mips4
Executable file
|
|
@ -0,0 +1,90 @@
|
|||
: sgi.mips4 cc wrapper that generates mips4 binaries : 2007-04-27 :
|
||||
|
||||
HOSTTYPE=sgi.mips4
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
cc=/usr/bin/cc
|
||||
debug=
|
||||
dynamic=-G0
|
||||
flags=-OPT:Olimit=0
|
||||
fatal=1035
|
||||
ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433
|
||||
ldignore=15,84,85,13
|
||||
optimize=
|
||||
|
||||
case $_AST_cc_OPTIONS in
|
||||
?*) eval $_AST_cc_OPTIONS ;;
|
||||
esac
|
||||
case $fatal in
|
||||
?*) fatal="-diag_error $fatal" ;;
|
||||
esac
|
||||
case $ignore in
|
||||
?*) ignore="-woff $ignore" ;;
|
||||
esac
|
||||
case $ldignore in
|
||||
?*) ifs=$IFS
|
||||
IFS=,
|
||||
v=$ldignore
|
||||
ldignore=
|
||||
for i in $v
|
||||
do ldignore="$ldignore -Wl,-woff,$i"
|
||||
done
|
||||
IFS=$ifs
|
||||
;;
|
||||
esac
|
||||
case $debug in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-g*) case $debug in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$debug
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
case $optimize in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-O*) case $optimize in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$optimize
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
-mips2) if test -d /usr/lib32
|
||||
then LD_LIBRARYN32_PATH=/lib32 $cc -32 -mips2 $flags $dynamic $ldignore $ignore "$@"
|
||||
else $cc -mips2 $flags $ignore "$@"
|
||||
fi
|
||||
;;
|
||||
-mips3) $cc -n32 -mips3 $flags $dynamic $fatal $ldignore $ignore "$@"
|
||||
;;
|
||||
*) case " $* " in
|
||||
*" -ldl "*)
|
||||
integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-ldl) ;;
|
||||
*) a[n++]=$i ;;
|
||||
esac
|
||||
done
|
||||
set -- ${a[@]}
|
||||
esac
|
||||
$cc -64 -mips4 $flags $dynamic $fatal $ldignore $ignore "$@"
|
||||
;;
|
||||
esac
|
||||
65
src/cmd/INIT/cc.sgi.mips4-n32
Executable file
65
src/cmd/INIT/cc.sgi.mips4-n32
Executable file
|
|
@ -0,0 +1,65 @@
|
|||
: sgi.mips4-n32 cc wrapper that generates mips4 n32 binaries : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=sgi.mips4-n32
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
cc=/usr/bin/cc
|
||||
debug=
|
||||
dynamic=-G0
|
||||
flags=
|
||||
ignore=1685,733,1048,1155,1171,1184,1209,1343,3169,3170,3433
|
||||
ldignore=15,84,85,13
|
||||
optimize=
|
||||
|
||||
case $_AST_cc_OPTIONS in
|
||||
?*) eval $_AST_cc_OPTIONS ;;
|
||||
esac
|
||||
case $ignore in
|
||||
?*) ignore="-woff $ignore" ;;
|
||||
esac
|
||||
case $ldignore in
|
||||
?*) ifs=$IFS
|
||||
IFS=,
|
||||
v=$ldignore
|
||||
ldignore=
|
||||
for i in $v
|
||||
do ldignore="$ldignore -Wl,-woff,$i"
|
||||
done
|
||||
IFS=$ifs
|
||||
;;
|
||||
esac
|
||||
case $debug in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-g*) case $debug in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$debug
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
case $optimize in
|
||||
?*) integer n=0
|
||||
for i
|
||||
do case $i in
|
||||
-O*) case $optimize in
|
||||
-) continue ;;
|
||||
esac
|
||||
i=$optimize
|
||||
;;
|
||||
esac
|
||||
a[n++]=$i
|
||||
done
|
||||
set -- ${a[@]}
|
||||
;;
|
||||
esac
|
||||
|
||||
$cc -n32 -mips4 $flags $dynamic $ldignore $ignore "$@"
|
||||
18
src/cmd/INIT/cc.sol11.i386
Executable file
18
src/cmd/INIT/cc.sol11.i386
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
: solaris.i386 cc wrapper for reasonable ansi C defaults and 32 bit : 2021-01-17 :
|
||||
|
||||
HOSTTYPE=sol11.i386
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# Solaris build scripts set $CC_EXPLICIT. If not set, function without it.
|
||||
case ${CC_EXPLICIT:=$CC} in
|
||||
'' | cc)
|
||||
PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc'
|
||||
CC_EXPLICIT=cc
|
||||
esac
|
||||
|
||||
# Note: the _XPG6 macro is now defined in src/lib/libast/features/common
|
||||
|
||||
$CC_EXPLICIT -m32 -xc99 "$@"
|
||||
18
src/cmd/INIT/cc.sol11.i386-64
Executable file
18
src/cmd/INIT/cc.sol11.i386-64
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
: solaris.i386-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2021-01-17 :
|
||||
|
||||
HOSTTYPE=sol11.i386-64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# Solaris build scripts set $CC_EXPLICIT. If not set, function without it.
|
||||
case ${CC_EXPLICIT:=$CC} in
|
||||
'' | cc)
|
||||
PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc'
|
||||
CC_EXPLICIT=cc
|
||||
esac
|
||||
|
||||
# Note: the _XPG6 macro is now defined in src/lib/libast/features/common
|
||||
|
||||
$CC_EXPLICIT -m64 -xc99 "$@"
|
||||
18
src/cmd/INIT/cc.sol11.sparc
Executable file
18
src/cmd/INIT/cc.sol11.sparc
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
: solaris.sparc cc wrapper for reasonable ansi C defaults and 32 bit : 2021-01-17 :
|
||||
|
||||
HOSTTYPE=sol11.sparc
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# Solaris build scripts set $CC_EXPLICIT. If not set, function without it.
|
||||
case ${CC_EXPLICIT:=$CC} in
|
||||
'' | cc)
|
||||
PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc'
|
||||
CC_EXPLICIT=cc
|
||||
esac
|
||||
|
||||
# Note: the _XPG6 macro is now defined in src/lib/libast/features/common
|
||||
|
||||
$CC_EXPLICIT -m32 -xc99 "$@"
|
||||
18
src/cmd/INIT/cc.sol11.sparc-64
Executable file
18
src/cmd/INIT/cc.sol11.sparc-64
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
: solaris.sparc-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2021-01-17 :
|
||||
|
||||
HOSTTYPE=sol11.sparc-64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# Solaris build scripts set $CC_EXPLICIT. If not set, function without it.
|
||||
case ${CC_EXPLICIT:=$CC} in
|
||||
'' | cc)
|
||||
PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc'
|
||||
CC_EXPLICIT=cc
|
||||
esac
|
||||
|
||||
# Note: the _XPG6 macro is now defined in src/lib/libast/features/common
|
||||
|
||||
$CC_EXPLICIT -m64 -xc99 "$@"
|
||||
35
src/cmd/INIT/cc.specialize
Executable file
35
src/cmd/INIT/cc.specialize
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
: -O* specialization cc wrapper : 2011-11-11 :
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
cc=cc
|
||||
|
||||
CCREPLACE='' # these (possibly empty) options replace -O*
|
||||
CCALWAYS='' # these (possibly empty) options always set
|
||||
|
||||
case $CCREPLACE in
|
||||
'') ;;
|
||||
*) case " $* " in
|
||||
*" -O"*)
|
||||
set '' "$@" ''
|
||||
shift
|
||||
while :
|
||||
do a=$1
|
||||
shift
|
||||
case $a in
|
||||
'') break
|
||||
;;
|
||||
-O*) set '' "$@" $CCREPLACE
|
||||
;;
|
||||
*) set '' "$@" "$a"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
$cc $CCALWAYS "$@"
|
||||
76
src/cmd/INIT/cc.unix.mc68k
Executable file
76
src/cmd/INIT/cc.unix.mc68k
Executable file
|
|
@ -0,0 +1,76 @@
|
|||
: 3B1/PC7300 unix.mc68k cc wrapper for ANSI C : 2002-09-01 :
|
||||
|
||||
HOSTTYPE=unix.mc68k
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# /bin/cc predates ANSI C; use gcc
|
||||
# some headers depend on SYSTEM5 or mc68k being defined
|
||||
# headers for Ethernet software are under /usr/ethernet/include
|
||||
# both /usr/lib/libnet.a and /usr/lib/libcurses.a define select()
|
||||
# -lcurses uses a version of select for napms(), but that
|
||||
# implementation always returns an error if given file
|
||||
# descriptors to watch
|
||||
# the one in -lnet must be used if fds (instead of or in addition to
|
||||
# a timeout) are of interest therefore, -lnet should be
|
||||
# specified before -lcurses
|
||||
# rename(old, new) in /usr/lib/libnet.a fails if new exists
|
||||
# (permitted by ANSI/ISO C-1990 7.9.4.2)
|
||||
# gcc -fpic doesn't work as there's no _GLOBAL_OFFSET_TABLE symbol
|
||||
|
||||
cc="gcc"
|
||||
|
||||
exec=
|
||||
show=:
|
||||
inc=0
|
||||
lib=0
|
||||
set '' -DSYSTEM5 -Dmc68k "$@" ''
|
||||
shift
|
||||
while :
|
||||
do a=$1
|
||||
shift
|
||||
case $a in
|
||||
'') break
|
||||
;;
|
||||
-lcurses|libcurses.a|*/libcurses.a)
|
||||
lib=1
|
||||
set '' "$@" -lnet
|
||||
shift
|
||||
;;
|
||||
-lnet|libnet.a|*/libnet.a)
|
||||
lib=1
|
||||
;;
|
||||
-o) a=$1
|
||||
shift
|
||||
set '' "$@" -o
|
||||
shift
|
||||
;;
|
||||
-fpic) continue
|
||||
;;
|
||||
-n) exec=:
|
||||
continue
|
||||
;;
|
||||
-v) show=echo
|
||||
continue
|
||||
;;
|
||||
-*) ;;
|
||||
*) case $inc in
|
||||
0) inc=1
|
||||
set '' "$@" -I/usr/ethernet/include
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
set '' "$@" "$a"
|
||||
shift
|
||||
done
|
||||
case $lib in
|
||||
0) set '' "$@" -lnet
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
$show $cc "$@"
|
||||
$exec $cc "$@"
|
||||
9
src/cmd/INIT/cc.unixware.i386
Executable file
9
src/cmd/INIT/cc.unixware.i386
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
: unixware.i386 cc wrapper
|
||||
|
||||
HOSTTYPE=unixware.i386
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/bin/cc -D_XOPEN_UNIX -D_XOPEN_SOURCE_EXTENDED "$@"
|
||||
141
src/cmd/INIT/crossexec.sh
Normal file
141
src/cmd/INIT/crossexec.sh
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
########################################################################
|
||||
# #
|
||||
# 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> #
|
||||
# #
|
||||
########################################################################
|
||||
: 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 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[+NAME?crossexec - cross compiler a.out execution]
|
||||
[+DESCRIPTION?\bcrossexec\b runs a cross-compiled \acommand\a in an environment
|
||||
that supports a cross-compilation architecture different from the
|
||||
current host. The cross environment is determined by \acrosstype\a,
|
||||
usually a host type name produced by \bpackage\b(1). \acrosstype\a
|
||||
is used to find an entry in \b$HOME/.crossexec\b that specifies
|
||||
the cross compiler host and access details.]
|
||||
[+?The exit status of \bcrossexec\b is the exit status of \acommand\a.]
|
||||
[+CROSS ENVIRONMENT FILE?\b$HOME/.crossexec\b contains one line for each
|
||||
supported \acrosstype\a. Each line contains 5 tab separated fields.
|
||||
Field default values are specified as \b-\b. The fields are:]{
|
||||
[+crosstype?The host type produced by \bpackage\b(1).]
|
||||
[+host?The host name.]
|
||||
[+user?The user name on \ahost\a. The default is the current user.]
|
||||
[+dir?The directory to copy \acommand\a and execute it. The default
|
||||
is the \auser\a \b$HOME\b on \ahost\a.]
|
||||
[+shell?The command used to get shell access to \ahost\a. Currently
|
||||
only \brsh\b and \bssh\b are supported.]
|
||||
[+copy?The command used to copy \acommand\a to \ahost\a. Currently
|
||||
only \brcp\b and \bscp\b are supported.]
|
||||
}
|
||||
[n:show?Show the underlying commands but do not execute.]
|
||||
|
||||
crosstype command [ option ... ] [ file ... ]
|
||||
|
||||
[+SEE ALSO?\brcp\b(1), \brsh\b(1), \bscp\b(1), \bssh\b(1)]
|
||||
'
|
||||
;;
|
||||
*) ARGV0=""
|
||||
USAGE="crosstype command [ option ... ] [ file ... ]"
|
||||
;;
|
||||
esac
|
||||
|
||||
usage()
|
||||
{
|
||||
OPTIND=0
|
||||
getopts $ARGV0 "$USAGE" OPT '-?'
|
||||
exit 2
|
||||
}
|
||||
|
||||
exec=
|
||||
|
||||
# get the options and operands
|
||||
|
||||
while getopts $ARGV0 "$USAGE" OPT
|
||||
do case $OPT in
|
||||
n) exec=echo ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
shift $OPTIND-1
|
||||
case $# in
|
||||
[01]) usage ;;
|
||||
esac
|
||||
|
||||
type=$1
|
||||
shift
|
||||
cmd=$1
|
||||
shift
|
||||
|
||||
# get the host info
|
||||
|
||||
info=$HOME/.$command
|
||||
if test ! -r $info
|
||||
then echo "$command: $info: not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
ifs=${IFS-'
|
||||
'}
|
||||
while :
|
||||
do IFS=' '
|
||||
read hosttype hostname usr dir sh cp
|
||||
code=$?
|
||||
IFS=$ifs
|
||||
case $code in
|
||||
0) ;;
|
||||
*) echo "$command: $type: unknown cross compiler host type" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
case $hosttype in
|
||||
$type) break ;;
|
||||
esac
|
||||
done < $info
|
||||
|
||||
# fill in the defaults
|
||||
|
||||
case $usr in
|
||||
-) cpu= shu= ;;
|
||||
*) cpu=${usr}@ shu="-l $usr" ;;
|
||||
esac
|
||||
case $dir in
|
||||
-) dir= ;;
|
||||
esac
|
||||
case $sh in
|
||||
''|-) sh=ssh ;;
|
||||
esac
|
||||
case $cp in
|
||||
''|-) cp=scp ;;
|
||||
scp) cp="$cp -q" ;;
|
||||
esac
|
||||
|
||||
trap "rm -f $tmp" 0 1 2 3 15
|
||||
$exec $cp $cmd $cpu$hostname:$dir </dev/null || 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`
|
||||
37
src/cmd/INIT/db.c
Normal file
37
src/cmd/INIT/db.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <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;
|
||||
}
|
||||
460
src/cmd/INIT/ditto.sh
Normal file
460
src/cmd/INIT/ditto.sh
Normal file
|
|
@ -0,0 +1,460 @@
|
|||
########################################################################
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
# #
|
||||
# A copy of the License is available at #
|
||||
# http://www.eclipse.org/org/documents/epl-v10.html #
|
||||
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
||||
# #
|
||||
# Information and Software Systems Research #
|
||||
# AT&T Research #
|
||||
# Florham Park NJ #
|
||||
# #
|
||||
# Glenn Fowler <gsf@research.att.com> #
|
||||
# #
|
||||
########################################################################
|
||||
: replicate directory hierarchies
|
||||
|
||||
COMMAND=ditto
|
||||
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
0123) ARGV0="-a $COMMAND"
|
||||
USAGE=$'
|
||||
[-?
|
||||
@(#)$Id: ditto (AT&T Labs Research) 2010-11-22 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[+NAME?ditto - replicate directory hierarchies]
|
||||
[+DESCRIPTION?\bditto\b replicates the \asource\a directory hierarchy
|
||||
to the \adestination\a directory hierarchy. Both \asource\a and
|
||||
\adestination\a may be of the form
|
||||
[\auser\a@]][\ahost\a:]][\adirectory\a]]. At least one of
|
||||
\ahost\a: or \adirectory\a must be specified. The current user is used
|
||||
if \auser@\a is omitted, the local host is used if \ahost\a: is
|
||||
omitted, and the user home directory is used if \adirectory\a is
|
||||
omitted.]
|
||||
[+?Remote hosts and files are accessed via \bssh\b(1) or \brsh\b(1). \bksh\b(1),
|
||||
\bpax\b(1), and \btw\b(1) must be installed on the local and remote hosts.]
|
||||
[+?For each source file \bditto\b does one of these actions:]{
|
||||
[+chmod|chown?change the mode and/or ownership of the destination
|
||||
file to match the source]
|
||||
[+copy?copy the source file to the destination]
|
||||
[+delete?delete the destination file]
|
||||
[+skip?the destination file is not changed]
|
||||
}
|
||||
[+?The source and destination hierarchies are generated by \btw\b(1) with
|
||||
the \b--logical\b option. An \b--expr\b option may
|
||||
be specified to prune the search. The \btw\b searches are relative to
|
||||
the \asource\a and \adestination\a directories.]
|
||||
[c:checksum?Copy if the \btw\b(1) 32x4 checksum mismatches.]
|
||||
[d:delete?Delete \adestination\a files that are not in the \asource\a.]
|
||||
[e:expr?\btw\b(1) select expression.]:[tw-expression]
|
||||
[m!:mode?Preserve file mode.]
|
||||
[n:show?Show the operations but do not execute.]
|
||||
[o:owner?Preserve file user and group ownership.]
|
||||
[p:physical?Generate source and destination hierarchies by \btw\b(1) with
|
||||
the \b--physical\b option.]
|
||||
[r:remote?The remote access protocol; either \bssh\b or
|
||||
\brsh\b.]:[protocol:=ssh]
|
||||
[u:update?Copy only if the \asource\a file is newer than the
|
||||
\adestination\a file.]
|
||||
[v:verbose?Trace the operations as they are executed.]
|
||||
[D:debug?Enable the debug trace.]
|
||||
|
||||
source destination
|
||||
|
||||
[+SEE ALSO?\brdist\b(1), \brsync\b(1), \brsh\b(1), \bssh\b(1), \btw\b(1)]
|
||||
'
|
||||
;;
|
||||
*) ARGV0=""
|
||||
USAGE="de:[tw-expression]mnouvD source destination"
|
||||
;;
|
||||
esac
|
||||
|
||||
usage()
|
||||
{
|
||||
OPTIND=0
|
||||
getopts $ARGV0 "$USAGE" OPT '-?'
|
||||
exit 2
|
||||
}
|
||||
|
||||
parse() # id user@host:dir
|
||||
{
|
||||
typeset id dir user host
|
||||
id=$1
|
||||
dir=$2
|
||||
(( debug || ! exec )) && print -r $id $dir
|
||||
if [[ $dir == *@* ]]
|
||||
then
|
||||
user=${dir%%@*}
|
||||
dir=${dir#${user}@}
|
||||
else
|
||||
user=
|
||||
fi
|
||||
if [[ $dir == *:* ]]
|
||||
then
|
||||
host=${dir%%:*}
|
||||
dir=${dir#${host}:}
|
||||
else
|
||||
host=
|
||||
fi
|
||||
if [[ $user ]]
|
||||
then
|
||||
user="-l $user"
|
||||
if [[ ! $host ]]
|
||||
then
|
||||
host=$(hostname)
|
||||
fi
|
||||
fi
|
||||
eval ${id}_user='$user'
|
||||
eval ${id}_host='$host'
|
||||
eval ${id}_dir='$dir'
|
||||
}
|
||||
|
||||
# initialize
|
||||
|
||||
typeset -A chown chmod
|
||||
typeset tw cp rm link
|
||||
integer ntw=0 ncp=0 nrm=0 nlink=0 n
|
||||
|
||||
typeset src_user src_host src_path src_type src_uid src_gid src_perm src_sum
|
||||
typeset dst_user dst_host dst_path dst_type dst_uid dst_gid dst_perm dst_sum
|
||||
integer src_size src_mtime src_eof
|
||||
integer dst_size dst_mtime dst_eof
|
||||
|
||||
integer debug=0 delete=0 exec=1 mode=1 owner=0 update=0 verbose=0 logical
|
||||
|
||||
typeset remote=ssh trace
|
||||
typeset checksum='"-"' pax="pax"
|
||||
typeset paxreadflags="" paxwriteflags="--write --format=tgz --nosummary"
|
||||
|
||||
tw[ntw++]=tw
|
||||
(( logical=ntw ))
|
||||
tw[ntw++]=--logical
|
||||
tw[ntw++]=--chop
|
||||
tw[ntw++]=--ignore-errors
|
||||
tw[ntw++]=--expr=sort:name
|
||||
|
||||
# grab the options
|
||||
|
||||
while getopts $ARGV0 "$USAGE" OPT
|
||||
do case $OPT in
|
||||
c) checksum=checksum ;;
|
||||
d) delete=1 ;;
|
||||
e) tw[ntw++]=--expr=\"$OPTARG\" ;;
|
||||
m) mode=0 ;;
|
||||
n) exec=0 verbose=1 ;;
|
||||
o) owner=1 ;;
|
||||
p) tw[logical]=--physical ;;
|
||||
r) remote=$OPTARG ;;
|
||||
u) update=1 ;;
|
||||
v) verbose=1 ;;
|
||||
D) debug=1 ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
shift $OPTIND-1
|
||||
if (( $# != 2 ))
|
||||
then usage
|
||||
fi
|
||||
tw[ntw++]=--expr=\''action:printf("%d\t%d\t%s\t%s\t%s\t%-.1s\t%o\t%s\t%s\n", size, mtime, '$checksum', uid, gid, mode, perm, path, symlink);'\'
|
||||
if (( exec ))
|
||||
then
|
||||
paxreadflags="$paxreadflags --read"
|
||||
fi
|
||||
if (( verbose ))
|
||||
then
|
||||
paxreadflags="$paxreadflags --verbose"
|
||||
fi
|
||||
|
||||
# start the source and destination path list generators
|
||||
|
||||
parse src "$1"
|
||||
parse dst "$2"
|
||||
|
||||
# the |& command may exit before the exec &p
|
||||
# the print sync + read delays the |& until the exec &p finishes
|
||||
|
||||
if [[ $src_host ]]
|
||||
then ($remote $src_user $src_host "{ test ! -f .profile || . ./.profile ;} && cd $src_dir && read && ${tw[*]}") 2>&1 |&
|
||||
else (cd $src_dir && read && eval "${tw[@]}") 2>&1 |&
|
||||
fi
|
||||
exec 5<&p 7>&p
|
||||
print -u7 sync
|
||||
exec 7>&-
|
||||
|
||||
if [[ $dst_host ]]
|
||||
then ($remote $dst_user $dst_host "{ test ! -f .profile || . ./.profile ;} && cd $dst_dir && read && ${tw[*]}") 2>&1 |&
|
||||
else (cd $dst_dir && read && eval "${tw[@]}") 2>&1 |&
|
||||
fi
|
||||
exec 6<&p 7>&p
|
||||
print -u7 sync
|
||||
exec 7>&-
|
||||
|
||||
# scan through the sorted path lists
|
||||
|
||||
if (( exec ))
|
||||
then
|
||||
src_skip=*
|
||||
dst_skip=*
|
||||
else
|
||||
src_skip=
|
||||
dst_skip=
|
||||
fi
|
||||
src_path='' src_eof=0
|
||||
dst_path='' dst_eof=0
|
||||
ifs=${IFS-$' \t\n'}
|
||||
IFS=$'\t'
|
||||
while :
|
||||
do
|
||||
# get the next source path
|
||||
|
||||
if [[ ! $src_path ]] && (( ! src_eof ))
|
||||
then
|
||||
if read -r -u5 text src_mtime src_sum src_uid src_gid src_type src_perm src_path src_link
|
||||
then
|
||||
if [[ $text != +([[:digit:]]) ]]
|
||||
then
|
||||
print -u2 $COMMAND: source: "'$text'"
|
||||
src_path=
|
||||
continue
|
||||
fi
|
||||
src_size=$text
|
||||
elif (( dst_eof ))
|
||||
then
|
||||
break
|
||||
elif (( src_size==0 ))
|
||||
then
|
||||
exit 1
|
||||
else
|
||||
src_path=
|
||||
src_eof=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# get the next destination path
|
||||
|
||||
if [[ ! $dst_path ]] && (( ! dst_eof ))
|
||||
then
|
||||
if read -r -u6 text dst_mtime dst_sum dst_uid dst_gid dst_type dst_perm dst_path dst_link
|
||||
then
|
||||
if [[ $text != +([[:digit:]]) ]]
|
||||
then
|
||||
print -u2 $COMMAND: destination: $text
|
||||
dst_path=
|
||||
continue
|
||||
fi
|
||||
dst_size=$text
|
||||
elif (( src_eof ))
|
||||
then
|
||||
break
|
||||
elif (( dst_size==0 ))
|
||||
then
|
||||
exit 1
|
||||
else
|
||||
dst_path=
|
||||
dst_eof=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# determine the { cp rm chmod chown } ops
|
||||
|
||||
if (( debug ))
|
||||
then
|
||||
[[ $src_path ]] && print -r -u2 -f $': src %8s %10s %s %s %s %s %3s %s\n' $src_size $src_mtime $src_sum $src_uid $src_gid $src_type $src_perm "$src_path"
|
||||
[[ $dst_path ]] && print -r -u2 -f $': dst %8s %10s %s %s %s %s %3s %s\n' $dst_size $dst_mtime $dst_sum $dst_uid $dst_gid $dst_type $dst_perm "$dst_path"
|
||||
fi
|
||||
if [[ $src_path == $dst_path ]]
|
||||
then
|
||||
if [[ $src_type != $dst_type ]]
|
||||
then
|
||||
rm[nrm++]=$dst_path
|
||||
if [[ $dst_path != $dst_skip ]]
|
||||
then
|
||||
if [[ $dst_type == d ]]
|
||||
then
|
||||
dst_skip="$dst_path/*"
|
||||
print -r rm -r "'$dst_path'"
|
||||
else
|
||||
dst_skip=
|
||||
print -r rm "'$dst_path'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [[ $src_type == l ]]
|
||||
then if [[ $src_link != $dst_link ]]
|
||||
then
|
||||
cp[ncp++]=$src_path
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r cp "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
elif [[ $src_type != d ]] && { (( update && src_mtime > dst_mtime )) || (( ! update )) && { (( src_size != dst_size )) || [[ $src_sum != $dst_sum ]] ;} ;}
|
||||
then
|
||||
if [[ $src_path != . ]]
|
||||
then
|
||||
cp[ncp++]=$src_path
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r cp "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if (( owner )) && [[ $src_uid != $dst_uid || $src_gid != $dst_gid ]]
|
||||
then
|
||||
chown[$src_uid.$src_gid]="${chown[$src_uid.$src_gid]} '$src_path'"
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r chown $src_uid.$src_gid "'$src_path'"
|
||||
fi
|
||||
if (( (src_perm & 07000) || mode && src_perm != dst_perm ))
|
||||
then
|
||||
chmod[$src_perm]="${chmod[$src_perm]} '$src_path'"
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r chmod $src_perm "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
elif (( mode && src_perm != dst_perm ))
|
||||
then
|
||||
chmod[$src_perm]="${chmod[$src_perm]} '$src_path'"
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r chmod $src_perm "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
src_path=
|
||||
dst_path=
|
||||
elif [[ ! $dst_path || $src_path && $src_path < $dst_path ]]
|
||||
then
|
||||
if [[ $src_path != . ]]
|
||||
then
|
||||
cp[ncp++]=$src_path
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
if [[ $src_type == d ]]
|
||||
then
|
||||
src_skip="$src_path/*"
|
||||
print -r cp -r "'$src_path'"
|
||||
else
|
||||
src_skip=
|
||||
print -r cp "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
src_path=
|
||||
elif [[ $dst_path ]]
|
||||
then
|
||||
if (( delete ))
|
||||
then
|
||||
rm[nrm++]=$dst_path
|
||||
if [[ $dst_path != $dst_skip ]]
|
||||
then
|
||||
if [[ $dst_type == d ]]
|
||||
then
|
||||
dst_skip="$dst_path/*"
|
||||
print -r rm -r "'$dst_path'"
|
||||
else
|
||||
dst_skip=
|
||||
print -r rm "'$dst_path'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dst_path=
|
||||
fi
|
||||
done
|
||||
IFS=$ifs
|
||||
|
||||
(( exec )) || exit 0
|
||||
|
||||
# generate, transfer and execute the { rm chown chmod } script
|
||||
|
||||
if (( ${#rm[@]} || ${#chmod[@]} || ${#chown[@]} ))
|
||||
then
|
||||
{
|
||||
if (( verbose ))
|
||||
then
|
||||
print -r -- set -x
|
||||
fi
|
||||
print -nr -- cd "'$dst_dir'"
|
||||
n=0
|
||||
for i in ${rm[@]}
|
||||
do
|
||||
if (( --n <= 0 ))
|
||||
then
|
||||
n=32
|
||||
print
|
||||
print -nr -- rm -rf
|
||||
fi
|
||||
print -nr -- " '$i'"
|
||||
done
|
||||
for i in ${!chown[@]}
|
||||
do
|
||||
n=0
|
||||
for j in ${chown[$i]}
|
||||
do
|
||||
if (( --n <= 0 ))
|
||||
then
|
||||
n=32
|
||||
print
|
||||
print -nr -- chown $i
|
||||
fi
|
||||
print -nr -- " $j"
|
||||
done
|
||||
done
|
||||
for i in ${!chmod[@]}
|
||||
do
|
||||
n=0
|
||||
for j in ${chmod[$i]}
|
||||
do
|
||||
if (( --n <= 0 ))
|
||||
then
|
||||
n=32
|
||||
print
|
||||
print -nr -- chmod $i
|
||||
fi
|
||||
print -nr -- " $j"
|
||||
done
|
||||
done
|
||||
print
|
||||
} | {
|
||||
if (( ! exec ))
|
||||
then
|
||||
cat
|
||||
elif [[ $dst_host ]]
|
||||
then
|
||||
$remote $dst_user $dst_host sh
|
||||
else
|
||||
$SHELL
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
# generate, transfer and read back the { cp } tarball
|
||||
|
||||
if (( ${#cp[@]} ))
|
||||
then
|
||||
{
|
||||
cd $src_dir &&
|
||||
print -r -f $'%s\n' "${cp[@]}" |
|
||||
$pax $paxwriteflags
|
||||
} | {
|
||||
if [[ $dst_host ]]
|
||||
then
|
||||
$remote $dst_user $dst_host "{ test ! -f .profile || . ./.profile ;} && { test -d \"$dst_dir\" || mkdir -p \"$dst_dir\" ;} && cd \"$dst_dir\" && gunzip | $pax $paxreadflags"
|
||||
else
|
||||
( { test -d "$dst_dir" || mkdir -p "$dst_dir" ;} && cd "$dst_dir" && gunzip | $pax $paxreadflags )
|
||||
fi
|
||||
}
|
||||
wait
|
||||
fi
|
||||
33
src/cmd/INIT/dl.c
Normal file
33
src/cmd/INIT/dl.c
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
/*
|
||||
* small test for -ldl
|
||||
*/
|
||||
|
||||
#ifndef dlopen
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
dlopen("libdl.so",0);
|
||||
return 0;
|
||||
}
|
||||
187
src/cmd/INIT/execrate.sh
Normal file
187
src/cmd/INIT/execrate.sh
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
########################################################################
|
||||
# #
|
||||
# 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> #
|
||||
# #
|
||||
########################################################################
|
||||
: 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 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[+NAME?execrate - wrapper for .exe challenged commands]
|
||||
[+DESCRIPTION?\bexecrate\b runs \acommand\a after checking the \afile\a
|
||||
operands for standard semantics with respect to \bwin32\b \b.exe\b
|
||||
suffix conventions. This command is only needed on \bwin32\b
|
||||
systems that inconsistently handle \b.exe\b across library and
|
||||
command interfaces. \acommand\a may be one of \bcat\b(1), \bchmod\b(1),
|
||||
\bcmp\b(1), \bcp\b(1), \bln\b(1), \bmv\b(1), or \brm\b(1).
|
||||
Only the 2 argument forms of \bcp\b, \bln\b and \bmv\b are handled.
|
||||
Unsupported commands and commands requiring no change are
|
||||
silently executed.]
|
||||
[+?With no arguments \bexecrate\b exits with status 0 if the current system
|
||||
is \b.exe\b challenged, 1 if the current system is normal.]
|
||||
[n:show?Show the underlying commands but do not execute.]
|
||||
|
||||
command [ option ... ] file ...
|
||||
|
||||
[+SEE ALSO?\bwebster\b(1)]
|
||||
'
|
||||
usage()
|
||||
{
|
||||
OPTIND=0
|
||||
getopts $ARGV0 "$USAGE" OPT '-?'
|
||||
exit 2
|
||||
}
|
||||
exec=1
|
||||
while getopts $ARGV0 "$USAGE" OPT
|
||||
do case $OPT in
|
||||
n) exec=0 ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
shift `expr $OPTIND - 1`
|
||||
;;
|
||||
*) usage()
|
||||
{
|
||||
echo "Usage: execrate [ -n ] [ command [ option ... ] file ... ]" >&2
|
||||
exit 2
|
||||
}
|
||||
exec=1
|
||||
while :
|
||||
do case $1 in
|
||||
-n) exec=0 ;;
|
||||
-*) usage ;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
;;
|
||||
esac
|
||||
case $# in
|
||||
0) if test ! -x /bin/cat.exe
|
||||
then exit 1 # normal
|
||||
fi
|
||||
if /bin/cat /bin/cat >/dev/null 2>&1
|
||||
then exit 1 # normal
|
||||
fi
|
||||
exit 0 # challenged
|
||||
;;
|
||||
1) usage
|
||||
;;
|
||||
esac
|
||||
case $1 in
|
||||
*cat|*rm)
|
||||
NUM=0
|
||||
;;
|
||||
*chgrp|*chmod)
|
||||
NUM=1
|
||||
;;
|
||||
*cmp|*cp|*ln|*mv)
|
||||
NUM=2
|
||||
;;
|
||||
*) case $exec in
|
||||
0) echo "$@" ;;
|
||||
*) "$@" ;;
|
||||
esac
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
CMD=$1
|
||||
shift
|
||||
case $CMD in
|
||||
*/*) ;;
|
||||
*) for d in $bins
|
||||
do if test -x $d/$1 -o -x $d/$1.exe
|
||||
then CMD=$d/$1
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
while :
|
||||
do case $1 in
|
||||
-*) CMD="$CMD $1" ;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
case $exec in
|
||||
0) CMD="echo $CMD" ;;
|
||||
esac
|
||||
case $NUM:$# in
|
||||
*:0) ;;
|
||||
1:*) CMD="$CMD $1"
|
||||
NUM=0
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
case $NUM:$# in
|
||||
0:*) status=0
|
||||
for f
|
||||
do if test "$f" -ef "$f".exe
|
||||
then f=$f.exe
|
||||
fi
|
||||
$CMD "$f"
|
||||
case $? in
|
||||
0) ;;
|
||||
*) status=$? ;;
|
||||
esac
|
||||
done
|
||||
exit $status
|
||||
;;
|
||||
2:2) f=$1
|
||||
case $f in
|
||||
*.exe) ;;
|
||||
*) if test "$f" -ef "$f".exe
|
||||
then f=$f.exe
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
case $f in
|
||||
*.exe) if test -d "$2"
|
||||
then t=$2/$f
|
||||
else t=$2
|
||||
fi
|
||||
case $t in
|
||||
*/*) b=`basename "$t"` ;;
|
||||
*) b=$t ;;
|
||||
esac
|
||||
case $b in
|
||||
*.*) $CMD "$f" "$t"; exit ;;
|
||||
*) $CMD "$f" "$t".exe; exit ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
$CMD "$@"
|
||||
102
src/cmd/INIT/filter.sh
Normal file
102
src/cmd/INIT/filter.sh
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
########################################################################
|
||||
# #
|
||||
# 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> #
|
||||
# #
|
||||
########################################################################
|
||||
: 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 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[+NAME?filter - run a command in stdin/stdout mode]
|
||||
[+DESCRIPTION?\bfilter\b runs \acommand\a in a mode that takes input from
|
||||
the \afile\a operands, or from the standard input if no \afile\a
|
||||
operands are specified, and writes the results to the standard output.
|
||||
It can be used to run commands like \bsplit\b(1), that normally modify
|
||||
\afile\a operands in-place, in pipelines. The \afile\a operands are
|
||||
not modified; \acommand\a is run on copies in \b/tmp\b.]
|
||||
|
||||
command [ option ... ] [ file ... ]
|
||||
|
||||
[+SEE ALSO?\bstrip\b(1)]
|
||||
'
|
||||
;;
|
||||
*) ARGV0=""
|
||||
USAGE="command [ option ... ] [ file ... ]"
|
||||
;;
|
||||
esac
|
||||
|
||||
usage()
|
||||
{
|
||||
OPTIND=0
|
||||
getopts $ARGV0 "$USAGE" OPT '-?'
|
||||
exit 2
|
||||
}
|
||||
|
||||
while getopts $ARGV0 "$USAGE" OPT
|
||||
do case $OPT in
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
shift `expr $OPTIND - 1`
|
||||
case $# in
|
||||
0) usage ;;
|
||||
esac
|
||||
|
||||
cmd=$1
|
||||
while :
|
||||
do shift
|
||||
case $# in
|
||||
0) break ;;
|
||||
esac
|
||||
case $1 in
|
||||
-*) cmd="$cmd $1" ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
trap 'rm -f $tmp$suf' 0 1 2 3 15
|
||||
case $# in
|
||||
0) cat > $tmp
|
||||
$cmd $tmp
|
||||
;;
|
||||
*) for file
|
||||
do suf=${file##*/}
|
||||
case $suf in
|
||||
*.*) suf=.${suf#*.} ;;
|
||||
*) suf= ;;
|
||||
esac
|
||||
cp $file $tmp$suf || exit 1
|
||||
chmod u+rwx $tmp$suf || exit 1
|
||||
$cmd $tmp$suf || exit 1
|
||||
cat $tmp$suf
|
||||
rm -f $tmp$suf
|
||||
done
|
||||
;;
|
||||
esac
|
||||
37
src/cmd/INIT/gdbm.c
Normal file
37
src/cmd/INIT/gdbm.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <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;
|
||||
}
|
||||
37
src/cmd/INIT/gdbm1.c
Normal file
37
src/cmd/INIT/gdbm1.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <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;
|
||||
}
|
||||
37
src/cmd/INIT/gdbm2.c
Normal file
37
src/cmd/INIT/gdbm2.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <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;
|
||||
}
|
||||
23
src/cmd/INIT/hello.c
Normal file
23
src/cmd/INIT/hello.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#ifndef printf
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
int main() { int new = 0; printf("hello world\n"); return new;}
|
||||
6
src/cmd/INIT/hosttype.tst
Normal file
6
src/cmd/INIT/hosttype.tst
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
hp.pa hostname 9000/730 hp9000s700 HP-UX hostname A.09.01 A
|
||||
linux-aout.i386 hostname i586 i386 linux hostname 1.1.59 #1
|
||||
sgi.mips2 hostname.domain IP22 mips IRIX hostname 5.2 02282016
|
||||
osf.alpha hostname.domain alpha alpha OSF1 hostname.domain V3.2 62
|
||||
sun4 hostname.domain sun4 sparc SunOS hostname.domain 4.1.1 1 sun4c
|
||||
sol.sun4 hostname.domain sun4 sparc SunOS hostname.domain 5.4 Generic_101945-13
|
||||
209
src/cmd/INIT/hurl.sh
Normal file
209
src/cmd/INIT/hurl.sh
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
########################################################################
|
||||
# #
|
||||
# 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> #
|
||||
# #
|
||||
########################################################################
|
||||
: copy http url data
|
||||
|
||||
(command set -o posix) 2>/dev/null && set -o posix
|
||||
|
||||
command=hurl
|
||||
agent="$command/2009-01-20 (AT&T Research)"
|
||||
authorize=
|
||||
verbose=0
|
||||
|
||||
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
0123) ARGV0="-a $command"
|
||||
USAGE=$'
|
||||
[-?
|
||||
@(#)$Id: hurl (AT&T Research) 2009-01-20 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[+NAME?hurl - copy http url data]
|
||||
[+DESCRIPTION?\bhurl\b copies the data for the \bhttp\b \aurl\a operand
|
||||
to the standard output. The \aurl\a must be of the form
|
||||
\b[http://]]\b\ahost\a[\b:\b\aport\a]]\b/\b\apath\a. The default
|
||||
\aport\a is \b80\b.]
|
||||
[+?\bhurl\b is a shell script that attempts to access the \aurl\a by
|
||||
these methods:]{
|
||||
[+/dev/tcp/\ahost\a\b/80\b?Supported by \bksh\b(1) and recent
|
||||
\bbash\b(1).]
|
||||
[+wget -nv -O - \aurl\a?]
|
||||
[+lynx -source \aurl\a?]
|
||||
[+curl -s -L -o - \aurl\a?]
|
||||
}
|
||||
[a:authorize?The url authorization user name and password, separated
|
||||
by \b:\b (one colon character.)]:[user::password]
|
||||
[s:size?Terminate the data transmission after \abytes\a have been
|
||||
transferred.]:[bytes]
|
||||
[v:verbose?Verbose trace.]
|
||||
|
||||
url
|
||||
|
||||
[+SEE ALSO?\bcurl\b(1), \blynx\b(1), \bwget\b(1)]
|
||||
'
|
||||
;;
|
||||
*) ARGV0=""
|
||||
USAGE="a:v"
|
||||
;;
|
||||
esac
|
||||
|
||||
usage()
|
||||
{
|
||||
OPTIND=0
|
||||
getopts $ARGV0 "$USAGE" OPT '-?'
|
||||
exit 2
|
||||
}
|
||||
|
||||
integer limit=0 total=0 block=8*1024
|
||||
|
||||
while getopts $ARGV0 "$USAGE" OPT
|
||||
do case $OPT in
|
||||
a) authorize=$OPTARG ;;
|
||||
s) limit=$OPTARG ;;
|
||||
v) verbose=1 ;;
|
||||
esac
|
||||
done
|
||||
shift `expr $OPTIND - 1`
|
||||
|
||||
url=$1
|
||||
AUTHORIZE=
|
||||
|
||||
exec 9<&0
|
||||
|
||||
while :
|
||||
do test 0 != $verbose && echo "$command: url=$url" >&2
|
||||
case $url in
|
||||
*://*/*)prot=${url%%:*}
|
||||
url=${url#*://}
|
||||
;;
|
||||
*) prot=http
|
||||
;;
|
||||
esac
|
||||
host=$url
|
||||
path=/${host#*/}
|
||||
host=${host%%/*}
|
||||
case $host in
|
||||
*:+([0-9]))
|
||||
port=${host##*:}
|
||||
host=${host%:*}
|
||||
;;
|
||||
*) port=80
|
||||
;;
|
||||
esac
|
||||
test 0 != $verbose && echo "$command: prot=$prot host=$host port=$port path=$path" >&2
|
||||
case $prot in
|
||||
http) if (eval "exec >" || exit 0) 2>/dev/null &&
|
||||
eval "exec 8<> /dev/tcp/\$host/$port" 2>/dev/null
|
||||
then test 0 != $verbose && echo "$command: using /dev/tcp/$host/$port" >&2
|
||||
if ! echo "GET $path HTTP/1.0
|
||||
Host: $host
|
||||
User-Agent: $agent
${AUTHORIZE}
|
||||
" >&8
|
||||
then echo "$command: $host: write error"
|
||||
exit 1
|
||||
fi
|
||||
{
|
||||
if ! read prot code text
|
||||
then echo "$command: $host: read error" >&2
|
||||
exit 1
|
||||
fi
|
||||
code=${code%:*}
|
||||
type=Basic
|
||||
realm=access
|
||||
test 0 != $verbose && echo "$command: prot=$prot code=$code $text" >&2
|
||||
while :
|
||||
do if ! read head data
|
||||
then echo "$command: $host: read error" >&2
|
||||
exit 1
|
||||
fi
|
||||
test 0 != $verbose && echo "$command: head=$head $data" >&2
|
||||
case $head in
|
||||
Location:)
|
||||
case $code in
|
||||
30[123])url=$data
|
||||
continue 2
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
WWW-Authenticate:)
|
||||
set -- $data
|
||||
type=$1
|
||||
shift
|
||||
eval "$@"
|
||||
realm=${realm%$'\r'}
|
||||
;;
|
||||
''|?) break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
case $code in
|
||||
200) if (( limit ))
|
||||
then (( limit = (limit + block - 1) / block))
|
||||
dd bs=$block count=$limit silent=1
|
||||
else cat
|
||||
fi
|
||||
exit
|
||||
;;
|
||||
401) {
|
||||
if [[ $AUTHORIZE || $type != Basic ]]
|
||||
then print authorization failed
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! $authorize ]]
|
||||
then if [[ ! -t 0 ]]
|
||||
then print authorization failed
|
||||
exit 1
|
||||
fi
|
||||
print -n "Enter user name for $realm: "
|
||||
read -u9 user
|
||||
print -n "Password: "
|
||||
trap 'stty echo <&9' 0 1 2 3 15
|
||||
stty -echo
|
||||
read password
|
||||
stty echo
|
||||
print
|
||||
trap - 0 1 2 3 15
|
||||
authorize=$user:$password
|
||||
fi
|
||||
AUTHORIZE=$'\nAuthorization: '$type' '$(print -n -r -- "$authorize" | uuencode -h -x base64)$'\r'
|
||||
} <&9 >&2
|
||||
continue 2
|
||||
;;
|
||||
*) echo "$0: $url: $code: $text" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
} <&8
|
||||
elif wget ${authorize:+--http-user="${authorize%:*}"} ${password:+--http-passwd="${password##*:}"} -nv -O - $url 2>/dev/null
|
||||
then test 0 != $verbose && echo "$command: using wget" >&2
|
||||
exit
|
||||
elif lynx ${authorize:+-auth "$authorize"} -source $url 2>/dev/null
|
||||
then test 0 != $verbose && echo "$command: using wget" >&2
|
||||
exit
|
||||
elif curl ${authorize:+-u "$authorize"} -s -L -o - $url 2>/dev/null
|
||||
then test 0 != $verbose && echo "$command: using curl" >&2
|
||||
exit
|
||||
else echo "$command: $url: { /dev/tcp/$host/$port wget curl } failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*) echo "$command: $prot: protocol not supported" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
29
src/cmd/INIT/iconv.c
Normal file
29
src/cmd/INIT/iconv.c
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#ifndef iconv
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
iconv(0, 0, 0, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
4674
src/cmd/INIT/iffe.sh
Normal file
4674
src/cmd/INIT/iffe.sh
Normal file
File diff suppressed because it is too large
Load diff
1945
src/cmd/INIT/iffe.tst
Normal file
1945
src/cmd/INIT/iffe.tst
Normal file
File diff suppressed because it is too large
Load diff
42
src/cmd/INIT/ignore.sh
Normal file
42
src/cmd/INIT/ignore.sh
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
########################################################################
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
# #
|
||||
# A copy of the License is available at #
|
||||
# http://www.eclipse.org/org/documents/epl-v10.html #
|
||||
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
||||
# #
|
||||
# Information and Software Systems Research #
|
||||
# AT&T Research #
|
||||
# Florham Park NJ #
|
||||
# #
|
||||
# Glenn Fowler <gsf@research.att.com> #
|
||||
# #
|
||||
########################################################################
|
||||
# non-ksh script for the nmake ignore prefix
|
||||
# @(#)ignore (AT&T Research) 1992-08-11
|
||||
|
||||
(command set -o posix) 2>/dev/null && set -o posix
|
||||
modern_export=`v=; export v=ok 2>/dev/null; echo "$v"`
|
||||
|
||||
while :
|
||||
do case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
case $1 in
|
||||
*=*) case $modern_export in
|
||||
ok) export "$1" ;;
|
||||
*) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;;
|
||||
esac
|
||||
shift
|
||||
;;
|
||||
*) break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@"
|
||||
exit 0
|
||||
29
src/cmd/INIT/intl.c
Normal file
29
src/cmd/INIT/intl.c
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#ifndef gettext
|
||||
#include <libintl.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
gettext(0);
|
||||
return 0;
|
||||
}
|
||||
5
src/cmd/INIT/ld.hp.pa
Executable file
5
src/cmd/INIT/ld.hp.pa
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
: hp.pa ld wrapper for reasonable warning defaults
|
||||
|
||||
# @(#)ld.hp.pa (AT&T Labs Research) 1998-01-23
|
||||
|
||||
/bin/ld +s +vnocompatwarnings "$@"
|
||||
22
src/cmd/INIT/ldd.cygwin.i386
Executable file
22
src/cmd/INIT/ldd.cygwin.i386
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/env sh
|
||||
: cygwin.i386 ldd -- how many ways does this confirm the windows bias?
|
||||
for f
|
||||
do case $f in
|
||||
*.exe) ;;
|
||||
*) f=$f.exe ;;
|
||||
esac
|
||||
p=$(type $f)
|
||||
case $p in
|
||||
*" not found"*)
|
||||
;;
|
||||
*) p=${p##* }
|
||||
case $p in
|
||||
?*) f=$p ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
cygcheck $(cygpath -aw $f) |
|
||||
for w in $(sed -e 's/^[[:space:]]*//' -e '/^$/d' -e '/^Use /d')
|
||||
do cygpath -u "$w"
|
||||
done
|
||||
done
|
||||
2
src/cmd/INIT/ldd.darwin
Executable file
2
src/cmd/INIT/ldd.darwin
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
: mac os10 ldd
|
||||
otool -L "$@"
|
||||
21
src/cmd/INIT/ldd.hp.pa
Executable file
21
src/cmd/INIT/ldd.hp.pa
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
: hp.pa ldd
|
||||
while :
|
||||
do case $# in
|
||||
0) break ;;
|
||||
esac
|
||||
case $1 in
|
||||
-*|+*) ;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
trap ':' 15
|
||||
for cmd
|
||||
do case $# in
|
||||
1) ;;
|
||||
*) echo $cmd: ;;
|
||||
esac
|
||||
_HP_DLDOPTS=-ldd "$cmd" < /dev/null 2> /dev/null | sort -u
|
||||
# chatr "$cmd" |
|
||||
# sed -e '/^[ ]*dynamic[ ][ ]*/!d' -e 's// /'
|
||||
done
|
||||
16
src/cmd/INIT/ldd.ibm.risc
Executable file
16
src/cmd/INIT/ldd.ibm.risc
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
: ibm.risc ldd
|
||||
case $# in
|
||||
1) header=0 ;;
|
||||
*) header=1 ;;
|
||||
esac
|
||||
for file
|
||||
do case $header in
|
||||
1) echo "$file:"
|
||||
header=2
|
||||
;;
|
||||
2) echo
|
||||
echo "$file:"
|
||||
;;
|
||||
esac
|
||||
dump -H "$file" | sed '1,/\*\*\*Import/d'
|
||||
done
|
||||
1
src/cmd/INIT/ldd.lynxos
Executable file
1
src/cmd/INIT/ldd.lynxos
Executable file
|
|
@ -0,0 +1 @@
|
|||
elflook -L "$@" | sed -e '/^NEEDED:/!d' -e 's/.*: *//'
|
||||
18
src/cmd/INIT/ldd.mvs.390
Executable file
18
src/cmd/INIT/ldd.mvs.390
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
: mvs.390 ldd
|
||||
case $# in
|
||||
1) header=0 ;;
|
||||
*) header=1 ;;
|
||||
esac
|
||||
for file
|
||||
do case $header in
|
||||
1) echo "$file:"
|
||||
header=2
|
||||
;;
|
||||
2) echo
|
||||
echo "$file:"
|
||||
;;
|
||||
esac
|
||||
strings $file |
|
||||
sed -e '/\<[[:lower:]][[:alnum:]]*\.dll\>/!d' -e 's/^/ /' |
|
||||
sort -u
|
||||
done
|
||||
2
src/cmd/INIT/ldd.sgi
Executable file
2
src/cmd/INIT/ldd.sgi
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
: sgi.mips ldd
|
||||
odump -Dl "$@"
|
||||
34
src/cmd/INIT/m.c
Normal file
34
src/cmd/INIT/m.c
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <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;
|
||||
}
|
||||
36
src/cmd/INIT/m2.c
Normal file
36
src/cmd/INIT/m2.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <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;
|
||||
}
|
||||
36
src/cmd/INIT/m3.c
Normal file
36
src/cmd/INIT/m3.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <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;
|
||||
}
|
||||
32
src/cmd/INIT/m4.c
Normal file
32
src/cmd/INIT/m4.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
/*
|
||||
* -lm test #4
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
double value = 0;
|
||||
|
||||
return isnan(value);
|
||||
}
|
||||
32
src/cmd/INIT/m5.c
Normal file
32
src/cmd/INIT/m5.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
/*
|
||||
* -lm test #5
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
long double value = 0;
|
||||
|
||||
return isnanl(value);
|
||||
}
|
||||
34
src/cmd/INIT/m6.c
Normal file
34
src/cmd/INIT/m6.c
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
/*
|
||||
* -lm test #6
|
||||
*/
|
||||
|
||||
#define _ISOC99_SOURCE 1
|
||||
|
||||
#include <math.h>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
double value = -0.0;
|
||||
|
||||
return !signbit(value);
|
||||
}
|
||||
2241
src/cmd/INIT/make.probe
Normal file
2241
src/cmd/INIT/make.probe
Normal file
File diff suppressed because it is too large
Load diff
2381
src/cmd/INIT/mamake.c
Normal file
2381
src/cmd/INIT/mamake.c
Normal file
File diff suppressed because it is too large
Load diff
40
src/cmd/INIT/mamake.rt
Normal file
40
src/cmd/INIT/mamake.rt
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
NOTE regression tests for the mamake command
|
||||
|
||||
UNIT mamake
|
||||
|
||||
TEST macros
|
||||
|
||||
DATA Mamfile <<'!'
|
||||
info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05
|
||||
setv DEFINED defined
|
||||
setv EMPTY
|
||||
make all
|
||||
|
||||
exec - echo DEFINED ${DEFINED}
|
||||
exec - echo DEFINED:VALUE ${DEFINED:VALUE}
|
||||
exec - echo DEFINED:-VALUE ${DEFINED:-VALUE}
|
||||
exec - echo DEFINED=VALUE ${DEFINED=VALUE}
|
||||
exec - echo DEFINED[VALUE] ${DEFINED[VALUE]}
|
||||
exec - echo DEFINED.COMPONENT ${DEFINED.COMPONENT}
|
||||
exec - echo DEFINED.COMPONENT[VALUE] ${DEFINED.COMPONENT[VALUE]}
|
||||
|
||||
exec - echo EMPTY ${EMPTY}
|
||||
exec - echo EMPTY:VALUE ${EMPTY:VALUE}
|
||||
exec - echo EMPTY:-VALUE ${EMPTY:-VALUE}
|
||||
exec - echo EMPTY=VALUE ${EMPTY=VALUE}
|
||||
exec - echo EMPTY[VALUE] ${EMPTY[VALUE]}
|
||||
exec - echo EMPTY.COMPONENT ${EMPTY.COMPONENT}
|
||||
exec - echo EMPTY.COMPONENT[VALUE] ${EMPTY.COMPONENT[VALUE]}
|
||||
|
||||
exec - echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__}
|
||||
exec - echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE}
|
||||
exec - echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE}
|
||||
exec - echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE}
|
||||
exec - echo __NoT_DeFiNeD__[VALUE] ${__NoT_DeFiNeD__[VALUE]}
|
||||
exec - echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT}
|
||||
exec - echo __NoT_DeFiNeD__.COMPONENT[VALUE] ${__NoT_DeFiNeD__.COMPONENT[VALUE]}
|
||||
|
||||
done all generated virtual
|
||||
!
|
||||
|
||||
EXEC -n
|
||||
63
src/cmd/INIT/mamake.tst
Normal file
63
src/cmd/INIT/mamake.tst
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# : : generated from mamake.rt by mktest : : #
|
||||
|
||||
# regression tests for the mamake command
|
||||
|
||||
UNIT mamake
|
||||
|
||||
TEST 01 macros
|
||||
|
||||
EXEC -n
|
||||
INPUT -n -
|
||||
INPUT Mamfile $'info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05
|
||||
setv DEFINED defined
|
||||
setv EMPTY
|
||||
make all
|
||||
|
||||
exec - echo DEFINED ${DEFINED}
|
||||
exec - echo DEFINED:VALUE ${DEFINED:VALUE}
|
||||
exec - echo DEFINED:-VALUE ${DEFINED:-VALUE}
|
||||
exec - echo DEFINED=VALUE ${DEFINED=VALUE}
|
||||
exec - echo DEFINED[VALUE] ${DEFINED[VALUE]}
|
||||
exec - echo DEFINED.COMPONENT ${DEFINED.COMPONENT}
|
||||
exec - echo DEFINED.COMPONENT[VALUE] ${DEFINED.COMPONENT[VALUE]}
|
||||
|
||||
exec - echo EMPTY ${EMPTY}
|
||||
exec - echo EMPTY:VALUE ${EMPTY:VALUE}
|
||||
exec - echo EMPTY:-VALUE ${EMPTY:-VALUE}
|
||||
exec - echo EMPTY=VALUE ${EMPTY=VALUE}
|
||||
exec - echo EMPTY[VALUE] ${EMPTY[VALUE]}
|
||||
exec - echo EMPTY.COMPONENT ${EMPTY.COMPONENT}
|
||||
exec - echo EMPTY.COMPONENT[VALUE] ${EMPTY.COMPONENT[VALUE]}
|
||||
|
||||
exec - echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__}
|
||||
exec - echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE}
|
||||
exec - echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE}
|
||||
exec - echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE}
|
||||
exec - echo __NoT_DeFiNeD__[VALUE] ${__NoT_DeFiNeD__[VALUE]}
|
||||
exec - echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT}
|
||||
exec - echo __NoT_DeFiNeD__.COMPONENT[VALUE] ${__NoT_DeFiNeD__.COMPONENT[VAL'\
|
||||
$'UE]}
|
||||
|
||||
done all generated virtual'
|
||||
OUTPUT - $'echo DEFINED defined
|
||||
echo DEFINED:VALUE
|
||||
echo DEFINED:-VALUE
|
||||
echo DEFINED=VALUE defined
|
||||
echo DEFINED[VALUE] ${DEFINED[VALUE]}
|
||||
echo DEFINED.COMPONENT
|
||||
echo DEFINED.COMPONENT[VALUE] ${DEFINED.COMPONENT[VALUE]}
|
||||
echo EMPTY
|
||||
echo EMPTY:VALUE ${EMPTY:VALUE}
|
||||
echo EMPTY:-VALUE ${EMPTY:-VALUE}
|
||||
echo EMPTY=VALUE
|
||||
echo EMPTY[VALUE] ${EMPTY[VALUE]}
|
||||
echo EMPTY.COMPONENT
|
||||
echo EMPTY.COMPONENT[VALUE] ${EMPTY.COMPONENT[VALUE]}
|
||||
echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__}
|
||||
echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE}
|
||||
echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE}
|
||||
echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE}
|
||||
echo __NoT_DeFiNeD__[VALUE] ${__NoT_DeFiNeD__[VALUE]}
|
||||
echo __NoT_DeFiNeD__.COMPONENT
|
||||
echo __NoT_DeFiNeD__.COMPONENT[VALUE] ${__NoT_DeFiNeD__.COMPONENT[VALUE]}'
|
||||
ERROR -n -
|
||||
273
src/cmd/INIT/mamprobe.sh
Normal file
273
src/cmd/INIT/mamprobe.sh
Normal file
|
|
@ -0,0 +1,273 @@
|
|||
########################################################################
|
||||
# #
|
||||
# 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> #
|
||||
# #
|
||||
########################################################################
|
||||
### 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
|
||||
83
src/cmd/INIT/mkdir.sh
Normal file
83
src/cmd/INIT/mkdir.sh
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
#!/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
|
||||
641
src/cmd/INIT/mktest.sh
Executable file
641
src/cmd/INIT/mktest.sh
Executable file
|
|
@ -0,0 +1,641 @@
|
|||
########################################################################
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
# #
|
||||
# A copy of the License is available at #
|
||||
# http://www.eclipse.org/org/documents/epl-v10.html #
|
||||
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
||||
# #
|
||||
# Information and Software Systems Research #
|
||||
# AT&T Research #
|
||||
# Florham Park NJ #
|
||||
# #
|
||||
# Glenn Fowler <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 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[+NAME?mktest - generate a regression test scripts]
|
||||
[+DESCRIPTION?\bmktest\b generates regression test scripts from test
|
||||
template commands in the \aunit\a.\brt\b file. The generated test
|
||||
script writes temporary output to '$PREFIX$'\aunit\a.tmp and compares
|
||||
it to the expected output in '$PREFIX$'\aunit\a.out. Run the test
|
||||
script with the \b--accept\b option to (re)generate the
|
||||
'$PREFIX$'\aunit\a.out.]
|
||||
[s:style?The script style:]:[style:='$STYLE$']
|
||||
{
|
||||
[+regress?\bregress\b(1) command input.]
|
||||
[+shell?Standalone test shell script.]
|
||||
}
|
||||
[w:width?Set the output format width to approximately
|
||||
\awidth\a.]:[width:='$WIDTH$']
|
||||
|
||||
unit.rt [ unit [ arg ... ] ]
|
||||
|
||||
[+INPUT FILES?The regression test command file \aunit\a\b.rt\b is a
|
||||
\bksh\b(1) script that makes calls to the following functions:]
|
||||
{
|
||||
[+DATA \afile\a [ - | [ options ]] data]]?Create input data
|
||||
\afile\a that is empty (-) or contains \adata\a subject to
|
||||
\bprint\b(1) \aoptions\a or that is a copy of the DATA command
|
||||
standard input. Set \afile\a to \b-\b to name the standard
|
||||
input.]
|
||||
[+DIAGNOSTICS?Diagnostic messages of unspecified format are
|
||||
expected.]
|
||||
[+DO \acommand\a [ \aarg\a ... ]]?Execute \acommand\a if the
|
||||
current test is active.]
|
||||
[+EXEC [ \aarg\a ... ]]?Run the command under test with
|
||||
optional arguments. If the standard input is not specified then
|
||||
the standard input of the previous EXEC is used. The standard
|
||||
input of the first EXEC in a TEST group is an empty regular
|
||||
file.]
|
||||
[+EXPORT \aname\a=\avalue\a ...?Export list for subsequent
|
||||
commands in the TEST group or for all TEST groups if before
|
||||
the first TEST group.]
|
||||
[+IGNORESPACE [ 0 | 1 ]
|
||||
?Ignore space differences when comparing expected output.]
|
||||
[+KEEP \apattern\a ...?File match patterns of files to retain
|
||||
between TEST groups.]
|
||||
[+NOTE \acomment\a?\acomment\a is added to the current test
|
||||
script.]
|
||||
[+PROG \acommand\a [ \aarg\a ... ]]?Run \acommand\a with
|
||||
optional arguments.]
|
||||
[+TEST [ \anumber\a ]] [ \adescription\a ... ]]?Define a new
|
||||
test group with optional \anumber\a and \adescripion\a.]
|
||||
[+TWD [ \adir\a ... ]]?Set the temporary test dir to \adir\a.
|
||||
The default is \aunit\a\b.tmp\b, where \aunit\a is the test
|
||||
input file sans directory and suffix. If \adir\a matches \b/*\b
|
||||
then it is the directory name; if \adir\a is non-null then the
|
||||
prefix \b${TMPDIR:-/tmp}\b is added; otherwise if \adir\a is
|
||||
omitted then
|
||||
\b${TMPDIR:-/tmp}/tst-\b\aunit\a-$$-$RANDOM.\b\aunit\a is
|
||||
used.]
|
||||
[+UMASK [ \amask\a ]]?Run subsequent tests with \bumask\b(1)
|
||||
\amask\a. If \amask\a is omitted then the original \bumask\b is
|
||||
used.]
|
||||
[+UNIT \acommand\a [ \aarg\a ... ]]?Define the command and
|
||||
optional default arguments to be tested. \bUNIT\b explicitly
|
||||
overrides the default command name derived from the test script
|
||||
file name.]
|
||||
[+WIDTH \awidth\a?Set the output format width to approximately
|
||||
\awidth\a.]
|
||||
}
|
||||
[+SEE ALSO?\bregress\b(1), \bksh\b(1)]
|
||||
'
|
||||
;;
|
||||
*) ARGV0=""
|
||||
USAGE='s: unit.rt [ arg ... ]'
|
||||
;;
|
||||
esac
|
||||
|
||||
typeset ARG SCRIPT UNIT TEMP=${TMPDIR:-/tmp}/$command.$$.tmp WORK
|
||||
typeset IO INPUT INPUT_N OUTPUT OUTPUT_N ERROR ERROR_N KEEP
|
||||
typeset -C STATE
|
||||
typeset -A DATA STATE.RESET REMOVE FORMAT
|
||||
integer KEEP_UNIT=0 SCRIPT_UNIT=0 TEST=0 CODE=0 EXIT=0 ACCEPT=0 DIAGNOSTICS=0 code
|
||||
|
||||
while getopts $ARGV0 "$USAGE" OPT
|
||||
do case $OPT in
|
||||
s) case $OPTARG in
|
||||
regress|shell)
|
||||
STYLE=$OPTARG
|
||||
;;
|
||||
*) print -u2 -r -- $command: --style=$OPTARG: regress or shell expected
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
w) WIDTH=$OPTARG
|
||||
;;
|
||||
*) OPTIND=0
|
||||
getopts $ARGV0 "$USAGE" OPT '-?'
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $OPTIND-1
|
||||
|
||||
typeset SINGLE= quote='%${SINGLE}..${WIDTH}q'
|
||||
|
||||
if [[ $1 == - ]]
|
||||
then shift
|
||||
fi
|
||||
if (( ! $# ))
|
||||
then
|
||||
print -u2 -r -- $command: test command script path expected
|
||||
exit 1
|
||||
fi
|
||||
SCRIPT=$1
|
||||
shift
|
||||
if [[ ! -r $SCRIPT ]]
|
||||
then print -u2 -r -- $command: $SCRIPT: cannot read
|
||||
exit 1
|
||||
fi
|
||||
(ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0
|
||||
if (( $# ))
|
||||
then set -A UNIT -- "$@"
|
||||
KEEP_UNIT=1
|
||||
else ARG=${SCRIPT##*/}
|
||||
set -A UNIT -- "${ARG%.*}"
|
||||
fi
|
||||
WORK=${UNIT[0]}.tmp
|
||||
rm -rf $WORK
|
||||
mkdir $WORK || exit
|
||||
export PATH=$PWD:$PATH
|
||||
|
||||
function LINE
|
||||
{
|
||||
if [[ $STYLE == regress ]]
|
||||
then print -u$stdout
|
||||
fi
|
||||
}
|
||||
|
||||
function NOTE
|
||||
{
|
||||
case $STYLE in
|
||||
regress)LINE
|
||||
print -u$stdout -r -- '#' "$@"
|
||||
;;
|
||||
shell) print -u$stdout -r -f ": $QUOTE"$'\n' -- "$*"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function UNIT
|
||||
{
|
||||
(( KEEP_UNIT )) || set -A UNIT -- "$@"
|
||||
case $STYLE in
|
||||
regress)LINE
|
||||
print -u$stdout -r -f $'UNIT'
|
||||
for ARG in "$@"
|
||||
do print -u$stdout -r -f " $QUOTE" -- "$ARG"
|
||||
done
|
||||
print -u$stdout
|
||||
;;
|
||||
shell) print -u$stdout -r -f $'set x'
|
||||
for ARG in "$@"
|
||||
do print -u$stdout -r -f " $QUOTE" -- "$ARG"
|
||||
done
|
||||
print -u$stdout
|
||||
print -u$stdout shift
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function TEST
|
||||
{
|
||||
typeset i
|
||||
typeset -A REM
|
||||
if (( ${#STATE.RESET[@]} ))
|
||||
then unset ${!STATE.RESET[@]}
|
||||
case $STYLE in
|
||||
shell) print -u$stdout -r -- unset ${!STATE.RESET[@]} ;;
|
||||
esac
|
||||
unset STATE.RESET
|
||||
typeset -A STATE.RESET
|
||||
fi
|
||||
if (( ${#REMOVE[@]} ))
|
||||
then rm -f -- "${!REMOVE[@]}"
|
||||
case $STYLE in
|
||||
shell) print -u$stdout -r -f $'rm -f'
|
||||
for i in ${!REMOVE[@]}
|
||||
do print -u$stdout -r -f " $QUOTE" "$i"
|
||||
done
|
||||
print -u$stdout
|
||||
;;
|
||||
esac
|
||||
for i in ${!REMOVE[@]}
|
||||
do unset REMOVE[$i]
|
||||
done
|
||||
fi
|
||||
rm -rf $WORK/*
|
||||
if [[ $1 == +([0-9]) ]]
|
||||
then TEST=${1##0}
|
||||
shift
|
||||
else ((TEST++))
|
||||
fi
|
||||
LINE
|
||||
case $STYLE in
|
||||
regress)print -u$stdout -r -f "TEST %02d $QUOTE"$'\n' -- $TEST "$*"
|
||||
;;
|
||||
shell) print -u$stdout -r -f ": TEST %02d $QUOTE"$'\n' -- $TEST "$*"
|
||||
;;
|
||||
esac
|
||||
: > $TEMP.INPUT > $TEMP.in
|
||||
INPUT=
|
||||
INPUT_N=
|
||||
OUTPUT=
|
||||
OUTPUT_N=
|
||||
ERROR=
|
||||
ERROR_N=
|
||||
UMASK=$UMASK_ORIG
|
||||
UMASK_DONE=$UMASK
|
||||
CODE=0
|
||||
}
|
||||
|
||||
function TWD
|
||||
{
|
||||
case $STYLE in
|
||||
regress)LINE
|
||||
print -u$stdout -r -f $'TWD'
|
||||
for ARG in "$@"
|
||||
do print -u$stdout -r -f " $QUOTE" -- "$ARG"
|
||||
done
|
||||
print -u$stdout
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function RUN
|
||||
{
|
||||
typeset i n p op unit sep output=1 error=1 exitcode=1
|
||||
op=$1
|
||||
shift
|
||||
while :
|
||||
do case $1 in
|
||||
++NOOUTPUT) output= ;;
|
||||
++NOERROR) error= ;;
|
||||
++NOEXIT) exitcode= ;;
|
||||
++*) print -u2 -r -- $command: $0: $1: unknown option; exit 1 ;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if [[ $op == PROG ]]
|
||||
then unit=$1
|
||||
shift
|
||||
elif (( ! ${#UNIT[@]} ))
|
||||
then print -u2 -r -- $command: $SCRIPT: UNIT statement or operand expected
|
||||
exit 1
|
||||
fi
|
||||
LINE
|
||||
case $STYLE in
|
||||
regress)if [[ $op == PROG ]]
|
||||
then print -u$stdout -r -f $'\t'"$op"$'\t'"$unit"
|
||||
sep=$' '
|
||||
else print -u$stdout -r -f $'\t'"$op"
|
||||
sep=$'\t'
|
||||
fi
|
||||
for ARG in "$@"
|
||||
do LC_CTYPE=C print -u$stdout -r -f "$sep$QUOTE" -- "$ARG"
|
||||
sep=$' '
|
||||
done
|
||||
print -u$stdout
|
||||
[[ ${DATA[-]} || /dev/fd/0 -ef /dev/fd/$stdin ]] || cat > $TEMP.in
|
||||
IO=$(cat $TEMP.in; print :)
|
||||
if [[ $IO == ?*$'\n:' ]]
|
||||
then IO=${IO%??}
|
||||
n=
|
||||
else IO=${IO%?}
|
||||
n=-n
|
||||
fi
|
||||
{
|
||||
[[ $UMASK != $UMASK_ORIG ]] && umask $UMASK
|
||||
cd $WORK
|
||||
if [[ $op == PROG ]]
|
||||
then "$unit" "$@"
|
||||
code=$?
|
||||
else "${UNIT[@]}" "$@"
|
||||
code=$?
|
||||
fi
|
||||
cd ..
|
||||
[[ $UMASK != $UMASK_ORIG ]] && umask $UMASK_ORIG
|
||||
} < $TEMP.in > $TEMP.out 2> $TEMP.err
|
||||
if [[ $IO != "$INPUT" || $n != "$INPUT_N" ]]
|
||||
then INPUT=$IO
|
||||
INPUT_N=$n
|
||||
if [[ ${FORMAT[-]} ]]
|
||||
then print -u$stdout -n -r -- $'\t\tINPUT'
|
||||
print -u$stdout -r -f " $QUOTE" -- "${FORMAT[-]}"
|
||||
print -u$stdout -r -f " $QUOTE" -- -
|
||||
unset FORMAT[-]
|
||||
else print -u$stdout -n -r -- $'\t\tINPUT' $n -
|
||||
[[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO"
|
||||
fi
|
||||
print -u$stdout
|
||||
unset DATA[-]
|
||||
fi
|
||||
for i in ${!DATA[@]}
|
||||
do if [[ ${FORMAT[$i]} ]]
|
||||
then print -u$stdout -n -r -- $'\t\tINPUT'
|
||||
print -u$stdout -r -f " $QUOTE" -- "${FORMAT[$i]}"
|
||||
print -u$stdout -r -f " $QUOTE" -- "$i"
|
||||
unset FORMAT[$i]
|
||||
else case $i in
|
||||
-) p=$TEMP.in ;;
|
||||
*) p=$WORK/$i ;;
|
||||
esac
|
||||
IO=$(cat $p; print :)
|
||||
if [[ $IO == ?*$'\n:' ]]
|
||||
then IO=${IO%??}
|
||||
n=
|
||||
else IO=${IO%?}
|
||||
n=-n
|
||||
fi
|
||||
print -u$stdout -n -r -- $'\t\tINPUT' $n
|
||||
print -u$stdout -r -f " $QUOTE" -- "$i"
|
||||
[[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO"
|
||||
fi
|
||||
print -u$stdout
|
||||
unset DATA[$i]
|
||||
done
|
||||
IO=$(cat $TEMP.out; print :)
|
||||
if [[ $IO == ?*$'\n:' ]]
|
||||
then IO=${IO%??}
|
||||
n=
|
||||
else IO=${IO%?}
|
||||
n=-n
|
||||
fi
|
||||
if [[ $IO != "$OUTPUT" || $n != "$OUTPUT_N" ]]
|
||||
then OUTPUT=$IO
|
||||
OUTPUT_N=$n
|
||||
if [[ $output ]]
|
||||
then if [[ ! -s $TEMP.out ]]
|
||||
then print -u$stdout -n -r -- $'\t\tOUTPUT' -
|
||||
elif cmp -s $TEMP.in $TEMP.out
|
||||
then OUTPUT=not-$OUTPUT
|
||||
print -u$stdout -n -r -- $'\t\tSAME OUTPUT INPUT'
|
||||
else print -u$stdout -n -r -- $'\t\tOUTPUT' $n -
|
||||
[[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO"
|
||||
fi
|
||||
print -u$stdout
|
||||
fi
|
||||
fi
|
||||
IO=$(cat $TEMP.err; print :)
|
||||
IO=${IO//$command\[*([0-9])\]:\ .\[*([0-9])\]:\ @(EXEC|PROG)\[*([0-9])\]:\ /}
|
||||
if [[ $IO == ?*$'\n:' ]]
|
||||
then IO=${IO%??}
|
||||
n=
|
||||
else IO=${IO%?}
|
||||
n=-n
|
||||
fi
|
||||
if [[ $IO != "$ERROR" || $n != "$ERROR_N" ]]
|
||||
then ERROR=$IO
|
||||
ERROR_N=$n
|
||||
if [[ $error ]]
|
||||
then print -u$stdout -n -r -- $'\t\tERROR' $n -
|
||||
[[ $IO ]] && LC_CTYPE=C print -u$stdout -r -f " $QUOTE" -- "$IO"
|
||||
print -u$stdout
|
||||
fi
|
||||
fi
|
||||
case $output:$error in
|
||||
:) OUTPUT=
|
||||
OUTPUT_N=
|
||||
ERROR=
|
||||
ERROR_N=
|
||||
print -u$stdout -r -- $'\t\tIGNORE OUTPUT ERROR'
|
||||
;;
|
||||
:1) OUTPUT=
|
||||
OUTPUT_N=
|
||||
print -u$stdout -r -- $'\t\tIGNORE OUTPUT'
|
||||
;;
|
||||
1:) ERROR=
|
||||
ERROR_N=
|
||||
print -u$stdout -r -- $'\t\tIGNORE ERROR'
|
||||
;;
|
||||
esac
|
||||
if [[ $UMASK_DONE != $UMASK ]]
|
||||
then UMASK_DONE=$UMASK
|
||||
print -u$stdout -r -f $'\t\tUMASK %s\n' $UMASK
|
||||
fi
|
||||
if (( code != CODE ))
|
||||
then (( CODE=code ))
|
||||
if [[ $exitcode ]]
|
||||
then print -u$stdout -r -f $'\t\tEXIT %d\n' $CODE
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
shell) [[ $UMASK != $UMASK_ORIG ]] && print -u$stdout -r -f "{ umask $UMASK; "
|
||||
if [[ $op == PROG ]]
|
||||
then print -u$stdout -r -f $'"'"$unit"$'"'
|
||||
else print -u$stdout -r -f $'"$@"'
|
||||
fi
|
||||
for ARG in "$@"
|
||||
do print -u$stdout -r -f " $QUOTE" -- "$ARG"
|
||||
done
|
||||
[[ $UMASK != $UMASK_ORIG ]] && print -u$stdout -r -f "umask $UMASK_ORIG; } "
|
||||
if [[ ! $output ]]
|
||||
then print -u$stdout -r -f " >/dev/null"
|
||||
fi
|
||||
if [[ ! $error ]]
|
||||
then if [[ ! $output ]]
|
||||
then print -u$stdout -r -f " 2>&1"
|
||||
else print -u$stdout -r -f " 2>/dev/null"
|
||||
fi
|
||||
fi
|
||||
IO=$(cat)
|
||||
if [[ $IO ]]
|
||||
then print -u$stdout -r -- "<<'!TEST-INPUT!'"
|
||||
print -u$stdout -r -- "$IO"
|
||||
print -u$stdout -r -- !TEST-INPUT!
|
||||
else print -u$stdout
|
||||
fi
|
||||
if [[ $exitcode ]]
|
||||
then print -u$stdout -r -- $'CODE=$?\ncase $CODE in\n0) ;;\n*) echo exit status $CODE ;;\nesac'
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function DO
|
||||
{
|
||||
LINE
|
||||
print -r $'\t'DO "$@"
|
||||
}
|
||||
|
||||
function EXEC
|
||||
{
|
||||
RUN EXEC "$@"
|
||||
}
|
||||
|
||||
function DATA
|
||||
{
|
||||
typeset f p o
|
||||
f=$1
|
||||
shift
|
||||
case $f in
|
||||
-) p=$TEMP.in ;;
|
||||
*) p=$WORK/$f ;;
|
||||
esac
|
||||
case $1 in
|
||||
'') cat ;;
|
||||
-) ;;
|
||||
*) print -r "$@" ;;
|
||||
esac > $p
|
||||
DATA[$f]=1
|
||||
if (( $# == 1 )) && [[ $1 == -?* ]]
|
||||
then FORMAT[$f]=$1
|
||||
else FORMAT[$f]=
|
||||
fi
|
||||
if [[ $f != $KEEP ]]
|
||||
then REMOVE[$f]=1
|
||||
fi
|
||||
if [[ $STYLE == shell ]]
|
||||
then {
|
||||
print -r -f "cat > $QUOTE <<'!TEST-INPUT!'"$'\n' -- "$f"
|
||||
cat "$p"
|
||||
print -r -- !TEST-INPUT!
|
||||
} >&$stdout
|
||||
fi
|
||||
}
|
||||
|
||||
function KEEP
|
||||
{
|
||||
typeset p
|
||||
for p
|
||||
do if [[ $KEEP ]]
|
||||
then KEEP=$KEEP'|'
|
||||
fi
|
||||
KEEP=$KEEP$p
|
||||
done
|
||||
}
|
||||
|
||||
function DIAGNOSTICS
|
||||
{
|
||||
LINE
|
||||
case $STYLE in
|
||||
regress) print -u$stdout -r $'DIAGNOSTICS' ;;
|
||||
shell) DIAGNOSTICS=1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
function EXPORT
|
||||
{
|
||||
typeset x n v
|
||||
LINE
|
||||
case $STYLE in
|
||||
regress) print -u$stdout -r -f $'EXPORT' ;;
|
||||
shell) print -u$stdout -r -f $'export' ;;
|
||||
esac
|
||||
for x
|
||||
do n=${x%%=*}
|
||||
v=${x#*=}
|
||||
export "$x"
|
||||
print -u$stdout -r -f " %s=$QUOTE" "$n" "$v"
|
||||
(( TEST )) && STATE.RESET["$n"]=1
|
||||
done
|
||||
print -u$stdout
|
||||
}
|
||||
|
||||
function PROG
|
||||
{
|
||||
RUN PROG "$@"
|
||||
}
|
||||
|
||||
function WIDTH
|
||||
{
|
||||
WIDTH=${1:-80}
|
||||
eval QUOTE='"'$quote'"'
|
||||
}
|
||||
|
||||
function IGNORESPACE
|
||||
{
|
||||
IGNORESPACE=-b
|
||||
LINE
|
||||
print -u$stdout -r IGNORESPACE
|
||||
}
|
||||
|
||||
function UMASK # [ mask ]
|
||||
{
|
||||
[[ $UMASK_ORIG ]] || UMASK_ORIG=$(umask)
|
||||
UMASK=$1
|
||||
[[ $UMASK ]] || UMASK=$UMASK_ORIG
|
||||
}
|
||||
|
||||
trap 'CODE=$?; rm -rf $TEMP.* $WORK; exit $CODE' 0 1 2 3 15
|
||||
|
||||
typeset IGNORESPACE UMASK UMASK_ORIG UMASK_DONE
|
||||
UMASK_ORIG=$(umask)
|
||||
IFS=$IFS$'\n'
|
||||
|
||||
print -u$stdout -r "# : : generated from $SCRIPT by $command : : #"
|
||||
case $STYLE in
|
||||
shell) cat <<!
|
||||
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
|
||||
30
src/cmd/INIT/mprobe.sh
Normal file
30
src/cmd/INIT/mprobe.sh
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
########################################################################
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
# #
|
||||
# A copy of the License is available at #
|
||||
# http://www.eclipse.org/org/documents/epl-v10.html #
|
||||
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
||||
# #
|
||||
# Information and Software Systems Research #
|
||||
# AT&T Research #
|
||||
# Florham Park NJ #
|
||||
# #
|
||||
# Glenn Fowler <gsf@research.att.com> #
|
||||
# #
|
||||
########################################################################
|
||||
: mam probe script
|
||||
opt=
|
||||
while :
|
||||
do case $1 in
|
||||
-d) opt=-d ;;
|
||||
-*) ;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
mamprobe $opt - "$1"
|
||||
31
src/cmd/INIT/nsl.c
Normal file
31
src/cmd/INIT/nsl.c
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
/*
|
||||
* small test for -lnsl
|
||||
*/
|
||||
|
||||
|
||||
extern void* gethostbyname();
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
return gethostbyname(0) == 0;
|
||||
}
|
||||
24
src/cmd/INIT/p.c
Normal file
24
src/cmd/INIT/p.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
/*
|
||||
* small test for prototyping cc
|
||||
*/
|
||||
|
||||
int main(int argc, char** argv) { return argc || argv; }
|
||||
1537
src/cmd/INIT/package.mk
Normal file
1537
src/cmd/INIT/package.mk
Normal file
File diff suppressed because it is too large
Load diff
7428
src/cmd/INIT/package.sh
Normal file
7428
src/cmd/INIT/package.sh
Normal file
File diff suppressed because it is too large
Load diff
283
src/cmd/INIT/probe.win32
Normal file
283
src/cmd/INIT/probe.win32
Normal file
|
|
@ -0,0 +1,283 @@
|
|||
:
|
||||
# @(#)probe.win32 (AT&T Research) 2010-01-01
|
||||
#
|
||||
# win32 specific make C probe initialization
|
||||
# wrapped cc's are easy on uwin
|
||||
#
|
||||
# 2> easy.err to avoid mysterious hang with bcc
|
||||
|
||||
# begin preamble shared with the pp probe.ini
|
||||
|
||||
IFS=$'\n'
|
||||
|
||||
chmod 777 . # cl.exe setuid workaround
|
||||
|
||||
typeset -A header version
|
||||
|
||||
# we are probing on behalf of libpp and nmake
|
||||
# so the native preprocessor must be forced in
|
||||
# order to bootstrap libpp and nmake
|
||||
|
||||
nativepp=-1
|
||||
export nativepp
|
||||
|
||||
probe_header="
|
||||
stddef.h
|
||||
"
|
||||
for inc in syslimits.h winerror.h ostream bits/ctype_base.h stream.h
|
||||
do echo "#include <$inc>" > easy.c
|
||||
if $cc -E easy.c > /dev/null 2> easy.err
|
||||
then probe_header="$probe_header
|
||||
$inc
|
||||
"
|
||||
fi
|
||||
done
|
||||
|
||||
{
|
||||
for i in $probe_header
|
||||
do echo "#include <$i>"
|
||||
done
|
||||
echo '#ifdef __cplusplus'
|
||||
echo "int _Pr0b3_cplus=__cplusplus;"
|
||||
echo '#endif'
|
||||
echo '#ifdef _UWIN'
|
||||
echo "int _Pr0b3_uwin=_UWIN;"
|
||||
echo '#endif'
|
||||
echo '#ifdef __BORLANDC__'
|
||||
echo "int _Pr0b3_version_BORLAND=__BORLANDC__;"
|
||||
echo '#endif'
|
||||
echo '#ifdef __DMC__'
|
||||
echo "int _Pr0b3_version_DM=__DMC__;"
|
||||
echo '#endif'
|
||||
echo '#ifdef _MSC_VER'
|
||||
echo "int _Pr0b3_version_MS=_MSC_VER;"
|
||||
echo '#endif'
|
||||
echo '#ifdef __ICL'
|
||||
echo "int _Pr0b3_version_ICL=__ICL;"
|
||||
echo '#endif'
|
||||
echo '#ifdef __LCC__'
|
||||
echo "int _Pr0b3_version_LCC=0+__LCC__;"
|
||||
echo '#endif'
|
||||
echo '#ifdef __MINGW32__'
|
||||
echo "int _Pr0b3_version_MINGW=__MINGW32__;"
|
||||
echo '#endif'
|
||||
echo '#ifdef __INTERIX'
|
||||
echo "int _Pr0b3_version_INTERIX=__INTERIX;"
|
||||
echo '#endif'
|
||||
echo '#ifdef __WATCOMC__'
|
||||
echo "int _Pr0b3_version_WATCOM=__WATCOMC__;"
|
||||
echo '#endif'
|
||||
} > easy.c
|
||||
|
||||
include=
|
||||
uwin=
|
||||
cplus=
|
||||
|
||||
$cc -E easy.c 2>&1 |
|
||||
egrep -i '^(#(line)? 1 .*\.[hH]| *int +_Pr0b3_[a-zA-Z_]* *= *[0-9])' |
|
||||
sed -e 's,_Pr0b3_,,' \
|
||||
-e 's/.*"\(.*\)".*/\1/' \
|
||||
-e 's,^ *,,' \
|
||||
-e 's, *$,,' \
|
||||
-e 's, *= *,=,' \
|
||||
-e 's,^\(.\):[\\/]*,/\1/,' \
|
||||
-e 's,[\\/][\\/]*,/,g' \
|
||||
-e 's,^\(/.*\)/\(.*\)$,header[\2]="\1",' \
|
||||
-e 's, *int *\(.*\);.*,\1,' \
|
||||
-e 's,^version_\(.*\)=,version[\1]=,' \
|
||||
> easy.sh
|
||||
. ./easy.sh
|
||||
|
||||
include=
|
||||
for i in $probe_header
|
||||
do d=${header[$i]}
|
||||
if [[ $d ]]
|
||||
then include="$include
|
||||
$d"
|
||||
elif [[ $i == */* ]]
|
||||
then d=${header[${i##*/}]}
|
||||
if [[ $d == */${i%/*} ]]
|
||||
then include="$include
|
||||
${d%/${i%/*}}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
i=$($cc -V 2> easy.err)
|
||||
if test "" != "$i" -a -d "$i/include"
|
||||
then include="$i/include
|
||||
$include"
|
||||
fi
|
||||
|
||||
stdinclude=
|
||||
for inc in $include
|
||||
do if [[ ${inc%/*} -ef /msdev/platformsdk ]]
|
||||
then inc=/msdev/platformsdk/${inc##*/}
|
||||
elif [[ ${inc%/*} -ef /platformsdk ]]
|
||||
then inc=/platformsdk/${inc##*/}
|
||||
fi
|
||||
for dup in $stdinclude
|
||||
do [[ $inc -ef $dup ]] && continue 2
|
||||
done
|
||||
stdinclude="$stdinclude
|
||||
$inc"
|
||||
done
|
||||
|
||||
# end preamble shared with the pp probe.ini
|
||||
|
||||
if [[ ${version[@]} == [0-9]* && $stdinclude ]]
|
||||
then : the payoff
|
||||
set -- $cc
|
||||
cmd=$1
|
||||
shift
|
||||
set -- $(whence $cmd) "$@"
|
||||
typ=$(package)
|
||||
dialect="ANSI CLOSURE DYNAMIC EXPORT=DLL LIBPP -I-"
|
||||
case ${cc##*/} in
|
||||
*CC*) dialect="$dialect C++"
|
||||
cplus=1
|
||||
;;
|
||||
esac
|
||||
ld=${cc%cc}ld
|
||||
if [[ ! -x $ld ]]
|
||||
then ld=${cc%/*}/ld
|
||||
if [[ ! -x $ld ]]
|
||||
then case $cc in
|
||||
*/ncc) ld=/usr/bin/nld ;;
|
||||
*) ld=/usr/bin/ld ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
{
|
||||
if $cc -v >/dev/null 2>&1
|
||||
then v=$($cc -v 2>/dev/null)
|
||||
if [[ $v ]]
|
||||
then print "# ;VERSION;-v;$v;PATH;$cc"
|
||||
fi
|
||||
else v=
|
||||
fi
|
||||
cat <<!
|
||||
CC.CC = $*
|
||||
CC.NATIVE = $*
|
||||
CC.EXECTYPE = $typ
|
||||
CC.HOSTTYPE = $typ
|
||||
CC.ALTPP.FLAGS = -Yp,\$(CPP:D)
|
||||
CC.ALTPP.ENV =
|
||||
CC.AR = ar
|
||||
CC.ARFLAGS =
|
||||
CC.DEBUG = -g
|
||||
CC.DIALECT = $dialect
|
||||
CC.DLL = -D_BLD_DLL
|
||||
CC.DLLBIG = -D_BLD_DLL
|
||||
CC.DLL.DEF = -D_BLD_DLL
|
||||
CC.DLL.DIR = \$(BINDIR)
|
||||
CC.DLL.LIBRARIES =
|
||||
CC.DLL.VARIANTS =
|
||||
CC.DYNAMIC =
|
||||
CC.EXPORT.DYNAMIC =
|
||||
CC.LD = $ld
|
||||
CC.LD.DYNAMIC = -Bdynamic
|
||||
CC.LD.LAZY =
|
||||
CC.LD.NOLAZY =
|
||||
CC.LD.ORIGIN =
|
||||
CC.LD.RECORD =
|
||||
CC.LD.NORECORD =
|
||||
CC.LD.RUNPATH =
|
||||
CC.LD.STATIC = -Bstatic
|
||||
CC.LD.STRIP =
|
||||
CC.LIB.DLL = option
|
||||
CC.LIB.ALL = -Bwhole-archive
|
||||
CC.LIB.UNDEF = -Bno-whole-archive
|
||||
CC.MAKE.OPTIONS = nativepp=0
|
||||
CC.NM = nm
|
||||
CC.NMEDIT =
|
||||
CC.NMFLAGS =
|
||||
CC.OPTIMIZE = -O
|
||||
CC.PIC =
|
||||
CC.PICBIG =
|
||||
CC.READONLY =
|
||||
CC.REPOSITORY =
|
||||
CC.SHARED = -G
|
||||
CC.SHARED.LD = $ld
|
||||
CC.SHARED.REGISTRY =
|
||||
CC.SHARED.REGISTRY.PATH =
|
||||
CC.SHELLMAGIC =
|
||||
CC.SIZE = size
|
||||
CC.STATIC = -Bstatic
|
||||
!
|
||||
inc=
|
||||
lib=
|
||||
if [[ ${version[LCC]} ]]
|
||||
then lib=/lcc
|
||||
fi
|
||||
if [[ $stdinclude == *' '* ]]
|
||||
then stdinclude=${stdinclude//' '/''}
|
||||
fi
|
||||
stdinc=
|
||||
stdlib=
|
||||
for inc in $stdinclude
|
||||
do stdinc="$stdinc $inc"
|
||||
d=${inc%/*}/lib
|
||||
if [[ -d $d ]]
|
||||
then stdlib="$stdlib $d"
|
||||
fi
|
||||
done
|
||||
case $uwin in
|
||||
[0-9]*) cat <<!
|
||||
CC.STDINCLUDE = /usr/include $stdinc
|
||||
CC.STDLIB = /usr/lib$lib $stdlib
|
||||
!
|
||||
;;
|
||||
*) cat <<!
|
||||
CC.STDINCLUDE = $stdinc
|
||||
CC.STDLIB = $stdlib
|
||||
!
|
||||
;;
|
||||
esac
|
||||
cat <<!
|
||||
CC.STRICT =
|
||||
CC.STRIP = strip
|
||||
CC.STRIP.FLAGS =
|
||||
CC.PREFIX.ARCHIVE = lib
|
||||
CC.PREFIX.DYNAMIC =
|
||||
CC.PREFIX.SHARED =
|
||||
CC.PREFIX.SYMBOL = _
|
||||
CC.SUFFIX.ARCHIVE = .a
|
||||
CC.SUFFIX.COMMAND =
|
||||
CC.SUFFIX.DEBUG = .pdb
|
||||
CC.SUFFIX.DYNAMIC = .dll
|
||||
CC.SUFFIX.LD = .def .exp .ign .res
|
||||
CC.SUFFIX.OBJECT = .o
|
||||
CC.SUFFIX.SHARED = .lib
|
||||
CC.SUFFIX.SOURCE = .c
|
||||
CC.SUFFIX.STATIC =
|
||||
!
|
||||
if [[ $v ]]
|
||||
then case $v in
|
||||
*\"*) v=$(print -r -- | sed -e 's,",\\",g' -e 's,^ ,,' -e 's,.*,"&",') ;;
|
||||
*\'*) v=\"$v\" ;;
|
||||
esac
|
||||
cat <<!
|
||||
CC.VERSION = -v
|
||||
CC.VERSION.STRING = $v
|
||||
!
|
||||
else cat <<!
|
||||
CC.VERSION =
|
||||
CC.VERSION.STRING =
|
||||
!
|
||||
fi
|
||||
if [[ ${version[MINGW]} || ${version[MS]} ]]
|
||||
then cat <<!
|
||||
CC.WARN = -Wall
|
||||
!
|
||||
else cat <<!
|
||||
CC.WARN =
|
||||
!
|
||||
fi
|
||||
cat <<!
|
||||
CC.PREROOT =
|
||||
CC.UNIVERSE = att
|
||||
!
|
||||
} >&3
|
||||
exit 0
|
||||
fi
|
||||
5289
src/cmd/INIT/proto.c
Normal file
5289
src/cmd/INIT/proto.c
Normal file
File diff suppressed because it is too large
Load diff
5312
src/cmd/INIT/ratz.c
Normal file
5312
src/cmd/INIT/ratz.c
Normal file
File diff suppressed because it is too large
Load diff
1463
src/cmd/INIT/regress.sh
Normal file
1463
src/cmd/INIT/regress.sh
Normal file
File diff suppressed because it is too large
Load diff
367
src/cmd/INIT/release.c
Normal file
367
src/cmd/INIT/release.c
Normal file
|
|
@ -0,0 +1,367 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1990-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> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#pragma clang diagnostic ignored "-Wparentheses"
|
||||
|
||||
/*
|
||||
* release -- list recent release changes
|
||||
*
|
||||
* coded for portability
|
||||
*/
|
||||
|
||||
static char id[] = "\n@(#)$Id: release (AT&T Research) 2000-01-28 $\0\n";
|
||||
|
||||
#if _PACKAGE_ast
|
||||
|
||||
#include <ast.h>
|
||||
#include <error.h>
|
||||
|
||||
static const char usage[] =
|
||||
"[-?\n@(#)$Id: release (AT&T Research) 2000-01-28 $\n]"
|
||||
USAGE_LICENSE
|
||||
"[+NAME?release - list recent changes]"
|
||||
"[+DESCRIPTION?\brelease\b lists the changes within the date range specified"
|
||||
" by the \b--from\b and \b--to\b options. The input files are assumed to"
|
||||
" contain date tag lines of the form [\acc\a]]\ayy-mm-dd\a [ \atext\a ]]"
|
||||
" (or \bdate\b(1) default format), where \acc\a is determined by a Y2K"
|
||||
" window year of 69 (we can produce an example coding dated 1991 - this"
|
||||
" can be patented?, how about 1+1=2?.) The date tag lines are followed by"
|
||||
" \areadme\a text in reverse chronological order (newer entries at the"
|
||||
" top of the file.) If no selection options are specified then all"
|
||||
" changes are listed. If no \afile\a operands are specified then the"
|
||||
" standard input is read.]"
|
||||
"[+?The entries for each \afile\a are annotated with the file directory name.]"
|
||||
"[f:from?Entries older than \adate\a are omitted.]:[date]"
|
||||
"[r:release?List all changes that include the first \acount\a release marks."
|
||||
" A release mark has a date tag followed by optional space and at least"
|
||||
" three \b-\b characters. Changes from release mark \acount\a+1 are not"
|
||||
" listed. If there are no release marks then the date range is used;"
|
||||
" if there is at least one release mark then the date range is ignored"
|
||||
" and at most \acount\a release marks will be listed.]#[count]"
|
||||
"[t:to?Entries newer than \adate\a are omitted.]:[date]"
|
||||
"[V?Print the program version and exit.]"
|
||||
|
||||
"\n"
|
||||
"\n[ file ... ]\n"
|
||||
"\n"
|
||||
|
||||
"[+SEE ALSO?\bpackage\b(1)]"
|
||||
;
|
||||
|
||||
#else
|
||||
|
||||
#define elementsof(x) ((int)(sizeof(x)/sizeof(x[0])))
|
||||
|
||||
#define NiL ((char*)0)
|
||||
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if !_PACKAGE_ast && defined(__STDC__)
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
static char mon[] = "janfebmaraprmayjunjulaugsepoctnovdec";
|
||||
static char day[] = "sunmontuewedthufrisat";
|
||||
|
||||
#if !_PACKAGE_ast
|
||||
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
fprintf(stderr, "Usage: release [-V] [-h hi-date] [-l lo-date] [-r count] [ file ...]\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static unsigned long
|
||||
number(register char* s, char** e)
|
||||
{
|
||||
unsigned long q = 0;
|
||||
|
||||
while (isspace(*s))
|
||||
s++;
|
||||
while (isdigit(*s))
|
||||
q = q * 10 + *s++ - '0';
|
||||
if (e)
|
||||
*e = s;
|
||||
return q;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
string(register char* s, char* tab, int num, int siz, char** e)
|
||||
{
|
||||
register int i;
|
||||
register int j;
|
||||
char buf[16];
|
||||
|
||||
while (isspace(*s))
|
||||
s++;
|
||||
for (i = 0; i < siz; i++)
|
||||
buf[i] = isupper(s[i]) ? tolower(s[i]) : s[i];
|
||||
for (i = 0; i < num; i += siz)
|
||||
for (j = 0; j < siz && buf[j] == tab[j+i]; j++)
|
||||
if (j == (siz - 1))
|
||||
{
|
||||
*e = s + siz;
|
||||
return i / siz + 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
date(char* s, char** e)
|
||||
{
|
||||
char* t;
|
||||
unsigned long y;
|
||||
unsigned long m;
|
||||
unsigned long d;
|
||||
|
||||
if (isdigit(*s))
|
||||
{
|
||||
y = number(s, &t);
|
||||
if (*t != '-')
|
||||
return 0;
|
||||
switch (t - s)
|
||||
{
|
||||
case 2:
|
||||
y += 1900;
|
||||
if (y <= 1969)
|
||||
y += 100;
|
||||
break;
|
||||
case 4:
|
||||
if (y < 1969)
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
if (!(m = number(++t, &s)))
|
||||
return 0;
|
||||
if ((s - t) != 2 || *s != '-' || m < 1 || m > 12)
|
||||
return 0;
|
||||
if (!(d = number(++s, &t)))
|
||||
return 0;
|
||||
if ((t - s) != 2 || d < 1 || d > 31)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string(s, day, elementsof(day), 3, &t))
|
||||
s = t;
|
||||
if (!(m = string(s, mon, elementsof(mon), 3, &t)))
|
||||
return 0;
|
||||
if (!(d = number(t, &s)))
|
||||
return 0;
|
||||
for (y = 1969; *s; s++)
|
||||
if ((y = number(s, &t)) && (t - s) == 4)
|
||||
{
|
||||
if (y < 1969)
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (e)
|
||||
{
|
||||
while (isspace(*t))
|
||||
t++;
|
||||
*e = t;
|
||||
}
|
||||
return ((y - 1969) * 13 + m) * 32 + d;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
register char* s;
|
||||
register char* u;
|
||||
register char* v;
|
||||
char* p;
|
||||
char* e;
|
||||
int i;
|
||||
unsigned long t;
|
||||
unsigned long lo;
|
||||
unsigned long hi;
|
||||
int mk;
|
||||
FILE* f;
|
||||
char buf[1024];
|
||||
|
||||
mk = 0;
|
||||
lo = hi = 0;
|
||||
#if _PACKAGE_ast
|
||||
error_info.id = "release";
|
||||
for (;;)
|
||||
{
|
||||
switch (optget(argv, usage))
|
||||
{
|
||||
case 'f':
|
||||
if (!(lo = date(opt_info.arg, &e)) || *e)
|
||||
{
|
||||
error(2, "%s: invalid from date [%s]", opt_info.arg, e);
|
||||
return 1;
|
||||
}
|
||||
continue;
|
||||
case 'r':
|
||||
mk = opt_info.num + 1;
|
||||
continue;
|
||||
case 't':
|
||||
if (!(hi = date(opt_info.arg, &e)) || *e)
|
||||
{
|
||||
error(2, "%s: invalid to date [%s]", opt_info.arg, e);
|
||||
return 1;
|
||||
}
|
||||
continue;
|
||||
case 'V':
|
||||
sfprintf(sfstdout, "%s\n", id + 10);
|
||||
return 0;
|
||||
case '?':
|
||||
error(ERROR_USAGE|4, "%s", opt_info.arg);
|
||||
continue;
|
||||
case ':':
|
||||
error(2, "%s", opt_info.arg);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (error_info.errors)
|
||||
error(ERROR_USAGE|4, "%s", optusage(NiL));
|
||||
argv += opt_info.index;
|
||||
#else
|
||||
while ((s = *++argv) && *s == '-' && *(s + 1))
|
||||
{
|
||||
if (*(s + 1) == '-')
|
||||
{
|
||||
if (!*(s + 2))
|
||||
{
|
||||
argv++;
|
||||
break;
|
||||
}
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
switch (i = *++s)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 'f':
|
||||
case 't':
|
||||
if (!*(v = ++s) && !(v = *++argv))
|
||||
{
|
||||
s = "??";
|
||||
continue;
|
||||
}
|
||||
if (!(t = date(v, &e)) || *e)
|
||||
{
|
||||
fprintf(stderr, "release: -%c%s: invalid date [%s]\n", i, s, e);
|
||||
return 1;
|
||||
}
|
||||
switch (i)
|
||||
{
|
||||
case 'f':
|
||||
lo = t;
|
||||
break;
|
||||
case 't':
|
||||
hi = t;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
if (!*(v = ++s) && !(v = *++argv))
|
||||
{
|
||||
s = "??";
|
||||
continue;
|
||||
}
|
||||
mk = number(v, &e) + 1;
|
||||
if (*e)
|
||||
{
|
||||
fprintf(stderr, "release: -%c%s: invalid count\n", i, s);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'V':
|
||||
fprintf(stdout, "%s\n", id + 10);
|
||||
return 0;
|
||||
default:
|
||||
fprintf(stderr, "release: -%c: unknown option\n", i);
|
||||
/*FALLTHROUGH*/
|
||||
case '?':
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
do
|
||||
{
|
||||
if (!(p = *argv++) || !*p || *p == '-' && !*(p + 1))
|
||||
{
|
||||
argv--;
|
||||
p = "";
|
||||
f = stdin;
|
||||
}
|
||||
else if (!(f = fopen(p, "r")))
|
||||
{
|
||||
fprintf(stderr, "release: %s: cannot read", p);
|
||||
return 1;
|
||||
}
|
||||
while (s = fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
if (t = date(s, &e))
|
||||
{
|
||||
if (mk && e[0] == '-' && e[1] == '-' && e[2] == '-' && !--mk)
|
||||
break;
|
||||
if (t < lo)
|
||||
break;
|
||||
if (hi && t > hi)
|
||||
continue;
|
||||
if (p)
|
||||
{
|
||||
if (*p)
|
||||
{
|
||||
for (u = v = p; *p; p++)
|
||||
if (*p == '/')
|
||||
{
|
||||
v = u;
|
||||
u = p + 1;
|
||||
}
|
||||
printf("\n:::::::: ");
|
||||
while ((i = *v++) && i != '/')
|
||||
fputc(i, stdout);
|
||||
printf(" ::::::::\n\n");
|
||||
}
|
||||
p = 0;
|
||||
}
|
||||
}
|
||||
if (!p)
|
||||
fputs(s, stdout);
|
||||
}
|
||||
if (f == stdin)
|
||||
break;
|
||||
fclose(f);
|
||||
} while (*argv);
|
||||
return 0;
|
||||
}
|
||||
479
src/cmd/INIT/rt.sh
Normal file
479
src/cmd/INIT/rt.sh
Normal file
|
|
@ -0,0 +1,479 @@
|
|||
########################################################################
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
# #
|
||||
# A copy of the License is available at #
|
||||
# http://www.eclipse.org/org/documents/epl-v10.html #
|
||||
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
||||
# #
|
||||
# Information and Software Systems Research #
|
||||
# AT&T Research #
|
||||
# Florham Park NJ #
|
||||
# #
|
||||
# Glenn Fowler <gsf@research.att.com> #
|
||||
# #
|
||||
########################################################################
|
||||
: rt - nmake test output filter
|
||||
|
||||
command=rt
|
||||
flags='--silent --keepgoing'
|
||||
failed=0
|
||||
heading=1
|
||||
verbose=0
|
||||
|
||||
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
0123) ARGV0="-a $command"
|
||||
USAGE=$'
|
||||
[-?
|
||||
@(#)$Id: rt (AT&T Research) 2010-07-27 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[+NAME?rt - run "nmake test" and filter output]
|
||||
[+DESCRIPTION?\brt\b runs \vnmake test\v and filters the regression
|
||||
test output to contain only test summary lines. If no \atest\a
|
||||
operands are specified then \btest\b is assumed. If \b-\b is
|
||||
specified then the \afile\a operands, or the standard input
|
||||
if no \afile\a operands are specified, are filtered instead
|
||||
of the output from \bnmake\b.]
|
||||
[f:failed?Only list failed test results.]
|
||||
[h!:heading?Enable per-file heading when more than one \afile\a operand
|
||||
follows \b-\b.]
|
||||
[v:verbose?Run with \vREGRESSFLAGS=-v\v.]
|
||||
|
||||
[ test ... | - [ file ... ] ]
|
||||
|
||||
[+SEE ALSO?\bnmake\b(1), \bregress\b(1)]
|
||||
[+CAVEATS?\brt\b guesses the regression test output style. Garbled
|
||||
output indicates a bad guess.]
|
||||
'
|
||||
;;
|
||||
*) ARGV0=""
|
||||
USAGE="fhv"
|
||||
;;
|
||||
esac
|
||||
|
||||
function usage
|
||||
{
|
||||
OPTIND=0
|
||||
getopts $ARGV0 "$USAGE" OPT '-?'
|
||||
exit 2
|
||||
}
|
||||
|
||||
while getopts $ARGV0 "$USAGE" OPT
|
||||
do case $OPT in
|
||||
f) failed=1 ;;
|
||||
h) heading=0 ;;
|
||||
v) (( verbose=$OPTARG )) && flags="$flags REGRESSFLAGS=-v" ;;
|
||||
esac
|
||||
done
|
||||
shift `expr $OPTIND - 1`
|
||||
|
||||
ifs=${IFS:-$' \t\n'}
|
||||
set -o noglob
|
||||
component=
|
||||
dots='............................................'
|
||||
bad=' ***'
|
||||
style=unknown
|
||||
integer tests errors signals lineno=0 skip=0
|
||||
typeset -l lower
|
||||
|
||||
function results # tests errors signals
|
||||
{
|
||||
integer t=$1 e=$2 s=$3
|
||||
typeset label note
|
||||
if [[ $style != unknown ]] && (( errors >= 0 ))
|
||||
then style=unknown
|
||||
if (( !failed || errors ))
|
||||
then if (( failed ))
|
||||
then print -r -n -- "$unit"
|
||||
fi
|
||||
if (( t >= 0 ))
|
||||
then if (( t == 1))
|
||||
then label="test "
|
||||
else label=tests
|
||||
fi
|
||||
printf $'%s%5d %s' "$prefix" "$t" "$label"
|
||||
prefix=
|
||||
else prefix="$prefix..........."
|
||||
fi
|
||||
if (( s ))
|
||||
then label=signal
|
||||
(( e=s ))
|
||||
else label=error
|
||||
fi
|
||||
if (( e != 1))
|
||||
then label=${label}s
|
||||
fi
|
||||
if (( e == 1 ))
|
||||
then note=" $bad"
|
||||
elif (( e > 1 ))
|
||||
then note=$bad
|
||||
fi
|
||||
printf $'%s%5d %s%s\n' "$prefix" "$e" "$label" "$note"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function unit
|
||||
{
|
||||
typeset x
|
||||
if [[ $component ]]
|
||||
then x=${component##*/}
|
||||
if [[ " $x " != *' '$unit' '* && " $unit " != *' '$x' '* ]]
|
||||
then if [[ $component == cmd/?*lib/* ]]
|
||||
then unit="$unit $x"
|
||||
else unit="$x $unit"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
unit="$unit ${dots:1:${#dots}-${#unit}}"
|
||||
if [[ $1 ]]
|
||||
then unit="$unit..........."
|
||||
fi
|
||||
if (( ! failed ))
|
||||
then print -r -n -- "$unit"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $1 == - ]]
|
||||
then shift
|
||||
if (( $# <= 1 ))
|
||||
then heading=0
|
||||
fi
|
||||
if (( heading ))
|
||||
then for i
|
||||
do print test heading $i
|
||||
cat -- "$i"
|
||||
done
|
||||
else cat "$@"
|
||||
fi
|
||||
else if [[ $1 == *=* ]]
|
||||
then set test "$@"
|
||||
elif (( ! $# ))
|
||||
then set test
|
||||
fi
|
||||
nmake "$@" $flags 2>&1
|
||||
fi |
|
||||
while read -r line
|
||||
do set '' $line
|
||||
shift
|
||||
case $line in
|
||||
TEST[' ']*', '*' error'*)
|
||||
IFS=${IFS}","
|
||||
set '' $line
|
||||
IFS=$ifs
|
||||
set '' $*
|
||||
while :
|
||||
do case $2 in
|
||||
'') break
|
||||
;;
|
||||
error|errors)
|
||||
errors=$1
|
||||
break
|
||||
;;
|
||||
test|tests)
|
||||
tests=$1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
results $tests $errors
|
||||
continue
|
||||
;;
|
||||
TEST[' ']*)
|
||||
results $tests $errors
|
||||
IFS=${IFS}","
|
||||
set '' $line
|
||||
IFS=$ifs
|
||||
set '' $*
|
||||
unit=${3##*/}
|
||||
case $4 in
|
||||
[a-zA-Z]*) unit="$unit $4" ;;
|
||||
esac
|
||||
unit
|
||||
prefix=
|
||||
errors=0
|
||||
signals=0
|
||||
style=regress
|
||||
continue
|
||||
;;
|
||||
'pathname and options of item under test')
|
||||
read -r line || break
|
||||
results $tests $errors $signals
|
||||
set '' $line
|
||||
unit=${2##*/}
|
||||
unit
|
||||
tests=0
|
||||
errors=0
|
||||
signals=0
|
||||
style=script
|
||||
continue
|
||||
;;
|
||||
'test heading '*)
|
||||
if (( heading ))
|
||||
then if (( heading > 1 ))
|
||||
then print
|
||||
else heading=2
|
||||
fi
|
||||
set '' $line
|
||||
shift 3
|
||||
print -r -- "==> $* <=="
|
||||
fi
|
||||
continue
|
||||
;;
|
||||
'test '*' begins at '????-??-??+??:??:??|'test '*' begins at '*' '*' '*' '*' '*)
|
||||
results $tests $errors $signals
|
||||
unit=${2##*/}
|
||||
unit=${unit%.sh}
|
||||
unit
|
||||
prefix=
|
||||
tests=-1
|
||||
errors=0
|
||||
signals=0
|
||||
style=shell
|
||||
continue
|
||||
;;
|
||||
'test '*' at '????-??-??+??:??:??' [ '*' ]'|'test '*' at '*' '*' '*' '*' '*)
|
||||
case $line in
|
||||
*' [ '*test*error*' ]')
|
||||
while :
|
||||
do case $1 in
|
||||
'[') tests=$2
|
||||
errors=$4
|
||||
if (( errors > 256 ))
|
||||
then (( signals++ ))
|
||||
fi
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
;;
|
||||
*' [ '*test*signal*' ]')
|
||||
while :
|
||||
do case $1 in
|
||||
'[') tests=$2
|
||||
signals=$4
|
||||
if (( signals ))
|
||||
then (( errors++ ))
|
||||
fi
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
;;
|
||||
*) if [[ $3 != passed ]]
|
||||
then (( errors )) || (( errors++ ))
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
results $tests $errors $signals
|
||||
continue
|
||||
;;
|
||||
'## ---'*(-)'--- ##')
|
||||
(( ++lineno > skip )) || continue
|
||||
read -r line || break
|
||||
lower=$line
|
||||
set '' $lower
|
||||
case $lower in
|
||||
'##'*'test suite:'*'##')
|
||||
results $tests $errors $signals
|
||||
set -- ${lower//*suite:}
|
||||
set -- ${*//[.#]/}
|
||||
unit=$*
|
||||
if [[ $unit == *' tests' ]]
|
||||
then unit=${unit/' tests'/}
|
||||
fi
|
||||
main=$unit
|
||||
prefix=
|
||||
tests=0
|
||||
errors=0
|
||||
signals=0
|
||||
category=
|
||||
style=autotest
|
||||
(( skip = lineno + 1 ))
|
||||
unit
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
+(-)) case $style in
|
||||
regress) continue ;;
|
||||
esac
|
||||
(( ++lineno > skip )) || continue
|
||||
read -r line || break
|
||||
set '' $line
|
||||
case $line in
|
||||
'Running tests for '*)
|
||||
results $tests $errors $signals
|
||||
shift 4
|
||||
unit=
|
||||
while (( $# ))
|
||||
do if [[ $1 == on ]]
|
||||
then break
|
||||
fi
|
||||
if [[ $unit ]]
|
||||
then unit="$unit "
|
||||
fi
|
||||
unit=$unit${1##*/}
|
||||
shift
|
||||
done
|
||||
main=$unit
|
||||
prefix=
|
||||
tests=-1
|
||||
errors=-1
|
||||
category=
|
||||
style=perl
|
||||
(( skip = lineno + 1 ))
|
||||
continue
|
||||
;;
|
||||
*' : '*)results $tests $errors $signals
|
||||
unit=${2##*/}
|
||||
unit=${unit%.sh}
|
||||
unit
|
||||
prefix=
|
||||
tests=0
|
||||
errors=0
|
||||
signals=0
|
||||
style=timing
|
||||
(( skip = lineno + 1 ))
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
+([0-9])*([a-zA-Z0-9])' '*)
|
||||
case $style in
|
||||
script) case $line in
|
||||
*FAILED*|*failed*)
|
||||
(( errors++ ))
|
||||
;;
|
||||
*) (( tests++ ))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
make:*|'make ['*']:'*)
|
||||
case $line in
|
||||
*': warning:'*|*'making test'*|*'action'?(s)' failed'*|*': *** '*)
|
||||
;;
|
||||
*) results $tests $errors $signals
|
||||
print -r -u2 -- "$line"
|
||||
;;
|
||||
esac
|
||||
continue
|
||||
;;
|
||||
+([/a-zA-Z_0-9]):)
|
||||
component=${line%:}
|
||||
;;
|
||||
'') continue
|
||||
;;
|
||||
esac
|
||||
case $style in
|
||||
autotest)
|
||||
case $line in
|
||||
+([0-9]):*ok)
|
||||
(( tests++ ))
|
||||
;;
|
||||
+([0-9]):*FAILED*)
|
||||
(( tests++ ))
|
||||
(( errors++ ))
|
||||
if (( $verbose ))
|
||||
then if [[ ! $prefix ]]
|
||||
then prefix=$unit
|
||||
print
|
||||
fi
|
||||
print -r -- " ${line//*'FAILED '/}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
continue
|
||||
;;
|
||||
perl) case $line in
|
||||
*'........ '*)
|
||||
if [[ $1 == */* ]]
|
||||
then cat=${1%%/*}
|
||||
if [[ $cat != $category ]]
|
||||
then results $tests $errors $signals
|
||||
category=$cat
|
||||
unit="$main $category"
|
||||
unit
|
||||
prefix=
|
||||
tests=0
|
||||
errors=0
|
||||
signals=0
|
||||
fi
|
||||
(( tests++ ))
|
||||
case $line in
|
||||
*' ok') ;;
|
||||
*) (( errors++ ))
|
||||
if (( $verbose ))
|
||||
then if [[ ! $prefix ]]
|
||||
then prefix=$unit
|
||||
print
|
||||
fi
|
||||
print -r -- "$line"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else results $tests $errors $signals
|
||||
case $line in
|
||||
*' ok') errors=0 ;;
|
||||
*) errors=1 ;;
|
||||
esac
|
||||
unit="$main $1"
|
||||
unit
|
||||
if (( $verbose && errors ))
|
||||
then prefix=$unit
|
||||
print
|
||||
shift 2
|
||||
print -r -- "$@"
|
||||
else prefix=
|
||||
fi
|
||||
results $tests $errors $signals
|
||||
tests=-1
|
||||
errors=-1
|
||||
category=
|
||||
fi
|
||||
style=perl
|
||||
;;
|
||||
esac
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
case $line in
|
||||
*FAILED*|*failed*)
|
||||
(( errors++ ))
|
||||
;;
|
||||
*) case $style in
|
||||
regress)case $line in
|
||||
['<>']*);;
|
||||
*) continue ;;
|
||||
esac
|
||||
;;
|
||||
script) continue
|
||||
;;
|
||||
shell) ((errors++ ))
|
||||
;;
|
||||
timing) (( tests++ ))
|
||||
continue
|
||||
;;
|
||||
unknown)continue
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
if (( $verbose ))
|
||||
then if [[ ! $prefix ]]
|
||||
then prefix=$unit
|
||||
print
|
||||
fi
|
||||
print -r -- "$line"
|
||||
fi
|
||||
done
|
||||
results $tests $errors $signals
|
||||
41
src/cmd/INIT/silent.sh
Normal file
41
src/cmd/INIT/silent.sh
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
########################################################################
|
||||
# #
|
||||
# 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> #
|
||||
# #
|
||||
########################################################################
|
||||
# non-ksh stub for the nmake silent prefix
|
||||
# @(#)silent (AT&T Research) 1992-08-11
|
||||
|
||||
(command set -o posix) 2>/dev/null && set -o posix
|
||||
modern_export=`v=; export v=ok 2>/dev/null; echo "$v"`
|
||||
|
||||
while :
|
||||
do case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
case $1 in
|
||||
*=*) case $modern_export in
|
||||
ok) export "$1" ;;
|
||||
*) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;;
|
||||
esac
|
||||
shift
|
||||
;;
|
||||
*) break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@"
|
||||
33
src/cmd/INIT/socket.c
Normal file
33
src/cmd/INIT/socket.c
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
/*
|
||||
* small test for -lnsl
|
||||
*/
|
||||
|
||||
#ifndef socket
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
return socket(0, 0, 0) < 0;
|
||||
}
|
||||
30
src/cmd/INIT/w.c
Normal file
30
src/cmd/INIT/w.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#ifndef DONTCARE
|
||||
#include <wchar.h>
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
wchar_t w = ' ';
|
||||
return iswspace(w) == 0;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue