summaryrefslogtreecommitdiffhomepage
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-09 23:26:17 -0500
committermidipix <writeonce@midipix.org>2016-03-10 08:32:40 -0500
commit5aae4bb6c4d410c35c7ced08cae21ff3273d5155 (patch)
tree60e9b3206587873c6375bfe1001d748679befa97 /src/logic
parentdf088e66dafc9df4a28070b24c3815bc8f4b1aec (diff)
downloadslibtool-5aae4bb6c4d410c35c7ced08cae21ff3273d5155.tar.bz2
slibtool-5aae4bb6c4d410c35c7ced08cae21ff3273d5155.tar.xz
struct slbt_exec_ctx: added placeholders for quick handling of different modes.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/slbt_exec_ctx.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index e191585..cfa7434 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -183,20 +183,19 @@ int slbt_get_exec_ctx(
}
}
- if (dctx->cctx->mode == SLBT_MODE_COMPILE) {
- if (dctx->cctx->drvflags & SLBT_DRIVER_SHARED) {
- ictx->ctx.argv[i++] = "-DPIC";
- ictx->ctx.argv[i++] = "-fPIC";
- }
+ /* placeholders for -DPIC, -fPIC, -c, -o, <output> */
+ ictx->ctx.dpic = &ictx->ctx.argv[i++];
+ ictx->ctx.fpic = &ictx->ctx.argv[i++];
+ ictx->ctx.cass = &ictx->ctx.argv[i++];
- ictx->ctx.argv[i++] = "-c";
- }
+ ictx->ctx.lout[0] = &ictx->ctx.argv[i++];
+ ictx->ctx.lout[1] = &ictx->ctx.argv[i++];
/* output file name */
if (ref) {
- ictx->ctx.argv[i++] = "-o";
- ictx->ctx.argv[i++] = ch;
- ictx->ctx.lobjname = ch;
+ *ictx->ctx.lout[0] = "-o";
+ *ictx->ctx.lout[1] = ch;
+ ictx->ctx.lobjname = ch;
sprintf(ch,"%s%s",
ictx->ctx.ldirname,
@@ -229,3 +228,14 @@ void slbt_free_exec_ctx(struct slbt_exec_ctx * ctx)
slbt_free_exec_ctx_impl(ictx,0);
}
}
+
+
+void slbt_reset_placeholders(struct slbt_exec_ctx * ectx)
+{
+ *ectx->dpic = "-DSLIBTOOL_PLACEHOLDER_DPIC";
+ *ectx->fpic = "-DSLIBTOOL_PLACEHOLDER_FPIC";
+ *ectx->cass = "-DSLIBTOOL_PLACEHOLDER_COMPILE_ASSEMBLE";
+
+ *ectx->lout[0] = "-DSLIBTOOL_PLACEHOLDER_OUTPUT_SWITCH";
+ *ectx->lout[1] = "-DSLIBTOOL_PLACEHOLDER_OUTPUT_FILE";
+}