perl.m4 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # serial 9
  2. dnl From Jim Meyering.
  3. dnl Find a new-enough version of Perl.
  4. # Copyright (C) 1998-2001, 2003-2004, 2007, 2009-2018 Free Software Foundation,
  5. # Inc.
  6. #
  7. # This file is free software; the Free Software Foundation
  8. # gives unlimited permission to copy and/or distribute it,
  9. # with or without modifications, as long as this notice is preserved.
  10. # GNUnet e.V. comment of origin: gnulib
  11. AC_DEFUN([gl_PERL],
  12. [
  13. dnl FIXME: don't hard-code 5.005
  14. AC_MSG_CHECKING([for perl5.005 or newer])
  15. if test "${PERL+set}" = set; then
  16. # 'PERL' is set in the user's environment.
  17. candidate_perl_names="$PERL"
  18. perl_specified=yes
  19. else
  20. candidate_perl_names='perl perl5'
  21. perl_specified=no
  22. fi
  23. found=no
  24. AC_SUBST([PERL])
  25. PERL="$am_missing_run perl"
  26. for perl in $candidate_perl_names; do
  27. # Run test in a subshell; some versions of sh will print an error if
  28. # an executable is not found, even if stderr is redirected.
  29. if ( $perl -e 'require 5.005; use File::Compare' ) > /dev/null 2>&1; then
  30. PERL=$perl
  31. found=yes
  32. break
  33. fi
  34. done
  35. AC_MSG_RESULT([$found])
  36. test $found = no && AC_MSG_WARN([
  37. WARNING: You don't seem to have perl5.005 or newer installed, or you lack
  38. a usable version of the Perl File::Compare module. As a result,
  39. you may be unable to run a few tests or to regenerate certain
  40. files if you modify the sources from which they are derived.
  41. ] )
  42. ])