From 325addae1dc5177c831909335dd6a0fe5fcfb14f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 19 Jan 2002 00:12:30 +0000 Subject: Ensure that the two version numbers in configure.ac remain in sync. (local-check): Depend on ac-check. (ac_p_pkg, AC_INIT_PKG): Define. (ac_p_ver, AC_INIT_VER): Define. (ac-check): New rule. --- Makefile.maint | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'Makefile.maint') diff --git a/Makefile.maint b/Makefile.maint index 811e2a1cd..17bb2c0b8 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -53,7 +53,7 @@ release_archive_dir ?= ../release # Checks that don't require cvs. # Run `changelog-check' last, as previous test may reveal problems requiring # new ChangeLog entries. -local-check: po-check copyright-check writable-files \ +local-check: ac-check po-check copyright-check writable-files \ m4-check author_mark_check \ changelog-check @@ -70,6 +70,23 @@ m4-check: && { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \ exit 1; } || : +# If the 3-arg form of AC_INIT is used, then verify that the package name +# and version number specified there match $(PACKAGE) and $(VERSION). +# e.g., AC_INIT(GNU fileutils, 4.1.6, bug-fileutils@gnu.org) + +ac_p_pkg = /^AC_INIT\((GNU )?(\S+),/ and print "$$2\n" +AC_INIT_PKG := $(shell perl -ne '$(ac_p_pkg)' configure.ac) +ac_p_ver = /^AC_INIT\(.*?, *(\S+),/ and print "$$1\n" +AC_INIT_VER := $(shell perl -ne '$(ac_p_ver)' configure.ac) + +ac-check: + if test "$(AC_INIT_PKG)"; then \ + test "$(AC_INIT_PKG)" = $(PACKAGE) || exit 1; \ + fi + if test "$(AC_INIT_VER)"; then \ + test "$(AC_INIT_VER)" = $(VERSION) || exit 1; \ + fi + # Verify that all source files using _() are listed in po/POTFILES.in. po-check: if test -f po/POTFILES.in; then \ -- cgit v1.2.3-54-g00ecf