summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-08-19 21:48:44 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-08-19 21:48:44 +0100
commita4db75521d6026410425187fc2c5c9cb931a69b5 (patch)
treea3273dcf64d7883c6c6c2f8543422cdfb58498e6 /configure.ac
parent7a5f7311d46ac87532e57aa5be9234acd18bdab8 (diff)
downloadlibguestfs-a4db75521d6026410425187fc2c5c9cb931a69b5.tar.gz
libguestfs-a4db75521d6026410425187fc2c5c9cb931a69b5.tar.xz
libguestfs-a4db75521d6026410425187fc2c5c9cb931a69b5.zip
configure: Add --with-extra flag to allow setting the extra version string.
Intended use in Fedora and RHEL is to encode the release string, eg. ./configure [...] --with-extra="-%{release}"
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 19 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 0416a9c2..56b0ad9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,12 +15,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-# major/minor/release must be numbers
+# The major, minor, and release fields MUST be numbers. Packagers can
+# add extra information using --with-extra="..." which may be any
+# freeform string.
m4_define([libguestfs_major], [1])
m4_define([libguestfs_minor], [13])
m4_define([libguestfs_release], [6])
-# extra can be any string
-m4_define([libguestfs_extra], [])
AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
AC_CONFIG_AUX_DIR([build-aux])
@@ -31,12 +31,6 @@ AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
AC_CONFIG_MACRO_DIR([m4])
-dnl Split up the version string.
-AC_DEFINE([PACKAGE_VERSION_MAJOR],[libguestfs_major],[Major version number])
-AC_DEFINE([PACKAGE_VERSION_MINOR],[libguestfs_minor],[Minor version number])
-AC_DEFINE([PACKAGE_VERSION_RELEASE],[libguestfs_release],[Release number])
-AC_DEFINE([PACKAGE_VERSION_EXTRA],["libguestfs_extra"],[Extra version string])
-
dnl Stable or unstable version?
AC_MSG_CHECKING([if this is a stable or unstable branch of libguestfs])
AS_IF([test "$((libguestfs_minor % 2))" -eq 0 ],[
@@ -53,6 +47,22 @@ please see the section "LIBGUESTFS VERSION NUMBERS" in guestfs(3).
***])
])
+dnl Extra string, a freeform string defined by packagers.
+AC_ARG_WITH([extra],
+ [AS_HELP_STRING([--with-extra],
+ [extra version string (for use by packagers)])],
+ [libguestfs_extra="$withval"],
+ [libguestfs_extra=]
+)
+
+AC_MSG_NOTICE([libguestfs version libguestfs_major.libguestfs_minor.libguestfs_release$libguestfs_extra])
+
+dnl Split up the version string.
+AC_DEFINE([PACKAGE_VERSION_MAJOR],[libguestfs_major],[Major version number])
+AC_DEFINE([PACKAGE_VERSION_MINOR],[libguestfs_minor],[Minor version number])
+AC_DEFINE([PACKAGE_VERSION_RELEASE],[libguestfs_release],[Release number])
+AC_DEFINE_UNQUOTED([PACKAGE_VERSION_EXTRA],["$libguestfs_extra"],[Extra version string])
+
dnl Early gnulib initialization.
gl_EARLY
gl_INIT