diff options
author | midipix <writeonce@midipix.org> | 2021-06-10 08:31:23 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-06-10 08:31:23 +0000 |
commit | 6f41153880f561e092fb7701a2db0facf6b6ffd9 (patch) | |
tree | 01f4371826c5cd595b84b81b46b2cbeb25b55e5b /src/driver/slbt_driver_ctx.c | |
parent | e0e31fbb6cf0f9b1feec89893747dd4df30cebf6 (diff) | |
download | slibtool-6f41153880f561e092fb7701a2db0facf6b6ffd9.tar.bz2 slibtool-6f41153880f561e092fb7701a2db0facf6b6ffd9.tar.xz |
driver: added --dumpmachine support.
Diffstat (limited to 'src/driver/slbt_driver_ctx.c')
-rw-r--r-- | src/driver/slbt_driver_ctx.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c index eed51bd..f8393ef 100644 --- a/src/driver/slbt_driver_ctx.c +++ b/src/driver/slbt_driver_ctx.c @@ -295,6 +295,7 @@ static int slbt_split_argv( struct argv_entry * finish; struct argv_entry * features; struct argv_entry * ccwrap; + struct argv_entry * dumpmachine; const struct argv_option ** popt; const struct argv_option ** optout; const struct argv_option * optv[SLBT_OPTV_ELEMENTS]; @@ -337,8 +338,8 @@ static int slbt_split_argv( meta = argv_get(argv,optv,ARGV_VERBOSITY_NONE,fderr); } - /* missing all of --mode, --help, --version, --config, --features, and --finish? */ - mode = help = version = config = finish = features = ccwrap = 0; + /* missing all of --mode, --help, --version, --config, --dumpmachine, --features, and --finish? */ + mode = help = version = config = finish = features = ccwrap = dumpmachine = 0; for (entry=meta->entries; entry->fopt; entry++) if (entry->tag == TAG_MODE) @@ -355,10 +356,12 @@ static int slbt_split_argv( features = entry; else if (entry->tag == TAG_CCWRAP) ccwrap = entry; + else if (entry->tag == TAG_DUMPMACHINE) + dumpmachine = entry; argv_free(meta); - if (!mode && !help && !version && !config && !finish && !features) { + if (!mode && !help && !version && !config && !finish && !features && !dumpmachine) { slbt_dprintf(fderr, "%s: error: --mode must be specified.\n", program); @@ -366,7 +369,7 @@ static int slbt_split_argv( } /* missing compiler? */ - if (!ctx.unitidx && !help && !version && !finish && !features) { + if (!ctx.unitidx && !help && !version && !finish && !features && !dumpmachine) { if (flags & SLBT_DRIVER_VERBOSITY_ERRORS) slbt_dprintf(fderr, "%s: error: <compiler> is missing.\n", @@ -491,7 +494,7 @@ static int slbt_split_argv( if (ctx.unitidx) { (void)0; - } else if (help || version || features) { + } else if (help || version || features || dumpmachine) { for (i=0; i<argc; i++) sargv->targv[i] = argv[i]; @@ -1482,6 +1485,10 @@ int slbt_get_driver_ctx( cctx.drvflags |= SLBT_DRIVER_CONFIG; break; + case TAG_DUMPMACHINE: + cctx.drvflags |= SLBT_DRIVER_OUTPUT_MACHINE; + break; + case TAG_DEBUG: cctx.drvflags |= SLBT_DRIVER_DEBUG; break; |