Index: waf_generator.py
===================================================================
--- waf_generator.py	(revision e9aa9537891a390044d1f283ef190165cfdd16e7)
+++ waf_generator.py	(revision 49637856b7fd1fae37566aabd92536a37f80b0f0)
@@ -212,4 +212,6 @@
         self.add('#')
         self.add('')
+        self.add('import os.path')
+        self.add('')
         self.add('try:')
         self.add('    import rtems_waf.rtems as rtems')
@@ -234,4 +236,8 @@
         self.add('                   dest = "warnings",')
         self.add('                   help = "Enable all warnings. The default is quiet builds.")')
+        self.add('    opt.add_option("--net-test-config",')
+        self.add('                   default = "config.inc",')
+        self.add('                   dest = "net_config",')
+        self.add('                   help = "Network test configuration.")')
         self.add('')
         self.add('def configure(conf):')
@@ -242,4 +248,5 @@
         self.add('    conf.env.AUTO_REGEN = conf.options.auto_regen')
         self.add('    conf.env.WARNINGS = conf.options.warnings')
+        self.add('    conf.env.NET_CONFIG = conf.options.net_config')
         self.add('    rtems.configure(conf)')
         self.add('    if rtems.check_networking(conf):')
@@ -279,4 +286,48 @@
 
         #
+        # Support the existing Makefile based network configuration file.
+        #
+        self.add('    # Network test configuration')
+        self.add('    if not os.path.exists(bld.env.NET_CONFIG):')
+        self.add('        bld.fatal("network configuraiton \'%s\' not found" % (bld.env.NET_CONFIG))')
+        self.add('    net_cfg_self_ip = None')
+        self.add('    net_cfg_netmask = None')
+        self.add('    net_cfg_peer_ip = None')
+        self.add('    net_cfg_gateway_ip = None')
+        self.add('    net_tap_interface = None')
+        self.add('    try:')
+        self.add('        net_cfg_lines = open(bld.env.NET_CONFIG).readlines()')
+        self.add('    except:')
+        self.add('        bld.fatal("network configuraiton \'%s\' read failed" % (bld.env.NET_CONFIG))')
+        self.add('    lc = 0')
+        self.add('    for l in net_cfg_lines:')
+        self.add('        lc += 1')
+        self.add('        if l.strip().startswith("NET_CFG_"):')
+        self.add('            ls = l.split("=")')
+        self.add('            if len(ls) != 2:')
+        self.add('                bld.fatal("network configuraiton \'%s\' parse error: %d: %s" % ' + \
+                 '(bld.env.NET_CONFIG, lc, l))')
+        self.add('            lhs = ls[0].strip()')
+        self.add('            rhs = ls[1].strip()')
+        self.add('            if lhs == "NET_CFG_SELF_IP":')
+        self.add('                net_cfg_self_ip = rhs')
+        self.add('            if lhs == "NET_CFG_NETMASK":')
+        self.add('                net_cfg_netmask = rhs')
+        self.add('            if lhs == "NET_CFG_PEER_IP":')
+        self.add('                net_cfg_peer_ip = rhs')
+        self.add('            if lhs == "NET_CFG_GATEWAY_IP_IP":')
+        self.add('                net_cfg_gateway_ip = rhs')
+        self.add('            if lhs == "NET_TAP_INTERFACE_IP_IP":')
+        self.add('                net_tap_interface = rhs')
+        self.add('    bld(target = "testsuite/include/rtems/bsd/test/network-config.h",')
+        self.add('        source = "testsuite/include/rtems/bsd/test/network-config.h.in",')
+        self.add('        rule = "sed -e \'s/@NET_CFG_SELF_IP@/%s/\' ' + \
+                 '-e \'s/@NET_CFG_NETMASK@/%s/\' ' + \
+                 '-e \'s/@NET_CFG_PEER_IP@/%s/\' ' + \
+                 '-e \'s/@NET_CFG_GATEWAY_IP@/%s/\' < ${SRC} > ${TGT}" % ' + \
+                 '(net_cfg_self_ip, net_cfg_netmask, net_cfg_peer_ip, net_cfg_netmask))')
+        self.add('')
+
+        #
         # Add the specific rule based builders for generating files.
         #
@@ -284,12 +335,11 @@
             kvmsymbols = data['KVMSymbols']
             self.add('    # KVM Symbols')
-            self.add('    if bld.env.AUTO_REGEN:')
-            self.add('        bld(target = "%s",' % (kvmsymbols['files']['all'][0]))
-            self.add('            source = "rtemsbsd/rtems/generate_kvm_symbols",')
-            self.add('            rule = "./${SRC} > ${TGT}")')
+            self.add('    bld(target = "%s",' % (kvmsymbols['files']['all'][0]))
+            self.add('        source = "rtemsbsd/rtems/generate_kvm_symbols",')
+            self.add('        rule = "./${SRC} > ${TGT}")')
             self.add('    bld.objects(target = "kvmsymbols",')
             self.add('                features = "c",')
             self.add('                cflags = cflags,')
-            self.add('                includes = includes,')
+            self.add('                includes = includes + ["rtemsbsd/rtems"],')
             self.add('                source = "%s")' % (kvmsymbols['files']['all'][0]))
             self.add('    libbsd_use += ["kvmsymbols"]')
