solaris.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPARCs running Solaris 2.5.1 at CS Dept., Princeton University */
  2. #include <string.h>
  3. #ifndef LCCDIR
  4. #define LCCDIR "/usr/local/lib/lcc/"
  5. #endif
  6. #ifndef SUNDIR
  7. #define SUNDIR "/opt/SUNWspro/SC4.2/lib/"
  8. #endif
  9. char *suffixes[] = { ".c", ".i", ".s", ".o", ".out", 0 };
  10. char inputs[256] = "";
  11. char *cpp[] = { LCCDIR "cpp",
  12. "-D__STDC__=1", "-Dsparc", "-D__sparc__", "-Dsun", "-D__sun__", "-Dunix",
  13. "$1", "$2", "$3", 0 };
  14. char *include[] = { "-I" LCCDIR "include", "-I/usr/local/include",
  15. "-I/usr/include", 0 };
  16. char *com[] = { LCCDIR "rcc", "-target=sparc/solaris",
  17. "$1", "$2", "$3", 0 };
  18. char *as[] = { "/usr/ccs/bin/as", "-Qy", "-s", "-o", "$3", "$1", "$2", 0 };
  19. char *ld[] = { "/usr/ccs/bin/ld", "-o", "$3", "$1",
  20. SUNDIR "crti.o", SUNDIR "crt1.o",
  21. SUNDIR "values-xa.o", "$2", "",
  22. "-Y", "P," SUNDIR ":/usr/ccs/lib:/usr/lib", "-Qy",
  23. "-L" LCCDIR, "-llcc", "-lm", "-lc", SUNDIR "crtn.o", 0 };
  24. extern char *concat(char *, char *);
  25. int option(char *arg) {
  26. if (strncmp(arg, "-lccdir=", 8) == 0) {
  27. cpp[0] = concat(&arg[8], "/cpp");
  28. include[0] = concat("-I", concat(&arg[8], "/include"));
  29. ld[12] = concat("-L", &arg[8]);
  30. com[0] = concat(&arg[8], "/rcc");
  31. } else if (strcmp(arg, "-g") == 0)
  32. ;
  33. else if (strcmp(arg, "-p") == 0) {
  34. ld[5] = SUNDIR "mcrt1.o";
  35. ld[10] = "P," SUNDIR "libp:/usr/ccs/lib/libp:/usr/lib/libp:"
  36. SUNDIR ":/usr/ccs/lib:/usr/lib";
  37. } else if (strcmp(arg, "-b") == 0)
  38. ;
  39. else if (strncmp(arg, "-ld=", 4) == 0)
  40. ld[0] = &arg[4];
  41. else
  42. return 0;
  43. return 1;
  44. }