From e88a3938a2b09ecc0dad759a2602784cb224b58a Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 10 Mar 2016 03:46:28 -0500 Subject: slbt_get_exec_ctx(): added support for .ltobjname. --- include/slibtool/slibtool.h | 1 + src/logic/slbt_exec_ctx.c | 16 ++++++++++++++-- 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; -- cgit v1.2.3