From: Bruno Haible Date: Thu, 23 Jan 2025 09:13:43 +0000 (+0100) Subject: build: Improve package version handling. X-Git-Tag: v0.24~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53e5da8c8da612b185c7fdfdfff9e6db4b2e2b54;p=thirdparty%2Fgettext.git build: Improve package version handling. * autogen.sh: Copy also m4/init-package-version.m4, m4/version-stamp.m4. * configure.ac: Use gl_INIT_PACKAGE and gl_CONFIG_VERSION_STAMP. * gettext-runtime/configure.ac: Use gl_INIT_PACKAGE. * gettext-runtime/intl/configure.ac: Likewise. * gettext-tools/configure.ac: Likewise. * gettext-tools/examples/configure.ac: Likewise. * Makefile.am (dist-tarball-version): New target. ($(top_srcdir)/.version): Remove target. --- diff --git a/.gitignore b/.gitignore index b980e08e1..dcf5660ae 100644 --- a/.gitignore +++ b/.gitignore @@ -388,6 +388,8 @@ /gettext-tools/tests/gnulib-lib/ !/gettext-tools/tests/gnulib-lib/Makefile.am /gettext-tools/tests/init.sh +/m4/init-package-version.m4 +/m4/version-stamp.m4 # Files brought in by "automake --add-missing --copy": /build-aux/compile diff --git a/Makefile.am b/Makefile.am index 2d38bfd67..5226a3bf3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the toplevel directory of GNU gettext -## Copyright (C) 1995-2024 Free Software Foundation, Inc. +## Copyright (C) 1995-2025 Free Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -98,12 +98,13 @@ EXTRA_DIST += INSTALL.aix # Versioning based on Git release tags. +dist-hook: dist-tarball-version +.PHONY: dist-tarball-version +dist-tarball-version: + echo '$(VERSION)' > $(distdir)/.tarball-version + EXTRA_DIST += $(top_srcdir)/.version BUILT_SOURCES = $(top_srcdir)/.version -$(top_srcdir)/.version: - echo $(VERSION) > $@-t && mv $@-t $@ -dist-hook: gen-ChangeLogs - echo $(VERSION) > $(distdir)/.tarball-version # Support for "make dist" without prior "make". @@ -120,6 +121,8 @@ distdir1: # Generate ChangeLog. +dist-hook: gen-ChangeLogs + gen_start_date = 2015-10-13 .PHONY: gen-ChangeLogs gen-ChangeLogs: diff --git a/autogen.sh b/autogen.sh index 11bdca36f..3d70de01c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -465,6 +465,8 @@ if ! $skip_gnulib; then $GNULIB_TOOL --copy-file build-aux/update-copyright || exit $? $GNULIB_TOOL --copy-file build-aux/useless-if-before-free || exit $? $GNULIB_TOOL --copy-file build-aux/vc-list-files || exit $? + $GNULIB_TOOL --copy-file m4/init-package-version.m4 || exit $? + $GNULIB_TOOL --copy-file m4/version-stamp.m4 || exit $? $GNULIB_TOOL --copy-file top/GNUmakefile . || exit $? $GNULIB_TOOL --copy-file top/maint.mk . || exit $? diff --git a/configure.ac b/configure.ac index 2521e4da0..c2754bb5a 100644 --- a/configure.ac +++ b/configure.ac @@ -17,11 +17,14 @@ dnl along with this program. If not, see . dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) -AC_INIT([gettext], - m4_esyscmd([build-aux/git-version-gen .tarball-version]), - [bug-gettext@gnu.org]) +AC_INIT +PACKAGE_BUGREPORT='bug-gettext@gnu.org' AC_CONFIG_SRCDIR([gettext-tools/src/msgfmt.c]) AC_CONFIG_AUX_DIR([build-aux]) +VERSION_NUMBER=`cd $srcdir \ + && build-aux/git-version-gen .tarball-version \ + | sed -e 's/dirty$/modified/'` +gl_INIT_PACKAGE([gettext], [$VERSION_NUMBER]) AM_INIT_AUTOMAKE([1.13 silent-rules parallel-tests tar-ustar]) dnl Override automake's tar command used for creating distributions: @@ -61,4 +64,6 @@ AC_CONFIG_FILES([Makefile], AC_CONFIG_FILES([gnulib-local/Makefile]) +gl_CONFIG_VERSION_STAMP + AC_OUTPUT diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index bf52be77d..cde0657dd 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-runtime directory of GNU gettext -dnl Copyright (C) 1995-2024 Free Software Foundation, Inc. +dnl Copyright (C) 1995-2025 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -17,11 +17,14 @@ dnl along with this program. If not, see . dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) -AC_INIT([gettext-runtime], - m4_esyscmd([../build-aux/git-version-gen ../.tarball-version]), - [bug-gettext@gnu.org]) +AC_INIT +PACKAGE_BUGREPORT='bug-gettext@gnu.org' AC_CONFIG_SRCDIR([intl/dcigettext.c]) AC_CONFIG_AUX_DIR([../build-aux]) +VERSION_NUMBER=`cd $srcdir/.. \ + && build-aux/git-version-gen .tarball-version \ + | sed -e 's/dirty$/modified/'` +gl_INIT_PACKAGE([gettext-runtime], [$VERSION_NUMBER]) AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) AC_CONFIG_HEADERS([config.h]) diff --git a/gettext-runtime/intl/configure.ac b/gettext-runtime/intl/configure.ac index 749a70096..e7edb39e1 100644 --- a/gettext-runtime/intl/configure.ac +++ b/gettext-runtime/intl/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-runtime directory of GNU gettext -dnl Copyright (C) 1995-2024 Free Software Foundation, Inc. +dnl Copyright (C) 1995-2025 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -17,11 +17,14 @@ dnl along with this program. If not, see . dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) -AC_INIT([libintl], - m4_esyscmd([../../build-aux/git-version-gen ../../.tarball-version]), - [bug-gettext@gnu.org]) +AC_INIT +PACKAGE_BUGREPORT='bug-gettext@gnu.org' AC_CONFIG_SRCDIR([dcigettext.c]) AC_CONFIG_AUX_DIR([../../build-aux]) +VERSION_NUMBER=`cd $srcdir/../.. \ + && build-aux/git-version-gen .tarball-version \ + | sed -e 's/dirty$/modified/'` +gl_INIT_PACKAGE([libintl], [$VERSION_NUMBER]) AM_INIT_AUTOMAKE([silent-rules]) AC_CONFIG_HEADERS([config.h]) diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index b863e0f2b..6a523aa24 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-tools directory of GNU gettext -dnl Copyright (C) 1995-2024 Free Software Foundation, Inc. +dnl Copyright (C) 1995-2025 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -17,11 +17,14 @@ dnl along with this program. If not, see . dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) -AC_INIT([gettext-tools], - m4_esyscmd([../build-aux/git-version-gen ../.tarball-version]), - [bug-gettext@gnu.org]) +AC_INIT +PACKAGE_BUGREPORT='bug-gettext@gnu.org' AC_CONFIG_SRCDIR([src/msgfmt.c]) AC_CONFIG_AUX_DIR([../build-aux]) +VERSION_NUMBER=`cd $srcdir/.. \ + && build-aux/git-version-gen .tarball-version \ + | sed -e 's/dirty$/modified/'` +gl_INIT_PACKAGE([gettext-tools], [$VERSION_NUMBER]) AM_INIT_AUTOMAKE([1.11.1 silent-rules parallel-tests]) AC_CONFIG_HEADERS([config.h]) diff --git a/gettext-tools/examples/configure.ac b/gettext-tools/examples/configure.ac index 249fd14cd..30857f937 100644 --- a/gettext-tools/examples/configure.ac +++ b/gettext-tools/examples/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-tools/examples directory of GNU gettext -dnl Copyright (C) 2006, 2009, 2014, 2019-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2025 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -17,11 +17,14 @@ dnl along with this program. If not, see . dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) -AC_INIT([gettext-examples], - m4_esyscmd([../../build-aux/git-version-gen ../../.tarball-version]), - [bug-gettext@gnu.org]) +AC_INIT +PACKAGE_BUGREPORT='bug-gettext@gnu.org' AC_CONFIG_SRCDIR([installpaths.in]) AC_CONFIG_AUX_DIR([../../build-aux]) +VERSION_NUMBER=`cd $srcdir/../.. \ + && build-aux/git-version-gen .tarball-version \ + | sed -e 's/dirty$/modified/'` +gl_INIT_PACKAGE([gettext], [$VERSION_NUMBER]) AM_INIT_AUTOMAKE([silent-rules]) dnl Installation directories.