summaryrefslogtreecommitdiffhomepage
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
parente02305465d278aa96f5650b41a592fe97208d208 (diff)
downloadslibtool-e88a3938a2b09ecc0dad759a2602784cb224b58a.tar.bz2
slibtool-e88a3938a2b09ecc0dad759a2602784cb224b58a.tar.xz
slbt_get_exec_ctx(): added support for .ltobjname.
-rw-r--r--include/slibtool/slibtool.h1
-rw-r--r--src/logic/slbt_exec_ctx.c16
2 files changed, 15 insertions, 2 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index 88bb26e..8ca528f 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -91,6 +91,7 @@ struct slbt_exec_ctx {
char * lbasename;
char * lobjname;
char * aobjname;
+ char * ltobjname;
pid_t pid;
int exitcode;
};
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;