From 9a5f9681f88126c47e11ef49e7fb01c604c90986 Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 23 Mar 2021 22:28:03 +0000 Subject: install mode: account for a libfoo.a that was created with -disable-static. --- src/logic/slbt_exec_install.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c index 3cf0e12..f87db59 100644 --- a/src/logic/slbt_exec_install.c +++ b/src/logic/slbt_exec_install.c @@ -340,6 +340,7 @@ static int slbt_exec_install_entry( bool fexe = false; bool fpe; bool frelease; + bool farchive; size_t slen; struct stat st; @@ -419,12 +420,6 @@ static int slbt_exec_install_entry( dot = strrchr(srcfile,'.'); strcpy(dot,dctx->cctx->settings.arsuffix); - if (!(dctx->cctx->drvflags & SLBT_DRIVER_DISABLE_STATIC)) - if (slbt_copy_file(dctx,ectx, - srcfile, - dest ? (char *)dest->arg : *dst)) - return SLBT_NESTED_ERROR(dctx); - /* dot/suffix */ strcpy(slnkname,srcfile); dot = strrchr(slnkname,'.'); @@ -436,6 +431,20 @@ static int slbt_exec_install_entry( /* libfoo.a --> libfoo.so */ strcpy(dot,dsosuffix); + /* libfoo.a installation */ + if (!(dctx->cctx->drvflags & SLBT_DRIVER_DISABLE_STATIC)) + farchive = true; + else if (slbt_symlink_is_a_placeholder(slnkname)) + farchive = true; + else + farchive = false; + + if (farchive) + if (slbt_copy_file(dctx,ectx, + srcfile, + dest ? (char *)dest->arg : *dst)) + return SLBT_NESTED_ERROR(dctx); + /* PE support: does .libs/libfoo.so.def exist? */ if ((size_t)snprintf(dstfile,sizeof(dstfile),"%s.def", slnkname) >= sizeof(dstfile)) -- cgit v1.2.3