aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorA. Karl Kornel <akkornel@stanford.edu>2016-01-22 22:19:45 -0800
committerRuss Allbery <eagle@eyrie.org>2016-01-23 15:21:55 -0800
commit61a42ce222ed07da0c22a5394e5f3b59cc4bf690 (patch)
treec7992bb9c566c0d856d388f194b3bf1bfa4e1d8a /configure.ac
parentd06e318c304a8c55277c616765a8a0502eb9207d (diff)
Make Perl path configurable & check version
Use configure to determine the path to Perl, and error out if Perl is not found or is too old. This also means users can set a path to a custom or weirdly-named Perl binary.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4f56eb0..350132a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,15 @@ AS_IF([test x"$REMCTLD" != x],
[AC_DEFINE_UNQUOTED([PATH_REMCTLD], ["$REMCTLD"],
[Define to the full path to remctld to run remctl tests.])])
+AC_ARG_VAR(PERL, [Path to the Perl binary])
+AC_PATH_PROG(PERL, perl)
+if test -z "$PERL"; then
+ AC_MSG_ERROR([Could not find Perl.])
+fi
+$PERL -e 'require 5.008;' || {
+ AC_MSG_ERROR([Perl 5.8 or better is required.])
+}
+
dnl Enable appropriate warnings.
AM_CONDITIONAL([WARNINGS_GCC], [test x"$GCC" = xyes && test x"$CLANG" != xyes])
AM_CONDITIONAL([WARNINGS_CLANG], [test x"$CLANG" = xyes])