diff options
author | Gert Doering <gert@greenie.muc.de> | 2015-06-01 21:04:47 +0200 |
---|---|---|
committer | Gert Doering <gert@greenie.muc.de> | 2015-06-01 21:16:46 +0200 |
commit | d378850ab70af4c967d099627f0a19ad42ecbdcb (patch) | |
tree | 31ae2aa1c8353ee94f8bc17246ee21d1aa41e3a3 | |
parent | 38c9f980d4f7cb7061f9db3ed8645ab3404e533d (diff) | |
download | openvpn-d378850ab70af4c967d099627f0a19ad42ecbdcb.tar.gz openvpn-d378850ab70af4c967d099627f0a19ad42ecbdcb.tar.xz openvpn-d378850ab70af4c967d099627f0a19ad42ecbdcb.zip |
Use configure.ac hack to apply serial_test AM option only if supported.
Inspired by libguestfs' configure.ac hack - test automake version,
and if 1.12 or newer, use m4 magic to pass "serial_tests" option
to AM_INIT_AUTOMAKE().
https://www.redhat.com/archives/libguestfs/2013-February/msg00102.html
Trac #427
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: <1433185487-9724-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9769
(cherry picked from commit c615835aa93701c764c23fc2579d97757c1a9970)
-rw-r--r-- | configure.ac | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index ab700cf..54b01a4 100644 --- a/configure.ac +++ b/configure.ac @@ -35,7 +35,21 @@ AC_CONFIG_AUX_DIR([.]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([src/openvpn/syshead.h]) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE + +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(foreign serial_tests) dnl NB: Do not [quote] this parameter. AC_CANONICAL_HOST AC_USE_SYSTEM_EXTENSIONS |