[RTEMS-NET-LEGACY PATCH] waf: List all source built and installed

chrisj at rtems.org chrisj at rtems.org
Mon Mar 27 05:44:55 UTC 2023


From: Chris Johns <chrisj at rtems.org>

- Remove scanning the file system for files to build and install.

- Install list checked against an RTEMS 5.3 networking build.

Closes #4887
---
 bsp_drivers.py                  | 244 +++++++++++++++++++-----
 netlegacy.py                    | 148 +++++---------
 netsources.py                   | 328 ++++++++++++++++++++++++++++++++
 testsuites/ftp01/wscript        |  18 +-
 testsuites/loopback/wscript     |   9 +-
 testsuites/networking01/wscript |   9 +-
 testsuites/pppd/wscript         |  13 +-
 testsuites/syscall01/wscript    |   9 +-
 testsuites/telnetd01/wscript    |  17 +-
 testsuites/wscript              |   6 +-
 wscript                         |   4 +-
 11 files changed, 615 insertions(+), 190 deletions(-)
 create mode 100644 netsources.py

diff --git a/bsp_drivers.py b/bsp_drivers.py
index 7d07d3d..e2250aa 100644
--- a/bsp_drivers.py
+++ b/bsp_drivers.py
@@ -26,51 +26,201 @@
 #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-from rtems_waf import rtems
-import os
-import waflib.Options
-import waflib.ConfigSet
+include = {
+    'arm/csb336': [
+        'bsps/arm/csb336/net',
+    ],
+    'arm/csb337': [
+        'bsps/arm/csb337/net',
+    ],
+    'arm/edb7312': [
+        'bsps/arm/edb7312/net',
+    ],
+    'arm/gumstix': [
+        'bsps/arm/gumstix/net',
+    ],
+    'arm/rtl22xx': [
+        'bsps/arm/rtl22xx/net',
+    ],
+    'bfin/bf537Stamp': [
+        'bsps/bfin/bf537Stamp/net',
+    ],
+    'i386/pc386': [
+        'bsps/i386/pc386/net',
+    ],
+    'lm32/lm32_evr': [
+        'bsps/lm32/include',
+        'bsps/lm32/shared/net',
+    ],
+    'm68k/av5282': [
+        'bsps/m68k/av5282/net',
+    ],
+    'm68k/csb360': [
+        'bsps/m68k/csb360/net',
+    ],
+    'm68k/mcf5235': [
+        'bsps/m68k/mcf5235/net',
+    ],
+    'm68k/mcf5329': [
+        'bsps/m68k/mcf5329/net',
+    ],
+    'm68k/mvme167': [
+        'bsps/m68k/mvme167/net',
+    ],
+    'm68k/uC5282': [
+        'bsps/m68k/uC5282/net',
+    ],
+    'mips/csb350': [
+        'bsps/mips/csb350/net',
+    ],
+    'powerpc/beatnik': [
+        'bsps/powerpc/beatnik/include',
+        'bsps/powerpc/beatnik/include/bsp',
+        'bsps/powerpc/beatnik/net',
+        'bsps/powerpc/beatnik/net/if_em',
+        'bsps/powerpc/beatnik/net/if_gfe',
+        'bsps/powerpc/beatnik/net/porting',
+    ],
+    'powerpc/mpc8260ads': [
+        'bsps/powerpc/mpc8260ads/net',
+    ],
+    'powerpc/mvme3100': [
+        'bsps/powerpc/mvme3100/net',
+    ],
+    'powerpc/mvme5500': [
+        'bsps/powerpc/mvme5500/net',
+    ],
+    'powerpc/psim': [
+        'bsps/powerpc/psim/net',
+    ],
+    'powerpc/virtex': [
+        'bsps/powerpc/virtex/net',
+    ],
+    'riscv/griscv': [
+        'bsps/riscv/griscv/net',
+    ],
+    'sparc/erc32': [
+        'bsps/sparc/erc32/net',
+    ],
+    'sparc/leon2': [
+        'bsps/sparc/leon2/net',
+    ],
+    'sparc/leon3': [
+        'bsps/sparc/leon3/net',
+    ],
+}
 
-
-def bsp_files(bld):
-    source_files = {}
-    include_dirs = {}
-    include_files = []
-
-    special_case_dirs = {'atsamv': os.path.expanduser('bsps/arm/atsam'),
-                         'lm32_evr': os.path.expanduser('bsps/lm32'),
-                         'lpc24xx_ea': os.path.expanduser('bsps/arm/shared/')}
-    special_case_sources = {'leon2':
-                            [os.path.expanduser('bsps/shared/grlib/net/network_interface_add.c'),
-                             os.path.expanduser('bsps/shared/grlib/net/greth.c')],
-                            'leon3':
-                            [os.path.expanduser('bsps/shared/grlib/net/network_interface_add.c'),
-                             os.path.expanduser('bsps/shared/grlib/net/greth.c')],
-                            'griscv':
-                            [os.path.expanduser('bsps/shared/grlib/net/network_interface_add.c'),
-                             os.path.expanduser('bsps/shared/grlib/net/greth.c')]}
-
-    bsp_list = bld.env.RTEMS_ARCH_BSP_LIST
-
-    for bl in bsp_list:
-        bsp = bl.split('-')[-1]
-        arch = bl.split('-')[0]
-        include_dirs[bsp] = []
-        source_files[bsp] = []
-        if bsp not in special_case_dirs:
-            source_dir = os.walk(os.path.join('bsps', arch, bsp))
-        else:
-            source_dir = os.walk(special_case_dirs[bsp])
-        for root, dirs, files in source_dir:
-            for name in files:
-                ext = os.path.splitext(name)[1]
-                if ext == '.c':
-                    source_files[bsp].append(os.path.join(root, name))
-                if ext == '.h':
-                    if root not in include_dirs[bsp]:
-                        include_dirs[bsp].append(root)
-            if bsp in special_case_sources:
-                source_files[bsp].extend(special_case_sources[bsp])
-        include_dirs[bsp].append(os.path.join('bsps', arch, bsp, 'net'))
-        include_dirs[bsp].append(os.path.join('bsps', arch, bsp, 'include'))
-    return (include_dirs, source_files)
+source = {
+    'arm/atsamv': [
+        'bsps/arm/atsam/if_atsam.c',
+    ],
+    'arm/csb336': [
+        'bsps/arm/csb336/net/lan91c11x.c',
+        'bsps/arm/csb336/net/network.c',
+    ],
+    'arm/csb337': [
+        'bsps/arm/csb337/net/network.c',
+    ],
+    'arm/edb7312': [
+        'bsps/arm/edb7312/net/network.c',
+    ],
+    'arm/gumstix': [
+        'bsps/arm/gumstix/net/rtl8019.c',
+    ],
+    'arm/lpc24xx_ea': [
+        'bsps/arm/shared/lpc-ethernet.c',
+    ],
+    'arm/rtl22xx': [
+        'bsps/arm/rtl22xx/net/network.c',
+    ],
+    'bfin/bf537Stamp': [
+        'bsps/bfin/bf537Stamp/net/ethernet.c',
+        'bsps/bfin/bf537Stamp/net/networkconfig.c',
+    ],
+    'i386/pc386': [
+        'bsps/i386/pc386/net/3c509.c',
+        'bsps/i386/pc386/net/elink.c',
+        'bsps/i386/pc386/net/ne2000.c',
+        'bsps/i386/pc386/net/wd8003.c',
+    ],
+    'lm32/lm32_evr': [
+        'bsps/lm32/shared/net/network.c',
+        'bsps/lm32/shared/net/tsmac.c',
+    ],
+    'm68k/av5282': [
+        'bsps/m68k/av5282/net/network.c',
+    ],
+    'm68k/csb360': [
+        'bsps/m68k/csb360/net/network.c',
+    ],
+    'm68k/mcf5235': [
+        'bsps/m68k/mcf5235/net/network.c',
+    ],
+    'm68k/mcf5329': [
+        'bsps/m68k/mcf5329/net/network.c',
+    ],
+    'm68k/mvme167': [
+        'bsps/m68k/mvme167/net/network.c',
+    ],
+    'm68k/uC5282': [
+        'bsps/m68k/uC5282/net/network.c',
+    ],
+    'mips/csb350': [
+        'bsps/mips/csb350/net/network.c',
+    ],
+    'powerpc/beatnik': [
+        'bsps/powerpc/beatnik/net/if_em/if_em.c',
+        'bsps/powerpc/beatnik/net/if_em/if_em_hw.c',
+        'bsps/powerpc/beatnik/net/if_em/if_em_rtems.c',
+        'bsps/powerpc/beatnik/net/if_gfe/if_gfe.c',
+        'bsps/powerpc/beatnik/net/if_gfe/if_gfe_rtems.c',
+        'bsps/powerpc/beatnik/net/porting/if_xxx_rtems.c',
+        'bsps/powerpc/beatnik/net/support/bsp_attach.c',
+        'bsps/powerpc/beatnik/net/support/early_link_status.c',
+    ],
+    'powerpc/mpc8260ads': [
+        'bsps/powerpc/mpc8260ads/net/if_hdlcsubr.c',
+        'bsps/powerpc/mpc8260ads/net/network.c',
+    ],
+    'powerpc/mvme3100': [
+        'bsps/powerpc/mvme3100/net/tsec.c',
+    ],
+    'powerpc/mvme5500': [
+        'bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c',
+        'bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c',
+        'bsps/powerpc/mvme5500/net/if_1GHz/pci_map.c',
+    ],
+    'powerpc/psim': [
+        'bsps/powerpc/psim/net/if_sim.c',
+    ],
+    'powerpc/virtex': [
+        'bsps/powerpc/virtex/net/xiltemac.c',
+    ],
+    'riscv/griscv': [
+        'bsps/riscv/griscv/net/griscv_greth.c',
+        'bsps/shared/grlib/net/greth.c',
+        'bsps/shared/grlib/net/greth.c',
+        'bsps/shared/grlib/net/network_interface_add.c',
+        'bsps/shared/grlib/net/network_interface_add.c',
+    ],
+    'sparc/erc32': [
+        'bsps/sparc/erc32/net/erc32sonic.c',
+    ],
+    'sparc/leon2': [
+        'bsps/shared/grlib/net/greth.c',
+        'bsps/shared/grlib/net/greth.c',
+        'bsps/shared/grlib/net/network_interface_add.c',
+        'bsps/shared/grlib/net/network_interface_add.c',
+        'bsps/sparc/leon2/net/leon_open_eth.c',
+        'bsps/sparc/leon2/net/leon_smc91111.c',
+    ],
+    'sparc/leon3': [
+        'bsps/shared/grlib/net/greth.c',
+        'bsps/shared/grlib/net/greth.c',
+        'bsps/shared/grlib/net/network_interface_add.c',
+        'bsps/shared/grlib/net/network_interface_add.c',
+        'bsps/sparc/leon3/net/leon_greth.c',
+        'bsps/sparc/leon3/net/leon_open_eth.c',
+        'bsps/sparc/leon3/net/leon_smc91111.c',
+    ],
+}
diff --git a/netlegacy.py b/netlegacy.py
index b08ccad..8445a26 100644
--- a/netlegacy.py
+++ b/netlegacy.py
@@ -26,39 +26,13 @@
 #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-from rtems_waf import rtems
-import bsp_drivers
 import os
+import os.path
 
-source_files = []
-include_files = {}
-exclude_dirs = [
-    'pppd', 'nfsclient', 'testsuites',
-    os.path.join('librpc', 'include'), 'bsps'
-]
-exclude_headers = ['rtems-bsd-user-space.h', 'rtems-bsd-kernel-space.h']
-
-for root, dirs, files in os.walk("."):
-    [dirs.remove(d) for d in list(dirs) if d in exclude_dirs]
-    dirs.append(os.path.join('bsps', 'shared', 'net'))
-    include_files[root[2:]] = []
-    for name in files:
-        ext = os.path.splitext(name)[1]
-        if ext == '.c':
-            source_files.append(os.path.join(root, name))
-        if ext == '.h' and name not in exclude_headers:
-            include_files[root[2:]].append(os.path.join(root, name))
-
-
-def find_node(bld, *paths):
-    path = os.path.join(*paths)
-    return os.path.relpath(str(bld.path.find_node(path)))
-
+from rtems_waf import rtems
 
-def install_file_list(*paths):
-    path = os.path.join(*paths)
-    file_list = [os.path.join(path, f) for f in os.listdir(path)]
-    return file_list
+import bsp_drivers
+import netsources
 
 
 def options(opt):
@@ -66,91 +40,65 @@ def options(opt):
 
 
 def bsp_configure(conf, arch_bsp, mandatory=True):
-    pass
-
-
-def build(bld):
-    include_path = []
-    ip = ''
-    bsp = bld.env.RTEMS_ARCH_BSP.split('-')[-1]
-    pppd_source = [
-        os.path.join('pppd', s) for s in os.listdir('pppd')
-        if os.path.splitext(s)[1] == '.c'
+    ab = rtems.arch(arch_bsp) + '/' + rtems.bsp(arch_bsp)
+    includes = [
+        '.',
+        'include',
+        'bsps/include',
+        'testsuites/include',
     ]
-    nfs_source = []
-    for root, dirs, files in os.walk('nfsclient'):
-        for name in files:
-            ext = os.path.splitext(name)[1]
-            if ext == '.c':
-                src_root = os.path.split(root)
-                nfs_source.append(os.path.join(src_root[0], src_root[1], name))
-
-    bsp_dirs, bsp_sources = bsp_drivers.bsp_files(bld)
-
-    include_path.extend([
-        '.', 'include',
-        os.path.relpath(bld.env.PREFIX),
-        os.path.join('testsuites', 'include'),
-        os.path.relpath(os.path.join(bld.env.PREFIX, 'include')),
-        os.path.join('bsps', 'include')
-    ])
-    arch_lib_path = rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION,
-                                            bld.env.RTEMS_ARCH_BSP)
-    lib_path = os.path.join(bld.env.PREFIX, arch_lib_path)
-    include_path.append(
-        os.path.relpath(os.path.join(bld.env.PREFIX, arch_lib_path)))
-    include_path.append(
-        os.path.relpath(os.path.join(bld.env.PREFIX, arch_lib_path,
-                                     'include')))
-    include_path.append(find_node(bld, 'bsps', 'include', 'libchip'))
-
-    bld.read_stlib('rtemsbsp', paths=[lib_path])
+    if ab in bsp_drivers.include:
+        includes += bsp_drivers.include[ab]
+    conf.env.IFLAGS = [str(conf.path.find_node(i))
+                       for i in includes] + conf.env.IFLAGS
+    conf.env.OPTIMIZATION = ['-O2']
 
-    if bsp in bsp_dirs:
-        include_path.extend(bsp_dirs[bsp])
 
-    for i in include_path:
-        ip = ip + i + ' '
+def build(bld):
+    arch_bsp = bld.env.RTEMS_ARCH_BSP
+    ab = rtems.arch(arch_bsp) + '/' + rtems.bsp(arch_bsp)
 
-    if (bsp in bsp_sources):
-        bld(target='bsp_objs',
+    if ab in bsp_drivers.source:
+        print(bsp_drivers.source[ab])
+        bld(target='bspobjs',
             features='c',
-            cflags=['-O2', '-g'],
-            includes=ip,
-            source=bsp_sources[bsp])
+            cflags=bld.env.OPTIMIZATION + ['-g'],
+            includes=bld.env.IFLAGS,
+            source=bsp_drivers.source[ab])
 
-    bld(target='network_objects',
+    bld(target='netobjs',
         features='c',
-        includes=ip,
+        cflags=bld.env.OPTIMIZATION + ['-g'],
+        includes=bld.env.IFLAGS,
         defines=['IN_HISTORICAL_NETS=1'],
-        source=source_files)
+        source=netsources.source.network)
 
-    bld(target='networking',
-        features='c cstlib',
-        use=['bsp_objs', 'network_objects'])
+    bld(target='networking', features='c cstlib', use=['bspobjs', 'netobjs'])
 
     bld.stlib(target='pppd',
               features='c',
-              includes=ip,
-              use='networking',
-              source=pppd_source)
+              cflags=bld.env.OPTIMIZATION + ['-g'],
+              includes=bld.env.IFLAGS,
+              use=['networking'],
+              source=netsources.source.pppd)
 
     bld.stlib(target='nfs',
               features='c',
-              includes=ip,
-              use=['rtemsbsp', 'networking'],
-              source=nfs_source)
+              cflags=bld.env.OPTIMIZATION + ['-g'],
+              includes=bld.env.IFLAGS,
+              use=['networking'],
+              source=netsources.source.nfsclient)
+
+    arch_lib_path = rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION,
+                                            bld.env.RTEMS_ARCH_BSP)
+    arch_inc_path = rtems.arch_bsp_include_path(bld.env.RTEMS_VERSION,
+                                                bld.env.RTEMS_ARCH_BSP)
 
     bld.install_files(os.path.join(bld.env.PREFIX, arch_lib_path),
                       ["libnetworking.a", 'libpppd.a', 'libnfs.a'])
-    bld.install_files(
-        os.path.join(bld.env.PREFIX, arch_lib_path, 'include', 'libchip'),
-        install_file_list('bsps', 'include', 'libchip'))
-    for i in include_files:
-        if 'include' in os.path.split(i):
-            bld.install_files(os.path.join(bld.env.PREFIX, arch_lib_path, i),
-                              include_files[i])
-        else:
-            bld.install_files(
-                os.path.join(bld.env.PREFIX, arch_lib_path, 'include', i),
-                include_files[i])
+    for inc_dir in netsources.header:
+        for header in netsources.header[inc_dir]:
+            hname = os.path.basename(header)
+            bld.install_as(
+                os.path.join(bld.env.PREFIX, arch_inc_path, inc_dir, hname),
+                header)
diff --git a/netsources.py b/netsources.py
new file mode 100644
index 0000000..be9334d
--- /dev/null
+++ b/netsources.py
@@ -0,0 +1,328 @@
+#
+# RTEMS Project (https://www.rtems.org/)
+#
+# Copyright (c) 2023 Chris Johns <chrisj at 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 COPYRIGHT HOLDERS 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 COPYRIGHT
+#  OWNER 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.
+
+
+class source:
+    network = [
+        # rtems
+        '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.c',
+        'rtems/rtems_syscall_api.c',
+        'rtems/sghostname.c',
+        # kernel
+        'kern/kern_mib.c',
+        'kern/kern_subr.c',
+        'kern/kern_sysctl.c',
+        'kern/uipc_domain.c',
+        'kern/uipc_mbuf.c',
+        'kern/uipc_socket.c',
+        'kern/uipc_socket2.c',
+        # bsps
+        'bsps/shared/net/cs8900.c',
+        'bsps/shared/net/dec21140.c',
+        'bsps/shared/net/elnk.c',
+        'bsps/shared/net/greth2.c',
+        'bsps/shared/net/i82586.c',
+        'bsps/shared/net/if_dc.c',
+        'bsps/shared/net/if_fxp.c',
+        'bsps/shared/net/open_eth.c',
+        'bsps/shared/net/smc91111.c',
+        'bsps/shared/net/sonic.c',
+        # net
+        'net/if.c',
+        'net/if_ethersubr.c',
+        'net/if_loop.c',
+        'net/if_ppp.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',
+        # netinet
+        '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',
+        # nfs
+        'nfs/bootp_subr.c',
+        # rpc
+        'librpc/src/rpc/auth_none.c',
+        'librpc/src/rpc/auth_unix.c',
+        'librpc/src/rpc/authunix_prot.c',
+        'librpc/src/rpc/bindresvport.c',
+        'librpc/src/rpc/clnt_generic.c',
+        'librpc/src/rpc/clnt_perror.c',
+        'librpc/src/rpc/clnt_raw.c',
+        'librpc/src/rpc/clnt_simple.c',
+        'librpc/src/rpc/clnt_tcp.c',
+        'librpc/src/rpc/clnt_udp.c',
+        'librpc/src/rpc/get_myaddress.c',
+        'librpc/src/rpc/getrpcent.c',
+        'librpc/src/rpc/getrpcport.c',
+        'librpc/src/rpc/netname.c',
+        'librpc/src/rpc/netnamer.c',
+        'librpc/src/rpc/pmap_clnt.c',
+        'librpc/src/rpc/pmap_getmaps.c',
+        'librpc/src/rpc/pmap_getport.c',
+        'librpc/src/rpc/pmap_prot.c',
+        'librpc/src/rpc/pmap_prot2.c',
+        'librpc/src/rpc/pmap_rmt.c',
+        'librpc/src/rpc/rpc_callmsg.c',
+        'librpc/src/rpc/rpc_commondata.c',
+        'librpc/src/rpc/rpc_dtablesize.c',
+        'librpc/src/rpc/rpc_prot.c',
+        'librpc/src/rpc/rpcdname.c',
+        'librpc/src/rpc/rtems_portmapper.c',
+        'librpc/src/rpc/rtems_rpc.c',
+        'librpc/src/rpc/rtime.c',
+        'librpc/src/rpc/svc.c',
+        'librpc/src/rpc/svc_auth.c',
+        'librpc/src/rpc/svc_auth_unix.c',
+        'librpc/src/rpc/svc_raw.c',
+        'librpc/src/rpc/svc_run.c',
+        'librpc/src/rpc/svc_simple.c',
+        'librpc/src/rpc/svc_tcp.c',
+        'librpc/src/rpc/svc_udp.c',
+        'librpc/src/xdr/xdr.c',
+        'librpc/src/xdr/xdr_array.c',
+        'librpc/src/xdr/xdr_float.c',
+        'librpc/src/xdr/xdr_mem.c',
+        'librpc/src/xdr/xdr_rec.c',
+        'librpc/src/xdr/xdr_reference.c',
+        'librpc/src/xdr/xdr_sizeof.c',
+        'librpc/src/xdr/xdr_stdio.c',
+        # misc
+        'libmisc/dummy-networking.c',
+        'libmisc/err.c',
+        'libmisc/main_ifconfig.c',
+        'libmisc/main_netstats.c',
+        'libmisc/main_ping.c',
+        'libmisc/main_route.c',
+        'libmisc/mon-network.c',
+        # lib
+        'lib/getprotoby.c',
+        'lib/rtems_bsdnet_ntp.c',
+        'lib/syslog.c',
+        # libc
+        '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/ns_name.c',
+        'libc/ns_netint.c',
+        'libc/ns_parse.c',
+        'libc/ns_print.c',
+        'libc/ns_ttl.c',
+        'libc/nsap_addr.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',
+        # libtest
+        'libtest/testbeginend.c',
+        'libtest/testbusy.c',
+        'libtest/testextension.c',
+        'libtest/testparallel.c',
+        'libtest/testrun.c',
+        'libtest/testwrappers.c',
+    ]
+
+    nfsclient = [
+        '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',
+    ]
+
+    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',
+    ]
+
+
+header = {
+    '.': ['ifaddrs.h', 'librtemsNfs.h', 'loop.h', 'resolv.h'],
+    'arpa': ['arpa/nameser.h', 'arpa/nameser_compat.h'],
+    'dev/mii': ['dev/mii/mii.h'],
+    'libchip': [
+        'bsps/include/libchip/cs8900.h',
+        'bsps/include/libchip/greth.h',
+        'bsps/include/libchip/i82586var.h',
+        'bsps/include/libchip/if_dcreg.h',
+        'bsps/include/libchip/if_fxpvar.h',
+        'bsps/include/libchip/open_eth.h',
+        'bsps/include/libchip/smc91111.h',
+        'bsps/include/libchip/smc91111exp.h',
+        'bsps/include/libchip/sonic.h',
+    ],
+    'machine': [
+        'machine/_align.h', 'machine/_kernel_if.h', 'machine/_kernel_lock.h',
+        'machine/_kernel_socket.h', 'machine/cpu.h', 'machine/cpufunc.h',
+        'machine/in_cksum.h', 'machine/limits.h', 'machine/vmparam.h'
+    ],
+    'net': [
+        'net/bpf.h', 'net/ethernet.h', 'net/if_arp.h', 'net/if_dl.h',
+        'net/if_llc.h', 'net/if_media.h', 'net/if_ppp.h', 'net/if_pppvar.h',
+        'net/if_types.h', 'net/if_var.h', 'net/netisr.h', 'net/ppp_comp.h',
+        'net/ppp_defs.h', 'net/radix.h', 'net/raw_cb.h', 'net/route.h',
+        'net/slcompress.h'
+    ],
+    'netinet': [
+        'netinet/icmp_var.h', 'netinet/if_ether.h', 'netinet/igmp.h',
+        'netinet/igmp_var.h', 'netinet/in_pcb.h', 'netinet/in_systm.h',
+        'netinet/in_var.h', 'netinet/ip.h', 'netinet/ip_fw.h',
+        'netinet/ip_icmp.h', 'netinet/ip_mroute.h', 'netinet/ip_var.h',
+        'netinet/tcp_debug.h', 'netinet/tcp_fsm.h', 'netinet/tcp_seq.h',
+        'netinet/tcp_timer.h', 'netinet/tcp_var.h', 'netinet/tcpip.h',
+        'netinet/udp.h', 'netinet/udp_var.h'
+    ],
+    'nfs': ['nfs/nfsproto.h', 'nfs/rpcv2.h', 'nfs/xdr_subs.h'],
+    'nfsclient': [
+        'nfsclient/nfsargs.h',
+        'nfsclient/nfsdiskless.h',
+    ],
+    'rpc': [
+        'rpc/auth.h', 'rpc/auth_unix.h', 'rpc/clnt.h', 'rpc/clnt_soc.h',
+        'rpc/clnt_stat.h', 'rpc/pmap_clnt.h', 'rpc/pmap_prot.h',
+        'rpc/pmap_rmt.h', 'rpc/rpc.h', 'rpc/rpc_com.h', 'rpc/rpc_msg.h',
+        'rpc/rpcent.h', 'rpc/svc.h', 'rpc/svc_auth.h', 'rpc/svc_soc.h',
+        'rpc/types.h', 'rpc/xdr.h'
+    ],
+    'rtems': [
+        'include/rtems/rtemspppd.h', 'rtems/bootp.h', 'rtems/dhcp.h',
+        'rtems/mkrootfs.h', 'rtems/rtems_bsdnet.h',
+        'rtems/rtems_bsdnet_internal.h', 'rtems/rtems_dhcp_failsafe.h',
+        'rtems/rtems_mii_ioctl.h', 'rtems/rtems_netdb.h',
+        'rtems/rtems_netinet_in.h', 'rtems/rtems_syscall.h'
+    ],
+    'rtems/bsdnet': ['rtems/bsdnet/_types.h', 'rtems/bsdnet/servers.h'],
+    'sys': [
+        'sys/callout.h', 'sys/conf.h', 'sys/domain.h', 'sys/kernel.h',
+        'sys/libkern.h', 'sys/linker_set.h', 'sys/malloc.h', 'sys/mbuf.h',
+        'sys/mount.h', 'sys/proc.h', 'sys/protosw.h', 'sys/reboot.h',
+        'sys/resourcevar.h', 'sys/selinfo.h', 'sys/signalvar.h',
+        'sys/socketvar.h', 'sys/sysctl.h', 'sys/systm.h', 'sys/ucred.h'
+    ],
+    'vm': ['vm/vm.h', 'vm/vm_extern.h', 'vm/vm_kern.h', 'vm/vm_param.h'],
+}
diff --git a/testsuites/ftp01/wscript b/testsuites/ftp01/wscript
index 200138e..550b0b5 100644
--- a/testsuites/ftp01/wscript
+++ b/testsuites/ftp01/wscript
@@ -27,7 +27,6 @@
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 from rtems_waf import rtems
-import os
 
 
 def init(ctx):
@@ -39,15 +38,12 @@ def configure(conf):
 
 
 def build(bld):
-    arch_lib_path = rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION,
-                                            bld.env.RTEMS_ARCH_BSP)
-    lib_path = os.path.join(bld.env.PREFIX, arch_lib_path)
-    bld.read_stlib('ftpfs', paths=[lib_path])
-    bld.read_stlib('ftpd', paths=[lib_path])
-
+    source = ['init.c']
     bld.program(target='ftp01.exe',
                 features='c cprogram',
-                cflags=['-O2', '-g'],
-                includes='. .. ../include ../../',
-                use=['ftpfs', 'ftpd', 'networking'],
-                source='init.c')
+                cflags=bld.env.OPTIMIZATION + ['-g'],
+                includes=bld.env.IFLAGS,
+                lib=['ftpfs', 'ftpd', 'networking'],
+                libpath=['.'],
+                source=source,
+                install_path=False)
diff --git a/testsuites/loopback/wscript b/testsuites/loopback/wscript
index 8ba0443..bc7bd9a 100644
--- a/testsuites/loopback/wscript
+++ b/testsuites/loopback/wscript
@@ -27,7 +27,6 @@
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 from rtems_waf import rtems
-import os
 
 
 def init(ctx):
@@ -39,9 +38,11 @@ def configure(conf):
 
 
 def build(bld):
+    source = ['init.c']
     bld.program(target='loopback.exe',
                 features='c cprogram',
-                cflags=['-O2', '-g'],
-                includes='. .. ../include ../../',
+                cflags=bld.env.OPTIMIZATION + ['-g'],
+                includes=bld.env.IFLAGS,
                 use=['networking'],
-                source='init.c')
+                source=source,
+                install_path=False)
diff --git a/testsuites/networking01/wscript b/testsuites/networking01/wscript
index f91a5f8..d9917ff 100644
--- a/testsuites/networking01/wscript
+++ b/testsuites/networking01/wscript
@@ -27,7 +27,6 @@
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 from rtems_waf import rtems
-import os
 
 
 def init(ctx):
@@ -39,9 +38,11 @@ def configure(conf):
 
 
 def build(bld):
+    source = ['init.c']
     bld.program(target='networking01.exe',
                 features='c cprogram',
-                cflags=['-O2', '-g'],
-                includes='. .. ../include ../../',
+                cflags=bld.env.OPTIMIZATION + ['-g'],
+                includes=bld.env.IFLAGS,
                 use=['networking'],
-                source='init.c')
+                source=source,
+                install_path=False)
diff --git a/testsuites/pppd/wscript b/testsuites/pppd/wscript
index cd57444..a99cf5e 100644
--- a/testsuites/pppd/wscript
+++ b/testsuites/pppd/wscript
@@ -27,7 +27,6 @@
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 from rtems_waf import rtems
-import os
 
 
 def init(ctx):
@@ -39,10 +38,12 @@ def configure(conf):
 
 
 def build(bld):
+    source = ['init.c', 'pppdapp.c']
     bld(target='pppd.exe',
         features='c cprogram',
-        cflags=['-O2', '-g'],
-        includes='. .. ../../include ../include ../../',
-        use=['pppd', 'networking'],
-        libpath=['.', '../../build'],
-        source=['init.c', 'pppdapp.c'])
+        cflags=bld.env.OPTIMIZATION + ['-g'],
+        includes=bld.env.IFLAGS,
+        lib=['pppd', 'networking'],
+        libpath=['.'],
+        source=source,
+        install_path=False)
diff --git a/testsuites/syscall01/wscript b/testsuites/syscall01/wscript
index 5ad2e19..c8fd30b 100644
--- a/testsuites/syscall01/wscript
+++ b/testsuites/syscall01/wscript
@@ -27,7 +27,6 @@
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 from rtems_waf import rtems
-import os
 
 
 def init(ctx):
@@ -39,9 +38,11 @@ def configure(conf):
 
 
 def build(bld):
+    source = ['init.c']
     bld.program(target='syscall01.exe',
                 features='c cprogram',
-                cflags=['-O2', '-g'],
-                includes='. .. ../include ../../',
+                cflags=bld.env.OPTIMIZATION + ['-g'],
+                includes=bld.env.IFLAGS,
                 use=['networking'],
-                source='init.c')
+                source=source,
+                install_path=False)
diff --git a/testsuites/telnetd01/wscript b/testsuites/telnetd01/wscript
index f24f2ad..fe8a447 100644
--- a/testsuites/telnetd01/wscript
+++ b/testsuites/telnetd01/wscript
@@ -27,7 +27,6 @@
 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 from rtems_waf import rtems
-import os
 
 
 def init(ctx):
@@ -39,14 +38,12 @@ def configure(conf):
 
 
 def build(bld):
-    arch_lib_path = rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION,
-                                            bld.env.RTEMS_ARCH_BSP)
-    lib_path = os.path.join(bld.env.PREFIX, arch_lib_path)
-    bld.read_stlib('telnetd', paths=[lib_path])
-
+    source = ['init.c']
     bld.program(target='telnetd01.exe',
                 features='c cprogram',
-                cflags=['-O2', '-g'],
-                includes='. .. ../include ../../ ../../include',
-                use=['telnetd', 'networking'],
-                source='init.c')
+                cflags=bld.env.OPTIMIZATION + ['-g'],
+                includes=bld.env.IFLAGS,
+                lib=['telnetd', 'networking'],
+                libpath=['.'],
+                source=source,
+                install_path=False)
diff --git a/testsuites/wscript b/testsuites/wscript
index 5145e92..040c5c6 100644
--- a/testsuites/wscript
+++ b/testsuites/wscript
@@ -28,9 +28,9 @@
 
 from rtems_waf import rtems
 
-subdirs = ['ftp01', 'loopback',
-           'networking01', 'pppd',
-           'syscall01', 'telnetd01']
+subdirs = [
+    'ftp01', 'loopback', 'networking01', 'pppd', 'syscall01', 'telnetd01'
+]
 
 
 def recurse(ctx):
diff --git a/wscript b/wscript
index 5492b51..b146db6 100644
--- a/wscript
+++ b/wscript
@@ -31,6 +31,7 @@ from rtems_waf import rtems
 
 import netlegacy
 import sys
+
 top = '.'
 
 rtems_version = "6"
@@ -71,6 +72,7 @@ def recurse(ctx):
 
 
 def build(bld):
-    netlegacy.build(bld)
     rtems.build(bld)
+    netlegacy.build(bld)
+    bld.add_group()
     recurse(bld)
-- 
2.37.1



More information about the devel mailing list