diff options
author | midipix <writeonce@midipix.org> | 2021-05-03 02:50:18 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-05-03 02:50:18 +0000 |
commit | 26354e5fca8a27ce476970f7ddb91171dba0912d (patch) | |
tree | 68be71212c7a3f391f55d74a77a3ba9849d0e20f /src | |
parent | 1f2c01c19d001c0e9b8cabc2522ae91e79f70944 (diff) | |
download | slibtool-26354e5fca8a27ce476970f7ddb91171dba0912d.tar.bz2 slibtool-26354e5fca8a27ce476970f7ddb91171dba0912d.tar.xz |
link mode: slbt_exec_link(): properly support non-default shared-object suffix.
Diffstat (limited to 'src')
-rw-r--r-- | src/logic/slbt_exec_link.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c index ea5dccf..949ca07 100644 --- a/src/logic/slbt_exec_link.c +++ b/src/logic/slbt_exec_link.c @@ -1997,6 +1997,11 @@ int slbt_exec_link( /* dynamic library */ if (dot && !strcmp(dot,".la") && dctx->cctx->rpath && !fstaticonly) { + const struct slbt_flavor_settings * dflavor; + + if (slbt_get_flavor_settings("default",&dflavor) < 0) + return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_LINK_FLOW); + /* -shrext support */ if (dctx->cctx->shrext) { strcpy(target,ectx->lafilename); @@ -2016,8 +2021,29 @@ int slbt_exec_link( target,lnkname, SLBT_SYMLINK_DEFAULT)) return SLBT_NESTED_ERROR(dctx); - } + /* non-default shared-object suffix support */ + } else 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); + } /* linking: libfoo.so.x.y.z */ if (slbt_exec_link_create_library( |