Mercurial > projects > ldc
comparison dmd/mars.c @ 568:f75b16f1e405
Automated merge with http://hg.dsource.org/projects/llvmdc
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 02 Sep 2008 19:14:37 +0200 |
parents | 68d7df3f9b05 aaba4f7c6d8a |
children | 926a03711ca8 cbd6c8073a32 |
comparison
equal
deleted
inserted
replaced
566:68d7df3f9b05 | 568:f75b16f1e405 |
---|---|
221 -annotate annotate the bitcode with human readable source code\n\ | 221 -annotate annotate the bitcode with human readable source code\n\ |
222 -dis disassemble module after compiling\n\ | 222 -dis disassemble module after compiling\n\ |
223 -ignore ignore unsupported pragmas\n\ | 223 -ignore ignore unsupported pragmas\n\ |
224 \n\ | 224 \n\ |
225 Path options:\n\ | 225 Path options:\n\ |
226 -R<path> provide path to the directory containing the runtime library\n\ | |
227 -I<path> where to look for imports\n\ | 226 -I<path> where to look for imports\n\ |
228 -J<path> where to look for string imports\n\ | 227 -J<path> where to look for string imports\n\ |
229 -debuglib=name set symbolic debug library to name (currently ignored)\n\ | 228 -defaultlib=name set default library for non-debug build\n\ |
230 -defaultlib=name set default library to name (currently ignored)\n\ | 229 -debuglib=name set default library for debug build\n\ |
231 \n\ | 230 \n\ |
232 Misc options:\n\ | 231 Misc options:\n\ |
233 -v verbose\n\ | 232 -v verbose\n\ |
234 -vv very verbose (does not include -v)\n\ | 233 -vv very verbose (does not include -v)\n\ |
235 -quiet suppress unnecessary messages\n\ | 234 -quiet suppress unnecessary messages\n\ |
318 global.params.noruntime = 0; | 317 global.params.noruntime = 0; |
319 global.params.novalidate = 0; | 318 global.params.novalidate = 0; |
320 global.params.optimizeLevel = -1; | 319 global.params.optimizeLevel = -1; |
321 global.params.runtimeImppath = 0; | 320 global.params.runtimeImppath = 0; |
322 global.params.useInlineAsm = 1; | 321 global.params.useInlineAsm = 1; |
323 | |
324 global.params.defaultlibname = "phobos"; | |
325 global.params.debuglibname = global.params.defaultlibname; | |
326 | 322 |
327 // Predefine version identifiers | 323 // Predefine version identifiers |
328 #if IN_LLVM | 324 #if IN_LLVM |
329 VersionCondition::addPredefinedGlobalIdent("LLVM"); | 325 VersionCondition::addPredefinedGlobalIdent("LLVM"); |
330 VersionCondition::addPredefinedGlobalIdent("LLVMDC"); | 326 VersionCondition::addPredefinedGlobalIdent("LLVMDC"); |
551 { | 547 { |
552 if (!global.params.fileImppath) | 548 if (!global.params.fileImppath) |
553 global.params.fileImppath = new Array(); | 549 global.params.fileImppath = new Array(); |
554 global.params.fileImppath->push(p + 2); | 550 global.params.fileImppath->push(p + 2); |
555 } | 551 } |
556 else if (p[1] == 'R') | |
557 { | |
558 global.params.runtimePath = p+2; | |
559 } | |
560 else if (memcmp(p + 1, "debug", 5) == 0 && p[6] != 'l') | 552 else if (memcmp(p + 1, "debug", 5) == 0 && p[6] != 'l') |
561 { | 553 { |
562 // Parse: | 554 // Parse: |
563 // -debug | 555 // -debug |
564 // -debug=number | 556 // -debug=number |
635 { | 627 { |
636 global.params.linkswitches->push(p + 2); | 628 global.params.linkswitches->push(p + 2); |
637 } | 629 } |
638 else if (memcmp(p + 1, "defaultlib=", 11) == 0) | 630 else if (memcmp(p + 1, "defaultlib=", 11) == 0) |
639 { | 631 { |
640 global.params.defaultlibname = p + 1 + 11; | 632 if(!global.params.defaultlibnames) |
633 global.params.defaultlibnames = new Array(); | |
634 global.params.defaultlibnames->push(p + 1 + 11); | |
641 } | 635 } |
642 else if (memcmp(p + 1, "debuglib=", 9) == 0) | 636 else if (memcmp(p + 1, "debuglib=", 9) == 0) |
643 { | 637 { |
644 global.params.debuglibname = p + 1 + 9; | 638 if(!global.params.debuglibnames) |
639 global.params.debuglibnames = new Array(); | |
640 global.params.debuglibnames->push(p + 1 + 9); | |
645 } | 641 } |
646 else if (strcmp(p + 1, "run") == 0) | 642 else if (strcmp(p + 1, "run") == 0) |
647 { global.params.run = 1; | 643 { global.params.run = 1; |
648 global.params.runargs_length = ((i >= argcstart) ? argc : argcstart) - i - 1; | 644 global.params.runargs_length = ((i >= argcstart) ? argc : argcstart) - i - 1; |
649 if (global.params.runargs_length) | 645 if (global.params.runargs_length) |
694 if (files.dim == 0) | 690 if (files.dim == 0) |
695 { usage(); | 691 { usage(); |
696 return EXIT_FAILURE; | 692 return EXIT_FAILURE; |
697 } | 693 } |
698 | 694 |
695 Array* libs; | |
696 if (global.params.symdebug) | |
697 libs = global.params.debuglibnames; | |
698 else | |
699 libs = global.params.defaultlibnames; | |
700 | |
701 if (libs) | |
702 { | |
703 for (int i = 0; i < libs->dim; i++) | |
704 { | |
705 char *arg = (char *)mem.malloc(64); | |
706 strcpy(arg, "-l"); | |
707 strncat(arg, (char *)libs->data[i], 64); | |
708 global.params.linkswitches->push(arg); | |
709 } | |
710 } | |
711 else | |
712 { | |
713 char *arg = (char *)mem.malloc(64); | |
714 strcpy(arg, "-ltango-base-llvmdc-native"); | |
715 global.params.linkswitches->push(arg); | |
716 } | |
717 | |
699 if (global.params.run) | 718 if (global.params.run) |
700 global.params.quiet = 1; | 719 global.params.quiet = 1; |
701 | 720 |
702 if (global.params.useUnitTests) | 721 if (global.params.useUnitTests) |
703 global.params.useAssert = 1; | 722 global.params.useAssert = 1; |