]> eyrie.org Git - kerberos/wallet.git/commitdiff
Improvements to Autoconf probe for Perl
authorRuss Allbery <eagle@eyrie.org>
Sat, 23 Jan 2016 23:05:11 +0000 (15:05 -0800)
committerRuss Allbery <eagle@eyrie.org>
Sat, 23 Jan 2016 23:21:55 +0000 (15:21 -0800)
Properly quote all the macro arguments, use AS_IF, and move the
code to the appropriate sequence in configure.ac.

configure.ac

index 350132a0d60b8a5a4f64177985cdf4e18763320d..bf2605581e3659a2b4d99f3de64f37ed0dda1d27 100644 (file)
@@ -45,6 +45,14 @@ AC_ARG_WITH([wallet-port],
         [AC_DEFINE_UNQUOTED([WALLET_PORT], [$withval],
             [Define to the default server port.])])])
 
+dnl Determine the path to the Perl binary.
+AC_ARG_VAR([PERL], [Path to the Perl binary])
+AC_PATH_PROG([PERL], [perl])
+AS_IF([test -z "$PERL"],
+    [AC_MSG_ERROR([Could not find Perl binary (set PERL to the full path)])])
+AS_IF(["$PERL" -e 'require 5.008'], [:],
+    [AC_MSG_ERROR([Perl 5.8 or better is required])])
+
 dnl Probe for required libraries.
 RRA_LIB_REMCTL
 RRA_LIB_KRB5
@@ -79,15 +87,6 @@ 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])