Mercurial > projects > ldc
diff dmd/mars.c @ 567:aaba4f7c6d8a
Get rid of runtime path. Allow defaultlib and debuglib switches to be given multiple times.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 02 Sep 2008 19:14:25 +0200 |
parents | cbe08531430f |
children | f75b16f1e405 |
line wrap: on
line diff
--- a/dmd/mars.c Sat Aug 30 10:31:04 2008 +0200 +++ b/dmd/mars.c Tue Sep 02 19:14:25 2008 +0200 @@ -223,11 +223,10 @@ -ignore ignore unsupported pragmas\n\ \n\ Path options:\n\ - -R<path> provide path to the directory containing the runtime library\n\ -I<path> where to look for imports\n\ -J<path> where to look for string imports\n\ - -debuglib=name set symbolic debug library to name (currently ignored)\n\ - -defaultlib=name set default library to name (currently ignored)\n\ + -defaultlib=name set default library for non-debug build\n\ + -debuglib=name set default library for debug build\n\ \n\ Misc options:\n\ -v verbose\n\ @@ -321,9 +320,6 @@ global.params.runtimeImppath = 0; global.params.useInlineAsm = 1; - global.params.defaultlibname = "phobos"; - global.params.debuglibname = global.params.defaultlibname; - // Predefine version identifiers #if IN_LLVM VersionCondition::addPredefinedGlobalIdent("LLVM"); @@ -551,10 +547,6 @@ global.params.fileImppath = new Array(); global.params.fileImppath->push(p + 2); } - else if (p[1] == 'R') - { - global.params.runtimePath = p+2; - } else if (memcmp(p + 1, "debug", 5) == 0 && p[6] != 'l') { // Parse: @@ -635,11 +627,15 @@ } else if (memcmp(p + 1, "defaultlib=", 11) == 0) { - global.params.defaultlibname = p + 1 + 11; + if(!global.params.defaultlibnames) + global.params.defaultlibnames = new Array(); + global.params.defaultlibnames->push(p + 1 + 11); } else if (memcmp(p + 1, "debuglib=", 9) == 0) { - global.params.debuglibname = p + 1 + 9; + if(!global.params.debuglibnames) + global.params.debuglibnames = new Array(); + global.params.debuglibnames->push(p + 1 + 9); } else if (strcmp(p + 1, "run") == 0) { global.params.run = 1; @@ -694,6 +690,29 @@ return EXIT_FAILURE; } + Array* libs; + if (global.params.symdebug) + libs = global.params.debuglibnames; + else + libs = global.params.defaultlibnames; + + if (libs) + { + for (int i = 0; i < libs->dim; i++) + { + char *arg = (char *)mem.malloc(64); + strcpy(arg, "-l"); + strncat(arg, (char *)libs->data[i], 64); + global.params.linkswitches->push(arg); + } + } + else + { + char *arg = (char *)mem.malloc(64); + strcpy(arg, "-ltango-base-llvmdc-native"); + global.params.linkswitches->push(arg); + } + if (global.params.run) global.params.quiet = 1;