summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-18 20:33:39 -0400
committermidipix <writeonce@midipix.org>2016-04-18 20:52:52 -0400
commit1c05ca6d85d7871e111aa39d6cd3470a28af22bf (patch)
treec9ef91c270df3f0ad6d3c0c287fae5e41c17579a
parentdbd229f23d887698fc0ea8c66602c78bb29cdf1c (diff)
downloadslibtool-1c05ca6d85d7871e111aa39d6cd3470a28af22bf.tar.bz2
slibtool-1c05ca6d85d7871e111aa39d6cd3470a28af22bf.tar.xz
install mode: PE support: create libfoo.so.x as a copy of libfoo.so.x.y.z.
-rw-r--r--src/logic/slbt_exec_install.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c
index c2e334a..d1147aa 100644
--- a/src/logic/slbt_exec_install.c
+++ b/src/logic/slbt_exec_install.c
@@ -108,6 +108,7 @@ static int slbt_exec_install_entry(
char dlnkname[PATH_MAX];
char lasource[PATH_MAX];
bool fexe = false;
+ bool fpe;
struct stat st;
/* executable wrapper? */
@@ -162,6 +163,13 @@ static int slbt_exec_install_entry(
dot = strrchr(slnkname,'.');
strcpy(dot,dctx->cctx->settings.dsosuffix);
+ /* PE support: does .libs/libfoo.so.def exist? */
+ if ((size_t)snprintf(dstfile,sizeof(dstfile),"%s.def",
+ slnkname) >= sizeof(dstfile))
+ return -1;
+
+ fpe = stat(dstfile,&st) ? false : true;
+
/* basename */
if ((base = strrchr(slnkname,'/')))
base++;
@@ -244,12 +252,21 @@ static int slbt_exec_install_entry(
dstdir,slnkname) >= sizeof(dlnkname))
return -1;
- /* create symlink: libfoo.so.x --> libfoo.so.x.y.z */
- if (slbt_create_symlink(
- dctx,ectx,
- target,dlnkname,
- false))
- return -1;
+ if (fpe) {
+ /* copy: .libs/libfoo.so.x.y.z --> libfoo.so.x */
+ if (slbt_copy_file(
+ dctx,ectx,
+ srcfile,
+ dlnkname))
+ return -1;
+ } else {
+ /* create symlink: libfoo.so.x --> libfoo.so.x.y.z */
+ if (slbt_create_symlink(
+ dctx,ectx,
+ target,dlnkname,
+ false))
+ return -1;
+ }
return 0;
}