summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2023-04-13 18:28:47 -1000
committerChris Johns <chrisj@rtems.org>2023-04-14 15:57:50 +1000
commitbef50b9ff76d3f6231e3c92bb35d47ee5bc7f0cb (patch)
treebd4abb767f8512bd551e42f584e5c1e9b13036ff
parentbsd: Add iface calls to help users manage the iface state (diff)
downloadrtems-net-legacy-bef50b9ff76d3f6231e3c92bb35d47ee5bc7f0cb.tar.bz2
waf: Generate a version header called rtems-net-legacy.h
-rwxr-xr-xinclude/rtems/rtems-net-legacy.h.in42
-rw-r--r--netlegacy.py35
m---------rtems_waf0
3 files changed, 74 insertions, 3 deletions
diff --git a/include/rtems/rtems-net-legacy.h.in b/include/rtems/rtems-net-legacy.h.in
new file mode 100755
index 0000000..a17ec21
--- /dev/null
+++ b/include/rtems/rtems-net-legacy.h.in
@@ -0,0 +1,42 @@
+/**
+ * @file
+ *
+ * @ingroup rtems_net_legacy
+ *
+ * @brief This file is generated
+ */
+
+/*
+ * Copyright (c) 2023. Chris Johns <chrisj@rtems.org>. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _RTEMS_NET_LGEACY_H_
+#define _RTEMS_NET_LEGACY_H_
+
+#define RTEMS_NET_LEGACY_VERSION @RTEMS_NET_LEGACY_VERSION@
+
+#define RTEMS_NET_LEGACY_MAJOR @RTEMS_NET_LEGACY_MAJOR@
+#define RTEMS_NET_LEGACY_REVISION @RTEMS_NET_LEGACY_REVISION@
+
+#endif /* _RTEMS_NET_LGEACY_H_ */
diff --git a/netlegacy.py b/netlegacy.py
index 60775dc..9f27ffc 100644
--- a/netlegacy.py
+++ b/netlegacy.py
@@ -29,12 +29,31 @@
import os
import os.path
+from rtems_waf import git
from rtems_waf import rtems
+from rtems_waf import version
import bsp_drivers
import netsources
+def version_header(bld):
+ versions = {
+ 'RTEMS_NET_LEGACY_VERSION':
+ '"' + bld.env.RTEMS_NET_LEGACY_VERSION + '"',
+ 'RTEMS_NET_LEGACY_MAJOR': bld.env.RTEMS_NET_LEGACY_MAJOR,
+ 'RTEMS_NET_LEGACY_REVISION':
+ '"' + bld.env.RTEMS_NET_LEGACY_REVISION + '"',
+ }
+ sed = 'sed '
+ for cfg in versions:
+ sed += "-e 's/@%s@/%s/' " % (cfg, versions[cfg])
+ bld(target='include/rtems/rtems-net-legacy.h',
+ source='include/rtems/rtems-net-legacy.h.in',
+ rule=sed + ' < ${SRC} > ${TGT}',
+ update_outputs=True)
+
+
def net_config_header(bld):
if not os.path.exists(bld.env.NET_CONFIG):
bld.fatal('network configuraiton \'%s\' not found' %
@@ -88,7 +107,14 @@ def options(opt):
def bsp_configure(conf, arch_bsp, mandatory=True):
- ab = rtems.arch(arch_bsp) + '/' + rtems.bsp(arch_bsp)
+ conf.start_msg('Checking version')
+ version.load_rtems_version_header(conf, conf.env.RTEMS_VERSION, arch_bsp,
+ conf.env.IFLAGS)
+ conf.env.RTEMS_NET_LEGACY_VERSION = version.string(conf)
+ conf.env.RTEMS_NET_LEGACY_MAJOR = version.version(conf)
+ conf.env.RTEMS_NET_LEGACY_REVISION = version.revision(conf)
+ conf.end_msg(conf.env.RTEMS_NET_LEGACY_VERSION)
+ ab = rtems.arch_bsp_name(arch_bsp)
includes = [
'.',
'include',
@@ -125,9 +151,9 @@ def bsp_configure(conf, arch_bsp, mandatory=True):
def build(bld):
- arch_bsp = bld.env.RTEMS_ARCH_BSP
- ab = rtems.arch(arch_bsp) + '/' + rtems.bsp(arch_bsp)
+ ab = rtems.arch_bsp_name(bld.env.RTEMS_ARCH_BSP)
+ version_header(bld)
net_config_header(bld)
if ab in bsp_drivers.source:
@@ -173,3 +199,6 @@ def build(bld):
bld.install_as(
os.path.join(bld.env.PREFIX, arch_inc_path, inc_dir, hname),
header)
+ bld.install_as(
+ os.path.join(bld.env.PREFIX, arch_inc_path, 'rtems',
+ 'rtems-net-legacy.h'), 'include/rtems/rtems-net-legacy.h')
diff --git a/rtems_waf b/rtems_waf
-Subproject 1a118bbcd52138dbdc3236e64bc23fd430a064b
+Subproject 2c15b90de5c369aa78cd2252a50bba677e9b13f