summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-04 21:27:57 -0400
committermidipix <writeonce@midipix.org>2016-04-04 21:27:57 -0400
commitf4776113b75bf3839b7f5a4c51b736eb3e208236 (patch)
tree4feed5d972c87aeae5a39c0aa5c468184c663f5d /src
parent41790b5a57abbcf760178a22f452c91b1fe65ebd (diff)
downloadslibtool-f4776113b75bf3839b7f5a4c51b736eb3e208236.tar.bz2
slibtool-f4776113b75bf3839b7f5a4c51b736eb3e208236.tar.xz
execution context: added exefilename initialization.
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_ctx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index 706fd51..df7f693 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -140,6 +140,7 @@ int slbt_get_exec_ctx(
char ** parg;
char * ch;
char * mark;
+ char * slash;
const char * ref;
int i;
@@ -288,6 +289,20 @@ int slbt_get_exec_ctx(
+ sizeof('\0');
}
+ /* linking: exefilename */
+ if (dctx->cctx->mode == SLBT_MODE_LINK && !dctx->cctx->libname) {
+ ictx->ctx.exefilename = ch;
+
+ if ((slash = strrchr(dctx->cctx->output,'/'))) {
+ strcpy(ch,dctx->cctx->output);
+ mark = ch + (slash - dctx->cctx->output);
+ sprintf(++mark,".libs/%s",++slash);
+ ch += strlen(ch) + sizeof('\0');
+ } else
+ ch += sprintf(ch,".libs/%s",dctx->cctx->output)
+ + sizeof('\0');
+ }
+
/* argument strings shadow copy */
memcpy(ictx->shadow,ictx->args,ictx->size);