From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 0EA6B3856248 for ; Thu, 15 Sep 2022 05:59:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0EA6B3856248 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 03FE4300089; Thu, 15 Sep 2022 05:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1663221577; bh=Ppu5TKyKkkhdVTbEXVM7qypNdV0XFnabUu6ARrvt/hM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=F5o1F0G2+FTEJSJqWDFS4gmzC/ikbP98RWn9Gf/W8P17jRbEBcSziQ6t8mt+laiNj SAp3YlAEQaS0yMiz8DjUwuzP2WtbkbCJ+jXqaEwtRUWtDPBEcwsv6N87JEoKSHqYzf A4Mf7LmmD9d4vfbgR3DBZh7BvUU6X1lQwESNZybQ= From: Tsukasa OI To: Tsukasa OI , Nick Clifton , Jim Wilson Cc: binutils@sourceware.org Subject: [PATCH 1/1] configure: Pass CPPFLAGS_FOR_BUILD to subdirs Date: Thu, 15 Sep 2022 05:59:23 +0000 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Because CPPFLAGS_FOR_BUILD is used in some subdirectories (through bfd/warning.m4), not AC_SUBSTing the variable causes minor issues. Fortunately, it didn't cause severe errors but error messages related to @CPPFLAGS_FOR_BUILD@ (not AC_SUBSTed CPPFLAGS_FOR_BUILD variable passed to subdirectories through Makefile) remain in config.log. To avoid invalid invocation of preprocessor for build environment, we need to set proper CPPFLAGS_FOR_BUILD (may be empty) and pass it to subdirectories that need it. This is what this commit does. ChangeLog: * configure.ac: Pass CPPFLAGS_FOR_BUILD to subdirectories. * configure: Regenerate. --- configure | 3 +++ configure.ac | 2 ++ 2 files changed, 5 insertions(+) diff --git a/configure b/configure index 16139e3bfa3..d75f47a1e95 100755 --- a/configure +++ b/configure @@ -651,6 +651,7 @@ GFORTRAN_FOR_BUILD DLLTOOL_FOR_BUILD CXX_FOR_BUILD CXXFLAGS_FOR_BUILD +CPPFLAGS_FOR_BUILD CFLAGS_FOR_BUILD CC_FOR_BUILD AS_FOR_BUILD @@ -8024,6 +8025,7 @@ esac # our build compiler if desired. if test x"${build}" = x"${host}" ; then CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}} CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}} LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} fi @@ -8102,6 +8104,7 @@ done + # Generate default definitions for YACC, M4, LEX and other programs that run # on the build machine. These are used if the Makefile can't locate these # programs in objdir. diff --git a/configure.ac b/configure.ac index a5555a9c91b..ae18d436aca 100644 --- a/configure.ac +++ b/configure.ac @@ -3326,6 +3326,7 @@ esac # our build compiler if desired. if test x"${build}" = x"${host}" ; then CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}} CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}} LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} fi @@ -3392,6 +3393,7 @@ AC_SUBST(AR_FOR_BUILD) AC_SUBST(AS_FOR_BUILD) AC_SUBST(CC_FOR_BUILD) AC_SUBST(CFLAGS_FOR_BUILD) +AC_SUBST(CPPFLAGS_FOR_BUILD) AC_SUBST(CXXFLAGS_FOR_BUILD) AC_SUBST(CXX_FOR_BUILD) AC_SUBST(DLLTOOL_FOR_BUILD) -- 2.34.1