Changeset efc4f09 in rtems-tools
- Timestamp:
- 12/09/15 09:08:19 (8 years ago)
- Branches:
- 4.10, 5, master
- Children:
- 8b49f73
- Parents:
- c9fa179
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
rc9fa179 refc4f09 9 9 .lock-waf* 10 10 build 11 VERSION -
linkers/rtems-ld.cpp
rc9fa179 refc4f09 213 213 case 'V': 214 214 std::cout << "rtems-ld (RTEMS Linker) " << rld::version () 215 << ", RTEMS revision " << rld::rtems::version () 215 216 << std::endl; 216 217 ::exit (0); -
linkers/rtems-ra.cpp
rc9fa179 refc4f09 43 43 #include <rld-process.h> 44 44 #include <rld-resolver.h> 45 #include <rld-rtems.h> 45 46 46 47 #ifndef HAVE_KILL … … 184 185 case 'V': 185 186 std::cout << "rtems-ra (RTEMS Linker) " << rld::version () 187 << ", RTEMS revision " << rld::rtems::version () 186 188 << std::endl; 187 189 ::exit (0); -
linkers/rtems-rapper.cpp
rc9fa179 refc4f09 45 45 #include <rld-process.h> 46 46 #include <rld-rap.h> 47 #include <rld-rtems.h> 47 48 48 49 #include <rtems-utils.h> … … 1173 1174 case 'V': 1174 1175 std::cout << "rtems-rap (RTEMS RAP Manager) " << rld::version () 1176 << ", RTEMS revision " << rld::rtems::version () 1175 1177 << std::endl; 1176 1178 ::exit (0); -
linkers/rtems-syms.cpp
rc9fa179 refc4f09 44 44 #include <rld-process.h> 45 45 #include <rld-symbols.h> 46 #include <rld-rtems.h> 46 47 47 48 #ifndef HAVE_KILL … … 330 331 case 'V': 331 332 std::cout << "rtems-syms (RTEMS Symbols) " << rld::version () 333 << ", RTEMS revision " << rld::rtems::version () 332 334 << std::endl; 333 335 ::exit (0); -
linkers/rtems-tld.cpp
rc9fa179 refc4f09 1737 1737 case 'V': 1738 1738 std::cout << "rtems-trace-ld (RTEMS Trace Linker) " << rld::version () 1739 << ", RTEMS revision " << rld::rtems::version () 1739 1740 << std::endl; 1740 1741 ::exit (0); -
linkers/wscript
rc9fa179 refc4f09 34 34 import sys 35 35 36 version_major = 137 version_minor = 038 version_revision = 039 40 36 def options(opt): 41 37 opt.load('compiler_c') … … 46 42 conf.load('compiler_cxx') 47 43 48 conf.env.C_OPTS = conf.options.c_opts.split(',')49 conf.env.RTEMS_VERSION = conf.options.rtems_version50 44 conf.write_config_header('config.h') 51 45 … … 86 80 87 81 # 82 # The list of defines 83 # 84 defines = ['HAVE_CONFIG_H=1', 85 'RTEMS_VERSION=\"%s\"' % (bld.env.RTEMS_VERSION), 86 'RTEMS_RELEASE=\"%s\"' % (bld.env.RTEMS_RELEASE)] 87 88 # 88 89 # Build the linker. 89 90 # 90 91 bld.program(target = 'rtems-ld', 91 92 source = ['rtems-ld.cpp'], 92 defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],93 defines = defines, 93 94 includes = ['.'] + conf['includes'], 94 95 cflags = conf['cflags'] + conf['warningflags'], … … 102 103 bld.program(target = 'rtems-ra', 103 104 source = ['rtems-ra.cpp'], 104 defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],105 defines = defines, 105 106 includes = ['.'] + conf['includes'], 106 107 cflags = conf['cflags'] + conf['warningflags'], … … 114 115 bld.program(target = 'rtems-tld', 115 116 source = ['rtems-tld.cpp'], 116 defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],117 defines = defines, 117 118 includes = ['.'] + conf['includes'], 118 119 cflags = conf['cflags'] + conf['warningflags'], … … 140 141 bld.program(target = 'rtems-syms', 141 142 source = ['rtems-syms.cpp'], 142 defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],143 defines = defines, 143 144 includes = ['.'] + conf['includes'], 144 145 cflags = conf['cflags'] + conf['warningflags'], … … 152 153 bld.program(target = 'rtems-rap', 153 154 source = ['rtems-rapper.cpp'], 154 defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],155 defines = defines, 155 156 includes = ['.'] + conf['includes'], 156 157 cflags = conf['cflags'] + conf['warningflags'], -
rtemstoolkit/git.py
rc9fa179 refc4f09 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2015 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # 6 6 # This file is part of the RTEMS Tools package in 'rtems-tools'. 7 #8 # Redistribution and use in source and binary forms, with or without9 # modification, are permitted provided that the following conditions are met:10 7 # 11 8 # 1. Redistributions of source code must retain the above copyright notice, … … 62 59 return exit_code, output 63 60 64 def __init__(self, _path, opts , macros = None):61 def __init__(self, _path, opts = None, macros = None): 65 62 self.path = _path 66 63 self.opts = opts 67 if macros is None :64 if macros is None and opts is not None: 68 65 self.macros = opts.defaults 69 66 else: 70 67 self.macros = macros 71 self.git = self.macros.expand('%{__git}') 68 if self.macros is None: 69 self.git = 'git' 70 else: 71 self.git = self.macros.expand('%{__git}') 72 72 73 73 def git_version(self): … … 87 87 ec, output = self._run(['fetch'], check = True) 88 88 89 def merge(self): 90 ec, output = self._run(['merge'], check = True) 91 89 92 def pull(self): 90 93 ec, output = self._run(['pull'], check = True) … … 105 108 def checkout(self, branch = 'master'): 106 109 ec, output = self._run(['checkout', branch], check = True) 110 111 def submodule(self, module): 112 ec, output = self._run(['submodule', 'update', '--init', module], check = True) 113 114 def clean(self, args = []): 115 if type(args) == str: 116 args = [args] 117 ec, output = self._run(['clean'] + args, check = True) 107 118 108 119 def status(self): … … 113 124 state = 'none' 114 125 for l in output.split('\n'): 115 if l.startswith('# On branch '): 116 _status['branch'] = l[len('# On branch '):] 117 elif l.startswith('# Changes to be committed:'): 126 if l.startswith('# '): 127 l = l[2:] 128 if l.startswith('On branch '): 129 _status['branch'] = l[len('On branch '):] 130 elif l.startswith('Changes to be committed:'): 118 131 state = 'staged' 119 elif l.startswith(' #Changes not staged for commit:'):132 elif l.startswith('Changes not staged for commit:'): 120 133 state = 'unstaged' 121 elif l.startswith(' #Untracked files:'):134 elif l.startswith('Untracked files:'): 122 135 state = 'untracked' 123 elif state != 'none' and l[0] == '#': 124 if l.strip() != '#' and not l.startswith('# ('): 125 if state not in _status: 126 _status[state] = [] 127 l = l[1:] 128 if ':' in l: 129 l = l.split(':')[1] 130 _status[state] += [l.strip()] 136 elif l.startswith('HEAD detached'): 137 state = 'detached' 138 elif state != 'none' and len(l.strip()) != 0: 139 if l[0].isspace(): 140 l = l.strip() 141 if l[0] != '(': 142 if state not in _status: 143 _status[state] = [] 144 l = l[1:] 145 if ':' in l: 146 l = l.split(':')[1] 147 _status[state] += [l.strip()] 131 148 return _status 132 149 133 def clean(self):150 def dirty(self): 134 151 _status = self.status() 135 return len(_status) == 1 and 'branch' in _status152 return not (len(_status) == 1 and 'branch' in _status) 136 153 137 154 def valid(self): -
rtemstoolkit/options.py
rc9fa179 refc4f09 354 354 repo_valid = '1' 355 355 repo_head = repo.head() 356 repo_clean = repo.clean()356 repo_clean = not repo.dirty() 357 357 repo_id = repo_head 358 358 if not repo_clean: -
rtemstoolkit/rld-rtems.cpp
rc9fa179 refc4f09 25 25 namespace rtems 26 26 { 27 static std::string _version = "4.12";27 static std::string _version = RTEMS_VERSION; 28 28 static std::string _path; 29 29 static std::string _arch_bsp; -
rtemstoolkit/rld.cpp
rc9fa179 refc4f09 33 33 #include <rld.h> 34 34 35 #define RLD_VERSION_MAJOR (1)36 #define RLD_VERSION_MINOR (0)37 #define RLD_VERSION_RELEASE (0)38 39 35 namespace rld 40 36 { … … 203 199 version () 204 200 { 205 std::string v = (rld::to_string (RLD_VERSION_MAJOR) + '.' + 206 rld::to_string (RLD_VERSION_MINOR) + '.' + 207 rld::to_string (RLD_VERSION_RELEASE)); 208 return v; 201 return RTEMS_RELEASE; 209 202 } 210 203 … … 212 205 rtems_version () 213 206 { 214 return rld::to_string (RTEMS_VERSION);207 return RTEMS_VERSION; 215 208 } 216 209 -
rtemstoolkit/version.py
rc9fa179 refc4f09 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2010-201 4Chris Johns (chrisj@rtems.org)3 # Copyright 2010-2015 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 30 30 31 31 # 32 # Manage paths locally. The internally the path is in Unix or shell format and 33 # we convert to the native format when performing operations at the Python 34 # level. This allows macro expansion to work. 32 # To release RTEMS Tools create a git archive and then add a suitable VERSION 33 # file to the top directory. 35 34 # 36 35 37 major = 0 38 minor = 0 39 revision = 0 36 import sys 37 38 import error 39 import git 40 import path 41 42 # 43 # Default to an internal string. 44 # 45 _version_str = '4.12.not_release' 46 _released = False 47 _git = False 48 49 def _at(): 50 return path.dirname(__file__) 51 52 def _load_released_version(): 53 global _released 54 global _version_str 55 at = _at() 56 for ver in [at, path.join(at, '..')]: 57 if path.exists(path.join(ver, 'VERSION')): 58 try: 59 with open(path.join(ver, 'VERSION')) as v: 60 _version_str = v.readline().strip() 61 v.close() 62 _released = True 63 except: 64 raise error.general('Cannot access the VERSION file') 65 return _released 66 67 def _load_git_version(): 68 global _git 69 global _version_str 70 repo = git.repo(_at()) 71 if repo.valid(): 72 head = repo.head() 73 if repo.dirty(): 74 modified = ' modified' 75 else: 76 modified = '' 77 _version_str = '%s (%s%s)' % (_version_str, head[0:12], modified) 78 _git = True 79 return _git 80 81 def released(): 82 return _load_released_version() 83 84 def version_control(): 85 return _load_git_version() 40 86 41 87 def str(): 42 return '%d.%d.%d'% (major, minor, revision) 88 if not _released and not _git: 89 if not _load_released_version(): 90 _load_git_version() 91 return _version_str 43 92 44 93 if __name__ == '__main__': 45 print('major = %d' % (major)) 46 print('minor = %d' % (minor)) 47 print('revision = %d' % (revision)) 48 print('Version: %s' % (str())) 94 print 'Version: %s' % (str()) -
rtemstoolkit/wscript
rc9fa179 refc4f09 34 34 import sys 35 35 36 version_major = 137 version_minor = 038 version_revision = 039 40 36 # 41 37 # Waf system setup. Allow more than one build in the same tree. … … 60 56 features = 'c', mandatory = False) 61 57 conf.write_config_header('config.h') 58 59 conf.load('python') 60 conf.check_python_version((2,6,6)) 61 conf.env['PYO'] = 0 62 conf.env['PYC'] = 0 62 63 63 64 def build(bld): … … 126 127 source = rld_source + rtems_utils + compression, 127 128 defines = ['HAVE_CONFIG_H=1', 128 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION, 129 'RTEMS_VERSION=\"%s\"' % (bld.env.RTEMS_VERSION), 130 'RTEMS_RELEASE=\"%s\"' % (bld.env.RTEMS_RELEASE), 129 131 'FASTLZ_LEVEL=1'], 130 132 includes = ['.'] + conf['includes'], … … 154 156 'version.py', 155 157 'windows.py'], 156 install_path = '${PREFIX}/share/rtems /rtemstoolkit')158 install_path = '${PREFIX}/share/rtems') 157 159 158 160 def rebuild(ctx): -
tester/rt/test.py
rc9fa179 refc4f09 40 40 from rtemstoolkit import path 41 41 from rtemstoolkit import stacktraces 42 from rtemstoolkit import version 42 43 43 44 import bsps … … 46 47 import options 47 48 import report 48 import version49 49 import fnmatch 50 50 … … 202 202 optargs = optargs, 203 203 command_path = command_path) 204 log.notice('RTEMS Testing - Tester, v%s' % (version.str()))204 log.notice('RTEMS Testing - Tester, %s' % (version.str())) 205 205 if opts.find_arg('--list-bsps'): 206 206 bsps.list(opts) -
tester/rtems-test
rc9fa179 refc4f09 2 2 # 3 3 # RTEMS Tools Project (http://www.rtems.org/) 4 # Copyright 2013 Chris Johns (chrisj@rtems.org)4 # Copyright 2013, 2015 Chris Johns (chrisj@rtems.org) 5 5 # All rights reserved. 6 6 # … … 34 34 parent = os.path.dirname(base) 35 35 rtems = os.path.join(parent, 'share', 'rtems') 36 tester = os.path.join(parent, 'share', 'rtems', 'tester') 37 sys.path = [parent, rtems, tester] + sys.path 36 sys.path = [rtems, os.path.join(rtems, 'tester')] + sys.path 38 37 39 38 try: -
tester/wscript
rc9fa179 refc4f09 43 43 conf.load('python') 44 44 conf.check_python_version((2,6,6)) 45 conf.env['PYO'] = 0 46 conf.env['PYC'] = 0 45 47 46 48 def build(bld): … … 61 63 'rt/test.py', 62 64 'rt/version.py'], 63 install_path = '${PREFIX}/share/rtems /tester')65 install_path = '${PREFIX}/share/rtems') 64 66 bld(features = 'py', 65 67 source = ['rt/pygdb/__init__.py', 66 68 'rt/pygdb/mi_parser.py', 67 69 'rt/pygdb/spark.py'], 68 install_path = '${PREFIX}/share/rtems /tester')70 install_path = '${PREFIX}/share/rtems') 69 71 bld.install_files('${PREFIX}/bin', ['rtems-test'], chmod = 0o755) 70 72 -
wscript
rc9fa179 refc4f09 1 1 # 2 2 # RTEMS Tools Project (http://www.rtems.org/) 3 # Copyright 2014 ,2015 Chris Johns (chrisj@rtems.org)3 # Copyright 2014-2015 Chris Johns (chrisj@rtems.org) 4 4 # All rights reserved. 5 5 # … … 29 29 # 30 30 31 import os.path 32 31 33 subdirs = ['rtemstoolkit', 32 34 'linkers', 33 35 'tester', 34 36 'tools/gdb/python'] 37 38 def get_version(ctx): 39 release = '4.12.not_released' 40 if os.path.exists('VERSION'): 41 try: 42 with open('VERSION') as v: 43 release = v.readline().strip() 44 v.close() 45 except: 46 ctx.fatal('cannot access the VERSION file') 47 last_dot = release.rfind('.') 48 if last_dot == -1: 49 ctx.fatal('invalid VERSION file') 50 revision = release[0:last_dot] 51 return revision, release 35 52 36 53 def recurse(ctx): … … 39 56 40 57 def options(ctx): 41 ctx.add_option('--rtems-version',42 default = '4.11',43 dest='rtems_version',44 help = 'Set the RTEMS version')45 58 ctx.add_option('--c-opts', 46 59 default = '-O2', … … 70 83 except: 71 84 pass 85 ctx.env.RTEMS_VERSION, ctx.env.RTEMS_RELEASE = get_version(ctx) 72 86 ctx.env.C_OPTS = ctx.options.c_opts.split(',') 73 ctx.env.RTEMS_VERSION = ctx.options.rtems_version74 87 check_options(ctx, ctx.options.host) 75 88 recurse(ctx) 76 89 77 90 def build(ctx): 91 if os.path.exists('VERSION'): 92 ctx.install_files('${PREFIX}/share/rtems/rtemstoolkit', ['VERSION']) 78 93 recurse(ctx) 79 94
Note: See TracChangeset
for help on using the changeset viewer.