summaryrefslogtreecommitdiffhomepage
path: root/src/driver
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-06-23 00:14:11 -0400
committermidipix <writeonce@midipix.org>2018-06-23 01:41:52 -0400
commit3c1679cf361e3a919dcf70b7b73367d67caa65f8 (patch)
treebfd5ffa6e7cac391edbdc5ea818670def465f045 /src/driver
parent88e561cb708235241310f39b4a0f640c4805143e (diff)
downloadslibtool-3c1679cf361e3a919dcf70b7b73367d67caa65f8.tar.bz2
slibtool-3c1679cf361e3a919dcf70b7b73367d67caa65f8.tar.xz
driver: added SLBT_MODE_INFO, for more elegant flow control.
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/slbt_driver_ctx.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 77c505a..2f08895 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -414,8 +414,9 @@ static int slbt_init_host_params(
else
base = cctx->cargv[0];
- if ((cctx->mode == SLBT_MODE_COMPILE) || (cctx->mode == SLBT_MODE_LINK))
- fdumpmachine = true;
+ fdumpmachine = (cctx->mode == SLBT_MODE_COMPILE)
+ || (cctx->mode == SLBT_MODE_LINK)
+ || (cctx->mode == SLBT_MODE_INFO);
/* support the portbld <--> unknown synonym */
if (!(drvhost->machine = strdup(SLBT_MACHINE)))
@@ -1164,6 +1165,10 @@ int slbt_get_driver_ctx(
cctx.output = 0;
}
+ /* info mode */
+ if (cctx.drvflags & (SLBT_DRIVER_CONFIG | SLBT_DRIVER_FEATURES))
+ cctx.mode = SLBT_MODE_INFO;
+
/* driver context */
if (!(ctx = slbt_driver_ctx_alloc(meta,&cctx)))
return slbt_get_driver_ctx_fail(meta);
@@ -1177,9 +1182,10 @@ int slbt_get_driver_ctx(
ctx->cctx.cargv = sargv.cargv;
/* host params */
- if ((cctx.drvflags & SLBT_DRIVER_HEURISTICS)
- || (cctx.drvflags & SLBT_DRIVER_CONFIG)
- || (cctx.mode != SLBT_MODE_COMPILE)) {
+ if (cctx.mode == SLBT_MODE_COMPILE) {
+ (void)0;
+
+ } else {
if (slbt_init_host_params(
&ctx->cctx,
&ctx->host,
@@ -1187,10 +1193,11 @@ int slbt_get_driver_ctx(
&ctx->cctx.cfgmeta)) {
slbt_free_driver_ctx(&ctx->ctx);
return -1;
- } else
- slbt_init_flavor_settings(
- &ctx->cctx,0,
- &ctx->cctx.settings);
+ }
+
+ slbt_init_flavor_settings(
+ &ctx->cctx,0,
+ &ctx->cctx.settings);
}
/* ldpath */