summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-10 00:15:34 -0500
committermidipix <writeonce@midipix.org>2016-03-10 08:32:40 -0500
commite02305465d278aa96f5650b41a592fe97208d208 (patch)
tree72dd36fa967ea9f015bc988fe3b6a8499d90a4a9
parent5aae4bb6c4d410c35c7ced08cae21ff3273d5155 (diff)
downloadslibtool-e02305465d278aa96f5650b41a592fe97208d208.tar.bz2
slibtool-e02305465d278aa96f5650b41a592fe97208d208.tar.xz
slbt_get_exec_ctx(): added support for .aobjname.
-rw-r--r--include/slibtool/slibtool.h1
-rw-r--r--src/logic/slbt_exec_ctx.c17
2 files changed, 13 insertions, 5 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index b9327f4..88bb26e 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -90,6 +90,7 @@ struct slbt_exec_ctx {
char * ldirname;
char * lbasename;
char * lobjname;
+ char * aobjname;
pid_t pid;
int exitcode;
};
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index cfa7434..f6bea2e 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -77,11 +77,11 @@ static struct slbt_exec_ctx_impl * slbt_exec_ctx_alloc(
else
size += sizeof('\0') + strlen(*parg);
- /* buffer size (ldirname, lbasename, lobjname) */
+ /* buffer size (ldirname, lbasename, lobjname, aobjname) */
if (dctx->cctx->output)
- size += 3*strlen(dctx->cctx->output);
+ size += 4*strlen(dctx->cctx->output);
else if ((csrc = slbt_source_file(dctx->cctx->cargv)))
- size += 3*strlen(csrc);
+ size += 4*strlen(csrc);
/* alloc */
if (!(args = malloc(size)))
@@ -197,9 +197,16 @@ int slbt_get_exec_ctx(
*ictx->ctx.lout[1] = ch;
ictx->ctx.lobjname = ch;
- sprintf(ch,"%s%s",
+ ch += sprintf(ch,"%s%s",
ictx->ctx.ldirname,
- ictx->ctx.lbasename);
+ ictx->ctx.lbasename)
+ + sizeof('\0');
+
+ ictx->ctx.aobjname = ch;
+
+ ch += sprintf(ch,"%s",ictx->ctx.ldirname);
+ ch -= strlen(".libs/");
+ sprintf(ch,ictx->ctx.lbasename);
}
*ectx = &ictx->ctx;