summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-25 14:29:07 -0400
committermidipix <writeonce@midipix.org>2016-04-25 14:29:07 -0400
commitdac9cd4bdd4da581279f2ad7a65a17b5d0ba7f87 (patch)
treeab71d20c067b01db03a6ef3a85761a95ccbea10f
parentff55c40b9cd02508fc41e9a33070a17f1000ffac (diff)
downloadslibtool-dac9cd4bdd4da581279f2ad7a65a17b5d0ba7f87.tar.bz2
slibtool-dac9cd4bdd4da581279f2ad7a65a17b5d0ba7f87.tar.xz
link mode: include slibtool version information in the generated wrappers.
-rw-r--r--src/logic/slbt_exec_link.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index d614f06..0274841 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -724,6 +724,7 @@ static int slbt_exec_link_create_executable(
char wraplnk[PATH_MAX];
bool fabspath;
bool fpic;
+ const struct slbt_source_version * verinfo;
struct slbt_deps_meta depsmeta = {0,0,0,0};
/* initial state */
@@ -761,10 +762,13 @@ static int slbt_exec_link_create_executable(
if (!(ectx->fwrapper = fopen(wrapper,"w")))
return -1;
+ verinfo = slbt_source_version();
+
if (fprintf(ectx->fwrapper,
"#!/bin/sh\n"
"# libtool compatible executable wrapper\n"
- "# Generated by %s (slibtool pre-alpha)\n\n"
+ "# Generated by %s (slibtool %d.%d.%d)\n"
+ "# [commit reference: %s]\n\n"
"if [ -z \"$%s\" ]; then\n"
"\tDL_PATH=\n"
@@ -777,6 +781,8 @@ static int slbt_exec_link_create_executable(
"fi\n\n",
dctx->program,
+ verinfo->major,verinfo->minor,verinfo->revision,
+ verinfo->commit,
dctx->cctx->settings.ldpathenv) < 0)
return -1;
@@ -911,6 +917,7 @@ int slbt_exec_link(
char soxyz [PATH_MAX];
char solnk [PATH_MAX];
char arname[PATH_MAX];
+ const struct slbt_source_version * verinfo;
/* libfoo.so.x.y.z */
if ((size_t)snprintf(soxyz,sizeof(soxyz),"%s%s%s.%d.%d.%d",
@@ -1106,10 +1113,12 @@ int slbt_exec_link(
fnover = !!(dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION);
fvernum = !!(dctx->cctx->verinfo.vernumber);
+ verinfo = slbt_source_version();
ret = fprintf(fout,
"# libtool compatible library wrapper\n"
- "# Generated by %s (slibtool pre-alpha)\n\n"
+ "# Generated by %s (slibtool %d.%d.%d)\n"
+ "# [commit reference: %s]\n\n"
"dlname='%s'\n"
"library_names='%s %s %s'\n"
@@ -1131,8 +1140,10 @@ int slbt_exec_link(
"libdir='%s'\n",
- /* nickname */
+ /* nickname, verinfo */
dctx->program,
+ verinfo->major,verinfo->minor,verinfo->revision,
+ verinfo->commit,
/* dlname */
fnover ? solnk : soxyz,