flex: Respect portage host cc variable

Pass CC_FOR_BUILD to econf. Otherwise it invokes gcc instead of portage
specified HOST/BUILD CC.

Gentoo PR: https://github.com/gentoo/gentoo/pull/16177

BUG=chromium:979916, chromium:991812, chromium:1093512
TEST=CQ

Change-Id: Ia58886b6750b5cb24626306db541c6ef177de5c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2238507
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: George Burgess <gbiv@chromium.org>
diff --git a/sys-devel/flex/flex-2.6.4-r1.ebuild b/sys-devel/flex/flex-2.6.4-r2.ebuild
similarity index 94%
rename from sys-devel/flex/flex-2.6.4-r1.ebuild
rename to sys-devel/flex/flex-2.6.4-r2.ebuild
index 33de0f9..f27d759 100644
--- a/sys-devel/flex/flex-2.6.4-r1.ebuild
+++ b/sys-devel/flex/flex-2.6.4-r2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI="6"
 
-inherit eutils flag-o-matic libtool multilib-minimal
+inherit eutils flag-o-matic libtool multilib-minimal toolchain-funcs
 
 DESCRIPTION="The Fast Lexical Analyzer"
 HOMEPAGE="https://flex.sourceforge.net/ https://github.com/westes/flex"
@@ -50,6 +50,7 @@
 	# Do not install shared libs #503522
 	ECONF_SOURCE=${S} \
 	econf \
+		CC_FOR_BUILD="$(tc-getBUILD_CC)" \
 		--disable-shared \
 		$(use_enable nls) \
 		--docdir='$(datarootdir)/doc/'${PF}