Use configure.ac hack to apply serial_test AM option only if supported.
PATCH 1/1 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
--- configure.ac | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
configure.ac +15 -1
@@ -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
Signature · 1 line
2.3.6
Quoted 4 lines · Gert Doering
Inspired by libguestfs' configure.ac hack - test automake version, and if 1.12 or newer, use m4 magic to pass "
serial_tests" option toAM_INIT_AUTOMAKE().
Quoted 9 lines
https://www.redhat.com/archives/libguestfs/2013-February/msg00102.html
Trac #427
Signed-off-by Gert Doering <[email protected]...>--- configure.ac | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
ACK.
I've tested on:
- CentOS 5 with automake 1.9.6
- RHEL 7 with automake 1.13.4
- Fedora 22 Beta with automake 1.15
Tested autoreconf, ./configure, make and make check successfully.
Signature · 3 lines
kind regards, David Sommerseth
Patch has been applied to the master and release/2.3 branch.
(Also tested by using buildbot on the "experimental" branch, plus building windows release from that - so we're fairly confident that it will not blow up stuff this time - sorry for the noise on the list)
commit c615835aa93701c764c23fc2579d97757c1a9970 (master) commit d378850ab70af4c967d099627f0a19ad42ecbdcb (release/2.3)
Author: Gert Doering Date: Mon Jun 1 21:04:47 2015 +0200
Use configure.ac hack to apply serial_test AM option only if supported.
Signed-off-by: Gert Doering <[email protected]...>
Acked-by: David Sommerseth <[email protected]...>
Message-Id: <[email protected]...>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9769--
kind regards,
Gert Doering