Quake-III-Arena

Quake III Arena GPL Source Release
Log | Files | Refs

gcc-solaris.c (1451B)


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