summaryrefslogtreecommitdiffhomepage
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-05-11 03:14:25 +0000
committermidipix <writeonce@midipix.org>2021-05-11 03:14:25 +0000
commitadb290e13315a7f5bd8f939ed471a07727e23e19 (patch)
tree8e76cd45e48ee9c7512c45eea5b4f2ea576ec4cd /src/logic
parentf020833322bbb1e3080d6ad1792e2040454a224e (diff)
downloadslibtool-adb290e13315a7f5bd8f939ed471a07727e23e19.tar.bz2
slibtool-adb290e13315a7f5bd8f939ed471a07727e23e19.tar.xz
install mode: libfoo.la installation: early detect static-only operation mode.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/slbt_exec_install.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c
index 1afeb27..727a38b 100644
--- a/src/logic/slbt_exec_install.c
+++ b/src/logic/slbt_exec_install.c
@@ -345,6 +345,7 @@ static int slbt_exec_install_entry(
bool fpe;
bool frelease;
bool fdualver;
+ bool fstatic;
bool farchive;
size_t slen;
size_t dlen;
@@ -442,19 +443,30 @@ static int slbt_exec_install_entry(
/* detect -release, exclusively or alongside -version-info */
frelease = false;
fdualver = false;
+ fstatic = false;
+ fpe = false;
+
+ /* static library only? */
+ sprintf(dot,"%s",dsosuffix);
+ fstatic = slbt_symlink_is_a_placeholder(fdcwd,slnkname);
/* libfoo.a --> libfoo.so.release */
- sprintf(dot,"%s.release",dsosuffix);
- frelease = !fstatat(fdcwd,slnkname,&st,0);
+ if (!fstatic) {
+ sprintf(dot,"%s.release",dsosuffix);
+ frelease = !fstatat(fdcwd,slnkname,&st,0);
+ }
/* libfoo.a --> libfoo.so.dualver */
- if (!frelease) {
+ if (!fstatic && !frelease) {
sprintf(dot,"%s.dualver",dsosuffix);
fdualver = !fstatat(fdcwd,slnkname,&st,0);
}
/* libfoo.so.def.{flavor} */
- if (frelease || fdualver) {
+ if (fstatic) {
+ (void)0;
+
+ } else if (frelease || fdualver) {
strcpy(dlnkname,slnkname);
slash = strrchr(dlnkname,'/');
@@ -498,16 +510,22 @@ static int slbt_exec_install_entry(
}
/* host/flabor */
- if (!(host = strrchr(hosttag,'.')))
+ if (fstatic) {
+ (void)0;
+
+ } else if (!(host = strrchr(hosttag,'.'))) {
return SLBT_CUSTOM_ERROR(dctx,SLBT_ERR_INSTALL_FLOW);
- else
+ } else {
host++;
+ }
/* symlink-based alternate host */
- if (slbt_set_alternate_host(dctx,host,host))
- return SLBT_NESTED_ERROR(dctx);
+ if (!fstatic) {
+ if (slbt_set_alternate_host(dctx,host,host))
+ return SLBT_NESTED_ERROR(dctx);
- fpe = !strcmp(dctx->cctx->asettings.imagefmt,"pe");
+ fpe = !strcmp(dctx->cctx->asettings.imagefmt,"pe");
+ }
/* libfoo.a --> libfoo.so */
strcpy(dot,dsosuffix);
@@ -515,7 +533,7 @@ static int slbt_exec_install_entry(
/* libfoo.a installation */
if (!(dctx->cctx->drvflags & SLBT_DRIVER_DISABLE_STATIC))
farchive = true;
- else if (slbt_symlink_is_a_placeholder(fdcwd,slnkname))
+ else if (fstatic)
farchive = true;
else
farchive = false;
@@ -535,7 +553,7 @@ static int slbt_exec_install_entry(
/* source (build) symlink target */
if (slbt_readlinkat(fdcwd,slnkname,target,sizeof(target)) < 0) {
/* -all-static? */
- if (slbt_symlink_is_a_placeholder(fdcwd,slnkname))
+ if (fstatic)
return 0;
/* -avoid-version? */