summaryrefslogtreecommitdiff
path: root/src/cmd/INIT/cc.ibm.risc
blob: 17a8f702ad97335454d927ac5f57b799ba964feb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
: cc wrapper for aix risc xlc : 2009-09-28 :

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