+dnl FPTOOLS_PROG_CHECK_VERSION(VERSIONSTR1, TEST, VERSIONSTR2,
+dnl ACTION-IF-TRUE [, ACTION-IF-FALSE])
+dnl
+dnl compare versions field-wise (separator is '.')
+dnl TEST is one of {-lt,-le,-eq,-ge,-gt}
+dnl
+dnl quite shell-independant and SUSv2 compliant code
+dnl
+dnl NOTE: the loop could be unrolled within autoconf, but the
+dnl macro code would be a) longer and b) harder to debug... ;)
+dnl
+AC_DEFUN(FPTOOLS_PROG_CHECK_VERSION,
+[if ( IFS=".";
+ a="[$1]"; b="[$3]";
+ while test -n "$a$b"
+ do
+ set -- [$]a; h1="[$]1"; shift 2>/dev/null; a="[$]*"
+ set -- [$]b; h2="[$]1"; shift 2>/dev/null; b="[$]*"
+ test -n "[$]h1" || h1=0; test -n "[$]h2" || h2=0
+ test [$]{h1} -eq [$]{h2} || break
+ done
+ test [$]{h1} [$2] [$]{h2}
+ )
+then ifelse([$4],,[:],[
+ $4])
+ifelse([$5],,,
+[else
+ $5])
+fi
+])])dnl
+
+
+dnl