summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-05-05 06:46:05 -0400
committermidipix <writeonce@midipix.org>2016-05-05 06:46:05 -0400
commite13a5c1d69f1c25133d9bb610be2abd82515504b (patch)
tree1ef1d9f553b97a61bac4592e803548c9f452b971 /src
parent4a0a6c6027d1195b4a70fd31c9df768803dfafa2 (diff)
downloadslibtool-e13a5c1d69f1c25133d9bb610be2abd82515504b.tar.bz2
slibtool-e13a5c1d69f1c25133d9bb610be2abd82515504b.tar.xz
install mode: fix and simplify logic related to installation of executables.
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_install.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c
index f192053..322fd8c 100644
--- a/src/logic/slbt_exec_install.c
+++ b/src/logic/slbt_exec_install.c
@@ -346,30 +346,6 @@ static int slbt_exec_install_entry(
if (!fexe && dot && !strcmp(dot,".lai"))
dot[3] = 0;
- /* .la ? */
- if (!fexe && (!dot || strcmp(dot,".la"))) {
- *src = (char *)entry->arg;
- *dst = dest ? 0 : (char *)last->arg;
-
- if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT))
- if (slbt_output_install(dctx,ectx))
- return -1;
-
- return (((ret = slbt_spawn(ectx,true)) < 0) || ectx->exitcode)
- ? -1 : 0;
- }
-
- /* legabits? */
- if (dctx->cctx->drvflags & SLBT_DRIVER_LEGABITS)
- if (slbt_exec_install_library_wrapper(dctx,ectx,entry,dstdir))
- return -1;
-
- /* *dst: consider: cp libfoo.la /dest/dir/libfoo.la */
- if ((*dst = dest ? 0 : (char *)last->arg))
- if ((dot = strrchr(last->arg,'.')))
- if (!(strcmp(dot,".la")))
- *dst = dstdir;
-
/* srcfile */
if (strlen(entry->arg) + strlen(".libs/") >= (PATH_MAX-1))
return -1;
@@ -382,9 +358,10 @@ static int slbt_exec_install_entry(
} else
sprintf(srcfile,".libs/%s",lasource);
- /* executable? */
- if (fexe) {
- *src = srcfile;
+ /* executable? ordinary file? */
+ if (fexe || !dot || strcmp(dot,".la")) {
+ *src = fexe ? srcfile : (char *)entry->arg;
+ *dst = dest ? 0 : (char *)last->arg;
if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT))
if (slbt_output_install(dctx,ectx))
@@ -394,6 +371,17 @@ static int slbt_exec_install_entry(
? -1 : 0;
}
+ /* legabits? */
+ if (dctx->cctx->drvflags & SLBT_DRIVER_LEGABITS)
+ if (slbt_exec_install_library_wrapper(dctx,ectx,entry,dstdir))
+ return -1;
+
+ /* *dst: consider: cp libfoo.la /dest/dir/libfoo.la */
+ if ((*dst = dest ? 0 : (char *)last->arg))
+ if ((dot = strrchr(last->arg,'.')))
+ if (!(strcmp(dot,".la")))
+ *dst = dstdir;
+
/* libfoo.a */
dot = strrchr(srcfile,'.');
strcpy(dot,dctx->cctx->settings.arsuffix);