irix.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SGI big endian MIPSes running IRIX 5.2 at CS Dept., Princeton University */
  2. #include <string.h>
  3. #ifndef LCCDIR
  4. #define LCCDIR "/usr/local/lib/lcc/"
  5. #endif
  6. char *suffixes[] = { ".c", ".i", ".s", ".o", ".out", 0 };
  7. char inputs[256] = "";
  8. char *cpp[] = { LCCDIR "cpp", "-D__STDC__=1",
  9. "-DLANGUAGE_C",
  10. "-DMIPSEB",
  11. "-DSYSTYPE_SVR4",
  12. "-D_CFE",
  13. "-D_LANGUAGE_C",
  14. "-D_MIPSEB",
  15. "-D_MIPS_FPSET=16",
  16. "-D_MIPS_ISA=_MIPS_ISA_MIPS1",
  17. "-D_MIPS_SIM=_MIPS_SIM_ABI32",
  18. "-D_MIPS_SZINT=32",
  19. "-D_MIPS_SZLONG=32",
  20. "-D_MIPS_SZPTR=32",
  21. "-D_SGI_SOURCE",
  22. "-D_SVR4_SOURCE",
  23. "-D_SYSTYPE_SVR4",
  24. "-D__host_mips",
  25. "-D__mips=1",
  26. "-D__sgi",
  27. "-D__unix",
  28. "-Dhost_mips",
  29. "-Dmips",
  30. "-Dsgi",
  31. "-Dunix",
  32. "$1", "$2", "$3", 0 };
  33. char *com[] = { LCCDIR "rcc", "-target=mips/irix", "$1", "$2", "$3", "", 0 };
  34. char *include[] = { "-I" LCCDIR "include", "-I/usr/local/include",
  35. "-I/usr/include", 0 };
  36. char *as[] = { "/usr/bin/as", "-o", "$3", "$1", "-nocpp", "-KPIC", "$2", 0 };
  37. char *ld[] = { "/usr/bin/ld", "-require_dynamic_link", "_rld_new_interface",
  38. "-elf", "-_SYSTYPE_SVR4", "-Wx,-G", "0", "-g0", "-KPIC", "-dont_warn_unused",
  39. "-o", "$3", "/usr/lib/crt1.o", "-L/usr/local/lib",
  40. "$1", "$2", "", "-L" LCCDIR, "-llcc", "-lc", "-lm", "/usr/lib/crtn.o", 0
  41. };
  42. extern char *concat(char *, char *);
  43. int option(char *arg) {
  44. if (strncmp(arg, "-lccdir=", 8) == 0) {
  45. cpp[0] = concat(&arg[8], "/cpp");
  46. include[0] = concat("-I", concat(&arg[8], "/include"));
  47. com[0] = concat(&arg[8], "/rcc");
  48. ld[17] = concat("-L", &arg[8]);
  49. } else if (strcmp(arg, "-g") == 0)
  50. ;
  51. else if (strcmp(arg, "-p") == 0)
  52. ld[12] = "/usr/lib/mcrt1.o";
  53. else if (strcmp(arg, "-b") == 0)
  54. ;
  55. else
  56. return 0;
  57. return 1;
  58. }