From 4aa56de14c5be1320afad03ac60f31e9dcc254e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 30 Jul 2013 12:17:17 +0200 Subject: [PATCH] build: only add 'serial-tests' for automake >= 1.12 Earlier versions of automake complain if they get a configuration parameter which they don't understand. The error is: configure.ac:19: option `serial-tests' not recognized Use some m4 hackery to work around this. Stolen from here by jklimes: https://www.redhat.com/archives/libguestfs/2013-February/msg00102.html --- configure.ac | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f74a5262ce..5ab5b38e16 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,20 @@ AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) -AM_INIT_AUTOMAKE([1.11 serial-tests tar-ustar no-dist-gzip dist-bzip2 -Wno-portability]) +dnl Initialize automake. automake < 1.12 didn't have serial-tests and +dnl gives an error if it sees this, but for automake >= 1.13 +dnl serial-tests is required so we have to include it. Solution is to +dnl test for the version of automake (by running an external command) +dnl and provide it if necessary. Note we have to do this entirely using +dnl m4 macros since automake queries this macro by running +dnl 'autoconf --trace ...'. +m4_define([serial_tests], [ + m4_esyscmd([automake --version | + head -1 | + awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}' + ]) +]) +AM_INIT_AUTOMAKE(1.11 serial_tests tar-ustar no-dist-gzip dist-bzip2 -Wno-portability) dnl NB: Do not [quote] this parameter. AM_MAINTAINER_MODE([enable]) AM_SILENT_RULES([yes])