Hello,
On Wed, Sep 20, 2023 at 08:44:34PM +0100, Gavin Smith wrote:
> Perhaps we should keep on resetting CFLAGS and LDFLAGS (in line with
> the autoconf manual), but leave CPPFLAGS alone due to gnulib's special
> use of it.
Since we need to avoid resetting CPPFLAGS to get the libunistring flags,
we should use CFLAGS to put CPPFLAGS we want to test gnulib with in
configure.ac -- which is not unlike what is already done.
In any case both your analysis and solution looks right to me. Here is
a simple patch proposal.
--
Pat
diff --git a/tp/Texinfo/XS/configure.ac b/tp/Texinfo/XS/configure.ac
index b9f9fcf658..ec369d3e7b 100644
--- a/tp/Texinfo/XS/configure.ac
+++ b/tp/Texinfo/XS/configure.ac
@@ -147,9 +147,15 @@ AM_CONDITIONAL([HAVE_ICONV],
[test "x$am_func_iconv" = "xyes"])
-# Do not include Perl configuration values when outputting these variables
+# Do not include Perl configuration values when outputting these variables,
+# as advised in the automake manual for CFLAGS and LDFLAGS, which could be
+# reset by the user. Here PERL_EXT_CFLAGS and PERL_EXT_LDFLAGS play the
+# same role as CFLAGS and LDFLAGS. The Perl configuration values are then
+# readded in Makefile.am.
+# For CPPFLAGS we do not follow the same rule because we want to keep the
+# flags added by gnulib macros, as for libunistring there is no separate
+# CPPFLAGS-like variable, the main CPPFLAGS is modified.
CFLAGS=$PERL_EXT_CFLAGS
-CPPFLAGS=$PERL_EXT_CPPFLAGS
LDFLAGS=$PERL_EXT_LDFLAGS
AC_CONFIG_FILES([Makefile gnulib/lib/Makefile])