From 1c99becd01d8a9520dc88e2e51539df84481052f Mon Sep 17 00:00:00 2001
From: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Date: Tue, 13 Dec 2016 14:43:01 +0100
Subject: [PATCH] Actually use a target specific compiler

Unless a compiler which produces code for the target is setup, the
result of the compilation (if successful) will just be native code which
isn't helpful. Setup target specific gcc && linker instead

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D5257
---
 tools/ade | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/ade b/tools/ade
index 53c6204..a8e631d 100755
--- a/tools/ade
+++ b/tools/ade
@@ -634,6 +634,7 @@ class Project:
 
     def configure(self, sysroot, debug=False, force=False, cflags=[], ldflags=[], args=[]):
         env = os.environ.copy()
+        triplet = TargetTriplet(sysroot.version.arch)
         args  = ["./configure"]
         args += ["--prefix=/Application/" + self.bundle_id]
         args += ["--sysconfdir=/var/Applications/" + self.bundle_id + "/etc"]
@@ -647,13 +648,15 @@ class Project:
             cflags += ["--sysroot=" + sysroot.path]
             cflags += ["-I" + os.path.join(sysroot.path, 'usr', 'include')]
             ldflags += ["--sysroot=" + sysroot.path]
-            args += ["--host=" + TargetTriplet(sysroot.version.arch).triplet]
+            args += ["--host=" + triplet.triplet]
             args += ["--with-sysroot=" + sysroot.path]
             self.set_pkg_config_vars(env, sysroot)
 
         if not os.path.exists(os.path.join(self.root, "configure")):
             self.autoreconf()
 
+        env['CC'] = "{}-{}".format(triplet.triplet, "gcc")
+        env['LD'] = "{}-{}".format(triplet.triplet, "ld")
         env['CFLAGS'] = ' '.join(cflags)
         env['LDFLAGS'] = ' '.join(ldflags)
 
-- 
GitLab