summaryrefslogtreecommitdiffhomepage
path: root/src/driver/slbt_driver_ctx.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-06-18 23:26:01 -0400
committermidipix <writeonce@midipix.org>2016-06-18 23:26:01 -0400
commitb9575f640dcf44bbce4f97e5e92289b34d1d073a (patch)
tree1def3e4b89826bf4a828daccd8b8e080e46fdd75 /src/driver/slbt_driver_ctx.c
parent3c03b34ecac2d81e9c1b3d291525f2ad29661256 (diff)
downloadslibtool-b9575f640dcf44bbce4f97e5e92289b34d1d073a.tar.bz2
slibtool-b9575f640dcf44bbce4f97e5e92289b34d1d073a.tar.xz
driver: added --finish support.
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;