From: S.Çağlar Onur Date: Mon, 2 Dec 2013 04:14:17 +0000 (-0500) Subject: Add LXC version information to version.h X-Git-Tag: lxc-1.0.0.beta1~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a22185ddda688aa284e6451c35fae3354139cb61;p=thirdparty%2Flxc.git Add LXC version information to version.h So that applications can get the LXC version number at compile time. This can be used to make applications/bindings that support compiling against multiple versions of LXC. Signed-off-by: S.Çağlar Onur Acked-by: Stéphane Graber --- diff --git a/.gitignore b/.gitignore index 65d9a7775..a38ceb01a 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,7 @@ src/lxc/lxc-version src/lxc/lxc-wait src/lxc/legacy/lxc-ls src/lxc/lxc-user-nic +src/lxc/version.h src/python-lxc/build/ src/python-lxc/lxc/__pycache__/ diff --git a/configure.ac b/configure.ac index e9d312823..7b3da91ce 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,11 @@ AC_INIT([lxc], [lxc_version]) AC_SUBST(LXC_VERSION_BASE, lxc_version_base) AC_SUBST(LXC_VERSION_BETA, lxc_version_beta) +AC_SUBST([LXC_VERSION_MAJOR], [lxc_version_major]) +AC_SUBST([LXC_VERSION_MINOR], [lxc_version_minor]) +AC_SUBST([LXC_VERSION_MICRO], [lxc_version_micro]) +AC_SUBST([LXC_VERSION], [lxc_version]) + AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_HEADERS([src/config.h]) @@ -554,7 +559,7 @@ AC_CONFIG_FILES([ src/lxc/lxc-start-ephemeral src/lxc/legacy/lxc-ls src/lxc/lxc.functions - + src/lxc/version.h src/python-lxc/Makefile src/lua-lxc/Makefile diff --git a/src/lxc/version.h b/src/lxc/version.h.in similarity index 82% rename from src/lxc/version.h rename to src/lxc/version.h.in index e2b0fc4c2..6867b6ed2 100644 --- a/src/lxc/version.h +++ b/src/lxc/version.h.in @@ -20,8 +20,13 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _version_h -#define _version_h +#ifndef _VERSION_H +#define _VERSION_H + +#define LXC_VERSION_MAJOR @LXC_VERSION_MAJOR@ +#define LXC_VERSION_MINOR @LXC_VERSION_MINOR@ +#define LXC_VERSION_MICRO @LXC_VERSION_MICRO@ +#define LXC_VERSION "@LXC_VERSION@" /* * Returns the version number of the library