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

Subversion Repositories eco32

[/] [eco32/] [tags/] [eco32-0.26/] [lcc/] [etc/] [linux.c] - Diff between revs 4 and 270

Only display areas with differences | Details | Blame | View Log

Rev 4 Rev 270
/* x86s running Linux */
/* x86s running Linux */
 
 
#include <string.h>
#include <string.h>
 
 
static char rcsid[] = "$Id: linux.c,v 1.5 1998/09/16 20:41:09 drh Exp $";
static char rcsid[] = "$Id: linux.c,v 1.5 1998/09/16 20:41:09 drh Exp $";
 
 
#ifndef LCCDIR
#ifndef LCCDIR
#define LCCDIR "/usr/local/lib/lcc/"
#define LCCDIR "/usr/local/lib/lcc/"
#endif
#endif
 
 
char *suffixes[] = { ".c", ".i", ".s", ".o", ".out", 0 };
char *suffixes[] = { ".c", ".i", ".s", ".o", ".out", 0 };
char inputs[256] = "";
char inputs[256] = "";
char *cpp[] = { LCCDIR "gcc/cpp",
char *cpp[] = { LCCDIR "gcc/cpp",
        "-U__GNUC__", "-D_POSIX_SOURCE", "-D__STDC__=1", "-D__STRICT_ANSI__",
        "-U__GNUC__", "-D_POSIX_SOURCE", "-D__STDC__=1", "-D__STRICT_ANSI__",
        "-Dunix", "-Di386", "-Dlinux",
        "-Dunix", "-Di386", "-Dlinux",
        "-D__unix__", "-D__i386__", "-D__linux__", "-D__signed__=signed",
        "-D__unix__", "-D__i386__", "-D__linux__", "-D__signed__=signed",
        "$1", "$2", "$3", 0 };
        "$1", "$2", "$3", 0 };
char *include[] = {"-I" LCCDIR "include", "-I" LCCDIR "gcc/include", "-I/usr/include", 0 };
char *include[] = {"-I" LCCDIR "include", "-I" LCCDIR "gcc/include", "-I/usr/include", 0 };
char *com[] = {LCCDIR "rcc", "-target=x86/linux", "$1", "$2", "$3", 0 };
char *com[] = {LCCDIR "rcc", "-target=x86/linux", "$1", "$2", "$3", 0 };
char *as[] = { "/usr/bin/as", "-o", "$3", "$1", "$2", 0 };
char *as[] = { "/usr/bin/as", "-o", "$3", "$1", "$2", 0 };
char *ld[] = {
char *ld[] = {
        /*  0 */ "/usr/bin/ld", "-m", "elf_i386", "-dynamic-linker",
        /*  0 */ "/usr/bin/ld", "-m", "elf_i386", "-dynamic-linker",
        /*  4 */ "/lib/ld-linux.so.2", "-o", "$3",
        /*  4 */ "/lib/ld-linux.so.2", "-o", "$3",
        /*  7 */ "/usr/lib/crt1.o", "/usr/lib/crti.o",
        /*  7 */ "/usr/lib/crt1.o", "/usr/lib/crti.o",
        /*  9 */ LCCDIR "/gcc/crtbegin.o",
        /*  9 */ LCCDIR "/gcc/crtbegin.o",
                 "$1", "$2",
                 "$1", "$2",
        /* 12 */ "-L" LCCDIR,
        /* 12 */ "-L" LCCDIR,
        /* 13 */ "-llcc",
        /* 13 */ "-llcc",
        /* 14 */ "-L" LCCDIR "/gcc", "-lgcc", "-lc", "-lm",
        /* 14 */ "-L" LCCDIR "/gcc", "-lgcc", "-lc", "-lm",
        /* 18 */ "",
        /* 18 */ "",
        /* 19 */ LCCDIR "/gcc/crtend.o", "/usr/lib/crtn.o",
        /* 19 */ LCCDIR "/gcc/crtend.o", "/usr/lib/crtn.o",
        0 };
        0 };
 
 
extern char *concat(char *, char *);
extern char *concat(char *, char *);
 
 
int option(char *arg) {
int option(char *arg) {
        if (strncmp(arg, "-lccdir=", 8) == 0) {
        if (strncmp(arg, "-lccdir=", 8) == 0) {
                cpp[0] = concat(&arg[8], "/gcc/cpp");
                cpp[0] = concat(&arg[8], "/gcc/cpp");
                include[0] = concat("-I", concat(&arg[8], "/include"));
                include[0] = concat("-I", concat(&arg[8], "/include"));
                include[1] = concat("-I", concat(&arg[8], "/gcc/include"));
                include[1] = concat("-I", concat(&arg[8], "/gcc/include"));
                ld[9]  = concat(&arg[8], "/gcc/crtbegin.o");
                ld[9]  = concat(&arg[8], "/gcc/crtbegin.o");
                ld[12] = concat("-L", &arg[8]);
                ld[12] = concat("-L", &arg[8]);
                ld[14] = concat("-L", concat(&arg[8], "/gcc"));
                ld[14] = concat("-L", concat(&arg[8], "/gcc"));
                ld[19] = concat(&arg[8], "/gcc/crtend.o");
                ld[19] = concat(&arg[8], "/gcc/crtend.o");
                com[0] = concat(&arg[8], "/rcc");
                com[0] = concat(&arg[8], "/rcc");
        } else if (strcmp(arg, "-p") == 0 || strcmp(arg, "-pg") == 0) {
        } else if (strcmp(arg, "-p") == 0 || strcmp(arg, "-pg") == 0) {
                ld[7] = "/usr/lib/gcrt1.o";
                ld[7] = "/usr/lib/gcrt1.o";
                ld[18] = "-lgmon";
                ld[18] = "-lgmon";
        } else if (strcmp(arg, "-b") == 0)
        } else if (strcmp(arg, "-b") == 0)
                ;
                ;
        else if (strcmp(arg, "-g") == 0)
        else if (strcmp(arg, "-g") == 0)
                ;
                ;
        else if (strncmp(arg, "-ld=", 4) == 0)
        else if (strncmp(arg, "-ld=", 4) == 0)
                ld[0] = &arg[4];
                ld[0] = &arg[4];
        else if (strcmp(arg, "-static") == 0) {
        else if (strcmp(arg, "-static") == 0) {
                ld[3] = "-static";
                ld[3] = "-static";
                ld[4] = "";
                ld[4] = "";
        } else
        } else
                return 0;
                return 0;
        return 1;
        return 1;
}
}
 
 

powered by: WebSVN 2.1.0

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