]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Ensure that the two version numbers in configure.ac remain in sync.
authorJim Meyering <jim@meyering.net>
Sat, 19 Jan 2002 00:12:30 +0000 (00:12 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 19 Jan 2002 00:12:30 +0000 (00:12 +0000)
(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

index 811e2a1cdc35e039d8ca83554a206c2f36e20ebc..17bb2c0b8e47a14e8855461a57f1170efc0f232e 100644 (file)
@@ -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 \