summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-10 06:52:07 -0400
committermidipix <writeonce@midipix.org>2016-04-10 06:52:07 -0400
commit5e58040cb4e77c2f3aae4cd20dd1f6eabc4b1ba3 (patch)
tree04d45d6780811670595d4ec07aac96e8e265fbf5 /src
parent061d4ac5055c2d5ce5ba3ed28f309a674d7e7f77 (diff)
downloadslibtool-5e58040cb4e77c2f3aae4cd20dd1f6eabc4b1ba3.tar.bz2
slibtool-5e58040cb4e77c2f3aae4cd20dd1f6eabc4b1ba3.tar.xz
install mode: install the executables, not the generated executable wrappers.
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_install.c27
-rw-r--r--src/logic/slbt_exec_link.c11
2 files changed, 36 insertions, 2 deletions
diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c
index b073132..cf9ba77 100644
--- a/src/logic/slbt_exec_install.c
+++ b/src/logic/slbt_exec_install.c
@@ -106,9 +106,20 @@ static int slbt_exec_install_entry(
char slnkname[PATH_MAX];
char dlnkname[PATH_MAX];
char lasource[PATH_MAX];
+ bool fexe = false;
+ struct stat st;
+
+ /* executable wrapper? */
+ if ((size_t)snprintf(slnkname,sizeof(slnkname),"%s.exe.wrapper",
+ entry->arg) >= sizeof(slnkname))
+ return -1;
+
+ fexe = stat(slnkname,&st)
+ ? false
+ : true;
/* .la ? */
- if (!(dot = strrchr(entry->arg,'.')) || strcmp(dot,".la")) {
+ if (!fexe && (!(dot = strrchr(entry->arg,'.')) || strcmp(dot,".la"))) {
*src = (char *)entry->arg;
*dst = dest ? 0 : (char *)last->arg;
@@ -132,9 +143,21 @@ static int slbt_exec_install_entry(
} else
sprintf(srcfile,".libs/%s",lasource);
- strcpy(slnkname,srcfile);
+ /* executable? */
+ if (fexe) {
+ *src = srcfile;
+ *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;
+ }
/* libfoo.la --> libfoo.so */
+ strcpy(slnkname,srcfile);
dot = strrchr(slnkname,'.');
sprintf(dot,dctx->cctx->settings.dsosuffix);
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 4b5fdc8..23802b1 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -411,6 +411,7 @@ static int slbt_exec_link_create_executable(
char cwd [PATH_MAX];
char output [PATH_MAX];
char wrapper[PATH_MAX];
+ char wraplnk[PATH_MAX];
/* initial state */
slbt_reset_arguments(ectx);
@@ -502,6 +503,16 @@ static int slbt_exec_link_create_executable(
fclose(ectx->fwrapper);
ectx->fwrapper = 0;
+ if ((size_t)snprintf(wraplnk,sizeof(wraplnk),"%s.exe.wrapper",
+ dctx->cctx->output) >= sizeof(wraplnk))
+ return -1;
+
+ if (slbt_create_symlink(
+ dctx,ectx,
+ dctx->cctx->output,wraplnk,
+ false))
+ return -1;
+
if (rename(wrapper,dctx->cctx->output))
return -1;