OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [lcc/] [etc/] [linux.c] - Blame information for rev 98

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 hellwig
/* x86s running Linux */
2
 
3
#include <string.h>
4
 
5
static char rcsid[] = "$Id: linux.c,v 1.5 1998/09/16 20:41:09 drh Exp $";
6
 
7
#ifndef LCCDIR
8
#define LCCDIR "/usr/local/lib/lcc/"
9
#endif
10
 
11
char *suffixes[] = { ".c", ".i", ".s", ".o", ".out", 0 };
12
char inputs[256] = "";
13
char *cpp[] = { LCCDIR "gcc/cpp",
14
        "-U__GNUC__", "-D_POSIX_SOURCE", "-D__STDC__=1", "-D__STRICT_ANSI__",
15
        "-Dunix", "-Di386", "-Dlinux",
16
        "-D__unix__", "-D__i386__", "-D__linux__", "-D__signed__=signed",
17
        "$1", "$2", "$3", 0 };
18
char *include[] = {"-I" LCCDIR "include", "-I" LCCDIR "gcc/include", "-I/usr/include", 0 };
19
char *com[] = {LCCDIR "rcc", "-target=x86/linux", "$1", "$2", "$3", 0 };
20
char *as[] = { "/usr/bin/as", "-o", "$3", "$1", "$2", 0 };
21
char *ld[] = {
22
        /*  0 */ "/usr/bin/ld", "-m", "elf_i386", "-dynamic-linker",
23
        /*  4 */ "/lib/ld-linux.so.2", "-o", "$3",
24
        /*  7 */ "/usr/lib/crt1.o", "/usr/lib/crti.o",
25
        /*  9 */ LCCDIR "/gcc/crtbegin.o",
26
                 "$1", "$2",
27
        /* 12 */ "-L" LCCDIR,
28
        /* 13 */ "-llcc",
29
        /* 14 */ "-L" LCCDIR "/gcc", "-lgcc", "-lc", "-lm",
30
        /* 18 */ "",
31
        /* 19 */ LCCDIR "/gcc/crtend.o", "/usr/lib/crtn.o",
32
 
33
 
34
extern char *concat(char *, char *);
35
 
36
int option(char *arg) {
37
        if (strncmp(arg, "-lccdir=", 8) == 0) {
38
                cpp[0] = concat(&arg[8], "/gcc/cpp");
39
                include[0] = concat("-I", concat(&arg[8], "/include"));
40
                include[1] = concat("-I", concat(&arg[8], "/gcc/include"));
41
                ld[9]  = concat(&arg[8], "/gcc/crtbegin.o");
42
                ld[12] = concat("-L", &arg[8]);
43
                ld[14] = concat("-L", concat(&arg[8], "/gcc"));
44
                ld[19] = concat(&arg[8], "/gcc/crtend.o");
45
                com[0] = concat(&arg[8], "/rcc");
46
        } else if (strcmp(arg, "-p") == 0 || strcmp(arg, "-pg") == 0) {
47
                ld[7] = "/usr/lib/gcrt1.o";
48
                ld[18] = "-lgmon";
49
        } else if (strcmp(arg, "-b") == 0)
50
                ;
51
        else if (strcmp(arg, "-g") == 0)
52
                ;
53
        else if (strncmp(arg, "-ld=", 4) == 0)
54
                ld[0] = &arg[4];
55
        else if (strcmp(arg, "-static") == 0) {
56
                ld[3] = "-static";
57
                ld[4] = "";
58
        } else
59
                return 0;
60
        return 1;
61
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.