Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/link.c b/src/link.c
- index 5d41fb0..a538dda 100644
- --- a/src/link.c
- +++ b/src/link.c
- @@ -340,6 +340,11 @@ int runLINK()
- argv.push(p);
- }
- + for (size_t i = 0; i < global.params.ccswitches->dim; i++)
- + { char *p = global.params.ccswitches->tdata()[i];
- + argv.push(p);
- + }
- +
- /* Add each library, prefixing it with "-l".
- * The order of libraries passed is:
- * 1. any libraries passed with -L command line switch
- diff --git a/src/mars.c b/src/mars.c
- index d680124..da73663 100644
- --- a/src/mars.c
- +++ b/src/mars.c
- @@ -278,8 +278,11 @@ Usage:\n\
- files.d D source files\n\
- @cmdfile read arguments from cmdfile\n\
- -c do not link\n\
- - -cov do code coverage analysis\n\
- - -D generate documentation\n\
- + -cov do code coverage analysis\n"
- +#if linux || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun&&__SVR4
- +" -cflag=ccflag pass ccflag to the C compiler/linker driver\n"
- +#endif
- +" -D generate documentation\n\
- -Dddocdir write documentation file to docdir directory\n\
- -Dffilename write documentation file to filename\n\
- -d allow deprecated features\n\
- @@ -398,6 +401,7 @@ int main(int argc, char *argv[])
- global.params.quiet = 1;
- global.params.linkswitches = new Strings();
- + global.params.ccswitches = new Strings();
- global.params.libfiles = new Strings();
- global.params.objfiles = new Strings();
- global.params.ddocfiles = new Strings();
- @@ -733,6 +737,12 @@ int main(int argc, char *argv[])
- {
- global.params.linkswitches->push(p + 2);
- }
- +#if linux || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun&&__SVR4
- + else if (memcmp(p + 1, "cflag=", 6) == 0)
- + {
- + global.params.ccswitches->push(p + 1 + 6);
- + }
- +#endif
- else if (memcmp(p + 1, "defaultlib=", 11) == 0)
- {
- global.params.defaultlibname = p + 1 + 11;
- diff --git a/src/mars.h b/src/mars.h
- index 3b44269..66409c9 100644
- --- a/src/mars.h
- +++ b/src/mars.h
- @@ -230,6 +230,7 @@ struct Param
- // Linker stuff
- Strings *objfiles;
- Strings *linkswitches;
- + Strings *ccswitches;
- Strings *libfiles;
- char *deffile;
- char *resfile;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement