summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-10 03:46:28 -0500
committermidipix <writeonce@midipix.org>2016-03-10 08:32:40 -0500
commite88a3938a2b09ecc0dad759a2602784cb224b58a (patch)
tree772984b6f02595da965bb02dfd1636dad1fb7aab /src
parente02305465d278aa96f5650b41a592fe97208d208 (diff)
downloadslibtool-e88a3938a2b09ecc0dad759a2602784cb224b58a.tar.bz2
slibtool-e88a3938a2b09ecc0dad759a2602784cb224b58a.tar.xz
slbt_get_exec_ctx(): added support for .ltobjname.
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_ctx.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index f6bea2e..40872a0 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -77,7 +77,7 @@ static struct slbt_exec_ctx_impl * slbt_exec_ctx_alloc(
else
size += sizeof('\0') + strlen(*parg);
- /* buffer size (ldirname, lbasename, lobjname, aobjname) */
+ /* buffer size (ldirname, lbasename, lobjname, aobjname, ltobjname) */
if (dctx->cctx->output)
size += 4*strlen(dctx->cctx->output);
else if ((csrc = slbt_source_file(dctx->cctx->cargv)))
@@ -206,7 +206,19 @@ int slbt_get_exec_ctx(
ch += sprintf(ch,"%s",ictx->ctx.ldirname);
ch -= strlen(".libs/");
- sprintf(ch,ictx->ctx.lbasename);
+ ch += sprintf(ch,"%s",
+ ictx->ctx.lbasename)
+ + sizeof('\0');
+
+ ictx->ctx.ltobjname = ch;
+ strcpy(ch,ictx->ctx.aobjname);
+
+ if ((ch = strrchr(ch,'.')))
+ ch += sprintf(ch,"%s",
+ (dctx->cctx->mode == SLBT_MODE_COMPILE)
+ ? ".lo"
+ : ".la")
+ + sizeof('\0');
}
*ectx = &ictx->ctx;