Commit f0c9b57c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

component/default: system gcc can be used only if all gcc, g++ and gfortran exist.

parent 9e769522
......@@ -42,13 +42,22 @@ min_version = 5.4
init =
import os, subprocess
parse_version = lambda ver: tuple(map(int, ver.strip().split('.')))
version_list = []
for command in ('gcc', 'g++', 'gfortran'):
try:
current = subprocess.check_output(('gcc', '-dumpfullversion'),
version = subprocess.check_output((command, '-dumpfullversion'),
stderr=subprocess.STDOUT,
universal_newlines=True).strip()
except subprocess.CalledProcessError: # BBB: old GCC
current = subprocess.check_output(('gcc', '-dumpversion'),
version = subprocess.check_output((command, '-dumpversion'),
universal_newlines=True).strip()
except FileNotFoundError:
version = None
version_list.append(version)
if None in version_list:
current = '0.0.0'
else:
current = sorted(version_list, key=parse_version)[0]
self.system_version = current
# If we're still going to use the same GCC,
# the conditions have no impact on the dependant parts.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment