gcc-solaris.c 1.4 KB

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