diff options
author | midipix <writeonce@midipix.org> | 2016-04-10 06:52:07 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-04-10 06:52:07 -0400 |
commit | 5e58040cb4e77c2f3aae4cd20dd1f6eabc4b1ba3 (patch) | |
tree | 04d45d6780811670595d4ec07aac96e8e265fbf5 /src/logic/slbt_exec_install.c | |
parent | 061d4ac5055c2d5ce5ba3ed28f309a674d7e7f77 (diff) | |
download | slibtool-5e58040cb4e77c2f3aae4cd20dd1f6eabc4b1ba3.tar.bz2 slibtool-5e58040cb4e77c2f3aae4cd20dd1f6eabc4b1ba3.tar.xz |
install mode: install the executables, not the generated executable wrappers.
Diffstat (limited to 'src/logic/slbt_exec_install.c')
-rw-r--r-- | src/logic/slbt_exec_install.c | 27 |
1 files changed, 25 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); |