summaryrefslogtreecommitdiff
path: root/src/cmd/INIT/cc.unix.mc68k
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-06-24 22:28:35 +0000
committerIgor Pashev <pashev.igor@gmail.com>2012-06-24 22:28:35 +0000
commit3950ffe2a485479f6561c27364d3d7df5a21d124 (patch)
tree468c6e14449d1b1e279222ec32f676b0311917d2 /src/cmd/INIT/cc.unix.mc68k
downloadksh-upstream.tar.gz
Imported Upstream version 93u+upstream
Diffstat (limited to 'src/cmd/INIT/cc.unix.mc68k')
-rwxr-xr-xsrc/cmd/INIT/cc.unix.mc68k76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/cmd/INIT/cc.unix.mc68k b/src/cmd/INIT/cc.unix.mc68k
new file mode 100755
index 0000000..ebdfa0d
--- /dev/null
+++ b/src/cmd/INIT/cc.unix.mc68k
@@ -0,0 +1,76 @@
+: 3B1/PC7300 unix.mc68k cc wrapper for ANSI C : 2002-09-01 :
+
+HOSTTYPE=unix.mc68k
+
+case " $* " in
+*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
+esac
+
+# /bin/cc predates ANSI C; use gcc
+# some headers depend on SYSTEM5 or mc68k being defined
+# headers for Ethernet software are under /usr/ethernet/include
+# both /usr/lib/libnet.a and /usr/lib/libcurses.a define select()
+# -lcurses uses a version of select for napms(), but that
+# implementation always returns an error if given file
+# descriptors to watch
+# the one in -lnet must be used if fds (instead of or in addition to
+# a timeout) are of interest therefore, -lnet should be
+# specified before -lcurses
+# rename(old, new) in /usr/lib/libnet.a fails if new exists
+# (permitted by ANSI/ISO C-1990 7.9.4.2)
+# gcc -fpic doesn't work as there's no _GLOBAL_OFFSET_TABLE symbol
+
+cc="gcc"
+
+exec=
+show=:
+inc=0
+lib=0
+set '' -DSYSTEM5 -Dmc68k "$@" ''
+shift
+while :
+do a=$1
+ shift
+ case $a in
+ '') break
+ ;;
+ -lcurses|libcurses.a|*/libcurses.a)
+ lib=1
+ set '' "$@" -lnet
+ shift
+ ;;
+ -lnet|libnet.a|*/libnet.a)
+ lib=1
+ ;;
+ -o) a=$1
+ shift
+ set '' "$@" -o
+ shift
+ ;;
+ -fpic) continue
+ ;;
+ -n) exec=:
+ continue
+ ;;
+ -v) show=echo
+ continue
+ ;;
+ -*) ;;
+ *) case $inc in
+ 0) inc=1
+ set '' "$@" -I/usr/ethernet/include
+ shift
+ ;;
+ esac
+ ;;
+ esac
+ set '' "$@" "$a"
+ shift
+done
+case $lib in
+0) set '' "$@" -lnet
+ shift
+ ;;
+esac
+$show $cc "$@"
+$exec $cc "$@"