From 7beb7a55a169d98bbc60ddd33874b48b142fe445 Mon Sep 17 00:00:00 2001 From: Manuel Jacob Date: Fri, 1 May 2026 11:29:11 -0600 Subject: [PATCH] [PATCH v2 1/2] build: Preserve *_FOR_BUILD environment variables in all cases. They were preserved in the `"${build}" != "${host}"` case, but not in the `"${build}" = "${host}"` case. Each of the following commands 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 CC_FOR_BUILD=/tmp/gcc_for_build ./configure --build=x86_64-make_autoconf_enable_cross_compiling-linux-gnu --host=x86_64-linux-gnu ./configure The following command produces a Makefile containing `CC_FOR_BUILD = $(CC)` without the patch and containing `CC_FOR_BUILD = /tmp/gcc_for_build` with the patch: CC_FOR_BUILD=/tmp/gcc_for_build ./configure ChangeLog: * configure.ac: Preserve *_FOR_BUILD environment variables in all cases. * configure: Regenerate. Signed-off-by: Manuel Jacob --- configure | 32 ++++++++++++++++---------------- configure.ac | 32 ++++++++++++++++---------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/configure b/configure index 083e8823d2b..9a6407d2c6f 100755 --- a/configure +++ b/configure @@ -4333,22 +4333,22 @@ if test "${build}" != "${host}" ; then WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres} WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc} else - AR_FOR_BUILD="\$(AR)" - AS_FOR_BUILD="\$(AS)" - CC_FOR_BUILD="\$(CC)" - CXX_FOR_BUILD="\$(CXX)" - DLLTOOL_FOR_BUILD="\$(DLLTOOL)" - DSYMUTIL_FOR_BUILD="\$(DSYMUTIL)" - GFORTRAN_FOR_BUILD="\$(GFORTRAN)" - A68_FOR_BUILD="\$(A68)" - GOC_FOR_BUILD="\$(GOC)" - GDC_FOR_BUILD="\$(GDC)" - GNATMAKE_FOR_BUILD="\$(GNATMAKE)" - LD_FOR_BUILD="\$(LD)" - NM_FOR_BUILD="\$(NM)" - RANLIB_FOR_BUILD="\$(RANLIB)" - WINDRES_FOR_BUILD="\$(WINDRES)" - WINDMC_FOR_BUILD="\$(WINDMC)" + AR_FOR_BUILD="${AR_FOR_BUILD-\$(AR)}" + AS_FOR_BUILD="${AS_FOR_BUILD-\$(AS)}" + CC_FOR_BUILD="${CC_FOR_BUILD-\$(CC)}" + CXX_FOR_BUILD="${CXX_FOR_BUILD-\$(CXX)}" + DLLTOOL_FOR_BUILD="${DLLTOOL_FOR_BUILD-\$(DLLTOOL)}" + DSYMUTIL_FOR_BUILD="${DSYMUTIL_FOR_BUILD-\$(DSYMUTIL)}" + GFORTRAN_FOR_BUILD="${GFORTRAN_FOR_BUILD-\$(GFORTRAN)}" + A68_FOR_BUILD="${A68_FOR_BUILD-\$(A68)}" + GOC_FOR_BUILD="${GOC_FOR_BUILD-\$(GOC)}" + GDC_FOR_BUILD="${GDC_FOR_BUILD-\$(GDC)}" + GNATMAKE_FOR_BUILD="${GNATMAKE_FOR_BUILD-\$(GNATMAKE)}" + LD_FOR_BUILD="${LD_FOR_BUILD-\$(LD)}" + NM_FOR_BUILD="${NM_FOR_BUILD-\$(NM)}" + RANLIB_FOR_BUILD="${RANLIB_FOR_BUILD-\$(RANLIB)}" + WINDRES_FOR_BUILD="${WINDRES_FOR_BUILD-\$(WINDRES)}" + WINDMC_FOR_BUILD="${WINDMC_FOR_BUILD-\$(WINDMC)}" fi ac_ext=c diff --git a/configure.ac b/configure.ac index c5de225b0ac..0854638e8e8 100644 --- a/configure.ac +++ b/configure.ac @@ -1468,22 +1468,22 @@ if test "${build}" != "${host}" ; then WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres} WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc} else - AR_FOR_BUILD="\$(AR)" - AS_FOR_BUILD="\$(AS)" - CC_FOR_BUILD="\$(CC)" - CXX_FOR_BUILD="\$(CXX)" - DLLTOOL_FOR_BUILD="\$(DLLTOOL)" - DSYMUTIL_FOR_BUILD="\$(DSYMUTIL)" - GFORTRAN_FOR_BUILD="\$(GFORTRAN)" - A68_FOR_BUILD="\$(A68)" - GOC_FOR_BUILD="\$(GOC)" - GDC_FOR_BUILD="\$(GDC)" - GNATMAKE_FOR_BUILD="\$(GNATMAKE)" - LD_FOR_BUILD="\$(LD)" - NM_FOR_BUILD="\$(NM)" - RANLIB_FOR_BUILD="\$(RANLIB)" - WINDRES_FOR_BUILD="\$(WINDRES)" - WINDMC_FOR_BUILD="\$(WINDMC)" + AR_FOR_BUILD="${AR_FOR_BUILD-\$(AR)}" + AS_FOR_BUILD="${AS_FOR_BUILD-\$(AS)}" + CC_FOR_BUILD="${CC_FOR_BUILD-\$(CC)}" + CXX_FOR_BUILD="${CXX_FOR_BUILD-\$(CXX)}" + DLLTOOL_FOR_BUILD="${DLLTOOL_FOR_BUILD-\$(DLLTOOL)}" + DSYMUTIL_FOR_BUILD="${DSYMUTIL_FOR_BUILD-\$(DSYMUTIL)}" + GFORTRAN_FOR_BUILD="${GFORTRAN_FOR_BUILD-\$(GFORTRAN)}" + A68_FOR_BUILD="${A68_FOR_BUILD-\$(A68)}" + GOC_FOR_BUILD="${GOC_FOR_BUILD-\$(GOC)}" + GDC_FOR_BUILD="${GDC_FOR_BUILD-\$(GDC)}" + GNATMAKE_FOR_BUILD="${GNATMAKE_FOR_BUILD-\$(GNATMAKE)}" + LD_FOR_BUILD="${LD_FOR_BUILD-\$(LD)}" + NM_FOR_BUILD="${NM_FOR_BUILD-\$(NM)}" + RANLIB_FOR_BUILD="${RANLIB_FOR_BUILD-\$(RANLIB)}" + WINDRES_FOR_BUILD="${WINDRES_FOR_BUILD-\$(WINDRES)}" + WINDMC_FOR_BUILD="${WINDMC_FOR_BUILD-\$(WINDMC)}" fi AC_PROG_CC_C99