]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Add LXC version information to version.h
authorS.Çağlar Onur <caglar@10ur.org>
Mon, 2 Dec 2013 04:14:17 +0000 (23:14 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 2 Dec 2013 23:17:21 +0000 (18:17 -0500)
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 <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
.gitignore
configure.ac
src/lxc/version.h [deleted file]
src/lxc/version.h.in [new file with mode: 0644]

index 65d9a7775494f1dd3e5ba710d4dabd9d54d3b668..a38ceb01a80d42dfd113c7ae34584804c92fe622 100644 (file)
@@ -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__/
index e9d3128236c0715c9a9ce1aad7589c34072478ee..7b3da91ce6a9a6bd7d7328d6d585fb9b1de9251d 100644 (file)
@@ -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
deleted file mode 100644 (file)
index e2b0fc4..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * lxc: linux Container library
- *
- * (C) Copyright IBM Corp. 2007, 2008
- *
- * Authors:
- * Daniel Lezcano <daniel.lezcano at free.fr>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * 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
-
-/*
- * Returns the version number of the library
- */
-extern const char *lxc_version(void);
-
-#endif
diff --git a/src/lxc/version.h.in b/src/lxc/version.h.in
new file mode 100644 (file)
index 0000000..6867b6e
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * lxc: linux Container library
+ *
+ * (C) Copyright IBM Corp. 2007, 2008
+ *
+ * Authors:
+ * Daniel Lezcano <daniel.lezcano at free.fr>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * 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
+
+#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
+ */
+extern const char *lxc_version(void);
+
+#endif