From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-699836-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 8DF311381FA
	for <garchives@archives.gentoo.org>; Thu, 29 May 2014 21:44:05 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 4A0CBE08E8;
	Thu, 29 May 2014 21:44:04 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id BD2B5E08E8
	for <gentoo-commits@lists.gentoo.org>; Thu, 29 May 2014 21:44:03 +0000 (UTC)
Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id E303233FD5F
	for <gentoo-commits@lists.gentoo.org>; Thu, 29 May 2014 21:44:02 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by spoonbill.gentoo.org (Postfix) with ESMTP id 01F22181A9
	for <gentoo-commits@lists.gentoo.org>; Thu, 29 May 2014 21:44:01 +0000 (UTC)
From: "Davide Pesavento" <pesa@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Davide Pesavento" <pesa@gentoo.org>
Message-ID: <1401399541.7e71215c77b38814444820a54cf24fc7daa4ce92.pesa@gentoo>
Subject: [gentoo-commits] proj/qt:master commit in: eclass/
X-VCS-Repository: proj/qt
X-VCS-Files: eclass/qt4-build-multilib.eclass
X-VCS-Directories: eclass/
X-VCS-Committer: pesa
X-VCS-Committer-Name: Davide Pesavento
X-VCS-Revision: 7e71215c77b38814444820a54cf24fc7daa4ce92
X-VCS-Branch: master
Date: Thu, 29 May 2014 21:44:01 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 90aa4f9c-fdb8-4372-bf7d-2fb87e1c08b1
X-Archives-Hash: a471270e53752a5301f230d5f9788985

commit:     7e71215c77b38814444820a54cf24fc7daa4ce92
Author:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
AuthorDate: Thu May 29 21:39:01 2014 +0000
Commit:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
CommitDate: Thu May 29 21:39:01 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=7e71215c

[qt4-build-multilib.eclass] Simplify how toolchain vars are respected.

Backported from qt5-build.eclass

---
 eclass/qt4-build-multilib.eclass | 41 +++++++++++++++++-----------------------
 1 file changed, 17 insertions(+), 24 deletions(-)

diff --git a/eclass/qt4-build-multilib.eclass b/eclass/qt4-build-multilib.eclass
index e908604..af90b06 100644
--- a/eclass/qt4-build-multilib.eclass
+++ b/eclass/qt4-build-multilib.eclass
@@ -189,21 +189,16 @@ qt4-build-multilib_src_prepare() {
 		filter-flags -fgraphite-identity
 	fi
 
-	# Respect CC, CXX, {C,CXX,LD}FLAGS in .qmake.cache
-	sed -e "/^SYSTEM_VARIABLES=/i \
-		CC='$(tc-getCC)'\n\
-		CXX='$(tc-getCXX)'\n\
-		CFLAGS='${CFLAGS}'\n\
-		CXXFLAGS='${CXXFLAGS}'\n\
-		LDFLAGS='${LDFLAGS}'\n\
-		QMakeVar set QMAKE_CFLAGS_RELEASE\n\
-		QMakeVar set QMAKE_CFLAGS_DEBUG\n\
-		QMakeVar set QMAKE_CXXFLAGS_RELEASE\n\
-		QMakeVar set QMAKE_CXXFLAGS_DEBUG\n\
-		QMakeVar set QMAKE_LFLAGS_RELEASE\n\
-		QMakeVar set QMAKE_LFLAGS_DEBUG\n"\
-		-i configure \
-		|| die "sed SYSTEM_VARIABLES failed"
+	# Reset QMAKE_*FLAGS_{RELEASE,DEBUG} variables,
+	# or they will override user's flags (.qmake.cache)
+	sed -i -e '/^SYSTEM_VARIABLES=/ i \
+		QMakeVar set QMAKE_CFLAGS_RELEASE\
+		QMakeVar set QMAKE_CFLAGS_DEBUG\
+		QMakeVar set QMAKE_CXXFLAGS_RELEASE\
+		QMakeVar set QMAKE_CXXFLAGS_DEBUG\
+		QMakeVar set QMAKE_LFLAGS_RELEASE\
+		QMakeVar set QMAKE_LFLAGS_DEBUG\n' \
+		configure || die "sed SYSTEM_VARIABLES failed"
 
 	# Respect CC, CXX, LINK and *FLAGS in config.tests
 	find config.tests/unix -name '*.test' -type f -print0 | xargs -0 \
@@ -292,6 +287,10 @@ qt4-build-multilib_src_prepare() {
 # @DESCRIPTION:
 # Runs configure and generates Makefiles for all QT4_TARGET_DIRECTORIES.
 qt4-build-multilib_src_configure() {
+	# toolchain setup
+	tc-export CC CXX
+	export LD="$(tc-getCXX)"
+
 	# configure arguments
 	local conf="
 		-prefix ${QT4_PREFIX}
@@ -385,8 +384,8 @@ qt4-build-multilib_src_configure() {
 		pushd ${dir} >/dev/null || die
 		einfo "Running qmake in: ${dir}"
 		"${S}"/bin/qmake \
-			"LIBS+=-L${QT4_LIBDIR}" \
-			"CONFIG+=nostrip" \
+			LIBS+=-L"${QT4_LIBDIR}" \
+			CONFIG+=nostrip \
 			|| die "qmake failed"
 		popd >/dev/null || die
 	done
@@ -399,13 +398,7 @@ qt4-build-multilib_src_compile() {
 	local dir
 	for dir in ${QT4_TARGET_DIRECTORIES}; do
 		pushd ${dir} >/dev/null || die
-		emake \
-			AR="$(tc-getAR) cqs" \
-			CC="$(tc-getCC)" \
-			CXX="$(tc-getCXX)" \
-			LINK="$(tc-getCXX)" \
-			RANLIB=":" \
-			STRIP=":"
+		emake
 		popd >/dev/null || die
 	done
 }