From e9fbfabcc9002c0163ad61b6ab944b498cdadb2f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 31 Mar 2015 04:27:29 +0000 Subject: [PATCH] tc-export_build_env: export BUILD_CPPFLAGS/BUILD_LDFLAGS to non-empty values so they do not get defaulted by build systems #526734 by Matthias Maier --- eclass/toolchain-funcs.eclass | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index d3c5a67eca29..4100a00d6f9b 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.135 2015/03/16 21:12:27 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.136 2015/03/31 04:27:29 vapier Exp $ # @ECLASS: toolchain-funcs.eclass # @MAINTAINER: @@ -223,10 +223,13 @@ tc-is-static-only() { # Export common build related compiler settings. tc-export_build_env() { tc-export "$@" + # Some build envs will initialize vars like: + # : ${BUILD_LDFLAGS:-${LDFLAGS}} + # So make sure all variables are non-empty. #526734 : ${BUILD_CFLAGS:=-O1 -pipe} : ${BUILD_CXXFLAGS:=-O1 -pipe} - : ${BUILD_CPPFLAGS:=} - : ${BUILD_LDFLAGS:=} + : ${BUILD_CPPFLAGS:= } + : ${BUILD_LDFLAGS:= } export BUILD_{C,CXX,CPP,LD}FLAGS # Some packages use XXX_FOR_BUILD. -- 2.26.2