]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PATCH v2 2/2] build: Set default for CPP_FOR_BUILD environment variable in all cases.
authorManuel Jacob <me@manueljacob.de>
Fri, 1 May 2026 17:38:01 +0000 (11:38 -0600)
committerJeff Law <jeffrey.law@oss.qualcomm.com>
Fri, 1 May 2026 17:39:05 +0000 (11:39 -0600)
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 <me@manueljacob.de>
configure
configure.ac

index 9a6407d2c6f57e5453367db84eb9ba4b5d51dab5..e2150f50aac59b372da093a2df48b05a55a8762e 100755 (executable)
--- 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'
index 0854638e8e854d3cfe2ee154cc0634e6ca8c82e8..edd53b2bb42a1726f25ccae78ac5d8e088865228 100644 (file)
@@ -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