From 526f0abf6de62adc42bca9dbdc63d50e36138dfc Mon Sep 17 00:00:00 2001 From: Manuel Jacob Date: Fri, 1 May 2026 11:38:01 -0600 Subject: [PATCH] [PATCH v2 2/2] build: Set default for CPP_FOR_BUILD environment variable in all cases. A default was set in the `"${build}" != "${host}"` case, but not in the `"${build}" = "${host}"` case. For a working build, this change should not make any difference. CPP_FOR_BUILD is passed to build modules as CPP. If not set, autoconf macro AC_PROG_CC infers CPP by trying various programs. First, it tries "$CC -E", which CPP will default to in all cases with this patch. The following command produces the same build directory with and without the patch: ./configure --build=x86_64-make_autoconf_enable_cross_compiling-linux-gnu --host=x86_64-linux-gnu The following command produces a Makefile containing `CPP_FOR_BUILD = ` without the patch and containing `CPP_FOR_BUILD = $(CC_FOR_BUILD) -E` with the patch: ./configure ChangeLog: * configure.ac: Set default for CPP_FOR_BUILD environment variable in all cases. * configure: Regenerate. Signed-off-by: Manuel Jacob --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 9a6407d2c6f..e2150f50aac 100755 --- a/configure +++ b/configure @@ -4318,7 +4318,6 @@ if test "${build}" != "${host}" ; then AR_FOR_BUILD=${AR_FOR_BUILD-ar} AS_FOR_BUILD=${AS_FOR_BUILD-as} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} - CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CC_FOR_BUILD) -E}" CXX_FOR_BUILD=${CXX_FOR_BUILD-g++} DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool} DSYMUTIL_FOR_BUILD=${DSYMUTIL_FOR_BUILD-dsymutil} @@ -4350,6 +4349,7 @@ else WINDRES_FOR_BUILD="${WINDRES_FOR_BUILD-\$(WINDRES)}" WINDMC_FOR_BUILD="${WINDMC_FOR_BUILD-\$(WINDMC)}" fi +CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CC_FOR_BUILD) -E}" ac_ext=c ac_cpp='$CPP $CPPFLAGS' diff --git a/configure.ac b/configure.ac index 0854638e8e8..edd53b2bb42 100644 --- a/configure.ac +++ b/configure.ac @@ -1453,7 +1453,6 @@ if test "${build}" != "${host}" ; then AR_FOR_BUILD=${AR_FOR_BUILD-ar} AS_FOR_BUILD=${AS_FOR_BUILD-as} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} - CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CC_FOR_BUILD) -E}" CXX_FOR_BUILD=${CXX_FOR_BUILD-g++} DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool} DSYMUTIL_FOR_BUILD=${DSYMUTIL_FOR_BUILD-dsymutil} @@ -1485,6 +1484,7 @@ else WINDRES_FOR_BUILD="${WINDRES_FOR_BUILD-\$(WINDRES)}" WINDMC_FOR_BUILD="${WINDMC_FOR_BUILD-\$(WINDMC)}" fi +CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CC_FOR_BUILD) -E}" AC_PROG_CC_C99 AC_PROG_CXX