On 2006-03-06, Roland Levillain roland@lrde.epita.fr wrote:
https://svn.lrde.epita.fr/svn/havm/trunk
Index: ChangeLog from Roland Levillain roland@lrde.epita.fr
Use AS_VERSION_COMPARE to check GHC's version number.
- build-aux/version-compare.m4: New file.
- build-aux/prog.m4: New file.
(HAVM_PROG): New macro.
- configure.ac: Use it to check that GHC's version is at least 6.4.
Catch "HAVM_*" macros that are not expanded.
- Makefile.am: Add build-aux to the list of directories scanned by
aclocal.
Makefile.am | 2 + build-aux/prog.m4 | 36 +++++++++++++++++++ build-aux/version-compare.m4 | 80 +++++++++++++++++++++++++++++++++++++++++++ configure.ac | 7 +-- 4 files changed, 121 insertions, 4 deletions
[STRIP]
Index: build-aux/version-compare.m4 --- build-aux/version-compare.m4 (revision 0) +++ build-aux/version-compare.m4 (revision 0) @@ -0,0 +1,80 @@ +# Remove this as soon as Autoconf 2.60 airs. -*- Autoconf -*-
+# _AS_VERSION_COMPARE_PREPARE +# --------------------------- +# Output variables for comparing version numbers. +AC_DEFUN([_AS_VERSION_COMPARE_PREPARE], +[[as_awk_strverscmp='
[STRIP AWK SCRIPT]
+']])
+# AS_VERSION_COMPARE(VERSION-1, VERSION-2, +# [ACTION-IF-LESS], [ACTION-IF-EQUAL], [ACTION-IF-GREATER]) +# ----------------------------------------------------------------------------- +# Compare two strings possibly containing shell variables as version strings. +AC_DEFUN([AS_VERSION_COMPARE], +[AS_REQUIRE([_$0_PREPARE])dnl +as_arg_v1=$1 +as_arg_v2=$2 +dnl This usage is portable even to ancient awk, +dnl so don't worry about finding a "nice" awk version. +awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null
^^^
+case $? in +1) $3;; +0) $4;; +2) $5;; +esac[]dnl +])
Faudrait pas plutot utiliser $AWK tel que le configure le declare? Je sais pas, y'a ptete des machines avec mawk sans awk (eg, pas de symlink /usr/bin/awk -> /usr/bin/mawk)