diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2013-07-30 12:17:17 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2013-07-30 12:53:42 +0200 |
commit | 4aa56de14c5be1320afad03ac60f31e9dcc254e5 (patch) | |
tree | 9a863a7f39e3ed3dda8c8e3e4047cdfc0d352528 /configure.ac | |
parent | b502b6cd582a146e2bd4a95c4bfb8ca54150bceb (diff) | |
download | NetworkManager-4aa56de14c5be1320afad03ac60f31e9dcc254e5.tar.gz |
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
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 15 |
1 files changed, 14 insertions, 1 deletions
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]) |