* Future-proof autoconf's Perl version test.
authoraudreyt@audreyt.org <unknown>
Wed, 11 Jul 2007 16:58:51 +0000 (16:58 +0000)
committeraudreyt@audreyt.org <unknown>
Wed, 11 Jul 2007 16:58:51 +0000 (16:58 +0000)
  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

index f2762b3..ce8e585 100644 (file)
@@ -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*
 ])