From: Florent Kermarrec Date: Sat, 6 Oct 2018 19:32:38 +0000 (+0200) Subject: soc/integration/cpu_interface: generate error if unable to find any of the cross... X-Git-Tag: 24jan2021_ls180~1568 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b27d2ae895aa3045759a3716aee07f97597dd0e;p=litex.git soc/integration/cpu_interface: generate error if unable to find any of the cross compilation toolchains --- diff --git a/litex/soc/integration/cpu_interface.py b/litex/soc/integration/cpu_interface.py index 21cbd272..fb8c1017 100644 --- a/litex/soc/integration/cpu_interface.py +++ b/litex/soc/integration/cpu_interface.py @@ -31,13 +31,20 @@ def get_cpu_mak(cpu): # select triple when more than one def select_triple(triple): - if isinstance(triple, tuple): + r = None + if not isinstance(triple, tuple): + triple = (triple) + for i in range(len(triple)): + t = triple[i] + if which(t+"-gcc"): + r = t + break + if r is None: + msg = "Unable to find any of the cross compilation toolchains:\n" for i in range(len(triple)): - t = triple[i] - if which(t+"-gcc"): - return t - else: - return triple + msg += "- " + triple[i] + "\n" + raise OSError(msg) + return r # return informations return [