[hackers] [scc] [driver] add o flag for linking to specified file || Quentin Rameau

From: <git_AT_suckless.org>
Date: Tue, 7 Jun 2016 14:30:11 +0200 (CEST)

commit 3dd71e3263f1e6cca98649a1376c89bb22638c78
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Sat Jun 4 13:12:17 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Tue Jun 7 14:30:03 2016 +0200

    [driver] add o flag for linking to specified file

diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index 332bd12..4f0944d 100644
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
_AT_@ -160,10 +160,9 @@ settool(int tool, char *input, int nexttool)
                 t->args[2] = t->outfile;
                 break;
         case LD:
- if (!t->outfile) {
+ if (!t->outfile)
                         t->outfile = "a.out";
- t->args[2] = t->outfile;
- }
+ t->args[2] = t->outfile;
                 break;
         case TEE:
                 switch (nexttool) {
_AT_@ -354,7 +353,7 @@ build(char *file)
 static void
 usage(void)
 {
- die("usage: %s [-E|-kS] [-m arch] [-D macro[=val]]... "
+ die("usage: %s [-E|-kS] [-m arch] [-o binout] [-D macro[=val]]... "
             "[-I dir]... file ...", argv0);
 }
 
_AT_@ -387,6 +386,9 @@ main(int argc, char *argv[])
         case 'm':
                 arch = EARGF(usage());
                 break;
+ case 'o':
+ tools[LD].outfile = EARGF(usage());
+ break;
         case '-':
                 fprintf(stderr,
                         "scc: ignored parameter --%s\n", EARGF(usage()));
Received on Tue Jun 07 2016 - 14:30:11 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 07 2016 - 14:36:16 CEST