From 4d2457071327bc82898b2c974d0d2e03747537c9 Mon Sep 17 00:00:00 2001 From: "audreyt@audreyt.org" Date: Wed, 11 Jul 2007 16:58:51 +0000 Subject: [PATCH] * Future-proof autoconf's Perl version test. GHC only works with Perl versions 5.6 and later; however the current test greps in a rather non-future-proof way (explicitly against 5.6 and 5.8). We instead exploit the "v-string" change in 5.6, which displays the version string as "v5.x.y", rather than the earlier format "version 5.xxx_yyy". Hence grepping against "v5" will make it future proof for a while. (At least until Perl 6 is installed as the system perl.) --- aclocal.m4 | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index f2762b3..ce8e585 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -571,22 +571,17 @@ AC_DEFUN([FP_MINGW_GCC], ]) dnl Small feature test for perl version. Assumes PerlCmd -dnl contains path to perl binary +dnl contains path to perl binary. +dnl +dnl (Perl versions prior to v5.6 does not contain the string "v5"; +dnl instead they display version strings such as "version 5.005".) dnl AC_DEFUN([FPTOOLS_CHECK_PERL_VERSION], [$PerlCmd -v >conftest.out 2>&1 - if grep "v5.6" conftest.out >/dev/null 2>&1; then + if grep "v5" conftest.out >/dev/null 2>&1; then : else - if grep "v5.8" conftest.out >/dev/null 2>&1; then - : - else - if grep "version 6" conftest.out >/dev/null 2>&1; then - : - else - AC_MSG_ERROR([your version of perl probably won't work, try upgrading it.]) - fi - fi + AC_MSG_ERROR([your version of perl probably won't work, try upgrading it.]) fi rm -fr conftest* ]) -- 1.7.10.4