Blame m4/perl.m4

Packit 709fb3
# serial 9
Packit 709fb3
Packit 709fb3
dnl From Jim Meyering.
Packit 709fb3
dnl Find a new-enough version of Perl.
Packit 709fb3
Packit 709fb3
# Copyright (C) 1998-2001, 2003-2004, 2007, 2009-2017 Free Software Foundation,
Packit 709fb3
# Inc.
Packit 709fb3
#
Packit 709fb3
# This file is free software; the Free Software Foundation
Packit 709fb3
# gives unlimited permission to copy and/or distribute it,
Packit 709fb3
# with or without modifications, as long as this notice is preserved.
Packit 709fb3
Packit 709fb3
AC_DEFUN([gl_PERL],
Packit 709fb3
[
Packit 709fb3
  dnl FIXME: don't hard-code 5.005
Packit 709fb3
  AC_MSG_CHECKING([for perl5.005 or newer])
Packit 709fb3
  if test "${PERL+set}" = set; then
Packit 709fb3
    # 'PERL' is set in the user's environment.
Packit 709fb3
    candidate_perl_names="$PERL"
Packit 709fb3
    perl_specified=yes
Packit 709fb3
  else
Packit 709fb3
    candidate_perl_names='perl perl5'
Packit 709fb3
    perl_specified=no
Packit 709fb3
  fi
Packit 709fb3
Packit 709fb3
  found=no
Packit 709fb3
  AC_SUBST([PERL])
Packit 709fb3
  PERL="$am_missing_run perl"
Packit 709fb3
  for perl in $candidate_perl_names; do
Packit 709fb3
    # Run test in a subshell; some versions of sh will print an error if
Packit 709fb3
    # an executable is not found, even if stderr is redirected.
Packit 709fb3
    if ( $perl -e 'require 5.005; use File::Compare' ) > /dev/null 2>&1; then
Packit 709fb3
      PERL=$perl
Packit 709fb3
      found=yes
Packit 709fb3
      break
Packit 709fb3
    fi
Packit 709fb3
  done
Packit 709fb3
Packit 709fb3
  AC_MSG_RESULT([$found])
Packit 709fb3
  test $found = no && AC_MSG_WARN([
Packit 709fb3
WARNING: You don't seem to have perl5.005 or newer installed, or you lack
Packit 709fb3
         a usable version of the Perl File::Compare module.  As a result,
Packit 709fb3
         you may be unable to run a few tests or to regenerate certain
Packit 709fb3
         files if you modify the sources from which they are derived.
Packit 709fb3
] )
Packit 709fb3
])