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