diff options
author | Russ Allbery <eagle@eyrie.org> | 2016-01-23 15:05:11 -0800 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2016-01-23 15:21:55 -0800 |
commit | 4abe4ae9b4149a5eb8a30a6e7b1070ff97d69021 (patch) | |
tree | 8b79c427d7046bf54674bdb7e0428d02d52dacd2 /configure.ac | |
parent | a3e8f376636476bbf0b840561b5fb190dedf1f8e (diff) |
Improvements to Autoconf probe for Perl
Properly quote all the macro arguments, use AS_IF, and move the
code to the appropriate sequence in configure.ac.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 350132a..bf26055 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) |