1 /* x86 running linux and using nasm as ELF */
6 #define LCCDIR "/usr/local/lib/lcc/"
9 #define NASMPATH "/usr/local/bin/nasm"
11 char *cpp
[] = { LCCDIR
"cpp", "-D__STDC__=1",
12 "-D__ELF__", "-Di386", "-D__i386", "-D__i386__",
13 "-Dlinux", "-D__linux", "-D__linux__",
16 char *include
[] = { "-I" LCCDIR
"include", "-I/usr/local/include",
19 char *com
[] = { LCCDIR
"rcc", "-target=x86/nasm",
22 char *as
[] = { NASMPATH
, "-a", "-felf", "-o", "$3", "$1", "$2", 0 };
23 char *ld
[] = { "/usr/bin/ld", "-m", "elf_i386",
24 "-dynamic-linker", "/lib/ld-linux.so.1",
25 "-L/usr/i486-linux/lib",
27 "/usr/lib/crt1.o", "/usr/lib/crti.o", "/usr/lib/crtbegin.o",
29 "-lc", "", "/usr/lib/crtend.o", "/usr/lib/crtn.o", 0
31 static char *bbexit
= LCCDIR
"bbexit.o";
33 extern char *concat(char *, char *);
34 extern int access(const char *, int);
38 if (strncmp(arg
, "-lccdir=", 8) == 0) {
39 cpp
[0] = concat(&arg
[8], "/cpp");
40 include
[0] = concat("-I", concat(&arg
[8], "/include"));
41 com
[0] = concat(&arg
[8], "/rcc");
42 bbexit
= concat(&arg
[8], "/bbexit.o");
43 } else if (strcmp(arg
, "-g") == 0) ;
44 else if (strcmp(arg
, "-b") == 0 && access(bbexit
, 4) == 0)