diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-04-11 15:29:07 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-04-24 15:54:06 +0200 |
commit | ea4aa6f184909db38bacbbf60f22f1674f2853a6 (patch) | |
tree | 200f106845b6ee274be3fe02c18e081f4478edfc /configure.ac | |
parent | 03acea832ad39fa371781f045c39677a02d1156a (diff) | |
download | pacman-ea4aa6f184909db38bacbbf60f22f1674f2853a6.tar.gz pacman-ea4aa6f184909db38bacbbf60f22f1674f2853a6.tar.xz |
configure: require bash >= 4.1 at compile time
We've unofficially agreed to raise our minimum supported bash version to
4.1, and since added features that require it. Additionally, an earlier
commit adds a syntax check to the builds of scripts/ and contrib/ which
could conceivably fail with an earlier shell. Therefore, make this a
hard requirement of the build process.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index d488bfaf..0e78c238 100644 --- a/configure.ac +++ b/configure.ac @@ -148,7 +148,23 @@ AC_PROG_AWK AC_PROG_CC_C99 AC_PROG_INSTALL AC_CHECK_PROGS([PYTHON], [python2.7 python2.6 python2.5 python2 python], [false]) -AC_PATH_PROGS([BASH_SHELL], [bash bash4 bash3], [false]) +AC_PATH_PROGS([BASH_SHELL], [bash bash4], [false]) + +AS_IF([test "x$BASH_SHELL" = "xfalse"], + AC_MSG_WARN([*** bash >= 4.1.0 is required for pacman scripts]), + [bash_version_major=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[0]]}"'` + bash_version_minor=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[1]]}"'` + ok=yes + if test "$bash_version_major" -lt 4; then + ok=no + fi + if test "$bash_version_major" -eq 4 && test "$bash_version_minor" -lt 1; then + ok=no + fi + if test "$ok" = "no"; then + AC_MSG_ERROR([*** bash >= 4.1.0 is required for pacman scripts]) + fi + unset bash_version_major bash_version_minor ok]) # find installed gettext AM_GNU_GETTEXT([external], [need-ngettext]) |