From: Bruno Haible Date: Wed, 2 Apr 2025 12:07:39 +0000 (+0200) Subject: gettextize: Fix bad interactions between autoreconf and autopoint. X-Git-Tag: v0.25~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c3b58eee6638ea21c26923d24a7f90c013a8663;p=thirdparty%2Fgettext.git gettextize: Fix bad interactions between autoreconf and autopoint. Reported by Sebastian Pipping in . * gettext-tools/m4/Makefile.am (aclocaldir): Remove variable. (pkgdatadir, macrosdir): Add variables. (macros_DATA): Renamed from aclocal_DATA. (install-data-local, uninstall-local, uninstall-macros): New targets. * gettext-tools/misc/gettextize.in: Copy the *.m4 files from $datadir/gettext/m4, not from $datadir/aclocal. * gettext-tools/doc/gettext.texi (aclocal): Don't recommend to add option --install to ACLOCAL_MFLAGS. Instead, recommend one-time use of --system-acdir. * PACKAGING: Expect *.m4 files in $prefix/share/gettext/m4, not in $prefix/share/aclocal. * NEWS: Mention the fix. --- diff --git a/NEWS b/NEWS index f007128c5..fa424785d 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,11 @@ Version 0.25 - April 2025 strings. - A new example 'hello-d' has been added. +Version 0.24.1 - April 2025 + +* Bug fixes: + - Fix bad interactions between autoreconf and autopoint. + Version 0.24 - February 2025 # Programming languages support: diff --git a/PACKAGING b/PACKAGING index b33601502..871156929 100644 --- a/PACKAGING +++ b/PACKAGING @@ -137,6 +137,17 @@ is according to the following file list. $prefix/libexec/gettext/* $prefix/share/locale/*/LC_MESSAGES/gettext-tools.mo $prefix/share/gettext/config.rpath + $prefix/share/gettext/m4/build-to-host.m4 + $prefix/share/gettext/m4/gettext.m4 + $prefix/share/gettext/m4/host-cpu-c-abi.m4 + $prefix/share/gettext/m4/iconv.m4 + $prefix/share/gettext/m4/intlmacosx.m4 + $prefix/share/gettext/m4/lib-ld.m4 + $prefix/share/gettext/m4/lib-link.m4 + $prefix/share/gettext/m4/lib-prefix.m4 + $prefix/share/gettext/m4/nls.m4 + $prefix/share/gettext/m4/po.m4 + $prefix/share/gettext/m4/progtest.m4 $prefix/share/gettext/po/* $prefix/share/gettext/projects/* $prefix/share/gettext/schema/* @@ -150,17 +161,6 @@ is according to the following file list. $prefix/share/gettext/archive.cvs.tar.* (only installed if --with-cvs specified) $prefix/share/gettext/disclaim-translations.txt $prefix/share/gettext-$VERSION/its/* - $prefix/share/aclocal/build-to-host.m4 - $prefix/share/aclocal/gettext.m4 - $prefix/share/aclocal/host-cpu-c-abi.m4 - $prefix/share/aclocal/iconv.m4 - $prefix/share/aclocal/intlmacosx.m4 - $prefix/share/aclocal/lib-ld.m4 - $prefix/share/aclocal/lib-link.m4 - $prefix/share/aclocal/lib-prefix.m4 - $prefix/share/aclocal/nls.m4 - $prefix/share/aclocal/po.m4 - $prefix/share/aclocal/progtest.m4 $prefix/share/emacs/site-lisp/po-compat.el $prefix/share/emacs/site-lisp/po-compat.elc $prefix/share/emacs/site-lisp/po-mode.el diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi index 85aa8c9f2..3686e18ad 100644 --- a/gettext-tools/doc/gettext.texi +++ b/gettext-tools/doc/gettext.texi @@ -8923,7 +8923,7 @@ the simplest is to concatenate the files @file{build-to-host.m4}, @file{gettext.m4}, @file{host-cpu-c-abi.m4}, @file{intlmacosx.m4}, @file{iconv.m4}, @file{lib-ld.m4}, @file{lib-link.m4}, @file{lib-prefix.m4}, @file{nls.m4}, @file{po.m4}, @file{progtest.m4} from GNU @code{gettext}'s -@file{m4/} directory into a single file. +@file{@var{prefix}/share/gettext/m4/} directory into a single file. If you already have an @file{aclocal.m4} file, then you will have to merge the said macro files into your @file{aclocal.m4}. Note that if @@ -8938,7 +8938,8 @@ You should be using GNU @code{automake} 1.9 or newer. With it, you need to copy the files @file{build-to-host.m4}, @file{gettext.m4}, @file{host-cpu-c-abi.m4}, @file{intlmacosx.m4}, @file{iconv.m4}, @file{lib-ld.m4}, @file{lib-link.m4}, @file{lib-prefix.m4}, @file{nls.m4}, -@file{po.m4}, @file{progtest.m4} from GNU @code{gettext}'s @file{m4/} +@file{po.m4}, @file{progtest.m4} from GNU @code{gettext}'s +@file{@var{prefix}/share/gettext/m4/} directory to a subdirectory named @file{m4/} and add the line @example @@ -8948,23 +8949,26 @@ ACLOCAL_AMFLAGS = -I m4 @noindent to your top level @file{Makefile.am}. -If you are using GNU @code{automake} 1.10 or newer, it is even easier: +If you are using GNU @code{automake} 1.12 or newer, it is even easier: Add the line @example -ACLOCAL_AMFLAGS = --install -I m4 +ACLOCAL_AMFLAGS = -I m4 @end example @noindent -to your top level @file{Makefile.am}, and run @samp{aclocal --install -I m4}. +to your top level @file{Makefile.am}, and run +@samp{aclocal --install --system-acdir=@var{prefix}/share/gettext/m4 -I m4}. This will copy the needed files to the @file{m4/} subdirectory automatically, before updating @file{aclocal.m4}. +Note: This @code{--system-acdir} option should only be used here, once. +If you were to use it after @code{autopoint} has been run, +it would destroy the consistency that @code{autopoint} guarantees +and lead to all sorts of malfunction at build time. + These macros check for the internationalization support functions -and related informations. Hopefully, once stabilized, these macros -might be integrated in the standard Autoconf set, because this -piece of @code{m4} code will be the same for all projects using GNU -@code{gettext}. +and related information. @node config.h.in @subsection @file{config.h.in} at top level diff --git a/gettext-tools/m4/Makefile.am b/gettext-tools/m4/Makefile.am index 702309e7a..684d4e0b1 100644 --- a/gettext-tools/m4/Makefile.am +++ b/gettext-tools/m4/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-tools/m4 directory of GNU gettext -## Copyright (C) 2003-2010, 2013, 2017-2023 Free Software Foundation, Inc. +## Copyright (C) 2003-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 @@ -17,9 +17,14 @@ ## Process this file with automake to produce Makefile.in. # Files installed for use by gettextize. +# Note: We do *not* install them into $(datadir)/share/aclocal/ any more, +# because there, 'aclocal --install' (possibly invoked from 'autoreconf') +# would see the files and copy them into the user's package, destroying +# the consistency between po.m4 and po/Makefile.in.in. -aclocaldir = @aclocaldir@ -aclocal_DATA = \ +pkgdatadir = $(datadir)/gettext +macrosdir = $(pkgdatadir)/m4 +macros_DATA = \ ../../gettext-runtime/gnulib-m4/host-cpu-c-abi.m4 \ ../../gettext-runtime/gnulib-m4/iconv.m4 \ ../../gettext-runtime/gnulib-m4/intlmacosx.m4 \ @@ -47,3 +52,10 @@ EXTRA_DIST = \ exported.m4 \ hostname.m4 \ locale-de.m4 + + +# We don't install the *.m4 files in $(aclocaldir) any more. +install-data-local: uninstall-macros +uninstall-local: uninstall-macros +uninstall-macros: + rm -rf '$(DESTDIR)@aclocaldir@' diff --git a/gettext-tools/misc/gettextize.in b/gettext-tools/misc/gettextize.in index 143a518ef..856e0e1a0 100644 --- a/gettext-tools/misc/gettextize.in +++ b/gettext-tools/misc/gettextize.in @@ -886,7 +886,7 @@ if test -f "$srcdir/Makefile.am"; then for file in $m4filelist; do same=no if test -f "$srcdir/$m4dir/$file"; then - if cmp -s "@datadir@/aclocal/$file" "$srcdir/$m4dir/$file"; then + if cmp -s "@datadir@/gettext/m4/$file" "$srcdir/$m4dir/$file"; then same=yes fi else @@ -900,7 +900,7 @@ if test -f "$srcdir/Makefile.am"; then fi fi func_backup "$m4dir/$file" - func_linkorcopy "@datadir@/aclocal/$file" "@datadir@/aclocal/$file" "$m4dir/$file" + func_linkorcopy "@datadir@/gettext/m4/$file" "@datadir@/gettext/m4/$file" "$m4dir/$file" done missing_m4Makefileam= if test -n "$added_m4files"; then @@ -1092,7 +1092,7 @@ else please="$please Please add the files $m4filelist -from the @datadir@/aclocal directory to your aclocal.m4 file. +from the @datadir@/gettext/m4 directory to your aclocal.m4 file. " fi