cc.unix.mc68k 1.4 KB

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