summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-05-04 13:56:44 +0000
committermidipix <writeonce@midipix.org>2021-05-04 13:56:44 +0000
commitd55a465814bb3d7ec429f85b36c26d5862ba7e48 (patch)
tree4330949fb18581bb9174c39d9b94b2893b61b95e
parent4ee438b198d7319ef95e51f90579391ab2f658f7 (diff)
downloadslibtool-d55a465814bb3d7ec429f85b36c26d5862ba7e48.tar.bz2
slibtool-d55a465814bb3d7ec429f85b36c26d5862ba7e48.tar.xz
link mode: static-only libfoo.la: account for non-default shared-object suffix.
-rw-r--r--src/logic/slbt_exec_link.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index c8586c5..f61c5db 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -1935,6 +1935,36 @@ int slbt_exec_link(
return SLBT_NESTED_ERROR(dctx);
}
+ /* static-only libfoo.la */
+ if (fstaticonly && dot && !strcmp(dot,".la")) {
+ const struct slbt_flavor_settings * dflavor;
+
+ if (slbt_get_flavor_settings("default",&dflavor) < 0)
+ return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_LINK_FLOW);
+
+ if (strcmp(dctx->cctx->settings.dsosuffix,dflavor->dsosuffix)) {
+ strcpy(target,ectx->lafilename);
+ sprintf(lnkname,"%s.shrext%s",
+ ectx->lafilename,
+ dctx->cctx->settings.dsosuffix);
+
+ if (slbt_create_symlink(
+ dctx,ectx,
+ target,lnkname,
+ SLBT_SYMLINK_DEFAULT))
+ return SLBT_NESTED_ERROR(dctx);
+
+ strcpy(target,lnkname);
+ sprintf(lnkname,"%s.shrext",ectx->lafilename);
+
+ if (slbt_create_symlink(
+ dctx,ectx,
+ target,lnkname,
+ SLBT_SYMLINK_DEFAULT))
+ return SLBT_NESTED_ERROR(dctx);
+ }
+ }
+
/* -all-static library */
if (fstaticonly && dctx->cctx->libname)
if (slbt_create_symlink(