From e2bb1db588de669bb2ef42fd6e54e2122b20fcf5 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Wed, 4 Dec 2019 00:34:53 -0500 Subject: Add new waf build. Unlike the older build this keeps files within each BSP now that we have a one-directory-per-bsp model. This supports external BSPs trivially by keeping all files separate from the base build. --- bsps/arm/beagle/py/__init__.py | 0 bsps/arm/beagle/py/bsp.py | 44 + bsps/arm/beagle/py/configure.py | 2 + bsps/arm/beagle/py/option.py | 8 + bsps/arm/beagle/wscript | 64 + bsps/arm/py/__init__.py | 0 bsps/arm/py/base.py | 11 + bsps/arm/py/configure.py | 2 + bsps/arm/py/option.py | 2 + bsps/arm/shared/wscript | 26 + bsps/shared/wscript | 137 ++ bsps/sparc/erc32/py/__init__.py | 0 bsps/sparc/erc32/py/bsp.py | 22 + bsps/sparc/erc32/py/configure.py | 2 + bsps/sparc/erc32/py/option.py | 12 + bsps/sparc/erc32/wscript | 24 + bsps/sparc/py/__init__.py | 0 bsps/sparc/py/base.py | 10 + bsps/sparc/py/configure.py | 2 + bsps/sparc/py/option.py | 12 + bsps/sparc/shared/wscript | 28 + bsps/wscript | 41 + c/wscript | 154 +++ cpukit/libcsupport/wscript | 256 ++++ cpukit/libfs/wscript | 226 ++++ cpukit/libmisc/wscript | 267 ++++ cpukit/libnetworking/wscript | 130 ++ cpukit/librpc/wscript | 56 + cpukit/posix/wscript | 251 ++++ cpukit/rtems/wscript | 172 +++ cpukit/score/wscript | 490 +++++++ cpukit/wscript | 227 ++++ cpukit/zlib/wscript | 35 + py/__init__.py | 0 py/config/TODO | 2 + py/config/__init__.py | 36 + py/config/base.py | 410 ++++++ py/config/bsp.py | 423 ++++++ py/config/feature.py | 30 + py/config/options.py | 283 ++++ py/waf/.gitignore | 1 + py/waf/TODO | 73 + py/waf/__init__.py | 0 py/waf/builder.py | 125 ++ py/waf/compat.py | 20 + py/waf/configure.py | 474 +++++++ py/waf/debug.py | 95 ++ py/waf/docs.py | 130 ++ py/waf/hello.py | 44 + py/waf/info.py | 72 + py/waf/option.py | 2713 ++++++++++++++++++++++++++++++++++++++ py/waf/rtems_config.py | 62 + py/waf/switch.py | 26 + py/waf/test.py | 38 + py/waf/tools.py | 256 ++++ py/waf/waf.py | 437 ++++++ testsuites/fstests/wscript | 94 ++ testsuites/libtests/wscript | 167 +++ testsuites/mptests/wscript | 57 + testsuites/psxtests/wscript | 269 ++++ testsuites/psxtmtests/wscript | 52 + testsuites/smptests/wscript | 21 + testsuites/sptests/wscript | 194 +++ testsuites/tmtests/wscript | 45 + testsuites/wscript | 54 + wscript | 288 ++++ 66 files changed, 9704 insertions(+) create mode 100644 bsps/arm/beagle/py/__init__.py create mode 100644 bsps/arm/beagle/py/bsp.py create mode 100644 bsps/arm/beagle/py/configure.py create mode 100644 bsps/arm/beagle/py/option.py create mode 100644 bsps/arm/beagle/wscript create mode 100644 bsps/arm/py/__init__.py create mode 100644 bsps/arm/py/base.py create mode 100644 bsps/arm/py/configure.py create mode 100644 bsps/arm/py/option.py create mode 100644 bsps/arm/shared/wscript create mode 100644 bsps/shared/wscript create mode 100644 bsps/sparc/erc32/py/__init__.py create mode 100644 bsps/sparc/erc32/py/bsp.py create mode 100644 bsps/sparc/erc32/py/configure.py create mode 100644 bsps/sparc/erc32/py/option.py create mode 100644 bsps/sparc/erc32/wscript create mode 100644 bsps/sparc/py/__init__.py create mode 100644 bsps/sparc/py/base.py create mode 100644 bsps/sparc/py/configure.py create mode 100644 bsps/sparc/py/option.py create mode 100644 bsps/sparc/shared/wscript create mode 100644 bsps/wscript create mode 100644 c/wscript create mode 100644 cpukit/libcsupport/wscript create mode 100644 cpukit/libfs/wscript create mode 100644 cpukit/libmisc/wscript create mode 100644 cpukit/libnetworking/wscript create mode 100644 cpukit/librpc/wscript create mode 100644 cpukit/posix/wscript create mode 100644 cpukit/rtems/wscript create mode 100644 cpukit/score/wscript create mode 100644 cpukit/wscript create mode 100644 cpukit/zlib/wscript create mode 100644 py/__init__.py create mode 100644 py/config/TODO create mode 100644 py/config/__init__.py create mode 100644 py/config/base.py create mode 100644 py/config/bsp.py create mode 100644 py/config/feature.py create mode 100644 py/config/options.py create mode 100644 py/waf/.gitignore create mode 100644 py/waf/TODO create mode 100644 py/waf/__init__.py create mode 100644 py/waf/builder.py create mode 100644 py/waf/compat.py create mode 100644 py/waf/configure.py create mode 100644 py/waf/debug.py create mode 100644 py/waf/docs.py create mode 100644 py/waf/hello.py create mode 100644 py/waf/info.py create mode 100644 py/waf/option.py create mode 100644 py/waf/rtems_config.py create mode 100644 py/waf/switch.py create mode 100644 py/waf/test.py create mode 100644 py/waf/tools.py create mode 100644 py/waf/waf.py create mode 100644 testsuites/fstests/wscript create mode 100644 testsuites/libtests/wscript create mode 100644 testsuites/mptests/wscript create mode 100644 testsuites/psxtests/wscript create mode 100644 testsuites/psxtmtests/wscript create mode 100644 testsuites/smptests/wscript create mode 100644 testsuites/sptests/wscript create mode 100644 testsuites/tmtests/wscript create mode 100644 testsuites/wscript create mode 100644 wscript diff --git a/bsps/arm/beagle/py/__init__.py b/bsps/arm/beagle/py/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bsps/arm/beagle/py/bsp.py b/bsps/arm/beagle/py/bsp.py new file mode 100644 index 0000000000..e6003cd8ce --- /dev/null +++ b/bsps/arm/beagle/py/bsp.py @@ -0,0 +1,44 @@ +class BSP(Base): + bsp = "beagleboardorig" + bsp_source_dir = "beagle" + + # Keep this to a very terse description! + descr = "BeagleBone Original" + + def build(self, c): + c.CFLAGS = ['-mcpu=cortex-a8'] + c.LINKCMDS = ['arm/beagle/start/linkcmds.beagle', 'arm/shared/start/linkcmds.armv4', 'arm/shared/start/linkcmds.base'] +# c.LINKCMDS = ['src/lib/libbsp/arm/beagle/startup/linkcmds.beagle', 'src/lib/libbsp/arm/shared/startup/linkcmds.armv4', 'src/lib/libbsp/arm/shared/startup/linkcmds.base'] + c.BSP_SOURCE_DIR = "beagle" + + def header(self, c): + c.CONSOLE_USE_INTERRUPTS = False + c.ENABLE_SIS_QUIRKS = Default + c.SIMSPARC_FAST_IDLE = Default + c.BSP_PRESS_KEY_FOR_RESET = Default +# c.BSP_RESET_BOARD_AT_EXIT = Default +# c.BSP_PRINT_EXCEPTION_CONTEXT = Default + c.BSP_VERBOSE_FATAL_EXTENSION = Default + c.CONSOLE_POLLED = Default + c.CONSOLE_BAUD = Default + c.IS_DM3730 = True + + +""" +class beagle_shared(Base): + def build(self, c): + c.CFLAGS = ['-mcpu=cortex-a8'] + c.LINKCMDS = ['src/lib/libbsp/arm/beagle/startup/linkcmds.beagle', 'src/lib/libbsp/arm/shared/startup/linkcmds.armv4', 'src/lib/libbsp/arm/shared/startup/linkcmds.base'] + + def header(self, c): + c.CONSOLE_POLLED = Default + c.CONSOLE_BAUD = Default + +class beagleboardorig(beagle_shared): + name = "arm/beagleboardorig" + + def header(self, c): + c.IS_DM3730 = True + +""" + diff --git a/bsps/arm/beagle/py/configure.py b/bsps/arm/beagle/py/configure.py new file mode 100644 index 0000000000..0a97ae74b7 --- /dev/null +++ b/bsps/arm/beagle/py/configure.py @@ -0,0 +1,2 @@ +def configure(ctx): + pass diff --git a/bsps/arm/beagle/py/option.py b/bsps/arm/beagle/py/option.py new file mode 100644 index 0000000000..43c15361a6 --- /dev/null +++ b/bsps/arm/beagle/py/option.py @@ -0,0 +1,8 @@ +# Add your options here. + +class IS_DM3730(Boolean): + value = False + tag = ["build"] + undef = True + descr = "true if SOC is DM3730" + diff --git a/bsps/arm/beagle/wscript b/bsps/arm/beagle/wscript new file mode 100644 index 0000000000..7452a4d26f --- /dev/null +++ b/bsps/arm/beagle/wscript @@ -0,0 +1,64 @@ +def build(ctx): + srcnode = ctx.srcnode.abspath() + + source = [ +# Shared +# "../../shared/dev/getentropy/getentropy-cpucounter.c", + "../../shared/start/bsp-fdt.c", +# "../../shared/start/bspfatal-default.c", + "../../shared/start/bspgetworkarea-default.c", +# "../../shared/start/sbrk.c", + "../../shared/start/stackalloc.c", + "../../shared/dev/gpio/gpio-support.c", + "../../shared/dev/btimer/btimer-stub.c", + "../../shared/dev/cpucounter/cpucounterfrequency.c", + "../../shared/dev/cpucounter/cpucounterread.c", + +# "../shared/start/bsp-start-memcpy.S", +# "../shared/cp15/arm-cp15-set-exception-handler.c", +# "../shared/cp15/arm-cp15-set-ttb-entries.c", + +# Startup + "../beagle/start/bspreset.c", + "../beagle/start/bspstart.c", + "../beagle/start/bspstarthooks.c", + "../beagle/start/bspstartmmu.c", + +# IRQ +# "../../shared/irq/irq-default-handler.c", + "../beagle/irq/irq.c", + +# Console +# "../../shared/dev/serial/legacy-console.c", +# "../../shared/dev/serial/legacy-console-control.c", +# "../../shared/dev/serial/legacy-console-select.c", + "../beagle/console/console-config.c", + +# I2C + "../beagle/i2c/bbb-i2c.c", + +# GPIO + "../beagle/gpio/bbb-gpio.c", + +#pwm + "../beagle/pwm/pwm.c", + +#RTC + "../beagle/rtc/rtc.c", + "../../shared/dev/rtc/rtc-support.c", +# Clock + "../beagle/clock/clock.c", + +# Cache +# "../shared/cache/cache-cp15.c", +] + + ctx.bsp.start(["../shared/start/start.S"]) + + ctx.bsp.source( + source, +# includes = ["%s/bsps/arm/beagle/include" % srcnode, "COLDBEER"], + features = "src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_shared src_include_networking" + ) + + diff --git a/bsps/arm/py/__init__.py b/bsps/arm/py/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bsps/arm/py/base.py b/bsps/arm/py/base.py new file mode 100644 index 0000000000..8502e370f5 --- /dev/null +++ b/bsps/arm/py/base.py @@ -0,0 +1,11 @@ +from py.config import Default, Config + + +class Base(Config): + arch = name = "arm" + conflicts=("clang",) + + def build(self, c): +# c.LINK_START = ['${RTEMS_BSP}/start.o', 'crti.o', 'crtbegin.o', '-e', '_start'] + c.LINK_START = ['crti.o', 'crtbegin.o', '-e', '_start'] + c.LINK_END = ['crtend.o', 'crtn.o'] diff --git a/bsps/arm/py/configure.py b/bsps/arm/py/configure.py new file mode 100644 index 0000000000..0a97ae74b7 --- /dev/null +++ b/bsps/arm/py/configure.py @@ -0,0 +1,2 @@ +def configure(ctx): + pass diff --git a/bsps/arm/py/option.py b/bsps/arm/py/option.py new file mode 100644 index 0000000000..09e2a6abd3 --- /dev/null +++ b/bsps/arm/py/option.py @@ -0,0 +1,2 @@ +# Add your options here. + diff --git a/bsps/arm/shared/wscript b/bsps/arm/shared/wscript new file mode 100644 index 0000000000..1004f0ff4f --- /dev/null +++ b/bsps/arm/shared/wscript @@ -0,0 +1,26 @@ +from imp import new_module +from os.path import basename + + +def build(ctx): + source = [] + + source += [ + "start/bsp-start-memcpy.S", + "cp15/arm-cp15-set-exception-handler.c", + "cp15/arm-cp15-set-ttb-entries.c", + "cache/cache-cp15.c" + ] + +# ctx.bsp.start(["start/start.S"]) + + ctx.bsp.source( + source, + features = "src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_shared", +# src_include_networking src_include_score src_include_bsp_common src_include_bsp", +# includes = ["%s/bsps/%s/%s/include/" % (ctx.srcnode.abspath(), ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP)] + ) + + + + diff --git a/bsps/shared/wscript b/bsps/shared/wscript new file mode 100644 index 0000000000..13695b6d49 --- /dev/null +++ b/bsps/shared/wscript @@ -0,0 +1,137 @@ +from imp import new_module +from os.path import basename + + +def build(ctx): + source = [] + + # Nothing below this will work on the host. + if ctx.variant == "host": + return + + # version.c + source_version = ["rtems-version.c"] + ctx.bsp.source( + source_version, + alias="version", + features="src_include src_include_rtems src_include_score", + cflags=[ + "-DRTEMS_VERSION=\"%s\"" % ctx.env.RTEMS_VERSION + ] + ) + + source += [ + "cache/nocache.c", + "dev/display/disp_hcms29xx.c", + "dev/display/font_hcms29xx.c", + "dev/flash/am29lv160.c", + "dev/getentropy/getentropy-cpucounter.c", + "dev/i2c/i2c-2b-eeprom.c", + "dev/i2c/i2c-ds1621.c", + "dev/i2c/i2c-sc620.c", + "dev/i2c/spi-flash-m25p40.c", + "dev/i2c/spi-fram-fm25l256.c", + "dev/i2c/spi-memdrv.c", + "dev/i2c/spi-sd-card.c", + "dev/ide/ata.c", + "dev/ide/ata_util.c", + "dev/ide/ide_controller.c", + "dev/rtc/ds1375.c", + "dev/rtc/icm7170.c", + "dev/rtc/icm7170_reg.c", + "dev/rtc/icm7170_reg2.c", + "dev/rtc/icm7170_reg4.c", + "dev/rtc/icm7170_reg8.c", + "dev/rtc/m48t08.c", + "dev/rtc/m48t08_reg.c", + "dev/rtc/m48t08_reg2.c", + "dev/rtc/m48t08_reg4.c", + "dev/rtc/m48t08_reg8.c", + "dev/rtc/mc146818a.c", + "dev/rtc/mc146818a_ioreg.c", + "dev/rtc/rtcprobe.c", + "dev/serial/legacy-console-control.c", + "dev/serial/legacy-console-select.c", + "dev/serial/legacy-console.c", + "dev/serial/mc68681.c", + "dev/serial/mc68681_baud.c", + "dev/serial/mc68681_reg.c", + "dev/serial/mc68681_reg2.c", + "dev/serial/mc68681_reg4.c", + "dev/serial/mc68681_reg8.c", + "dev/serial/ns16550-context.c", + "dev/serial/ns16550.c", + "dev/serial/serprobe.c", + "dev/serial/z85c30.c", + "dev/serial/z85c30_reg.c", + "irq/irq-default-handler.c", + "irq/irq-generic.c", + "irq/irq-info.c", + "irq/irq-legacy.c", + "irq/irq-lock.c", + "irq/irq-server.c", + "irq/irq-shell.c", + "net/cs8900.c", + "net/dec21140.c", + "net/elnk.c", + "net/greth2.c", + "net/i82586.c", + "net/if_dc.c", + "net/if_fxp.c", + "net/open_eth.c", + "net/smc91111.c", + "net/sonic.c", + "start/bootcard.c", + "start/bspreset-empty.c", + "start/bspfatal-default.c", + "start/sbrk.c" + ] + + ctx.bsp.source( + source, + features = "src_include src_include_rtems src_include_networking src_include_score src_include_bsp_common src_include_bsp src_include_bsp_arch", +# includes = ["%s/bsps/%s/%s/include/" % (ctx.srcnode.abspath(), ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP)] + ) + + + + + + +""" + # Open the correct sub-wscript and execute build() as waf does not support + # loading arbitrary wscripts. + path = "%s/c/" % ctx.srcnode.abspath() + with open("%s/wscript_%s" % (path, ctx.env.RTEMS_ARCH), "r") as fp: + module = new_module("RTEMS_MODULE") + exec(compile(fp.read(), "%swscript_%s" % (path, ctx.env.RTEMS_ARCH), "exec"), module.__dict__) + module.build(ctx) + + ctx( + target = "rtemsbsp", + use = [ + "auto_libbsp_objects" + ], + includes = ["%s/include/libchip" % ctx.srcnode.abspath()], + features = "c cstlib", + install_path = ctx.env.LIBDIR + ) + + # First file is always installed as "linkcmds" + # XXX: This needs to be removed eventually by fixing the filenames. + if ctx.env.LINKCMDS: + ctx.copy_or_subst( + ctx.env.LINKCMDS[0], + "linkcmds", + "linkcmds_linkcmds" + ) + + for file in ctx.env.LINKCMDS[1:]: + base = basename(file) + ctx.copy_or_subst( + file, + base, + "linkcmds_base" + ) + +""" diff --git a/bsps/sparc/erc32/py/__init__.py b/bsps/sparc/erc32/py/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bsps/sparc/erc32/py/bsp.py b/bsps/sparc/erc32/py/bsp.py new file mode 100644 index 0000000000..897c6c1067 --- /dev/null +++ b/bsps/sparc/erc32/py/bsp.py @@ -0,0 +1,22 @@ +class BSP(Base): + bsp = "erc32" + bsp_source_dir = "erc32" + + # Keep this to a very terse description! + descr = "SPARC ERC32" + + def build(self, c): + c.CFLAGS = ['-mcpu=cypress'] + c.LINKCMDS = ['sparc/erc32/start/linkcmds', + 'sparc/shared/start/linkcmds.base'] + c.BSP_SOURCE_DIR = "erc32" + + def header(self, c): + c.CONSOLE_USE_INTERRUPTS = False + c.ENABLE_SIS_QUIRKS = Default + c.SIMSPARC_FAST_IDLE = Default + c.BSP_PRESS_KEY_FOR_RESET = Default + c.BSP_RESET_BOARD_AT_EXIT = Default + c.BSP_PRINT_EXCEPTION_CONTEXT = Default + c.BSP_VERBOSE_FATAL_EXTENSION = Default + diff --git a/bsps/sparc/erc32/py/configure.py b/bsps/sparc/erc32/py/configure.py new file mode 100644 index 0000000000..0a97ae74b7 --- /dev/null +++ b/bsps/sparc/erc32/py/configure.py @@ -0,0 +1,2 @@ +def configure(ctx): + pass diff --git a/bsps/sparc/erc32/py/option.py b/bsps/sparc/erc32/py/option.py new file mode 100644 index 0000000000..681e9269e5 --- /dev/null +++ b/bsps/sparc/erc32/py/option.py @@ -0,0 +1,12 @@ +# Add your options here. + + +class ENABLE_SIS_QUIRKS(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If defined, then the sis simulator specific code in the bsp will be enabled. +In particular, sis requires special initialization not used on real erc32 + """ + diff --git a/bsps/sparc/erc32/wscript b/bsps/sparc/erc32/wscript new file mode 100644 index 0000000000..772f16283b --- /dev/null +++ b/bsps/sparc/erc32/wscript @@ -0,0 +1,24 @@ +def build(ctx): + source = [] + + source += [ + "btimer/btimer.c", + "clock/ckinit.c", + "console/debugputs.c", + "console/erc32_console.c", + "gnatsupp/gnatsupp.c", + "net/erc32sonic.c", + "start/boardinit.S", + "start/bspdelay.c", + "start/bspidle.c", + "start/bspstart.c", + "start/erc32mec.c", + "start/setvec.c", + "start/spurious.c", + ] + + ctx.bsp.source( + source, + features = "src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_shared src_include_networking", + ) + diff --git a/bsps/sparc/py/__init__.py b/bsps/sparc/py/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bsps/sparc/py/base.py b/bsps/sparc/py/base.py new file mode 100644 index 0000000000..85bc268bcf --- /dev/null +++ b/bsps/sparc/py/base.py @@ -0,0 +1,10 @@ +from py.config import Default, Config + + +class Base(Config): + arch = name = "sparc" + conflicts=("clang",) + + def build(self, c): + c.LINK_START = ['crti.o', 'crtbegin.o'] + c.LINK_END = ['crtend.o', 'crtn.o'] diff --git a/bsps/sparc/py/configure.py b/bsps/sparc/py/configure.py new file mode 100644 index 0000000000..0a97ae74b7 --- /dev/null +++ b/bsps/sparc/py/configure.py @@ -0,0 +1,2 @@ +def configure(ctx): + pass diff --git a/bsps/sparc/py/option.py b/bsps/sparc/py/option.py new file mode 100644 index 0000000000..de45f1be18 --- /dev/null +++ b/bsps/sparc/py/option.py @@ -0,0 +1,12 @@ +# Add your options here. + +class SIMSPARC_FAST_IDLE(Boolean): + value = False + tag = ["build"] + undef = True + descr = """ +If defined, speed up the clock ticks while the idle task is running so time +spent in the idle task is minimized. This significantly reduces the wall time +required to execute the rtems test suites. + """ + diff --git a/bsps/sparc/shared/wscript b/bsps/sparc/shared/wscript new file mode 100644 index 0000000000..91c3b975d2 --- /dev/null +++ b/bsps/sparc/shared/wscript @@ -0,0 +1,28 @@ +from imp import new_module +from os.path import basename + + +def build(ctx): + source = [] + + source += [ + "gnatcommon.c", + "irq/bsp_isr_handler.c", + "irq/irq-shared.c", + "start/bsp_fatal_exit.c", + "start/bsp_fatal_halt.c", + "start/bspgetworkarea.c", + ] + + ctx.bsp.start(["start/start.S"]) + + ctx.bsp.source( + source, + features = "src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_shared", +# src_include_networking src_include_score src_include_bsp_common src_include_bsp", +# includes = ["%s/bsps/%s/%s/include/" % (ctx.srcnode.abspath(), ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP)] + ) + + + + diff --git a/bsps/wscript b/bsps/wscript new file mode 100644 index 0000000000..8630435bfc --- /dev/null +++ b/bsps/wscript @@ -0,0 +1,41 @@ +from imp import new_module +from os.path import basename + + +def build(ctx): + source = [] + + ctx.recurse("shared") + ctx.recurse("%s/shared" % ctx.env.RTEMS_ARCH) + ctx.recurse("%s/%s" % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP)) + + + ctx( + target = "rtemsbsp", + use = [ + "auto_libbsp_objects" + ], + includes = ["%s/include/libchip" % ctx.srcnode.abspath()], + features = "c cstlib", + install_path = ctx.env.LIBDIR +# use = "linkcmds_linkcmds linkcmds_base" + ) + + # First file is always installed as "linkcmds" + # XXX: This needs to be removed eventually by fixing the filenames. +# if ctx.env.LINKCMDS: + + ctx.copy_or_subst( + ctx.env.LINKCMDS[0], + "linkcmds", + "linkcmds_linkcmds" + ) + + + for file in ctx.env.LINKCMDS[1:]: + base = basename(file) + ctx.copy_or_subst( + file, + base, + "linkcmds_base" + ) diff --git a/c/wscript b/c/wscript new file mode 100644 index 0000000000..357a26b240 --- /dev/null +++ b/c/wscript @@ -0,0 +1,154 @@ +from imp import new_module +from os.path import basename + + +def build(ctx): + source = [] + + # Nothing below this will work on the host. + if ctx.variant == "host": + return + + # version.c + source_version = ["src/support/version.c"] + ctx.bsp.source( + source_version, + alias="version", + features="src_include", + cflags=[ + "-DRTEMS_VERSION=\"%s\"" % ctx.env.RTEMS_VERSION + ] + ) + + + source_networking = [ + "src/libchip/network/cs8900.c", + "src/libchip/network/dec21140.c", + "src/libchip/network/elnk.c", + "src/libchip/network/greth.c", + "src/libchip/network/i82586.c", + "src/libchip/network/if_dc.c", + "src/libchip/network/if_fxp.c", + "src/libchip/network/open_eth.c", + "src/libchip/network/smc91111.c", + "src/libchip/network/sonic.c" + ] + ctx.bsp.networking( + source_networking, + features="src_include src_include_networking src_include_libchip", + defines=["__INSIDE_RTEMS_BSD_TCPIP_STACK__", "_KERNEL", "__BSD_VISIBLE", "__RTEMS_HAVE_DECL_SIGALTSTACK__"] + ) + + + source_mp = [ + "src/libchip/shmdr/addlq.c", + "src/libchip/shmdr/cnvpkt.c", + "src/libchip/shmdr/getlq.c", + "src/libchip/shmdr/dump.c", + "src/libchip/shmdr/fatal.c", + "src/libchip/shmdr/getpkt.c", + "src/libchip/shmdr/init.c", + "src/libchip/shmdr/initlq.c", + "src/libchip/shmdr/intr.c", + "src/libchip/shmdr/mpisr.c", + "src/libchip/shmdr/poll.c", + "src/libchip/shmdr/receive.c", + "src/libchip/shmdr/retpkt.c", + "src/libchip/shmdr/send.c" + ] + ctx.bsp.mp( + source_mp, + features="src_include", + includes = ["%s/c/src/libchip/shmdr" % ctx.srcnode.abspath()] + ) + + + source_ata = [ + "src/libchip/ide/ata.c", + "src/libchip/ide/ata_util.c", + ] + ctx.bsp.source( + source_ata, + features="src_include src_include_libchip" + ) + + + source += [ + "src/libchip/display/disp_hcms29xx.c", + "src/libchip/display/font_hcms29xx.c", + "src/libchip/flash/am29lv160.c", + "src/libchip/i2c/i2c-2b-eeprom.c", + "src/libchip/i2c/i2c-ds1621.c", + "src/libchip/i2c/spi-flash-m25p40.c", + "src/libchip/i2c/spi-fram-fm25l256.c", + "src/libchip/i2c/spi-memdrv.c", + "src/libchip/i2c/spi-sd-card.c", + "src/libchip/ide/ide_controller.c", + "src/libchip/rtc/ds1375.c", + "src/libchip/rtc/icm7170.c", + "src/libchip/rtc/icm7170_reg.c", + "src/libchip/rtc/icm7170_reg2.c", + "src/libchip/rtc/icm7170_reg4.c", + "src/libchip/rtc/icm7170_reg8.c", + "src/libchip/rtc/m48t08.c", + "src/libchip/rtc/m48t08_reg.c", + "src/libchip/rtc/m48t08_reg2.c", + "src/libchip/rtc/m48t08_reg4.c", + "src/libchip/rtc/m48t08_reg8.c", + "src/libchip/rtc/mc146818a.c", + "src/libchip/rtc/mc146818a_ioreg.c", + "src/libchip/rtc/rtcprobe.c", + "src/libchip/serial/mc68681.c", + "src/libchip/serial/mc68681_baud.c", + "src/libchip/serial/mc68681_reg.c", + "src/libchip/serial/mc68681_reg2.c", + "src/libchip/serial/mc68681_reg4.c", + "src/libchip/serial/mc68681_reg8.c", + "src/libchip/serial/ns16550.c", + "src/libchip/serial/serprobe.c", + "src/libchip/serial/z85c30.c", + "src/libchip/serial/z85c30_reg.c" + ] + ctx.bsp.source( + source, + features="src_include", + includes = ["%s/include/libchip" % ctx.srcnode.abspath()] + ) + + + # Open the correct sub-wscript and execute build() as waf does not support + # loading arbitrary wscripts. + path = "%s/c/" % ctx.srcnode.abspath() + with open("%s/wscript_%s" % (path, ctx.env.RTEMS_ARCH), "r") as fp: + module = new_module("RTEMS_MODULE") + exec(compile(fp.read(), "%swscript_%s" % (path, ctx.env.RTEMS_ARCH), "exec"), module.__dict__) + module.build(ctx) + + ctx( + target = "rtemsbsp", + use = [ + "auto_libbsp_objects" + ], + includes = ["%s/include/libchip" % ctx.srcnode.abspath()], + features = "c cstlib", + install_path = ctx.env.LIBDIR + ) + + # First file is always installed as "linkcmds" + # XXX: This needs to be removed eventually by fixing the filenames. + if ctx.env.LINKCMDS: + ctx.copy_or_subst( + ctx.env.LINKCMDS[0], + "linkcmds", + "linkcmds_linkcmds" + ) + + for file in ctx.env.LINKCMDS[1:]: + base = basename(file) + ctx.copy_or_subst( + file, + base, + "linkcmds_base" + ) + + diff --git a/cpukit/libcsupport/wscript b/cpukit/libcsupport/wscript new file mode 100644 index 0000000000..2ab7114e63 --- /dev/null +++ b/cpukit/libcsupport/wscript @@ -0,0 +1,256 @@ +def build(ctx): + source = [] + + source_newlib= [ + "src/readv.c", + "src/writev.c" + ] + ctx.cpu.newlib( + source_newlib, + features="src_include src_include_rtems src_include_score" + ) + + # ERROR_C_FILES + source += [ + "src/error.c", + "src/__assert.c" + ] + + # ASSOCIATION_C_FILES + source += [ + "src/assoclocalbyname.c", + "src/assoclocalbyremotebitfield.c", + "src/assoclocalbyremote.c", + "src/assocnamebad.c", + "src/assocnamebylocalbitfield.c", + "src/assocnamebylocal.c", + "src/assocnamebyremotebitfield.c", + "src/assocnamebyremote.c", + "src/assocptrbylocal.c", + "src/assocptrbyname.c", + "src/assocptrbyremote.c", + "src/assocremotebylocalbitfield.c", + "src/assocremotebylocal.c", + "src/assocremotebyname.c" + ] + + # BASE_FS_C_FILES + source += [ + "src/base_fs.c", + "src/mount.c", + "src/unmount.c", + "src/libio.c", + "src/mount-mgr.c", + "src/mount-mktgt.c", + "src/libio_init.c", + "src/privateenv.c", + "src/open_dev_console.c", + "src/__usrenv.c", + "src/rtems_mkdir.c" + ] + + + # TERMIOS_C_FILES + source += [ + "src/cfgetispeed.c", + "src/cfgetospeed.c", + "src/cfsetispeed.c", + "src/cfsetospeed.c", + "src/tcgetattr.c", + "src/tcsetattr.c", + "src/tcdrain.c", + "src/tcflow.c", + "src/tcflush.c", + "src/tcgetpgrp.c", + "src/tcsendbreak.c", + "src/tcsetpgrp.c", + "src/termios.c", + "src/termiosinitialize.c", + "src/termios_baud2index.c", + "src/termios_baud2num.c", + "src/termios_num2baud.c", + "src/termios_setinitialbaud.c", + "src/termios_baudtable.c", + "src/termios_setbestbaud.c" + ] + + # SYSTEM_CALL_C_FILES + source += [ + "src/open.c", + "src/close.c", + "src/read.c", + "src/write.c", + "src/write_r.c", + "src/lseek.c", + "src/ioctl.c", + "src/mkdir.c", + "src/mknod.c", + "src/mkfifo.c", + "src/rmdir.c", + "src/chdir.c", + "src/chmod.c", + "src/fchdir.c", + "src/fchmod.c", + "src/fchown.c", + "src/chown.c", + "src/link.c", + "src/unlink.c", + "src/umask.c", + "src/ftruncate.c", + "src/utime.c", + "src/fstat.c", + "src/fcntl.c", + "src/fpathconf.c", + "src/getdents.c", + "src/fsync.c", + "src/fdatasync.c", + "src/dup.c", + "src/dup2.c", + "src/symlink.c", + "src/readlink.c", + "src/chroot.c", + "src/sync.c", + "src/_rename_r.c", + "src/statvfs.c", + "src/utimes.c", + "src/lchown.c" + ] + + # ID_C_FILES + source += [ + "src/getegid.c", + "src/geteuid.c", + "src/getgid.c", + "src/getgroups.c", + "src/getlogin.c", + "src/getpgrp.c", + "src/getpid.c", + "src/getppid.c", + "src/getuid.c", + "src/setgid.c", + "src/setuid.c", + "src/seteuid.c", + "src/setpgid.c", + "src/setsid.c", + "src/setegid.c" + ] + + # MALLOC_C_FILES + source += [ + "src/_calloc_r.c", + "src/_free_r.c", + "src/_malloc_r.c", + "src/_realloc_r.c", + "src/calloc.c", + "src/free.c", + "src/malloc.c", + "src/malloc_deferred.c", + "src/malloc_dirtier.c", + "src/malloc_initialize.c", + "src/malloc_walk.c", + "src/mallocfreespace.c", + "src/mallocgetheapptr.c", + "src/mallocinfo.c", + "src/mallocsetheapptr.c", + "src/posix_memalign.c", + "src/realloc.c", + "src/rtems_heap_extend.c", + "src/rtems_memalign.c", + ] + + + # TERMINAL_IDENTIFICATION_C_FILES + source += [ + "src/isatty_r.c" + ] + + # LIBC_GLUE_C_FILES + source += [ + "src/__getpid.c", + "src/__gettod.c", + "src/__times.c", + "src/truncate.c", + "src/access.c", + "src/stat.c", + "src/lstat.c", + "src/pathconf.c", + "src/newlibc_reent.c", + "src/newlibc_exit.c", + "src/kill_noposix.c", + "src/utsname.c" + ] + + # BSD_LIBC_C_FILES + source += [ + "src/issetugid.c" + ] + + source += [ + "src/gxx_wrappers.c", + "src/getchark.c", + "src/printk.c", + "src/printk_plugin.c", + "src/putk.c", + "src/vprintk.c", + ] + + source += [ + "src/getpagesize.c", + "src/getrusage.c", + "src/flockfile.c", + "src/funlockfile.c", + "src/ftrylockfile.c" + ] + + source += [ + "src/getpwent.c", + "src/clonenode.c", + "src/ctermid.c", + "src/rtems_putc.c", + "src/libio_exit.c", + "src/rtems_heap_null_extend.c", + "src/sup_fs_check_permissions.c", + "src/sup_fs_deviceio.c", + "src/sup_fs_eval_path.c", + "src/sup_fs_eval_path_generic.c", + "src/sup_fs_exist_in_same_instance.c", + "src/sup_fs_location.c", + "src/sup_fs_mount_iterate.c", + "src/sup_fs_next_token.c", + "src/rtems_heap_extend_via_sbrk.c", + "src/resource_snapshot.c", + "src/rtems_heap_greedy.c", + "src/printf_plugin.c", + "src/freenode.c", + "src/cachealignedalloc.c", + "src/pwdgrp.c", + "src/getgrent.c", + "src/getgrnam.c", + "src/cachecoherentalloc.c", + # New files not sorted into categories above! + "src/arc4random_getentropy_fail.c", + "src/assoc32tostring.c", + "src/assocthreadstatestostring.c", + "src/cfmakeraw.c", + "src/cfmakesane.c", + "src/cfsetspeed.c", + "src/clock.c", + "src/consolesimple.c", + "src/consolesimpleread.c", + "src/consolesimpletask.c", + "src/posix_devctl.c", + "src/print_fprintf.c", + "src/print_printf.c", + "src/printerfprintfputc.c", + "src/printertask.c", + "src/realpath.c", + "src/setgroups.c", + "src/uenvgetgroups.c", + ] + + + ctx.cpu.source( + source, + alias="csupport", + features="src_include src_include_rtems src_include_score" + ) diff --git a/cpukit/libfs/wscript b/cpukit/libfs/wscript new file mode 100644 index 0000000000..3d6ce2c042 --- /dev/null +++ b/cpukit/libfs/wscript @@ -0,0 +1,226 @@ +def build(ctx): + source = [] + + source_devfs = [ + "src/devfs/devclose.c", + "src/devfs/devfs_eval.c", + "src/devfs/devfs_init.c", + "src/devfs/devfs_mknod.c", + "src/devfs/devfs_show.c", + "src/devfs/devioctl.c", + "src/devfs/devopen.c", + "src/devfs/devread.c", + "src/devfs/devstat.c", + "src/devfs/devwrite.c", + ] + + ctx.cpu.source( + source_devfs, + alias="libfs_devfs", + features="src_include src_include_rtems src_include_score" + ) + + source_dosfs = [ + "src/dosfs/fat_fat_operations.c", + "src/dosfs/fat_file.c", + "src/dosfs/fat.c", + "src/dosfs/msdos_conv_default.c", + "src/dosfs/msdos_conv_utf8.c", + "src/dosfs/msdos_conv.c", + "src/dosfs/msdos_create.c", + "src/dosfs/msdos_dir.c", + "src/dosfs/msdos_eval.c", + "src/dosfs/msdos_file.c", + "src/dosfs/msdos_format.c", + "src/dosfs/msdos_free.c", + "src/dosfs/msdos_fsunmount.c", + "src/dosfs/msdos_handlers_dir.c", + "src/dosfs/msdos_handlers_file.c", + "src/dosfs/msdos_init.c", + "src/dosfs/msdos_initsupp.c", + "src/dosfs/msdos_misc.c", + "src/dosfs/msdos_mknod.c", + "src/dosfs/msdos_rename.c", + "src/dosfs/msdos_rmnod.c", + "src/dosfs/msdos_statvfs.c", + ] + + ctx.cpu.source( + source_dosfs, + alias="libfs_dosfs", + features="src_include src_include_rtems src_include_score" + ) + + source_imfs = [ + "src/imfs/deviceio.c", + "src/imfs/imfs_chown.c", + "src/imfs/imfs_config.c", + "src/imfs/imfs_creat.c", + "src/imfs/imfs_dir_default.c", + "src/imfs/imfs_dir_minimal.c", + "src/imfs/imfs_dir.c", + "src/imfs/imfs_eval.c", + "src/imfs/imfs_fchmod.c", + "src/imfs/imfs_fifo.c", + "src/imfs/imfs_fsunmount.c", + "src/imfs/imfs_handlers_device.c", + "src/imfs/imfs_init.c", + "src/imfs/imfs_initsupp.c", + "src/imfs/imfs_linfile.c", + "src/imfs/imfs_link.c", + "src/imfs/imfs_load_tar.c", + "src/imfs/imfs_make_generic_node.c", + "src/imfs/imfs_memfile.c", + "src/imfs/imfs_mknod.c", + "src/imfs/imfs_mount.c", + "src/imfs/imfs_node.c", + "src/imfs/imfs_rename.c", + "src/imfs/imfs_rmnod.c", + "src/imfs/imfs_stat_file.c", + "src/imfs/imfs_stat.c", + "src/imfs/imfs_symlink.c", + "src/imfs/imfs_unmount.c", + "src/imfs/imfs_utime.c", + "src/imfs/ioman.c", + ] + + ctx.cpu.source( + source_imfs, + alias="libfs_imfs", + features="src_include src_include_rtems src_include_score" + ) + + source_pipe = [ + "src/pipe/fifo.c", + "src/pipe/pipe.c" + ] + + ctx.cpu.source( + source_pipe, + alias="libfs_pipe", + features="src_include src_include_rtems src_include_score" + ) + + source_rfs = [ + "src/rfs/rtems-rfs-bitmaps.c", + "src/rfs/rtems-rfs-block.c", + "src/rfs/rtems-rfs-buffer-bdbuf.c", + "src/rfs/rtems-rfs-buffer.c", + "src/rfs/rtems-rfs-dir-hash.c", + "src/rfs/rtems-rfs-dir.c", + "src/rfs/rtems-rfs-file-system.c", + "src/rfs/rtems-rfs-file.c", + "src/rfs/rtems-rfs-format.c", + "src/rfs/rtems-rfs-group.c", + "src/rfs/rtems-rfs-inode.c", + "src/rfs/rtems-rfs-link.c", + "src/rfs/rtems-rfs-mutex.c", + "src/rfs/rtems-rfs-rtems-dev.c", + "src/rfs/rtems-rfs-rtems-dir.c", + "src/rfs/rtems-rfs-rtems-file.c", + "src/rfs/rtems-rfs-rtems-utils.c", + "src/rfs/rtems-rfs-rtems.c", + "src/rfs/rtems-rfs-shell.c", + "src/rfs/rtems-rfs-trace.c", + ] + + ctx.cpu.source( + source_rfs, + alias="libfs_rfs", + features="src_include src_include_rtems src_include_score" + ) + + + source_nfs = [ + "src/nfsclient/proto/mount_prot_xdr.c", + "src/nfsclient/proto/nfs_prot_xdr.c", + "src/nfsclient/src/nfs.c", + "src/nfsclient/src/rpcio.c", + "src/nfsclient/src/sock_mbuf.c", + "src/nfsclient/src/xdr_mbuf.c", + ] + + ctx.cpu.source( + source_nfs, + alias="libfs_nfs", + features="src_include src_include_rtems src_include_score src_include_networking", + ) + + + source_jffs2 = [ + "src/jffs2/src/build.c", + "src/jffs2/src/compat-crc32.c", + "src/jffs2/src/compr.c", + "src/jffs2/src/compr_rtime.c", + "src/jffs2/src/compr_zlib.c", + "src/jffs2/src/debug.c", + "src/jffs2/src/dir-rtems.c", + "src/jffs2/src/erase.c", + "src/jffs2/src/flashio.c", + "src/jffs2/src/fs-rtems.c", + "src/jffs2/src/gc.c", + "src/jffs2/src/malloc-rtems.c", + "src/jffs2/src/nodelist.c", + "src/jffs2/src/nodemgmt.c", + "src/jffs2/src/read.c", + "src/jffs2/src/readinode.c", + "src/jffs2/src/scan.c", + "src/jffs2/src/write.c", + ] + + ctx.cpu.source( + source_jffs2, + alias="libfs_jffs2", + features="src_include src_include_rtems src_include_score", + includes=["%s/cpukit/libfs/src/jffs2/include/" % ctx.srcnode.abspath()], + ) + + + + source += [ + "src/defaults/default_are_nodes_equal.c", + "src/defaults/default_chown.c", + "src/defaults/default_clone.c", + "src/defaults/default_close.c", + "src/defaults/default_eval_path.c", + "src/defaults/default_fchmod.c", + "src/defaults/default_fcntl.c", + "src/defaults/default_freenode.c", + "src/defaults/default_fstat.c", + "src/defaults/default_fsunmount.c", + "src/defaults/default_fsync_success.c", + "src/defaults/default_fsync.c", + "src/defaults/default_ftruncate_directory.c", + "src/defaults/default_ftruncate.c", + "src/defaults/default_handlers.c", + "src/defaults/default_ioctl.c", + "src/defaults/default_kqfilter.c", + "src/defaults/default_link.c", + "src/defaults/default_lock_and_unlock.c", + "src/defaults/default_lseek_directory.c", + "src/defaults/default_lseek_file.c", + "src/defaults/default_lseek.c", + "src/defaults/default_mknod.c", + "src/defaults/default_mmap.c", + "src/defaults/default_mount.c", + "src/defaults/default_open.c", + "src/defaults/default_ops.c", + "src/defaults/default_poll.c", + "src/defaults/default_read.c", + "src/defaults/default_readlink.c", + "src/defaults/default_readv.c", + "src/defaults/default_rename.c", + "src/defaults/default_rmnod.c", + "src/defaults/default_statvfs.c", + "src/defaults/default_symlink.c", + "src/defaults/default_unmount.c", + "src/defaults/default_utime.c", + "src/defaults/default_write.c", + "src/defaults/default_writev.c", + ] + + ctx.cpu.source( + source, + alias="libfs", + features="src_include src_include_rtems src_include_score" + ) diff --git a/cpukit/libmisc/wscript b/cpukit/libmisc/wscript new file mode 100644 index 0000000000..62af524fe6 --- /dev/null +++ b/cpukit/libmisc/wscript @@ -0,0 +1,267 @@ +def build(ctx): + source = [] + + # shell + source_shell = [ + "shell/cat_file.c", + "shell/cmds.c", + "shell/main_alias.c", + "shell/main_cat.c", + "shell/main_cd.c", + "shell/cmp-ls.c", + "shell/main_chdir.c", + "shell/main_chmod.c", + "shell/main_chroot.c", + "shell/main_cp.c", + "shell/main_cpuuse.c", + "shell/main_date.c", + "shell/main_dir.c", + "shell/main_echo.c", + "shell/main_exit.c", + "shell/main_halt.c", + "shell/main_help.c", + "shell/main_id.c", + "shell/main_logoff.c", + "shell/main_ln.c", + "shell/main_ls.c", + "shell/main_mallocinfo.c", + "shell/main_md5.c", + "shell/main_mdump.c", + "shell/main_medit.c", + "shell/main_mfill.c", + "shell/main_mkdir.c", + "shell/main_mount.c", + "shell/main_mmove.c", + "shell/main_msdosfmt.c", + "shell/main_mv.c", + "shell/main_perioduse.c", + "shell/main_top.c", + "shell/main_pwd.c", + "shell/main_rm.c", + "shell/main_rmdir.c", + "shell/main_sleep.c", + "shell/main_stackuse.c", + "shell/main_tty.c", + "shell/main_umask.c", + "shell/main_unmount.c", + "shell/main_blksync.c", + "shell/main_whoami.c", + "shell/shell.c", + "shell/shell_cmdset.c", + "shell/shell_getchar.c", + "shell/shell_getprompt.c", + "shell/shellconfig.c", + "shell/shell_makeargs.c", + "shell/filemode.c", + "shell/pwcache.c", + "shell/print-ls.c", + "shell/write_file.c", + "shell/utils-cp.c", + "shell/utils-ls.c", + "shell/err.c", + "shell/errx.c", + "shell/verr.c", + "shell/vis.c", + "shell/verrx.c", + "shell/vwarn.c", + "shell/vwarnx.c", + "shell/warn.c", + "shell/warnx.c", + "shell/fts.c", + "shell/print_heapinfo.c", + "shell/main_wkspaceinfo.c", + "shell/shell_script.c", + "shell/login_prompt.c", + "shell/login_check.c", + "shell/fdisk.c", + "shell/main_rtc.c", + "shell/dd-args.c", + "shell/main_dd.c", + "shell/dd-conv.c", + "shell/dd-conv_tab.c", + "shell/dd-misc.c", + "shell/dd-position.c", + "shell/main_hexdump.c", + "shell/hexdump-conv.c", + "shell/hexdump-display.c", + "shell/hexdump-odsyntax.c", + "shell/hexdump-parse.c", + "shell/hexsyntax.c", + "shell/main_time.c", + "shell/main_mknod.c", + "shell/main_setenv.c", + "shell/main_getenv.c", + "shell/main_unsetenv.c", + "shell/main_mkrfs.c", + "shell/main_debugrfs.c", + "shell/main_df.c", + "shell/main_lsof.c", + "shell/main_edit.c", + "shell/main_blkstats.c", + "shell/main_rtrace.c", + "shell/shell-wait-for-input.c", + "shell/main_cmdls.c", + "shell/main_cmdchown.c", + "shell/main_cmdchmod.c", + "shell/main_cpuinfo.c", + "shell/main_profreport.c", + ] + ctx.cpu.shell( + source_shell, + includes="%s/shell" % ctx.path.abspath(), + features="src_include src_include_rtems src_include_score") + + + source_shell_networking = [ + "shell/main_ifconfig.c", + "shell/main_route.c", + "shell/main_netstats.c", + "shell/main_ping.c", + ] + + ctx.cpu.shell( + source_shell_networking, + test=ctx.env.ENABLE_NETWORKING, # extra test + alias="libmisc_shell", + includes=["%s/shell" % ctx.path.abspath()], + features="src_include src_include_rtems src_include_score src_include_networking") + + + source_serdbg = [ + "serdbg/serdbg.c", + "serdbg/serdbgio.c", + "serdbg/termios_printk.c" + ] + ctx.cpu.serdbg(source_serdbg) + + + source_networking = [ + "monitor/mon-network.c" + ] + ctx.cpu.networking(source_networking, + features="src_include src_include_rtems src_include_score src_include_networking") + + + source_mp= [ + "monitor/mon-mpci.c" + ] + ctx.cpu.mp( + source_mp, + features="src_include" + ) + + + source_uuid = [ + "uuid/clear.c", + "uuid/compare.c", + "uuid/copy.c", + "uuid/gen_uuid.c", + "uuid/isnull.c", + "uuid/pack.c", + "uuid/parse.c", + "uuid/unpack.c", + "uuid/unparse.c", + "uuid/uuid_time.c", + ] + ctx.cpu.source( + source_uuid, + alias="libmisc_uuid", + features="src_include src_include_rtems", + cflags=["-DHAVE_INTTYPES_H", "-DSIZEOF_TIME_T=4"] + ) + + + source_monitor = [ + "monitor/mon-command.c", + "monitor/mon-config.c", + "monitor/mon-driver.c", + "monitor/mon-editor.c", + "monitor/mon-extension.c", + "monitor/mon-itask.c", + "monitor/mon-manager.c", + "monitor/mon-monitor.c", + "monitor/mon-object.c", + "monitor/mon-part.c", + "monitor/mon-prmisc.c", + "monitor/mon-queue.c", + "monitor/mon-region.c", + "monitor/mon-sema.c", + "monitor/mon-server.c", + "monitor/mon-symbols.c", + "monitor/mon-task.c", + ] + ctx.cpu.source( + source_monitor, + alias="libmisc_monitor", + features="src_include src_include_rtems src_include_score", + cflags=["-DHAVE_INTTYPES_H"] + ) + + + +# if ctx.env.LIBUTF8PROC: +# utf8proc/utf8proc.c + +# if ctx.env.LIBPCI +# shell/main_pci.c + +# if LIBDRVMGR +# shell/main_drvmgr.c + + + source += [ + "bspcmdline/bspcmdline_get.c", + "bspcmdline/bspcmdline_getparam.c", + "bspcmdline/bspcmdline_getparamraw.c", + "bspcmdline/bspcmdline_getparamrhs.c", + "capture/capture_buffer.c", + "capture/capture_support.c", + "capture/capture_user_extension.c", + "capture/capture-cli.c", + "capture/capture.c", + "capture/rtems-trace-buffer-vars.c", + "cpuuse/cpuinforeport.c", + "cpuuse/cpuusagedata.c", + "cpuuse/cpuusagereport.c", + "cpuuse/cpuusagereset.c", + "cpuuse/cpuusagetop.c", + "devnull/devnull.c", + "devnull/devzero.c", +# "dummy/default-configuration.c", +# "dummy/dummy-networking.c", + "dumpbuf/dumpbuf.c", + "fb/mw_print.c", + "fb/mw_uid.c", + "fsmount/fsmount.c", + "mouse/mouse_parser.c", + "mouse/serial_mouse.c", + "redirector/stdio-redirect.c", + "rtems-fdt/rtems-fdt-shell.c", + "rtems-fdt/rtems-fdt.c", + "stackchk/check.c", + "stringto/stringtodouble.c", + "stringto/stringtofloat.c", + "stringto/stringtoint.c", + "stringto/stringtolong.c", + "stringto/stringtolongdouble.c", + "stringto/stringtolonglong.c", + "stringto/stringtopointer.c", + "stringto/stringtounsignedchar.c", + "stringto/stringtounsignedint.c", + "stringto/stringtounsignedlong.c", + "stringto/stringtounsignedlonglong.c", + "untar/untar_tgz.c", + "untar/untar_txz.c", + "untar/untar.c", + "xz/xz_crc32.c", + "xz/xz_dec_lzma2.c", + "xz/xz_dec_stream.c", + ] + + + ctx.cpu.source( + source, + alias="libmisc", + features="src_include src_include_rtems src_include_score src_include_networking" + ) + diff --git a/cpukit/libnetworking/wscript b/cpukit/libnetworking/wscript new file mode 100644 index 0000000000..b1605eed37 --- /dev/null +++ b/cpukit/libnetworking/wscript @@ -0,0 +1,130 @@ + +def build(ctx): + source = [] + + source += [ + "kern/kern_mib.c", + "kern/kern_subr.c", + "kern/kern_sysctl.c", + "kern/uipc_domain.c", + "kern/uipc_mbuf.c", + "kern/uipc_socket2.c", + "kern/uipc_socket.c", + "libc/base64.c", + "libc/gethostbydns.c", + "libc/gethostbyht.c", + "libc/gethostbynis.c", + "libc/gethostnamadr.c", + "libc/getifaddrs.c", + "libc/getnameinfo.c", + "libc/getnetbydns.c", + "libc/getnetbyht.c", + "libc/getnetbynis.c", + "libc/getnetnamadr.c", + "libc/getproto.c", + "libc/getprotoent.c", + "libc/getprotoname.c", + "libc/getservbyname.c", + "libc/getservbyport.c", + "libc/getservent.c", + "libc/herror.c", + "libc/if_indextoname.c", + "libc/if_nameindex.c", + "libc/inet_addr.c", + "libc/inet_lnaof.c", + "libc/inet_makeaddr.c", + "libc/inet_netof.c", + "libc/inet_network.c", + "libc/inet_ntoa.c", + "libc/inet_ntop.c", + "libc/inet_pton.c", + "libc/linkaddr.c", + "libc/map_v4v6.c", + "libc/nsap_addr.c", + "libc/ns_name.c", + "libc/ns_netint.c", + "libc/ns_parse.c", + "libc/ns_print.c", + "libc/ns_ttl.c", + "libc/rcmd.c", + "libc/recv.c", + "libc/res_comp.c", + "libc/res_data.c", + "libc/res_debug.c", + "libc/res_init.c", + "libc/res_mkquery.c", + "libc/res_mkupdate.c", + "libc/res_query.c", + "libc/res_send.c", + "libc/res_stubs.c", + "libc/res_update.c", + "libc/send.c", + "lib/getprotoby.c", + "lib/rtems_bsdnet_ntp.c", + "lib/syslog.c", + "net/if.c", + "net/if_ethersubr.c", + "net/if_loop.c", + "net/if_ppp.c", + "netinet/if_ether.c", + "netinet/igmp.c", + "netinet/in.c", + "netinet/in_cksum.c", + "netinet/in_pcb.c", + "netinet/in_proto.c", + "netinet/in_rmx.c", + "netinet/ip_divert.c", + "netinet/ip_fw.c", + "netinet/ip_icmp.c", + "netinet/ip_input.c", + "netinet/ip_mroute.c", + "netinet/ip_output.c", + "netinet/raw_ip.c", + "netinet/tcp_debug.c", + "netinet/tcp_input.c", + "netinet/tcp_output.c", + "netinet/tcp_subr.c", + "netinet/tcp_timer.c", + "netinet/tcp_usrreq.c", + "netinet/udp_usrreq.c", + "net/ppp_tty.c", + "net/radix.c", + "net/raw_cb.c", + "net/raw_usrreq.c", + "net/route.c", + "net/rtsock.c", + "net/slcompress.c", + "nfs/bootp_subr.c", + "rtems/mkrootfs.c", + "rtems/rtems_bootp.c", + "rtems/rtems_bsdnet_malloc_starvation.c", + "rtems/rtems_dhcp.c", + "rtems/rtems_dhcp_failsafe.c", + "rtems/rtems_glue.c", + "rtems/rtems_malloc_mbuf.c", + "rtems/rtems_mii_ioctl.c", + "rtems/rtems_mii_ioctl_kern.c", + "rtems/rtems_select.c", + "rtems/rtems_showicmpstat.c", + "rtems/rtems_showifstat.c", + "rtems/rtems_showipstat.c", + "rtems/rtems_showmbuf.c", + "rtems/rtems_showroute.c", + "rtems/rtems_showtcpstat.c", + "rtems/rtems_showudpstat.c", + "rtems/rtems_socketpair.c", + "rtems/rtems_syscall_api.c", + "rtems/rtems_syscall.c", + "rtems/sghostname.c", + ] + + libnetworking_defines=["__BSD_VISIBLE", "INET", + "NOPOLL", "NOSELECT", + "BOOTP_COMPAT", "NFS", "DIAGNOSTIC", "__RTEMS_HAVE_DECL_SIGALTSTACK__"] + + ctx.cpu.networking( + source, + alias="libnetworking", + defines=libnetworking_defines, + features="src_include src_include_rtems src_include_score src_include_networking" + ) diff --git a/cpukit/librpc/wscript b/cpukit/librpc/wscript new file mode 100644 index 0000000000..a4645c03da --- /dev/null +++ b/cpukit/librpc/wscript @@ -0,0 +1,56 @@ +def build(ctx): + source = [] + + source += [ + "src/rpc/auth_none.c", + "src/rpc/auth_unix.c", + "src/rpc/authunix_prot.c", + "src/rpc/bindresvport.c", + "src/rpc/clnt_generic.c", + "src/rpc/clnt_perror.c", + "src/rpc/clnt_raw.c", + "src/rpc/clnt_simple.c", + "src/rpc/clnt_tcp.c", + "src/rpc/clnt_udp.c", + "src/rpc/get_myaddress.c", + "src/rpc/getrpcent.c", + "src/rpc/getrpcport.c", + "src/rpc/netname.c", + "src/rpc/netnamer.c", + "src/rpc/pmap_clnt.c", + "src/rpc/pmap_getmaps.c", + "src/rpc/pmap_getport.c", + "src/rpc/pmap_prot.c", + "src/rpc/pmap_prot2.c", + "src/rpc/pmap_rmt.c", + "src/rpc/rpc_callmsg.c", + "src/rpc/rpc_commondata.c", + "src/rpc/rpc_dtablesize.c", + "src/rpc/rpc_prot.c", + "src/rpc/rpcdname.c", + "src/rpc/rtems_portmapper.c", + "src/rpc/rtems_rpc.c", + "src/rpc/rtime.c", + "src/rpc/svc_auth_unix.c", + "src/rpc/svc_auth.c", + "src/rpc/svc_raw.c", + "src/rpc/svc_run.c", + "src/rpc/svc_simple.c", + "src/rpc/svc_tcp.c", + "src/rpc/svc_udp.c", + "src/rpc/svc.c", + "src/xdr/xdr_array.c", + "src/xdr/xdr_float.c", + "src/xdr/xdr_mem.c", + "src/xdr/xdr_rec.c", + "src/xdr/xdr_reference.c", + "src/xdr/xdr_sizeof.c", + "src/xdr/xdr_stdio.c", + "src/xdr/xdr.c", + ] + + ctx.cpu.rpc( + source, + alias="librpc", + cflags=["-D_RPC_read=read.c", "-D_RPC_write=write.c", "-D_RPC_close=close.c", "-D_RTEMS_RPC_INTERNAL_"] + ) diff --git a/cpukit/posix/wscript b/cpukit/posix/wscript new file mode 100644 index 0000000000..70cdcf4688 --- /dev/null +++ b/cpukit/posix/wscript @@ -0,0 +1,251 @@ + +def build(ctx): + source = [] + + source_pthreads = [ + "src/aio_cancel.c", + "src/aio_error.c", + "src/aio_fsync.c", + "src/aio_misc.c", + "src/aio_read.c", + "src/aio_return.c", + "src/aio_write.c", + "src/alarm.c", + "src/getitimer.c", + "src/kill.c", + "src/kill_r.c", + "src/killinfo.c", + "src/mqueuenotify.c", + "src/pause.c", + "src/psignal.c", + "src/psignalclearprocesssignals.c", + "src/psignalclearsignals.c", + "src/psignalsetprocesssignals.c", + "src/psignalunblockthread.c", + "src/psxpriorityisvalid.c", + "src/psxtimercreate.c", + "src/psxtimerdelete.c", + "src/pthreadkill.c", + "src/pthreadsigmask.c", + "src/ptimer.c", + "src/setitimer.c", + "src/sigaction.c", + "src/signal_2.c", + "src/sigpending.c", + "src/sigqueue.c", + "src/sigsuspend.c", + "src/sigtimedwait.c", + "src/sigwait.c", + "src/sigwaitinfo.c", + "src/timergetoverrun.c", + "src/timergettime.c", + "src/timersettime.c", + "src/ualarm.c", + + ] + ctx.cpu.pthreads( + source_pthreads, + alias="posix_pthreads", + features="src_include src_include_rtems src_include_score" + ) + + + + source += [ + "src/_execve.c", + "src/adjtime.c", + "src/aio_suspend.c", + "src/barrierattrdestroy.c", + "src/barrierattrgetpshared.c", + "src/barrierattrinit.c", + "src/barrierattrsetpshared.c", + "src/cancel.c", + "src/cleanuppush.c", + "src/clockgetcpuclockid.c", + "src/clockgetres.c", + "src/clockgettime.c", + "src/clocksettime.c", + "src/condattrdestroy.c", + "src/condattrgetclock.c", + "src/condattrgetpshared.c", + "src/condattrinit.c", + "src/condattrsetclock.c", + "src/condattrsetpshared.c", + "src/condbroadcast.c", + "src/conddefaultattributes.c", + "src/conddestroy.c", + "src/condinit.c", + "src/condsignal.c", + "src/condsignalsupp.c", + "src/condtimedwait.c", + "src/condwait.c", + "src/condwaitsupp.c", + "src/fork.c", + "src/key.c", + "src/keydelete.c", + "src/keygetspecific.c", + "src/keysetspecific.c", + "src/lio_listio.c", + "src/mlock.c", + "src/mlockall.c", + "src/mmap.c", + "src/mprotect.c", + "src/mqueue.c", + "src/mqueueclose.c", + "src/mqueueconfig.c", + "src/mqueuedeletesupp.c", + "src/mqueuegetattr.c", + "src/mqueueopen.c", + "src/mqueuereceive.c", + "src/mqueuerecvsupp.c", + "src/mqueuesend.c", + "src/mqueuesendsupp.c", + "src/mqueuesetattr.c", + "src/mqueuetimedreceive.c", + "src/mqueuetimedsend.c", + "src/mqueueunlink.c", + "src/msync.c", + "src/munlock.c", + "src/munlockall.c", + "src/munmap.c", + "src/mutexattrdestroy.c", + "src/mutexattrgetprioceiling.c", + "src/mutexattrgetprotocol.c", + "src/mutexattrgetpshared.c", + "src/mutexattrgettype.c", + "src/mutexattrinit.c", + "src/mutexattrsetprioceiling.c", + "src/mutexattrsetprotocol.c", + "src/mutexattrsetpshared.c", + "src/mutexattrsettype.c", + "src/mutexdestroy.c", + "src/mutexgetprioceiling.c", + "src/mutexinit.c", + "src/mutexlock.c", + "src/mutexlocksupp.c", + "src/mutexsetprioceiling.c", + "src/mutextimedlock.c", + "src/mutextrylock.c", + "src/mutexunlock.c", + "src/nanosleep.c", + "src/pbarrierdestroy.c", + "src/pbarrierinit.c", + "src/pbarrierwait.c", + "src/posix_madvise.c", + "src/prwlockdestroy.c", + "src/prwlockinit.c", + "src/prwlockrdlock.c", + "src/prwlocktimedrdlock.c", + "src/prwlocktimedwrlock.c", + "src/prwlocktryrdlock.c", + "src/prwlocktrywrlock.c", + "src/prwlockunlock.c", + "src/prwlockwrlock.c", + "src/psignalconfig.c", + "src/pspindestroy.c", + "src/pspininit.c", + "src/pspinlock.c", + "src/pspinunlock.c", + "src/psxnametoid.c", + "src/psxpriorityisvalid.c", + "src/psxsemaphore.c", + "src/psxsemaphoreconfig.c", + "src/psxtimerconfig.c", + "src/psxtransschedparam.c", + "src/pthread.c", + "src/pthreadatfork.c", + "src/pthreadattrdefault.c", + "src/pthreadattrdestroy.c", + "src/pthreadattrgetaffinitynp.c", + "src/pthreadattrgetdetachstate.c", + "src/pthreadattrgetguardsize.c", + "src/pthreadattrgetinheritsched.c", + "src/pthreadattrgetschedparam.c", + "src/pthreadattrgetschedpolicy.c", + "src/pthreadattrgetscope.c", + "src/pthreadattrgetstack.c", + "src/pthreadattrgetstackaddr.c", + "src/pthreadattrgetstacksize.c", + "src/pthreadattrinit.c", + "src/pthreadattrsetaffinitynp.c", + "src/pthreadattrsetdetachstate.c", + "src/pthreadattrsetguardsize.c", + "src/pthreadattrsetinheritsched.c", + "src/pthreadattrsetschedparam.c", + "src/pthreadattrsetschedpolicy.c", + "src/pthreadattrsetscope.c", + "src/pthreadattrsetstack.c", + "src/pthreadattrsetstackaddr.c", + "src/pthreadattrsetstacksize.c", + "src/pthreadconcurrency.c", + "src/pthreadconfig.c", + "src/pthreadcreate.c", + "src/pthreaddetach.c", + "src/pthreadequal.c", + "src/pthreadexit.c", + "src/pthreadgetaffinitynp.c", + "src/pthreadgetattrnp.c", + "src/pthreadgetcpuclockid.c", + "src/pthreadgetnamenp.c", + "src/pthreadgetschedparam.c", + "src/pthreadinitthreads.c", + "src/pthreadjoin.c", + "src/pthreadonce.c", + "src/pthreadself.c", + "src/pthreadsetaffinitynp.c", + "src/pthreadsetnamenp.c", + "src/pthreadsetschedparam.c", + "src/pthreadsetschedprio.c", + "src/rwlockattrdestroy.c", + "src/rwlockattrgetpshared.c", + "src/rwlockattrinit.c", + "src/rwlockattrsetpshared.c", + "src/sched_getparam.c", + "src/sched_getprioritymax.c", + "src/sched_getprioritymin.c", + "src/sched_getscheduler.c", + "src/sched_rr_get_interval.c", + "src/sched_setparam.c", + "src/sched_setscheduler.c", + "src/sched_yield.c", + "src/semaphoredeletesupp.c", + "src/semclose.c", + "src/semdestroy.c", + "src/semgetvalue.c", + "src/seminit.c", + "src/semopen.c", + "src/sempost.c", + "src/semtimedwait.c", + "src/semtrywait.c", + "src/semunlink.c", + "src/semwait.c", + "src/setcancelstate.c", + "src/setcanceltype.c", + "src/shm.c", + "src/shmconfig.c", + "src/shmheap.c", + "src/shmopen.c", + "src/shmops.c", + "src/shmunlink.c", + "src/shmwkspace.c", + "src/sigaddset.c", + "src/sigdelset.c", + "src/sigemptyset.c", + "src/sigfillset.c", + "src/sigismember.c", + "src/sigprocmask.c", + "src/sysconf.c", + "src/testcancel.c", + "src/vfork.c", + "src/wait.c", + "src/waitpid.c", + "src/keyzerokvp.c", + "src/keycreate.c", + ] + ctx.cpu.source( + source, + alias="posix", + features="src_include src_include_rtems src_include_score" + ) + + diff --git a/cpukit/rtems/wscript b/cpukit/rtems/wscript new file mode 100644 index 0000000000..eae93303f9 --- /dev/null +++ b/cpukit/rtems/wscript @@ -0,0 +1,172 @@ +def build(ctx): + source = [] + + source_mp = [ + "src/eventmp.c", + "src/mp.c", + "src/msgmp.c", + "src/partmp.c", + "src/semmp.c", + "src/signalmp.c", + "src/taskmp.c", + ] + ctx.cpu.mp( + source_mp, + features="src_include" + ) + + + source += [ + "src/barrier.c", + "src/barriercreate.c", + "src/barrierdelete.c", + "src/barrierident.c", + "src/barrierrelease.c", + "src/barrierwait.c", + "src/clockgetsecondssinceepoch.c", + "src/clockgettickspersecond.c", + "src/clockgettod.c", + "src/clockgettodtimeval.c", + "src/clockgetuptime.c", + "src/clockgetuptimenanoseconds.c", + "src/clockgetuptimetimeval.c", + "src/clockset.c", + "src/clocktick.c", + "src/clocktodtoseconds.c", + "src/clocktodvalidate.c", + "src/dpmem.c", + "src/dpmemcreate.c", + "src/dpmemdelete.c", + "src/dpmemexternal2internal.c", + "src/dpmemident.c", + "src/dpmeminternal2external.c", + "src/eventreceive.c", + "src/eventseize.c", + "src/eventsend.c", + "src/eventsurrender.c", + "src/getcurrentprocessor.c", + "src/getprocessorcount.c", + "src/intrbody.c", + "src/intrcatch.c", + "src/modes.c", + "src/msg.c", + "src/msgqbroadcast.c", + "src/msgqcreate.c", + "src/msgqdelete.c", + "src/msgqflush.c", + "src/msgqgetnumberpending.c", + "src/msgqident.c", + "src/msgqreceive.c", + "src/msgqsend.c", + "src/msgqurgent.c", + "src/part.c", + "src/partcreate.c", + "src/partdelete.c", + "src/partgetbuffer.c", + "src/partident.c", + "src/partreturnbuffer.c", + "src/ratemon.c", + "src/ratemoncancel.c", + "src/ratemoncreate.c", + "src/ratemondelete.c", + "src/ratemongetstatistics.c", + "src/ratemongetstatus.c", + "src/ratemonident.c", + "src/ratemonperiod.c", + "src/ratemonreportstatistics.c", + "src/ratemonresetall.c", + "src/ratemonresetstatistics.c", + "src/ratemontimeout.c", + "src/region.c", + "src/regioncreate.c", + "src/regiondelete.c", + "src/regionextend.c", + "src/regiongetfreeinfo.c", + "src/regiongetinfo.c", + "src/regiongetsegment.c", + "src/regiongetsegmentsize.c", + "src/regionident.c", + "src/regionprocessqueue.c", + "src/regionresizesegment.c", + "src/regionreturnsegment.c", + "src/rtemsbuildid.c", + "src/rtemsbuildname.c", + "src/rtemsobjectapimaximumclass.c", + "src/rtemsobjectapiminimumclass.c", + "src/rtemsobjectgetapiclassname.c", + "src/rtemsobjectgetapiname.c", + "src/rtemsobjectgetclassicname.c", + "src/rtemsobjectgetclassinfo.c", + "src/rtemsobjectgetname.c", + "src/rtemsobjectidapimaximum.c", + "src/rtemsobjectidapiminimum.c", + "src/rtemsobjectidgetapi.c", + "src/rtemsobjectidgetclass.c", + "src/rtemsobjectidgetindex.c", + "src/rtemsobjectidgetnode.c", + "src/rtemsobjectsetname.c", + "src/rtemstimer.c", + "src/scheduleraddprocessor.c", + "src/schedulergetprocessorset.c", + "src/scheduleridentbyprocessor.c", + "src/scheduleridentbyprocessorset.c", + "src/schedulerident.c", + "src/schedulerremoveprocessor.c", + "src/sem.c", + "src/semcreate.c", + "src/semdelete.c", + "src/semflush.c", + "src/semident.c", + "src/semobtain.c", + "src/semrelease.c", + "src/semsetpriority.c", + "src/signalcatch.c", + "src/signalsend.c", + "src/status.c", + "src/statustext.c", + "src/statustoerrno.c", + "src/systemeventreceive.c", + "src/systemeventsend.c", + "src/taskcreate.c", + "src/taskdelete.c", + "src/taskexit.c", + "src/taskgetaffinity.c", + "src/taskgetpriority.c", + "src/taskgetscheduler.c", + "src/taskident.c", + "src/taskinitusers.c", + "src/taskissuspended.c", + "src/taskiterate.c", + "src/taskmode.c", + "src/taskrestart.c", + "src/taskresume.c", + "src/tasks.c", + "src/taskself.c", + "src/tasksetaffinity.c", + "src/tasksetpriority.c", + "src/tasksetscheduler.c", + "src/taskstart.c", + "src/tasksuspend.c", + "src/taskwakeafter.c", + "src/taskwakewhen.c", + "src/timercancel.c", + "src/timercreate.c", + "src/timerdelete.c", + "src/timerfireafter.c", + "src/timerfirewhen.c", + "src/timergetinfo.c", + "src/timerident.c", + "src/timerreset.c", + "src/timerserver.c", + "src/timerserverfireafter.c", + "src/timerserverfirewhen.c", + "src/workspace.c", + "src/workspacegreedy.c", + "src/rtemsmaxprio.c", + ] + + ctx.cpu.source( + source, + alias="rtems", + features="src_include src_include_rtems src_include_score" + ) diff --git a/cpukit/score/wscript b/cpukit/score/wscript new file mode 100644 index 0000000000..35680da5fc --- /dev/null +++ b/cpukit/score/wscript @@ -0,0 +1,490 @@ +def build(ctx): + source = [] + + source_mp = [ + "src/mpci.c", + "src/objectmp.c", + "src/threadmp.c", + ] + + ctx.cpu.mp( + source_mp, + alias="score_mp", + features="src_include", + includes=["%s/cpukit/score/include" % ctx.srcnode.abspath()] + ) + + source_smp = [ + "src/percpustatewait.c", + "src/profilingsmplock.c", + "src/schedulerdefaultpinunpin.c", + "src/scheduleredfsmp.c", + "src/schedulerpriorityaffinitysmp.c", + "src/schedulerprioritysmp.c", + "src/schedulersimplesmp.c", + "src/schedulerstrongapa.c", + "src/smp.c", + "src/smplock.c", + "src/smpmulticastaction.c", + "src/schedulerdefaultaskforhelp.c", + "src/schedulerdefaultsetaffinity.c", + "src/schedulersmp.c", + "src/schedulersmpstartidle.c", + "src/threadunpin.c", + ] + + ctx.cpu.smp( + source_smp, + alias="score_smp", + features="src_include", + includes=["%s/cpukit/score/include" % ctx.srcnode.abspath()] + ) + +# source_pthreads = [ +# "src/corerwlock.c", +# "src/corerwlockobtainread.c", +# "src/corerwlockobtainwrite.c", +# "src/corerwlockrelease.c", +# "src/corespinlock.c", +# "src/corespinlockrelease.c", +# "src/corespinlockwait.c" +# ] +# ctx.cpu.pthreads( +# source_pthreads, +# alias="score", +# features="src_include", +# includes=["%s/cpukit/score/include" % ctx.srcnode.abspath()] +# ) + + source += [ +# "src/schedulerprioritysmp.c", + "src/allocatormutex.c", + "src/apimutexisowner.c", + "src/apimutexlock.c", + "src/apimutexunlock.c", + "src/corebarrier.c", + "src/corebarrierrelease.c", + "src/corebarrierwait.c", + "src/coremsg.c", + "src/coremsgbroadcast.c", + "src/coremsgclose.c", + "src/coremsgflush.c", + "src/coremsgflushwait.c", + "src/coremsginsert.c", + "src/coremsgseize.c", + "src/coremsgsubmit.c", + "src/coremutexseize.c", + "src/percpu.c", + "src/percpuasm.c", + "src/corerwlock.c", + "src/corerwlockobtainread.c", + "src/corerwlockobtainwrite.c", + "src/corerwlockrelease.c", + "src/coresem.c", + "src/heap.c", + "src/heapallocate.c", + "src/heapextend.c", + "src/heapfree.c", + "src/heapsizeofuserarea.c", + "src/heapwalk.c", + "src/heapgetinfo.c", + "src/heapgetfreeinfo.c", + "src/heapresizeblock.c", + "src/heapiterate.c", + "src/heapgreedy.c", + "src/heapnoextend.c", + "src/objectallocate.c", + "src/objectclose.c", + "src/objectextendinformation.c", + "src/objectfree.c", + "src/objectgetnext.c", + "src/objectinitializeinformation.c", + "src/objectnametoid.c", + "src/objectnametoidstring.c", + "src/objectshrinkinformation.c", + "src/objectgetnoprotection.c", + "src/objectidtoname.c", + "src/objectgetnameasstring.c", + "src/objectsetname.c", + "src/objectgetinfo.c", + "src/objectgetinfoid.c", + "src/objectapimaximumclass.c", + "src/objectnamespaceremove.c", + "src/objectactivecount.c", + "src/objectgetlocal.c", + "src/log2table.c", + "src/scheduler.c", + "src/schedulergetaffinity.c", + "src/schedulersetaffinity.c", + "src/schedulerdefaultmappriority.c", + "src/schedulerdefaultnodedestroy.c", + "src/schedulerdefaultnodeinit.c", + "src/schedulerdefaultreleasejob.c", + "src/schedulerdefaultschedule.c", + "src/schedulerdefaultstartidle.c", + "src/schedulerdefaulttick.c", + "src/schedulerpriority.c", + "src/schedulerpriorityblock.c", + "src/schedulerprioritychangepriority.c", + "src/schedulerpriorityschedule.c", + "src/schedulerpriorityunblock.c", + "src/schedulerpriorityyield.c", + "src/schedulersimple.c", + "src/schedulersimpleblock.c", + "src/schedulersimplechangepriority.c", + "src/schedulersimpleschedule.c", + "src/schedulersimpleunblock.c", + "src/schedulersimpleyield.c", + "src/scheduleredf.c", + "src/scheduleredfnodeinit.c", + "src/scheduleredfblock.c", + "src/scheduleredfchangepriority.c", + "src/scheduleredfreleasejob.c", + "src/scheduleredfschedule.c", + "src/scheduleredfunblock.c", + "src/scheduleredfyield.c", + "src/schedulercbs.c", + "src/schedulercbsnodeinit.c", + "src/schedulercbsattachthread.c", + "src/schedulercbscleanup.c", + "src/schedulercbscreateserver.c", + "src/schedulercbsdestroyserver.c", + "src/schedulercbsdetachthread.c", + "src/schedulercbsgetapprovedbudget.c", + "src/schedulercbsgetexecutiontime.c", + "src/schedulercbsgetparameters.c", + "src/schedulercbsgetremainingbudget.c", + "src/schedulercbsgetserverid.c", + "src/schedulercbssetparameters.c", + "src/schedulercbsreleasejob.c", + "src/schedulercbsunblock.c", + "src/pheapallocate.c", + "src/pheapextend.c", + "src/pheapfree.c", + "src/pheapgetsize.c", + "src/pheapgetblocksize.c", + "src/pheapgetfreeinfo.c", + "src/pheapgetinfo.c", + "src/pheapinit.c", + "src/pheapresizeblock.c", + "src/pheapwalk.c", + "src/pheapiterate.c", + "src/freechain.c", + "src/rbtreeextract.c", + "src/rbtreeinsert.c", + "src/rbtreeiterate.c", + "src/rbtreenext.c", + "src/rbtreepostorder.c", + "src/rbtreereplace.c", + "src/thread.c", + "src/threadchangepriority.c", + "src/threadclearstate.c", + "src/threadcreateidle.c", + "src/threaddispatch.c", + "src/threadget.c", + "src/threadhandler.c", + "src/threadinitialize.c", + "src/threadloadenv.c", + "src/threadrestart.c", + "src/threadsetstate.c", + "src/threadstackallocate.c", + "src/threadstackfree.c", + "src/threadstart.c", + "src/threadstartmultitasking.c", + "src/iterateoverthreads.c", + "src/threadentryadaptoridle.c", + "src/threadentryadaptornumeric.c", + "src/threadentryadaptorpointer.c", + "src/threadgetcputimeused.c", + "src/threaditerate.c", + "src/threadname.c", + "src/threadscheduler.c", + "src/threadtimeout.c", + "src/threadwaitgetid.c", + "src/threadyield.c", + "src/threadq.c", + "src/threadqenqueue.c", + "src/threadqextractwithproxy.c", + "src/threadqfirst.c", + "src/threadqflush.c", + "src/threadqops.c", + "src/threadqtimeout.c", + "src/timespecaddto.c", + "src/timespecfromticks.c", + "src/timespecisvalid.c", + "src/timespeclessthan.c", + "src/timespecsubtract.c", + "src/timespectoticks.c", + "src/timespecdivide.c", + "src/timespecdividebyinteger.c", + "src/timespecgetasnanoseconds.c", + "src/coretod.c", + "src/coretodset.c", + "src/coretodtickspersec.c", + "src/coretodadjust.c", + "src/watchdoginsert.c", + "src/watchdogremove.c", + "src/watchdogtick.c", + "src/watchdogtickssinceboot.c", + "src/userextaddset.c", + "src/userext.c", + "src/userextremoveset.c", + "src/userextiterate.c", + "src/chain.c", + "src/chainnodecount.c", + "src/debugisthreaddispatchingallowed.c", + "src/interr.c", + "src/isr.c", + "src/wkspace.c", + "src/wkstringduplicate.c", + "src/ioprintf.c", + "src/iovprintf.c", + "src/isrisinprogress.c", + "src/condition.c", + "src/futex.c", + "src/profilingisrentryexit.c", + "src/mutex.c", + "src/once.c", + "src/sched.c", + "src/semaphore.c", + "src/smpbarrierwait.c", + "src/kern_tc.c", + "src/libatomic.c", + "src/processormaskcopy.c", + ] + + if ctx.env.RTEMS_ARCH == "arm": + source += [ + "cpu/arm/__aeabi_read_tp.c", + "cpu/arm/arm-context-validate.S", + "cpu/arm/arm-context-volatile-clobber.S", + "cpu/arm/arm_exc_abort.S", + "cpu/arm/arm-exception-default.c", + "cpu/arm/arm-exception-frame-print.c", + "cpu/arm/arm_exc_interrupt.S", + "cpu/arm/armv4-exception-default.S", + "cpu/arm/armv4-sync-synchronize.c", + "cpu/arm/armv7m-context-initialize.c", + "cpu/arm/armv7m-context-restore.c", + "cpu/arm/armv7m-context-switch.c", + "cpu/arm/armv7m-exception-default.c", + "cpu/arm/armv7m-exception-handler-get.c", + "cpu/arm/armv7m-exception-handler-set.c", + "cpu/arm/armv7m-exception-priority-get.c", + "cpu/arm/armv7m-exception-priority-handler.c", + "cpu/arm/armv7m-exception-priority-set.c", + "cpu/arm/armv7m-initialize.c", + "cpu/arm/armv7m-isr-dispatch.c", + "cpu/arm/armv7m-isr-enter-leave.c", + "cpu/arm/armv7m-isr-level-get.c", + "cpu/arm/armv7m-isr-level-set.c", + "cpu/arm/armv7m-isr-vector-install.c", + "cpu/arm/armv7m-multitasking-start-stop.c", + "cpu/arm/armv7-thread-idle.c", + "cpu/arm/cpu_asm.S", + "cpu/arm/cpu.c", + "cpu/arm/__tls_get_addr.c", + ] + + elif ctx.env.RTEMS_ARCH == "bfin": + source += [ + "cpu/bfin/bfin-exception-frame-print.c", + "cpu/bfin/cpu_asm.S", + "cpu/bfin/cpu.c", + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + ] + elif ctx.env.RTEMS_ARCH == "epiphany": + source += [ + "cpu/epiphany/cpu.c", + "cpu/epiphany/epiphany-context-initialize.c", + "cpu/epiphany/epiphany-context-switch.S", + "cpu/epiphany/epiphany-exception-handler.S", + "cpu/epiphany/setjmp.S", + "cpu/no_cpu/cpucounterfrequency.c", + ] + elif ctx.env.RTEMS_ARCH == "i386": + source += [ + "cpu/i386/cpu_asm.S", + "cpu/i386/cpu.c", + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + "cpu/no_cpu/cpuidle.c", + ] + elif ctx.env.RTEMS_ARCH == "lm32": + source += [ + "cpu/lm32/cpu_asm.S", + "cpu/lm32/cpu.c", + "cpu/lm32/irq.c", + "cpu/lm32/lm32-exception-frame-print.c", + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + ] + elif ctx.env.RTEMS_ARCH == "m32c": + source += [ + "cpu/m32c/context_init.c", + "cpu/m32c/context_switch.S", + "cpu/m32c/cpu_asm.c", + "cpu/m32c/cpu.c", + "cpu/m32c/m32c-exception-frame-print.c", + "cpu/m32c/varvects.S", + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + ] + elif ctx.env.RTEMS_ARCH == "m68k": + source += [ + "cpu/m68k/cpu_asm.S", + "cpu/m68k/cpu.c", + "cpu/m68k/m68k-exception-frame-print.c", + "cpu/m68k/__m68k_read_tp.c", + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + ] + elif ctx.env.RTEMS_ARCH == "mips": + source += [ + "cpu/mips/cpu.c", + "cpu/mips/cpu_asm.S", + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + ] + elif ctx.env.RTEMS_ARCH == "moxie": + source += [ + "cpu/moxie/cpu.c", + "cpu/moxie/moxie-exception-frame-print.c", + "cpu/moxie/cpu_asm.S", + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + "cpu/no_cpu/cpuidle.c", + ] + elif ctx.env.RTEMS_ARCH == "nios2": + source += [ + "cpu/nios2/nios2-context-initialize.c", + "cpu/nios2/nios2-context-switch.S", + "cpu/nios2/nios2-context-validate.S", + "cpu/nios2/nios2-context-volatile-clobber.S", + "cpu/nios2/nios2-eic-il-low-level.S", + "cpu/nios2/nios2-eic-rsie-low-level.S", + "cpu/nios2/nios2-exception-frame-print.c", + "cpu/nios2/nios2-fatal-halt.c", + "cpu/nios2/nios2-iic-low-level.S", + "cpu/nios2/nios2-iic-irq.c", + "cpu/nios2/nios2-initialize.c", + "cpu/nios2/nios2-isr-get-level.c", + "cpu/nios2/nios2-isr-install-raw-handler.c", + "cpu/nios2/nios2-isr-install-vector.c", + "cpu/nios2/nios2-isr-is-in-progress.c", + "cpu/nios2/nios2-isr-set-level.c", + "cpu/nios2/nios2-mpu-add-region.c", + "cpu/nios2/nios2-mpu-configuration.c", + "cpu/nios2/nios2-mpu-descriptor.c", + "cpu/nios2/nios2-mpu-disable-protected.c", + "cpu/nios2/nios2-mpu-reset.c", + "cpu/nios2/nios2-thread-dispatch-disabled.c", + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + "cpu/no_cpu/cpuidle.c", + ] + elif ctx.env.RTEMS_ARCH == "or1k": + source += [ + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/or1k/cpu.c", + "cpu/or1k/or1k-context-initialize.c", + "cpu/or1k/or1k-context-switch.S", + "cpu/or1k/or1k-context-validate.S", + "cpu/or1k/or1k-context-volatile-clobber.S", + "cpu/or1k/or1k-exception-default.c", + "cpu/or1k/or1k-exception-frame-print.c", + "cpu/or1k/or1k-exception-handler-low.S", + ] + elif ctx.env.RTEMS_ARCH == "powerpc": + source += [ + "cpu/no_cpu/cpuidle.c", + "cpu/powerpc/cpu.c", + "cpu/powerpc/ppc-context-volatile-clobber.S", + "cpu/powerpc/ppc-context-validate.S", + "cpu/powerpc/ppc-isr-disable-mask.S", + "cpu/powerpc/ppc-isr-vector-install.c", + ] + elif ctx.env.RTEMS_ARCH == "riscv": + source += [ + "cpu/riscv/cpu.c", + "cpu/riscv/riscv-exception-handler.S", + "cpu/riscv/riscv-exception-frame-print.c", + "cpu/riscv/riscv-context-switch.S", + "cpu/riscv/riscv-context-initialize.c", + "cpu/riscv/riscv-context-validate.S", + "cpu/riscv/riscv-context-volatile-clobber.S", + "cpu/riscv/riscv-counter.S", + ] + elif ctx.env.RTEMS_ARCH == "sh": + source += [ + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + "cpu/no_cpu/cpuidle.c", + "cpu/sh/cpu.c", + "cpu/sh/context.c", + "cpu/sh/sh-exception-frame-print.c", + ] + elif ctx.env.RTEMS_ARCH == "sparc": + source += [ + "cpu/no_cpu/cpuidle.c", + "cpu/sparc/access_le.c", + "cpu/sparc/cpu.c", + "cpu/sparc/cpu_asm.S", + "cpu/sparc/sparc-access.S", + "cpu/sparc/sparc-context-validate.S", + "cpu/sparc/sparc-context-volatile-clobber.S", + "cpu/sparc/sparc-counter-asm.S", + "cpu/sparc/syscall.S", + "cpu/sparc/window.S", + ] + elif ctx.env.RTEMS_ARCH == "sparc64": + source += [ + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + "cpu/no_cpu/cpuidle.c", + "cpu/sparc64/context.S", + "cpu/sparc64/cpu.c", + "cpu/sparc64/interrupt.S", + "cpu/sparc64/sparc64-exception-frame-print.c", + "cpu/sparc64/sparc64-syscall.S", + ] + elif ctx.env.RTEMS_ARCH == "v850": + source += [ + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + "cpu/no_cpu/cpuidle.c", + "cpu/v850/cpu.c", + "cpu/v850/cpu_asm.S", + "cpu/v850/v850-exception-frame-print.c", + ] + elif ctx.env.RTEMS_ARCH == "x86_64": + source += [ + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + "cpu/no_cpu/cpuidle.c", + "cpu/x86_64/cpu.c", + "cpu/x86_64/x86_64-context-initialize.c", + "cpu/x86_64/x86_64-context-switch.S", + ] + elif ctx.env.RTEMS_ARCH_NO_CPU: + source += [ + "cpu/no_cpu/cpu.c", + "cpu/no_cpu/cpu_asm.c", + "cpu/no_cpu/cpucounterfrequency.c", + "cpu/no_cpu/cpucounterread.c", + "cpu/no_cpu/cpuidle.c", + ] + elif ctx.cmd != "build" and ctx.cmd != "%s/%s" % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP): + # Hack to let other commands such as 'waf list' work + pass + else: + ctx.fatal("cpukit/score/wscript: unknown arch: %s" % ctx.env.RTEMS_ARCH) + + + ctx.cpu.source( + source, + alias="score", + features="src_include src_include_rtems src_include_score", + includes=["%s/cpukit/score/include" % ctx.srcnode.abspath()] + ) diff --git a/cpukit/wscript b/cpukit/wscript new file mode 100644 index 0000000000..765b021342 --- /dev/null +++ b/cpukit/wscript @@ -0,0 +1,227 @@ +def build(ctx): + source = [] + + + # ftpd/ + source_ftpd = [ + "ftpd/ftpd-init.c", + "ftpd/ftpd.c", + ] + + ctx.cpu.networking( + source_ftpd, + alias="ftpd", + features="src_include src_include_rtems src_include_score" + ) + + # telnetd/ + source_telnetd = [ + "telnetd/check_passwd.c", + "telnetd/des.c", + "telnetd/pty.c", + "telnetd/telnetd-init.c", + "telnetd/telnetd.c", + ] + + ctx.cpu.networking( + source_telnetd, + alias="telnetd", + features="src_include src_include_rtems src_include_score", + includes=["%s/cpukit/libnetworking" % ctx.srcnode.abspath()], + ) + + # pppd/ + source_pppd = [ + "pppd/auth.c", + "pppd/ccp.c", + "pppd/chap.c", + "pppd/chap_ms.c", + "pppd/chat.c", + "pppd/demand.c", + "pppd/fsm.c", + "pppd/ipcp.c", + "pppd/lcp.c", + "pppd/magic.c", + "pppd/options.c", + "pppd/rtemsmain.c", + "pppd/rtemspppd.c", +#"pppd/sys-rtems.c", + "pppd/upap.c", + "pppd/utils.c", + ] + ctx.cpu.networking( + source_pppd, + alias="pppd", + features="src_include src_include_rtems src_include_score", + includes=["%s/cpukit/libnetworking" % ctx.srcnode.abspath()], + ) + + # mghttpd/ + source_mghttpd = ["mghttpd/mongoose.c"] + ctx.cpu.networking( + source_mghttpd, + alias="mghttpd", + features="src_include src_include_rtems src_include_score", + includes=["%s/include/mghttpd" % ctx.srcnode.abspath()], + cflags=["-DNO_SSI", "-DNO_SSL", "-DNO_CGI"] + ) + + # libblock/ + source_libblock = [ + "libblock/src/bdbuf.c", + "libblock/src/bdpart-create.c", + "libblock/src/bdpart-dump.c", + "libblock/src/bdpart-mount.c", + "libblock/src/bdpart-read.c", + "libblock/src/bdpart-register.c", + "libblock/src/bdpart-sort.c", + "libblock/src/bdpart-write.c", + "libblock/src/blkdev-blkstats.c", + "libblock/src/blkdev-imfs.c", + "libblock/src/blkdev-ioctl.c", + "libblock/src/blkdev-ops.c", + "libblock/src/blkdev-print-stats.c", + "libblock/src/blkdev.c", + "libblock/src/diskdevs-init.c", + "libblock/src/diskdevs.c", + "libblock/src/flashdisk.c", + "libblock/src/ide_part_table.c", + "libblock/src/media-desc.c", + "libblock/src/media-dev-ident.c", + "libblock/src/media-path.c", + "libblock/src/media-server.c", + "libblock/src/media.c", + "libblock/src/nvdisk-sram.c", + "libblock/src/nvdisk.c", + "libblock/src/ramdisk-config.c", + "libblock/src/ramdisk-driver.c", + "libblock/src/ramdisk-init.c", + "libblock/src/ramdisk-register.c", + "libblock/src/sparse-disk.c", + ] + ctx.cpu.source( + source_libblock, + alias="libblock", + features="src_include src_include_rtems src_include_score" + ) + + + # libtest/ + source_libtest = [ + "libtest/t-test-checks-eno.c", + "libtest/t-test-checks-psx.c", + "libtest/t-test-checks.c", + "libtest/t-test-hash-sha256.c", + "libtest/t-test-malloc.c", + "libtest/t-test-rtems-fds.c", + "libtest/t-test-rtems-heap.c", + "libtest/t-test-rtems-measure.c", + "libtest/t-test-rtems-objs.c", + "libtest/t-test-rtems.c", + "libtest/t-test-time.c", + "libtest/t-test.c", + "libtest/testbeginend.c", + "libtest/testbusy.c", + "libtest/testextension.c", + "libtest/testparallel.c", + "libtest/testwrappers.c", + ] + ctx.cpu.source( + source_libtest, + alias="libtest", + features="src_include src_include_rtems src_include_score" + ) + + # sapi/ + source_sapi = [ + "sapi/src/chainappendnotify.c", + "sapi/src/chaingetnotify.c", + "sapi/src/chaingetwait.c", + "sapi/src/chainprependnotify.c", + "sapi/src/chainprotected.c", + "sapi/src/cpucounterconverter.c", + "sapi/src/delaynano.c", + "sapi/src/delayticks.c", + "sapi/src/exinit.c", + "sapi/src/exshutdown.c", + "sapi/src/extension.c", + "sapi/src/extensioncreate.c", + "sapi/src/extensiondelete.c", + "sapi/src/extensionident.c", + "sapi/src/fatal.c", + "sapi/src/fatalsrctext.c", + "sapi/src/getversionstring.c", + "sapi/src/interrtext.c", + "sapi/src/io.c", + "sapi/src/ioclose.c", + "sapi/src/iocontrol.c", + "sapi/src/ioinitialize.c", + "sapi/src/ioopen.c", + "sapi/src/ioread.c", + "sapi/src/ioregisterdriver.c", + "sapi/src/iounregisterdriver.c", + "sapi/src/iowrite.c", + "sapi/src/panic.c", + "sapi/src/posixapi.c", + "sapi/src/profilingiterate.c", + "sapi/src/profilingreportxml.c", + "sapi/src/rbheap.c", + "sapi/src/rbtree.c", + "sapi/src/rbtreefind.c", + "sapi/src/sapirbtreeinsert.c", + "sapi/src/tcsimpleinstall.c", + "sapi/src/version.c", + "sapi/src/getconfigmax.c", + + ] + + #XXX: is this -j safe? Needs to be done properly temp hack. + node = ctx.bldnode.make_node('version-vc-key.h') + node.write('#define RTEMS_VERSION_VC_KEY "waf";\n') + + ctx.cpu.source( + source_sapi, + alias="sapi", + features="src_include src_include_rtems src_include_score", + includes=[ctx.bldnode.abspath()] + ) + + + + + source += [ + "libgnat/ada_intrsupp.c", +# "libgnat/adasupp.c", # XXX: if libnat + "dev/i2c/eeprom.c", + "dev/i2c/fpga-i2c-slave.c", + "dev/i2c/gpio-nxp-pca9535.c", + "dev/i2c/i2c-bus.c", + "dev/i2c/i2c-dev.c", + "dev/i2c/sensor-lm75a.c", + "dev/i2c/switch-nxp-pca9548a.c", + "dev/i2c/ti-ads-16bit-adc.c", + "dev/i2c/ti-lm25066a.c", + "dev/i2c/ti-tmp112.c", + "dev/i2c/xilinx-axi-i2c.c", + "libi2c/libi2c.c", + "libmd/md4.c", + "libmd/md5.c", + "libmd/sha256c.c", + "libmd/sha512c.c", + ] + + ctx.cpu.source( + source, + alias="misc", + features="src_include src_include_rtems src_include_score" + ) + + ctx( + target = "rtemscpu", + use = [ + "auto_libcpu_objects" + ], + features = "c cstlib", + install_path = ctx.env.LIBDIR + ) + diff --git a/cpukit/zlib/wscript b/cpukit/zlib/wscript new file mode 100644 index 0000000000..3f0ce83d6a --- /dev/null +++ b/cpukit/zlib/wscript @@ -0,0 +1,35 @@ +def build(ctx): +# ctx( +# features = "subst", +# source = "zconf.h.in", +# target = "zconf.h", +# name = "libcpu_libz_zconf_h", +# before = ("c",) +# ) + + source = [ + "adler32.c", + "compress.c", + "crc32.c", + "deflate.c", + "gzclose.c", + "gzlib.c", + "gzread.c", + "gzwrite.c", + "infback.c", + "inffast.c", + "inflate.c", + "inftrees.c", + "trees.c", + "uncompr.c", + "zutil.c", + ] + + ctx.cpu.source( + source, + alias = "libz", +# cflags = ["-DZ_PREFIX", "-DZ_HAVE_UNISTD_H"], + includes = ctx.bldnode.bldpath(), + features = "src_include src_include_rtems", +# use = "libcpu_libz_zconf_h" + ) diff --git a/py/__init__.py b/py/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/py/config/TODO b/py/config/TODO new file mode 100644 index 0000000000..98d5e5bd96 --- /dev/null +++ b/py/config/TODO @@ -0,0 +1,2 @@ +* __init__.py imports 'defaults' from py.waf. This is not allowed as + RTEMS Config cannot be connected to the build. diff --git a/py/config/__init__.py b/py/config/__init__.py new file mode 100644 index 0000000000..6030c12e24 --- /dev/null +++ b/py/config/__init__.py @@ -0,0 +1,36 @@ +from .base import BuildConfig, Config, Default, Feature, Disable, Feature, Value +from .options import Option, Boolean, String, StringList, Integer +#from .tag import tag_map + +class RTEMSConfig(object): + """ + Main entry point for RTEMS Config + + :param dict default: Default options. + :param list config: Default configs. + + """ + + def __init__(self, default, config): + self.default = default # Dictionary of options. + self.config = config # List of configs. +# self.config = feature # List of features. + + def options_get(self, category=False): + """ + Return sorted list of options + + :param list category: Categories + + :returns: List of options optionally limited by categories. + :rtype: list + """ + + if category: + tmp = {} + for name, option in self.default.items(): + if not set(category).isdisjoint(option.tag): + tmp[name] = option + return [v for (k, v) in sorted(tmp.items())] + + return [v for (k, v) in sorted(self.default.items())] diff --git a/py/config/base.py b/py/config/base.py new file mode 100644 index 0000000000..dc43340386 --- /dev/null +++ b/py/config/base.py @@ -0,0 +1,410 @@ +try: + from configparser import ConfigParser, NoOptionError +except ImportError: + from ConfigParser import ConfigParser, NoOptionError + +from os.path import exists +from sys import version_info + +Default = None # Default value. +Disable = "-DISABLED-" # Disable this option +features_list = [] # Global features list. + + +def fatal(str): + print("FATAL: %s" % str) + exit(1) + + +class Value(object): + """Holds an option value internally. This acts in a similar fashion to a dictionary.""" + + def __init__(self, rc): + self.__dict__["options"] = {} + self.__dict__["rc"] = rc + + def __setattr__(self, key, value): + """Set a value, this either fetches the option or sets it if it already exists.""" + self._set_or_get(key, value) + + def __getitem__(self, key): + """Get an option from the internal table.""" + return self.options[key] + + def __getattr__(self, key): + """Allow an option to be fetched as an attribute.""" + return self.options[key] + + def _set_or_get(self, option, value): + """ + Set or get an option. + + :param option: Option name (string) + :param value: Value to set option + """ + + # Disabling an option removes it from the header completely irrespective of its type. + if type(value) == str and value == "-DISABLED-": + del self.options[option] + return + + if option not in self.options: + if option not in self.rc.default: + fatal("Missing default option: %s" % option) + opt = self.rc.default[option] # Get option class + i = opt(value) # Create option with value + self.options[i.name] = i # Set in dictionary + else: + i = self.options[option] + i.set(value) # Set value + + def __str__(self): + """String representation of a value object.""" + return "Value object at %s: %s" % (hex(id(self)), self.value) + + def __iter__(self): + """Allow iteration.""" + return iter(self.options) + + + +class Config(object): + feature = () #: Feature list (XXX: Why is this required?) + feature_default = ("gcc", "debug") #: Default features. + + def __init__(self, rc): + self.rc = rc + self.base = False #: Whether this is a base config or not. + self.option_header = Value(rc) #: Internal header options + self.option_build = Value(rc) #: Internal build options + + if hasattr(self, "bsp") and not hasattr(self, "descr"): + raise Exception("BSP.descr is required for BSPs") + + # Iterate over base classes in reverse order so the 'latest' + # defined option is taken. + for i in type(self).__mro__[::-1]: + if hasattr(i, "header"): + i.header(self, self.option_header) + if hasattr(i, "build"): + i.build(self, self.option_build) + + # Make sure features don't conflict with each other. + processed = [] + feature_obj = [x for x in features_list if x.name in self.feature] + for feature in feature_obj: + conflicts = set(processed) & set(feature.conflicts) + processed.append(feature.name) + if conflicts: + raise Exception("Feature %s conflicts with %s" % (feature.name, ", ".join(conflicts))) + feature(self) + + self.feature += self.feature_default # Features in this config + + + def header(self, c): + """ + Header config options. + + :param c: `self.option_header` + """ + pass + + + def build(self, c): + """ + Build config options. + + :param c: `self.build_header` + """ + pass + + # XXX: needs to merge both dictionaries and sort them. + def config_get(self): + """Get the config.cfg (.ini) format for this config.""" + str = "[%s]\n" % self.name + def add(d, str): + for o in sorted(d): + opt = d[o] + str += "%s" % opt.config_get() + str += "\n\n" + return str + + str = add(self.option_header, str) + str = add(self.option_build, str) + return str + + + + +class Feature(Config): + """Build feature base class""" + name = None #: Name of feature + description = None #: Description + exclude = None #: BSPs to exclude + include = None #: BSPs to include + conflicts = None #: Other features this one conflicts with + is_feature = True #: Whether this is a feature or not + + def __init__(self, parent): + self.build(parent.option_build) + self.header(parent.option_header) + + def __str__(self): + return "%s (%s)" % (self, self.name) + + + +class cfg_general(Config): + """[general] block for `config.cfg.`""" + name = "general" + def build(self, c): + c.BSP = Default + c.PREFIX = Default + c.PATH_TOOLS = Default + c.ENABLE_DEBUG = Default + c.CFLAGS = Default + c.LIBS = Default + c.LDFLAGS = Default + + +class cfg_host(Config): + """[host] block for `config.cfg.`""" + name = "host" + def build(self, c): + c.CFLAGS = Default + c.LIBS = Default + c.LDFLAGS = Default + + +class cfg_bsp(Config): + """[bsp] block for `config.cfg` to hold BSP-specific settings""" + name = "bsp" + def build(self, c): + c.ENABLE_DEBUG = Default + c.ENABLE_MP = Default + c.ENABLE_MULTILIB = Default + c.ENABLE_NETWORKING = Default + c.ENABLE_NEWLIB = Default + c.ENABLE_POSIX = Default + c.ENABLE_PTHREADS = Default + c.ENABLE_SERDBG = Default + c.ENABLE_SHELL = Default + c.ENABLE_SMP = Default + c.LINK_START = Default + c.LINK_END = Default + c.LINK_LINK = Default + c.ENABLE_SYSTEM_DEP = Default + + + + +class BuildConfig(object): + """ + This class handles creating and loading `config.cfg`. + """ + file_config = "config.cfg" #: Default config file name. + + def __init__(self, rc, list_bsp=[]): + self.cfg_default = [cfg_general(rc), cfg_host(rc), cfg_bsp(rc)] #: Default BSP configuration. + self.cfg = list(self.cfg_default) #: BSP config. + self.list_bsp = [] + self.rc = rc + + if list_bsp: + self.list_bsp = sorted(list_bsp) + elif not exists(self.file_config): + fatal("Missing config.cfg") + else: + # Load on-disk config. + self.cfg_user = ConfigParser() + self.cfg_user.read(self.file_config) + + # Set BSP list. + # XXX: Far too complicated due to chicken-and-egg issue. + # This will be refactored in the future. + tmp = cfg_general(self.rc) + opt = tmp.option_build["BSP"] + o = self.cfg_user.get("general", "BSP") + if version_info < (3,) and type(o) is unicode: #2to3 + o = str(o) + opt.set(o) + self.list_bsp = opt.value + + # Parse BSPs + self._parse_bsp(self.list_bsp) + + # Load user configuration + if not list_bsp: + self._cfg_user_load() + + # Make sure BSP= is always set. + self.option_set("general", "BSP", " " .join(self.list_bsp)) + + # XXX: this is not needed with the new system + def _parse_bsp(self, list_bsp): + """ + Parse BSP config. + + :param: list_bsp: List of BSPs in this config. + """ + + # Make this simplier + bsp_map = {} + + for b in self.list_bsp: + bsp = [x for x in self.rc.config if x.name == b][0] + + bsp_arch = [x for x in self.rc.config if x.arch == bsp.arch][0] + bsp_map.setdefault((bsp_arch.name, bsp_arch), []).append(bsp) + + # Save for usage in config_set + self.bsp_map = bsp_map + + for bsp_name, bsp_arch in sorted(bsp_map): +# self.cfg.append(bsp_arch(self.rc)) # XXX: [sparc] used to be its own section not anymore for now. + for bsp in bsp_map[(bsp_name, bsp_arch)]: + self.cfg.append(bsp(self.rc)) + + + def save(self): + """Save config to disk.""" + with open(self.file_config, "w") as fp: + fp.write(self._cfg_get()) + fp.write("\n\n") # Handy. + + + def config_set(self, ctx, cfg_name, arch_name=None): + """ + Apply config internally to waf. + + :param ctx: waf Context. + :param cfg_name: BSP config name (arch/bsp format). + :param arch_name: Architecture name. + """ + + cfg = None + if arch_name: +# self.config_set(ctx, arch_name) + cfg_name = "%s/%s" % (arch_name, cfg_name) + + for c in self.cfg: + if c.name == cfg_name: + cfg = c + break + + if not cfg: + fatal("BuildConfig:config_set(): Invalid config: %s" % cfg_name) + + for option in cfg.option_build: + opt = cfg.option_build[option] +# self._set_cfg_user(cfg_name, opt) + opt.set_config_build(ctx) + + for option in cfg.option_header: + opt = cfg.option_header[option] +# self._set_cfg_user(cfg_name, opt) + opt.set_config_header(ctx) + + + + def bsp_get_detail(self, arch, bsp): + cfg = None + + for c in self.rc.config: + if c.name == "%s/%s" % (arch, bsp): + cfg = c + break + + + if cfg is None: + raise Exception("MISSING BSP!") + + return cfg.descr + + + def option_set(self, cfg, option, value): + """ + Set an option within a config + + :param cfg: Config to set. + :param option: Option name. + :param value: Value to set. + """ + + for config in self.cfg_default: + if config.name == cfg: + # Only allow build options to be set for now. + for o in config.option_build: + opt = config.option_build[o] + if opt.name == option: + opt.set(value) + + def _cfg_get(self): + """Get config text.""" + cfg = "" + for bsp in self.cfg: + cfg += "\n\n" + cfg += bsp.config_get() + return cfg.strip() + + + #XXX: unused + def _cfg_add(self, str): + self.cfg += "\n" + self.cfg += str + + + def _cfg_user_load(self): + """Load user config from disk.""" + for cfg_bsp in self.cfg: + section = cfg_bsp.name + + if not self.cfg_user.has_section(section): + fatal("Missing section: [%s]" % section) + + for option in cfg_bsp.option_build: + opt = cfg_bsp.option_build[option] + + if not self.cfg_user.has_option(section, opt.name): + fatal("Missing Option in config: %s" % opt.name) + + o = self.cfg_user.get(section, opt.name) + + # configpaser does not convert values anymore. + if o in ["True", "False"]: + o = self.cfg_user.getboolean(section, opt.name) + + # We do not support unicode internally + if version_info < (3,) and type(o) is unicode: #2to3 + o = str(o) + + self._set_cfg_user(section, opt) + +# opt.set(o) + + for option in cfg_bsp.option_header: + opt = cfg_bsp.option_header[option] + self._set_cfg_user(section, opt) +# o = self.cfg_user.get(section, opt.name) +# opt.set(o) + + + def _set_cfg_user(self, section, opt): + if not self.cfg_user.has_section(section): + fatal("Missing section: [%s]" % section) + + o = self.cfg_user.get(section, opt.name) + + # configpaser does not convert values anymore. + if o in ["True", "False"]: + o = self.cfg_user.getboolean(section, opt.name) + + # We do not support unicode internally + if version_info < (3,) and type(o) is unicode: #2to3 + o = str(o) + + opt.set(o) + + + diff --git a/py/config/bsp.py b/py/config/bsp.py new file mode 100644 index 0000000000..3fc61cad62 --- /dev/null +++ b/py/config/bsp.py @@ -0,0 +1,423 @@ +from glob import glob + + +import inspect + +from imp import new_module +from copy import copy + + +# XXX: This should work in Windows? +def bsp_class(arch_only=None): + map_bsp = {} + bsp_py = glob("bsps/*/*/py/__init__.py") + + for i in bsp_py: + split = i.split("/") + + arch = split[1] + bsp = split[2] + + map_bsp.setdefault(arch, []).append(bsp) + + if arch_only: + return map_bsp[arch] + + return map_bsp + + +def get_option_class(): + map = {} + skip = ("Option", "Boolean", "String", "StringList", "Integer") + + + mod = new_module("RTEMS_OPTION") + + file = "py/config/options.py" + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + + file = "py/waf/option.py" + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + + list_bsp = bsp_class() + + for arch in list_bsp: + + file = "bsps/%s/py/option.py" % arch + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + + for bsp in list_bsp[arch]: + file = "bsps/%s/%s/py/option.py" % (arch, bsp) + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + + for i in mod.__dict__.keys(): + m = getattr(mod, i) + try: + if m.__module__ == "RTEMS_OPTION": + map[i] = m + except: + pass + + return map + + +# Collect a list of configs from a module +# XXX: Check to make sure only configs are passed to this, remove the 'skip' list. +def get_config_class(): + config_list = [] + skip = ("__class__", "Base", "Config") + + list_bsp = bsp_class() + + for arch in list_bsp: + mod = new_module("RTEMS_CONFIG") + file = "bsps/%s/py/base.py" % arch + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + for bsp in list_bsp[arch]: + file = "bsps/%s/%s/py/bsp.py" % (arch, bsp) + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + mod.BSP.name = "%s/%s" % (mod.BSP.arch, mod.BSP.bsp) + + config_list.append(mod.BSP) + + return config_list + + + + +# XXX: This should work in Windows? +def map_bsp(arch_only=None): + map_bsp = {} + + for i in get_config_class(): + if arch_only: + map_bsp[i.arch] + else: + map_bsp.setdefault(i.arch, []).append(i.bsp) + + return map_bsp + + + + + +""" +list_bsp = { + "arm": [ + "altcycv_devkit", + "altcycv_devkit_smp", + "arm1136jfs", + "arm1136js", + "arm7tdmi", + "arm920", + "armcortexa9", + "bbxm", + "beagleboardorig", + "beagleboardxm", + "beagleboneblack", + "beaglebonewhite", + "csb336", + "csb337", + "csb637", + "edb7312", + "gba", + "gp32", + "gumstix", + "kit637_v6", + "lm3s3749", + "lm3s6965", + "lm3s6965_qemu", + "lm4f120", + "lpc1768_mbed", + "lpc1768_mbed_ahb_ram", + "lpc1768_mbed_ahb_ram_eth", + "lpc17xx_ea_ram", + "lpc17xx_ea_rom_int", + "lpc17xx_plx800_ram", + "lpc17xx_plx800_rom_int", + "lpc2362", + "lpc23xx_tli800", + "lpc24xx_ea", + "lpc24xx_ncs_ram", + "lpc24xx_ncs_rom_ext", + "lpc24xx_ncs_rom_int", + "lpc24xx_plx800_ram", + "lpc24xx_plx800_rom_int", + "lpc32xx_mzx", + "lpc32xx_mzx_stage_1", + "lpc32xx_mzx_stage_2", + "lpc32xx_phycore", + "lpc40xx_ea_ram", + "lpc40xx_ea_rom_int", + "nds", + "raspberrypi", + "realview_pbx_a9_qemu", + "realview_pbx_a9_qemu_smp", + "rtl22xx", + "rtl22xx_t", + "smdk2410", + "stm32f105rc", + "stm32f4", + "tms570ls3137_hdk", + "tms570ls3137_hdk_intram", + "tms570ls3137_hdk_sdram", + "xilinx_zynq_a9_qemu", + "xilinx_zynq_zc702", + "xilinx_zynq_zc706", + "xilinx_zynq_zedboard", + ], + + "avr": [ + "avrtest", + ], + + "bfin": [ + "bf537stamp", + "ezkit533", + "tll6527m", + ], + + "h8300": [ + "h8sim", + "h8sxsim", + ], + + "i386": [ + "pc386", + "pc486", + "pc586", + "pc586-sse", + "pc686", + "pcp4", + ], + + "lm32": [ + "lm32_evr", + "milkymist", + ], + + "m32c": [ + "m32csim", + ], + + "m32r": [ + "m32rsim", + ], + + "m68k": [ + "av5282", + "cobra5475", + "csb360", + "gen68302", + "gen68340", + "gen68360", + "gen68360_040", + "idp", + "m5484fireengine", + "mcf5206elite", + "mcf52235", + "mcf5225x", + "mcf5235", + "mcf5329", + "mrm332", + "mvme136", + "mvme147", + "mvme147s", + "mvme162", + "mvme162lx", + "mvme167", + "ods68302", + "pgh360", + "sim68000", + "simcpu32", + "uc5282", + ], + + "mips": [ + "csb350", + "genmongoosev", + "hurricane", + "jmr3904", + "malta", + "rbtx4925", + "rbtx4938", + ], + + "moxie": [ + "moxiesim", + ], + + "nios2": [ + "nios2_iss", + ], + + "or1k": [ + "or1ksim", + "sim", + ], + + "powerpc": [ + "beatnik", + "br_uid", + "brs5l", + "brs6l", + "dp2", + "ep1a", + "gwlcfm", + "haleakala", + "hsc_cm01", + "icecube", + "mbx821_001", + "mbx821_002", + "mbx821_002b", + "mbx860_001b", + "mbx860_002", + "mbx860_005b", + "mbx860_1b", + "mcp750", + "mpc5566evb", + "mpc5566evb_spe", + "mpc5643l_dpu", + "mpc5643l_evb", + "mpc5668g", + "mpc5674f_ecu508_app", + "mpc5674f_ecu508_boot", + "mpc5674f_rsm6", + "mpc5674fevb", + "mpc5674fevb_spe", + "mpc8260ads", + "mpc8309som", + "mpc8313erdb", + "mpc8349eamds", + "mtx603e", + "mvme2100", + "mvme2307", + "mvme3100", + "mvme5500", + "pghplus", + "phycore_mpc5554", + "pm520_cr825", + "pm520_ze30", + "psim", + "qemuppc", + "qemuprep", + "qemuprep-altivec", + "qoriq_core_0", + "qoriq_core_1", + "qoriq_p1020rdb", + "score603e", + "ss555", + "t32mppc", + "tqm8xx_stk8xx", + "virtex", + "virtex4", + "virtex5", + ], + + "sh": [ + "gensh1", + "gensh2", + "gensh4", + "simsh1", + "simsh2", + "simsh2e", + "simsh4", + ], + + "sparc": [ + "erc32", + "leon2", + "leon3", + "ngmp", + "sis", + ], + + "sparc64": [ + "niagara", + "usiii", + ], + + "v850": [ + "v850e1sim", + "v850e2sim", + "v850e2v3sim", + "v850esim", + "v850essim", + "v850sim", + ] +} + + + +list_bsp = { + "arm": [ + "lm3s3749", + "lm3s6965", + "lm3s6965_qemu", + "lpc17xx_ea_ram", + "lpc17xx_ea_rom_int", + "lpc17xx_plx800_ram", + "lpc17xx_plx800_rom_int", + "lpc24xx_plx800_ram", + "lpc24xx_plx800_rom_int", + "raspberrypi", + "realview_pbx_a9_qemu", + "stm32f4", + "xilinx_zynq_a9_qemu", + ], + + "i386": [ + "pcp4", + ], + + "mips": [ + "malta", + ], + + "moxie": [ + "moxiesim", + ], + + "nios2": [ + "nios2_iss", + ], + + "powerpc": [ + "br_uid", + "brs6l", + "mpc5566evb_spe", + "mpc5643l_dpu", + "mpc5643l_evb", + "mpc5674f_ecu508_app", + "mpc5674f_ecu508_boot", + "mpc5674f_rsm6", + "mpc5674fevb", + "mpc5674fevb_spe", + "mpc8309som", + "phycore_mpc5554", + "qemuprep", + "qemuprep-altivec", + "qoriq_core_0", + "qoriq_core_1", + "qoriq_p1020rdb", + "t32mppc", + "virtex4", + "virtex5", + ], + + "v850": [ + "v850e1sim", + "v850e2sim", + "v850e2v3sim", + "v850esim", + "v850essim", + "v850sim", + ] +} +""" diff --git a/py/config/feature.py b/py/config/feature.py new file mode 100644 index 0000000000..cc28491834 --- /dev/null +++ b/py/config/feature.py @@ -0,0 +1,30 @@ +from .__init__ import Feature + +class FeatureGCC(Feature): + """GCC Compiler.""" + name = "gcc" + description = "GCC Compiler" + conflicts = ("clang",) + + def build(self, c): + c.USE_GCC = True + + +class FeatureClang(Feature): + """Clang Compiler.""" + name = "clang" + description = "Clang Compiler" + conflicts = ("gcc",) + + def build(self, c): + c.USE_CLANG = True + + +class FeatureDebug(Feature): + """Debug Options""" + name = "debug" + description = "Enable debug options" + + def build(self, c): + c.ENABLE_DEBUG = True + diff --git a/py/config/options.py b/py/config/options.py new file mode 100644 index 0000000000..e4165e51ee --- /dev/null +++ b/py/config/options.py @@ -0,0 +1,283 @@ +class Option(object): + """ + Base class for all Options + + .. py:attribute:: undef=True + + Whether to undefine the option in the header file when "disabled". + + .. py:attribute:: limit=None + + List or min,max to restrict the option to. Depends on option type. + + .. py:attribute:: quote=False + + Whether to quote the value in the header. + + .. py:attribute:: tag=list + + List of tags for this option. At least one is required. + """ + + tag_map = { + "general": "General settings", + "build": "Build options", + "network": "Network option", + "storage": "Storage option" + } + + + def __init__(self, value=None): + self.name = self.__class__.__name__ + + + # Do not set a default if no_default set. + if not hasattr(self, "no_default"): + self.no_default = True + + # Whether to quote the value + if not hasattr(self, "quote"): + self.quote = False + + # Tag sanity check. + if not hasattr(self, "tag") or not self.tag: + self._fatal("At least one tag is required") + elif type(self.tag) is not list: + self._fatal("%s.tag: must be a list().") + elif not set(self.tag).issubset(self.tag_map): + missing = [x for x in self.tag if x not in self.tag_map] + self._fatal("Tag(s) %s do not exist." % missing) + else: + duplicates = set([x for x in self.tag if self.tag.count(x) > 1]) + if duplicates: + self._fatal("duplicate tags: %s" % ", ".join(duplicates)) + + + # Value limit + if not hasattr(self, "limit"): + self.limit = None + + if value is not None: + self.validate(value) + self.value = value + elif self.no_default and not hasattr(self, "value"): + raise Exception("no_default is set you must supply a value in bsp config") + else: + self.validate(self.value) + + def __add__(self, value): + """ + Hack around only a _set. Need a _convert and _set in each type of option. + + :rtype: Depends on subclass + :return: Two options added together + """ + current = self.value + self._set(value) + optsum = self.value + self.value = current + return current + optsum + + + def validate(self, value): + """Validate option.""" + self._fatal("Must be set in subclass.") + + + def set(self, value): + """Set option value""" + if value is None: +# self.value = self.default #XXX: why is this here, a artifact? + return + + self._set(value) + + + def _fatal(self, str): + """Fatal error""" + raise Exception("(%s)%s: %s" % (self.__class__.__bases__[0].__name__, self.__class__.__name__, str)) + + + def config_get(self): + """ + Get string suitable for config.cfg + + :rtype: string + :return: Pre-formatted Windows `.ini` block. + """ + + from textwrap import TextWrapper + + wrapper = TextWrapper() + wrapper.width = 75 + wrapper.initial_indent = "# " + wrapper.subsequent_indent = "# " + + opt = [] + opt += wrapper.wrap(self.descr.strip()) + opt += ["%s = %s" % (self.__class__.__name__, self._str_value())] + return "\n".join(opt) + + + def _str_value(self): + """ + Get option as a string. + + :rtype: string + :return: Option value as a string. + """ + raise Exception("Needs to be implmented in subclass.") + + + def set_config_header(self, ctx): + """ + 1. If value is an integer always define it beacuse it could be 0. + 2. If value is empty "" or boolean=False undefine it + 3. if self.undef == True (undefine if false) undefine it. + + :param ctx: waf context + """ + if type(self.value) is not int and not self.value and self.undef: + ctx.undefine(self.name) + return + self._set_config_header(ctx) + + + def set_config_build(self, ctx): + """ + Set option inside waf as part of the build. + + :param ctx: waf context + """ + if type(self.value) is list: + ctx.env.append_value(self.name, self.value) + else: + setattr(ctx.env, self.name, self.value) + + + +class Boolean(Option): + """Boolean option value.""" + + def validate(self, value): + """Validate as one of: 1, 0, true, false""" + + if type(value) is not bool: + self._fatal("Not a boolean value (True|False): %s" % type(value)) + + def _str_value(self): + return str(self.value) + + # XXX: This is wrong (works for now!) + def _set(self, value): + + if type(value) is str: + if value.lower() == "true": + value = True + elif value.lower() == "false": + value = False + else: + self._fatal("Internal error in Boolean._set()") + + self.validate(value) + self.value = value + + def _set_config_header(self, ctx): + """Set value in config header.""" + + if self.undef: + ctx.define_cond(self.name, 1 if self.value else 0) + else: + ctx.define(self.name, 0) + + + + +class String(Option): + def validate(self, value): + """Verify value is a string and is in `limit` if defined.""" + if type(value) is not str: + self._fatal("Not a string: %s (%s)" % (value, type(value))) + + if self.limit: + if type(limit) is not list: + self._fatal("Only lists are supported as a limiter for strings.") + + if value not in limit: + self._fatal("%s not in list of accepted values: %s" % (value, limit)) + + def _str_value(self): + return self.value + + def _set(self, value): + """Set string, strips bounding whitespace.""" + self.validate(value) + self.value = value.strip() + + def _set_config_header(self, ctx): + """Define in header.""" + ctx.define(self.name, self.value, quote=self.quote) + + +class StringList(Option): + def validate(self, value): + """Validate list of strings""" + if type(value) is not list: + self._fatal("Not a list: %s (%s)" % (value, type(value))) + + for v in value: + if type(v) is not str: + self._fatal("Value %s is not a String." % v) + +#XXX: Needs to be fixed. +# if self.limit: +# if type(limit) is not list: +# self._fatal("Only lists are supported as a limiter for strings.") + +# if value not in limit: +# self._fatal("%s not in list of accepted values: %s" % (value, limit)) + + def _str_value(self): + return " ".join(self.value) + + def _set(self, value): + """Make sure value is a list otherwise split into one delimited by whitespace.""" + + if type(value) is not list: + value = value.split(" ") + value = [x for x in value if x] + + self.validate(value) + self.value = value + + def _set_config_header(self, ctx): + ctx.define(self.name, self.value, quote=self.quote) + + + +class Integer(Option): + def validate(self, value): + """Verify value is an int and in limit if defined.""" + if type(value) is not int: + self._fatal("Not an integer: %s (%s)" % (value, type(value))) + + if self.limit: + if type(limit) is list: + if value not in limit: + self._fatal("%s not in list of accepted values: %s" % (value, limit)) + + if type(limit) is tuple: + min, max = limit + if value < min or value > max: + self._fatal("%s is outside min/max: %s/%s" % (value, min, max)) + + def _str_value(self): + return str(self.value) + + def _set(self, value): + value = int(value) #XXX: configparser doesn't convert this anymore, sigh. + self.validate(value) + self.value = value + + def _set_config_header(self, ctx): + ctx.define(self.name, self.value, quote=self.quote) diff --git a/py/waf/.gitignore b/py/waf/.gitignore new file mode 100644 index 0000000000..0d20b6487c --- /dev/null +++ b/py/waf/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/py/waf/TODO b/py/waf/TODO new file mode 100644 index 0000000000..6a7df0e8d8 --- /dev/null +++ b/py/waf/TODO @@ -0,0 +1,73 @@ +Before Release +~~~~~~~~~~~~~~ + * Add a c.MCFLAGS which seperates machine flags -mXXX and -fXXX into + MCFLAGS and the rest into CFLAGS so machine code can be built + (eg, bootloader). RTEMS build would merge both, rtems-config will offer + them seperately if requested. + + +Configure +~~~~~~~~~ + * SIZEOF_MODE_T, SIZEOF_VOID_P, BLKSIZE_T... need to be dynamically + calculated in py/waf/configure.py + * Better warnings if an option or section is missing in config.cfg after + updating when a new option has been added and 'waf config' has not been + run. + + +General +~~~~~ + * Documentation + * Install mode (It can be used in-place w/out installing using rtems-config) + * Distribution (creating a tarball) + * Test runner + * Create a system to force options on/off/unavailable/make them required in a bsp-specific way + * Board targets so you can do waf config --board and have it setup everything + + + +Optimisations +~~~~~~~~~~~~~ + * Usage of ctx.srcnode.abspath() and others should result in one call, eg. + srcnode = ctx.srcnode.abspath() at the top then "%s" % srcnode. + * No BSP should take longer than 30s to build with maximum tests enabled. + * Profile waf when the build is running + + + +Options +~~~~~~~ + * LDFLAGS is LINKERFLAGS, make sure this is changed everywhere. + CCJ - not sure which direction to make the change so made it + LINKFLAGS -> LDFLAGS. + * LIBS may be the wrong variable name to use it is not waf-eqsue. + * Changed the default for the i386/pc586 bsp adding BSP_PRESS_KEY_FOR_RESET. + Did the config, configure, build and build tests and the setting + was not picked up. Changed the default networking setting and waf + rebuilt lots of files and then the bsp reset worked. + * Classes allow duplicate options -- this needs to throw an error to avoid + typos in the case two similar options, eg INTERFACE_TX, INTERFACE_RX. + +Future +~~~~~~ + * Support for building multiple branches at once + - Make previous branches use versioned build directories build-5.1, build-5.2 + + +Includes +~~~~~~~~ + * cache_.h + * Look at c/wscript_arm -> arm/realview_pbx_a9_qemu. + Other BSPs need to be fixed for cache_manager.c and console*, other bsps have been + hacked to include src_include_libcpu and src_include_bsp for all files this is wrong. + + +Enhancements +~~~~~~~~~~~~ + * Seperate logic to convert from string to internal python values in config/options.py + + +Config +~~~~~~ + * --path-tools= cannot be relative otherwise GCC cannot find its header files it must be absolute. + * Force re-gen of config.cfg if options change in the BSP config. "NoOptionError: No option 'bsp_verbose_fatal_extension' in section: 'sparc'" diff --git a/py/waf/__init__.py b/py/waf/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/py/waf/builder.py b/py/waf/builder.py new file mode 100644 index 0000000000..d0b3d476e8 --- /dev/null +++ b/py/waf/builder.py @@ -0,0 +1,125 @@ +class rtems_base(object): + name = None + + def __init__(self, ctx): + self.ctx = ctx + + if ctx.env.ENABLE_PTHREADS and not ctx.env.ENABLE_POSIX: + raise ValueError("ENABLE_POSIX required for ENABLE_PTHREADS") + + self.ctx( + name = "auto_%s_objects" % self.name, + use = [] + ) + + + def _get_id(self, name): + name_id = "auto_%s" % name + + try: + counter = self.ctx.counter + except AttributeError: + counter = self.ctx.counter = {} + + if name_id not in counter: + counter[name_id] = 0 + return "%s_0" % name_id + else: + counter[name_id] += 1 + return "%s_%d" % (name_id, counter[name_id]) + + + def _obj_add(self, name, source, **kwarg): + + if "test" in kwarg: + if not kwarg["test"]: + return + + if "alias" in kwarg: + name = "%s_%s" % (name, kwarg["alias"]) + + id = self._get_id(name) + + self.ctx.rtems_obj( + id, + source, + **kwarg + ) + + #XXX: Is this OK? + for g in self.ctx.groups[0]: + if g.get_name() == "auto_%s_objects" % self.name: + g.use.append(id) + + def start(self, source, defines=[]): + from os.path import splitext, basename + + for s in source: + file = splitext(basename(s))[0] + self.ctx( + rule = '${CC} -DASM ${CFLAGS} ${CPPFLAGS} ${DEFINES_ST:DEFINES} ${CPPPATH_ST:INCPATHS} -c -o ${TGT} ${SRC}', + source = s, + target = "%s.o" % file, + name = "start_%s_o" % file, + features = "c casm bld_include src_include src_include_score src_include_rtems src_include_bsp", + defines = defines, + ) + + def source(self, source, **kwarg): + self._obj_add(self.name, source, **kwarg) + + def debug(self, source, **kwarg): + if self.ctx.env.ENABLE_DEBUG: + self._obj_add("%s_debug" % self.name, source, **kwarg) + + def mp(self, source, **kwarg): + if self.ctx.env.ENABLE_MP: + self._obj_add("%s_mp" % self.name, source, **kwarg) + + def multilib(self, source, **kwarg): + if self.ctx.env.ENABLE_MULTILIB: + self._obj_add("%s_multilib" % self.name, source, **kwarg) + + def networking(self, source, **kwarg): + if self.ctx.env.ENABLE_NETWORKING: + self._obj_add("%s_networking" % self.name, source, **kwarg) + + def newlib(self, source, **kwarg): + if self.ctx.env.ENABLE_NEWLIB: + self._obj_add("%s_newlib" % self.name, source, **kwarg) + + def posix(self, source, **kwarg): + if self.ctx.env.ENABLE_POSIX: + self._obj_add("%s_posix" % self.name, source, **kwarg) + + def pthreads(self, source, **kwarg): + # pthreads requires POSIX + if self.ctx.env.ENABLE_PTHREADS and self.ctx.env.ENABLE_POSIX: + self._obj_add("%s_pthreads" % self.name, source, **kwarg) + + def rpc(self, source, **kwarg): + if self.ctx.env.ENABLE_RPC: + self._obj_add("%s_rpc" % self.name, source, **kwarg) + + def serdbg(self, source, **kwarg): + if self.ctx.env.ENABLE_SERDBG: + self._obj_add("%s_serdbg" % self.name, source, **kwarg) + + def shell(self, source, **kwarg): + if self.ctx.env.ENABLE_SHELL: + self._obj_add("%s_shell" % self.name, source, **kwarg) + + def smp(self, source, **kwarg): + if self.ctx.env.ENABLE_SMP: + self._obj_add("%s_smp" % self.name, source, **kwarg) + + +class libcpu(rtems_base): + name = "libcpu" + +class libbsp(rtems_base): + name = "libbsp" + + def fpsp(self, source, **kwarg): + if self.ctx.env.ENABLE_FPSP: + self._obj_add("%s_fpsp" % self.name, source, **kwarg) diff --git a/py/waf/compat.py b/py/waf/compat.py new file mode 100644 index 0000000000..5c58f9b9bb --- /dev/null +++ b/py/waf/compat.py @@ -0,0 +1,20 @@ +# Compat code for python 2<->3. + + +# Borrowed from the Six package: https://pypi.python.org/pypi/six +# Copyright (c) 2010-2015 Benjamin Peterson +def add_metaclass(metaclass): + """Class decorator for creating a class with a metaclass.""" + def wrapper(cls): + orig_vars = cls.__dict__.copy() + slots = orig_vars.get('__slots__') + if slots is not None: + if isinstance(slots, str): + slots = [slots] + for slots_var in slots: + orig_vars.pop(slots_var) + orig_vars.pop('__dict__', None) + orig_vars.pop('__weakref__', None) + return metaclass(cls.__name__, cls.__bases__, orig_vars) + return wrapper + diff --git a/py/waf/configure.py b/py/waf/configure.py new file mode 100644 index 0000000000..a85ceb49b9 --- /dev/null +++ b/py/waf/configure.py @@ -0,0 +1,474 @@ +from waflib.Logs import pprint +pprint.__doc__ = None # Make sure waf doesn't see this as a command. +from waflib.Utils import subprocess + +# TODO +# __attribute__((weak) will not work on a cross compile. +# __RTEMS_SIZEOF_VOID_P__ + + +# XXX: BSP hacks that need to be addressed / resolved. +def bsp_hack(ctx, bsp): + if bsp == "m68k/mvme167": + # PowerPC unfortunatly uses macros to define this instead of an integer. + # We need to choose one or the other. + ctx.define('CONSOLE_MINOR', 1) + ctx.define('PRINTK_MINOR', 1) + + # I have no idea why it was done this way. + if bsp.startswith("arm/xilinx_zynq_") and ctx.env.ENABLE_SMP: + ctx.env.ZYNQ_CPUS = 2 + + +# general +def config_h(ctx): + # Are these even needed? + ctx.define_cond('ENABLE_DEBUG', ctx.env.ENABLE_DEBUG) + ctx.define_cond('ENABLE_MP', ctx.env.ENABLE_MP) + ctx.define_cond('ENABLE_MULTILIB', ctx.env.ENABLE_MULTILIB) + ctx.define_cond('ENABLE_NETWORKING', ctx.env.ENABLE_NETWORKING) + ctx.define_cond('ENABLE_NEWLIB', ctx.env.ENABLE_NEWLIB) + ctx.define_cond('ENABLE_POSIX', ctx.env.ENABLE_POSIX) + ctx.define_cond('ENABLE_PTHREADS', ctx.env.ENABLE_PTHREADS) + ctx.define_cond('ENABLE_SERDB', ctx.env.ENABLE_SERDB) + ctx.define_cond('ENABLE_SHELL', ctx.env.ENABLE_SHELL) + ctx.define_cond('ENABLE_SMP', ctx.env.ENABLE_SMP) + + header = ["sys/types.h", "sys/stat.h", "stdlib.h", "memory.h", "string.h", "strings.h", "inttypes.h", "stdint.h", "unistd.h", "getopt.h", "libgen.h"] + for file in header: + ctx.check(header_name=file, features='c cprogram', mandatory=False) + + ctx.check_inline() + ctx.check_func_header('strerror', header_n="string.h", mandatory=True) + ctx.check_func_header('strtol', header_n=["stdlib.h", "limits.h"], mandatory=True) + ctx.check_func_header('basename', header_n="libgen.h", mandatory=True) + + +# cpukit/ +def config_h_libcpu(ctx): + # Mandated by POSIX, decls not present in some versions of newlib, + # some versions stubbed in newlib's rtems crt0 + + + files = ["seteuid", "geteuid", "setegid", "getegid", "setuid", "getuid", "setgid", "getgid", "setsid", "getsid", "setpgid", "getpgid", "setpgrp", "getpgrp"] + for f in files: + ctx.check_func_header(f, header_n="unistd.h", mandatory=False) + + + # Mandated by POSIX, decls not present in some versions of newlib + ctx.check_func_header('flockfile', header_n="stdio.h", mandatory=False) + ctx.check_func_header('funlockfile', header_n="stdio.h", mandatory=False) + ctx.check_func_header('ftrylockfile', header_n="stdio.h", mandatory=False) + + # BSD-isms, used throughout the sources. + func = ["strsep", "strcasecmp", "snprintf", "strdup", "strndup", "strncasecmp", "bcopy", "bcmp", "isascii", "fileno", "strlcpy", "strlcat", "sbrk"] + + # Check for functions supplied by newlib >= 1.17.0 Newlib's posix/ directory + func += ["readdir_r", "isatty", "creat", "opendir", "closedir", "readdir", "rewinddir", "scandir", "seekdir", "sleep", "telldir", "usleep", "__assert", "execl", "execlp", "execle", "execv", "execvp", "execve", "regcomp", "regexec", "regerror", "regfree"] + + # Newlib's unix/ directory + func += ["ttyname", "getcwd"] + for f in func: + ctx.check_func(f, mandatory=False) + + + header = ["tar.h", "errno.h", "sched.h", "sys/cdefs.h", "sys/queue.h", "stdint.h", "inttypes.h", "pthread.h"] + for file in header: + ctx.check(header_name=file, features='c cprogram') + + ctx.check(header_name="pthread.h", features='c cprogram') + + ctx.check_type('pthread_rwlock_t', header_n="pthread.h", mandatory=False) + ctx.check_type('pthread_barrier_t', header_n="pthread.h", mandatory=False) + ctx.check_type('pthread_spinlock_t', header_n="pthread.h", mandatory=False) + ctx.check_func_decl("int pthread_setschedparam(pthread_t, int, const struct sched_param *)", "pthread.h", "PTHREAD_SETSCHEDPARAM_CONST") + ctx.check_func_decl("int pthread_mutex_getprioceiling(const pthread_mutex_t *__restrict, int *)", "pthread.h", "PTHREAD_MUTEX_GETCEILING_CONST") + + ctx.check_func_decl("int mprotect(const void *, size_t, int)", "sys/mman.h", "MPROTECT_CONST") + +#HAVE_PTHREAD_SETSCHEDPARAM_CONST +#include +#int pthread_setschedparam(pthread_t, int, const struct sched_param *); + + + # pthread-functions not declared in some versions of newlib. + ctx.check_func_header('pthread_attr_getguardsize', header_n="pthread.h", mandatory=False) + ctx.check_func_header('pthread_attr_setguardsize', header_n="pthread.h", mandatory=False) + ctx.check_func_header('pthread_attr_setstack', header_n="pthread.h", mandatory=False) + ctx.check_func_header('pthread_attr_getstack', header_n="pthread.h", mandatory=False) + + ctx.check(header_name="signal.h", features='c cprogram') + ctx.check_type('sighandler_t', header_n="signal.h", mandatory=False) + + # FIXME: Mandatory in SUSv4, optional in SUSv3. + # Not implemented in GCC/newlib, so far. + ctx.check_define("WORD_BIT", "limits.h") + ctx.check_define("LONG_BIT", "limits.h") + +# ctx.check_define("CLOCK_PROCESS_CPUTIME_ID", "time.h") +# ctx.check_define("CLOCK_THREAD_CPUTIME_ID", "time.h") + + types = [ + "uint8_t", "int8_t", + "uint16_t", "int16_t", + "uint32_t", "int32_t", + "uint64_t", "int64_t", + "uintmax_t", "intmax_t", + "uintptr_t", "intptr_t" + ] + for type in types: + ctx.check_type(type, header_n="stdint.h", mandatory=False) + +# ctx.check_size("mode_t") +# ctx.define_cond('HAVE_MD5', True) # XXX: hack for cpukit/mghttpd/mongoose.c + ctx.define('__RTEMS_SIZEOF_MODE_T__', 4) # XXX: This is a hack for cpukit/libfs/src/nfsclient/src/dirutils.c + ctx.define('__RTEMS_SIZEOF_VOID_P__', 4) + ctx.define('__RTEMS_SIZEOF_OFF_T__', 8) + ctx.define('__RTEMS_SIZEOF_TIME_T__', 4) # XXX: hack for cpukit/libmisc/uuid/gen_uuid.c + ctx.define('__RTEMS_SIZEOF_BLKSIZE_T__', 4) # XXX: hack for tests + ctx.define('__RTEMS_SIZEOF_BLKCNT_T__', 4) # XXX: hack +# ctx.check_size("off_t") +# ctx.check_size("void *", define_name="SIZEOF_VOID_P") + + ctx.define('__RTEMS_HAVE_DECL_SIGALTSTACK__', 1) + + ctx.define('HAVE_DECL_PTHREAD_ATTR_GETAFFINITY_NP', 1) + ctx.define('HAVE_DECL_PTHREAD_ATTR_GETGUARDSIZE', 1) + ctx.define('HAVE_DECL_PTHREAD_ATTR_GETSTACK', 1) + ctx.define('HAVE_DECL_PTHREAD_ATTR_SETAFFINITY_NP', 1) + ctx.define('HAVE_DECL_PTHREAD_ATTR_SETGUARDSIZE', 1) + ctx.define('HAVE_DECL_PTHREAD_ATTR_SETSTACK', 1) + ctx.define('HAVE_DECL_PTHREAD_GETAFFINITY_NP', 1) + ctx.define('HAVE_DECL_PTHREAD_SETAFFINITY_NP', 1) + + +def version_header_info(ctx, config): + ctx.define('__RTEMS_MAJOR__', config["rtems_version_major"]) + ctx.define('__RTEMS_MINOR__', config["rtems_version_minor"]) + ctx.define('__RTEMS_REVISION__', config["rtems_version_revision"]) + ctx.define('RTEMS_VERSION', ctx.env.RTEMS_VERSION) + ctx.define('RTEMS_BSP', ctx.env.RTEMS_BSP) + + +# c/ +def config_h_libbsp(ctx): + ctx.define('__RTEMS_SIZEOF_VOID_P__', 4) + + +def cpuopts_h(ctx): + ctx.define_cond('__RTEMS_USE_TICKS_FOR_STATISTICS__', False) # disable nanosecond granularity for statistics + ctx.define_cond('__RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__', False) # disable nanosecond granularity for cpu usage statistics + ctx.define_cond('__RTEMS_USE_TICKS_RATE_MONOTONIC_STATISTICS__', False) # disable nanosecond granularity for period statistics + ctx.define_cond('__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__', False) # disable inlining _Thread_Enable_dispatch (This improves both the size and coverage analysis.) + ctx.define_cond('__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__', False) # disable inlining _Thread_Enable_dispatch (This improves both the size and coverage analysis.) + ctx.define_cond('__RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY__', False) # disable inlining _Thread_queue_Enqueue_priority (This improves both the size and coverage analysis.) + ctx.define_cond('__RTEMS_STRICT_ORDER_MUTEX__', False) # disable strict order mutex (This gives the same behavior as 4.8 and older) + ctx.define_cond('__RTEMS_ADA__', False) # ada/gnat bindings are built-in (Deactivate ada bindings) + + ctx.define_cond('RTEMS_DEBUG', ctx.env.ENABLE_DEBUG) + ctx.define_cond('RTEMS_MULTIPROCESSING', ctx.env.ENABLE_MP) + ctx.define_cond('RTEMS_NETWORKING', ctx.env.ENABLE_NETWORKING) + ctx.define_cond('RTEMS_NEWLIB', ctx.env.ENABLE_NEWLIB) + ctx.define_cond('RTEMS_POSIX_API', ctx.env.ENABLE_POSIX) + ctx.define_cond('RTEMS_SMP', ctx.env.ENABLE_SMP) + + +def depend_version(ctx): + ctx.start_msg("Checking GCC version") + ctx.get_cc_version(ctx.env.CC, gcc=True) + ctx.end_msg(".".join(ctx.env.CC_VERSION)) + + ctx.start_msg("Checking Binutils version") + cmd = ctx.env.BIN_RTEMS_LD + ["-v"] + ctx.env.LD_VERSION = ctx.cmd_and_log(cmd, quiet=0).strip().split(" ")[-1] + ctx.end_msg(ctx.env.LD_VERSION) + + +def build_config(ctx): + ctx.start_msg("DEVEL: Collecting compiler configuration") + cmd = ctx.env.CC + ["-dM", "-E", "-"] + p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=None) + p.stdin.write("\n") + gcc_config, stderr = p.communicate() + ctx.end_msg("Done") + + + # XXX: Add 'M' if it is modified see vc-key.sh + ctx.start_msg("DEVEL: Getting revision") + cmd = ["git", "log", "-1", "--format=%H"] + p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=None) + ctx.env.REVISION, stderr = p.communicate() + ctx.env.REVISION = ctx.env.REVISION.replace("\n", "") + ctx.end_msg(ctx.env.REVISION) + + with open("build/c4che/%s/%s_cache.py" % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP), "r") as fp: + cache_data = fp.read() + + ctx.start_msg("DEVEL: Writing build information") + from json import JSONEncoder + from time import strftime + + data = JSONEncoder(sort_keys=True).encode({ + "time": int(strftime("%s")), # There is no better way to get seconds across lal platforms? + "revision": ctx.env.REVISION, + "bsp": ctx.env.RTEMS_BSP, + "architecture": ctx.env.RTEMS_ARCH, + "version": { + "gcc": ".".join(ctx.env.CC_VERSION), + "binutils": ctx.env.LD_VERSION + }, + "waf_cache": cache_data, + "gcc_config": gcc_config + }) + file = "build/c4che/%s/build_%s.json" % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP) + with open(file, "w") as fp: + fp.write(data) + ctx.end_msg(file) + + +def cmd_configure(ctx, config): + ctx.load('waf', tooldir='py/waf/') + ctx.load('waf_unit_test') + + from py.config.bsp import get_option_class, get_config_class + from py.config import BuildConfig, RTEMSConfig + + rc = RTEMSConfig(get_option_class(), get_config_class()) + cfg = BuildConfig(rc) + + # Misc funcs + def yesno(val): + return "Yes" if val else "No" + + def write_header(header): + ctx.start_msg("Writing configuration header:") + ctx.write_config_header(header) + ctx.end_msg(header, "PINK") + + def msg(str): + pprint("YELLOW", str) + + def msg_setting(name, val): + pprint("NORMAL", " %-30s: " % name, sep="") + pprint("YELLOW", val) + + + + ###### + # HOST + ###### + + msg("") + msg("--- General Settings ---") + cfg.config_set(ctx, "general") + + ctx.env.RTEMS_VERSION = "%d.%d.%d" % (config["rtems_version_major"], config["rtems_version_minor"], config["rtems_version_revision"]) + ctx.env.RTEMS_VERSION_DATA = "%d.%d" % (config["rtems_version_major"], config["rtems_version_minor"]) + + ctx.env.LIBDIR = "%s/lib" % ctx.env.PREFIX + ctx.env.BINDIR = "%s/bin" % ctx.env.PREFIX + + + + msg("") + msg("--- Host Settings ---") + ctx.setenv('host', ctx.env.derive()) + ctx.load('compiler_c') + ctx.load('compiler_cxx') + + + + if ctx.options.dev_config: + ctx.start_msg('BUILD: Gathering build platform details.') + + # General + from socket import gethostname + from waflib.Utils import unversioned_sys_platform + import platform + + ctx.env.BUILD_HOSTNAME = gethostname() + ctx.env.BUILD_PLATFORM = unversioned_sys_platform() + ctx.env.BUILD_ARCHITECTURE = platform.architecture() + ctx.env.BUILD_MACHINE = platform.machine() + ctx.env.BUILD_PLATFORM = platform.platform() + ctx.env.BUILD_PYTHON_BUILD = platform.python_build() + ctx.env.BUILD_SYSTEM = platform.system() + + # Unix + ctx.env.BUILD_SIGNATURE = platform.uname() + + # Linux + #platform.libc_ver() + #platform.linux_distribution() + + # Windows + #platform.win32_ver() + + ctx.end_msg("Done") + + + ctx.check_library() +# ctx.check_cc(function_name='strerror', header_name="string.h", mandatory=True) +# ctx.check_cc(function_name='strtol', header_name=["stdlib.h", "limits.h"], mandatory=True) +# ctx.check_cc(function_name='basename', header_name="libgen.h", mandatory=True) + + files = ["getopt.h", "libgen.h"] + for f in files: + ctx.check(header_name=f, features='c cprogram') + + # Locate python binary for rtems-config + ctx.find_program("python", var='BIN_PYTHON') + + # Debug + if ctx.options.dev_json: + ctx.env.BUILD_JSON = True + + #XXX: TEMP! + if ctx.options.enable_tests: + ctx.env.ENABLE_TESTS = True + + cfg.config_set(ctx, "host") + write_header("host/include/config.h") + + # Set general BSP options + cfg.config_set(ctx, "bsp") + + # Set timetstamp of config.cfg to enforce re-running configure if it is changed. + from .tools import get_file_mtime + ctx.env.CONFIG_TIMESTAMP = get_file_mtime("config.cfg") + + # Always start with a pristeen env while looping. + env_orig = ctx.env + for bsp in ctx.env.BSP: + +# if ctx.env.ENABLE_SYSTEM_DEP: +# from waflib.Tools import c_preproc +# c_preproc.go_absolute=True + + msg("") + msg("--- Configuring %s ---" % bsp) + ctx.setenv(bsp, env_orig.derive()) + + (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP) = bsp.split("/") + + if ctx.env.ENABLE_PTHREADS: + ctx.define("HAS_PTHREADS", 1) + + + if ctx.env.ENABLE_PTHREADS and not ctx.env.ENABLE_POSIX: + ctx.fatal("Must be built with posix support (ENABLE_POSIX) when using pthreads (ENABLE_PTHREADS)") + + # XXX: Joel says this shouldn't be nessicary. + if ctx.env.ENABLE_MP and not ctx.env.ENABLE_POSIX: + ctx.fatal("Must be built with posix support (ENABLE_POSIX) when using MP (ENABLE_MP)") + + + # Miscellanous setup. + ctx.env.RTEMS_VERSION = "%d.%d.%d.%d" % (config["rtems_version_major"], config["rtems_version_minor"], config["rtems_version_revision"], config["rtems_version_patch"]) + ctx.env.RTEMS_VERSION_DATA = "%d.%d" % (config["rtems_version_major"], config["rtems_version_minor"]) + ctx.env.RTEMS_TOOL_VERSION = config["rtems_tool_version"] + ctx.env.append_value('CFLAGS', '-DHAVE_CONFIG_H') + ctx.env.append_value('CFLAGS', '-D__rtems_%s_%s__' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP.replace("-", "_"))) + ctx.env.LIBDIR = "%s/lib/rtems/%s/%s-%s/" % (ctx.env.PREFIX, ctx.env.RTEMS_VERSION_DATA, ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP) + ctx.env.BINDIR = ctx.env.LIBDIR + +#XXX: Re-add after things are fixed. + # Enforce required values. +# required = ["LINKCMDS", "LINK_START", "LINK_END"] +# for value in required: +# if not ctx.env[value]: +# ctx.fatal("%s must be defined in [%s]" % (value, bsp)) + + #XXX: ARM hack + if ctx.env.RTEMS_ARCH == "arm": + ctx.env.LDFLAGS = ctx.env.CFLAGS + + + # Tools. + ctx.find_program('%s-rtems%s-ar' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_TOOL_VERSION), var='BIN_RTEMS_AR', path_list=ctx.env.PATH_TOOLS) + ctx.find_program('%s-rtems%s-as' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_TOOL_VERSION), var='BIN_RTEMS_AS', path_list=ctx.env.PATH_TOOLS) + ctx.find_program('%s-rtems%s-g++' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_TOOL_VERSION), var='BIN_RTEMS_CPP', path_list=ctx.env.PATH_TOOLS, mandatory=False) + ctx.find_program('%s-rtems%s-gcc' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_TOOL_VERSION), var='BIN_RTEMS_CC', path_list=ctx.env.PATH_TOOLS) + ctx.find_program('%s-rtems%s-ld' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_TOOL_VERSION), var='BIN_RTEMS_LD', path_list=ctx.env.PATH_TOOLS) + ctx.find_program('%s-rtems%s-nm' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_TOOL_VERSION), var='BIN_RTEMS_NM', path_list=ctx.env.PATH_TOOLS) + ctx.find_program('%s-rtems%s-ranlib' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_TOOL_VERSION), var='BIN_RTEMS_RANLIB', path_list=ctx.env.PATH_TOOLS) + ctx.find_program('%s-rtems%s-strip' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_TOOL_VERSION), var='BIN_RTEMS_STRIP', path_list=ctx.env.PATH_TOOLS) + ctx.find_program('%s-rtems%s-run' % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_TOOL_VERSION), var='BIN_RTEMS_RUN', path_list=ctx.env.PATH_TOOLS, mandatory=False) + ctx.env.AR = ctx.env.BIN_RTEMS_AR + ctx.env.AS = ctx.env.BIN_RTEMS_AS + ctx.env.CC = ctx.env.BIN_RTEMS_CC + ctx.env.CPP = ctx.env.BIN_RTEMS_CPP + ctx.env.RANLIB = ctx.env.BIN_RTEMS_RANLIB + ctx.env.STRIP = ctx.env.BIN_RTEMS_STRIP + ctx.env.LD = ctx.env.BIN_RTEMS_LD + ctx.env.LINK_CC = ctx.env.BIN_RTEMS_CC + ctx.env.LINK_CXX = ctx.env.BIN_RTEMS_CCP + + + # Config (config.h) + config_h(ctx) + config_h_libcpu(ctx) + version_header_info(ctx, config) + cpuopts_h(ctx) #XXX: duplicate info. + write_header("%s/include/config.h" % bsp) + + # BSP options. + cfg.config_set(ctx, ctx.env.RTEMS_BSP, ctx.env.RTEMS_ARCH) + bsp_hack(ctx, bsp) + write_header("%s/include/bspopts.h" % ctx.variant) + config_h_libbsp(ctx) # Eventually there will be an option to exclude this and replace it with something custom. + + # CPU options. + cpuopts_h(ctx) + version_header_info(ctx, config) + write_header("%s/include/rtems/score/cpuopts.h" % bsp) + + ctx.start_msg('Generating GCC spec file') + from py.waf.tools import generate_gcc_spec_file + spec_file = generate_gcc_spec_file(ctx, devel=True) + ctx.end_msg(spec_file) + + + depend_version(ctx) + if ctx.options.dev_config: + build_config(ctx) + + + msg("") + msg("--- Settings for %s ---" % bsp) + msg_setting("Enable Networking", yesno(ctx.env.ENABLE_NETWORKING)) + msg_setting("Enable Multiprocessing", yesno(ctx.env.ENABLE_MP)) + msg_setting("Enable Multilib", yesno(ctx.env.ENABLE_MULTILIB)) + msg_setting("Enable POSIX", yesno(ctx.env.ENABLE_POSIX)) + msg_setting("Enable SMP", yesno(ctx.env.ENABLE_SMP)) + msg_setting("Enable pthreads", "%s (Depends on POSIX)" % yesno(ctx.env.ENABLE_PTHREADS)) + msg("") + msg("Build Options") + msg_setting("CC", " ".join(ctx.env.CC)) + msg_setting("CFLAGS", " ".join(ctx.env.CFLAGS)) + msg_setting("LDFLAGS", " ".join(ctx.env.LDFLAGS)) + + + # Reset the env back to the original in order to print the proper settings below. + ctx.setenv("host", env_orig.derive()) + + msg("") + ctx.start_msg('Generating rtems-config') + from py.waf.tools import generate_rtems_config + generate_rtems_config(ctx, "py/waf/rtems_config.py", "rtems-config", devel=True) + ctx.end_msg("Done") + + + msg("") + msg("--- General Settings (applies to all) --- ") + msg_setting("Enabled BSPs", ", ".join(ctx.env.BSP)) + msg_setting("Install Prefix", ctx.env.PREFIX) + msg_setting("Tool Directory", ctx.env.PATH_TOOLS) + msg("") + msg("Build Options") + msg_setting("CFLAGS", " ".join(ctx.env.CFLAGS)) + msg_setting("LDFLAGS", " ".join(ctx.env.LDFLAGS)) + msg_setting("Enable Debug", yesno(ctx.env.ENABLE_DEBUG)) + + + diff --git a/py/waf/debug.py b/py/waf/debug.py new file mode 100644 index 0000000000..d0c2a02ce9 --- /dev/null +++ b/py/waf/debug.py @@ -0,0 +1,95 @@ +from hashlib import sha256 +from os.path import exists +from json import JSONEncoder +from time import time +import logging +from logging.handlers import MemoryHandler +from waflib.Task import Task +from waflib.Utils import subprocess, check_dir +from waflib.Logs import debug + +from os.path import dirname + +#from cStringIO import StringIO +#from waflib import Utils + +def logger_json_create(ctx): + logger = logging.getLogger('build.json') + logger.setLevel(logging.INFO) + + if ctx.variant == "host": + file = "%s/logs/host.json" % ctx.out_dir + else: + file = "%s/logs/%s.json" % (ctx.out_dir, ctx.variant) + + check_dir(dirname(file)) + filetarget = logging.FileHandler(file, mode="w") + memoryhandler = MemoryHandler(1048576, target=filetarget) + + logger.addHandler(memoryhandler) + + return logger + + +def hash_files(files): + h = [] + for file in files: + if exists(file): + fp = open(file, "r") + h.append((file, sha256(fp.read()).hexdigest())) + fp.close() + return h + + +def exec_command_json(self, cmd, **kw): +# subprocess = Utils.subprocess + kw['shell'] = isinstance(cmd, str) + + debug('runner_env: kw=%s' % kw) + + try: + record = {} + record["time"] = time() + record["command"] = cmd + recoard["variant"] = ctx.variant + + task_self = kw["json_task_self"] + record["type"] = task_self.__class__.__name__ + + del kw["json_task_self"] + + record["inputs"] = [x.srcpath() for x in task_self.inputs] + record["outputs"] = [x.srcpath() for x in task_self.outputs] + record["cflags"] = self.env.CFLAGS + record["cc"] = self.env.CC + + kw['stdout'] = kw['stderr'] = subprocess.PIPE + + time_start = time() + p = subprocess.Popen(cmd, **kw) + (stdout, stderr) = p.communicate() + record["time_duration"] = time() - time_start + + if stdout: + record["stdout"] = stdout + if stderr: + record["stderr"] = stderr + + record["hash"] = {} + record["hash"]["inputs"] = hash_files(record["inputs"]) + record["hash"]["outputs"] = hash_files(record["outputs"]) + + record["retval"] = p.returncode + data = JSONEncoder(sort_keys=False, indent=False).encode(record) + + self.logger_json.info(data) + + return p.returncode + + except OSError: + return -1 + + +def exec_command_json_extra(self, cmd, **kw): + kw["json_task_self"] = self + self.exec_command_real(cmd, **kw) diff --git a/py/waf/docs.py b/py/waf/docs.py new file mode 100644 index 0000000000..1f00ebfd95 --- /dev/null +++ b/py/waf/docs.py @@ -0,0 +1,130 @@ +from bsp import list_bsp +from py.config.base import config_list + + +def header(): + return """ + + + + + List of RTEMS BSP Options + + + + + + + + +
+ """ + + +def footer(): + return """ +
+ + + """ + + +TABLE_START = """ + + +""" + +TABLE_END = """ +
OptionDefault ValueDescription
+""" + +TABLE_ROW =""" + + %s + %s + %s + +""" + +BSP_HEADING = """ +
+
+

%s

+""" + +TABLE_HEADING = """ +
+%s +""" + + +def rtems_cmd_docs(ctx): + fp = open(ctx.options.file_out, "w") + fp.write(header()) + + full = [] + for arch in list_bsp: + full.append(arch) + for bsp in list_bsp[arch]: + full.append("%s/%s" % (arch, bsp)) + + all = ["general", "host"] + sorted(full) + + def cfg_get(entry): + for config in config_list: + if config.name == entry: + return config +# raise Exception("Not found %s" % entry) # XXX: Because not all BSPs are added. + + for entry in all: + cfg = cfg_get(entry) + + if cfg == None: + continue # XXX: Hack because not all BSPs are added. +# print cfg.name, cfg + + c = cfg() + + fp.write(BSP_HEADING % c.name) + def print_opt(name, values): + if not list(values): + return + + fp.write(TABLE_HEADING % "%s Options" % name) + fp.write(TABLE_START) + for option in values: + opt = values[option] + if type(opt.value) is list: + value = " ".join(opt.value) + else: + value = opt.value + fp.write(TABLE_ROW % (opt.name, value or " ", opt.descr)) + + fp.write(TABLE_END) + + print_opt("Build", c.option_build) + print_opt("Header", c.option_header) + + + fp.write(footer()) + + print("Wrote options.html") diff --git a/py/waf/hello.py b/py/waf/hello.py new file mode 100644 index 0000000000..85697e69a1 --- /dev/null +++ b/py/waf/hello.py @@ -0,0 +1,44 @@ +from subprocess import Popen, PIPE +from .tools import run +from waflib.ConfigSet import ConfigSet + +def rtems_cmd_hello(ctx): + c = ConfigSet("build/c4che/_cache.py") + for bsp in c.BSP: + print("\nBUILDING: %s" % bsp) + a, b = bsp.split("/") + c = ConfigSet("build/c4che/%s/%s_cache.py" % (a, b)) + + cflags, cf_stderr, cf_rc = run(["./rtems-config", "--bsp=%s" % bsp, "--cflags"]) + ldflags, ld_stderr, ld_rc = run(["./rtems-config", "--bsp=%s" % bsp, "--ldflags"]) + + + print(run(["./rtems-config", "--bsp=%s" % bsp, "--cflags"])) + + ldflags = ldflags.decode("utf-8") + " -Itestsuites/support/include/" + + + print(ldflags) + print(cflags) + + if cf_rc or ld_rc: + print(cf_stderr) + print(ld_stderr) + + cmd = c.BIN_RTEMS_CC + cmd += cflags.decode("utf-8").split(" ") + cmd.append("-o") + cmd.append("/tmp/hello") + cmd.append("testsuites/samples/hello/init.c") + cmd += ldflags.split(" ") + + print(" ".join(cmd)) + stdout, stderr, returncode = run(cmd) + + if stdout: + print(stdout) + if stderr: + print(stderr) + + if cf_rc or ld_rc or returncode: + ctx.fatal("Compilation Failed") diff --git a/py/waf/info.py b/py/waf/info.py new file mode 100644 index 0000000000..50164581a5 --- /dev/null +++ b/py/waf/info.py @@ -0,0 +1,72 @@ +from waflib.ConfigSet import ConfigSet + +def system(ctx): + info = {} + + from waflib.Utils import unversioned_sys_platform + info["platform_waf"] = unversioned_sys_platform() + + from multiprocessing import cpu_count + info["cpu_count"] = cpu_count() + + # platform information + import platform + methods = [ + "machine", + "platform", + "processor", + "python_build", + "python_version", + "python_version_tuple", + "system", +# "system_alias", + "release", +# "version", +# "uname", + "win32_ver", + "mac_ver", + "linux_distribution" + ] + for method in methods: + info[method] = getattr(platform, method)() + + return info + + +def rtems(ctx): + info = {} + + c = ConfigSet("build/c4che/_cache.py") + + + info["version"] = c.RTEMS_VERSION + + info["bsp"] = {} + for bsp in c.BSP: + a, b = bsp.split("/") + c = ConfigSet("build/c4che/%s/%s_cache.py" % (a, b)) + + b = {} + + info["bsp"][bsp] = b + + return info + + +def rtems_cmd_info(ctx): + info = {} + + info["system"] = system(ctx) + info["rtems"] = rtems(ctx) + + + for val in sorted(info): + print("\n%s" % val) + for v in sorted(info[val]): + print(" %s = %s" % (v, info[val][v])) + +# import pprint +# pp = pprint.PrettyPrinter(indent=4) +# pp.pprint(info) + + diff --git a/py/waf/option.py b/py/waf/option.py new file mode 100644 index 0000000000..d7f51acfa8 --- /dev/null +++ b/py/waf/option.py @@ -0,0 +1,2713 @@ + +class ALLOW_IRQ_NESTING(Boolean): + value = True + tag = ["build"] + undef = True + descr = "If set to !0, allow nested irq processing" + + +class ARM_CLK(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Arm clock in hz" + + +class BENCHMARK_IRQ_PROCESSING(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If set to !0, enable code to benchmark irq processing" + + +class BFIN_ON_SKYEYE(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If defined, disable features which are not supported on skyeye. + """ + + +class BSP(StringList): + value = [] + tag = ["general"] + undef = True + descr = "List of bsps to build, comma delimited." + + +class BSP_CONSOLE_BAUD(Integer): + value = 9600 + tag = ["general"] + undef = True + descr = "The default console baud rate." + + +class BSP_CPU_CLOCK_SPEED(Integer): + value = 0 + tag = ["general"] + undef = True + descr = "The cpu clock frequency." + + +class BSP_DATA_CACHE_ENABLED(Boolean): + value = True + tag = ["storage"] + undef = True + descr = "Enables the data cache, if defined to a value other than zero" + + +class BSP_DIRTY_MEMORY(Boolean): + value = False + tag = ["storage"] + undef = True + descr = """ +If defined, then the bsp framework will put a non-zero pattern into the rtems +workspace and C program heap. This should assist in finding code that assumes +memory starts set to zero. + """ + + +class BSP_DISABLE_UBOOT_WORK_AREA_CONFIG(Integer): + value = 1 + tag = ["general"] + undef = True + descr = "Disable u-boot work area configuration" + + +class BSP_GPIOPCR_INITMASK(String): + value = "0x330F0F77" + tag = ["general"] + undef = True + descr = """ +Defines the bits modified in the mpc5200 gpiopcr register during init. Must +match the hardware requirements + """ + + +class BSP_GPIOPCR_INITVAL(String): + value = "0x01050444" + tag = ["general"] + undef = True + descr = """ +Defines the bit values written in the mpc5200 gpiopcr register during init. +Must match the hardware requirements + """ + + +class BSP_HAS_RM52xx(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "This bsp has a rm52xx compatible cpu." + + +class BSP_HAS_SMP(Integer): + value = 1 + tag = ["build"] + undef = True + descr = """ +Always defined when on a pc386 to enable the pc386 support for determining +the cpu core number in an smp configuration. + """ + + +class BSP_HAS_TX49xx(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "This bsp has a rm52xx compatible cpu." + + +class BSP_HAS_USC320(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "This bsp has a v3 usc320 system controller chip." + + +class BSP_INSTRUCTION_CACHE_ENABLED(Boolean): + value = True + tag = ["storage"] + undef = True + descr = """ +Enables the instruction cache, if defined to a value other than zero + """ + + +class BSP_INTERRUPT_STACK_AT_WORK_AREA_BEGIN(Integer): + value = 1 + tag = ["general"] + undef = True + descr = "Indicate that the interrupt stack is at the work area begin" + + +class BSP_LEON3_SMP(Integer): + value = 1 + tag = ["build"] + undef = True + descr = """ +Always defined when on a leon3 to enable the leon3 support for determining +the cpu core number in an smp configuration. + """ + + +class BSP_PRESS_KEY_FOR_RESET(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If defined, print a message and wait until pressed before resetting board when +application exits. + """ + + +class BSP_RESET_BOARD_AT_EXIT(Boolean): + value = False + tag = ["general"] + undef = True + descr = "If defined, reset the board when the application exits." + + +class BSP_SMALL_MEMORY(Boolean): + value = False + tag = ["storage"] + undef = True + descr = "Disable testsuite samples with high memory demands" + + +class BSP_START_RESET_VECTOR(String): + value = "" + tag = ["general"] + undef = True + descr = "Reset vector address for bsp start" + + +class BSP_UART_AVAIL_MASK(String): + value = "0x01" + tag = ["network"] + undef = True + descr = """ +Bit mask to specify the uarts (pscs), which should be enabled on this board. +Must match the hardware requirements. Psc1 corresponds to the lsb + """ + + +class BSP_USE_NETWORK_FEC(Boolean): + value = False + tag = ["network"] + undef = True + descr = """ +If defined, then the bsp will use the fast ethernet controller for 10/100mbit +networking and used as primary networking interface. + """ + + +class BSP_USE_NETWORK_SCC(Boolean): + value = False + tag = ["network"] + undef = True + descr = """ +If defined, then the bsp will use the serial communications controller (scc1) +for 10mbit networking. + """ + + +class BSP_USE_UART2(Boolean): + value = False + tag = ["network"] + undef = True + descr = "If defined, enables uart2." + + +class BSP_USE_UART_INTERRUPTS(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Enable usage of interrupts for the uart modules" + + +class BSP_VIDEO_80x50(Boolean): + value = False + tag = ["general"] + undef = True + descr = "If defined, set the vga display to 80x50." + + +class CC(String): + value = "" + tag = ["build"] + undef = True + descr = "C compiler command" + + +class CCAS(String): + value = "" + tag = ["build"] + undef = True + descr = "Assembler compiler command (defaults to CC)" + + +class CCASFLAGS(String): + value = "" + tag = ["build"] + undef = True + descr = "Assembler compiler flags (defaults to cflags)" + + +class CCLK(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Cpu clock in hz" + + +class CD2401_INT_LEVEL(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "Interrupt level for the cd2401 (when cd2401_io_mode == 1)." + + +class CD2401_IO_MODE(Integer): + value = 0 + tag = ["build"] + undef = True + descr = "0 for polled I/O, 1 for interrupt-driven." + + +class CD2401_USE_TERMIOS(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Enable using termios based console." + + +class CFLAGS(StringList): + value = [] + tag = ["build"] + undef = True + descr = "C compiler flags" + + +class CFLAGS_DEBUG(String): + value = "" + tag = ["build"] + undef = True + descr = "Debug compiler flags." + + +class CFLAGS_OPTIMISE(String): + value = "" + tag = ["build"] + undef = True + descr = "Compiler flags for optimisation" + + +class CLOCK_DRIVER_USE_8254(Integer): + value = 0 + tag = ["general"] + undef = True + descr = """ +If enabled, the clock driver will use the good old 8254 chip to report +microsecond-accuracy clock times. Enable it, if: - you have nanosecond +timing enabled (you do not have use_ticks_for_cpu_usage_statistics enabled) +- you do not have clock_driver_use_tsc enabled (use one, the other, or +neither) - you do not mind adding roughly 5 microseconds to each context +switch. + """ + + +class CLOCK_DRIVER_USE_8254CLOCK_DRIVER_USE_TSC(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If enabled, the clock driver will use the good old 8254 chip to report +microsecond-accuracy clock times. Enable it, if: 1, you have nanosecond timing +enabled (you do not have use_ticks_for_cpu_usage_statistics enabled) 2, you +do not have clock_driver_use_tsc enabled (use one, the other, or neither 3, +you do not mind adding roughly 5 microseconds to each context switch. + """ + + +class CLOCK_DRIVER_USE_FAST_IDLE(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +This sets a mode where the time runs as fast as possible when a clock isr +occurs while the idle thread is executing. This can significantly reduce +simulation times. + """ + + +class CLOCK_DRIVER_USE_TSC(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If enabled, the clock driver will use the tsc register available with pentium- +class cpus to report close to nanosecond-accuracy clock times. Enable it, if: +1, you have nanosecond timing enabled (you do not have +use_ticks_for_cpu_usage_statistics enabled 2, you do not have +clock_driver_use_8254 enabled (use one, the other, or neither 3, you have a +pentium which supports tsc (all intels, and probably all or most clones 4, you +do not have a variable-speed cpu clock. Note that some motherboard bios will +automatically vary clock speed for thermal control. Note also, however, that +really new pentium-class chips from intel and amd will maintain a constant- +rate tsc regardless. + """ + + +class CONFIG_CFLAGS(StringList): + value = [] + tag = ["build"] + undef = True + descr = "Default compiler flags for rtems-config" + + +class CONFIG_CONSOLE(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Configuration for console (uart 0)" + + +class CONFIG_FPSP(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If defined enables the motorola floating point support package (fpsp) + """ + + +class CONFIG_I2C_0(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Configuration for i2c 0" + + +class CONFIG_I2C_1(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Configuration for i2c 1" + + +class CONFIG_I2C_2(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Configuration for i2c 2" + + +class CONFIG_LDFLAGS(StringList): + value = [] + tag = ["build"] + undef = True + descr = "Default linker flags for rtems-config" + + +class CONFIG_LIBS(StringList): + value = [] + tag = ["build"] + undef = True + descr = "= Default libraries for rtems-config" + + +class CONFIG_U3CLK(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Clock configuration for uart 3" + + +class CONFIG_U4CLK(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Clock configuration for uart 4" + + +class CONFIG_U5CLK(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Clock configuration for uart 5" + + +class CONFIG_U6CLK(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Clock configuration for uart 6" + + +class CONFIG_UART_1(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Configuration for uart 1" + + +class CONFIG_UART_2(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Configuration for uart 2" + + +class CONFIG_UART_3(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Configuration for uart 3" + + +class CONFIG_UART_CLKMODE(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Clock mode configuration for uarts" + + +class CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK(Boolean): + value = True + tag = ["general"] + undef = True + descr = """ +If defined then the bsp may reduce the available memory size initially. This +can be useful for debugging (reduce the core size) or dynamic loading (std gcc +text offsets/Jumps are < +/-32m). Note that the policy can still be defined by +the application (see sbrk.C, bsp_sbrk_policy). By undefining +configure_malloc_bsp_supports_sbrk this feature is removed and a little memory +is saved. + """ + + +class CONS_SCC1_MODE(String): + value = "CONS_MODE_UNUSED" + tag = ["network"] + undef = True + descr = """ +(Bsp--scc1 uart if mode) must be defined if scc1 is used as a tty (uart) +channel. Set it to cons_mode_polled for polled operation, cons_mode_irq for +interrupt driven (spooled) operation. Set it to cons_mode_unused, if not used + """ + + +class CONS_SCC2_MODE(String): + value = "CONS_MODE_UNUSED" + tag = ["network"] + undef = True + descr = """ +(Bsp--scc2 uart if mode) must be defined if scc2 is used as a tty (uart) +channel. Set it to cons_mode_polled for polled operation, cons_mode_irq for +interrupt driven (spooled) operation. Set it to cons_mode_unused, if not used + """ + + +class CONS_SCC3_MODE(String): + value = "CONS_MODE_UNUSED" + tag = ["network"] + undef = True + descr = """ +(Bsp--scc3 uart if mode) must be defined if scc3 is used as a tty (uart) +channel. Set it to cons_mode_polled for polled operation, cons_mode_irq for +interrupt driven (spooled) operation. Set it to cons_mode_unused, if not used + """ + + +class CONS_SCC4_MODE(String): + value = "CONS_MODE_UNUSED" + tag = ["network"] + undef = True + descr = """ +(Bsp--scc4 uart if mode) must be defined if scc4 is used as a tty (uart) +channel. Set it to cons_mode_polled for polled operation, cons_mode_irq for +interrupt driven (spooled) operation. Set it to cons_mode_unused, if not used + """ + + +class CONS_SMC1_MODE(String): + value = "CONS_MODE_UNUSED" + tag = ["network"] + undef = True + descr = """ +(Bsp--smc1 uart if mode) must be defined if smc1 is used as a tty (uart) +channel. Set it to cons_mode_polled for polled operation, cons_mode_irq for +interrupt driven (spooled) operation. Set it to cons_mode_unused, if not +used]) + """ + + +class CONS_SMC2_MODE(String): + value = "CONS_MODE_UNUSED" + tag = ["network"] + undef = True + descr = """ +(Bsp--smc2 uart if mode) must be defined if smc2 is used as a tty (uart) +channel. Set it to cons_mode_polled for polled operation, cons_mode_irq for +interrupt driven (spooled) operation. Set it to cons_mode_unused, if not used + """ + + +class CONSOLE_BAUDRATE(Integer): + value = 9600 + tag = ["general"] + undef = True + descr = "The baudrate of the console uart." + + +class CONSOLE_CHN(String): + value = "CONS_CHN_SMC1" + tag = ["general"] + undef = True + descr = """ +Bsp--console driver) must be defined to be one of cons_chn_smc1, +cons_chn_smc2, cons_chn_scc1, cons_chn_scc2, cons_chn_scc3, or cons_chn_scc4. +Determines which device will be registered as /Dev/Console. + """ + + +class CONSOLE_MINOR(String): + value = "SMC1_MINOR" + tag = ["general"] + undef = True + descr = """ +Port to use for the rtems console: 0 - /Dev/Tty0, serial port 1/Console on the +mvme712m, 1 - /Dev/Tty1, serial port 2/Tty01 on the mvme712m, 2 - /Dev/Tty2, +serial port 3 on the mvme712m, 3 - /Dev/Tty3, serial port 4 on the mvme712m.]) + """ + + +class CONSOLE_MINOR_DUPLICATE(String): + value = "SMC2_MINOR" + tag = ["general"] + undef = True + descr = """ +Bsp--console driver) must be defined to be one of smc1_minor, smc2_minor, +scc2_minor, scc3_minor, or scc4_minor. Determines which device will be +registered as /Dev/Console. + """ + + +class CONSOLE_USE_INTERRUPTS(Boolean): + value = True + tag = ["general"] + undef = False + descr = """ +The erc32 console driver can operate in either polled or interrupt mode. Under +the simulator (especially when fast_uart is defined), polled seems to operate +better. It is common for a task to print a line (like the end of test message) +and then exit. In this case, the program returns control to the simulator +command line before the program has even queued the output to the uart. Thus +sis has no chance of getting the data out. + """ + + +class CPU_CLOCK_RATE_HZ(Integer): + value = 20000000 + tag = ["general"] + undef = True + descr = "Cpu clock rate in hz" + + +class DISABLE_MMU(Boolean): + value = False + tag = ["storage"] + undef = True + descr = "Disable mmu" + + +class DISABLE_READ_ONLY_PROTECTION(Boolean): + value = False + tag = ["storage"] + undef = True + descr = "Disable mmu protection of read-only sections" + + +class DISABLE_READ_WRITE_DATA_CACHE(Boolean): + value = False + tag = ["storage"] + undef = True + descr = "Disable cache for read-write data sections" + + +class DISPATCH_HANDLER_STAT(Boolean): + value = True + tag = ["build"] + undef = True + descr = "Used by irq/Irq.C" + + +class EMC_MICRON(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable micron configuration for emc" + + +class EMC_NUMONYX(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable numonyx configuration for emc" + + +class EMC_TEST(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable tests for emc" + + +class ENABLE(Boolean): + value = True + tag = ["general"] + undef = True + descr = "Whether a bsp is enabled or disabled for use." + + +class ENABLE_DEBUG(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Enable debug build." + + +class ENABLE_FPSP(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Motorola floating point support package (fpsp)" + + +class ENABLE_LCD(Boolean): + value = False + tag = ["general"] + undef = True + descr = "If defined, enable use of the sed1356 controller and LCD." + + +class ENABLE_MP(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Enable multiprocessing." + + +class ENABLE_MULTILIB(Boolean): + value = True + tag = ["general"] + undef = True + descr = "???" + + +class ENABLE_NETWORKING(Boolean): + value = True + tag = ["general"] + undef = True + descr = "Enable tcp/Ip stack." + + +class ENABLE_NEWLIB(Boolean): + value = True + tag = ["general"] + undef = True + descr = "???" + + +class ENABLE_POSIX(Boolean): + value = True + tag = ["general"] + undef = True + descr = "Enable posix." + + +class ENABLE_PTHREADS(Boolean): + value = True + tag = ["general"] + undef = True + descr = "Enable pthreads, requires posix." + + +class ENABLE_SERDBG(Boolean): + value = False + tag = ["general"] + undef = True + descr = "???" + + +class ENABLE_SHELL(Boolean): + value = True + tag = ["general"] + undef = True + descr = "???" + + +class ENABLE_SMP(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Enable smp, available for i386/Sparc only." + + +class ENABLE_UMON(Boolean): + value = False + tag = ["general"] + undef = True + descr = "If defined, enable use of the umon console." + + +class ENABLE_UMON_CONSOLE(Boolean): + value = False + tag = ["general"] + undef = True + descr = "If defined, enable use of the micromonitor console device." + + +class ENABLE_USART0(Boolean): + value = False + tag = ["general"] + undef = True + descr = "If defined, enable use of the usart 0." + + +class ENABLE_USART1(Boolean): + value = False + tag = ["general"] + undef = True + descr = "If defined, enable use of the usart 1." + + +class ENABLE_USART2(Boolean): + value = False + tag = ["general"] + undef = True + descr = "If defined, enable use of the usart 2." + + +class ENABLE_USART3(Boolean): + value = False + tag = ["general"] + undef = True + descr = "If defined, enable use of the usart 3." + + +class ENABLE_WATCHDOG_RESET(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Bsp_reset() will use the watchdog to reset the chip" + + +class EPPCBUG_SMC1(Boolean): + value = True + tag = ["build"] + undef = True + descr = """ +If defined, smc1 is in use by eppc-bug. The console driver will not re- +initialize that port. + """ + + +class EPPCBUG_VECTORS(Boolean): + value = True + tag = ["build"] + undef = True + descr = """ +(Bsp--rtems) if defined, vectors branch to eppcbug, except the following: +0x500 (external interrupt), 0x900 (decrementer).]) + """ + + +class ETHERNET_RMII(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Enable rmii for ethernet" + + +class GEN83XX_ENABLE_INTERRUPT_NESTING(Boolean): + value = True + tag = ["build"] + undef = True + descr = "Enable interrupt nesting" + + +class HAS_DBUG(Integer): + value = 0 + tag = ["general"] + undef = True + descr = """ +If defined, we will not boot from reset, but from freescale dbug monitor. + """ + + +class HAS_LOW_LEVEL_INIT(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If defined, we will do all the low level init of the chip (like +bus/Memory...). + """ + + +class HAS_PMC_PSC8(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Whether has a psc8 pmc board attached to pmc slot" + + +class HAS_SMC91111(Boolean): + value = False + tag = ["network"] + undef = True + descr = "If defined the board has the smc91111 networking chip." + + +class HAS_UBOOT(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable u-boot startup" + + +class HAVE_SHSIM_IOMEM_PATCH(Boolean): + value = True + tag = ["build"] + undef = True + descr = """ +Whether support for functional iomem in shsim/Gdb shall be enabled + """ + + +class HCLK(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Ahb bus clock in hz" + + +class HEAP_EXTEND(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Enable heap extend by ethernet and usb regions" + + +class IDE_USE_PRIMARY_INTERFACE(Boolean): + value = True + tag = ["general"] + undef = True + descr = """ +Determines, whether rtems will try to use the primary ide interface. Disable +it, if: 1, you have no primary ide interface. 2, you have no disk attached to +this interface or 3, you do not want to access disks attached to this +interface. + """ + + +class IDE_USE_SECONDARY_INTERFACE(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +Determines, whether rtems will try to use the secondary ide interface. Enable +it, if: 1, you have a secondary ide interface 2, you have at least one disk +attached to this interface 3, you do want to access disks attached to this +interface. + """ + + +class INITIALIZE_COM_PORTS(Boolean): + value = False + tag = ["general"] + undef = True + descr = "???" + + +class INTERRUPT_USE_TABLE(Boolean): + value = True + tag = ["build"] + undef = True + descr = "Select if interrupt use table or link list" + + +class LDFLAGS(StringList): + value = [] + tag = ["build"] + undef = True + descr = """ +Linker flags only, do not use this for directories or libraries + """ + + +class LIBS(StringList): + value = [] + tag = ["build"] + undef = True + descr = "Libraries to pass to the linker, e.G. -L" + + +class LINK_END(StringList): + value = [] + tag = ["build"] + undef = True + descr = "Objects linked last" + + +class LINK_START(StringList): + value = [] + tag = ["build"] + undef = True + descr = "Objects linked first" + + +class LINK_LINK(StringList): + value = ["-L${RTEMS} -L${RTEMS_BSP} -L${RTEMS_LINKCMDS} -T ${RTEMS_LINKCMDS}/linkcmds -dc -dp -N"] + tag = ["build"] + undef = True + descr = "Linker link flags" + + +class LINKCMDS(StringList): + value = [] + tag = ["build"] + undef = True + descr = "Linker command files, first one is installed as linkcmds" + + +class LPC24XX_CCLK(String): + value = "72000000U" + tag = ["general"] + undef = True + descr = "Cpu clock in hz" + + +class LPC24XX_CONFIG_CONSOLE(Integer): + value = 0 + tag = ["network"] + undef = True + descr = "Configuration for console (uart 0)" + + +class LPC24XX_CONFIG_I2C_0(Integer): + value = 0 + tag = ["network"] + undef = True + descr = "Configuration for i2c 0" + + +class LPC24XX_CONFIG_I2C_1(Integer): + value = 1 + tag = ["network"] + undef = True + descr = "Configuration for i2c 1" + + +class LPC24XX_CONFIG_I2C_2(String): + value = "" + tag = ["network"] + undef = True + descr = "Configuration for i2c 2" + + +class LPC24XX_CONFIG_UART_1(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Configuration for uart 1" + + +class LPC24XX_CONFIG_UART_2(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Configuration for uart 2" + + +class LPC24XX_CONFIG_UART_3(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Configuration for uart 3" + + +class LPC24XX_EMC_MICRON(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "Enable micron configuration for emc" + + +class LPC24XX_EMC_NUMONYX(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "Enable numonyx configuration for emc" + + +class LPC24XX_EMC_TEST(String): + value = "" + tag = ["general"] + undef = True + descr = "Enable tests for emc" + + +class LPC24XX_ETHERNET_RMII(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Enable rmii for ethernet" + + +class LPC24XX_HEAP_EXTEND(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Enable heap extend by ethernet and usb regions" + + +class LPC24XX_OSCILLATOR_MAIN(String): + value = "12000000U" + tag = ["general"] + undef = True + descr = "Main oscillator frequency in hz" + + +class LPC24XX_OSCILLATOR_RTC(String): + value = "32768U" + tag = ["general"] + undef = True + descr = "Rtc oscillator frequency in hz" + + +class LPC24XX_SPECIAL_TASK_STACKS_SUPPORT(Integer): + value = 1 + tag = ["general"] + undef = True + descr = """ +Enable special task stack support for task stacks in internal ram + """ + + +class LPC24XX_STOP_ETHERNET(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "Stop ethernet controller at start-up to avoid dma interference" + + +class LPC24XX_STOP_GPDMA(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "Stop general purpose dma at start-up to avoid dma interference" + + +class LPC24XX_STOP_USB(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "Stop usb controller at start-up to avoid dma interference" + + +class LPC24XX_UART_BAUD(String): + value = "115200U" + tag = ["general"] + undef = True + descr = "Baud for uarts" + + +class LPC32XX_ARM_CLK(String): + value = "208000000U" + tag = ["general"] + undef = True + descr = "Arm clock in hz" + + +class LPC32XX_CONFIG_U3CLK(String): + value = "" + tag = ["network"] + undef = True + descr = "Clock configuration for uart 3" + + +class LPC32XX_CONFIG_U4CLK(String): + value = "" + tag = ["network"] + undef = True + descr = "Clock configuration for uart 4" + + +class LPC32XX_CONFIG_U5CLK(String): + value = "0x00001386U" + tag = ["network"] + undef = True + descr = "Clock configuration for uart 5" + + +class LPC32XX_CONFIG_U6CLK(String): + value = "" + tag = ["network"] + undef = True + descr = "Clock configuration for uart 6" + + +class LPC32XX_CONFIG_UART_CLKMODE(String): + value = "0x00000200U" + tag = ["network"] + undef = True + descr = "Clock mode configuration for uarts" + + +class LPC32XX_DISABLE_MMU(Boolean): + value = False + tag = ["storage"] + undef = True + descr = "Disable mmu" + + +class LPC32XX_DISABLE_READ_ONLY_PROTECTION(Boolean): + value = False + tag = ["storage"] + undef = True + descr = "Disable mmu protection of read-only sections" + + +class LPC32XX_DISABLE_READ_WRITE_DATA_CACHE(Boolean): + value = False + tag = ["storage"] + undef = True + descr = "Disable cache for read-write data sections" + + +class LPC32XX_ENABLE_WATCHDOG_RESET(Boolean): + value = True + tag = ["general"] + undef = True + descr = "Enable watchdog reset" + + +class LPC32XX_ETHERNET_RMII(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Enable rmii for ethernet" + + +class LPC32XX_HCLK(String): + value = "104000000U" + tag = ["general"] + undef = True + descr = "Ahb bus clock in hz" + + +class LPC32XX_OSCILLATOR_MAIN(String): + value = "13000000U" + tag = ["general"] + undef = True + descr = "Main oscillator frequency in hz" + + +class LPC32XX_OSCILLATOR_RTC(String): + value = "32768U" + tag = ["general"] + undef = True + descr = "Rtc oscillator frequency in hz" + + +class LPC32XX_PERIPH_CLK(String): + value = "13000000U" + tag = ["geenral"] + undef = True + descr = "Peripheral clock in hz" + + +class LPC32XX_SCRATCH_AREA_SIZE(Integer): + value = 4096 + tag = ["general"] + undef = True + descr = "Size of scratch area" + + +class LPC32XX_STOP_ETHERNET(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Stop ethernet controller at start-up to avoid dma interference" + + +class LPC32XX_STOP_GPDMA(Boolean): + value = True + tag = ["general"] + undef = True + descr = "Stop general purpose dma at start-up to avoid dma interference" + + +class LPC32XX_STOP_USB(Boolean): + value = True + tag = ["general"] + undef = True + descr = "Stop usb controller at start-up to avoid dma interference" + + +class LPC32XX_UART_1_BAUD(String): + value = "" + tag = ["network"] + undef = True + descr = "Baud for uart 1" + + +class LPC32XX_UART_2_BAUD(String): + value = "" + tag = ["network"] + undef = True + descr = "Baud for uart 2" + + +class LPC32XX_UART_7_BAUD(String): + value = "" + tag = ["network"] + undef = True + descr = "Baud for uart 7" + + +class MPC5200_PSC_INDEX_FOR_GPS_MODULE(Integer): + value = 0 + tag = ["build"] + undef = True + descr = "Psc index for gps module, if defined results in '/Dev/Gps'" + + +class MPC55XX_BOARD_GWLCFM(Boolean): + value = True + tag = ["build"] + undef = True + descr = "If defined, use custom settings for gwlcfm board" + + +class MPC55XX_BOARD_MPC5566EVB(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If defined, use custom settings for mpc5566evb board" + + +class MPC55XX_BOARD_MPC5674FEVB(Boolean): + value = True + tag = ["build"] + undef = True + descr = "If defined, use custom settings for mpc5674fevb board" + + +class MPC55XX_BOARD_PHYCORE_MPC5554(Boolean): + value = True + tag = ["build"] + undef = True + descr = "If defined, use custom settings for phycore mpc5554 board" + + +class MPC55XX_BOOTFLAGS(String): + value = "" + tag = ["build"] + undef = True + descr = """ +If defined, builds in bootflags above the rchw for setup in a debugger to +avoid startup mmu setup + """ + + +class MPC55XX_CHIP_TYPE(Integer): + value = 5554 + tag = ["build"] + undef = True + descr = "Specifies the chip type in use (e.G. 5554 for mpc5554" + + +class MPC55XX_CLOCK_EMIOS_CHANNEL(String): + value = "MPC55XX_EMIOS_CHANNEL_NUMBER-1" + tag = ["build"] + undef = True + descr = """ +Define to the emios channel to use for the bsp clock. The default is the last +channel. + """ + + +class MPC55XX_EMIOS_PRESCALER(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "Must be defined to set the emios prescaler" + + +class MPC55XX_ESCI_CONSOLE_MINOR(Integer): + value = 0 + tag = ["general"] + undef = True + descr = """ +Determines which esci device will be registered as /Dev/Console + """ + + +class MPC55XX_ESCI_USE_INTERRUPTS(Boolean): + value = True + tag = ["build"] + undef = True + descr = """ +Define to zero or one to disable or enable interrupts for the esci devices + """ + + +class MPC55XX_FMPLL_CLK_OUT(Integer): + value = 128000000 + tag = ["general"] + undef = True + descr = """ +Must be defined to be the pll output clock (in hz) for clock generation + """ + + +class MPC55XX_FMPLL_MFD(Integer): + value = 12 + tag = ["general"] + undef = True + descr = """ +Must be defined to be the pll multiplication factor for clock generation + """ + + +class MPC55XX_FMPLL_PREDIV(Integer): + value = 1 + tag = ["general"] + undef = True + descr = """ +Must be defined to be the pll predivider factor for clock generation + """ + + +class MPC55XX_FMPLL_REF_CLOCK(Integer): + value = 8000000 + tag = ["general"] + undef = True + descr = """ +Must be defined to be the external reference clock (in hz) for clock +generation + """ + + +class NVRAM_CONFIGURE(Boolean): + value = True + tag = ["storage"] + undef = True + descr = """ +Define to 1 if you want the console driver, network driver and caches +configured at boot time from parameters stored in nvram. If set to 1, most +parameters below are ignored during the build. If not set to 1, then the +console driver is configured at build time, the network host information is +obtained from application supplied data structures, and the caches are +configured at boot time based on the information supplied in this file. + """ + + +class ON_SIMULATOR(Boolean): + value = False + tag = ["build"] + undef = True + descr = """ +If defined, this indicates the bsp is being built to run on the lm32 simulator +in gdb. This enables fast idle support which speeds up the clock ticks while +the idle task is running so time spent in the idle task is minimized. This +significantly reduces the wall time required to execute the rtems test suites. +It also enables a special exit and alternate printk support. + """ + + +class ON_SKYEYE(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If defined, enable options which optimize executingon the skyeye simulator. +Speed up the clock ticks while the idle task is running so time spent in the +idle task is minimized. This significantly reduces the wall time required to +execute the rtems test suites. + """ + + +class OSCILLATOR_MAIN(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Main oscillator frequency in hz" + + +class OSCILLATOR_RTC(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Rtc oscillator frequency in hz" + + +class PATH_TOOLS(String): + value = "" + tag = ["general"] + undef = True + descr = "Location of rtems tools." + + +class PERIPH_CLK(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Peripheral clock in hz" + + +class PPC_USE_SPRG(Boolean): + value = True + tag = ["build"] + undef = True + descr = """ +If defined, then the powerpc specific code in rtems will use some of the +special purpose registers to slightly optimize interrupt response time. The +use of these registers can conflict with other tools like debuggers. + """ + + +class PPC_VECTOR_FILE_BASE(String): + value = "0x0100" + tag = ["build"] + undef = True + descr = """ +This defines the base address of the exception table. Note: vectors are +actually at 0xfff00000 but file starts at offset. + """ + + +class PREFIX(String): + value = "" + tag = ["general"] + undef = True + descr = "Install prefix." + + +class PRINTK_CHN(String): + value = "NOT_DEFINED_IN_BSP" + tag = ["general"] + undef = True + descr = """ +(Bsp--console driver) must be defined to be one of cons_chn_smc1, +cons_chn_smc2, cons_chn_scc2, cons_chn_scc3, or cons_chn_scc4. Determines +which device is used for output y printk(). If the port that printk() uses is +also used for other I/O (e.G. If printk_chn == console_chn), then both ports +should use the same type of I/O, otherwise the drivers will likely conflict +with each other. + """ + + +class PRINTK_IO_MODE(Integer): + value = 0 + tag = ["general"] + undef = True + descr = """ +(Bsp--console driver) define to 0 or 1 if you want polled I/O performed by +rtems. Define to 2 if you want polled I/O performed by eppcbug. The printk() +port is not configured to use termios. With eppcbug 1.1, if mode 2 is +selected, printk_minor must be set to smc1_minor. This is a deficiency of the +firmware: it does not perform serial I/O on any port other than its default +debug port, which must be smc1. Printk always uses polled output. + """ + + +class PRINTK_MINOR(String): + value = "NOT_DEFINED_IN_BSP" + tag = ["general"] + undef = True + descr = """ +Port to use for the rtems console: 0 - /Dev/Tty0, serial port 1/Console on the +mvme712m, 1 - /Dev/Tty1, serial port 2/Tty01 on the mvme712m, 2 - /Dev/Tty2, +serial port 3 on the mvme712m, 3 - /Dev/Tty3, serial port 4 on the mvme712m.]) + """ + + +class PRINTK_MINOR_DUPLICATE(String): + value = "SMC2_MINOR" + tag = ["general"] + undef = True + descr = """ +(Bsp--console driver) must be defined to be one of smc1_minor, smc2_minor, +scc2_minor, scc3_minor, or scc4_minor. Determines which device is used for +output by printk(). If the port that printk() uses is also used for other I/O +(e.G. If printk_minor == \$console_minor), then both ports should use the +same type of I/O, otherwise the drivers will likely conflict with each other. + """ + + +class QORIQ_CLOCK_TIMER(Integer): + value = 0 + tag = ["general"] + undef = True + descr = """ +Global timer used for system clock, 0..3 maps to a0..a3, and 4..7 maps to +b0..b3 + """ + + +class QORIQ_ETSEC_1_PHY_ADDR(Integer): + value = -1 + tag = ["general"] + undef = True + descr = "Phy address for etsec interface 1" + + +class QORIQ_ETSEC_2_PHY_ADDR(Integer): + value = 0 + tag = ["general"] + undef = True + descr = "Phy address for etsec interface 2" + + +class QORIQ_ETSEC_3_PHY_ADDR(Integer): + value = 1 + tag = ["general"] + undef = True + descr = "Phy address for etsec interface 3" + + +class QORIQ_INITIAL_MSR(String): + value = "0x02000200" + tag = ["general"] + undef = True + descr = "Initial msr value" + + +class QORIQ_INITIAL_SPEFSCR(String): + value = "0x00000000" + tag = ["general"] + undef = True + descr = "Initial spefscr value" + + +class QORIQ_INTERCOM_AREA_BEGIN(String): + value = "0x3000000" + tag = ["build"] + undef = True + descr = "Inter-processor communication area begin" + + +class QORIQ_INTERCOM_AREA_SIZE(String): + value = "0x1000000" + tag = ["build"] + undef = True + descr = "Inter-processor communication area size" + + +class QORIQ_UART_0_ENABLE(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Use 1 to enable uart 0, otherwise use 0" + + +class QORIQ_UART_1_ENABLE(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Use 1 to enable uart 1, otherwise use 0" + + +class QORIQ_UART_BRIDGE_0_ENABLE(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Use 1 to enable uart 0 to intercom bridge, otherwise use 0" + + +class QORIQ_UART_BRIDGE_1_ENABLE(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Use 1 to enable uart 1 to intercom bridge, otherwise use 0" + + +class QORIQ_UART_BRIDGE_MASTER_CORE(Integer): + value = 0 + tag = ["network"] + undef = True + descr = "Uart to intercom bridge master core index" + + +class QORIQ_UART_BRIDGE_SLAVE_CORE(Integer): + value = 1 + tag = ["network"] + undef = True + descr = "Uart to intercom bridge slave core index" + + +class QORIQ_UART_BRIDGE_TASK_PRIORITY(Integer): + value = 250 + tag = ["network"] + undef = True + descr = "Uart to intercom bridge task priority" + + +class RTEMS_BSP_I2C_EEPROM_DEVICE_NAME(String): + value = "eeprom" + tag = ["storage"] + undef = True + descr = "Eeprom name for libi2c" + + +class RTEMS_BSP_I2C_EEPROM_DEVICE_PATH(String): + value = "/dev/i2c1.eeprom" + tag = ["storage"] + undef = True + descr = "Eeprom device file path" + + +class RTEMS_XPARAMETERS_H(String): + value = "" + tag = ["general"] + undef = True + descr = """ +This defines the location of the hardware specific xparameters.H + """ + + +class RTEMS_XPPC_BASE(String): + value = "." + tag = ["build"] + undef = True + descr = "Defines path to xilinx xps ppc libraries." + + +class SCORE603E_OPEN_FIRMWARE(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Use open firmware rom monitor" + + +class SCORE603E_USE_DINK(Boolean): + value = False + tag = ["build"] + undef = True + descr = "???" + + +class SCORE603E_USE_NONE(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Use no rom monitor" + + +class SCORE603E_USE_SDS(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Use sds rom monitor" + + +class SCRATCH_AREA_SIZE(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Size of scratch area" + + +class SINGLE_CHAR_MODE(String): + value = "" + tag = ["general"] + undef = True + descr = "Enable single character mode for the psc console driver" + + +class SMC91111_ENADDR_IS_SETUP(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If defined the smc91111 chip has the ethernet address loaded at reset. + """ + + +class SPECIAL_TASK_STACKS_SUPPORT(Boolean): + value = False + tag = ["build"] + undef = True + descr = """ +Enable special task stack support for task stacks in internal ram. + """ + + +class SPI_BOARD_INIT_FNC(String): + value = "bsp_dummy_spi_init" + tag = ["build"] + undef = True + descr = """ +(Bsp--spi board init function) specify the function that inits the board port +lines and further devices. + """ + + +class SPI_SEND_ADDR_FNC(String): + value = "bsp_dummy_spi_sel_addr" + tag = ["build"] + undef = True + descr = """ +Bsp--spi send address function) specify the function that addresses spi +devices. Set to bsp_dummy_spi_sel_addr for dummy implementation + """ + + +class SPI_SEND_STOP_FNC(String): + value = "bsp_dummy_spi_send_stop" + tag = ["build"] + undef = True + descr = """ +Bsp--spi send stop function) specify the function that deaddresses spi +devices. Set to bsp_dummy_spi_send_stop for dummy implementation + """ + + +class STANDALONE_EVB(String): + value = "" + tag = ["general"] + undef = True + descr = """ +If defined, compiles code to jump-start from flash, without a monitor + """ + + +class START_HW_INIT(String): + value = "" + tag = ["build"] + undef = True + descr = """ +If defined, selects whether 'early_hw_init()' is called from 'start.S'; +'bsp_hw_init()' is always called from 'bspstart.C' + """ + + +class STOP_ETHERNET(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Stop ethernet controller at start-up to avoid dma interference" + + +class STOP_GPDMA(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Stop general purpose dma at start-up to avoid dma interference" + + +class STOP_USB(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Stop usb controller at start-up to avoid dma interference" + + +class TESTS_USE_PRINTK(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Tests use printk() for output" + + +class UART_1_BAUD(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Baud for uart 1" + + +class UART_2_BAUD(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Baud for uart 2" + + +class UART_7_BAUD(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Baud for uart 7" + + +class UART_BAUD(Boolean): + value = False + tag = ["network"] + undef = True + descr = "Baud for uarts" + + +class UART_USE_DMA(Boolean): + value = True + tag = ["network"] + undef = True + descr = """ +The uart driver can operate in dma mode with interrupts. Set true if dma +operation is required + """ + + +class UARTS_IO_MODE(Integer): + value = 0 + tag = ["network"] + undef = True + descr = """ +Define to 0 or 1 if you want polled I/O performed by rtems. Define to 1 if +you want interrupt-driven performed by rtems. Define to 2 if you want polled +I/O performed by eppcbug. There is no provision to have a MIX of interrupt- +driven and polled I/O ports, except that the printk port may use a different +mode from the other ports. If this is done, do not open the printk port from +an rtems application. With eppcbug 1.1, if mode 2 is selected, console_minor +must be set to smc1_minor. This is a deficiency of the firmware: it does not +perform serial I/O on any port other than its default debug port, which must +be smc1. + """ + + +class UARTS_USE_TERMIOS(Boolean): + value = False + tag = ["network"] + undef = True + descr = """ +Define to 1 if you want termios support for every port. Termios support is +independent of the choice of uart I/O mode. + """ + + +class UARTS_USE_TERMIOS_INT(Boolean): + value = True + tag = ["network"] + undef = True + descr = "Enable interrupt support for the psc console driver" + + +class USE_COM1_AS_CONSOLE(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +Determines, whether the console will be associated with the standard vga +display or with the com1 serial port. Currently only the vga display and com1 +support printk. + """ + + +class WATCHDOG_TIMEOUT(String): + value = "0xFFFF" + tag = ["general"] + undef = True + descr = """ +Define to the desired timeout (in steps of 1/20 msec) to enable the watchdog. +Default is to disable the watchdog entirely. + """ + + +# These are all hacks, they only exist to enable shared BSPS, they are not +# required and will be removed in the future. + +class BOARD_PHYCORE_MPC5554(Boolean): + value = False + tag = ["general"] + undef = True + descr = """ +If defined, use custom settings for the phytec phycore mpc5554 som + """ + + +class BSP_TYPE_DP2(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Enable settings for dp2" + + +class csb637(Boolean): + value = False + tag = ["build"] + undef = True + descr = """ +If defined, this indicates that the bsp is being built for the csb637 +variant. + """ + + +class GEN68360(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If defined, use custom settings for the gen68360 bsp." + + +class GEN68360_040(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If defined, use custom settings for the gen68360_040 bsp." + + +class HSC_CM01(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If defined, use custom settings for the hsc_cm01 bsp." + + +class M5484FIREENGINE(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If defined, use custom settings for the m5484fireengine bsp." + + +class mpc8240(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Defined for boards with mpc8240 -- undefined for others" + + +class MPC8313ERDB(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If defined, use custom settings for the mpc8313erdb bsp." + + +class MPC8349(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If defined, use custom settings for the mpc8349 libcpu family." + + +class MPC8349EAMDS(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If defined, use custom settings for the mpc8349eamds bsp." + + +class mvme167(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Defined for mvme167 -- undefined for others" + + +class mvme2100(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Defined for mvme2100 -- undefined for others" + + +class PGH360(Boolean): + value = False + tag = ["build"] + undef = True + descr = "If defined, use custom settings for the pgh360 bsp." + + +class qemu(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Defined for qemu bsp -- undefined for others" + + +class MPC5200_BOARD_BRS5L(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable settings for powerpc MPC5200 BRS5L" + +class MPC5200_BOARD_BRS6L(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable settings for powerpc MPC5200 BRS6l" + +class MPC5200_BOARD_DP2(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable settings for powerpc MPC5200 dp2" + +class MPC5200_BOARD_ICECUBE(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable settings for powerpc MPC5200 icecube" + +class MPC5200_BOARD_PM520_CR825(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable settings for powerpc MPC5200 PM520_CR825" + +class MPC5200_BOARD_PM520_ZE30(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Enable settings for powerpc MPC5200 pm520" + + +# RTEMS internal options. +class USE_CLANG(Boolean): + value = False + tag = ["build"] + undef = True + descr = "Use Clang compiler." + +class USE_GCC(Boolean): + value = True + tag = ["build"] + undef = True + descr = "Use GCC compiler.." + + + + +# THESE ARE UNSORTED! + + +class LPC24XX_PCLKDIV(String): + value = "1U" + tag = ["general"] + undef = True + descr = "clock divider for default PCLK (PCLK = CCLK / PCLKDIV)" + + +class LPC24XX_EMCCLKDIV(String): + value = "2U" + tag = ["general"] + undef = True + descr = "clock divider for EMCCLK (EMCCLK = CCLK / EMCCLKDIV)" + + +class LPC24XX_EMC_MT48LC4M16A2(Boolean): + value = False + tag = ["general"] + undef = True + descr = "enable Micron MT48LC4M16A2 configuration for EMC" + + +class LPC24XX_EMC_W9825G2JB75I(Boolean): + value = True + tag = ["general"] + undef = True + descr = "enable Winbond W9825G2JB75I configuration for EMC" + + +class LPC24XX_EMC_IS42S32800D7(Boolean): + value = True + tag = ["general"] + undef = True + descr = "enable ISSI IS42S32800D7 configuration for EMC" + + +class LPC24XX_EMC_IS42S32800B(Boolean): + value = True + tag = ["general"] + undef = True + descr = "enable ISSI IS42S32800B configuration for EMC" + + +class LPC24XX_EMC_M29W160E(Boolean): + value = True + tag = ["general"] + undef = True + descr = "enable M29W160E configuration for EMC" + + +class LPC24XX_EMC_M29W320E70(Boolean): + value = False + tag = ["general"] + undef = True + descr = "enable M29W320E70 configuration for EMC" + + +class LPC24XX_EMC_SST39VF3201(Boolean): + value = True + tag = ["general"] + undef = True + descr = "enable SST39VF3201 configuration for EMC" + + +class LPC_DMA_CHANNEL_COUNT(Integer): + value = 2 + tag = ["general"] + undef = True + descr = "DMA channel count" + + +class BSP_USB_OTG_TRANSCEIVER_I2C_ADDR(String): + value = "" + tag = ["general"] + undef = True + descr = "USB OTG transceiver I2C address used by USB stack" + + +class MPC55XX_CHIP_FAMILY(String): + value = "(MPC55XX_CHIP_TYPE / 10)" + tag = ["general"] + undef = True + descr = "specifies the chip family in use (e.g. 555 for MPC5554)" + + +class SMSC9218I_EDMA_RX_CHANNEL(Integer): + value = 49 + tag = ["network"] + undef = True + descr = "receive eDMA channel for SMSC9218I network interface" + +class SMSC9218I_EDMA_TX_CHANNEL(Integer): + value = 48 + tag = ["network"] + undef = True + descr = "transmit eDMA channel for SMSC9218I network interface" + + +class SMSC9218I_BIG_ENDIAN_SUPPORT(Boolean): + value = True + tag = ["network"] + undef = True + descr = "enable big endian support for SMSC9218I network interface" + + +class SMSC9218I_ENABLE_LED_OUTPUTS(Boolean): + value = True + tag = ["network"] + undef = True + descr = "enable LED outputs for SMSC9218I network interface" + + +class SMSC9218I_RESET_PIN(Integer): + value = 186 + tag = ["network"] + undef = True + descr = "reset pin for SMSC9218I network interface" + + +class SMSC9218I_IRQ_PIN(Integer): + value = 193 + tag = ["network"] + undef = True + descr = "IRQ pin for SMSC9218I network interface" + + +class MPC55XX_SYSTEM_CLOCK_DIVIDER(Integer): + value = 1 + tag = ["general"] + undef = True + descr = "system clock divider" + + +class MPC55XX_REFERENCE_CLOCK(Integer): + value = 8000000 + tag = ["general"] + undef = True + descr = "Must be defined to be the external reference clock (in Hz) for clock generation" + + +class MPC55XX_SYSTEM_CLOCK(Integer): + value = 8000000 + tag = ["general"] + undef = True + descr = "The system clock frequency in Hz." + + +class MPC55XX_FMPLL_ESYNCR1_CLKCFG(Integer): + value = 7 + tag = ["general"] + undef = True + descr = "the FMPLL ESYNCR1[CLKCFG] value" + +class MPC83XX_BOARD_HSC_CM01(Boolean): + value = True + tag = ["build"] + undef = True + descr = "if defined, then use settings for the HSC_CM01 board" + + + + + + +class LM3S69XX_ENABLE_UART_0(Boolean): + value = True + tag = ["network"] + undef = True + descr = "enable UART 0" + + +class LM3S69XX_ENABLE_UART_1(Boolean): + value = True + tag = ["network"] + undef = True + descr = "enable UART 1" + + +class LM3S69XX_ENABLE_UART_2(Boolean): + value = True + tag = ["network"] + undef = True + descr = "enable UART 2" + + +class LM3S69XX_HAS_UDMA(Boolean): + value = False + tag = ["general"] + undef = True + descr = "defined if MCU supports UDMA" + + +class LM3S69XX_MCU_LM3S3749(Boolean): + value = False + tag = ["build"] + undef = True + descr = "board has LM3S3749 MCU" + + +class LM3S69XX_MCU_LM3S6965(Boolean): + value = False + tag = ["build"] + undef = True + descr = "board has LM3S6965 MCU" + + +class LM3S69XX_NUM_GPIO_BLOCKS(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "number of GPIO blocks supported by MCU" + + +class LM3S69XX_NUM_SSI_BLOCKS(Integer): + value = 1 + tag = ["build"] + undef = True + descr = "number of SSI blocks supported by MCU" + + +class LM3S69XX_SSI_CLOCK(String): + value = "1000000U" + tag = ["general"] + undef = True + descr = "SSI clock in Hz" + + +class LM3S69XX_SYSTEM_CLOCK(String): + value = "50000000U" + tag = ["general"] + undef = True + descr = "system clock in Hz" + + +class LM3S69XX_UART_BAUD(String): + value = "115200U" + tag = ["general"] + undef = True + descr = "baud for UARTs" + + +class LM3S69XX_USE_AHB_FOR_GPIO(Boolean): + value = False + tag = ["general"] + undef = True + descr = "use AHB apperture to access GPIO registers" + + +class LM3S69XX_XTAL_CONFIG(String): + value = "0x10" + tag = ["build"] + undef = True + descr = "crystal configuration for RCC register" + + +class BSP_ARM_A9MPCORE_PERIPHCLK(String): + value = "100000000U" + tag = ["build"] + undef = True + descr = "ARM Cortex-A9 MPCore PERIPHCLK clock frequency in Hz" + + + +class STM32F4_HSE_OSCILLATOR(Integer): + value = 8000000 + tag = ["build"] + undef = True + descr = "HSE oscillator frequency in Hz" + + + +class STM32F4_SYSCLK(Integer): + value = 16000000 + tag = ["general"] + undef = True + descr = "SYSCLK frequency in Hz" + + + +class STM32F4_HCLK(Integer): + value = 16000000 + tag = ["general"] + undef = True + descr = "HCLK frequency in Hz" + + + +class STM32F4_PCLK1(Integer): + value = 16000000 + tag = ["general"] + undef = True + descr = "PCLK1 frequency in Hz" + + + +class STM32F4_PCLK2(Integer): + value = 16000000 + tag = ["general"] + undef = True + descr = "PCLK2 frequency in Hz" + + + +class STM32F4_USART_BAUD(Integer): + value = 115200 + tag = ["network"] + undef = True + descr = "baud for USARTs" + + + +class STM32F4_ENABLE_USART_1(Boolean): + value = False + tag = ["network"] + undef = True + descr = "enable USART 1" + + +class STM32F4_ENABLE_USART_2(Boolean): + value = False + tag = ["network"] + undef = True + descr = "enable USART 2" + + +class STM32F4_ENABLE_USART_3(Boolean): + value = True + tag = ["network"] + undef = True + descr = "enable USART 3" + + +class STM32F4_ENABLE_UART_4(Boolean): + value = False + tag = ["network"] + undef = True + descr = "enable UART 4" + + +class STM32F4_ENABLE_UART_5(Boolean): + value = False + tag = ["network"] + undef = True + descr = "enable UART 5" + + +class STM32F4_ENABLE_USART_6(Boolean): + value = False + tag = ["network"] + undef = True + descr = "enable USART 6" + + +class MPC83XX_BOARD_BR_UID(Boolean): + value = True + tag = ["general"] + undef = True + descr = "if defined, then use settings for the BR UID board" + + +class MPC83XX_NETWORK_INTERFACE_0_PHY_ADDR(String): + value = "0x11" + tag = ["build"] + undef = True + quote = False + descr = "PHY address of network interface 0" + + +class MPC83XX_CHIP_TYPE(Integer): + value = 0 + tag = ["build"] + undef = True + descr = "chip type of the MPC83XX family" + + +class MPC83XX_HAS_NAND_LP_FLASH_ON_CS0(Boolean): + value = True + tag = ["build"] + undef = True + descr = "indicates if the board has a NAND large page flash on chip select 0" + + +class BSP_INTERRUPT_HANDLER_TABLE_SIZE(Integer): + no_default = True + undef = True + descr = "defines the maximum number of interrupt handlers" + tag = ["general"] + +class MPC55XX_NULL_POINTER_PROTECTION(Boolean): + value = True + tag = ["build"] + undef = True + descr = "enable NULL pointer protection" + + +class MPC55XX_CLOCK_PIT_CHANNEL(Integer): + no_default = True + undef = True + descr = "selects the PIT channel for the RTEMS system tick (the default is the last channel" + tag = ["build"] + +class MPC55XX_NEEDS_LOW_LEVEL_INIT(Boolean): + value = True + tag = ["build"] + undef = True + descr = "if defined, do low level initialization" + + +class BSP_DATA_CACHE_USE_WRITE_THROUGH(Boolean): + no_default = True + undef = True + descr = "use write-through for data cache" + tag = ["storage"] + +class MPC55XX_BOARD_MPC5674F_ECU508(Boolean): + value = True + tag = ["build"] + undef = True + descr = "if defined, use custom settings for ECU508 board" + + +class MPC55XX_CONSOLE_MINOR(Integer): + value = 0 + tag = ["build"] + undef = True + descr = "determines which serial device will be registered as /dev/console" + + +class MPC55XX_BOARD_MPC5674F_RSM6(Boolean): + value = True + tag = ["build"] + quote = False + undef = True + descr = "if defined, use custom settings for RSM6 board" + + +class MPC55XX_ENABLE_START_PROLOGUE(Boolean): + value = True + tag = ["build"] + undef = True + descr = "if defined, enable start prologue" + + +class BSP_DEFAULT_BAUD_RATE(Integer): + value = 115200 + tag = ["general"] + undef = True + descr = "default console baud" + + +class MPC55XX_EARLY_STACK_SIZE(Integer): + value = 1024 + tag = ["build"] + undef = True + descr = "size of the early initialization stack in bytes" + +class MPC83XX_BOARD_MPC8309SOM(Boolean): + value = True + tag = ["build"] + undef = True + descr = "if defined, then use settings for the MPC8309SOM board" + + +class ZYNQ_RAM_ORIGIN(String): + value = "0x00400000" + tag = ["storage"] + undef = True + descr = "Normal RAM region origin" + +class ZYNQ_RAM_MMU(String): + value = "%(ZYNQ_RAM_ORIGIN)s" + tag = ["storage"] + quote = False + undef = True + descr = "MMU region origin" + +class ZYNQ_RAM_MMU_LENGTH(String): + value = "16k" + tag = ["storage"] + undef = True + descr = "MMU region length" + +class ZYNQ_RAM_ORIGIN_AVAILABLE(String): + value = "%(ZYNQ_RAM_ORIGIN)s + 0x00004000" + tag = ["storage"] + undef = True + descr = "Origin of available RAM" + +class ZYNQ_RAM_LENGTH_AVAILABLE(String): + value = "%(BSP_ZYNQ_RAM_LENGTH)s - 1M - 16k" + tag = ["storage"] + undef = True + descr = "Length of available RAM" + +class ZYNQ_RAM_INT_0_ORIGIN(String): + value = "0x00000000" + tag = ["storage"] + undef = True + descr = "Internal 0 RAM region origin" + +class ZYNQ_RAM_INT_0_LENGTH(String): + value = "64k + 64k + 64k" + tag = ["storage"] + undef = True + descr = "Internal 0 RAM region length" + +class ZYNQ_RAM_INT_1_ORIGIN(String): + value = "0xFFFF0000" + tag = ["storage"] + undef = True + descr = "Internal 1 RAM region origin" + +class ZYNQ_RAM_INT_1_LENGTH(String): + value = "64k - 512" + tag = ["storage"] + undef = True + descr = "Internal 1 RAM region length" + +class BSP_ZYNQ_RAM_LENGTH(String): + value = "256M" + tag = ["storage"] + quote = False + undef = True + descr = "Override a BSP's default RAM length" + +class ZYNQ_RAM_NOCACHE_LENGTH(String): + value = "1M" + tag = ["storage"] + quote = False + undef = True + descr = "Length of nocache RAM region" + +class ZYNQ_CLOCK_CPU_1X(String): + value = "111111111U" + tag = ["general"] + quote = False + undef = True + descr = "Zynq cpu_1x clock frequency in Hz" + +class ZYNQ_CLOCK_UART(String): + value = "50000000UL" + tag = ["network"] + quote = False + undef = True + descr = "Zynq UART clock frequency in Hz" + + +class ZYNQ_CPUS(Integer): + value = 1 + tag = ["general"] + quote = False + undef = True + descr = "Number of active cores" + + +class IS_DM3730(Boolean): + value = False + tag = ["build"] + undef = True + descr = "true if SOC is DM3730" + + +class IS_AM335X(Boolean): + value = False + tag = ["build"] + undef = True + descr = "true if SOC is AM335X" + + +class CONSOLE_POLLED(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Polled console i/o." + + +class CONSOLE_BAUD(Integer): + value = 115200 + tag = ["network"] + undef = True + descr = "initial baud for console UART" + + +class ENABLE_SYSTEM_DEP(Boolean): + value = False + tag = ["general"] + undef = True + descr = "Enable dependencies on system headers, only useful if you are developing toolchains. This will slow down the build" + + +class BSP_PRESS_KEY_FOR_RESET(Boolean): + value = False + tag = ["general"] + undef = False + descr = """If defined to a non-zero value, print a message and wait until pressed before +resetting board when application exits. + """ + +class BSP_RESET_BOARD_AT_EXIT(Boolean): + value = True + tag = ["general"] + undef = False + descr = "If defined to a non-zero value, reset the board when the application exits." + +class BSP_PRINT_EXCEPTION_CONTEXT(Boolean): + value = True + tag = ["general"] + undef = False + descr = """If defined to a non-zero value, prints the exception context when an +unexpected exception occurs. + """ + +class BSP_VERBOSE_FATAL_EXTENSION(Boolean): + value = True + tag = ["general"] + undef = False + descr = "If defined to a non-zero value, prints the some information in case of a fatalerror." + + + +class BSP_SOURCE_DIR(String): + value = None + tag = ["general"] + descr = "Directory for primary BSP source code." diff --git a/py/waf/rtems_config.py b/py/waf/rtems_config.py new file mode 100644 index 0000000000..8c8e21d04c --- /dev/null +++ b/py/waf/rtems_config.py @@ -0,0 +1,62 @@ + + +# --- ANYTHING ABOVE THIS LINE IS AUTOGENERATED --- +from argparse import ArgumentParser + +def arg_print(args): + print(" ".join(args)) + +parser = ArgumentParser(description="RTEMS %s Configuration" % RTEMS_VERSION) +parser.add_argument('--version', action='version', version=RTEMS_VERSION) + +compiler = parser.add_argument_group('BSP Settings / Information') +compiler.add_argument('--bsp', action="store", help="BSP to show options for, use --list for a list.", nargs=1) +compiler.add_argument('--list', action="store_true", help="List available BSPs.") +compiler.add_argument('--list-format', action="store", help="List available bsps using LIST_FORMAT. (default: %%(arch)s/%%(bsp)s)", default=False, nargs="?") + +compiler = parser.add_argument_group('Compiler Arguments') +compiler_e = compiler.add_mutually_exclusive_group() +compiler_e.add_argument('--cflags', action="store_true", help="C Flags.") +compiler_e.add_argument('--libs', action="store_true", help="Libraries used for linking.") +compiler_e.add_argument('--ldflags', action="store_true", help="Linker flags.") + +args = parser.parse_args() + + +if args.list is True: + print("List of Installed BSPs") + print("~~~~~~~~~~~~~~~~~~~~~~") + for b in sorted(BSP_LIST): + print("%-16s %s" % (b, BSP_LIST[b]["description"])) + exit(0) + + +if args.list_format is not False: + if args.list_format is None: + args.list_format = "%(arch)s/%(bsp)s" + + tmp = [] + for b in sorted(BSP_LIST): + arch, bsp = b.split("/") + tmp.append(args.list_format % {"arch": arch, "bsp": bsp}) + print(" ".join(tmp)) + exit(0) + + +if args.bsp is not None: + bsp = args.bsp[0] #XXX: Why is this a list? + + if bsp not in BSP_LIST: + print("Unknown BSP \"%s\", use --list." % bsp) + exit(1) + + if args.cflags is True: + arg_print(BSP_LIST[bsp]["cflags"]) + elif args.libs is True: + arg_print(BSP_LIST[bsp]["libs"]) + elif args.ldflags is True: + arg_print(BSP_LIST[bsp]["ldflags"]) + exit(0) + + +#parser.print_usage() diff --git a/py/waf/switch.py b/py/waf/switch.py new file mode 100644 index 0000000000..0ec674fd8c --- /dev/null +++ b/py/waf/switch.py @@ -0,0 +1,26 @@ +def options(ctx): + ctx.load('compiler_c') + ctx.load('compiler_cxx') + ctx.load('waf_unit_test') + + ctx.add_option('--enable-tests', action='store_true', default=False, help='Enable tests (TEMP OPTION!)') + + grp = ctx.add_option_group("config (configuration file) options") + grp.add_option('--bsp', dest='bsps', help="Command seperated list of BSPs to build.", type='string') + grp.add_option('--list', action='store_true', default=False, help='List available BSPs.') + grp.add_option('--prefix', dest='prefix', help="Install prefix.", type='string') + grp.add_option('--path-tools', dest='path_tools', help="Directory for RTEMS tools.", type='string') + grp.add_option('--force', action='store_true', default=False, help='Force overwriting config.cfg.') + + grp = ctx.add_option_group("docs documentation options") + grp.add_option('--out', dest='file_out', default="options.html", help="Output file (default: %default)", type='string') + grp.add_option('--html', action='store_true', default=True, help='Generate HTML documentation. (default: yes)') + grp.add_option('--txt', action='store_true', default=True, help='Generate Text documentation. (default: no)') + + grp = ctx.add_option_group("build options") + grp.add_option('--build-bsp', help="Build this BSP only.", type='string') + + grp = ctx.add_option_group("developer options") + grp.add_option('--dev-config', action='store_true', default=False, help="Write build configuration. (default: no)") + grp.add_option('--dev-json', action='store_true', default=False, help="Write JSON build log.. (default: no)") + diff --git a/py/waf/test.py b/py/waf/test.py new file mode 100644 index 0000000000..4070e3c10e --- /dev/null +++ b/py/waf/test.py @@ -0,0 +1,38 @@ +from waflib.Logs import pprint + +def test_write_log(ctx): + file_out = "%s/test.log" % ctx.bldnode.abspath() + + log = lst = getattr(ctx, 'utest_results', []) + + if not log: + return + + with open(file_out, "w") as fp: + for binary, retval, lines, error in ctx.utest_results: + fp.write("BINARY : %s\n" % binary) + fp.write("RETURN VALUE: %s\n" % retval) + fp.write("\n*** stdout ***\n") + fp.write(lines) + fp.write("\n*** stderr ***\n") + fp.write(error) + fp.write("\n\n\n") + + pprint("BLUE", "Wrote test log to: ", file_out) + + +def test_print_log(ctx): + for binary, retval, lines, error in ctx.utest_results: + pprint("YELLOW", "BINARY :", binary) + pprint("YELLOW", "RETURN VALUE:", retval) + print("") + + if retval or error: + pprint("RED", "****** ERROR ******\n") + + print(error or lines) + + if (not retval) and (not error): + pprint("GREEN", "****** LOG ******\n", lines) + + print diff --git a/py/waf/tools.py b/py/waf/tools.py new file mode 100644 index 0000000000..9e6a415319 --- /dev/null +++ b/py/waf/tools.py @@ -0,0 +1,256 @@ +from waflib.Logs import pprint +from os.path import exists, getmtime + + +def fatal(str): + pprint('RED', str) + exit(1) + +def generate_rtems_config(ctx, file_in, file_out, devel=False): + from os import fchmod + from pprint import PrettyPrinter + srcnode = ctx.srcnode.abspath() + pp = PrettyPrinter(depth=4) + bsps = {} + + + for bsp in ctx.env.BSP: + env = ctx.all_envs[bsp] + bsps[bsp] = { + # XXX: This really needs to use features to get the paths. + "cflags": env.CFLAGS + env.CONFIG_CFLAGS + \ + [ + "-I%s/cpukit/include" % srcnode, "-I%s/cpukit/score/cpu/%s/include/" % (srcnode, env.RTEMS_ARCH), + "-I%s/bsps/%s/%s/include/" % (srcnode, env.RTEMS_ARCH, env.BSP_SOURCE_DIR), + "-I%s/bsps/include/" % srcnode, + "-I%s/bsps/%s/include/" % (srcnode, env.RTEMS_ARCH) + ], + "libs": env.LIBS + ["-lrtemscpu -lrtemsbsp"] + env.CONFIG_LIBS, + "ldflags": env.LDFLAGS + env.CONFIG_LDFLAGS, + "description": env.CONFIG_DESCRIPTION + } + + if devel: + path_bld = "%s/%s" % (ctx.bldnode.abspath(), bsp) + + include = [] + include.append("-I%s/include" % srcnode) + include.append("-I%s/include" % path_bld) + include.append("-I%s/include/rtems" % path_bld) + bsps[bsp]["cflags"] = include + bsps[bsp]["cflags"] +# bsps[bsp]["libs"] = ["%s/c/start.o" % path_bld] + bsps[bsp]["libs"] + + ldflags = [] + ldflags.append("-specs %s/gcc_spec" % path_bld) + ldflags.append("-L%s/cpukit/" % path_bld) + ldflags.append("-L%s/c/" % path_bld) +# ldflags.append("-Wl,-T %s/c/linkcmds" % path_bld) +# bsps[bsp]["ldflags"] = ldflags + bsps[bsp]["libs"] + bsps[bsp]["ldflags"] += ldflags + ["-Wl,-start-group"] + bsps[bsp]["libs"] + ["-lc"] + ["-lgcc"] + ["-Wl,-end-group"] + + else: + raise Exception("Doesn't work in install mode yet.") + + #XXX: file_in and file_out can be automatically calculated they don't need to be parms. + with open(file_in, "r") as fp: + config = fp.read() + + with open(file_out, "w") as fp: + fp.write('#!%s\n' % ctx.env.BIN_PYTHON[0]) # XXX: How does this work on Windows? + fp.write('RTEMS_VERSION = "%s"\n' % ctx.env.RTEMS_VERSION) + fp.write('PREFIX="%s"\n' % ctx.env.PREFIX) + fp.write('BSP_LIST = %s\n' % pp.pformat(bsps)) + fp.write(config) + fchmod(fp.fileno(), 0o755) + + +# XXX: rewrite this. +def generate_gcc_spec_file(ctx, devel=False): + + path_bld = "%s/%s" % (ctx.bldnode.abspath(), ctx.variant) + path_bld_linkcmds = "%s/bsps/" % path_bld #XXX temp for new build. + path_bld_shared = "%s/bsps/%s/shared/" % (path_bld, ctx.env.RTEMS_ARCH) #XXX temp for new build. + path_bld_bsp = "%s/bsps/%s/%s/" % (path_bld, ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP) #XXX temp for new build. + data = [] + +# /mnt/devel/rtems/commit/build/sparc/erc32/bsps/sparc/shared//linkcmds +# /mnt/devel/rtems/commit/build/sparc/erc32/bsps/linkcmds + + def expand_flags(ctx, obj_list): +# path_bld = "%s/%s" % (ctx.bldnode.abspath(), ctx.variant) + l = [] + for obj in obj_list: + obj = obj.replace("${RTEMS_LINKCMDS}", "%s" % path_bld_linkcmds) + obj = obj.replace("${RTEMS}", "%s" % path_bld_shared) + obj = obj.replace("${RTEMS_BSP}", "%s" % path_bld_bsp) + + if obj.endswith('.o'): + fmt = '%s%%s' + else: + fmt = '%s' + l.append(fmt % obj) + return " ".join(l) + + data.append("*startfile:") + data.append(expand_flags(ctx, ctx.env.LINK_START)) + data.append("") + data.append("*endfile:") + data.append(expand_flags(ctx, ctx.env.LINK_END)) + data.append("") + data.append("*link:") + data.append(expand_flags(ctx, ctx.env.LINK_LINK)) + + with open("%s/gcc_spec" % path_bld, "w") as fp: + for line in data: + fp.write(line) + fp.write("\n") + + ctx.env.append_value('cfg_files', "%s/gcc_spec" % path_bld) + + return "%s/%s/gcc_spec" % (ctx.bldnode, ctx.variant) + + + +# Get all the BSPs for a specific arch +def rtems_bsp_arch_all(arch): + from py.config.bsp import map_bsp + list_bsp = map_bsp() #XXX: temp + + if arch not in list_bsp: + fatal("Incorrect arch for --bsp, must be in the form of arch or arch/name: \"%s\"" % arch) + bsp_list = [] + for bsp in list_bsp[arch]: + bsp_list += ['%s/%s' % (arch, bsp)] + return bsp_list + + +# Get all the BSPs +def rtems_bsp_all(): + from py.config.bsp import map_bsp + list_bsp = map_bsp() #XXX: temp + + bsp_list = [] + for arch in list_bsp: + for bsp in list_bsp[arch]: + bsp_list += ['%s/%s' % (arch, bsp)] + return bsp_list + + +def rtems_bsp_wildcard(pattern): + if '.' in pattern: + pattern = pattern.replace('.', '\.') + if '*' in pattern: + pattern = pattern.replace('*', '.*') + return '^' + pattern + '$' + + +def rtems_bsp_list(bsps): + import re + from py.config.bsp import map_bsp + list_bsp = map_bsp() #XXX: temp + + bsp_list = [x.strip() for x in bsps.split(',')] + + verified_bsp_list = [] + + for bsp in bsp_list: + if '/' not in bsp: + fatal("Incorrect value for --bsp must be in the form of arch/name: \"%s\"" % bsp) + (arch, bsp) = bsp.split('/') + pa = re.compile(rtems_bsp_wildcard(arch), re.IGNORECASE) + pb = re.compile(rtems_bsp_wildcard(bsp), re.IGNORECASE) + + for arch in list_bsp: + if pa.match(arch) is not None: + for bsp in list_bsp[arch]: + if pb.match(bsp) is not None: + arch_bsp = '%s/%s' % (arch, bsp) + verified_bsp_list += [arch_bsp] + + return sorted(verified_bsp_list) + + +def rtems_cmd_config(ctx): + from py.config import BuildConfig, RTEMSConfig + from py.config.bsp import get_option_class, get_config_class + + rc = RTEMSConfig(get_option_class(), get_config_class()) + + if ctx.options.list is True: + from py.config.bsp import map_bsp + list_bsp = map_bsp() #XXX: temp + + from py.config import BuildConfig +# cfg = BuildConfig(rc) + + for arch in sorted(list_bsp): + print("") + print(arch) + + for bsp in sorted(list_bsp[arch]): +# descr = cfg.bsp_get_detail(arch, bsp) + descr = "" #XXX: There is a bug here fix needs to be in config/base/BuildConfig::_parse_bsp + print(" %-22s %s" % ("%s/%s" % (arch, bsp), descr)) + return + + + + + if ctx.options.force is False and exists("config.cfg"): + ctx.fatal("Please delete config.cfg before creating a new one.") + + if not ctx.options.bsps: + ctx.fatal("You must specify a single or comma separated list of BSPs using --bsp") + + bsp_list = rtems_bsp_list(ctx.options.bsps) + if not bsp_list: + ctx.fatal("You must specify a single or comma separated list of BSPs using --bsp") + + + cfg = BuildConfig(rc, bsp_list) + cfg.option_set("general", "PATH_TOOLS", ctx.options.path_tools or "") + cfg.option_set("general", "PREFIX", ctx.options.prefix or "") + cfg.save() + + pprint("YELLOW", "Wrote config.cfg") + archs = {} + for bsp in bsp_list: + pprint("YELLOW", " - %s" % bsp) + arch = bsp.split('/')[0] + if arch not in archs: + archs[arch] = 0 + archs[arch] += 1 + + pprint("YELLOW", "Configured BSPS:") + pprint("YELLOW", " Total : %d" % len(bsp_list)) + arch_list = sorted(archs.keys()) + for arch in arch_list: + pprint("YELLOW", " %-8s: %d" % (arch, archs[arch])) + + +def rtems_cmd_bsp(ctx): + ctx.fatal("Not implemented.") + print("List of available BSPs") + print("List of DISABLED BSPs") + + +# Get file mtime. +def get_file_mtime(file): + return getmtime(file) + + +from subprocess import Popen, PIPE + +def run(cmd): + p = Popen(cmd, stdout=PIPE, stderr=PIPE) + stdout, stderr = p.communicate() + return stdout[:-1], stderr[:-1], p.returncode + + +def get_options(bsp): + pass + +def get_config(bsp): + pass + + diff --git a/py/waf/waf.py b/py/waf/waf.py new file mode 100644 index 0000000000..3988dbf5cb --- /dev/null +++ b/py/waf/waf.py @@ -0,0 +1,437 @@ +from waflib.Task import Task +from waflib.TaskGen import feature, before, after, extension, after_method +from waflib.Configure import conf +from waflib.Logs import pprint +#from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext +#from waflib import Build, Scripting +#from waflib.Tools import c_preproc +#from py.tools import gccdeps +#from waflib import Logs +#import ConfigParser + + +################# +# Handle .S Files +################# +class casm(Task): +# run_str = '${CC} ${ARCH_ST:ARCH} ${CFLAGS} ${CPPFLAGS} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT}' + run_str = '${CC} -DASM ${ARCH_ST:ARCH} ${CFLAGS} ${CPPFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT}' + ext_in = ['.h'] + ext_out = ['.o'] + color = 'BLUE' + +@extension('.S') +def asm_hook(self, node): + return self.create_compiled_task('casm', node) + + +########## +# Features +########## +@feature('bld_include') +@after_method('apply_incpaths') +def insert_blddir(self): + self.env.prepend_value('INCPATHS', ['include']) + +@feature('src_include') +@after_method('apply_incpaths', 'insert_blddir') +def insert_srcdir(self): + path = self.bld.srcnode.abspath() + self.env.append_value('INCPATHS', "%s/include" % path) + + if self.env.ENABLE_SMP: +# self.env.append_value('INCPATHS', "%s/cpukit/score/cpu/%s/include/" % (path, self.env.RTEMS_ARCH)) + self.env.append_value('INCPATHS', "%s/cpukit/include/" % path) + +@feature('src_include_rtems') +@after_method('apply_incpaths', 'insert_blddir') +def insert_srcdir_rtems(self): + self.env.append_value('INCPATHS', "%s/cpukit/include/" % self.bld.srcnode.abspath()) + +@feature('src_include_networking') +@after_method('apply_incpaths', 'insert_blddir') +def insert_srcdir_networking(self): + self.env.append_value('INCPATHS', "%s/cpukit/libnetworking" % self.bld.srcnode.abspath()) + +@feature('src_include_bsp_common') +@after_method('apply_incpaths', 'insert_blddir') +def src_include_bsp_common(self): + self.env.append_value('INCPATHS', "%s/bsps/include" % self.bld.srcnode.abspath()) + +@feature('src_include_bsp') +@after_method('apply_incpaths', 'insert_blddir') +def insert_srcdir_bsp(self): + self.env.append_value('INCPATHS', "%s/bsps/%s/%s/include/" % (self.bld.srcnode.abspath(), self.env.RTEMS_ARCH, self.env.BSP_SOURCE_DIR)) + +@feature('src_include_bsp_shared') +@after_method('apply_incpaths', 'insert_blddir') +def insert_srcdir_bsp_shared(self): + self.env.append_value('INCPATHS', "%s/bsps/%s/include/" % (self.bld.srcnode.abspath(), self.env.RTEMS_ARCH)) + +@feature('src_include_libcpu') +@after_method('apply_incpaths', 'insert_blddir') +def insert_srcdir_libcpu(self): + self.env.append_value('INCPATHS', "%s/include/libcpu" % self.bld.srcnode.abspath()) + +@feature('src_include_libchip') +@after_method('apply_incpaths', 'insert_blddir') +def insert_srcdir_libchip(self): + self.env.append_value('INCPATHS', "%s/include/libchip" % self.bld.srcnode.abspath()) + +@feature('src_include_score') +@after_method('apply_incpaths', 'insert_blddir') +def insert_srcdir_score(self): + self.env.append_value('INCPATHS', "%s/cpukit/score/cpu/%s/include/" % (self.bld.srcnode.abspath(), self.env.RTEMS_ARCH)) + +@feature('src_include_bsp_arch') +@after_method('apply_incpaths', 'insert_blddir') +def insert_bsp_arch(self): + self.env.append_value('INCPATHS', "%s/bsps/%s/include//" % (self.bld.srcnode.abspath(), self.env.RTEMS_ARCH)) + + + +########### +# Shortcuts +########### +def rtems_build(cmd, ctx, target_name, source, **kwarg): + feature = "c bld_include" + if "features" in kwarg: + feature = "%s %s" % (kwarg["features"], feature) + del kwarg["features"] + + cmd( + source = source, + target = target_name, + features = feature, + install_path = ctx.env.LIBDIR, + **kwarg) + +# There's probably a better way to do this. +@conf +def rtems_lib(ctx, target_name, source, **kwarg): + rtems_build(ctx.stlib, ctx, target_name, source, **kwarg) + +@conf +def rtems_obj(ctx, target_name, source, **kwarg): + rtems_build(ctx, ctx, target_name, source, **kwarg) + +@conf +def rtems_program(ctx, target_name, source, **kwarg): + rtems_build(ctx.program, ctx, target_name, source, **kwarg) + + +@conf +def copy(ctx, source, target, name): + ctx( + features = 'subst', + source = source, + target = target, + is_copy = True, + name = name, + ) + +@conf +def copy_or_subst(ctx, source, target, name): + if source.endswith(".in"): + # This is required as not all 'linkcmd' files are named as such see the + # bottom of c/wscript It can be removed when the names are normalised + # XXX: fix 'linkcmd' names. + + if target.endswith(".in"): + target = target[:-3] + + ctx( + features = 'subst', + source = source, + target = target, + encoding = 'ascii', # for python3. + name = name, +# is_copy = True + ) + else: + ctx.copy(source, target, name) + + +################# +# Configure Steps +################# + +SNIP_FUNCTION = ''' +%s +int main(int argc, char **argv) { + void (*p)(); + (void)argc; (void)argv; + p=(void(*)())(%s); + return !p; +} +''' + +SNIP_TYPE = ''' +#include <%(header)s> +int main(int argc, char **argv) { + (void)argc; (void)argv; + if ((%(type)s *) 0) return 0; + if (sizeof (%(type)s)) return 0; + return 1; +} +''' + +SNIP_FIELD = ''' +int main(int argc, char **argv) { + char *off; + (void)argc; (void)argv; + off = (char*) &((%(type_name)s*)0)->%(field_name)s; + return (size_t) off < sizeof(%(type_name)s); +} +''' + + +SNIP_FUNC_DECL = ''' +%(header)s +int main(int argc, char **argv) { + %(decl)s; + return 1; +} +''' + + +@conf +def check_type(ctx, type, header_n, mandatory=False): + ctx.check_cc( + mandatory = mandatory, + fragment = SNIP_TYPE % {"type": type, "header": header_n}, + define_name = "HAVE_%s" % type.upper(), + execute = False, + msg = "Checking for type %s in header %s" % (type, header_n) +) + + +@conf +def check_func_header(ctx, func, header_n, mandatory=False): + header_msg = "" + header_inc = "" + + if header_n: + if isinstance(header_n, list): + for header in header_n: + header_inc += "#include <%s>\n" % header + header_msg = "in %s" % ", ".join(header_n) + else: + header_inc = "#include <%s>\n" % header_n + header_msg = "in %s" % header_n + + ctx.check_cc( + mandatory = mandatory, + fragment = SNIP_FUNCTION % (header_inc, func), + define_name = "HAVE_%s" % func.upper(), + execute = False, + msg = "Checking for C library function %s %s" % (func, header_msg), + features = 'c' + ) + + +@conf +def check_func(ctx, func, mandatory=False): + ctx.check_cc( + mandatory = mandatory, + fragment = "char %s();\n int main() { return %s(); return 0; }" % (func, func), + define_name = "HAVE_%s" % func.upper(), + execute = False, + msg = "Checking for C library function %s" % func +) + +@conf +def check_func_decl(ctx, decl, header_n, define, mandatory=False): + if header_n: + if isinstance(header_n, list): + for header in header_n: + header_inc += "#include <%s>\n" % header + header_msg = "in %s" % ", ".join(header_n) + else: + header_inc = "#include <%s>\n" % header_n + header_msg = "in %s" % header_n + + ctx.check_cc( + mandatory = mandatory, + fragment = SNIP_FUNC_DECL % {"decl": decl, "header": header_inc}, + define_name = "HAVE_%s" % define.upper(), + execute = False, + msg = "Checking for function decleration\n %s %s" % (decl, header_msg) +) + + +# ctx.check_cc( +# mandatory = mandatory, +# fragment = SNIP_FUNCTION % (header_inc, func), +# fragment = "%s\n %s\n int main() { return %s(); return 0; }\n" % (header_inc, char_check, func), +# define_name = "HAVE_%s" % func.upper(), +# execute = False, +# msg = "Checking for C library function %s%s" % (func, header_msg), +# features = 'c' +# ) + + + + + +@conf +def check_size(ctx, field, mandatory=False, define_name=None): + if define_name is None: + define_name = "SIZEOF_%s" % field.upper() + + ctx.check_cc( + mandatory = mandatory, + fragment = """ + #include + #include + main() { + printf("%%d", sizeof(%s)); + return 0; + } + """ % field, + execute = True, + define_ret = True, + define_name = define_name, + quote = False, + msg = "Checking size of %s" % field + ) + +@conf +def check_define(ctx, define, header, mandatory=False): + ctx.check( + mandatory = mandatory, + fragment = '''#include <%s>\n int main () {\n #ifndef %s\n #error "missing define"\n #endif\n return 0; }\n''' % (header, define), + define_name = "HAVE_%s" % define.upper(), + features = "c", + msg = "Checking for define %s in %s" % (define, header) + ) + + +################################################# +# This writes objects to a file if there are > 25 +# objects to avoid commandline arg limits for ar. +################################################# +def rtems_stlib_command(self, *k, **kw): + # Following block borrowed from waflib/Tools/msvc.py + bld = self.generator.bld + + try: + if not kw.get('cwd', None): + kw['cwd'] = bld.cwd + except AttributeError: + bld.cwd = kw['cwd'] = bld.variant_dir + + # Put the objects on the commandline if there aren't enough to + # warrant writing to a file. + if len(self.inputs) < 25: + return self.generator.bld.exec_command(*k, **kw) + + file_obj = "%s_files" % self.outputs[0].abspath() + with open(file_obj, "w") as fp: + for f in self.inputs: + fp.write("%s\n" % f.bldpath()) + + pprint("YELLOW", "Wrote %d objects to %s" % (len(self.inputs), file_obj)) + cmd = self.env.AR + ["rc", self.outputs[0].bldpath(), "@%s_files" % self.outputs[0].bldpath()] + + # Task information for JSON build output. + if self.env.BUILD_JSON: + kw["json_task_self"] = self + + return self.generator.bld.exec_command(cmd, **kw) + + + +# Tests +@feature('test_include') +@after_method('apply_incpaths') +def insert_test_include(self): + self.env.prepend_value('INCPATHS', "%s/testsuites/support/include" % self.bld.srcnode.abspath()) + +@feature('test_cprogram') +@after_method('apply_incpaths', 'apply_link', 'src_include_bsp_common') +def re_fix_linkcmds(self): + linkcmds = self.env.LINKCMDS[0] + assert linkcmds + assert self.link_task + for x in ('linkcmds_linkcmds', 'linkcmds_base', 'start_start_o'): + tg = self.bld.get_tgen_by_name(x) + tg.post() + self.link_task.dep_nodes.append(tg.tasks[0].outputs[0]) + +from waflib.Tools.c import cprogram +from waflib.Tools.ccroot import USELIB_VARS + +USELIB_VARS['test_cprogram'] = set(['STLIB', 'STLIBPATH', 'LDFLAGS']) + +#from StringIO import StringIO +from os import fdopen, pipe, read, close +class test_cprogram(cprogram): + run_str = '${LINK_CC} ${LDFLAGS} ${CFLAGS} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[0].abspath()} -specs gcc_spec -Wl,-Bstatic -Lc -Lcpukit -Wl,-start-group -lc -lgcc ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} -Wl,-end-group' + + def exec_command(self, cmd, **kw): + r, w = pipe() + rfd = fdopen(r, "r", encoding="utf-8") + kw["stderr"] = fdopen(w, "wb", 0) + ret = cprogram.exec_command(self, cmd, **kw) + kw["stderr"].close() + + if ret == 1: + data = rfd.readlines() + + if " ".join(data).find("will not fit in region") != -1: + file = self.outputs[0].abspath() + with open(file, "w") as fp: + fp.write("Target does not meet test memory constraints.\n") + pprint("RED", "Target \"%s\" does not meet test memory constraints." % file) + rfd.close() + return 0 + print("".join(data)) + + rfd.close() + return ret + + + +@conf +def rtems_test(ctx, target_name, source_name, **kwarg): + features_merged = "c test_cprogram bld_include src_include src_include_rtems" # test" + if "features" in kwarg: + features_merged = "%s %s" % (kwarg["features"], features_merged) + del kwarg["features"] + + use_merged = "rtemsbsp rtemscpu" + if "use" in kwarg: + use_merged = "%s %s" % (kwarg["use"], use_merged) + del kwarg["use"] + + name = "test_%s" % target_name + + ctx( + source = source_name, + target = name, + features = features_merged, + use = use_merged, + install_path = ctx.env.TESTDIR, + ut_cmd = "%s %%s" % ctx.env.BIN_RTEMS_RUN[0], + **kwarg + ) + + +@conf +def rtems_doc(ctx, section): + pprint("YELLOW", "See http://docs.rtems.org/%s/user/#%s (Not activated yet!)" % (ctx.env.RTEMS_VERSION, section)) + + +@conf +def rtems_fatal(ctx, message, section): + pprint("RED", message) + ctx.rtems_doc(section) + ctx.fatal("Fatal error") + + +@conf +def rtems_warn(ctx, message, section): + pprint("YELLOW", message) + ctx.rtems_doc(section) + diff --git a/testsuites/fstests/wscript b/testsuites/fstests/wscript new file mode 100644 index 0000000000..ab8cea1932 --- /dev/null +++ b/testsuites/fstests/wscript @@ -0,0 +1,94 @@ +def build(ctx): + srcnode = ctx.srcnode.abspath() + + includes_common = [ + "%s/testsuites/fstests/support" % srcnode, + "%s/testsuites/psxtests/include" % srcnode, + "%s/testsuites/support/include" % srcnode, + ] + + def test(target, source, includes=[], use=[]): + ctx.rtems_test( + "fstests_%s" % target, + source, + includes = includes_common + includes, + use = use, + features = "src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + ) + + def objects_common(target, source): + ctx.objects( + source = source, + name = "fstests_%s_common" % target, + includes = ["%s/testsuites/fstests/%s_support" % (srcnode, target)] + includes_common, + features = "bld_include src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + ) + + + def imfs(target, source): + test( + target, + source, + includes = ["%s/testsuites/fstests/imfs_support" % srcnode], + use = "fstests_imfs_common" + ) + + objects_common("imfs", ["imfs_support/fs_support.c", "support/fstest_support.c"]) + imfs("imfs_fserror", ["fserror/test.c"]) + imfs("imfs_fslink", ["fslink/test.c"]) + imfs("imfs_fspatheval", ["fspatheval/test.c"]) + imfs("imfs_fspermission", ["fspermission/test.c"]) + imfs("imfs_fsrdwr", ["fsrdwr/init.c"]) + imfs("imfs_fssymlink", ["fssymlink/test.c"]) + imfs("imfs_fstime", ["fstime/test.c"]) + + + + def mdosfs(target, source): + test( + target, + source, + includes = ["%s/testsuites/fstests/mdosfs_support" % srcnode], + use = "fstests_mdosfs_common" + ) + objects_common("mdosfs", ["mdosfs_support/fs_support.c", "support/fstest_support.c", "support/ramdisk_support.c"]) + mdosfs("mdosfs_fserror", ["fserror/test.c"]) + mdosfs("mdosfs_fspatheval", ["fspatheval/test.c"]) + mdosfs("mdosfs_fsrdwr", ["fsrdwr/init.c"]) + mdosfs("mdosfs_fstime", ["fstime/test.c"]) + + + + def mimfs(target, source): + test( + target, + source, + includes = ["%s/testsuites/fstests/mimfs_support" % srcnode], + use = "fstests_mimfs_common" + ) + objects_common("mimfs", ["mimfs_support/fs_support.c", "support/fstest_support.c"]) + mimfs("mimfs_fserror", ["fserror/test.c"]) + mimfs("mimfs_fslink", ["fslink/test.c"]) + mimfs("mimfs_fspatheval", ["fspatheval/test.c"]) + mimfs("mimfs_fspermission", ["fspermission/test.c"]) + mimfs("mimfs_fsrdwr", ["fsrdwr/init.c"]) + mimfs("mimfs_fssymlink", ["fssymlink/test.c"]) + mimfs("mimfs_fstime", ["fstime/test.c"]) + + + + def mrfs(target, source): + test( + target, + source, + includes = ["%s/testsuites/fstests/mimfs_support" % srcnode], + use = "fstests_mrfs_common" + ) + objects_common("mrfs", ["mrfs_support/fs_support.c", "support/fstest_support.c", "support/ramdisk_support.c"]) + mrfs("mrfs_fserror", ["fserror/test.c"]) + mrfs("mrfs_fslink", ["fslink/test.c"]) + mrfs("mrfs_fspatheval", ["fspatheval/test.c"]) + mrfs("mrfs_fspermission", ["fspermission/test.c"]) + mrfs("mrfs_fsrdwr", ["fsrdwr/init.c"]) + mrfs("mrfs_fssymlink", ["fssymlink/test.c"]) + mrfs("mrfs_fstime", ["fstime/test.c"]) diff --git a/testsuites/libtests/wscript b/testsuites/libtests/wscript new file mode 100644 index 0000000000..757f786afc --- /dev/null +++ b/testsuites/libtests/wscript @@ -0,0 +1,167 @@ +def build(ctx): + + broken = False +# XXX: This needs fixing! + if broken: +# if ctx.env.ENABLE_POSIX: + def posix(target, source): + ctx.rtems_test( + "libtests_posix_%s" % target, + source, + ) + + posix("calloc", "POSIX/calloc.c") + posix("clock_gettime", "POSIX/clock_gettime.c") + posix("close", "POSIX/close.c") + posix("dup2", "POSIX/dup2.c") + posix("fcntl", "POSIX/fcntl.c") + posix("flockfile", "POSIX/flockfile.c") + posix("fork", "POSIX/fork.c") + posix("free", "POSIX/free.c") + posix("fstat", "POSIX/fstat.c") + posix("ftrylockfile", "POSIX/ftrylockfile.c") + posix("funlockfile", "POSIX/funlockfile.c") + posix("getlogin", "POSIX/getlogin.c") + posix("getpwnam", "POSIX/getpwnam.c") + posix("getpwuid", "POSIX/getpwuid.c") + posix("gettimeofday", "POSIX/gettimeofday.c") + posix("getuid", "POSIX/getuid.c") + posix("htonl", "POSIX/htonl.c") + posix("iconv", "POSIX/iconv.c") + posix("iconv_close", "POSIX/iconv_close.c") + posix("iconv_open", "POSIX/iconv_open.c") + posix("kill", "POSIX/kill.c") + posix("longjmp", "POSIX/longjmp.c") + posix("lseek", "POSIX/lseek.c") + posix("lstat", "POSIX/lstat.c") + posix("malloc", "POSIX/malloc.c") + posix("nanosleep", "POSIX/nanosleep.c") + posix("open", "POSIX/open.c") + posix("pipe", "POSIX/pipe.c") + posix("posix_memalign", "POSIX/posix_memalign.c") + posix("read", "POSIX/read.c") + posix("readv", "POSIX/readv.c") + posix("realloc", "POSIX/realloc.c") + posix("setjmp", "POSIX/setjmp.c") + posix("sigaddset", "POSIX/sigaddset.c") + posix("sigdelset", "POSIX/sigdelset.c") + posix("sigemptyset", "POSIX/sigemptyset.c") + posix("sigfillset", "POSIX/sigfillset.c") + posix("sigismember", "POSIX/sigismember.c") + posix("sigprocmask", "POSIX/sigprocmask.c") + posix("stat", "POSIX/stat.c") + posix("unlink", "POSIX/unlink.c") + posix("vfork", "POSIX/vfork.c") + posix("wait", "POSIX/wait.c") + posix("waitpid", "POSIX/waitpid.c") + posix("write", "POSIX/write.c") + posix("writev", "POSIX/writev.c") + + return + + def test(target, source, **kwarg): + ctx.rtems_test( + "libtests_%s" % target, + source, + features = "test_include", + **kwarg + ) + + test("block01", ["block01/init.c"]) + test("block02", ["block02/init.c"]) + test("block03", ["block03/init.c"]) + test("block04", ["block04/init.c"]) + test("block05", ["block05/init.c"]) + test("block06", ["block06/init.c"]) + test("block07", ["block07/init.c"]) + test( + "block08", + ["block08/bdbuf_test1_1.c", "block08/bdbuf_test1_2.c", "block08/bdbuf_test1_3.c", "block08/bdbuf_test1_4.c", "block08/bdbuf_test1_5.c", "block08/bdbuf_test2_1.c", "block08/bdbuf_test2_2.c", "block08/bdbuf_test3_1.c", "block08/bdbuf_test3_2.c", "block08/bdbuf_test3_3.c", "block08/bdbuf_test4_1.c", "block08/bdbuf_test4_2.c", "block08/bdbuf_test4_3.c", "block08/bdbuf_tests.c", "block08/init.c", "block08/test_disk.c"], + includes="%s/testsuites/libtests/block08" % ctx.srcnode.abspath() + ) + test("block09", ["block09/init.c"]) + test("block10", ["block10/init.c"]) + test("bspcmdline01", ["bspcmdline01/init.c"]) +# requires build hacking test("complex", ["complex/docomplex.c", "complex/docomplexf.c", "complex/docomplexl.c", "complex/init.c"], stlib=["m"]) + test("cpuuse", ["cpuuse/init.c", "cpuuse/task1.c", "cpuuse/task2.c", "cpuuse/task3.c", "cpuuse/tswitch.c"]) + test("devfs01", ["devfs01/init.c"]) + test("devfs02", ["devfs02/init.c"]) + test("devfs03", ["devfs03/init.c"]) + test("devfs04", ["devfs04/init.c", "devfs04/test_driver.c"]) + test("deviceio01", ["deviceio01/init.c", "deviceio01/test_driver.c"]) +# test("devnullfatal01", ["../sptests/spfatal_support/init.c"]) # XXX: relative path + test("dumpbuf01", ["dumpbuf01/init.c"]) + test("ftp01", ["ftp01/init.c"]) + test("gxx01", ["gxx01/init.c"]) + test("heapwalk", ["heapwalk/init.c"]) + test("malloc02", ["malloc02/init.c"]) + test("malloc03", ["malloc03/init.c"]) + test("malloc04", ["malloc04/init.c"]) + test("malloc05", ["malloc05/init.c"]) + test("malloctest", ["malloctest/init.c", "malloctest/task1.c"]) + + test( + "math", + ["math/domath.c", "math/init.c"], + stlib=["m"] + ) + + test( + "mathf", + ["mathf/domathf.c", "mathf/init.c"], + stlib=["m"] + ) + + test( + "mathl", + ["mathl/domathl.c", "mathl/init.c"], + stlib=["m"] +) + test("monitor", ["monitor/init.c"]) + + test("monitor02", ["monitor02/init.c"]) + + test( + "mouse01", + ["mouse01/init.c", "mouse01/msmouse.c", "mouse01/serial_mouse_config.c", "termios04/termios_testdriver_intr.c"], + includes="%s/testsuites/libtests/termios04" % ctx.srcnode.abspath() + ) + + test("putenvtest", ["putenvtest/init.c"]) +# test("rtems++", ["Init.cc", "Task1.cc", "Task2.cc", "Task3.cc"]) + + test("rtmonuse", ["rtmonuse/getall.c", "rtmonuse/init.c", "rtmonuse/task1.c"]) + test("stackchk", ["stackchk/blow.c", "stackchk/init.c", "stackchk/task1.c"]) + test("stackchk01", ["stackchk01/init.c"]) + test("stringto01", ["stringto01/init.c"]) +#bin2c test("tar01", ["tar01/init.c"]) +#bin2c test("tar02", ["tar02/init.c"]) + test("tar03", ["tar03/init.c"]) + test("termios", ["termios/init.c"]) + test("termios01", ["termios01/init.c", "termios01/termios_testdriver.c"]) + test("termios02", ["termios02/init.c"]) + test("termios03", ["termios03/init.c", "termios03/termios_testdriver_polled.c"]) + test("termios04", ["termios04/init.c", "termios04/termios_testdriver_intr.c"]) + test( + "termios05", + ["termios05/init.c", "termios05/termios_testdriver_taskdriven.c"], + includes="%s/testsuites/libtests/termios04" % ctx.srcnode.abspath() + ) + test( + "termios06", + ["termios06/init.c", "termios06/test_pppd.c", "termios04/termios_testdriver_intr.c"], + includes="%s/testsuites/libtests/termios03" % ctx.srcnode.abspath() + ) + test( + "termios07", + ["termios07/init.c", "termios04/termios_testdriver_intr.c"], + includes="%s/testsuites/libtests/termios04" % ctx.srcnode.abspath() + ) + test( + "termios08", + ["termios08/init.c", "termios04/termios_testdriver_intr.c"], + includes="%s/testsuites/libtests/termios03" % ctx.srcnode.abspath() + ) + test("tztest", ["tztest/init.c"]) + + diff --git a/testsuites/mptests/wscript b/testsuites/mptests/wscript new file mode 100644 index 0000000000..e727092bc7 --- /dev/null +++ b/testsuites/mptests/wscript @@ -0,0 +1,57 @@ +def build(ctx): + srcnode = ctx.srcnode.abspath() + + def test(target, source, defines): + ctx.rtems_test( + "mptests_%s" % target, + source, + includes = [ + "%s/testsuites/psxtests/include/" % srcnode, + "%s/c/src/libchip/shmdr/" % srcnode, + ], + features = "test_include", + defines = defines + ) + + test("mp01-node01", ["mp01/init.c", "mp01/task1.c"], defines=["NODE_NUMBER=1"]) + test("mp01-node02", ["mp01/init.c", "mp01/task1.c"], defines=["NODE_NUMBER=2"]) + + test("mp02-node01", ["mp02/init.c", "mp02/task1.c"], defines=["NODE_NUMBER=1"]) + test("mp02-node02", ["mp02/init.c", "mp02/task1.c"], defines=["NODE_NUMBER=1"]) + + test("mp03-node01", ["mp03/delay.c", "mp03/init.c", "mp03/task1.c"], defines=["NODE_NUMBER=1"]) + test("mp03-node02", ["mp03/delay.c", "mp03/init.c", "mp03/task1.c"], defines=["NODE_NUMBER=1"]) + + test("mp04-node01", ["mp04/init.c", "mp04/task1.c"], defines=["NODE_NUMBER=1"]) + test("mp04-node02", ["mp04/init.c", "mp04/task1.c"], defines=["NODE_NUMBER=1"]) + + test("mp05-node01", ["mp05/asr.c", "mp05/init.c", "mp05/task1.c"], defines=["NODE_NUMBER=1"]) + test("mp05-node02", ["mp05/asr.c", "mp05/init.c", "mp05/task1.c"], defines=["NODE_NUMBER=1"]) + + test("mp06-node01", ["mp06/init.c", "mp06/task1.c"], defines=["NODE_NUMBER=1"]) + test("mp06-node02", ["mp06/init.c", "mp06/task1.c"], defines=["NODE_NUMBER=1"]) + + test("mp07-node01", ["mp07/init.c", "mp07/task1.c"], defines=["NODE_NUMBER=1"]) + test("mp07-node02", ["mp07/init.c", "mp07/task1.c"], defines=["NODE_NUMBER=1"]) + + test("mp08-node01", ["mp08/init.c", "mp08/task1.c"], defines=["NODE_NUMBER=1"]) + test("mp08-node02", ["mp08/init.c", "mp08/task1.c"], defines=["NODE_NUMBER=1"]) + + test("mp09-node01", ["mp09/init.c", "mp09/recvmsg.c", "mp09/sendmsg.c", "mp09/task1.c"], defines=["NODE_NUMBER=1"]) + test("mp09-node02", ["mp09/init.c", "mp09/recvmsg.c", "mp09/sendmsg.c", "mp09/task1.c"], defines=["NODE_NUMBER=1"]) + + test("mp10-node01", ["mp10/init.c", "mp10/task1.c", "mp10/task2.c", "mp10/task3.c"], defines=["NODE_NUMBER=1"]) + test("mp10-node02", ["mp10/init.c", "mp10/task1.c", "mp10/task2.c", "mp10/task3.c"], defines=["NODE_NUMBER=1"]) + + test("mp11-node01", ["mp11/init.c"], defines=["NODE_NUMBER=1"]) + test("mp11-node02", ["mp11/init.c"], defines=["NODE_NUMBER=1"]) + + test("mp12-node01", ["mp12/init.c"], defines=["NODE_NUMBER=1"]) + test("mp12-node02", ["mp12/init.c"], defines=["NODE_NUMBER=1"]) + + test("mp13-node01", ["mp13/init.c", "mp13/task1.c", "mp13/task2.c"], defines=["NODE_NUMBER=1"]) + test("mp13-node02", ["mp13/init.c", "mp13/task1.c", "mp13/task2.c"], defines=["NODE_NUMBER=1"]) + +#XXX: MAX_LONG_TEST_DURATION needs to be an option in config.cg + test("mp14-node01", ["mp14/delay.c", "mp14/evtask1.c", "mp14/evtmtask.c", "mp14/exit.c", "mp14/init.c", "mp14/msgtask1.c", "mp14/pttask1.c", "mp14/smtask1.c"], defines=["NODE_NUMBER=1", "MAX_LONG_TEST_DURATION=100"]) + test("mp14-node02", ["mp14/delay.c", "mp14/evtask1.c", "mp14/evtmtask.c", "mp14/exit.c", "mp14/init.c", "mp14/msgtask1.c", "mp14/pttask1.c", "mp14/smtask1.c"], defines=["NODE_NUMBER=1", "MAX_LONG_TEST_DURATION=100"]) diff --git a/testsuites/psxtests/wscript b/testsuites/psxtests/wscript new file mode 100644 index 0000000000..a186ed359b --- /dev/null +++ b/testsuites/psxtests/wscript @@ -0,0 +1,269 @@ +def build(ctx): + srcnode = ctx.srcnode.abspath() + + def test(target, source, **kwarg): + + includes_merge = [] + if "includes" in kwarg: + includes_merge = kwarg["includes"] + del kwarg["includes"] + + ctx.rtems_test( + "sptests_%s" % target, + source, + includes = [ + "%s/testsuites/psxtests/include/" % srcnode, + ] + includes_merge, + features = "test_include src_include_score src_include_bsp src_include_bsp_common", + **kwarg + ) + + + ctx( + target = "test_psxtests_psxhdrs", + source = [ + "psxhdrs/devctl/posix_devctl.c", + "psxhdrs/pthread/pthread_attr_destroy.c", + "psxhdrs/pthread/pthread_attr_getdetachstate.c", + "psxhdrs/pthread/pthread_attr_getguardsize.c", + "psxhdrs/pthread/pthread_attr_getinheritsched.c", + "psxhdrs/pthread/pthread_attr_getschedparam.c", + "psxhdrs/pthread/pthread_attr_getschedpolicy.c", + "psxhdrs/pthread/pthread_attr_getscope.c", + "psxhdrs/pthread/pthread_attr_getstack.c", + "psxhdrs/pthread/pthread_attr_getstackaddr.c", + "psxhdrs/pthread/pthread_attr_getstacksize.c", + "psxhdrs/pthread/pthread_attr_init.c", + "psxhdrs/pthread/pthread_attr_setdetachstate.c", + "psxhdrs/pthread/pthread_attr_setguardsize.c", + "psxhdrs/pthread/pthread_attr_setinheritsched.c", + "psxhdrs/pthread/pthread_attr_setschedparam.c", + "psxhdrs/pthread/pthread_attr_setschedpolicy.c", + "psxhdrs/pthread/pthread_attr_setscope.c", + "psxhdrs/pthread/pthread_attr_setstack.c", + "psxhdrs/pthread/pthread_attr_setstackaddr.c", + "psxhdrs/pthread/pthread_attr_setstacksize.c", + "psxhdrs/pthread/pthread_cancel.c", + "psxhdrs/pthread/pthread_cleanup.c", + "psxhdrs/pthread/pthread_cond_broadcast.c", + "psxhdrs/pthread/pthread_cond_destroy.c", + "psxhdrs/pthread/pthread_cond_init.c", + "psxhdrs/pthread/pthread_cond_signal.c", + "psxhdrs/pthread/pthread_cond_timedwait.c", + "psxhdrs/pthread/pthread_cond_wait.c", + "psxhdrs/pthread/pthread_condattr_destroy.c", + "psxhdrs/pthread/pthread_condattr_getpshared.c", + "psxhdrs/pthread/pthread_condattr_init.c", + "psxhdrs/pthread/pthread_condattr_setpshared.c", + "psxhdrs/pthread/pthread_create.c", + "psxhdrs/pthread/pthread_detach.c", + "psxhdrs/pthread/pthread_equal.c", + "psxhdrs/pthread/pthread_exit.c", + "psxhdrs/pthread/pthread_getconcurrency.c", + "psxhdrs/pthread/pthread_getcpuclockid.c", + "psxhdrs/pthread/pthread_getschedparam.c", + "psxhdrs/pthread/pthread_getspecific.c", + "psxhdrs/pthread/pthread_join.c", + "psxhdrs/pthread/pthread_key_create.c", + "psxhdrs/pthread/pthread_key_delete.c", + "psxhdrs/pthread/pthread_mutex_destroy.c", + "psxhdrs/pthread/pthread_mutex_getprioceiling.c", + "psxhdrs/pthread/pthread_mutex_init.c", + "psxhdrs/pthread/pthread_mutex_lock.c", + "psxhdrs/pthread/pthread_mutex_setprioceiling.c", + "psxhdrs/pthread/pthread_mutex_timedlock.c", + "psxhdrs/pthread/pthread_mutex_trylock.c", + "psxhdrs/pthread/pthread_mutex_unlock.c", + "psxhdrs/pthread/pthread_mutexattr_destroy.c", + "psxhdrs/pthread/pthread_mutexattr_getprioceiling.c", + "psxhdrs/pthread/pthread_mutexattr_getprotocol.c", + "psxhdrs/pthread/pthread_mutexattr_getpshared.c", + "psxhdrs/pthread/pthread_mutexattr_init.c", + "psxhdrs/pthread/pthread_mutexattr_setprioceiling.c", + "psxhdrs/pthread/pthread_once.c", + "psxhdrs/pthread/pthread_mutexattr_setprotocol.c", + "psxhdrs/pthread/pthread_mutexattr_setpshared.c", + "psxhdrs/pthread/pthread_self.c", + "psxhdrs/pthread/pthread_setcancelstate.c", + "psxhdrs/pthread/pthread_setcanceltype.c", + "psxhdrs/pthread/pthread_setconcurrency.c", + "psxhdrs/pthread/pthread_setschedparam.c", + "psxhdrs/pthread/pthread_setspecific.c", + "psxhdrs/pthread/pthread_testcancel.c", + "psxhdrs/sched/sched_get_priority_max.c", + "psxhdrs/sched/sched_get_priority_min.c", + "psxhdrs/sched/sched_getparam.c", + "psxhdrs/sched/sched_getscheduler.c", + "psxhdrs/sched/sched_rr_get_interval.c", + "psxhdrs/sched/sched_setparam.c", + "psxhdrs/sched/sched_setscheduler.c", + "psxhdrs/sched/sched_yield.c", + "psxhdrs/signal/pthread_sigmask.c", + "psxhdrs/signal/raise.c", + "psxhdrs/signal/signal.c", + "psxhdrs/signal/sigpending.c", + "psxhdrs/signal/sigprocmask.c", + "psxhdrs/signal/sigsuspend.c", + "psxhdrs/signal/sigtimedwait.c", + "psxhdrs/signal/sigwait.c", + "psxhdrs/signal/sigwaitinfo.c", + "psxhdrs/sys/mman/mlock.c", + "psxhdrs/sys/mman/mlockall.c", + "psxhdrs/sys/mman/mmap.c", + "psxhdrs/sys/mman/mprotect.c", + "psxhdrs/sys/mman/msync.c", + "psxhdrs/sys/mman/munlock.c", + "psxhdrs/sys/mman/munlockall.c", + "psxhdrs/sys/mman/munmap.c", + "psxhdrs/sys/mman/posix_madvise.c", + "psxhdrs/sys/mman/shm_open.c", + "psxhdrs/sys/mman/shm_unlink.c", + "psxhdrs/sys/socket/accept.c", + "psxhdrs/sys/socket/bind.c", + "psxhdrs/sys/socket/connect.c", + "psxhdrs/sys/socket/getpeername.c", + "psxhdrs/sys/socket/getsockname.c", + "psxhdrs/sys/socket/getsockopt.c", + "psxhdrs/sys/socket/listen.c", + "psxhdrs/sys/socket/recv.c", + "psxhdrs/sys/socket/recvfrom.c", + "psxhdrs/sys/socket/recvmsg.c", + "psxhdrs/sys/socket/send.c", + "psxhdrs/sys/socket/sendmsg.c", + "psxhdrs/sys/socket/sendto.c", + "psxhdrs/sys/socket/setsockopt.c", + "psxhdrs/sys/socket/shutdown.c", + "psxhdrs/sys/socket/socket.c", + "psxhdrs/sys/socket/socketpair.c", + "psxhdrs/time/asctime.c", + "psxhdrs/time/asctime_r.c", + "psxhdrs/time/clock.c", + "psxhdrs/time/clock_getcpuclockid.c", + "psxhdrs/time/clock_getres.c", + "psxhdrs/time/clock_gettime.c", + "psxhdrs/time/clock_nanosleep.c", + "psxhdrs/time/clock_settime.c", + "psxhdrs/time/ctime.c", + "psxhdrs/time/ctime_r.c", + "psxhdrs/time/difftime.c", + "psxhdrs/time/gmtime.c", + "psxhdrs/time/gmtime_r.c", + "psxhdrs/time/localtime.c", + "psxhdrs/time/localtime_r.c", + "psxhdrs/time/mktime.c", + "psxhdrs/time/nanosleep.c", + "psxhdrs/time/strftime.c", + "psxhdrs/time/time.c", + "psxhdrs/time/timer_create.c", + "psxhdrs/time/timer_delete.c", + "psxhdrs/time/timer_getoverrun.c", + "psxhdrs/time/timer_gettime.c", + "psxhdrs/time/timer_settime.c", + "psxhdrs/unistd/alarm.c", + "psxhdrs/unistd/fdatasync.c", + "psxhdrs/unistd/fsync.c", + "psxhdrs/unistd/getegid.c", + "psxhdrs/unistd/geteuid.c", + "psxhdrs/unistd/getgid.c", + "psxhdrs/unistd/getgroups.c", + "psxhdrs/unistd/getlogin.c", + "psxhdrs/unistd/getlogin_r.c", + "psxhdrs/unistd/getpgrp.c", + "psxhdrs/unistd/getpid.c", + "psxhdrs/unistd/getppid.c", + "psxhdrs/unistd/getuid.c", + "psxhdrs/unistd/pause.c", + "psxhdrs/unistd/setgid.c", + "psxhdrs/unistd/setgroups.c", + "psxhdrs/unistd/setpgid.c", + "psxhdrs/unistd/setsid.c", + "psxhdrs/unistd/setuid.c", + "psxhdrs/unistd/sleep.c", + "psxhdrs/unistd/sync.c", + "psxhdrs/unistd/ualarm.c", + "psxhdrs/unistd/usleep.c", + ], + features = "c cstlib bld_include src_include", + ) + + + test("psx01", ["psx01/init.c", "psx01/task.c"]) + test("psx02", ["psx02/init.c", "psx02/task.c"]) + test("psx03", ["psx03/init.c", "psx03/task.c"]) + test("psx04", ["psx04/init.c", "psx04/task1.c", "psx04/task2.c", "psx04/task3.c"]) + test("psx05", ["psx05/init.c", "psx05/task.c", "psx05/task2.c", "psx05/task3.c"]) + test("psx06", ["psx06/init.c", "psx06/task.c", "psx06/task2.c"]) + test("psx07", ["psx07/init.c", "psx07/task.c"]) + test("psx08", ["psx08/init.c", "psx08/task1.c", "psx08/task2.c", "psx08/task3.c"]) + test("psx09", ["psx09/init.c"]) + test("psx10", ["psx10/init.c", "psx10/task.c", "psx10/task2.c", "psx10/task3.c"]) + test("psx11", ["psx11/init.c", "psx11/task.c"]) + test("psx12", ["psx12/init.c"]) + test("psx13", ["psx13/main.c", "psx13/test.c"]) + test("psx14", ["psx14/init.c"]) + test("psx15", ["psx15/init.c"]) + test("psx16", ["psx16/init.c"]) + test("psxaio01", ["psxaio01/init.c"]) + test("psxaio02", ["psxaio02/init.c"]) + test("psxaio03", ["psxaio03/init.c"]) + test("psxalarm01", ["psxalarm01/init.c"]) + test("psxautoinit01", ["psxautoinit01/init.c"]) + test("psxautoinit02", ["psxautoinit02/init.c"]) + test("psxbarrier01", ["psxbarrier01/main.c", "psxbarrier01/test.c"]) +# test("psxcancel", ["psxcancel/init.c"]) _pthread_cleanup_push + test("psxcancel01", ["psxcancel01/init.c"]) + test("psxchroot01", ["psxchroot01/main.c", "psxchroot01/test.c"]) + test("psxclassic01", ["psxclassic01/init.c"]) +# test("psxcleanup", ["psxcleanup/psxcleanup.c"]) _pthread_cleanup_push +# test("psxcleanup01", ["psxcleanup01/init.c"]) _pthread_cleanup_push + test("psxclock", ["psxclock/init.c"]) + test("psxcond01", ["psxcond01/init.c"]) + test("psxeintr_join", ["psxeintr_join/init.c"]) + test("psxenosys", ["psxenosys/init.c"]) +# test("psxfatal01", ["psxfatal_support/init.c"], includes=["%s/testsuites/psxtests/psxfatal01/" % srcnode]) +# test("psxfatal02", ["psxfatal_support/init.c"], includes=["%s/testsuites/psxtests/psxfatal02/" % srcnode]) + test("psxfchx01", ["psxfchx01/init.c"]) + test("psxfile01", ["psxfile01/main.c", "psxfile01/test.c", "psxfile01/test_cat.c", "psxfile01/test_extend.c", "psxfile01/test_write.c"]) + test("psxfile02", ["psxfile02/init.c"]) +#flockfile test("psxfilelock01", ["psxfilelock01/init.c"]) + test("psxgetrusage01", ["psxgetrusage01/init.c"], use="test_support_spin") + test("psxid01", ["psxid01/init.c"]) + test("psximfs01", ["psximfs01/init.c"]) + test("psximfs02", ["psximfs02/init.c"]) + test("psxintrcritical01", ["psxintrcritical01/init.c", "../sptests/spintrcritical_support/intrcritical.c"], includes=["%s/testsuites/sptests/spintrcritical_support/" % srcnode]) #XXX: relative path + test("psxitimer", ["psxitimer/init.c"]) + test("psxkey01", ["psxkey01/init.c"], use="test_support") + test("psxkey02", ["psxkey02/init.c"]) + test("psxkey03", ["psxkey03/init.c"]) + test("psxmount", ["psxmount/main.c", "psxmount/test.c"]) + test("psxmsgq01", ["psxmsgq01/init.c"], use="test_support") + test("psxmsgq02", ["psxmsgq02/init.c"], use="test_support") + test("psxmsgq03", ["psxmsgq03/init.c"]) + test("psxmsgq04", ["psxmsgq04/init.c"], use="test_support") + test("psxmutexattr01", ["psxmutexattr01/init.c"]) + test("psxobj01", ["psxobj01/init.c"], use="test_support") + test("psxpasswd01", ["psxpasswd01/init.c"]) + test("psxpasswd02", ["psxpasswd02/init.c"]) + test("psxpipe01", ["psxpipe01/init.c"]) + test("psxrdwrv", ["psxrdwrv/main.c", "psxrdwrv/test.c"]) + test("psxreaddir", ["psxreaddir/main.c", "psxreaddir/test.c"]) + test("psxrwlock01", ["psxrwlock01/main.c", "psxrwlock01/test.c"]) + test("psxsem01", ["psxsem01/init.c"], use="test_support") + test("psxsignal01", ["psxsignal01/init.c", "psxsignal01/task1.c"]) + test("psxsignal02", ["psxsignal02/init.c"]) + test("psxsignal03", ["psxsignal03/init.c"], defines=["USE_USER_SIGNALS_PROCESS"]) + test("psxsignal04", ["psxsignal03/init.c"], defines=["USE_REAL_TIME_SIGNALS_PROCESS"]) + test("psxsignal05", ["psxsignal05/init.c"]) + test("psxsignal06", ["psxsignal06/init.c"]) + test("psxspin01", ["psxspin01/main.c", "psxspin01/test.c"]) + test("psxstack01", ["psxstack01/init.c"]) + test("psxstack02", ["psxstack02/init.c"]) + test("psxstat", ["psxstat/main.c", "psxstat/test.c"]) + test("psxsysconf", ["psxsysconf/init.c"]) + test("psxtime", ["psxtime/main.c", "psxtime/test.c"]) + test("psxtimer01", ["psxtimer01/psxtimer.c"]) + test("psxtimer02", ["psxtimer02/psxtimer.c"]) + test("psxtimes01", ["psxtimes01/init.c"], use="test_support_spin") + test("psxualarm", ["psxualarm/init.c"]) + test("psxusleep", ["psxusleep/init.c"]) + diff --git a/testsuites/psxtmtests/wscript b/testsuites/psxtmtests/wscript new file mode 100644 index 0000000000..06214e9591 --- /dev/null +++ b/testsuites/psxtmtests/wscript @@ -0,0 +1,52 @@ +def build(ctx): + srcnode = ctx.srcnode.abspath() + + def test(target, source, **kwarg): + + includes_merge = [] + if "includes" in kwarg: + includes_merge = kwarg["includes"] + del kwarg["includes"] + + ctx.rtems_test( + "sptests_%s" % target, + source, + includes = [ + "%s/testsuites/tmtests/include/" % srcnode, + ] + includes_merge, + features = "test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common", + **kwarg + ) + + + test("psxtmbarrier01", ["psxtmbarrier01/init.c"]) + test("psxtmbarrier02", ["psxtmbarrier02/init.c"]) + test("psxtmbarrier03", ["psxtmbarrier03/init.c"]) + test("psxtmkey01", ["psxtmkey01/init.c"]) + test("psxtmkey02", ["psxtmkey02/init.c"]) + test("psxtmmq01", ["psxtmmq01/init.c"]) + test("psxtmmutex01", ["psxtmmutex01/init.c"]) + test("psxtmmutex02", ["psxtmmutex02/init.c"]) + test("psxtmmutex03", ["psxtmmutex03/init.c"]) + test("psxtmmutex04", ["psxtmmutex04/init.c"]) + test("psxtmmutex05", ["psxtmmutex05/init.c"]) + test("psxtmmutex06", ["psxtmmutex06/init.c"]) + test("psxtmmutex07", ["psxtmmutex07/init.c"]) + test("psxtmnanosleep01", ["psxtmnanosleep01/init.c"]) + test("psxtmnanosleep02", ["psxtmnanosleep02/init.c"]) + test("psxtmrwlock01", ["psxtmrwlock01/init.c"]) + test("psxtmrwlock02", ["psxtmrwlock02/init.c"]) + test("psxtmrwlock03", ["psxtmrwlock03/init.c"]) + test("psxtmrwlock04", ["psxtmrwlock04/init.c"]) + test("psxtmrwlock05", ["psxtmrwlock05/init.c"]) + test("psxtmrwlock06", ["psxtmrwlock06/init.c"]) + test("psxtmrwlock07", ["psxtmrwlock07/init.c"]) + test("psxtmsem01", ["psxtmsem01/init.c"]) + test("psxtmsem02", ["psxtmsem02/init.c"]) + test("psxtmsem03", ["psxtmsem03/init.c"]) + test("psxtmsem04", ["psxtmsem04/init.c"]) + test("psxtmsem05", ["psxtmsem05/init.c"]) + test("psxtmsleep01", ["psxtmsleep01/init.c"]) + test("psxtmsleep02", ["psxtmsleep02/init.c"]) + test("psxtmthread01", ["psxtmthread01/init.c"], use="test_support_tmtests test_support_empty_func") + test("psxtmthread03", ["psxtmthread03/init.c"]) diff --git a/testsuites/smptests/wscript b/testsuites/smptests/wscript new file mode 100644 index 0000000000..075d347aa8 --- /dev/null +++ b/testsuites/smptests/wscript @@ -0,0 +1,21 @@ +def build(ctx): + srcnode = ctx.srcnode.abspath() + + def test(target, source): + ctx.rtems_test( + "smptests_%s" % target, + source, + features = "test_include", + use = "test_support_locked_print" + ) + + + test("smp01", ["smp01/init.c", "smp01/tasks.c"]) + test("smp02", ["smp02/init.c", "smp02/tasks.c"]) + test("smp03", ["smp03/init.c", "smp03/tasks.c"]) + test("smp04", ["smp04/init.c"]) + test("smp05", ["smp05/init.c"]) + test("smp06", ["smp06/init.c"]) + test("smp07", ["smp07/init.c"]) + test("smp08", ["smp08/init.c", "smp08/tasks.c"]) + test("smp09", ["smp09/init.c"]) diff --git a/testsuites/sptests/wscript b/testsuites/sptests/wscript new file mode 100644 index 0000000000..d7628bb721 --- /dev/null +++ b/testsuites/sptests/wscript @@ -0,0 +1,194 @@ +def build(ctx): + def test(target, source, **kwarg): + ctx.rtems_test( + "sptests_%s" % target, + source, + features = "test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common", + **kwarg + ) + + test("sp01", ["sp01/init.c", "sp01/task1.c"]) + test("sp02", ["sp02/init.c", "sp02/preempt.c", "sp02/task1.c", "sp02/task2.c", "sp02/task3.c"]) + test("sp03", ["sp03/init.c", "sp03/task1.c", "sp03/task2.c"]) + test("sp04", ["sp04/init.c", "sp04/task1.c", "sp04/task2.c", "sp04/task3.c", "sp04/tswitch.c"]) + test("sp05", ["sp05/init.c", "sp05/task1.c", "sp05/task2.c", "sp05/task3.c"]) + test("sp06", ["sp06/init.c", "sp06/task1.c", "sp06/task2.c", "sp06/task3.c"]) + test("sp07", ["sp07/init.c", "sp07/task1.c", "sp07/task2.c", "sp07/task3.c", "sp07/task4.c", "sp07/taskexit.c", "sp07/tcreate.c", "sp07/tdelete.c", "sp07/trestart.c", "sp07/tstart.c"]) + test("sp08", ["sp08/init.c"]) +# test("sp09", ["sp09/init.c", "sp09/isr.c", "sp09/screen01.c", "sp09/screen02.c", "sp09/screen03.c", "sp09/screen04.c", "sp09/screen05.c", "sp09/screen06.c", "sp09/screen07.c", "sp09/screen08.c", "sp09/screen09.c", "sp09/screen10.c", "sp09/screen11.c", "sp09/screen12.c", "sp09/screen13.c", "sp09/screen14.c", "sp09/task1.c", "sp09/task2.c", "sp09/task3.c", "sp09/task4.c"]) + test("sp11", ["sp11/init.c", "sp11/task1.c", "sp11/task2.c", "sp11/timer.c"]) + test("sp12", ["sp12/init.c", "sp12/pridrv.c", "sp12/pritask.c", "sp12/task1.c", "sp12/task2.c", "sp12/task3.c", "sp12/task4.c", "sp12/task5.c"]) + test("sp13", ["sp13/fillbuff.c", "sp13/init.c", "sp13/putbuff.c", "sp13/task1.c", "sp13/task2.c", "sp13/task3.c"]) + test("sp14", ["sp14/asr.c", "sp14/init.c", "sp14/task1.c", "sp14/task2.c"]) + test("sp15", ["sp15/init.c", "sp15/task1.c"]) + test("sp16", ["sp16/init.c", "sp16/task1.c", "sp16/task2.c", "sp16/task3.c", "sp16/task4.c", "sp16/task5.c"]) + test("sp17", ["sp17/asr.c", "sp17/init.c", "sp17/task1.c", "sp17/task2.c"]) + test("sp18", ["sp18/init.c"]) + test("sp19", ["sp19/first.c", "sp19/fptask.c", "sp19/init.c", "sp19/task1.c"]) + test("sp20", ["sp20/getall.c", "sp20/init.c", "sp20/task1.c"]) + test("sp21", ["sp21/init.c"]) + test("sp22", ["sp22/delay.c", "sp22/init.c", "sp22/prtime.c", "sp22/task1.c"]) + test("sp23", ["sp23/init.c", "sp23/task1.c"]) + test("sp24", ["sp24/init.c", "sp24/resume.c", "sp24/task1.c"]) + test("sp25", ["sp25/init.c", "sp25/task1.c"]) + test("sp26", ["sp26/init.c", "sp26/task1.c"]) + test("sp27", ["sp27/init.c"]) + test("sp27a", ["sp27/init.c"]) + test("sp29", ["sp29/init.c"]) + test("sp30", ["sp30/init.c", "sp30/resume.c", "sp30/task1.c"]) + test("sp31", ["sp31/delay.c", "sp31/init.c", "sp31/prtime.c", "sp31/task1.c"]) + test("sp32", ["sp32/init.c"]) + test("sp33", ["sp33/init.c"]) + test("sp34", ["sp34/changepri.c"]) + test("sp35", ["sp35/priinv.c"]) + test("sp37", ["sp37/init.c"]) + test("sp38", ["sp38/init.c"]) +# test("sp39", ["sp39/init.c"]) + test("sp40", ["sp40/init.c"]) + test("sp41", ["sp41/init.c"]) + test("sp42", ["sp42/init.c"]) + test("sp43", ["sp43/init.c"]) + test("sp44", ["sp44/init.c"]) + test("sp45", ["sp45/init.c"]) + test("sp46", ["sp46/init.c"]) + test("sp47", ["sp47/init.c"]) + test("sp48", ["sp48/init.c"]) + test("sp49", ["sp49/init.c"]) + test("sp50", ["sp50/init.c"]) + test("sp51", ["sp51/init.c"]) + test("sp52", ["sp52/init.c"]) + test("sp53", ["sp52/init.c"], defines=["USE_TIMER_SERVER"]) + test("sp54", ["sp54/init.c"]) + test("sp55", ["sp55/init.c"]) + test("sp56", ["sp56/init.c"]) + test("sp57", ["sp57/init.c"]) + test("sp58", ["sp58/init.c"]) + test("sp59", ["sp59/init.c"]) + test("sp60", ["sp60/init.c"]) + test("sp62", ["sp62/init.c"]) + test("sp63", ["sp63/init.c"]) + test("sp64", ["sp64/init.c"]) + test("sp65", ["sp65/init.c"]) + test("sp66", ["sp65/init.c"]) + test("sp67", ["sp67/init.c"]) + test("sp68", ["sp68/init.c"]) +#support/src/spin.c test("sp69", ["sp69/init.c"]) + test("sp70", ["sp70/init.c"]) + test("sp71", ["sp71/init.c"]) + test("sp72", ["sp72/init.c"]) + test("sp73", ["sp73/init.c"]) + test("sp74", ["sp74/init.c"]) + test("sp75", ["sp75/init.c"]) + test("sp76", ["sp76/init.c"]) + test("spassoc01", ["spassoc01/init.c"]) + test("spchain", ["spchain/init.c"]) + test("spcoverage", ["spcoverage/init.c"]) + test("sperror01", ["sperror01/init.c"]) + test("sperror02", ["sperror02/init.c"]) + test("sperror03", ["sperror03/init.c"]) + +# ctx.objects( +# source = ["spfatal_support/consume_sems.c"], +# name = "test_sptests_spfatal_support", +# includes = "%s/testsuites/support/include" % ctx.srcnode.abspath(), +# features = "bld_include src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" +# ) + + def spfatal(target, source): + ctx.rtems_test( + "sptests_%s" % target, + source, + includes = [ + "%s/testsuites/support/include" % ctx.srcnode.abspath(), + "%s/testsuites/sptests/%s" % (ctx.srcnode.abspath(), target) + ], + features = "src_include_rtems src_include_score src_include_bsp src_include_bsp_common", + use="test_sptests_spfatal_support" + ) + + spfatal("spfatal01", ["spfatal01/init.c"]) + spfatal("spfatal02", ["spfatal02/init.c"]) + spfatal("spfatal03", ["spfatal03/init.c"]) + spfatal("spfatal04", ["spfatal04/init.c"]) + spfatal("spfatal05", ["spfatal05/init.c"]) + spfatal("spfatal06", ["spfatal06/init.c"]) + spfatal("spfatal08", ["spfatal08/init.c"]) + spfatal("spfatal09", ["spfatal09/init.c"]) + spfatal("spfatal10", ["spfatal10/init.c"]) + spfatal("spfatal11", ["spfatal11/init.c"]) + spfatal("spfatal12", ["spfatal12/init.c"]) + spfatal("spfatal14", ["spfatal14/init.c"]) + spfatal("spfatal15", ["spfatal15/init.c"]) + spfatal("spfatal24", ["spfatal24/init.c"]) + spfatal("spfatal25", ["spfatal25/init.c"]) + spfatal("spfatal26", ["spfatal26/init.c"]) + spfatal("spfatal27", ["spfatal27/init.c"]) + spfatal("spfatal28", ["spfatal28/init.c"]) + spfatal("spfatal29", ["spfatal29/init.c"]) + spfatal("spfatal30", ["spfatal30/init.c"]) + spfatal("spfatal31", ["spfatal31/init.c"]) + spfatal("spfatal32", ["spfatal32/init.c"]) + + test("spfifo01", ["spfifo01/init.c"]) + test("spfifo02", ["spfifo02/init.c"]) + test("spfifo03", ["spfifo03/init.c"]) + test("spfifo04", ["spfifo04/init.c"]) + test("spfifo05", ["spfifo05/init.c"]) + test("spheapprot", ["spheapprot/init.c"]) + + + ctx.objects( + source = ["spintrcritical_support/intrcritical.c"], + name = "test_sptests_spintrcritical_support", + includes = [ + "%s/testsuites/support/include" % ctx.srcnode.abspath(), + "%s/testsuites/sptests/spintrcritical_support" % ctx.srcnode.abspath() + ], + features = "bld_include src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + ) + + def spincritical(target, source, **kwargs): + ctx.rtems_test( + "sptests_%s" % target, + source, + includes = [ + "%s/testsuites/sptests/spintrcritical_support" % ctx.srcnode.abspath() + ], + features = "test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common", + use="test_sptests_spintrcritical_support", + **kwargs + ) + + spincritical("spintrcritical01", ["spintrcritical01/init.c"], defines=["FIFO_NO_TIMEOUT"]) + spincritical("spintrcritical02", ["spintrcritical01/init.c"], defines=["FIFO_WITH_TIMEOUT"]) + spincritical("spintrcritical03", ["spintrcritical01/init.c"], defines=["PRIORITY_NO_TIMEOUT"]) + spincritical("spintrcritical04", ["spintrcritical01/init.c"], defines=["PRIORITY_WITH_TIMEOUT"]) + spincritical("spintrcritical05", ["spintrcritical01/init.c"], defines=["PRIORITY_NO_TIMEOUT_REVERSE"]) + spincritical("spintrcritical06", ["spintrcritical06/init.c"], defines=["PRIORITY_NO_TIMEOUT_FORWARD"]) + spincritical("spintrcritical07", ["spintrcritical06/init.c"], defines=["PRIORITY_NO_TIMEOUT_REVERSE"]) + spincritical("spintrcritical08", ["spintrcritical08/init.c"]) + spincritical("spintrcritical09", ["spintrcritical09/init.c"]) + spincritical("spintrcritical10", ["spintrcritical10/init.c"]) + spincritical("spintrcritical11", ["spintrcritical11/init.c"], defines=["EVENT_ANY"]) + spincritical("spintrcritical12", ["spintrcritical11/init.c"], defines=["EVENT_ALL"]) + spincritical("spintrcritical13", ["spintrcritical13/init.c"], defines=["FIRE_AFTER"]) + spincritical("spintrcritical14", ["spintrcritical13/init.c"], defines=["SERVER_FIRE_AFTER"]) + spincritical("spintrcritical15", ["spintrcritical15/init.c"]) + spincritical("spintrcritical16", ["spintrcritical16/init.c"]) + + + test("spmkdir", ["spmkdir/init.c"]) + test("spmountmgr01", ["spmountmgr01/init.c"]) + test("spnsext01", ["spnsext01/init.c"]) + test("spobjgetnext", ["spobjgetnext/init.c"]) + test("spprintk", ["spprintk/init.c"]) + test("spprivenv01", ["spprivenv01/init.c"]) + test("sprbtree01", ["sprbtree01/init.c"]) + test("spsimplesched01", ["spsimplesched01/init.c"]) + test("spsimplesched02", ["spsimplesched02/init.c"]) + test("spsimplesched03", ["spsimplesched03/init.c"]) + test("spsize", ["spsize/getint.c", "spsize/init.c", "spsize/size.c"]) + test("spstkalloc", ["spstkalloc/init.c"]) + test("spthreadq01", ["spthreadq01/init.c"]) + test("spwatchdog", ["spwatchdog/delay.c", "spwatchdog/init.c", "spwatchdog/prtime.c", "spwatchdog/task1.c"]) + test("spwkspace", ["spwkspace/init.c"]) diff --git a/testsuites/tmtests/wscript b/testsuites/tmtests/wscript new file mode 100644 index 0000000000..ee2e11c4ae --- /dev/null +++ b/testsuites/tmtests/wscript @@ -0,0 +1,45 @@ +def build(ctx): + def test(target, source): + ctx.rtems_test( + "tmtests_%s" % target, + source, + use = "test_support_empty_func", + includes = [ + "%s/testsuites/tmtests/include/" % ctx.srcnode.abspath(), + "%s/testsuites/support/include/" % ctx.srcnode.abspath(), + ], + features = "src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + ) + + test("tmck", "tmck/task1.c") + test("tmoverhd", ["tmoverhd/empty.c", "tmoverhd/testtask.c"]) + test("tm01", "tm01/task1.c") +# test("tm02", "tm02/task1.c") +# test("tm03", "tm03/task1.c") + test("tm04", "tm04/task1.c") + test("tm05", "tm05/task1.c") + test("tm06", "tm06/task1.c") + test("tm07", "tm07/task1.c") + test("tm08", "tm08/task1.c") + test("tm09", "tm09/task1.c") + test("tm10", "tm10/task1.c") + test("tm11", "tm11/task1.c") + test("tm12", "tm12/task1.c") + test("tm13", "tm13/task1.c") + test("tm14", "tm14/task1.c") + test("tm15", "tm15/task1.c") + test("tm16", "tm16/task1.c") + test("tm17", "tm17/task1.c") + test("tm18", "tm18/task1.c") + test("tm19", "tm19/task1.c") + test("tm20", "tm20/task1.c") + test("tm21", "tm21/task1.c") + test("tm22", "tm22/task1.c") + test("tm23", "tm23/task1.c") + test("tm24", "tm24/task1.c") + test("tm25", "tm25/task1.c") + test("tm26", "tm26/task1.c") + test("tm27", "tm27/task1.c") + test("tm28", "tm28/task1.c") + test("tm29", "tm29/task1.c") + test("tm30", ["tm30/init.c", "../support/src/tmtests_support.c"]) # XXX: fix this relative path. diff --git a/testsuites/wscript b/testsuites/wscript new file mode 100644 index 0000000000..c3ebff5f15 --- /dev/null +++ b/testsuites/wscript @@ -0,0 +1,54 @@ +def build(ctx): + srcnode = ctx.srcnode.abspath() + + ctx.objects( + source = ["support/src/tmtests_empty_function.c"], + name = "test_support_empty_func", + includes = ["%s/testsuites/support/include/" % srcnode], + features = "bld_include src_include src_include_rtems src_include_score" + ) + + ctx.objects( + source = ["support/src/spin.c"], + name = "test_support_spin", + includes = ["%s/testsuites/support/include/" % srcnode], #XXX: why was this added in ac165341 + features = "bld_include src_include src_include_rtems src_include_score" + ) + + ctx.objects( + source = ["support/src/test_support.c"], + name = "test_support", + features = "bld_include src_include test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + ) + + ctx.objects( + source = ["support/src/tmtests_support.c"], + name = "test_support_tmtests", + includes = ["%s/testsuites/tmtests/include/" % srcnode], + features = "bld_include src_include test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + ) + + if ctx.env.ENABLE_SMP and ctx.env.BSP[0] in ["sparc/leon3", "i386/pc386"]: + ctx.objects( + source = ["support/src/locked_print.c"], + name = "test_support_locked_print", + features = "bld_include src_include test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + ) + + ctx.recurse("fstests") + ctx.recurse("libtests") + + if ctx.env.ENABLE_MP: + ctx.recurse("mptests") + + if ctx.env.ENABLE_POSIX: + ctx.recurse("psxtests") + ctx.recurse("psxtmtests") + + if ctx.env.ENABLE_SMP and ctx.env.BSP[0] in ["sparc/leon3", "i386/pc386"]: + ctx.recurse("smptests") + + ctx.recurse("sptests") + ctx.recurse("tmtests") + +# ctx.recurse("samples") diff --git a/wscript b/wscript new file mode 100644 index 0000000000..e6b4f83c5d --- /dev/null +++ b/wscript @@ -0,0 +1,288 @@ +#! /usr/bin/env python +# encoding: ascii + +# RTEMS version, this is the only editable portion of this file. +config = {} +config["rtems_version_major"] = 5 +config["rtems_version_minor"] = 0 +config["rtems_version_revision"] = 0 +config["rtems_version_patch"] = 0 + +config["rtems_tool_version"] = "5" + +# --------- DO NOT EDIT BELOW THIS LINE ----------- +from sys import argv +from waflib import Task, Scripting, Configure, Utils +from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext, StepContext, ListContext +from waflib import Context, Errors +from waflib.Tools import c_preproc +from waflib.Logs import pprint +from py.waf.builder import libcpu, libbsp +from py.waf.switch import options +from py.waf.tools import get_file_mtime +from os.path import exists +from waflib.Tools import waf_unit_test +from py.waf.test import test_write_log, test_print_log + +# RTEMS Version for waf +VERSION='%d.%d' % (config["rtems_version_major"], config["rtems_version_minor"]) +if config["rtems_version_revision"]: + VERSION = "%s.%d" % (VERSION, config["rtems_version_revision"]) + if config["rtems_version_patch"]: # There can't be a patch version without a revision. + VERSION = "%s.%d" % (VERSION, config["rtems_version_patch"]) + +APPNAME='rtems' +class Dist(Scripting.Dist): + algo = 'tar.bz2' # tar.gz, tar.bz2, tar.xz or zip + def get_excl(self): + # do not ship config.cfg in the archive + return Scripting.Dist.get_excl(self) + ' config.cfg' + + +pprint.__doc__ = None # Make sure waf doesn't see this as a command. + +Configure.autoconfig = 'clobber' # Apply the original configure command-line arguments +Context.Context.repeat_hack = False + +top = '.' +out = 'build' +c_preproc.go_absolute = False # Disable dependencies on system headers. +config["variants"] = [] + +if exists("%s/build/c4che/host_cache.py" % top): + from waflib.ConfigSet import ConfigSet + cset = ConfigSet() + cset.load("build/c4che/host_cache.py") + config["variants"] = cset.BSP + +# Init commands manually to iterate over the variants. +def init_handler(ctx): + cmd = ctx.cmd + if cmd == 'init_handler': + cmd = 'build' + + def make_context(name): + for x in Context.classes: + if x.cmd == name and x.fun != 'init_handler': + return x() + ctx.fatal('No class for %r' % cmd) + + if ctx.options.build_bsp: + if ctx.options.build_bsp not in config["variants"]: + ctx.fatal("BSP not in configured list: %s" % ctx.options.build_bsp) + config["variants"] = [ctx.options.build_bsp] + + + # By default we want to iterate over each variant. + for v in ["host"] + config["variants"]: + obj = make_context(cmd) + obj.variant = v + pprint("YELLOW", "--- %sing %s ---" % (cmd, v)) + obj.execute() + +# Add target-specific commands. +variant_cmd = ( + ("build", BuildContext), + ("clean", CleanContext), + ("install", InstallContext), + ("step", StepContext), + ("list", ListContext), + ("check", BuildContext) +) + +# save the usable build context class +class BuildContextTest(BuildContext): + cmd = '_build-bak' +host = 1 +for variant in ["host"] + config["variants"]: + if host: + v = "host" + host = 0 + else: + v = variant.split("/")[1] + # the reason for creating these subclasses is just for __doc__ below... + for cmd, cls in variant_cmd: + class tmp(cls): + __doc__ = "%s %s BSP" % (cmd, v) + cmd = "%s_%s" % (cmd, v) + variant = variant + +def get_targets(self): + # targets in host and bsp variants differ, do not raise an exception + to_post = [] + min_grp = 0 + for name in self.targets.split(','): + try: + tg = self.get_tgen_by_name(name) + except Errors.WafError: + continue + m = self.get_group_idx(tg) + if m > min_grp: + min_grp = m + to_post = [tg] + elif m == min_grp: + to_post.append(tg) + return (min_grp, to_post) +BuildContext.get_targets = get_targets + +# These will stay local functions to avoid importing the subcommands +# upon every invocation which will happen during regular development. +def cmd_config(ctx): + from py.waf.tools import rtems_cmd_config + rtems_cmd_config(ctx) + +def cmd_docs(ctx): + from py.waf.docs import rtems_cmd_docs + rtems_cmd_docs(ctx) + +def cmd_bsp(ctx): + from py.waf.tools import rtems_cmd_bsp + rtems_cmd_bsp(ctx) + +def cmd_hello(ctx): + from py.waf.hello import rtems_cmd_hello + rtems_cmd_hello(ctx) + +def cmd_info(ctx): + from py.waf.info import rtems_cmd_info + rtems_cmd_info(ctx) + +# List of commands to override / add +commands = ( + ("install", "init_handler", None), + ("uninstall", "init_handler", None), + ("build", "init_handler", None), + ("clean", "init_handler", None), + ("list", "init_handler", None), + ("step", "init_handler", None), + ("config", "cmd_config", "create config.cfg"), + ("docs", "cmd_docs", "build option documentation."), + ("bsp", "cmd_bsp", "BSP information."), + ("hello", "cmd_hello", "Test command: Build hello.c."), + ("info", "cmd_info", "Show build information / configuration.") +) + +for command, func, descr in commands: + class tmp(Context.Context): + if descr: + __doc__ = descr + cmd = command + fun = func + if command in 'install uninstall build clean list step docs bsp info': + execute = Scripting.autoconfigure(Context.Context.execute) + + +def buildlog(ctx): + pass +buildlog.__doc__ = "Available only when -dev-json and --dev-config are used." + + +# Check sanity of default.cfg +def checkconfig(ctx): + from py.waf.tools import rtems_check_config + rtems_check_config(ctx) +checkconfig.__doc__ = None # Make sure waf doesn't see this as a command. + + +def configure(ctx): + ctx.run_build_cls = '_build-bak' + from py.waf.configure import cmd_configure + node = ctx.path.find_node('config.cfg') + if not node: + ctx.fatal('Run "waf config" first, for example: waf config --bsp sparc/sis --path-tools ~/development/rtems/4.11/bin') + # hash the config.cfg file too so that changes in the configure() function will trigger + # a re-configuration with the original command-line + ctx.files.append(node.abspath()) + ctx.hash = Utils.h_list((ctx.hash, node.read('rb'))) + # using the standard ctx.recurse() would add the dependency automatically + node = ctx.path.find_node('py/waf/configure.py') + ctx.files.append(node.abspath()) + ctx.hash = Utils.h_list((ctx.hash, node.read('rb'))) + cmd_configure(ctx, config) + +#class check(BuildContext): +# cmd = 'check' + +def build(ctx): + ctx.load('waf_unit_test') + + if ctx.env.ENABLE_SYSTEM_DEP: + c_preproc.go_absolute=True + + ctx.load('waf', tooldir='py/waf/') + + from py.waf.waf import rtems_stlib_command + class cstlib(Task.classes['cstlib']): + exec_command = rtems_stlib_command + + # Dump build log in JSON. + if ctx.cmd == "build" \ + and ctx.env.BUILD_JSON \ + and not ctx.repeat_hack: + + from py.waf.debug import logger_json_create, exec_command_json, exec_command_json_extra + ctx.repeat_hack = True + + # Make sure any previous handlers are closed so logs are written. + if hasattr(ctx, "logger_json"): + ctx.logger_json.handlers[0].close() + + ctx.logger_json = logger_json_create(ctx) + ctx.exec_command = exec_command_json + + # Send extra information from the parent task. + cls_task = Task.classes["Task"] + + # Avoid recursion since this can be run twice due to host building. + if not hasattr(cls_task, "exec_command_real"): + cls_task.exec_command_real = cls_task.exec_command + cls_task.exec_command = exec_command_json_extra + + + # Host is only meant for building host utilities. + if ctx.variant == "host": +# ctx.recurse("tools/build") + ctx.recurse("c") + + # Reset things back so a new log is created for the BSP. + if ctx.cmd == "build" and ctx.env.BUILD_JSON: + ctx.repeat_hack = False + return + + # Everything will break if you remove these lines below. + ctx.cpu = libcpu(ctx) + ctx.bsp = libbsp(ctx) + + ctx.recurse("cpukit") + ctx.recurse("cpukit/score") + ctx.recurse("cpukit/rtems") + ctx.recurse("cpukit/posix") + ctx.recurse("cpukit/libcsupport") + ctx.recurse("cpukit/libfs") + ctx.recurse("cpukit/libnetworking") + ctx.recurse("cpukit/librpc") + ctx.recurse("cpukit/libmisc") + ctx.recurse("cpukit/zlib") + + # XXX: This needs to loop over each BSP. + ctx.recurse("bsps") + + if ctx.env.ENABLE_TESTS or "--enable-tests" in argv: # or ctx.env.BIN_RTEMS_RUN: + pprint("YELLOW", "--- building %s tests ---" % ctx.env.BSP[0]) + ctx.recurse("testsuites") + + + # Force re-running of tests. Same as 'waf --alltests' + if ctx.cmd == "check_%s" % ctx.env.RTEMS_BSP : + ctx.options.all_tests = True + + # Print log if -v is supplied + if ctx.options.verbose: + ctx.add_post_fun(test_print_log) + + # Write test log to a file + ctx.add_post_fun(test_write_log) + + # Print a summary at the end + ctx.add_post_fun(waf_unit_test.summary) + -- cgit v1.2.3