1 # Contributed by Mark Asbach
2 # 2006-05-17, asbach@ient.rwth-aachen.de
4 # AC_VERSION_AT_LEAST([given-version = N[.N[.N]]],[required-version = N[.N[.N]]])
6 # Compare given-version to required-version and set ac_version_at_least to
7 # 'yes' or 'no' as the result. Nothing is AC_SUBSTed or AC_DEFINEd.
9 # Thanks to Eric Blake, Stephan Kasal, Paul Eggert and Harald Dunkel of
10 # the GNU Autoconf mailing list for providing the core implementation.
12 # Author: Mark Asbach <asbach@ient.rwth-aachen.de>
14 AC_DEFUN([AC_VERSION_AT_LEAST],[
15 # check if both parameters were given
20 AC_MSG_ERROR([no required-version supplied])
23 AC_MSG_ERROR([no given-version supplied])
26 # recombine version strings
28 $1" | sed 's/\.0*/./g'`
31 # Use POSIX sort first, falling back on traditional sort.
32 sort -t. -k1,1n -k1,1 -k2,2n -k2,2 -k3,3n -k3,3 -k4,4n -k4,4 2>/dev/null ||
33 sort -t. +0n -1 +0 -1 +1n -2 +1 -2 +2n -3 +2 -3 +3n -4 +3 -4
38 if test "x$tmp_both" = "x$tmp_sorted"; then
39 ac_version_at_least=yes
41 ac_version_at_least=no