From: Bruno Haible Date: Sun, 1 Oct 2023 18:16:36 +0000 (+0200) Subject: build: Remove redundant -I options from AM_CPPFLAGS. X-Git-Tag: v0.23~328 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1123b123dde7bdcd907196cf4607050234908fea;p=thirdparty%2Fgettext.git build: Remove redundant -I options from AM_CPPFLAGS. https://www.gnu.org/software/automake/manual/html_node/Program-Variables.html documents that -I. -I$(srcdir) and -I$(top_builddir) (for config.h) are already part of Automake's $(DEFAULT_INCLUDES), which is used before $(AM_CPPFLAGS). * gettext-runtime/src/Makefile.am (AM_CPPFLAGS): Remove redundant -I options. * gettext-tools/gnulib-lib/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-tools/libgettextpo/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-tools/libgrep/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-tools/src/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-tools/system-tests/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-tools/tests/Makefile.am (AM_CPPFLAGS): Likewise. * libtextstyle/adhoc-tests/Makefile.am (AM_CPPFLAGS): Likewise. * libtextstyle/lib/Makefile.am (AM_CPPFLAGS): Likewise. * gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Add comment. * gettext-runtime/libasprintf/Makefile.am (AM_CPPFLAGS): Likewise. --- diff --git a/gettext-runtime/intl/Makefile.am b/gettext-runtime/intl/Makefile.am index 32b26b46b..ea166277b 100644 --- a/gettext-runtime/intl/Makefile.am +++ b/gettext-runtime/intl/Makefile.am @@ -31,6 +31,8 @@ DISTCLEANFILES = MAINTAINERCLEANFILES = SUFFIXES = +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). # -DBUILDING_LIBINTL: Change expansion of LIBINTL_SHLIB_EXPORTED macro. # -DBUILDING_LIBRARY: Change expansion of SHLIB_EXPORTED macro. We're compiling # a library. Exporting the relevant symbols is desired. diff --git a/gettext-runtime/libasprintf/Makefile.am b/gettext-runtime/libasprintf/Makefile.am index c0eb4062d..fa4e4e6b8 100644 --- a/gettext-runtime/libasprintf/Makefile.am +++ b/gettext-runtime/libasprintf/Makefile.am @@ -28,6 +28,8 @@ MOSTLYCLEANFILES = RM = rm -f +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). AM_CPPFLAGS = -Ignulib-lib -I$(srcdir)/gnulib-lib DEFS = -DIN_LIBASPRINTF @DEFS@ diff --git a/gettext-runtime/src/Makefile.am b/gettext-runtime/src/Makefile.am index e9974c4c2..f696fe94a 100644 --- a/gettext-runtime/src/Makefile.am +++ b/gettext-runtime/src/Makefile.am @@ -26,9 +26,9 @@ RM = rm -f bin_PROGRAMS = gettext ngettext envsubst +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). AM_CPPFLAGS = \ - -I. -I$(srcdir) \ - -I.. \ -I../intl -I$(srcdir)/../intl \ -I../gnulib-lib -I$(srcdir)/../gnulib-lib DEFS = -DLOCALEDIR=$(localedir_c_make) @DEFS@ diff --git a/gettext-tools/gnulib-lib/Makefile.am b/gettext-tools/gnulib-lib/Makefile.am index 053ba6285..6b9d43f9b 100644 --- a/gettext-tools/gnulib-lib/Makefile.am +++ b/gettext-tools/gnulib-lib/Makefile.am @@ -34,12 +34,14 @@ noinst_LTLIBRARIES = pkgdatadir = $(datadir)/gettext pkgdata_DATA = +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). AM_CPPFLAGS = # Needed for the gnulib source code that does '#include "gettext.h"'. AM_CPPFLAGS += -I../../gettext-runtime/intl -# Needed so that config.h and woe32dll/export.h are found. -AM_CPPFLAGS += -I$(top_builddir) -I$(top_srcdir) +# Needed so that woe32dll/export.h is found. +AM_CPPFLAGS += -I$(top_srcdir) # Parametrization of the 'relocatable' module. AM_CPPFLAGS += -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 diff --git a/gettext-tools/libgettextpo/Makefile.am b/gettext-tools/libgettextpo/Makefile.am index c823a0118..0fe0995d0 100644 --- a/gettext-tools/libgettextpo/Makefile.am +++ b/gettext-tools/libgettextpo/Makefile.am @@ -34,10 +34,11 @@ noinst_LTLIBRARIES = nodist_noinst_HEADERS = config.h +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). # The option -I$(top_srcdir) is needed so that woe32dll/export.h is found. AM_CPPFLAGS = \ - -I. -I$(srcdir) \ - -I.. -I$(top_srcdir) \ + -I$(top_srcdir) \ -I../src -I$(top_srcdir)/src \ -I../../gettext-runtime/intl -I$(top_srcdir)/../gettext-runtime/intl diff --git a/gettext-tools/libgrep/Makefile.am b/gettext-tools/libgrep/Makefile.am index ea5e4f5d0..0d0d2b2c6 100644 --- a/gettext-tools/libgrep/Makefile.am +++ b/gettext-tools/libgrep/Makefile.am @@ -27,7 +27,11 @@ MAINTAINERCLEANFILES = noinst_LIBRARIES = -AM_CPPFLAGS = -I.. -I../gnulib-lib -I$(top_srcdir)/gnulib-lib -I../../gettext-runtime/intl +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). +AM_CPPFLAGS = \ + -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \ + -I../../gettext-runtime/intl # Enable more warning options in this directory. AM_CFLAGS = @WARN_CFLAGS@ diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index 971dc6882..ae50de135 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -90,10 +90,11 @@ projectsdir = $(pkgdatadir)/projects pkglibdir = $(libdir)/gettext pkglibexecdir = $(libexecdir)/gettext +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). # The option -I$(top_srcdir) is needed so that woe32dll/export.h is found. AM_CPPFLAGS = \ - -I. -I$(srcdir) \ - -I.. -I$(top_srcdir) \ + -I$(top_srcdir) \ -I$(top_srcdir)/libgrep \ -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \ -I../../gettext-runtime/intl -I$(top_srcdir)/../gettext-runtime/intl diff --git a/gettext-tools/system-tests/Makefile.am b/gettext-tools/system-tests/Makefile.am index 4c15ec234..63076aee1 100644 --- a/gettext-tools/system-tests/Makefile.am +++ b/gettext-tools/system-tests/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-tools/system-tests subdirectory of GNU gettext -## Copyright (C) 1995-2018 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 @@ -55,7 +55,9 @@ LOG_COMPILER = $(SHELL) $(srcdir)/run-test # It is important that the gnulib-generated *.h files are not visible here, # except for config.h. -AM_CPPFLAGS = -I.. +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). +AM_CPPFLAGS = # The USE_SYSTEM_LIBINTL flag distinguishes a compilation in the system-tests/ # directory from a compilation in the tests/ directory. diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am index e45042888..ce0352e73 100644 --- a/gettext-tools/tests/Makefile.am +++ b/gettext-tools/tests/Makefile.am @@ -287,8 +287,9 @@ xg-c-1.ok.po: $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c $(top_srcdir)/src/xgettext.c $(top_srcdir)/src/msgfmt.c # Auxiliary programs used by the tests. +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). AM_CPPFLAGS = \ - -I.. \ -I../gnulib-lib -I$(top_srcdir)/gnulib-lib \ -I../../gettext-runtime/intl DEFS = -DLOCALEDIR=$(localedir_c_make) @DEFS@ diff --git a/libtextstyle/adhoc-tests/Makefile.am b/libtextstyle/adhoc-tests/Makefile.am index 88f384096..0276137b5 100644 --- a/libtextstyle/adhoc-tests/Makefile.am +++ b/libtextstyle/adhoc-tests/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the adhoc-tests subdirectory of GNU libtextstyle. -## Copyright (C) 2019 Free Software Foundation, Inc. +## Copyright (C) 2019-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 @@ -33,9 +33,9 @@ hello_SOURCES = hello.c # Define the styles. noinst_DATA = hello-default.css +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). AM_CPPFLAGS = \ - -I. -I$(srcdir) \ - -I.. \ -I../lib -I$(srcdir)/../lib \ -DSRCDIR=\"$(srcdir)/\" diff --git a/libtextstyle/lib/Makefile.am b/libtextstyle/lib/Makefile.am index 74ec39b4c..943bb60e3 100644 --- a/libtextstyle/lib/Makefile.am +++ b/libtextstyle/lib/Makefile.am @@ -36,9 +36,9 @@ nobase_nodist_include_HEADERS = noinst_HEADERS = notinline.h +# Note that Automake's $(DEFAULT_INCLUDES) already contains +# -I. -I$(srcdir) -I$(top_builddir). AM_CPPFLAGS = \ - -I. -I$(srcdir) \ - -I$(top_builddir) \ -Iglib \ -DIN_LIBTEXTSTYLE