1: 3B1/PC7300 unix.mc68k cc wrapper for ANSI C : 2002-09-01 :
2
3HOSTTYPE=unix.mc68k
4
5case " $* " in
6*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
7esac
8
9# /bin/cc predates ANSI C; use gcc
10# some headers depend on SYSTEM5 or mc68k being defined
11# headers for Ethernet software are under /usr/ethernet/include
12# both /usr/lib/libnet.a and /usr/lib/libcurses.a define select()
13#	-lcurses uses a version of select for napms(), but that
14#		implementation always returns an error if given file
15#		descriptors to watch
16#	the one in -lnet must be used if fds (instead of or in addition to
17#		a timeout) are of interest therefore, -lnet should be
18#		specified before -lcurses
19#	rename(old, new) in /usr/lib/libnet.a fails if new exists
20#		(permitted by ANSI/ISO C-1990 7.9.4.2)
21# gcc -fpic doesn't work as there's no _GLOBAL_OFFSET_TABLE symbol
22
23cc="gcc"
24
25exec=
26show=:
27inc=0
28lib=0
29set '' -DSYSTEM5 -Dmc68k "$@" ''
30shift
31while	:
32do	a=$1
33	shift
34	case $a in
35	'')	break
36		;;
37	-lcurses|libcurses.a|*/libcurses.a)
38		lib=1
39		set '' "$@" -lnet
40		shift
41		;;
42	-lnet|libnet.a|*/libnet.a)
43		lib=1
44		;;
45	-o)	a=$1
46		shift
47		set '' "$@" -o
48		shift
49		;;
50	-fpic)	continue
51		;;
52	-n)	exec=:
53		continue
54		;;
55	-v)	show=echo
56		continue
57		;;
58	-*)	;;
59	*)	case $inc in
60		0)	inc=1
61			set '' "$@" -I/usr/ethernet/include
62			shift
63			;;
64		esac
65		;;
66	esac
67	set '' "$@" "$a"
68	shift
69done
70case $lib in
710)	set '' "$@" -lnet
72	shift
73	;;
74esac
75$show $cc "$@"
76$exec $cc "$@"
77