Add invalid-tags cover icon.
[gmpc.git] / m4 / gob2.m4
blob196d6c24e358815ce05a64e3288df5f5e925b52a
1 dnl
2 dnl GOB_HOOK(script if found, fail)
3 dnl if fail = "failure", abort if GOB not found
4 dnl
7 AC_DEFUN([GOB2_HOOK],[
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
22                                                 AC_MSG_RESULT(ok)
23                                         else
24                                                 if test $g_ma -gt $g_r_ma; then
25                                                         AC_MSG_RESULT(ok)
26                                                 else
27                                                         AC_MSG_ERROR("found $g_ve.$g_ma.$g_mi requires $g_r_ve.$g_r_ma.$g_r_mi")
28                                                 fi
29                                         fi
30                                 else
31                                         AC_MSG_ERROR("found $g_ve.$g_ma.$g_mi requires $g_r_ve.$g_r_ma.$g_r_mi")
32                                 fi
33                         else
34                                 if test $g_ve -gt $g_r_ve; then
35                                         AC_MSG_RESULT(ok)
36                                 else
37                                         AC_MSG_ERROR(major version $g_ve found but $g_r_ve required)
38                                 fi
39                         fi
40         
41                         unset gob_version
42                         unset g_ve
43                         unset g_ma
44                         unset g_mi
45                         unset g_r_ve
46                         unset g_r_ma
47                         unset g_r_mi
48                 fi
49                 AC_SUBST(GOB2)
50                 $2
51         else            
52                 $3
53         fi
56 AC_DEFUN([GOB2_CHECK],[
57         GOB2_HOOK($1,[],[AC_MSG_ERROR([Cannot find GOB-2, check http://www.5z.com/jirka/gob.html])])