From 45b34468a88226ea13f40bd2ee642a95cf985fee Mon Sep 17 00:00:00 2001
From: John Klug <john.klug@multitech.com>
Date: Wed, 24 May 2017 14:28:05 -0500
Subject: Fix CC for at91bootstrap to find /usr/include

---
 recipes-bsp/at91bootstrap/at91bootstrap_3.5.inc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'recipes-bsp')

diff --git a/recipes-bsp/at91bootstrap/at91bootstrap_3.5.inc b/recipes-bsp/at91bootstrap/at91bootstrap_3.5.inc
index ac147c0..4b3e957 100644
--- a/recipes-bsp/at91bootstrap/at91bootstrap_3.5.inc
+++ b/recipes-bsp/at91bootstrap/at91bootstrap_3.5.inc
@@ -11,13 +11,19 @@ do_compile () {
 	unset CFLAGS
 	unset CPPFLAGS
 
+        # For Newer Yocto/Bitbake, CC does not
+        # include the staging directory
+        # by default
+        CC="${CC} --sysroot=${STAGING_DIR_HOST}"
+        LD="${LD} --sysroot=${STAGING_DIR_HOST}"
+
 	rm -Rf ${S}/binaries
 	for board in ${AT91BOOTSTRAP_BOARD} ; do
-		oe_runmake mrproper
+		oe_runmake mrproper CC="${CC}" LD="${LD}"
 		filename=`find board -name ${board}_defconfig`
 		if ! [ "x$filename" == "x" ] ; then 
 			cp $filename .config
-			oe_runmake 
+			oe_runmake CC="${CC}" LD="${LD}"
 			oe_runmake install
 		else
 			echo "${board} could not be built"
-- 
cgit v1.2.3