diff options
author | makise-homura <akemi_homura@kurisa.ch> | 2018-03-19 23:30:00 +0300 |
---|---|---|
committer | makise-homura <akemi_homura@kurisa.ch> | 2018-03-19 23:30:00 +0300 |
commit | 7cc41baa98e486d6fd08ca5bb6f336481b757c4a (patch) | |
tree | 92c0252fc70b6ef8dbb21272ffe212d17b8ce64f /mesonbuild/environment.py | |
parent | 22a83817c8685733adaa94c21b9b248b3e62f5f8 (diff) | |
download | meson-7cc41baa98e486d6fd08ca5bb6f336481b757c4a.zip meson-7cc41baa98e486d6fd08ca5bb6f336481b757c4a.tar.gz meson-7cc41baa98e486d6fd08ca5bb6f336481b757c4a.tar.bz2 |
Added Elbrus lcc compilers support as inheritance from gcc ones
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index b3b4a55..67a0fe0 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -49,6 +49,9 @@ from .compilers import ( GnuFortranCompiler, GnuObjCCompiler, GnuObjCPPCompiler, + ElbrusCCompiler, + ElbrusCPPCompiler, + ElbrusFortranCompiler, IntelCCompiler, IntelCPPCompiler, IntelFortranCompiler, @@ -498,15 +501,26 @@ class Environment: continue version = search_version(out) full_version = out.split('\n', 1)[0] - if 'Free Software Foundation' in out or ('e2k' in out and 'lcc' in out): + + guess_gcc_or_lcc = False + if 'Free Software Foundation' in out: + guess_gcc_or_lcc = 'gcc' + if 'e2k' in out and 'lcc' in out: + guess_gcc_or_lcc = 'lcc' + + if guess_gcc_or_lcc: defines = self.get_gnu_compiler_defines(compiler) if not defines: popen_exceptions[' '.join(compiler)] = 'no pre-processor defines' continue gtype = self.get_gnu_compiler_type(defines) version = self.get_gnu_version_from_defines(defines) - cls = GnuCCompiler if lang == 'c' else GnuCPPCompiler + if guess_gcc_or_lcc == 'lcc': + cls = ElbrusCCompiler if lang == 'c' else ElbrusCPPCompiler + else: + cls = GnuCCompiler if lang == 'c' else GnuCPPCompiler return cls(ccache + compiler, version, gtype, is_cross, exe_wrap, defines, full_version=full_version) + if 'clang' in out: if 'Apple' in out or mesonlib.for_darwin(want_cross, self): cltype = CLANG_OSX @@ -559,14 +573,24 @@ class Environment: version = search_version(out) full_version = out.split('\n', 1)[0] + guess_gcc_or_lcc = False if 'GNU Fortran' in out: + guess_gcc_or_lcc = 'gcc' + if 'e2k' in out and 'lcc' in out: + guess_gcc_or_lcc = 'lcc' + + if guess_gcc_or_lcc: defines = self.get_gnu_compiler_defines(compiler) if not defines: popen_exceptions[' '.join(compiler)] = 'no pre-processor defines' continue gtype = self.get_gnu_compiler_type(defines) version = self.get_gnu_version_from_defines(defines) - return GnuFortranCompiler(compiler, version, gtype, is_cross, exe_wrap, defines, full_version=full_version) + if guess_gcc_or_lcc == 'lcc': + cls = ElbrusFortranCompiler + else: + cls = GnuFortranCompiler + return cls(compiler, version, gtype, is_cross, exe_wrap, defines, full_version=full_version) if 'G95' in out: return G95FortranCompiler(compiler, version, is_cross, exe_wrap, full_version=full_version) |