mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb/setbuilder: Control buildsets using the --with-* command line option
- Expand macros in buildset file names - Add support to buildsets for `%defineifnot` - Update 6 and 7 to support command line build overrides Closes #4646
This commit is contained in:
parent
22e32ecc27
commit
7d80719f74
@ -4,16 +4,17 @@
|
|||||||
%include 6/rtems-base.bset
|
%include 6/rtems-base.bset
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build gdb first to raise the Python install error as early as possible.
|
# Default RTEMS build. Override on the command line to the
|
||||||
# GDB needs expat so it needs to be built before.
|
# the RSB. For example to test the latest version of gcc use:
|
||||||
#
|
#
|
||||||
|
# --with-rtems-gcc=tools/rtems-gcc-head-newlib-head
|
||||||
|
#
|
||||||
|
%defineifnot with_rtems_dtc devel/dtc-1.6.1-1
|
||||||
|
%defineifnot with_rtems_expat devel/expat-2.4.8-1
|
||||||
|
%defineifnot with_rtems_gmp devel/gmp-6.2.1
|
||||||
|
%defineifnot with_rtems_gdb tools/rtems-gdb-11.2
|
||||||
|
%defineifnot with_rtems_binutils tools/rtems-binutils-2.38
|
||||||
|
%defineifnot with_rtems_gcc tools/rtems-gcc-10-newlib-head
|
||||||
|
%defineifnot with_rtems_tools tools/rtems-tools-6
|
||||||
|
|
||||||
devel/dtc-1.6.1-1
|
tools/rtems-default-tools.bset
|
||||||
|
|
||||||
devel/expat-2.4.8-1
|
|
||||||
devel/gmp-6.2.1
|
|
||||||
tools/rtems-gdb-11.2
|
|
||||||
|
|
||||||
tools/rtems-binutils-2.38
|
|
||||||
tools/rtems-gcc-10-newlib-head
|
|
||||||
tools/rtems-tools-6
|
|
||||||
|
@ -1,16 +1,20 @@
|
|||||||
|
#
|
||||||
|
# Default tools configuration.
|
||||||
|
#
|
||||||
%include 7/rtems-base.bset
|
%include 7/rtems-base.bset
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build gdb first to raise the Python install error as early as possible.
|
# Default RTEMS build. Override on the command line to the
|
||||||
# GDB needs expat so it needs to be built before.
|
# the RSB. For example to test the latest version of gcc use:
|
||||||
#
|
#
|
||||||
|
# --with-rtems-gcc=tools/rtems-gcc-head-newlib-head
|
||||||
|
#
|
||||||
|
%defineifnot with_rtems_dtc devel/dtc-1.6.1-1
|
||||||
|
%defineifnot with_rtems_expat devel/expat-2.4.8-1
|
||||||
|
%defineifnot with_rtems_gmp devel/gmp-6.2.1
|
||||||
|
%defineifnot with_rtems_gdb tools/rtems-gdb-head
|
||||||
|
%defineifnot with_rtems_binutils tools/rtems-binutils-head
|
||||||
|
%defineifnot with_rtems_gcc tools/rtems-gcc-head-newlib-head
|
||||||
|
%defineifnot with_rtems_tools tools/rtems-tools-6
|
||||||
|
|
||||||
devel/dtc-1.6.1-1
|
tools/rtems-default-tools.bset
|
||||||
|
|
||||||
devel/expat-2.4.8-1
|
|
||||||
devel/gmp-6.2.1
|
|
||||||
tools/rtems-gdb-head
|
|
||||||
|
|
||||||
tools/rtems-binutils-head
|
|
||||||
tools/rtems-gcc-head-newlib-head
|
|
||||||
tools/rtems-tools-6
|
|
||||||
|
15
rtems/config/tools/rtems-default-tools.bset
Normal file
15
rtems/config/tools/rtems-default-tools.bset
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#
|
||||||
|
# Default tools build
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build gdb first to raise the Python install error as early as
|
||||||
|
# possible. GDB needs expat so it needs to be built before gdb.
|
||||||
|
#
|
||||||
|
%{with_rtems_dtc}
|
||||||
|
%{with_rtems_expat}
|
||||||
|
%{with_rtems_gmp}
|
||||||
|
%{with_rtems_gdb}
|
||||||
|
%{with_rtems_binutils}
|
||||||
|
%{with_rtems_gcc}
|
||||||
|
%{with_rtems_tools}
|
@ -284,6 +284,7 @@ class buildset:
|
|||||||
line = line[1:b]
|
line = line[1:b]
|
||||||
return line.strip()
|
return line.strip()
|
||||||
|
|
||||||
|
bset = macro_expand(self.macros, bset)
|
||||||
bsetname = bset
|
bsetname = bset
|
||||||
|
|
||||||
if not path.exists(bsetname):
|
if not path.exists(bsetname):
|
||||||
@ -315,15 +316,22 @@ class buildset:
|
|||||||
if ls[0][-1] == ':' and ls[0][:-1] == 'package':
|
if ls[0][-1] == ':' and ls[0][:-1] == 'package':
|
||||||
self.bset_pkg = ls[1].strip()
|
self.bset_pkg = ls[1].strip()
|
||||||
self.macros['package'] = self.bset_pkg
|
self.macros['package'] = self.bset_pkg
|
||||||
elif ls[0][0] == '%':
|
elif ls[0][0] == '%' and (len(ls[0]) > 1 and ls[0][1] != '{'):
|
||||||
def err(msg):
|
def err(msg):
|
||||||
raise error.general('%s:%d: %s' % (self.bset, lc, msg))
|
raise error.general('%s:%d: %s' % (self.bset, lc, msg))
|
||||||
if ls[0] == '%define':
|
if ls[0] == '%define' or ls[0] == '%defineifnot' :
|
||||||
|
name = ls[1].strip()
|
||||||
|
value = None
|
||||||
if len(ls) > 2:
|
if len(ls) > 2:
|
||||||
self.macros.define(ls[1].strip(),
|
value = ' '.join([f.strip() for f in ls[2:]])
|
||||||
' '.join([f.strip() for f in ls[2:]]))
|
if ls[0] == '%defineifnot':
|
||||||
|
if self.macros.defined(name):
|
||||||
|
name = None
|
||||||
|
if name is not None:
|
||||||
|
if value is not None:
|
||||||
|
self.macros.define(name, value)
|
||||||
else:
|
else:
|
||||||
self.macros.define(ls[1].strip())
|
self.macros.define(name)
|
||||||
elif ls[0] == '%undefine':
|
elif ls[0] == '%undefine':
|
||||||
if len(ls) > 2:
|
if len(ls) > 2:
|
||||||
raise error.general('%s:%d: %undefine requires ' \
|
raise error.general('%s:%d: %undefine requires ' \
|
||||||
@ -336,7 +344,7 @@ class buildset:
|
|||||||
elif ls[0] == '%hash':
|
elif ls[0] == '%hash':
|
||||||
sources.hash(ls[1:], self.macros, err)
|
sources.hash(ls[1:], self.macros, err)
|
||||||
else:
|
else:
|
||||||
l = l.strip()
|
l = macro_expand(self.macros, l.strip())
|
||||||
c = build.find_config(l, self.configs)
|
c = build.find_config(l, self.configs)
|
||||||
if c is None:
|
if c is None:
|
||||||
raise error.general('%s:%d: cannot find file: %s' % (self.bset,
|
raise error.general('%s:%d: cannot find file: %s' % (self.bset,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user