summaryrefslogtreecommitdiff
path: root/src/cmd/INIT/cc.lynxos.i386
blob: acd0d02d620f5acfb4f2a1f0e0c4a8759ca12a7c (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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