]> eyrie.org Git - kerberos/wallet.git/commitdiff
Make Perl path configurable & check version
authorA. Karl Kornel <akkornel@stanford.edu>
Sat, 23 Jan 2016 06:19:45 +0000 (22:19 -0800)
committerRuss Allbery <eagle@eyrie.org>
Sat, 23 Jan 2016 23:21:55 +0000 (15:21 -0800)
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.

Makefile.am
configure.ac

index 6cabc93ccb9c7de67d55518641e32d043c9f8371..87ba95993d92119c773d2383ce4b391a0bd8504c 100644 (file)
@@ -236,7 +236,7 @@ perl/blib/lib/Wallet/Config.pm: $(srcdir)/perl/lib/Wallet/Config.pm
        $(INSTALL_DATA) $(srcdir)/tests/tap/perl/Test/RRA.pm perl/t/lib/Test/
        $(INSTALL_DATA) $(srcdir)/tests/tap/perl/Test/RRA/Config.pm \
            perl/t/lib/Test/RRA/
-       cd perl && perl Build.PL $(WALLET_PERL_FLAGS)
+       cd perl && $(PERL) Build.PL $(WALLET_PERL_FLAGS)
        cd perl && ./Build
 
 # This is a really ugly hack to only honor prefix when running make install
index 4f56eb023fba47e47ad831e29725582914ad64b0..350132a0d60b8a5a4f64177985cdf4e18763320d 100644 (file)
@@ -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])