summaryrefslogtreecommitdiff
path: root/src/logic/slbt_exec_link.c
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/slbt_exec_link.c
parent3deeba0ce76e9ac7ef5aa03015d511312b4829c3 (diff)
downloadslibtool-0f859168d7cb37b2cbb74d9405f8e2aa861c2a88.tar.bz2
slibtool-0f859168d7cb37b2cbb74d9405f8e2aa861c2a88.tar.xz
link mode: added -soname support.
Diffstat (limited to 'src/logic/slbt_exec_link.c')
-rw-r--r--src/logic/slbt_exec_link.c13
1 files changed, 13 insertions, 0 deletions
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";