From 00ae41703c606f0ea98febed8f67435f875f7e6f Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Mon, 27 Jan 2020 18:16:15 -0500 Subject: [PATCH] Replace GOB2_CHECK with the version from dxcommon. 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 | 1 + Makefile.am | 11 +++++++-- common | 2 +- gob2.m4 | 58 ------------------------------------------------ tests/general.at | 3 +-- 5 files changed, 12 insertions(+), 63 deletions(-) delete mode 100644 gob2.m4 diff --git a/.gitignore b/.gitignore index cef6aa1..35d44a7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ /configure /depcomp /gob2 +/gob2.m4 /gob2.spec /install-sh /libtool diff --git a/Makefile.am b/Makefile.am index 5e859a1..0f6ad3d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 9ade2c8..4705ffd 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 9ade2c8c042ab15030d7bbb49fa97ae692a10e4f +Subproject commit 4705ffd69e7b7551bab4650f9e49756667be783b diff --git a/gob2.m4 b/gob2.m4 deleted file mode 100644 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])]) -]) diff --git a/tests/general.at b/tests/general.at index 10f6f0f..4001942 100644 --- a/tests/general.at +++ b/tests/general.at @@ -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 <