Changeset 7385feb in rtems-source-builder
- Timestamp:
- 07/20/15 03:49:42 (8 years ago)
- Branches:
- 4.11
- Children:
- 4c49119
- Parents:
- fba2549
- git-author:
- Chris Johns <chrisj@…> (07/20/15 03:49:42)
- git-committer:
- Chris Johns <chrisj@…> (07/21/15 06:56:53)
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
rtems/config/rtems-bsp.cfg
rfba2549 r7385feb 4 4 5 5 # 6 # The RTEMS BSP support requires the host turple, the RTEMS BSP 7 # and the path to the tools. The prefix is set to an installed8 # RTEMS. The built package isinstalled into the prefix.6 # The RTEMS BSP support requires the host turple, the RTEMS BSP and the path to 7 # the tools. The prefix is set to an installed RTEMS. The built package is 8 # installed into the prefix. 9 9 # 10 # Keeping the package's installed path in the RTEMS install path 11 # and separate to the tools lets the tools version vary12 # independently. If --with-toolsis not provided use the prefix.10 # Keeping the package's installed path in the RTEMS install path and separate 11 # to the tools lets the tools version vary independently. If --rtems-tools 12 # (--with-tools) is not provided use the prefix. 13 13 # 14 14 15 %if %{_host} == %{nil} 16 %error No RTEMS target specified: --host=host 15 %if %{_target} == %{nil} 16 %error No RTEMS target specified: --rtems-bsp=arch/bsp (or --target=target) 17 %endif 18 19 %if %{_host} != %{_build} 20 %error Canadian cross building for BSP is not supported. 17 21 %endif 18 22 19 23 %ifn %{defined with_rtems_bsp} 20 %error No RTEMS BSP specified: -- with-rtems-bsp=bsp24 %error No RTEMS BSP specified: --rtems-bsp=arch/bsp (or --with-rtems-bsp=bsp) 21 25 %endif 22 26 … … 24 28 %define with_tools %{_prefix} 25 29 %endif 30 31 # 32 # Set the host to the target. 33 # 34 %define _host %{_target} 26 35 27 36 # … … 47 56 %define rtems_bsp_ldflags %{pkgconfig ldflags %{_host}-%{rtems_bsp}} 48 57 %define rtems_bsp_libs %{pkgconfig libs %{_host}-%{rtems_bsp}} 58 59 %if %{rtems_bsp_cflags} == %{nil} 60 %error No RTEMS target CFLAGS found; Please check the --rtems-bsp option. 61 %endif 49 62 50 63 %if %{rtems_bsp_ccflags} == %{nil} -
rtems/config/tools/rtems-autoconf-2.69-1.cfg
rfba2549 r7385feb 2 2 # Autoconf 2.69. 3 3 # 4 5 %if %{rtems_arch} == none 6 %define _target %{_host} 7 %endif 4 8 5 9 %include %{_configdir}/checks.cfg -
rtems/config/tools/rtems-automake-1.12.6-1.cfg
rfba2549 r7385feb 2 2 # Automake 1.12.6 3 3 # 4 5 %if %{rtems_arch} == none 6 %define _target %{_host} 7 %endif 4 8 5 9 %include %{_configdir}/checks.cfg -
source-builder/defaults.mc
rfba2549 r7385feb 80 80 _builddir: dir, optional, '%{_topdir}/build/%{buildname}' 81 81 _buildcxcdir: dir, optional, '%{_topdir}/build/%{buildname}-cxc' 82 _buildxcdir: dir, optional, '%{_topdir}/build/%{buildname}-xc' 82 83 _docdir: dir, none, '%{_defaultdocdir}' 83 84 _tmppath: dir, none, '%{_topdir}/build/tmp' … … 86 87 buildroot: dir, none, '%{_tmppath}/%{buildname}-%{_uid}' 87 88 buildcxcroot: dir, none, '%{_tmppath}/%{buildname}-%{_uid}-cxc' 89 buildxcroot: dir, none, '%{_tmppath}/%{buildname}-%{_uid}-xx' 88 90 _datadir: dir, none, '%{_prefix}/share' 89 91 _defaultdocdir: dir, none, '%{_prefix}/share/doc' … … 302 304 host_build_flags: none, none, ''' 303 305 # Host and build flags, Cross build if host and build are different and 304 # Cxc build i df target is deifned and also different.306 # Cxc build if target is deifned and also different. 305 307 # Note, gcc is not ready to be compiled with -std=gnu99 (this needs to be checked). 306 308 if test "%{_build}" != "%{_host}" ; then -
source-builder/sb/build.py
rfba2549 r7385feb 23 23 # 24 24 25 import copy 25 26 import getopt 26 27 import glob … … 117 118 try: 118 119 self.opts = opts 119 if macros is None: 120 self.macros = opts.defaults 121 else: 122 self.macros = macros 120 self.init_name = name 121 self.init_macros = macros 122 self.config = None 123 123 self.create_tar_files = create_tar_files 124 124 log.notice('config: ' + name) 125 self.set_macros(macros) 125 126 self.config = config.file(name, opts, self.macros) 126 127 self.script = script() … … 137 138 raise 138 139 140 def copy_init_macros(self): 141 return copy.copy(self.init_macros) 142 143 def copy_macros(self): 144 return copy.copy(self.macros) 145 146 def set_macros(self, macros): 147 if macros is None: 148 self.macros = copy.copy(opts.defaults) 149 else: 150 self.macros = copy.copy(macros) 151 if self.config: 152 self.config.set_macros(self.macros) 153 139 154 def rmdir(self, rmpath): 140 155 log.output('removing: %s' % (path.host(rmpath))) … … 152 167 _build = self.config.expand('%{_build}') 153 168 _target = self.config.expand('%{_target}') 154 return self.config.defined('%{allow_cxc}') and \ 155 len(_host) and len(_build) and (_target) and \ 156 _host != _build and _host != _target 169 _allowed = self.config.defined('%{allow_cxc}') 170 if len(_host) and len(_build) and (_target) and \ 171 _allowed and _host != _build and _host != _target: 172 return True 173 return False 174 175 def installable(self): 176 _host = self.config.expand('%{_host}') 177 _build = self.config.expand('%{_build}') 178 _canadian_cross = self.canadian_cross() 179 if self.macros.get('_disable_installing') and \ 180 self.config.expand('%{_disable_installing}') == 'yes': 181 _disable_installing = True 182 else: 183 _disable_installing = False 184 _no_install = self.opts.no_install() 185 log.trace('_build: installable: host=%s build=%s ' \ 186 'no-install=%r Cxc=%r disable_installing=%r disabled=%r' % \ 187 (_host, _build, _no_install, _canadian_cross, _disable_installing, \ 188 self.disabled())) 189 return len(_host) and len(_build) and \ 190 not self.disabled() and \ 191 not _disable_installing and \ 192 not _canadian_cross 157 193 158 194 def source(self, name): … … 314 350 if args[0] == '%setup': 315 351 if len(args) == 1: 316 raise error.general('invalid %%setup directive: %s' % (' '.join(args))) 352 raise error.general('invalid %%setup directive: %s' % \ 353 (' '.join(args))) 317 354 if args[1] == 'source': 318 355 self.source_setup(package, args[1:]) … … 372 409 def build_package(self, package): 373 410 if self.canadian_cross(): 411 if not self.config.defined('%{allow_cxc}'): 412 raise error.general('Canadian Cross is not allowed') 374 413 self.script.append('echo "==> Candian-cross build/target:"') 375 414 self.script.append('SB_CXC="yes"') … … 403 442 return packages['main'] 404 443 444 def reload(self): 445 self.config.load(self.init_name) 446 405 447 def make(self): 406 448 package = self.main_package() … … 411 453 name = package.name() 412 454 if self.canadian_cross(): 413 log.notice('package: (Cxc) %s' % (name))455 cxc_label = '(Cxc) ' 414 456 else: 415 log.notice('package: %s' % (name)) 416 log.trace('---- macro maps %s' % ('-' * 55)) 417 log.trace('%s' % (str(self.config.macros))) 418 log.trace('-' * 70) 457 cxc_label = '' 458 log.notice('package: %s%s' % (cxc_label, name)) 459 log.trace('---- macro maps %s' % ('-' * 55)) 460 log.trace('%s' % (str(self.config.macros))) 461 log.trace('-' * 70) 419 462 self.script.reset() 420 463 self.script.append(self.config.expand('%{___build_template}')) … … 427 470 log.output('write script: ' + sn) 428 471 self.script.write(sn) 429 if self.canadian_cross(): 430 log.notice('building: (Cxc) %s' % (name)) 431 else: 432 log.notice('building: %s' % (name)) 472 log.notice('building: %s%s' % (cxc_label, name)) 433 473 self.run(sn) 434 474 except error.general, gerr: -
source-builder/sb/config.py
rfba2549 r7385feb 237 237 238 238 def __init__(self, name, opts, macros = None): 239 log.trace('config: %s: initialising' % (name)) 239 240 self.opts = opts 240 if macros is None:241 self.macros = opts.defaults242 else:243 self.macros = macros244 241 self.init_name = name 245 log.trace('config: %s' % (name))246 self.disable_macro_reassign = False247 self.configpath = []248 242 self.wss = re.compile(r'\s+') 249 243 self.tags = re.compile(r':+') 250 244 self.sf = re.compile(r'%\([^\)]+\)') 251 for arg in self.opts.args: 252 if arg.startswith('--with-') or arg.startswith('--without-'): 253 if '=' in arg: 254 label, value = arg.split('=', 1) 255 else: 256 label = arg 257 value = None 258 label = label[2:].lower().replace('-', '_') 259 if value: 260 self.macros.define(label, value) 261 else: 262 self.macros.define(label) 263 self._includes = [] 264 self.load_depth = 0 265 self.pkgconfig_prefix = None 266 self.pkgconfig_crosscompile = False 267 self.pkgconfig_filter_flags = False 245 self.set_macros(macros) 246 self._reset(name) 268 247 self.load(name) 269 248 … … 286 265 s += str(self._packages[_package]) 287 266 return s 267 268 def _reset(self, name): 269 self.name = name 270 self.load_depth = 0 271 self.configpath = [] 272 self._includes = [] 273 self._packages = {} 274 self.in_error = False 275 self.lc = 0 276 self.conditionals = {} 277 self._packages = {} 278 self.package = 'main' 279 self.disable_macro_reassign = False 280 self.pkgconfig_prefix = None 281 self.pkgconfig_crosscompile = False 282 self.pkgconfig_filter_flags = False 283 for arg in self.opts.args: 284 if arg.startswith('--with-') or arg.startswith('--without-'): 285 if '=' in arg: 286 label, value = arg.split('=', 1) 287 else: 288 label = arg 289 value = None 290 label = label[2:].lower().replace('-', '_') 291 if value: 292 self.macros.define(label, value) 293 else: 294 self.macros.define(label) 288 295 289 296 def _relative_path(self, p): … … 1054 1061 self._packages[self.package].info_append(info, data) 1055 1062 1063 def set_macros(self, macros): 1064 if macros is None: 1065 self.macros = opts.defaults 1066 else: 1067 self.macros = macros 1068 1056 1069 def load(self, name): 1057 1070 … … 1067 1080 1068 1081 if self.load_depth == 0: 1069 self.in_error = False 1070 self.lc = 0 1071 self.name = name 1072 self.conditionals = {} 1073 self._packages = {} 1074 self.package = 'main' 1082 self._reset(name) 1075 1083 self._packages[self.package] = package(self.package, 1076 1084 self.define('%{_arch}'), -
source-builder/sb/options.py
rfba2549 r7385feb 222 222 print '--with-<label> : Add the --with-<label> to the build' 223 223 print '--without-<label> : Add the --without-<label> to the build' 224 print '--rtems-tools path : Path to an install RTEMS tool set' 225 print '--rtems-bsp arc/bsp : Standard RTEMS architecure and BSP specifier' 226 print '--rtems-version ver : The RTEMS major/minor version string' 224 227 if self.optargs: 225 228 for a in self.optargs: … … 298 301 if path.exists(rsb_macros): 299 302 self.defaults.load(rsb_macros) 300 # If a Cxc build disable installing.301 if self.canadian_cross():302 self.opts['no-install'] = '1'303 self.defaults['_no_install'] = '1'304 303 305 304 def sb_git(self): … … 451 450 def get_arg(self, arg): 452 451 if self.optargs is None or arg not in self.optargs: 453 r aise error.internal('bad arg: %s' % (arg))452 return None 454 453 return self.parse_args(arg) 455 454 … … 517 516 return self.opts['no-download'] != '0' 518 517 518 def disable_install(self): 519 self.opts['no-install'] = '1' 520 519 521 def info(self): 520 522 s = ' Command Line: %s%s' % (' '.join(self.argv), os.linesep) … … 524 526 def log_info(self): 525 527 log.output(self.info()) 528 529 def rtems_options(self): 530 # Check for RTEMS specific helper options. 531 rtems_tools = self.parse_args('--rtems-tools') 532 if rtems_tools is not None: 533 if self.get_arg('--with-tools') is not None: 534 raise error.general('--rtems-tools and --with-tools cannot be used together') 535 self.args.append('--with-tools=%s' % (rtems_tools[1])) 536 rtems_arch_bsp = self.parse_args('--rtems-bsp') 537 if rtems_arch_bsp is not None: 538 if self.get_arg('--target') is not None: 539 raise error.general('--rtems-bsp and --target cannot be used together') 540 ab = rtems_arch_bsp[1].split('/') 541 if len(ab) != 2: 542 raise error.general('invalid --rtems-bsp option') 543 rtems_version = self.parse_args('--rtems-version') 544 if rtems_version is None: 545 rtems_version = '%d.%d' % (version.major, version.minor) 546 else: 547 rtems_version = rtems_version[1] 548 self.args.append('--target=%s-rtems%s' % (ab[0], rtems_version)) 549 self.args.append('--with-rtems-bsp=%s' % (ab[1])) 526 550 527 551 def load(args, optargs = None, defaults = '%{_sbdir}/defaults.mc'): … … 591 615 592 616 o.sb_git() 617 o.rtems_options() 593 618 o.process() 594 619 o.post_process() -
source-builder/sb/path.py
rfba2549 r7385feb 202 202 if trace: 203 203 print ' mkdir: %s' % (hdst) 204 os.makedirs(hdst) 204 try: 205 os.makedirs(hdst) 206 except OSError, why: 207 raise error.general('copying tree: cannot create target directory %s: %s' % \ 208 (hdst, str(why))) 205 209 206 210 for name in names: -
source-builder/sb/setbuilder.py
rfba2549 r7385feb 100 100 if format is not None: 101 101 if len(format) != 2: 102 raise error.general('invalid report format option: %s' % ('='.join(format))) 102 raise error.general('invalid report format option: %s' % \ 103 ('='.join(format))) 103 104 format = format[1] 104 105 if format is None: … … 157 158 158 159 def canadian_cross(self, _build): 159 # @fixme Switch to using a private macros map. 160 macros_to_save = ['%{_prefix}', 161 '%{_tmproot}', 162 '%{buildroot}', 163 '%{_builddir}', 164 '%{_host}'] 165 macros_to_copy = [('%{_host}', '%{_build}'), 166 ('%{_tmproot}', '%{_tmpcxcroot}'), 167 ('%{buildroot}', '%{buildcxcroot}'), 168 ('%{_builddir}', '%{_buildcxcdir}')] 169 orig_macros = {} 170 for m in macros_to_save: 171 orig_macros[m] = _build.config.macro(m) 160 log.trace('_bset: Cxc for build machine: _build => _host') 161 macros_to_copy = [('%{_host}', '%{_build}'), 162 ('%{_host_alias}', '%{_build_alias}'), 163 ('%{_host_arch}', '%{_build_arch}'), 164 ('%{_host_cpu}', '%{_build_cpu}'), 165 ('%{_host_os}', '%{_build_os}'), 166 ('%{_host_vendor}', '%{_build_vendor}'), 167 ('%{_tmproot}', '%{_tmpcxcroot}'), 168 ('%{buildroot}', '%{buildcxcroot}'), 169 ('%{_builddir}', '%{_buildcxcdir}')] 170 cxc_macros = _build.copy_init_macros() 172 171 for m in macros_to_copy: 173 _build.config.set_define(m[0], _build.config.macro(m[1])) 172 log.trace('_bset: Cxc: %s <= %s' % (m[0], cxc_macros[m[1]])) 173 cxc_macros[m[0]] = cxc_macros[m[1]] 174 _build.set_macros(cxc_macros) 175 _build.reload() 174 176 _build.make() 175 for m in macros_to_save:176 _build.config.set_define(m, orig_macros[m])177 177 if not _build.macros.get('%{_disable_collecting}'): 178 self.root_copy(_build.config.expand('%{buildcxcroot}'), 179 _build.config.expand('%{_tmpcxcroot}')) 178 self.root_copy(_build.config.expand('%{buildroot}'), 179 _build.config.expand('%{_tmproot}')) 180 _build.set_macros(_build.copy_init_macros()) 181 _build.reload() 180 182 181 183 def build_package(self, _config, _build): … … 190 192 def bset_tar(self, _build): 191 193 tardir = _build.config.expand('%{_tardir}') 192 if self.opts.get_arg('--bset-tar-file') \194 if (self.opts.get_arg('--bset-tar-file') or self.opts.canadian_cross()) \ 193 195 and not _build.macros.get('%{_disable_packaging}'): 194 196 path.mkdir(tardir) … … 381 383 else: 382 384 raise 385 # 386 # Installing ... 387 # 388 log.trace('_bset: installing: deps:%r no-install:%r' % \ 389 (deps is None, self.opts.no_install())) 383 390 if deps is None \ 384 391 and not self.opts.no_install() \ 385 392 and not have_errors: 386 393 for b in builds: 387 if not b.canadian_cross() \ 388 and not b.disabled() \ 389 and not b.macros.get('%{_disable_installing}'): 394 log.trace('_bset: installing: %r' % b.installable()) 395 if b.installable(): 390 396 self.install(b.name(), 391 397 b.config.expand('%{buildroot}'), 392 398 b.config.expand('%{_prefix}')) 399 393 400 if deps is None and \ 394 401 (not self.opts.no_clean() or self.opts.always_clean()): … … 473 480 if not list_bset_cfg_files(opts, configs): 474 481 prefix = opts.defaults.expand('%{_prefix}') 482 if opts.canadian_cross(): 483 opts.disable_install() 484 475 485 if not opts.dry_run() and \ 476 486 not opts.canadian_cross() and \ -
source-builder/sb/version.py
rfba2549 r7385feb 24 24 # 25 25 26 major = 027 minor = 526 major = 4 27 minor = 11 28 28 revision = 0 29 29
Note: See TracChangeset
for help on using the changeset viewer.