b9575f driver: added --finish support.

Authored and Committed by midipix 8 years ago
    driver: added --finish support.
    
        
file modified
+19 -12
src/driver/slbt_driver_ctx.c CHANGED
@@ -192,6 +192,7 @@ static int slbt_split_argv(
192
192
struct argv_entry * entry;
193
193
struct argv_entry * mode;
194
194
struct argv_entry * config;
195
+ struct argv_entry * finish;
195
196
const struct argv_option * option;
196
197
const struct argv_option * options = slbt_default_options;
197
198
struct argv_ctx ctx = {ARGV_VERBOSITY_NONE,
@@ -216,15 +217,6 @@ static int slbt_split_argv(
216
217
return -1;
217
218
}
218
219
219
- /* missing compiler? */
220
- if (!ctx.unitidx) {
221
- if (flags & SLBT_DRIVER_VERBOSITY_ERRORS)
222
- fprintf(stderr,
223
- "%s: error: <compiler> is missing.\n",
224
- program);
225
- return -1;
226
- }
227
-
228
220
/* obtain slibtool's own arguments */
229
221
compiler = argv[ctx.unitidx];
230
222
argv[ctx.unitidx] = 0;
@@ -232,22 +224,33 @@ static int slbt_split_argv(
232
224
meta = argv_get(argv,options,ARGV_VERBOSITY_NONE);
233
225
argv[ctx.unitidx] = compiler;
234
226
235
- /* missing both --mode and --config? */
236
- for (mode=0, config=0, entry=meta->entries; entry->fopt; entry++)
227
+ /* missing all of --mode, --config, and --finish? */
228
+ for (mode=0, config=0, finish=0, entry=meta->entries; entry->fopt; entry++)
237
229
if (entry->tag == TAG_MODE)
238
230
mode = entry;
239
231
else if (entry->tag == TAG_CONFIG)
240
232
config = entry;
233
+ else if (entry->tag == TAG_FINISH)
234
+ finish = entry;
241
235
242
236
argv_free(meta);
243
237
244
- if (!mode && !config) {
238
+ if (!mode && !config && !finish) {
245
239
fprintf(stderr,
246
240
"%s: error: --mode must be specified.\n",
247
241
program);
248
242
return -1;
249
243
}
250
244
245
+ /* missing compiler? */
246
+ if (!ctx.unitidx && !finish) {
247
+ if (flags & SLBT_DRIVER_VERBOSITY_ERRORS)
248
+ fprintf(stderr,
249
+ "%s: error: <compiler> is missing.\n",
250
+ program);
251
+ return -1;
252
+ }
253
+
251
254
/* allocate split vectors */
252
255
for (argc=0, targv=argv; *targv; targv++)
253
256
argc++;
@@ -841,6 +844,10 @@ int slbt_get_driver_ctx(
841
844
cctx.mode = SLBT_MODE_UNINSTALL;
842
845
break;
843
846
847
+ case TAG_FINISH:
848
+ cctx.mode = SLBT_MODE_FINISH;
849
+ break;
850
+
844
851
case TAG_DRY_RUN:
845
852
cctx.drvflags |= SLBT_DRIVER_DRY_RUN;
846
853
break;
src/internal/slibtool_driver_impl.h CHANGED
@@ -21,6 +21,7 @@ enum app_tags {
21
21
TAG_FEATURES,
22
22
TAG_LEGABITS,
23
23
TAG_MODE,
24
+ TAG_FINISH,
24
25
TAG_WARNINGS,
25
26
TAG_ANNOTATE,
26
27
TAG_DEPS,
file modified
+3 -0
src/skin/slbt_skin_default.c CHANGED
@@ -22,6 +22,9 @@ const struct argv_option slbt_default_options[] = {
22
22
"their addition is expected before "
23
23
"the next release"},
24
24
25
+ {"finish", 0,TAG_FINISH,ARGV_OPTARG_NONE,0,0,0,
26
+ "same as --mode=finish"},
27
+
25
28
{"dry-run", 'n',TAG_DRY_RUN,ARGV_OPTARG_NONE,0,0,0,
26
29
"do not spawn any processes, "
27
30
"do not make any changes to the file system"},