mirror of https://github.com/acidanthera/audk.git
OvmfPkg/create-release.py: Support GCC44 through GCC47
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15041 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
4272d1a7c1
commit
6d3d4a7e9f
|
@ -31,11 +31,6 @@ if not os.path.exists(os.path.join('OvmfPkg', 'OvmfPkgX64.dsc')):
|
|||
print "OvmfPkg/OvmfPkgX64.dsc doesn't exist"
|
||||
sys.exit(-1)
|
||||
|
||||
if 'TOOLCHAIN' in os.environ:
|
||||
TOOLCHAIN = os.environ['TOOLCHAIN']
|
||||
else:
|
||||
TOOLCHAIN = 'GCC44'
|
||||
|
||||
def run_and_capture_output(args, checkExitCode = True):
|
||||
p = subprocess.Popen(args=args, stdout=subprocess.PIPE)
|
||||
stdout = p.stdout.read()
|
||||
|
@ -44,6 +39,21 @@ def run_and_capture_output(args, checkExitCode = True):
|
|||
assert ret_code == 0
|
||||
return stdout
|
||||
|
||||
gcc_version = run_and_capture_output(args=('gcc', '--version'))
|
||||
gcc_re = re.compile(r'\s*\S+\s+\([^\)]+?\)\s+(\d+(?:\.\d+)*)(?:\s+.*)?')
|
||||
mo = gcc_re.match(gcc_version)
|
||||
if not mo:
|
||||
print "Unable to find GCC version"
|
||||
sys.exit(-1)
|
||||
gcc_version = map(lambda n: int(n), mo.group(1).split('.'))
|
||||
|
||||
if 'TOOLCHAIN' in os.environ:
|
||||
TOOLCHAIN = os.environ['TOOLCHAIN']
|
||||
else:
|
||||
assert(gcc_version[0] == 4)
|
||||
minor = max(4, min(7, gcc_version[1]))
|
||||
TOOLCHAIN = 'GCC4' + str(minor)
|
||||
|
||||
def git_svn_info():
|
||||
dir = os.getcwd()
|
||||
os.chdir('OvmfPkg')
|
||||
|
@ -82,8 +92,7 @@ def gen_build_info():
|
|||
|
||||
machine = run_and_capture_output(args=('uname', '-m')).strip()
|
||||
|
||||
gcc_version = run_and_capture_output(args=('gcc', '--version'))
|
||||
gcc_version = gcc_version.split('\n')[0].split()[-1]
|
||||
gcc_version_str = '.'.join(map(lambda v: str(v), gcc_version))
|
||||
|
||||
ld_version = run_and_capture_output(args=('ld', '--version'))
|
||||
ld_version = ld_version.split('\n')[0].split()[-1]
|
||||
|
@ -94,7 +103,7 @@ def gen_build_info():
|
|||
|
||||
sb = StringIO.StringIO()
|
||||
print >> sb, 'edk2: ', 'r%d' % revision
|
||||
print >> sb, 'compiler: GCC', gcc_version
|
||||
print >> sb, 'compiler: GCC', gcc_version_str, '(' + TOOLCHAIN + ')'
|
||||
print >> sb, 'binutils:', ld_version
|
||||
print >> sb, 'iasl: ', iasl_version
|
||||
print >> sb, 'system: ', distro, machine.replace('_', '-')
|
||||
|
|
Loading…
Reference in New Issue