[PATCH rtems-lwip] wscript: Build a header instead of using -D
Kinsey Moore
kinsey.moore at oarcorp.com
Mon Mar 27 15:28:45 UTC 2023
This change moves the use of items configured in config.ini from using
-D to set defines on the command line to using a header built by waf.
This also resolves an issue where configuration parameters were bleeding
between BSPs when multiple BSPs were configured.
---
rtemslwip/beaglebone/lwipopts.h | 2 ++
rtemslwip/zynqmp/lwipopts.h | 2 ++
wscript | 19 ++++++++++++++++---
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/rtemslwip/beaglebone/lwipopts.h b/rtemslwip/beaglebone/lwipopts.h
index 888fae4..71ddd9f 100644
--- a/rtemslwip/beaglebone/lwipopts.h
+++ b/rtemslwip/beaglebone/lwipopts.h
@@ -117,6 +117,8 @@
#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__
+#include <configuredlwipbspopts.h>
+
/*****************************************************************************
** CONFIGURATIONS
*****************************************************************************/
diff --git a/rtemslwip/zynqmp/lwipopts.h b/rtemslwip/zynqmp/lwipopts.h
index feabe73..d1b7334 100644
--- a/rtemslwip/zynqmp/lwipopts.h
+++ b/rtemslwip/zynqmp/lwipopts.h
@@ -27,6 +27,8 @@
#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__
+#include <configuredlwipbspopts.h>
+
#define SYS_LIGHTWEIGHT_PROT 1
#define NO_SYS 0
diff --git a/wscript b/wscript
index f1b919e..5e30279 100644
--- a/wscript
+++ b/wscript
@@ -91,15 +91,23 @@ def get_configured_bsp_options(cp, arch, bsp):
return options
+bsp_opts_target = "bsps/include/configuredlwipbspopts.h"
+
+
def bsp_configure(conf, arch_bsp):
cp = get_config()
arch = rtems.arch(arch_bsp)
bsp = rtems.bsp(arch_bsp)
config_options = get_configured_bsp_options(cp, arch, bsp)
for key, val in config_options.items():
- flag = "-D"+key+"="+val
- conf.env.CFLAGS.append(flag)
- conf.env.CXXFLAGS.append(flag)
+ conf.define(key, val, quote=False)
+ conf.env.include_key = []
+ conf.write_config_header(
+ arch_bsp + "/" + bsp_opts_target,
+ guard="CONFIGURED_LWIP_BSP_OPTS_H",
+ top=True
+ )
+ conf.env.include_key = None
lwip.bsp_configure(conf, arch_bsp)
@@ -112,4 +120,9 @@ def configure(conf):
def build(bld):
rtems.build(bld)
+ arch_bsp = bld.env.RTEMS_ARCH_BSP
+ arch = rtems._arch_from_arch_bsp(arch_bsp)
+ bsp = rtems.bsp(arch_bsp)
+ install_target = os.path.join(bld.env.PREFIX, arch, bsp, "lib", "include")
+ bld.install_files(install_target, bsp_opts_target)
lwip.build(bld)
--
2.30.2
More information about the devel
mailing list