summaryrefslogtreecommitdiff
path: root/src/driver/slbt_driver_ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/driver/slbt_driver_ctx.c')
-rw-r--r--src/driver/slbt_driver_ctx.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index b230ce8..baf08fb 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -192,6 +192,7 @@ static int slbt_split_argv(
struct argv_entry * entry;
struct argv_entry * mode;
struct argv_entry * config;
+ struct argv_entry * finish;
const struct argv_option * option;
const struct argv_option * options = slbt_default_options;
struct argv_ctx ctx = {ARGV_VERBOSITY_NONE,
@@ -216,15 +217,6 @@ static int slbt_split_argv(
return -1;
}
- /* missing compiler? */
- if (!ctx.unitidx) {
- if (flags & SLBT_DRIVER_VERBOSITY_ERRORS)
- fprintf(stderr,
- "%s: error: <compiler> is missing.\n",
- program);
- return -1;
- }
-
/* obtain slibtool's own arguments */
compiler = argv[ctx.unitidx];
argv[ctx.unitidx] = 0;
@@ -232,22 +224,33 @@ static int slbt_split_argv(
meta = argv_get(argv,options,ARGV_VERBOSITY_NONE);
argv[ctx.unitidx] = compiler;
- /* missing both --mode and --config? */
- for (mode=0, config=0, entry=meta->entries; entry->fopt; entry++)
+ /* missing all of --mode, --config, and --finish? */
+ for (mode=0, config=0, finish=0, entry=meta->entries; entry->fopt; entry++)
if (entry->tag == TAG_MODE)
mode = entry;
else if (entry->tag == TAG_CONFIG)
config = entry;
+ else if (entry->tag == TAG_FINISH)
+ finish = entry;
argv_free(meta);
- if (!mode && !config) {
+ if (!mode && !config && !finish) {
fprintf(stderr,
"%s: error: --mode must be specified.\n",
program);
return -1;
}
+ /* missing compiler? */
+ if (!ctx.unitidx && !finish) {
+ if (flags & SLBT_DRIVER_VERBOSITY_ERRORS)
+ fprintf(stderr,
+ "%s: error: <compiler> is missing.\n",
+ program);
+ return -1;
+ }
+
/* allocate split vectors */
for (argc=0, targv=argv; *targv; targv++)
argc++;
@@ -841,6 +844,10 @@ int slbt_get_driver_ctx(
cctx.mode = SLBT_MODE_UNINSTALL;
break;
+ case TAG_FINISH:
+ cctx.mode = SLBT_MODE_FINISH;
+ break;
+
case TAG_DRY_RUN:
cctx.drvflags |= SLBT_DRIVER_DRY_RUN;
break;