Add RTEMS version support, update all python to 2 and 3.

Add support to force the RTEMS version. This remove the need for using
the --rtems-version command line option if the automatic detection fails.

Update all python code to support python 2 and 3.

Update rtems_waf to the latest version to support the RTEMS version,
check environment variables and to display the CC version.

Sort all tests. I think the unsorted list is dependent on the version
of python and so would result in repo noise as if it regenerted.
This commit is contained in:
Chris Johns
2016-04-18 10:53:20 +10:00
parent 891a7568e5
commit 97c5024a79
8 changed files with 341 additions and 315 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2015 Chris Johns <chrisj@rtems.org>. All rights reserved.
# Copyright (c) 2015-2016 Chris Johns <chrisj@rtems.org>. All rights reserved.
#
# Copyright (c) 2009-2015 embedded brains GmbH. All rights reserved.
#
@@ -34,6 +34,8 @@
# FreeBSD: http://svn.freebsd.org/base/releng/8.2/sys (revision 222485)
from __future__ import print_function
import shutil
import os
import re
@@ -50,7 +52,14 @@ FreeBSD_DIR = "freebsd-org"
isVerbose = False
isDryRun = False
isDiffMode = False
filesProcessed = 0
filesProcessedCount = 0
filesProcessed = []
def changedFileSummary():
if isDiffMode == False:
print('%d file(s) were changed:' % (filesProcessedCount))
for f in sorted(filesProcessed):
print(' %s' % (f))
class error(Exception):
"""Base class for exceptions."""
@@ -131,20 +140,22 @@ def header_paths():
# + copy or diff depending on execution mode
def processIfDifferent(new, old, src):
global filesProcessedCount
global filesProcessed
global isVerbose, isDryRun, isEarlyExit
if not os.path.exists(old) or \
filecmp.cmp(new, old, shallow = False) == False:
filesProcessed += 1
filesProcessed += [old]
filesProcessedCount += 1
if isDiffMode == False:
if isVerbose == True:
print "Move " + src + " to " + old
print("Move " + src + " to " + old)
if isDryRun == False:
shutil.move(new, old)
else:
if isVerbose == True:
print "Diff %s => %s" % (src, new)
print("Diff %s => %s" % (src, new))
old_contents = open(old).readlines()
new_contents = open(new).readlines()
for line in \
@@ -191,14 +202,14 @@ def revertFixLocalIncludes(data):
def assertHeaderFile(path):
if path[-2] != '.' or path[-1] != 'h':
print "*** " + path + " does not end in .h"
print "*** Move it to a C source file list"
print("*** " + path + " does not end in .h")
print("*** Move it to a C source file list")
sys.exit(2)
def assertSourceFile(path):
if path[-2] != '.' or (path[-1] != 'c' and path[-1] != 'S'):
print "*** " + path + " does not end in .c"
print "*** Move it to a header file list"
print("*** " + path + " does not end in .c")
print("*** Move it to a header file list")
sys.exit(2)
class Converter(object):