diff options
| author | Nathan Rossi <nathan@nathanrossi.com> | 2017-05-30 18:46:21 +1000 |
|---|---|---|
| committer | Nathan Rossi <nathan@nathanrossi.com> | 2017-05-30 18:46:21 +1000 |
| commit | c017b2a016429560223a0f8654994bc772977460 (patch) | |
| tree | dba95aa622968e0424087c73a28466d150cccdd0 /conf | |
| parent | c519c5ee2b725e6f946ffd11c862463b3391876e (diff) | |
| download | meta-xilinx-c017b2a016429560223a0f8654994bc772977460.tar.gz | |
feature-microblaze-versions.inc: Simplify version formatting functions
Simplify the functions used to generate the TUNE_CCARGS and PKGARCH
version strings.
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Diffstat (limited to 'conf')
| -rw-r--r-- | conf/machine/include/microblaze/feature-microblaze-versions.inc | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/conf/machine/include/microblaze/feature-microblaze-versions.inc b/conf/machine/include/microblaze/feature-microblaze-versions.inc index 53d0b9bf..7e9aa954 100644 --- a/conf/machine/include/microblaze/feature-microblaze-versions.inc +++ b/conf/machine/include/microblaze/feature-microblaze-versions.inc | |||
| @@ -24,28 +24,14 @@ def microblaze_version_conflict(ver, d): | |||
| 24 | conflict.append(i) | 24 | conflict.append(i) |
| 25 | return " ".join(conflict) | 25 | return " ".join(conflict) |
| 26 | 26 | ||
| 27 | def microblaze_current_version(d): | 27 | def microblaze_current_version(d, gcc = False): |
| 28 | tunes = (d.getVar("TUNE_FEATURES") or "").split() | 28 | tunes = (d.getVar("TUNE_FEATURES") or "").split() |
| 29 | for i in tunes: | 29 | version = next((v for v in [microblaze_parse_version(i) for i in tunes] if v), None) |
| 30 | version = microblaze_parse_version(i) | 30 | if version: |
| 31 | if version: | 31 | if version[0] <= 8 and len(version) > 2 and (gcc or version[2] != "a"): |
| 32 | return version | 32 | return "v%d.%d.%s" % version[0:3] |
| 33 | return None | ||
| 34 | |||
| 35 | def microblaze_format_gcc_version(ver): | ||
| 36 | if ver: | ||
| 37 | if ver[0] <= 8 and len(ver) > 2: | ||
| 38 | return "v%d.%d.%s" % ver[0:3] | ||
| 39 | else: | ||
| 40 | return "v%d.%d" % ver[0:2] | ||
| 41 | return "" | ||
| 42 | |||
| 43 | def microblaze_format_pkg_version(ver): | ||
| 44 | if ver: | ||
| 45 | if ver[0] <= 8 and len(ver) > 2 and ver[2] != "a": | ||
| 46 | return "v%d.%d.%s" % ver[0:3] | ||
| 47 | else: | 33 | else: |
| 48 | return "v%d.%d" % ver[0:2] | 34 | return "v%d.%d" % version[0:2] |
| 49 | return "" | 35 | return "" |
| 50 | 36 | ||
| 51 | # MicroBlaze versions | 37 | # MicroBlaze versions |
| @@ -89,6 +75,6 @@ TUNECONFLICTS[v8.10] += "reorder" | |||
| 89 | TUNECONFLICTS[v8.20] += "reorder" | 75 | TUNECONFLICTS[v8.20] += "reorder" |
| 90 | 76 | ||
| 91 | # Version flags | 77 | # Version flags |
| 92 | TUNE_CCARGS += "-mcpu=${@microblaze_format_gcc_version(microblaze_current_version(d))}" | 78 | TUNE_CCARGS += "-mcpu=${@microblaze_current_version(d, True)}" |
| 93 | MBPKGARCH_VERSION = "-${@microblaze_format_pkg_version(microblaze_current_version(d))}" | 79 | MBPKGARCH_VERSION = "-${@microblaze_current_version(d)}" |
| 94 | 80 | ||
