summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2022-11-23 12:29:29 -0600
committerKinsey Moore <kinsey.moore@oarcorp.com>2022-11-23 12:29:29 -0600
commit6ebe11f4cd4e4fca61b324f17738eab2e4e8c40b (patch)
tree426de183f057a2aca9ab1e22cdf9f1abfb473f96
parentMigrate telnet test from rtems-lwip (diff)
downloadrtems-net-services-6ebe11f4cd4e4fca61b324f17738eab2e4e8c40b.tar.bz2
wscript: Allow selection of BSPs via config.ini
-rw-r--r--README7
-rw-r--r--wscript41
2 files changed, 47 insertions, 1 deletions
diff --git a/README b/README
index 057abd1..6ea9285 100644
--- a/README
+++ b/README
@@ -30,3 +30,10 @@ git submodule update
More `waf` arguments can be found by using:
`./waf --help`
+
+Further Build Information
+-------------------------
+
+The BSPs configured to build may be specified on the waf configure command line
+with --rtems-bsps or they may be configured in config.ini as in RTEMS. The
+command line option will override the BSPs configured in config.ini.
diff --git a/wscript b/wscript
index e8cec5b..b0c701d 100644
--- a/wscript
+++ b/wscript
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
#
# RTEMS Project (https://www.rtems.org/)
#
@@ -27,6 +29,11 @@
from __future__ import print_function
+try:
+ import configparser
+except:
+ import ConfigParser as configparser
+
import netservices
import sys
top = '.'
@@ -47,8 +54,40 @@ def options(opt):
rtems.options(opt)
+def no_unicode(value):
+ if sys.version_info[0] > 2:
+ return value
+ if isinstance(value, unicode):
+ return str(value)
+ return value
+
+
+def get_config():
+ cp = configparser.ConfigParser()
+ filename = "config.ini"
+ if filename not in cp.read([filename]):
+ return None
+ return cp
+
+
+def get_configured_bsps(cp):
+ if not cp:
+ return "all"
+ bsps = []
+ for raw_bsp in cp.sections():
+ bsps.append(no_unicode(raw_bsp))
+ return ",".join(bsps)
+
+
+def bsp_configure(conf, arch_bsp):
+ netservices.bsp_configure(conf, arch_bsp)
+
+
def configure(conf):
- rtems.configure(conf, netservices.bsp_configure)
+ cp = get_config()
+ if conf.options.rtems_bsps == "all":
+ conf.options.rtems_bsps = get_configured_bsps(cp)
+ rtems.configure(conf, bsp_configure)
def build(bld):