:
# Glenn Fowler
# AT&T Research
#
# @(#)make.probe (AT&T Research) 2003-06-11
#
# C probe for make
#
# NOTE: C.probe must be included or .'d here
#

probe_arflags="-xar"
probe_debug="-g"
probe_ld='ld "$cc"'
probe_ldlazy='-zlazyload -znolazyload -Wl,-zlazyload -Wl,-znolazyload'
probe_ldlib="LD_LIBRARY_PATH LIBPATH LPATH"
probe_ldmap="'-Wl,-M' '-Qoption ld -M' '-Wl,-m' '-m'"
probe_ldorigin="-Wl,-z,origin"
probe_ldrecord='-zrecord -zignore -Wl,-zrecord -Wl,-zignore'
probe_ldrunpath="-Wl,-R, -R -Wl,-rpath, -L"
probe_ldstrip="'-s -mr' -Wl,-s"
probe_lib="a lib"
probe_lib_append="/usr/lib/pa1.1"
probe_lib_all_undef="-all -notall -all -none -Bwhole-archive -Bno-whole-archive -whole-archive -no-whole-archive -Wl,-whole-archive -Wl,-no-whole-archive -all_load '' -Wl,-zallextract -Wl,-zdefaultextract +forceload +noforceload"
probe_lib_multiple="-Wl,-zmuldefs"
probe_libdir="shlib lib"
probe_nm="nm"
probe_nmflags="'' -p -B"
probe_optimize="-O"
probe_pic="-Kpic -KPIC -fpic -pic +z '-G 0' -D_DLL_BLD -Wc,exportall -dynamic"
probe_PIC="-Kpic -KPIC -fpic -fPIC -pic -PIC +z +Z"
probe_readonly="-R -Krodata -xMerge -Wa,-r"
probe_shared="'' -G -b -c -shared -Wl,dll"
probe_shared_nostart="-nostartfiles"
probe_shared_registry='"-update_registry $probe_shared_registry_file"'
probe_shared_registry_file='registry.ld'
probe_shared_registry_path="\$(LIBDIR)/$probe_shared_registry_file"
probe_strict="'-ansi -pedantic' '-ansi -strict' -strict -ansi"
probe_strip="strip"
probe_stripflags="'-f -s' -f -s"
probe_unresolved="'-expect_unresolved \"*\"'"
probe_warn="-Wall -fullwarn -w3 '-A -A' +w1"

echo '#pragma pp:version' > libpp.$src
echo '#define dDflag on' > dDflag.$src
echo 'main(){return 0;}' > doti.$src
echo '#include <stdio.h>' > imstd.$src
echo '#include "_i_.h"' > imusr.$src
echo 'int x;' > _i_.h
mkdir im
echo '(' > im/stdio.h
echo '#include "implc_x.h"
int main(){f(1);return 0;}' > implc.$src
echo 'template <class T> void f(T){}' > implc_x.$src
echo 'template <class T> void f(T);' > implc_x.h
echo 'extern int NotalL(){return(0);}' > notall.$src
echo '#include <stdio.h>
extern int i;
int i = 1;
extern int f(){return(i);}
int main(){FILE* fp=stdin;return(f());}' > pic.$src
echo 'class x {int n;} m;' > plusplus.$src
echo 'int prefix(){return 0;}' > prefix.$src
echo 'template<class T> int gt(T a, T b);
template<class T> int gt(T a, T b) { return a > b; }
int main () { return gt(2,1); }' > ptr.$src
echo 'main(){return 0;}' > require.$src
echo '#if test_const
#define CONST const
#else
#define CONST
#endif
static CONST char x[]={1,2,3,4,5,6,7,8,9,0};
#if mips && !sgi
{
#endif
main(){*(char*)x=0;return(0);}' > readonly.$src
# NOTE:	sfclose() defined on uwin, not defined on all other systems
echo 'extern int sfclose(); extern int ShareD(){return(sfclose());}' > shared.$src
echo '#define g(a,b) a ## b
volatile int a;
const int g(x,y)=1;
extern int c(int);' > stdc.$src
echo 'extern int f(); main() { return f(); }' > sovmain.$src
echo 'int f() { return 0; }' > sovlib.$src
echo '#include <stdio.h>
int i;
main(){int j;j = i * 10;return j;}' > strip.$src
echo 'template <class T> void f(T){}
int main(){f(1);return 0;}' > toucho.$src
echo '#if defined(__STDC__) || defined(__cplusplus)
extern type call(int);
#endif
int main() {call(0);return(0);}' > tstlib.$src
echo 'int f(){return 0;}' > warn.$src
echo 'int f(){}' > warn1.$src
echo 'int f(){int i; return 0;}' > warn2.$src
echo 'int f(){int i; return i;}' > warn3.$src
echo 'int f(){return g();}' > warn4.$src
warn_enum="1 2 3 4"
chmod -w *.$src

arflags=
dDflag=
debug=
dialect=
dll_dir='$(LIBDIR)'
dll_libraries=
dll_variants=
doti=
exectype=
gnu=
iminus=
implicitc=
lddynamic=
ldlazy=
ldnolazy=
ldnorecord=
ldorigin=
ldrecord=
ldrunpath=
ldscript=
ldstatic=
ldstrip=
Lflag=
lib_dll=
lib_all=
lib_undef=
libpath=
libpp=
makeoptions=
optimize=
pic=
plusplus=
prefix_archive=lib
prefix_dynamic=
prefix_shared=lib
ptrcopy=
ptrimplicit=
ptrmkdir=
readonly=
repository=
require=
shared=
shared_registry=
shellmagic=
soversion=
stdc=
strict=
symprefix=
toucho=
warn=

set $probe_lib
lib=$1

d=
for f in $stdinclude $usrinclude
do	case $f in
	-I*)	;;
	*)	d="$d $f" ;;
	esac
done
stdinclude=$d

ifs=$IFS
IFS=:
set x $PATH
IFS=$ifs
path=$*
set x $cc
eval `echo $2 | sed -e 's,\(.*\)/\(.*\),d=\1 b=\2,'`
case $b in
[cC][cC])
	p= s=
	;;
*[cC][cC]*)
	eval `echo $b | sed -e 's,\(.*\)[cC][cC]\(.*\),p=\1 b=\2,'`
	case $p in
	*g)	p="$p `echo $p | sed -e 's/.$//'`" ;;
	esac
	;;
*)	p= s=
	;;
esac
eval set _ $probe_ld _ $probe_nm _ $probe_size _ $probe_strip _
while	:
do	shift
	case $# in
	0)	break ;;
	esac
	n=$1
	v=
	while	:
	do	case $1 in
		_)	break ;;
		esac
		i=$1
		shift
		case $i in
		/*)	if	$executable $i
			then	v=$i
				break
			fi
			;;
		esac
		for x in $p ''
		do	for y in $s ''
			do	if	$executable $d/$x$i$y
				then	v=$d/$x$i$y
					break 3
				fi
			done
		done
		for x in $path
		do	if	$executable $x/$i
			then	v=$i
				break 2
			fi
		done
	done
	case $v in
	'')	case $n in
		size)	v='wc' ;;
		*)	v=$n ;;
		esac
		;;
	esac
	eval $n='$'v
	while	:
	do	case $1 in
		_)	break ;;
		esac
		shift
	done
done
nmedit=
nmflags=
stripflags=

rm -f dynamic.$exe
if	$cc -o dynamic.$exe dynamic.$obj && $executable dynamic.$exe
then	mkdir mylib
	echo > mylib/libc.$lib
	eval set x $probe_ldlib
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		rm -f dynamic.$exe
		if	eval $1=./mylib '$'cc -o dynamic.$exe dynamic.$obj
		then	:
		else	libpath=$1
			break
		fi
	done
fi
test `$cc -E libpp.$src | grep -c '^#pragma pp:version "libpp '` -eq 1 && libpp=1
$cc -E doti.$src > doti.i && $cc -c doti.i && test -s doti.$obj && doti=1
if	$cc -c imusr.$src
then	if	$cc -c -I- imusr.$src
	then	: '-I- should skip "_i_.h" in .'
	elif	$cc -c imstd.$src
	then	if	$cc -c -Iim imstd.$src
		then	: '-Idir should find <stdio.h> in dir'
		elif	$cc -c -I- -Iim imstd.$src
		then	: '-I- -Idir should find <stdio.h> in dir'
		elif	$cc -c -Iim -I- imstd.$src
		then	iminus=1
		else	: '-Idir -I- should skip <stdio.h> in dir'
		fi
	else	: should find stdio.h
	fi
else	: 'should find "_i_.h" in .'
fi
if	$cc -c pic.$src 2>e
then	e=`wc -l e`
	s=`$size pic.$obj; wc pic.$obj`
	eval set x $probe_pic
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		rm -f pic.$obj pic.$exe
		$cc $1 -c pic.$src 2>e && test -f pic.$obj || continue
		$cc $1 -o pic.$exe pic.$obj && test -f pic.$exe || {
			rm -f pic.$exe
			$cc -o pic.$exe pic.$obj && test -f pic.$exe && continue
		}
		case $1 in
		*-D[abcdefghijklmnopqrstuvwxyz]*=*)
			pic=$1
			break
			;;
		-Wc,exportall)
			# get specific since sgi gets this far too
			rm -f pic.$exe pic.x
			$cc -Wl,dll -o pic.$exe pic.$obj || continue
			test -f pic.$exe || continue
			test -f pic.x || continue
			pic="$1 -D_SHARE_EXT_VARS"
			so=.x
			sd=.dll
			shared=-Wl,dll
			prefix_shared=
			probe_sd=
			probe_shared=
			#unused# lddynamic=-Bdynamic
			#unused# ldstatic=-Bstatic
			lib_dll=SYMBOL
			break
			;;
		esac
		case `wc -l e` in
		$e)	;;
		*)	continue ;;
		esac
		case $1 in
		???*)	ns=`$size pic.$obj; wc pic.$obj`
			case $ns in
			$s)	continue ;;
			esac
			m=`echo " $1" | sed -e 's/^ [-+]//g' -e 's/./-& /g' -e 's/[-+] //g'`
			rm -f pic.$obj
			if	$cc $m -c pic.$src 2>e && test -f pic.$obj
			then	case `$size pic.$obj; wc pic.$obj` in
				$ns)	continue ;;
				esac
			fi
			pic=$1
			break
			;;
		*)	case `$size pic.$obj; wc pic.$obj` in
			$s)	;;
			*)	pic=$1
				break
				;;
			esac
			;;
		esac
	done
	PIC=$pic
	eval set x x $probe_PIC
	while	:
	do	shift
		shift
		case $# in
		0|1)	break ;;
		esac
		case $pic in
		$1)	rm -f pic.$obj pic.$exe
			$cc $2 -c pic.$src 2>e && test -f pic.$obj || break
			$cc $2 -o pic.$exe pic.$obj && test -f pic.$exe || {
				rm -f pic.$exe
				$cc -o pic.$exe pic.$obj && test -f pic.$exe && break
			}
			PIC=$2
			break
			;;
		esac
	done
fi
$cc -c plusplus.$src && plusplus=1
$cc -E -dD dDflag.$src > t
case `grep '#define[ 	][ 	]*dDflag[ 	][ 	]*on' t` in
?*)	dDflag=1 ;;
esac
case `grep '#define.*_GNUC_' t` in
?*)	gnu=1 ;;
esac
case $plusplus in
"")	$cc -c stdc.$src && stdc=1 ;;
*)	mkdir ptr
	cd ptr
	$cc -c ../ptr.$src &
	NFS_locks_are_botched=$!
	cd ..
	if	$cc -c require.$src && $cc require.$obj
	then	set x `$cc require.$obj 2>&1`
		d=
		while	:
		do	shift
			case $# in
			0)	break ;;
			esac
			case $1 in
			-l*)	d="$d $1" ;;
			esac
		done
		for f in ++
		do	if $cc require.$obj -l$f
			then	set x `$cc require.$obj -l$f 2>&1`
				r=
				while	:
				do	shift
					case $# in
					0)	break ;;
					esac
					case $1 in
					-l*)	case " $d $r " in
						*" "$1" "*)	;;
						*)		r="$r $1" ;;
						esac
					esac
				done
				case $r in
				?*)	require="$require $f"
					echo '' $r > req.$f
					;;
				esac
			fi
		done
	fi
	cd ptr
	for i in *
	do	if	test -d $i
		then	repository=$i
			break
		fi
	done
	cd ..
	kill -9 $NFS_locks_are_botched
	rm -rf ptr
	case $repository in
	*?)	mkdir ptr
		cd ptr
		i=PTR
		case $repository in
		$i)	i=$i$i ;;
		esac
		$cc -ptr$i -c ../ptr.$src &
		NFS_locks_are_botched=$!
		cd ..
		sleep 5
		if	test -d ptr/$i/$repository
		then	ptrimplicit=1
		fi
		kill -9 $NFS_locks_are_botched
		rm -rf ptr
		;;
	esac
	$cc -o implc implc.$src && $executable implc && implicitc=1
	if	$cc -c toucho.$src && test -f toucho.$obj
	then	o=`ls -l toucho.$obj`
		if	$cc -o toucho toucho.$obj && $executable toucho
		then	n=`ls -l touch.$obj`
			case $n in
			"$o")	;;
			*)	toucho=1 ;;
			esac
		fi
	fi
	;;
esac

if	$cc -c pic.$src
then	eval set x $probe_nmflags
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		case `$nm $1 pic.$obj | grep -c '[0123456789][ 	][ 	]*T[ 	][ 	]*[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]'` in
		0)	;;
		*)	nmflags=$1
			break
			;;
		esac
	done
	case $# in
	0)	case `$nm -gh pic.$obj | grep -c '|\.*[TtDdBbC][EeAaSsOo][XxTtSsMm]'` in
		0)	;;
		*)	nmflags=-gh
			nmedit="-e '/\.*[TtDdBbC][EeAaSsOo][XxTtSsMm]/!d' -e 's/[| 	].*//'"
			;;
		esac
		;;
	*)	nmedit="-e '/[ 	]T[ 	][ 	]*[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]/!d' -e 's/.*[ 	]T[ 	][ 	]*//'"
		;;
	esac
fi

if	$cc -c doti.$src
then	eval set x $probe_stripflags
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		if	$strip $1 doti.$obj
		then	stripflags=$1
			break
		fi
	done
fi

rm -f strip.exe
if	$cc -o strip.exe strip.$src
then	z=`wc -c < strip.exe`
	eval set x $probe_ldstrip
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		rm -f strip.exe
		if	$cc -o strip.exe $1 strip.$src
		then	case `wc -c < strip.exe` in
			$z)	;;
			*)	ldstrip=$1
				break
				;;
			esac
		fi
	done
fi

rm -f strip.exe strip.$obj
if	$cc -c strip.$src && $cc -o strip.exe strip.$obj 2>e
then	eval set x x $probe_ldlazy
	while	:
	do	shift
		shift
		case $# in
		0)	break ;;
		esac
		rm -f strip.$exe
		$cc -o strip.$exe $1 strip.$obj $2 2>f && test -f strip.$exe || continue
		cmp -s e f || continue
		ldlazy=$1
		ldnolazy=$2
		break
	done
	eval set x x $probe_ldrecord
	while	:
	do	shift
		shift
		case $# in
		0)	break ;;
		esac
		rm -f strip.$exe
		$cc -o strip.$exe $1 strip.$obj $2 2>f && test -f strip.$exe || continue
		cmp -s e f || continue
		ldrecord=$1
		ldnorecord=$2
		break
	done
fi

case $pic:$so:$dynamic:$static in
:::)	: lets get specifical
	while	:
	do
		echo '__declspec(dllexport) int fun() { return 0; }' > exp.$src
		if	$cc -c -D_BLD_DLL exp.$src
		then	rm -f xxx.dll xxx.lib
			if	$cc -shared -Wl,--enable-auto-image-base -Wl,--out-implib=xxx.lib -o xxx.dll exp.$obj &&
				test -f xxx.lib -a -f xxx.dll
			then
				: cygwin
				ld=$cc
				pic=-D_BLD_DLL
				PIC=$pic
				dll_dir='$(BINDIR)'
				sd=.dll
				so=.dll.a
				ldscript=".def .exp .ign .res"
				lib_dll=option
				lib_all=-Wl,-whole-archive
				lib_undef=-Wl,-no-whole-archive
				shared='-shared -Wl,--enable-auto-image-base -Wl,--out-implib=$(<:N=*'$so')'
				prefix_dynamic=cyg
				prefix_shared=lib
				break
			fi
		fi
		break
	done
	;;
*)	if	$cc -c $pic shared.$src notall.$src
	then	
		for dld in "$cc" "$ld"
		do	eval set x $probe_shared
			while	:
			do	shift
				case $# in
				0)	break ;;
				esac
				rm -f xxx$dll
				# UNDENT ...

	if	$dld $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll
	then	if	test -s e && egrep -i 'unknown|invalid|option' e > /dev/null
		then	continue
		fi
		case `PATH=/bin:/usr/bin:$PATH file xxx$dll` in
		*lib*|*obj*|*shared*)	;;
		"")		$executable xxx$dll || continue ;;
		*)		continue ;;
		esac
		ld=$dld
		shared=$1
		z=`wc -c < xxx$dll`
		eval set x $probe_shared_nostart
		while	:
		do	shift
			case $# in
			0)	break ;;
			esac
			rm -f xxx$dll
			if	$ld $shared $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll
			then	case `wc -c < xxx$dll` in
				$z)	;;
				*)	if	test -s e
					then	case `cat e` in
						*[Ee][Rr][Rr][Oo][Rr]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*)
							continue
							;;
						esac
					fi
					case $shared in
					'')	shared=$1 ;;
					*)	shared="$shared $1" ;;
					esac
					break
					;;
				esac
			fi
		done
		case $pic in
		"")	pic=-D_PIC_ ;;
		esac
		eval set x x $probe_sd
		while	:
		do	shift
			shift
			case $# in
			[01])	break ;;
			esac
			rm -f xxx xxx$1 xxx$2
			if	$ld $shared -o xxx shared.$obj 2>e
			then	if	test -f xxx$1 -a \( -f xxx$2 -o "$pic" = "-D_DLL_BLD" \)
				then	sd=$1
					so=$2
					lddynamic=-Bdynamic
					ldstatic=-Bstatic
					break 2
				elif	test -f xxx -a -f xxx$2
				then	sd=$1
					so=$2
					break 2
				else	case $so in
					'')	so=$1 ;;
					esac
					break
				fi
			fi
		done
		rm -f libxxx.$lib
		ar cr libxxx.$lib shared.$obj
		ranlib libxxx.$lib
		eval set x x $probe_lib_all_undef
		rm -f xxx$dll
		if	$ld $shared -o xxx$dll libxxx.$lib && test -r xxx$dll
		then	if	$nm $nmflags xxx$dll | grep ShareD
			then	lib_dll=OPTION
				set x x
			fi
		fi
		while	:
		do	shift
			shift
			case $# in
			0|1)	break ;;
			esac
			rm -f xxx$dll
			if	$ld $shared -o xxx$dll $1 libxxx.$lib $2 && test -r xxx$dll
			then	if	$nm $nmflags xxx$dll | grep ShareD
				then	lib_dll=option
					lib_all=$1
					lib_undef=$2
					break
				fi
			fi
			case $2 in
			?*)	if	$ld $shared -o xxx$dll $1 libxxx.$lib && test -r xxx$dll
				then	if	$nm $nmflags xxx$dll | grep ShareD
					then	lib_dll=option
						lib_all=$1
						break
					fi
				fi
				;;
			esac
		done
		case $lib_dll in
		OPTION)	lib_dll=option
			;;
		option)	case $lib_undef in
			"")	rm -f libyyy.$lib
				ar cr libyyy.$lib notall.$obj
				ranlib libyyy.$lib
				$cc -c prefix.$src
				eval set x x $probe_lib_all_undef
				while	:
				do	shift
					shift
					case $# in
					0|1)	break ;;
					esac
					rm -f xxx$dll
					if	$ld $shared -o xxx$dll prefix.$obj $lib_all libxxx.$lib $2 libyyy.$lib && test -r xxx$dll
					then	rm -f t
						$nm $nmflags xxx$dll > t
						case `grep -c ShareD t`:`grep -c NotalL t` in
						0:*)	;;
						*:0)	lib_undef=$2
							break
							;;
						esac
					fi
				done
				;;
			esac
			case $lib_undef in
			"")	eval set x $probe_lib_multiple
				rm -f libyyy.$lib
				cp libxxx.$lib libyyy.$lib
				rm -f xxx$dll
				if	$ld $shared -o xxx$dll prefix.$obj $lib_all libxxx.$lib libyyy.$lib && test -r xxx$dll
				then	:
				else	while	:
					do	shift
						case $# in
						0)	break ;;
						esac
						rm -f xxx$dll
						if	$ld $shared -o xxx$dll prefix.$obj $lib_all $1 libxxx.$lib libyyy.$lib && test -r xxx$dll
						then	rm -f t
							$nm $nmflags xxx$dll > t
							case `grep -c ShareD t` in
							0)	;;
							*)	lib_all="$lib_all $1"
								break
								;;
							esac
						fi
					done
				fi
				lib_dll=symbol
				;;
			esac
			;;
		*)	lib_dll=symbol
			;;
		esac
		case `cat e` in
		?*)	eval set x $probe_unresolved
			while	:
			do	shift
				case $# in
				0)	break ;;
				esac
				rm -f xxx$dll
				if	eval '$ld $shared' $1 '-o xxx$dll shared.$obj 2>e && test -r xxx$dll'
				then	case `cat e` in
					"")	shared="$shared $1"; break ;;
					esac
				fi
			done
			;;
		esac
		r=
		eval set x $probe_shared_registry
		while	:
		do	shift
			r=x$r
			case $# in
			0)	break ;;
			esac
			rm -f xxx$dll
			if	eval \$ld \$shared -o xxx\$dll $1 shared.\$obj &&
				test -r xxx$dll -a -r $probe_shared_registry_file
			then	probe_shared_registry_file='$(CC.SHARED.REGISTRY.PATH)'
				eval set x $probe_shared_registry
				i=
				while	:
				do	shift
					i=x$i
					case $i in
					$r)	break ;;
					esac
				done
				shared_registry=$1
			fi
		done
		break 2
	fi

				# ... INDENT
			done
		done
	fi
	case $so in
	?*)	if	$cc -c require.$src
		then	p='
/usr/proberun/lib:/local/runprobe/lib
'
			eval set x $probe_ldrunpath
			while	:
			do	shift
				case $# in
				0)	break ;;
				esac
				rm -f require.exe
				if	$cc -o require.exe $1"$p" require.$obj &&
					grep -c /proberun/ require.exe >/dev/null &&
					grep -c /runprobe/ require.exe > /dev/null
				then	ldrunpath=$1
					eval set x $probe_ldorigin
					while	:
					do	shift
						case $# in
						0)	break ;;
						esac
						rm -f require.exe
						if	$cc -o require.exe $1 $ldrunpath"$p" require.$obj
						then	ldorigin="$1 $ldrunpath"'\$ORIGIN/$(BINDIR:P=R=$(DLLDIR))'
							break
						fi
					done
					break
				fi
			done
		fi
		rm -f libxxx$so
		if	$cc -c sovmain.$src &&
			$cc $pic -c sovlib.c &&
			$ld $shared -o libxxx$so sovlib.$obj &&
			$cc -o sovmain.$exe -L. sovmain.$obj -lxxx
		then	rm -f sovmain.$exe
			mv libxxx$so libxxx$so.5.6
			if	$cc -o sovmain.$exe -L. sovmain.$obj -lxxx
			then	soversion=1
			fi
		fi
		;;
	esac
	;;
esac

rm -f shared.$obj
if	$cc -c shared.$src
then	eval set x $probe_arflags
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		rm -f libxxx.$lib
		if	$cc $1 -o libxxx.$lib shared.$obj && ar t libxxx.$lib 2>&1 | grep shared.$obj >/dev/null
		then	arflags=$1
			break
		fi
	done
fi

case $shared in
-G)	case $pic in
	"")	pic=-D_PIC_ ;;
	esac
	;;
*)	case $lib_dll in
	symbol)	echo 'extern int f();
	main() { f(); return 0; }' > main.$src
		echo '#include <stdio.h>
	int f() { printf("hello world"); return 0; }' > member.$src
		if	$cc -c main.$src && $cc -c member.$src
		then	echo f > lib.exp
			rm -f lib.$obj main.exe
			if	$ld -o lib.$obj -L: -bexport:lib.exp -berok -bmodtype:SRE -T512 -H512 -lm -lc member.$obj && $cc -o main.exe main.$obj lib.$obj
			then	shared='-T512 -H512 -L$(LIBDIR): -berok -bmodtype:SRE'
				lib_dll=export
				dll_libraries='-lm -lc'
				ldscript=.exp
				case $pic in
				"")	pic=-D_PIC_ ;;
				esac
				case $so in
				"")	so=.$obj ;;
				esac
			fi
		fi
		;;
	esac
	;;
esac
case $PIC in
'')	PIC=$pic ;;
esac

case $hosttype in
win32.*|cygwin.*|os2.*)
	Lflag=1
	;;
*)	if	$cc -c doti.$src
	then	if	$cc -L. doti.$obj -lc >/dev/null
		then	case $pic in
			'')	;;
			*)	Lflag=1 ;;
			esac
		fi
	fi
	;;
esac

case $lib_dll in
option)	case $hosttype in
	linux.*)	dll_libraries=-lc ;;
	esac
	;;
SYMBOL)	lib_dll=symbol
	;;
symbol)	echo "#include <stdio.h>
extern int fun()
{
	puts(\"fun\");
	return 0;
}" > dllib.$src
	echo "extern int fun();
main()
{
	return fun();
}" > dlmain.$src
	pwd=`pwd`
	while	:
	do
		if	$cc $pic -c dlmain.$src &&
			$cc $pic -c dllib.$src
		then	rm -f libxxx$so
			if	$ld $shared -o libxxx$so dllib.$obj &&
				chmod 555 libxxx$so
			then	rm -f dlmain.$exe
				if	$cc -o dlmain.$exe dlmain.$obj $pwd/libxxx$so &&
					(./dlmain.$exe) >/dev/null 2>&1
				then	break
				fi
			fi
			rm -f libxxx$so dlmain.$exe
			if	$ld $shared -o libxxx$so dllib.$obj -lm -lc &&
				chmod 555 libxxx$so &&
				$cc -o dlmain.$exe dlmain.$obj $pwd/libxxx$so &&
				(./dlmain.$exe) >/dev/null 2>&1
			then	dll_libraries='-lm -lc'
			fi
		fi
		break
	done
	# the dll_libraries probe is still lame
	case $dll_libraries in
	'')	case $hosttype in
		sco.*|sol*.*|sun*)	;;
		*)			dll_libraries='-lm -lc' ;;
		esac
		;;
	esac
	;;
esac

false && case $libpath in
?*)	stdlib="$stdlib "'$('$libpath':/:/ /G)'
esac
tstlib=
implib=
if	$cc -c hosted.$src
then	for f in `(
		eval set x $probe_verbose
		while	:
		do	shift
			case $# in
			0)	break ;;
			esac
			$cc $1 hosted.$obj
		done
		) 2>&1 | sed -e 's/[ 	:]/\\
/g' -e 's/-L//g' -e 's/^P,//' -e "s/[\\"']//g" -e 's,^[\\\\/]*[\\\\/],/,' | sed -e '/^\$/d' -e '/^[-+]/d' -e '/^[^\\\\\\/]/d' -e '/[\\\\\\/]tmp[\\\\\\/]/d' -e 's/:\$//' -e 's,//*$,,'`
	do	case " $tstlib $implib " in
		*" $f "*)	continue ;;
		esac
		if	test -d $f
		then	tstlib="$tstlib $f"
		elif	test -f $f
		then	d=`echo $f | sed -e 's,[\\\\/]*[^\\\\/]*\$,,'`
			case " $tstlib $implib " in
			*" $d "*)	continue ;;
			esac
			case $d in
			*[\\/]usr[\\/]lib)
				x=$d
				d="`echo $d | sed -e 's,[\\\\/][\\\\/]*usr[\\\\/]lib\$,/lib,'`"
				case " $tstlib $implib " in
				*" $d "*)	;;
				*)		implib="$implib $d" ;;
				esac
				implib="$implib $x"
				;;
			*[\\/]lib)
				implib="$implib $d"
				d="`echo $d | sed -e 's,[\\\\/][\\\\/]*lib\$,/usr/lib,'`"
				case " $tstlib $implib " in
				*" $d "*)	;;
				*)		implib="$implib $d" ;;
				esac
				;;
			*)	implib="$implib $d"
				;;
			esac
		fi
	done
fi
tstlib="$tstlib $implib"
if	$cc -Dtype=void -Dcall=exit -c tstlib.$src && mv tstlib.$obj tst.$obj
then	case $plusplus in
	'')	probe_lxx= ;;
	esac
	l=
	for sym in $probe_l $probe_lxx
	do	case $l in
		"")	l=$sym; continue ;;
		esac
		rm -f tstlib.$exe
		if	$cc -o tstlib.$exe tst.$obj -l$l
		then	eval set x $probe_ldmap
			while	:
			do	shift
				case $# in
				0)	break ;;
				esac
				d=`$cc -Dtype=int -Dcall=$sym $static $1 tstlib.$src -l$l 2>&1 | sed -e '/[\\\\\\/].*[\\\\\\/]lib[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+]*\.[^\\\\\\/]*\$/!d' -e 's,^[^\\\\\/]*,,' -e 's,[\\\\\\/]lib[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+]*\.[^\\\\\\/]*\$,,' -e '/^[\\\\\\/]/!d' | sort -u`
				case $d in
				?*)	tstlib="$tstlib $d" ;;
				esac
			done
		fi
		l=
	done
fi
libstd=
libset=
stdlibroot="/ /usr/"
for d in $tstlib
do	case $d in
	[\\/]lib|[\\/]usr[\\/]lib)
		;;
	*)	case " $stdlib " in
		*\ $d\ *)
			;;
		*)	if	ls $d ${PREROOT+$PREROOT/../$d} > tmp.tmp && test -s tmp.tmp
			then	for i in $probe_lib $obj
				do	if	grep -i "\\.$i\$" tmp.tmp >/dev/null
					then	case " $probe_lib_append " in
						*\ $d\ *)
							libstd="$libstd $d"
							;;
						*)	stdlib="$stdlib $d"
							case $d in
							/usr/lib|/usr/lib/*)
								;;
							/usr/lib?*)
								e=`echo $d | sed -e 's,/usr,,'`
								g=`echo $d/libc.* $e/libc.*`
								case "$e $g " in
								*".* "*);;
								*)	stdlib="$stdlib $e"
									stdlibroot=
									;;
								esac
								;;
							esac
							;;
						esac
						case $libset in
						"")	case $i in
							$obj)	;;
							*)	libset=1
								lib=$i
								;;
							esac
							;;
						esac
						break
					fi
				done
			fi
			;;
		esac
		;;
	esac
done
for d in `$ld --verbose 2>&1 | sed -e '/SEARCH_DIR/!d' -e 's/[ 	][ 	][ 	]*/ /g' -e 's/SEARCH_DIR(\([^ ]*\));/\1/g' -e 's, //[^ ]*,,'`
do	case " $stdlib $libstd " in
	*\ ${d}\ *)
		;;
	*)	libstd="$libstd $d"
		;;
	esac
done
case $hosted in
"")	tstlib= ;;
*)	tstlib="$stdlibroot /usr/ccs/ /usr/local/" ;;
esac
case $stdlibroot in
?*)	d=
	for f in $stdinclude
	do	f=`echo $f | sed -e 's,[^\\\\/]*\$,,'`
		d="$d $f"
	done
	tstlib="$d $tstlib"
	;;
esac
$cc -c doti.$src > all.tmp
for f in $probe_libdir
do	for d in $tstlib
	do	case " $stdlib $libstd " in
		*" ${d}${f} "*)
			;;
		*)	if	test -d ${d}${f} &&
				ls ${d}${f} ${PREROOT:+$PREROOT/../${d}${f}} > tmp.tmp &&
				test -s tmp.tmp
			then	if	egrep -i "\\.$lib\$" tmp.tmp >lib.tmp ||
					egrep -i "\\.$obj\$" tmp.tmp >/dev/null ||
					egrep -i "\\$so(.[0-9]+)*\$" tmp.tmp >>lib.tmp
				then	if	test -s lib.tmp
					then	sed -e "s,.*/,," -e 's,^'${prefix_archive}'\(.*\)\.'$lib'$,\1,g' -e 's,^'${prefix_shared}'\(.*\)\'$so'[.0-9]*,\1,g' lib.tmp | sort -u > tmp.tmp
						xs=`sort all.tmp all.tmp tmp.tmp | uniq -u`
						case $xs in
						'')	continue ;;
						esac
						ok=0
						for x in $xs
						do	if	$cc -o doti.$exe doti.$obj -l$x
							then	ok=1
								break
							fi
						done
						case $ok in
						0)	continue ;;
						esac
						sort -u all.tmp tmp.tmp > lib.tmp
						mv lib.tmp all.tmp
					fi
					if	test -d ${d}${f}/fsoft
					then	stdlib="$stdlib ${d}${f}/"'$(FLOAT_OPTION)'
					fi
					stdlib="$stdlib ${d}${f}"
				fi
			fi
			;;
		esac
	done
done
stdlib="$stdlib $libstd"
case $stdlib in
*/shlib*)
	dy=
	st=
	for i in $stdlib $libstd
	do	case $i in
		*/shlib)	dy="$dy $i" ;;
		*)		st="$st $i" ;;
		esac
	done
	for i in /var
	do	if	test -d $i/shlib
		then	dy="$dy $i/shlib"
		fi
	done
	stdlib="$dy $st"
	;;
esac

if	$cc -c prefix.$src
then	eval set x $probe_symprefix
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		if	$nm $nmflags prefix.$obj | grep -c ${1}prefix >/dev/null
		then	symprefix=$1
			break
		fi
	done
fi

if	$cc -c warn.$src 2>e && test -f warn.$obj
then	e=`wc -c < e`

	eval set x $probe_debug
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		rm -f warn.$obj
		$cc $1 -c warn.$src 2>e && test -f warn.$obj || continue
		case `wc -c < e` in
		$e)	debug=$1; break ;;
		esac
	done

	eval set x $probe_optimize
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		rm -f warn.$obj
		$cc $1 -c warn.$src 2>e && test -f warn.$obj || continue
		case `wc -c < e` in
		$e)	optimize=$1; break ;;
		esac
	done

	eval set x $probe_strict
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		rm -f warn.$obj
		$cc $1 -c warn.$src 2>e && test -f warn.$obj || continue
		n=`wc -c < e`
		if	test $n -ge $e
		then	strict=$1
			break
		fi
	done

	$cc -c warn.$src 2>e
	o=`wc -c < e`
	eval set x $probe_warn
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		rm -f warn.$obj
		$cc $1 -c warn.$src 2>e && test -f warn.$obj || continue
		n=`wc -c < e`
		if	test $n -gt $o
		then	continue
		fi
		for n in $warn_enum
		do	rm -f warn$n.$obj
			$cc $1 -c warn$n.$src 2>e && test -f warn$n.$obj || continue
			n=`wc -c < e`
			if	test $n -gt $e
			then	warn=$1
				break 2
			fi
		done
	done

fi

while	:
do	case $hosted in
	?*)	rm -f readonly.$exe
		eval set x '""' $probe_readonly
		while	:
		do	shift
			case $# in
			0)	break ;;
			esac
			for co in '' -Dtest_const
			do	rm -f readonly.$exe
				if	$cc -o readonly.$exe $co $1 readonly.$src && $executable readonly.$exe
				then	if	./readonly.$exe
					then	:
					else	readonly=$1
						break 3
					fi
				fi
			done
		done
		rm -f readonly.$exe readonly.s
		if	$cc -S readonly.$src && test -f readonly.s
		then	if	sed	-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)data/\1text/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)zero[ 	][ 	]*/\1set	.,.+/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)space[ 	][ 	]*1/\1byte 0/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)space[ 	][ 	]*2/\1byte 0,0/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)space[ 	][ 	]*3/\1byte 0,0,0/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)space[ 	][ 	]*4/\1byte 0,0,0,0/' \
					readonly.s > ro.s && $cc -o readonly.$exe ro.s && $executable readonly.$exe
			then	if	./readonly.$exe
				then	:
				else	readonly='-S.data'
					break
				fi
			fi
			rm -f readonly.$exe
			if	sed	-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)idat/\1code/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)zero[ 	][ 	]*/\1set	.,.+/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)space[ 	][ 	]*1/\1byte 0/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)space[ 	][ 	]*2/\1byte 0,0/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)space[ 	][ 	]*3/\1byte 0,0,0/' \
					-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)space[ 	][ 	]*4/\1byte 0,0,0,0/' \
					readonly.s > ro.s && $cc -o readonly.$exe ro.s && $executable readonly.$exe
			then	if	./readonly.$exe
				then	:
				else	readonly='-S.idat'
					break
				fi
			fi
			if	sed	-e 's/^\([ 	]*[.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$:]*[ 	]*\.*\)data/\1rdata/' \
					readonly.s > ro.s && $cc -o readonly.$exe ro.s && $executable readonly.$exe
			then	if	./readonly.$exe
				then	:
				else	readonly='-S.rdata'
					break
				fi
			fi
		fi
		;;
	esac
	break
done

case $stdc in
?*)	dialect="$dialect ANSI" ;;
esac
case $plusplus in
?*)	dialect="$dialect C++" ;;
esac
case $hosted in
"")	dialect="$dialect CROSS" ;;
esac
case $doti in
?*)	dialect="$dialect DOTI" ;;
esac
case $gnu in
?*)	dialect="$dialect GNU" ;;
esac
case $so:$dynamic:$static in
::)	;;
*)	dialect="$dialect DYNAMIC"
	case $soversion in
	?*)	dialect="$dialect VERSION" ;;
	esac
	;;
esac
case $implicitc in
?*)	dialect="$dialect IMPLICITC" ;;
esac
case $ptrcopy in
?*)	dialect="$dialect PTRCOPY" ;;
esac
case $ptrimplicit in
?*)	dialect="$dialect PTRIMPLICIT" ;;
esac
case $ptrmkdir in
?*)	dialect="$dialect PTRMKDIR" ;;
esac
case $libpp in
?*)	dialect="$dialect LIBPP" ;;
esac
case $toucho in
?*)	dialect="$dialect TOUCHO" ;;
esac
case $dDflag in
?*)	dialect="$dialect -dD" ;;
esac
case $iminus in
?*)	dialect="$dialect -I-" ;;
esac
case $Lflag in
?*)	dialect="$dialect -L" ;;
esac

ppcmd='$(CPP)'
ppdir='$(CPP:D)'
eval ppopt='"'$ppopt'"'
eval ppenv='"'$ppenv'"'

set x "" .$exe
shift
exe=
for i
do	rm -f require$i
done
if	$cc -o require require.$src
then	for i
	do	if	$executable require$i
		then	exe=$i
			break
		fi
	done
fi
case $sa:$sd:$so in
::?*)	eval set x $probe_sa
	while	:
	do	shift
		case $# in
		0)	break ;;
		esac
		for i in $stdlib
		do	eval j="'" $i/lib*$1 "'"
			case $j in
			" $i/lib*$1 ")
				eval j="'" $i/lib*$1.[0123456789]* "'"
				case $j in
				" $i/lib*$1.[0123456789]* ")
					continue
					;;
				esac
				;;
			esac
			sa=$1
			lddynamic=-Bdynamic
			ldstatic=-Bstatic
			break 2
		done
	done
	;;
esac
case $ldscript in
"")	case $so in
	.lib)	ldscript=".def .exp" ;;
	*)	ldscript=".ld" ;;
	esac
	;;
esac
case $hosttype in
'')		hosttype=unknown ;;
sgi.mips3)	dll_variants='sgi.mips2:o32:-mips2 sgi.mips4:64:-mips4' ;;
sgi.mips4)	dll_variants='sgi.mips2:o32:-mips2 sgi.mips3:n32:-mips3' ;;
esac

case $hosted in
'')	ccnative=`echo $cc | sed -e 's,.*/,,'`
	ccs=$ccnative
	for c in cc gcc
	do	case " $ccs " in
		*" $c "*)	;;
		*)		ccs="$ccs $c" ;;
		esac
	done
	for p in $path
	do	for c in $ccs
		do	if	$executable $p/$c
			then	rm -f native.$exe
				if	$p/$c -o native.$exe doti.$src && ./native.$exe
				then	ccnative=$p/$c
					exectype=`package CC="$ccnative" || $SHELL -c "package CC='$ccnative'"`
					case $exectype in
					*[Uu][Ss][Aa][Gg][Ee]:*)
						exectype=`PATH=$_probe_PATH; export PATH; package CC="$ccnative" || $SHELL -c "package CC='$ccnative'"`
						;;
					esac
					break 2
				fi
			fi
		done
	done
	;;
*)	ccnative=$cc
	exectype=$hosttype
	;;
esac

# shellmagic defined if installed shell scripts need magic

echo ': got magic :
echo ok' > ok
chmod +x ok
case `(eval ./ok | /bin/sh) 2>/dev/null` in
ok)	;;
*)	echo '#!/bin/env sh
: got magic :
echo ok' > ok
	chmod +x ok
	case `(eval ./ok | /bin/sh) 2>/dev/null` in
	ok)	shellmagic='$("#")!/bin/env sh'
		;;
	*)	for i in /emx/bin/bash.exe /emx/bin/sh.exe
		do	if	test -x $i
			then	shellmagic='$("#")!'$i
				break
			fi
		done
		;;
	esac
	;;
esac

#
# set up for local override
#

CC_CC=$cc
CC_NATIVE=$ccnative
CC_ALTPP_FLAGS=$ppopt
CC_ALTPP_ENV=$ppenv
CC_ARFLAGS=$arflags
CC_DEBUG=$debug
CC_DIALECT=$dialect
CC_DLL=$pic
CC_DLLBIG=$PIC
CC_DLL_DIR=$dll_dir
CC_DLL_LIBRARIES=$dll_libraries
CC_DLL_VARIANTS=$dll_variants
CC_DYNAMIC=$dynamic
CC_EXECTYPE=$exectype
CC_HOSTTYPE=$hosttype
CC_LD=$ld
CC_LD_DYNAMIC=$lddynamic
CC_LD_LAZY=$ldlazy
CC_LD_NOLAZY=$ldnolazy
CC_LD_ORIGIN=$ldorigin
CC_LD_RECORD=$ldrecord
CC_LD_NORECORD=$ldnorecord
CC_LD_RUNPATH=$ldrunpath
CC_LD_STATIC=$ldstatic
CC_LD_STRIP=$ldstrip
CC_LIB_DLL=$lib_dll
CC_LIB_ALL=$lib_all
CC_LIB_UNDEF=$lib_undef
CC_MAKE_OPTIONS=$makeoptions
CC_NM=$nm
CC_NMEDIT=$nmedit
CC_NMFLAGS=$nmflags
CC_OPTIMIZE=$optimize
CC_READONLY=$readonly
CC_REPOSITORY=$repository
CC_REQUIRE=$require
CC_SHARED=$shared
CC_SHARED_REGISTRY=$shared_registry
CC_SHARED_REGISTRY_PATH=$probe_shared_registry_path
CC_SHELLMAGIC=$shellmagic
CC_STATIC=$static
CC_STDINCLUDE=$stdinclude
CC_STDLIB=$stdlib
CC_STRICT=$strict
CC_STRIP=$strip
CC_STRIP_FLAGS=$stripflags
CC_PREFIX_ARCHIVE=$prefix_archive
CC_PREFIX_DYNAMIC=$prefix_dynamic
CC_PREFIX_SHARED=$prefix_shared
CC_PREFIX_SYMBOL=$symprefix
CC_SUFFIX_ARCHIVE=.$lib
CC_SUFFIX_COMMAND=$suffix_command
CC_SUFFIX_DYNAMIC=$sd
CC_SUFFIX_LD=$ldscript
CC_SUFFIX_OBJECT=.$obj
CC_SUFFIX_SHARED=$so
CC_SUFFIX_SOURCE=.$src
CC_SUFFIX_STATIC=$sa
CC_WARN=$warn
CC_ATTRIBUTES=$ATTRIBUTES

exec >&3

echo CC.CC = $CC_CC

#
# check for local override
# all CC_* but CC_CC may be modified
# additional CC.* may be printed on stdout
#

if	test -f "$dir/probe.lcl"
then	. "$dir/probe.lcl"
fi

#
# the payoff
#

echo CC.NATIVE = $CC_NATIVE
echo CC.ALTPP.FLAGS = $CC_ALTPP_FLAGS
echo CC.ALTPP.ENV = $CC_ALTPP_ENV
echo CC.ARFLAGS = $CC_ARFLAGS
echo CC.DEBUG = $CC_DEBUG
echo CC.DIALECT = $CC_DIALECT
echo CC.DLL = $CC_DLL
echo CC.DLLBIG = $CC_DLLBIG
echo CC.DLL.DIR = $CC_DLL_DIR
echo CC.DLL.LIBRARIES = $CC_DLL_LIBRARIES
echo CC.DLL.VARIANTS = $CC_DLL_VARIANTS
echo CC.DYNAMIC = $CC_DYNAMIC
echo CC.EXECTYPE = $CC_EXECTYPE
echo CC.HOSTTYPE = $CC_HOSTTYPE
echo CC.LD = $CC_LD
echo CC.LD.DYNAMIC = $CC_LD_DYNAMIC
echo CC.LD.LAZY = $CC_LD_LAZY
echo CC.LD.NOLAZY = $CC_LD_NOLAZY
echo CC.LD.ORIGIN = $CC_LD_ORIGIN
echo CC.LD.RECORD = $CC_LD_RECORD
echo CC.LD.NORECORD = $CC_LD_NORECORD
echo CC.LD.RUNPATH = $CC_LD_RUNPATH
echo CC.LD.STATIC = $CC_LD_STATIC
echo CC.LD.STRIP = $CC_LD_STRIP
echo CC.LIB.DLL = $CC_LIB_DLL
echo CC.LIB.ALL = $CC_LIB_ALL
echo CC.LIB.UNDEF = $CC_LIB_UNDEF
echo CC.MAKE.OPTIONS = $CC_MAKE_OPTIONS
echo CC.NM = $CC_NM
case $CC_NMEDIT in
?*)	CC_NMEDIT=" $CC_NMEDIT" ;;
esac
echo CC.NMEDIT ="$CC_NMEDIT"
echo CC.NMFLAGS = $CC_NMFLAGS
echo CC.OPTIMIZE = $CC_OPTIMIZE
echo CC.READONLY = $CC_READONLY
echo CC.REPOSITORY = $CC_REPOSITORY
for f in $CC_REQUIRE
do	echo CC.REQUIRE.$f =`cat req.$f`
done
echo CC.SHARED = $CC_SHARED
echo CC.SHARED.REGISTRY = $CC_SHARED_REGISTRY
echo CC.SHARED.REGISTRY.PATH = $CC_SHARED_REGISTRY_PATH
echo CC.SHELLMAGIC = $CC_SHELLMAGIC
echo CC.STATIC = $CC_STATIC
echo CC.STDINCLUDE = $CC_STDINCLUDE
echo CC.STDLIB = $CC_STDLIB
echo CC.STRICT = $CC_STRICT
echo CC.STRIP = $CC_STRIP
echo CC.STRIP.FLAGS = $CC_STRIP_FLAGS
echo CC.PREFIX.ARCHIVE = $CC_PREFIX_ARCHIVE
echo CC.PREFIX.DYNAMIC = $CC_PREFIX_DYNAMIC
echo CC.PREFIX.SHARED = $CC_PREFIX_SHARED
echo CC.PREFIX.SYMBOL = $CC_PREFIX_SYMBOL
echo CC.SUFFIX.ARCHIVE = $CC_SUFFIX_ARCHIVE
echo CC.SUFFIX.COMMAND = $CC_SUFFIX_COMMAND
echo CC.SUFFIX.DYNAMIC = $CC_SUFFIX_DYNAMIC
echo CC.SUFFIX.LD = $CC_SUFFIX_LD
echo CC.SUFFIX.OBJECT = $CC_SUFFIX_OBJECT
echo CC.SUFFIX.SHARED = $CC_SUFFIX_SHARED
echo CC.SUFFIX.SOURCE = $CC_SUFFIX_SOURCE
echo CC.SUFFIX.STATIC = $CC_SUFFIX_STATIC
echo CC.WARN = $CC_WARN

for i in $CC_ATTRIBUTES
do	eval echo CC.$i = \$$i
done
