]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
gettextize: Fix bad interactions between autoreconf and autopoint.
authorBruno Haible <bruno@clisp.org>
Tue, 1 Apr 2025 14:16:18 +0000 (16:16 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 1 Apr 2025 14:18:07 +0000 (16:18 +0200)
Reported by Sebastian Pipping <sebastian@pipping.org>
in <https://savannah.gnu.org/bugs/index.php?66968>.

* 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.

NEWS
PACKAGING
gettext-tools/doc/gettext.texi
gettext-tools/m4/Makefile.am
gettext-tools/misc/gettextize.in

diff --git a/NEWS b/NEWS
index 01415bc98c123e19c41529cb644113a3c3703782..3d74ef5086e3bb482c018d5f7a5646c12f0f7937 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+Version 0.24.1 - April 2025
+
+* Bug fixes:
+  - Fix bad interactions between autoreconf and autopoint.
+
 Version 0.24 - February 2025
 
 # Programming languages support:
index 8a8666ed6b7bcf2733bf318a6de7bee5b79a88e5..9055593296632d72e7b0b7e1ad2d6ab8feb59ec4 100644 (file)
--- a/PACKAGING
+++ b/PACKAGING
@@ -132,6 +132,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/*
@@ -145,17 +156,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
index 0fa7087ffb951a98a42f1f349b0f31fe0be17991..496646d37c162241efba7a5a37a620552e722039 100644 (file)
@@ -8895,7 +8895,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
@@ -8910,7 +8910,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
@@ -8920,23 +8921,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
index 702309e7ab06fc9988be3b18598287f5044779ac..684d4e0b1253603a150880388c9e35d49feb84a8 100644 (file)
@@ -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
 ## 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@'
index 143a518ef57ff8a6506646bddc5fc6b13ab1ea5a..856e0e1a0fa0c6593eedd8b94d49debf77f4539b 100644 (file)
@@ -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