summaryrefslogtreecommitdiffhomepage
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-06 02:00:51 -0400
committermidipix <writeonce@midipix.org>2016-04-06 02:00:51 -0400
commit0f859168d7cb37b2cbb74d9405f8e2aa861c2a88 (patch)
tree28c0512bcc3b2771ed1ea6411c1f22e9ed640627 /src/logic
parent3deeba0ce76e9ac7ef5aa03015d511312b4829c3 (diff)
downloadslibtool-0f859168d7cb37b2cbb74d9405f8e2aa861c2a88.tar.bz2
slibtool-0f859168d7cb37b2cbb74d9405f8e2aa861c2a88.tar.xz
link mode: added -soname support.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/slbt_exec_ctx.c7
-rw-r--r--src/logic/slbt_exec_link.c13
2 files changed, 19 insertions, 1 deletions
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index 8b20f95..620cde7 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -227,8 +227,10 @@ int slbt_get_exec_ctx(
ictx->ctx.fpic = &ictx->ctx.argv[i++];
ictx->ctx.cass = &ictx->ctx.argv[i++];
-
ictx->ctx.noundef = &ictx->ctx.argv[i++];
+ ictx->ctx.soname = &ictx->ctx.argv[i++];
+ ictx->ctx.lsoname = &ictx->ctx.argv[i++];
+
ictx->ctx.lout[0] = &ictx->ctx.argv[i++];
ictx->ctx.lout[1] = &ictx->ctx.argv[i++];
ictx->ctx.sentinel= &ictx->ctx.argv[i++];
@@ -361,6 +363,9 @@ void slbt_reset_placeholders(struct slbt_exec_ctx * ectx)
*ectx->cass = "-USLIBTOOL_PLACEHOLDER_COMPILE_ASSEMBLE";
*ectx->noundef = "-USLIBTOOL_PLACEHOLDER_NO_UNDEFINED";
+ *ectx->soname = "-USLIBTOOL_PLACEHOLDER_SONAME";
+ *ectx->lsoname = "-USLIBTOOL_PLACEHOLDER_LSONAME";
+
*ectx->lout[0] = "-USLIBTOOL_PLACEHOLDER_OUTPUT_SWITCH";
*ectx->lout[1] = "-USLIBTOOL_PLACEHOLDER_OUTPUT_FILE";
*ectx->sentinel= 0;
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 025ae56..e483ced 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -322,6 +322,7 @@ static int slbt_exec_link_create_library(
{
char ** parg;
char output [PATH_MAX];
+ char soname [PATH_MAX];
/* initial state */
slbt_reset_arguments(ectx);
@@ -344,6 +345,18 @@ static int slbt_exec_link_create_library(
if (dctx->cctx->drvflags & SLBT_DRIVER_NO_UNDEFINED)
*ectx->noundef = "-Wl,--no-undefined";
+ /* -soname */
+ if ((size_t)snprintf(soname,sizeof(soname),"-Wl,%s%s%s.%d",
+ dctx->cctx->settings.dsoprefix,
+ dctx->cctx->libname,
+ dctx->cctx->settings.dsosuffix,
+ dctx->cctx->verinfo.major)
+ >= sizeof(soname))
+ return -1;
+
+ *ectx->soname = "-Wl,-soname";
+ *ectx->lsoname = soname;
+
/* shared object */
*ectx->dpic = "-shared";
*ectx->fpic = "-fPIC";