From: Bruno Haible Date: Sun, 1 Oct 2023 18:17:58 +0000 (+0200) Subject: build: Use a separate gnulib-tool invocation for gettext-tools/tests/. X-Git-Tag: v0.23~327 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0608425df6301b80949e889d17a9f693b9982ce0;p=thirdparty%2Fgettext.git build: Use a separate gnulib-tool invocation for gettext-tools/tests/. * 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. --- diff --git a/.gitignore b/.gitignore index 7840ae8b7..3c3544448 100644 --- a/.gitignore +++ b/.gitignore @@ -361,6 +361,9 @@ /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": diff --git a/autogen.sh b/autogen.sh index 44594a84d..6df9cf4cd 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 \ diff --git a/gettext-tools/Makefile.am b/gettext-tools/Makefile.am index 90f554860..26bb9941d 100644 --- a/gettext-tools/Makefile.am +++ b/gettext-tools/Makefile.am @@ -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 diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index c71d0bee3..ff758dbbb 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -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]) diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am index ce0352e73..c08b61e60 100644 --- a/gettext-tools/tests/Makefile.am +++ b/gettext-tools/tests/Makefile.am @@ -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 index 000000000..37ebb9618 --- /dev/null +++ b/gettext-tools/tests/gnulib-lib/Makefile.am @@ -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 . + +## 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