Skip to content
Snippets Groups Projects
Commit 1c99becd authored by Sjoerd Simons's avatar Sjoerd Simons
Browse files

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: default avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: default avatarGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D5257
parent 56513058
No related branches found
No related tags found
No related merge requests found
...@@ -634,6 +634,7 @@ class Project: ...@@ -634,6 +634,7 @@ class Project:
def configure(self, sysroot, debug=False, force=False, cflags=[], ldflags=[], args=[]): def configure(self, sysroot, debug=False, force=False, cflags=[], ldflags=[], args=[]):
env = os.environ.copy() env = os.environ.copy()
triplet = TargetTriplet(sysroot.version.arch)
args = ["./configure"] args = ["./configure"]
args += ["--prefix=/Application/" + self.bundle_id] args += ["--prefix=/Application/" + self.bundle_id]
args += ["--sysconfdir=/var/Applications/" + self.bundle_id + "/etc"] args += ["--sysconfdir=/var/Applications/" + self.bundle_id + "/etc"]
...@@ -647,13 +648,15 @@ class Project: ...@@ -647,13 +648,15 @@ class Project:
cflags += ["--sysroot=" + sysroot.path] cflags += ["--sysroot=" + sysroot.path]
cflags += ["-I" + os.path.join(sysroot.path, 'usr', 'include')] cflags += ["-I" + os.path.join(sysroot.path, 'usr', 'include')]
ldflags += ["--sysroot=" + sysroot.path] ldflags += ["--sysroot=" + sysroot.path]
args += ["--host=" + TargetTriplet(sysroot.version.arch).triplet] args += ["--host=" + triplet.triplet]
args += ["--with-sysroot=" + sysroot.path] args += ["--with-sysroot=" + sysroot.path]
self.set_pkg_config_vars(env, sysroot) self.set_pkg_config_vars(env, sysroot)
if not os.path.exists(os.path.join(self.root, "configure")): if not os.path.exists(os.path.join(self.root, "configure")):
self.autoreconf() self.autoreconf()
env['CC'] = "{}-{}".format(triplet.triplet, "gcc")
env['LD'] = "{}-{}".format(triplet.triplet, "ld")
env['CFLAGS'] = ' '.join(cflags) env['CFLAGS'] = ' '.join(cflags)
env['LDFLAGS'] = ' '.join(ldflags) env['LDFLAGS'] = ' '.join(ldflags)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment