1 /* x86 running linux and using nasm as a.out */
6 #define LCCDIR "/usr/local/lib/lcc/"
9 #define NASMPATH "/usr/local/bin/nasm"
11 char *cpp
[] = { LCCDIR
"cpp", "-D__STDC__=1",
12 "-Di386", "-D__i386", "-D__i386__",
13 "-Dlinux", "-D__linux", "-D__linux__",
14 "-Dunix", "-D__unix", "-D__unix__",
15 "$1", "$2", "$3", 0 };
16 char *include
[] = { "-I" LCCDIR
"include", "-I/usr/local/include",
17 "-I/usr/include", 0 };
18 char *com
[] = { LCCDIR
"rcc", "-target=x86/nasm",
19 "$1", "$2", "$3", 0 };
20 char *as
[] = { NASMPATH
, "-a", "-faout", "-o", "$3", "$1", "$2", 0 };
21 char *ld
[] = { "/usr/bin/ld", "-m", "i386linux",
22 "-L/usr/i486-linuxaout/lib",
24 "/usr/i486-linuxaout/lib/crt0.o",
26 static char *bbexit
= LCCDIR
"bbexit.o";
28 extern char *concat(char *, char *);
29 extern int access(const char *, int);
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 com
[0] = concat(&arg
[8], "/rcc");
36 bbexit
= concat(&arg
[8], "/bbexit.o");
37 } else if (strcmp(arg
, "-g") == 0)
39 else if (strcmp(arg
, "-b") == 0 && access(bbexit
, 4) == 0)