summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-11 18:43:39 -0400
committermidipix <writeonce@midipix.org>2016-04-11 18:43:39 -0400
commit867d1e60472f9290ca7b99ec252e1bbf83a8c94c (patch)
tree14a49dc0d02bad75ed06526a7fa1d2c1bc853e87 /src
parent68f313e1452c88235ece7f5b76b6bbdb82b9e5f3 (diff)
downloadslibtool-867d1e60472f9290ca7b99ec252e1bbf83a8c94c.tar.bz2
slibtool-867d1e60472f9290ca7b99ec252e1bbf83a8c94c.tar.xz
link mode: added -avoid-version support.
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_link.c69
1 files changed, 40 insertions, 29 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 23802b1..0e31524 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -184,6 +184,9 @@ static int slbt_exec_link_adjust_argument_vector(
} else if (strcmp(dot,dctx->cctx->settings.dsosuffix)) {
*aarg++ = *carg++;
+ } else if (carg == ectx->lout[1]) {
+ /* ^^^hoppla^^^ */
+ *aarg++ = *carg++;
} else {
/* account for {'-','L','-','l'} */
if ((size_t)snprintf(arg,sizeof(arg),"%s",
@@ -350,29 +353,35 @@ static int slbt_exec_link_create_library(
*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;
+ if (!(dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION)) {
+ 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;
+ *ectx->soname = "-Wl,-soname";
+ *ectx->lsoname = soname;
+ }
/* shared object */
*ectx->dpic = "-shared";
*ectx->fpic = "-fPIC";
/* output */
- if ((size_t)snprintf(output,sizeof(output),"%s.%d.%d.%d",
- dsofilename,
- dctx->cctx->verinfo.major,
- dctx->cctx->verinfo.minor,
- dctx->cctx->verinfo.revision)
- >= sizeof(output))
- return -1;
+ if (dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION) {
+ strcpy(output,dsofilename);
+ } else {
+ if ((size_t)snprintf(output,sizeof(output),"%s.%d.%d.%d",
+ dsofilename,
+ dctx->cctx->verinfo.major,
+ dctx->cctx->verinfo.minor,
+ dctx->cctx->verinfo.revision)
+ >= sizeof(output))
+ return -1;
+ }
*ectx->lout[0] = "-o";
*ectx->lout[1] = output;
@@ -610,20 +619,22 @@ int slbt_exec_link(
return -1;
}
- /* symlink: libfoo.so.x --> libfoo.so.x.y.z */
- if (slbt_exec_link_create_library_symlink(
- dctx,ectx,
- true)) {
- slbt_free_exec_ctx(actx);
- return -1;
- }
+ if (!(dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION)) {
+ /* symlink: libfoo.so.x --> libfoo.so.x.y.z */
+ if (slbt_exec_link_create_library_symlink(
+ dctx,ectx,
+ true)) {
+ slbt_free_exec_ctx(actx);
+ return -1;
+ }
- /* symlink: libfoo.so --> libfoo.so.x.y.z */
- if (slbt_exec_link_create_library_symlink(
- dctx,ectx,
- false)) {
- slbt_free_exec_ctx(actx);
- return -1;
+ /* symlink: libfoo.so --> libfoo.so.x.y.z */
+ if (slbt_exec_link_create_library_symlink(
+ dctx,ectx,
+ false)) {
+ slbt_free_exec_ctx(actx);
+ return -1;
+ }
}
}