: unix wrapper for mac os10 cc : 2002-10-04 :

HOSTTYPE=darwin.ppc

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)	tmp=/tmp/cc.$$.err
	ld -m -flat_namespace -undefined suppress -dylib -dynamic \
		-ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1
	status=$?
	egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2
	rm -f $tmp
	exit $status
	;;
ld)	tmp=/tmp/cc.$$.err
	$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
	rm -f $tmp
	exit $status
	;;
esac
