aboutsummaryrefslogtreecommitdiff
path: root/nxcomp
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-12-15 00:48:35 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-05 23:18:58 +0100
commitec1b3a44c0653e21dd252e1727ed42f86f0bb0ec (patch)
treed9170b2bd676cad47a9578e7bed01767af1fc0cc /nxcomp
parent04962efa95a41cd6f665ebb110a7ce07d99a4554 (diff)
downloadnx-libs-ec1b3a44c0653e21dd252e1727ed42f86f0bb0ec.tar.gz
nx-libs-ec1b3a44c0653e21dd252e1727ed42f86f0bb0ec.tar.bz2
nx-libs-ec1b3a44c0653e21dd252e1727ed42f86f0bb0ec.zip
Add support for custom version string
Make nxproxy and nxagent print an arbitrary version number by running make NX_VERSION_CUSTOM="myvers". nxagent and nxproxy will then show this in addition to the original version number: NXPROXY - Version myvers (3.5.99.22) NXAGENT - Version myvers (3.5.99.22) Fixes ArcticaProject/nx-libs#606
Diffstat (limited to 'nxcomp')
-rw-r--r--nxcomp/configure.ac7
-rw-r--r--nxcomp/src/Loop.cpp13
2 files changed, 16 insertions, 4 deletions
diff --git a/nxcomp/configure.ac b/nxcomp/configure.ac
index a1839c719..0e17521c3 100644
--- a/nxcomp/configure.ac
+++ b/nxcomp/configure.ac
@@ -19,6 +19,13 @@ AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-bzip2])
# Initialize libtool
AC_PROG_LIBTOOL
+# enable this to add the variable to the Makefiles
+#AC_ARG_VAR(NX_VERSION_CUSTOM, [custom version string])
+
+if test "x$NX_VERSION_CUSTOM" != x; then
+ AC_DEFINE_UNQUOTED([NX_VERSION_CUSTOM], ["${NX_VERSION_CUSTOM}"], [user provided custom version string])
+fi
+
COMP_VERSION=nxcomp_version
AC_SUBST([COMP_VERSION])
diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp
index bb8a89d64..eb7373f9f 100644
--- a/nxcomp/src/Loop.cpp
+++ b/nxcomp/src/Loop.cpp
@@ -13308,13 +13308,18 @@ void PrintConnectionInfo()
void PrintVersionInfo()
{
- cerr << "NXPROXY - " << "Version "
+ cerr << "NXPROXY - Version "
+#ifdef NX_VERSION_CUSTOM
+ << NX_VERSION_CUSTOM << " ("
+#endif
<< control -> LocalVersionMajor << "."
<< control -> LocalVersionMinor << "."
<< control -> LocalVersionPatch << "."
- << control -> LocalVersionMaintenancePatch;
-
- cerr << endl;
+ << control -> LocalVersionMaintenancePatch
+#ifdef NX_VERSION_CUSTOM
+ << ")"
+#endif
+ << endl;
}
void PrintCopyrightInfo()