diff options
author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-10-05 03:13:20 +0000 |
---|---|---|
committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-10-05 03:13:20 +0000 |
commit | 6f0ade1fc81015a421ee97c38b9896c2f0f60854 (patch) | |
tree | 30f499b40d6d1b3967bd353e424e210f4df4a9a5 /code/tools/lcc/etc | |
parent | 2b9cd1bd7e11ad6d1fd04d2cb4c9fd04f93b09ab (diff) | |
download | ioquake3-aero-6f0ade1fc81015a421ee97c38b9896c2f0f60854.tar.gz ioquake3-aero-6f0ade1fc81015a421ee97c38b9896c2f0f60854.zip |
* Fixes to the MinGW vm compiler
* General MinGW tweaks
git-svn-id: svn://svn.icculus.org/quake3/trunk@139 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/tools/lcc/etc')
-rw-r--r-- | code/tools/lcc/etc/lcc.c | 25 | ||||
-rw-r--r-- | code/tools/lcc/etc/linux.c | 10 |
2 files changed, 33 insertions, 2 deletions
diff --git a/code/tools/lcc/etc/lcc.c b/code/tools/lcc/etc/lcc.c index 89706df..4a6d0f6 100644 --- a/code/tools/lcc/etc/lcc.c +++ b/code/tools/lcc/etc/lcc.c @@ -74,6 +74,31 @@ static List lccinputs; /* list of input directories */ int main(int argc, char *argv[]) { int i, j, nf; +#ifdef _WIN32 + // Tim Angus <tim@ngus.net> 05/09/05 + // Append the base path of this file to the PATH + // There are probably (much) cleaner ways of doing this, but + // IANAWD (Windows Developer) + { + char basepath[ 1024 ]; + char path[ 4096 ]; + char *p; + + strncpy( basepath, argv[ 0 ], 1024 ); + p = strrchr( basepath, '\\' ); + + if( p ) + { + *p = '\0'; + strncpy( path, "PATH=", 4096 ); + strncat( path, getenv( "PATH" ), 4096 ); + strncat( path, ";", 4096 ); + strncat( path, basepath, 4096 ); + _putenv( path ); + } + } +#endif + progname = argv[0]; ac = argc + 50; av = alloc(ac*sizeof(char *)); diff --git a/code/tools/lcc/etc/linux.c b/code/tools/lcc/etc/linux.c index bf50025..f93a0ee 100644 --- a/code/tools/lcc/etc/linux.c +++ b/code/tools/lcc/etc/linux.c @@ -14,17 +14,23 @@ removed __linux__ preprocessor define (confuses the preprocessor, we are doing b //#define LCCDIR "/usr/local/lib/lcc/" #endif +#ifdef _WIN32 +#define BINEXT ".exe" +#else +#define BINEXT "" +#endif + char *suffixes[] = { ".c", ".i", ".asm", ".o", ".out", 0 }; char inputs[256] = ""; // TTimo experimental: do not compile with the __linux__ define, we are doing bytecode! -char *cpp[] = { LCCDIR "q3cpp", +char *cpp[] = { LCCDIR "q3cpp" BINEXT, "-U__GNUC__", "-D_POSIX_SOURCE", "-D__STDC__=1", "-D__STRICT_ANSI__", "-Dunix", "-Di386", "-Dlinux", "-D__unix__", "-D__i386__", "-D__signed__=signed", "$1", "$2", "$3", 0 }; char *include[] = {"-I" LCCDIR "include", "-I" LCCDIR "gcc/include", "-I/usr/include", "-I" SYSTEM "include", 0 }; -char *com[] = {LCCDIR "q3rcc", "-target=bytecode", "$1", "$2", "$3", 0 }; +char *com[] = {LCCDIR "q3rcc" BINEXT, "-target=bytecode", "$1", "$2", "$3", 0 }; char *as[] = { "/usr/bin/as", "-o", "$3", "$1", "$2", 0 }; // NOTE TTimo I don't think we have any use with the native linkage // our target is always bytecode.. |