]> git.draconx.ca Git - gob-dx.git/commitdiff
Replace GOB2_CHECK with the version from dxcommon.
authorNick Bowler <nbowler@draconx.ca>
Mon, 27 Jan 2020 23:16:15 +0000 (18:16 -0500)
committerNick Bowler <nbowler@draconx.ca>
Mon, 27 Jan 2020 23:16:15 +0000 (18:16 -0500)
Other than the name, the DX_PROG_GOB2 macro from dxcommon can work as
a drop-in replacement for GOB2_CHECK and has a much more robust version
check.

So let's drop the current macro and install a renamed DX_PROG_GOB2
macro instead.

.gitignore
Makefile.am
common
gob2.m4 [deleted file]
tests/general.at

index cef6aa1e332392cfc3c4771264179279c56fb2a8..35d44a7b3880a954d2f10516f722c7b4c9f73124 100644 (file)
@@ -11,6 +11,7 @@
 /configure
 /depcomp
 /gob2
+/gob2.m4
 /gob2.spec
 /install-sh
 /libtool
index 5e859a17a4edcc2e8e09145f6a34d59a5c568b71..0f6ad3da08ea1b68cabb8542f22422df9465f349 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2019 Nick Bowler
+# Copyright © 2019-2020 Nick Bowler
 #
 # Based on original work Copyright © 1999-2013 Jiri (George) Lebl.
 #
@@ -84,6 +84,13 @@ uninstall-gob2-html:
 .PHONY: uninstall-gob2-html
 
 m4dir = $(datadir)/aclocal
-dist_m4_DATA = gob2.m4
+m4_DATA = gob2.m4
+
+gob2.m4: $(top_srcdir)/common/m4/gob2.m4
+       $(AM_V_GEN) $(SED) 's/DX_PROG_GOB2/GOB2_CHECK/g' \
+         $(top_srcdir)/common/m4/gob2.m4 >$@.tmp
+       $(AM_V_at) mv -f $@.tmp $@
+DISTCLEANFILES += gob2.m4
+EXTRA_DIST += common/m4/gob2.m4
 
 include $(top_srcdir)/common/snippet/autotest.mk
diff --git a/common b/common
index 9ade2c8c042ab15030d7bbb49fa97ae692a10e4f..4705ffd69e7b7551bab4650f9e49756667be783b 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 9ade2c8c042ab15030d7bbb49fa97ae692a10e4f
+Subproject commit 4705ffd69e7b7551bab4650f9e49756667be783b
diff --git a/gob2.m4 b/gob2.m4
deleted file mode 100644 (file)
index 196d6c2..0000000
--- a/gob2.m4
+++ /dev/null
@@ -1,58 +0,0 @@
-dnl
-dnl GOB_HOOK(script if found, fail)
-dnl if fail = "failure", abort if GOB not found
-dnl
-
-
-AC_DEFUN([GOB2_HOOK],[
-       AC_PATH_PROG(GOB2,gob2)
-       if test ! x$GOB2 = x; then      
-               if test ! x$1 = x; then 
-                       AC_MSG_CHECKING(for gob-2 >= $1)
-                       g_r_ve=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-                       g_r_ma=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-                       g_r_mi=`echo $1|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-                       g_ve=`$GOB2 --version 2>&1|sed 's/Gob version \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-                       g_ma=`$GOB2 --version 2>&1|sed 's/Gob version \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-                       g_mi=`$GOB2 --version 2>&1|sed 's/Gob version \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-
-                       if test $g_ve -eq $g_r_ve; then
-                               if test $g_ma -ge $g_r_ma; then
-                                       if test $g_mi -ge $g_r_mi; then
-                                               AC_MSG_RESULT(ok)
-                                       else
-                                               if test $g_ma -gt $g_r_ma; then
-                                                       AC_MSG_RESULT(ok)
-                                               else
-                                                       AC_MSG_ERROR("found $g_ve.$g_ma.$g_mi requires $g_r_ve.$g_r_ma.$g_r_mi")
-                                               fi
-                                       fi
-                               else
-                                       AC_MSG_ERROR("found $g_ve.$g_ma.$g_mi requires $g_r_ve.$g_r_ma.$g_r_mi")
-                               fi
-                       else
-                               if test $g_ve -gt $g_r_ve; then
-                                       AC_MSG_RESULT(ok)
-                               else
-                                       AC_MSG_ERROR(major version $g_ve found but $g_r_ve required)
-                               fi
-                       fi
-       
-                       unset gob_version
-                       unset g_ve
-                       unset g_ma
-                       unset g_mi
-                       unset g_r_ve
-                       unset g_r_ma
-                       unset g_r_mi
-               fi
-               AC_SUBST(GOB2)
-               $2
-       else            
-               $3
-       fi
-])
-
-AC_DEFUN([GOB2_CHECK],[
-       GOB2_HOOK($1,[],[AC_MSG_ERROR([Cannot find GOB-2, check http://www.5z.com/jirka/gob.html])])
-])
index 10f6f0fc7962c14de29b08ffae4e1cccf14af29e..40019425f54e7bd0007a18f567338c4280050063 100644 (file)
@@ -278,7 +278,6 @@ AT_CHECK([$AUTOCONF && test -f configure || exit 77], [0], [ignore], [ignore])
 
 m4_define([MYVER],
   m4_bpatsubst(m4_dquote(m4_defn([AT_PACKAGE_VERSION])), [[^][0-9.]]))
-m4_if(m4_defn([MYVER]), m4_defn([AT_PACKAGE_VERSION]), [], [AT_XFAIL_IF([:])])
 
 m4_define([MYVER_P1], m4_dquote(m4_reverse(m4_unquote(
   m4_split(m4_defn([MYVER]), [[.]])))))
@@ -289,7 +288,7 @@ AT_DATA([test.in], [[@GOB2@
 ]])
 
 cat >configure.ac <<EOF
-[m4@&t@_include([$srcdir/gob2.m4])]
+[m4@&t@_include([$builddir/gob2.m4])]
 [m4@&t@_pattern_forbid([^GOB2_])]
 [AC_INIT([gob2_check], [0])]
 [GOB2_CHECK(]m4_dquote(m4_defn([MYVER]))[)]