]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Use a separate gnulib-tool invocation for gettext-tools/tests/.
authorBruno Haible <bruno@clisp.org>
Sun, 1 Oct 2023 18:17:58 +0000 (20:17 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 6 Oct 2023 14:25:03 +0000 (16:25 +0200)
* autogen.sh (GNULIB_MODULES_LIBGETTEXTLIB, GNULIB_MODULES_TOOLS_TESTS): New
variables.
Add a gnulib-tool invocation for gettext-tools/tests/gnulib-{m4,lib}.
Add option -I tests/gnulib-m4 when generating gettext-tools/configure.
* gettext-tools/tests/gnulib-lib/Makefile.am: New file.
* gettext-tools/tests/Makefile.am (SUBDIRS): New variable.
(AM_CPPFLAGS): Add more -I options.
(EXTRA_DIST): Add gnulib-m4/gnulib-cache.m4.
* gettext-tools/Makefile.am (ACLOCAL_AMFLAGS): Add -I tests/gnulib-m4.
* gettext-tools/configure.ac: Invoke gttgl_EARLY and gttgl_INIT. Add an
AC_CONFIG_FILES of tests/gnulib-lib/Makefile.

.gitignore
autogen.sh
gettext-tools/Makefile.am
gettext-tools/configure.ac
gettext-tools/tests/Makefile.am
gettext-tools/tests/gnulib-lib/Makefile.am [new file with mode: 0644]

index 7840ae8b70059253b619fcebf2e22e80410b1a07..3c3544448082ca3e67edd6e32e64e7bfc9194877 100644 (file)
 /gettext-tools/libgrep/windows-initguard.h
 /gettext-tools/libgrep/wcrtomb.c
 /gettext-tools/man/x-to-1.in
+/gettext-tools/tests/gnulib-m4/
+/gettext-tools/tests/gnulib-lib/
+!/gettext-tools/tests/gnulib-lib/Makefile.am
 /gettext-tools/tests/init.sh
 
 # Files brought in by "automake --add-missing --copy":
index 44594a84db2eb2ef6426d30f131981b57a5999bb..6df9cf4cdd7ad68bff82687406ecfb39c181af0c 100755 (executable)
@@ -303,12 +303,13 @@ if ! $skip_gnulib; then
     unistr/u8-mbtouc-unsafe-tests
     uniwidth/width-tests
   '
+  GNULIB_MODULES_LIBGETTEXTLIB="$GNULIB_MODULES_TOOLS_FOR_SRC $GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES $GNULIB_MODULES_TOOLS_OTHER"
   $GNULIB_TOOL --dir=gettext-tools --lib=libgettextlib --source-base=gnulib-lib --m4-base=gnulib-m4 --tests-base=gnulib-tests --makefile-name=Makefile.gnulib --libtool --with-tests --local-dir=gnulib-local --local-symlink \
     --import \
     --avoid=fdutimensat-tests --avoid=futimens-tests --avoid=utime-tests --avoid=utimens-tests --avoid=utimensat-tests \
     --avoid=array-list-tests --avoid=linked-list-tests --avoid=linkedhash-list-tests \
     `for m in $GNULIB_MODULES_TOOLS_LIBUNISTRING_TESTS; do echo --avoid=$m; done` \
-    $GNULIB_MODULES_TOOLS_FOR_SRC $GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES $GNULIB_MODULES_TOOLS_OTHER || exit $?
+    $GNULIB_MODULES_LIBGETTEXTLIB || exit $?
   $GNULIB_TOOL --copy-file m4/libtextstyle.m4 gettext-tools/gnulib-m4/libtextstyle.m4 || exit $?
   # In gettext-tools/libgrep:
   GNULIB_MODULES_TOOLS_FOR_LIBGREP='
@@ -394,6 +395,18 @@ if ! $skip_gnulib; then
   '
   $GNULIB_TOOL --dir=gettext-tools --source-base=libgettextpo --m4-base=libgettextpo/gnulib-m4 --macro-prefix=gtpo --makefile-name=Makefile.gnulib --libtool --local-dir=gnulib-local --local-symlink \
     --import --avoid=progname $GNULIB_MODULES_LIBGETTEXTPO $GNULIB_MODULES_LIBGETTEXTPO_OTHER || exit $?
+  # In gettext-tools/tests:
+  GNULIB_MODULES_TOOLS_TESTS='
+    thread
+  '
+  $GNULIB_TOOL --dir=gettext-tools --macro-prefix=gttgl --lib=libtestsgnu --source-base=tests/gnulib-lib --m4-base=tests/gnulib-m4 --makefile-name=Makefile.gnulib --local-dir=gnulib-local --local-symlink \
+    --import \
+    `for m in $GNULIB_MODULES_LIBGETTEXTLIB; do \
+       if test \`$GNULIB_TOOL --local-dir=gnulib-local --extract-applicability $m\` != all; then \
+         echo --avoid=$m; \
+       fi; \
+     done` \
+    $GNULIB_MODULES_TOOLS_TESTS || exit $?
   # Overwrite older versions of .m4 files with the up-to-date version.
   cp gettext-runtime/m4/gettext.m4 gettext-tools/gnulib-m4/gettext.m4
   # Import build tools.  We use --copy-file to avoid directory creation.
@@ -503,7 +516,7 @@ done
 
 echo "$0: generating configure in gettext-tools..."
 cd gettext-tools
-aclocal -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 \
+aclocal -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 -I tests/gnulib-m4 \
   && autoconf \
   && autoheader && touch config.h.in \
   && touch ChangeLog \
index 90f554860a6c1ed9bf8daec0fee38084e69dd842..26bb9941d5bb00bed025e9e0dda8638d77b41ead 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for the gettext-tools directory of GNU gettext
-## Copyright (C) 1995-2007, 2010, 2013-2016, 2018-2019, 2021 Free Software Foundation, Inc.
+## Copyright (C) 1995-2023 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,7 +17,7 @@
 ## Process this file with automake to produce Makefile.in.
 
 AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies
-ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4
+ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 -I tests/gnulib-m4
 
 SUBDIRS = gnulib-lib libgrep src libgettextpo po its projects styles emacs misc man m4 tests system-tests gnulib-tests examples doc
 
index c71d0bee3550fc72fd9c60e56db56ebe8884c964..ff758dbbbd893c81991058f99ec6a1ab0154629c 100644 (file)
@@ -89,6 +89,7 @@ dnl Make sure we see all GNU and Solaris extensions.
 gl_EARLY
 grgl_EARLY
 gtpo_EARLY
+gttgl_EARLY
 
 dnl Check for build configuration.
 
@@ -212,6 +213,7 @@ dnl Checks for header files, functions and declarations.
 gl_INIT
 grgl_INIT
 gtpo_INIT
+gttgl_INIT
 
 dnl Allow libgrep/locale.h to use setlocale_null.h from gnulib-lib/.
 GL_GRGL_GNULIB_SETLOCALE_NULL=1
@@ -604,6 +606,7 @@ AC_CONFIG_FILES([m4/Makefile])
 
 AC_CONFIG_FILES([tests/Makefile])
 AC_CONFIG_FILES([tests/init-env])
+AC_CONFIG_FILES([tests/gnulib-lib/Makefile])
 
 AC_CONFIG_FILES([system-tests/Makefile])
 
index ce0352e731610554a7de492e4dd3310ba642c7b0..c08b61e6021e0fb0e300afaf3c652b53fef31866 100644 (file)
@@ -17,6 +17,7 @@
 ## Process this file with automake to produce Makefile.in.
 
 AUTOMAKE_OPTIONS = 1.11 gnits no-dependencies color-tests
+SUBDIRS = gnulib-lib
 EXTRA_DIST =
 MOSTLYCLEANFILES = core *.stackdump
 
@@ -290,6 +291,7 @@ xg-c-1.ok.po: $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c
 # Note that Automake's $(DEFAULT_INCLUDES) already contains
 # -I. -I$(srcdir) -I$(top_builddir).
 AM_CPPFLAGS = \
+  -Ignulib-lib -I$(srcdir)/gnulib-lib \
   -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \
   -I../../gettext-runtime/intl
 DEFS = -DLOCALEDIR=$(localedir_c_make) @DEFS@
@@ -363,6 +365,11 @@ sentence_1_prg_SOURCES = sentence-1-prg.c
 sentence_1_prg_CPPFLAGS = $(AM_CPPFLAGS) -I../src -I$(top_srcdir)/src
 sentence_1_prg_LDADD = ../src/libgettextsrc.la $(LDADD)
 
+
+# Allow users to use "gnulib-tool --update".
+EXTRA_DIST += gnulib-m4/gnulib-cache.m4
+
+
 # Clean up after Solaris cc.
 clean-local:
        rm -rf SunWS_cache
diff --git a/gettext-tools/tests/gnulib-lib/Makefile.am b/gettext-tools/tests/gnulib-lib/Makefile.am
new file mode 100644 (file)
index 0000000..37ebb96
--- /dev/null
@@ -0,0 +1,37 @@
+## Makefile for the gettext-tools/tests/gnulib-lib subdirectory of GNU gettext
+## Copyright (C) 2023 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
+## the Free Software Foundation; either version 3 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+## Process this file with automake to produce Makefile.in.
+
+AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects no-dependencies
+EXTRA_DIST =
+BUILT_SOURCES =
+MOSTLYCLEANFILES = core *.stackdump
+MOSTLYCLEANDIRS =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+SUFFIXES =
+
+noinst_LIBRARIES =
+
+# Note that Automake's $(DEFAULT_INCLUDES) already contains
+# -I. -I$(srcdir) -I$(top_builddir).
+AM_CPPFLAGS = \
+  -I../../gnulib-lib -I$(top_srcdir)/gnulib-lib
+
+# Rules generated and collected by gnulib-tool.
+include Makefile.gnulib