# 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], [10])
-m4_define([libguestfs_release], [7])
-# extra can be any string
-m4_define([libguestfs_extra], [])
+m4_define([libguestfs_release], [11])
AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
AC_CONFIG_AUX_DIR([build-aux])
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 ],[
***])
])
+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
])
fi
+ dnl qemu 0.15 was released with broken support for '-machine',
+ dnl requiring you to add the machine type: '-machine pc,[...]'.
+ dnl The problem is that 'pc' is only applicable for PC-like
+ dnl hardware, so we cannot do this as a general solution. Since
+ dnl qemu 0.15, this problem has been fixed so now the default
+ dnl machine type is chosen (qemu commit 2645c6dcaf6ea2a51a).
+ dnl
+ dnl We need to work out if this qemu is the broken version, so we
+ dnl can add 'pc' just for this broken version.
+ dnl
+ dnl Note that old qemu didn't support the '-machine' option at all.
+ dnl
+ dnl We use the -kernel option for testing this, because this option
+ dnl is processed very late, after qemu has set up the machine.
+ AC_MSG_CHECKING([for broken '-machine accel=tcg' option in $QEMU])
+ LC_ALL=C $QEMU -nographic -machine accel=tcg -kernel /NO_SUCH_FILE \
+ > config1.tmp 2>&1
+ LC_ALL=C $QEMU -nographic -machine pc,accel=tcg -kernel /NO_SUCH_FILE \
+ > config2.tmp 2>&1
+ if cmp -s config1.tmp config2.tmp; then
+ AC_MSG_RESULT([no])
+ else
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([QEMU_MACHINE_TYPE_IS_BROKEN],[1],[qemu -machine accel=tcg option is broken (in qemu 0.15 only)])
+ fi
+ rm config1.tmp config2.tmp
+
+ dnl See if the '-machine [pc,]accel=tcg' option is required in
+ dnl order to run the virtio-serial test below. This happens when
+ dnl we run qemu-kvm inside a VM without forcing TCG:
+ dnl
+ dnl Could not access KVM kernel module: No such file or directory
+ dnl failed to initialize KVM: No such file or directory
+ dnl No accelerator found!
+ AC_MSG_CHECKING([if -machine @<:@pc,@:>@accel=tcg option is required to test virtio-serial feature])
+ if $QEMU -nographic -device \? >/dev/null 2>&1; then
+ :
+ elif $QEMU -machine accel=tcg -nographic -device \? >/dev/null 2>&1; then
+ QEMU_EXTRA_OPTIONS_FOR_TEST="-machine accel=tcg"
+ elif $QEMU -machine pc,accel=tcg -nographic -device \? >/dev/null 2>&1; then
+ QEMU_EXTRA_OPTIONS_FOR_TEST="-machine pc,accel=tcg"
+ # else nothing ... it'll fail below.
+ fi
+ AC_MSG_RESULT([$QEMU_EXTRA_OPTIONS_FOR_TEST])
+
AC_MSG_CHECKING([for virtio-serial support in $QEMU])
- if $QEMU -nographic -device \? 2>&1 | grep -sq virtio-serial; then
+ if $QEMU $QEMU_EXTRA_OPTIONS_FOR_TEST -nographic -device \? 2>&1 | grep -sq virtio-serial; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
if test "x$PYTHON" != "xno"; then
AC_MSG_CHECKING([Python prefix])
- PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
+ PYTHON_PREFIX=`$PYTHON -c "import sys; print (sys.prefix)"`
AC_MSG_RESULT([$PYTHON_PREFIX])
AC_MSG_CHECKING([Python version])
- PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
+ PYTHON_VERSION=`$PYTHON -c "import sys; print (sys.version[[0:3]])"`
AC_MSG_RESULT([$PYTHON_VERSION])
for d in \