Changeset 97c5024a in rtems-libbsd for waf_generator.py


Ignore:
Timestamp:
Apr 18, 2016, 12:53:20 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
c1e05b9ea378b2971e3d7704779112b4bc4296da, freebsd-9.3, 4a77611a223ea883fb548679b516d326a020d447
Children:
00a7956
Parents:
891a756
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waf_generator.py

    r891a756 r97c5024a  
    11#
    2 #  Copyright (c) 2015 Chris Johns <chrisj@rtems.org>. All rights reserved.
     2#  Copyright (c) 2015-2016 Chris Johns <chrisj@rtems.org>. All rights reserved.
    33#
    44#  Copyright (c) 2009-2015 embedded brains GmbH.  All rights reserved.
     
    3333#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3434
     35from __future__ import print_function
     36
    3537import os
     38import sys
    3639import tempfile
    3740
     
    147150        try:
    148151            out = tempfile.NamedTemporaryFile(delete = False)
    149             out.write(self.script)
     152            try:
     153                out.write(bytes(self.script, sys.stdin.encoding))
     154            except:
     155                out.write(self.script)
    150156            out.close()
    151157            wscript = builder.RTEMS_DIR + '/wscript'
     
    177183        self.generator['yacc'] = YaccFragmentComposer
    178184
    179     def generate(self):
     185    def generate(self, rtems_version):
    180186
    181187        def _source_list(lhs, files, append = False):
     
    258264        self.add('#')
    259265        self.add('')
     266        self.add('from __future__ import print_function')
     267        self.add('')
    260268        self.add('import os.path')
     269        self.add('')
     270        self.add('rtems_version = "%s"' % (rtems_version))
    261271        self.add('')
    262272        self.add('try:')
     
    268278        self.add('')
    269279        self.add('def init(ctx):')
    270         self.add('    rtems.init(ctx)')
     280        self.add('    rtems.init(ctx, version = rtems_version)')
    271281        self.add('')
    272282        self.add('def options(opt):')
     
    570580        self.add('    # Tests')
    571581        tests = data['tests']
    572         for test_name in tests:
     582        for test_name in sorted(tests):
    573583            files = ['testsuite/%s/%s.c' % (test_name, f) for f in  data['tests'][test_name]['all']['files']]
    574584            _source_list('    test_%s' % (test_name), sorted(files))
Note: See TracChangeset for help on using the changeset viewer.