2 dnl GOB_HOOK(script if found, fail)
3 dnl if fail = "failure", abort if GOB not found
8 AC_PATH_PROG(GOB2,gob2)
9 if test ! x$GOB2 = x; then
10 if test ! x$1 = x; then
11 AC_MSG_CHECKING(for gob-2 >= $1)
12 g_r_ve=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
13 g_r_ma=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
14 g_r_mi=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
15 g_ve=`$GOB2 --version 2>&1|sed 's/Gob version \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
16 g_ma=`$GOB2 --version 2>&1|sed 's/Gob version \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
17 g_mi=`$GOB2 --version 2>&1|sed 's/Gob version \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
19 if test $g_ve -eq $g_r_ve; then
20 if test $g_ma -ge $g_r_ma; then
21 if test $g_mi -ge $g_r_mi; then
24 if test $g_ma -gt $g_r_ma; then
27 AC_MSG_ERROR("found $g_ve.$g_ma.$g_mi requires $g_r_ve.$g_r_ma.$g_r_mi")
31 AC_MSG_ERROR("found $g_ve.$g_ma.$g_mi requires $g_r_ve.$g_r_ma.$g_r_mi")
34 if test $g_ve -gt $g_r_ve; then
37 AC_MSG_ERROR(major version $g_ve found but $g_r_ve required)
56 AC_DEFUN([GOB2_CHECK],[
57 GOB2_HOOK($1,[],[AC_MSG_ERROR([Cannot find GOB-2, check http://www.5z.com/jirka/gob.html])])