[PATCH 1/2] bsps: Move network define to source files

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jan 29 14:39:16 UTC 2018


Define __INSIDE_RTEMS_BSD_TCPIP_STACK__ in the network interface driver
source files to avoid some build system magic.
---
 bsps/powerpc/motorola_powerpc/include/bsp.h        |  5 +++
 c/src/lib/libbsp/arm/csb336/Makefile.am            | 11 ++----
 c/src/lib/libbsp/arm/csb336/network/lan91c11x.c    |  3 ++
 c/src/lib/libbsp/arm/csb336/network/network.c      |  3 ++
 c/src/lib/libbsp/arm/csb337/Makefile.am            |  9 +----
 c/src/lib/libbsp/arm/csb337/network/network.c      |  2 ++
 c/src/lib/libbsp/arm/edb7312/Makefile.am           | 12 +------
 c/src/lib/libbsp/arm/edb7312/network/network.c     |  2 ++
 c/src/lib/libbsp/arm/gumstix/Makefile.am           | 13 +------
 c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c     |  2 ++
 c/src/lib/libbsp/arm/lpc24xx/Makefile.am           | 10 +-----
 c/src/lib/libbsp/arm/lpc32xx/Makefile.am           | 10 +-----
 c/src/lib/libbsp/arm/raspberrypi/Makefile.am       | 21 +----------
 c/src/lib/libbsp/arm/rtl22xx/Makefile.am           | 11 +-----
 c/src/lib/libbsp/arm/rtl22xx/network/network.c     |  3 ++
 .../libbsp/arm/shared/lpc/network/lpc-ethernet.c   |  3 +-
 c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am       |  7 +---
 .../libbsp/bfin/bf537Stamp/network/networkconfig.c |  2 +-
 c/src/lib/libbsp/i386/pc386/3c509/3c509.c          |  2 ++
 c/src/lib/libbsp/i386/pc386/3c509/elink.c          |  2 ++
 c/src/lib/libbsp/i386/pc386/Makefile.am            | 42 ++++------------------
 c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c        |  2 ++
 c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c        |  2 ++
 c/src/lib/libbsp/lm32/lm32_evr/Makefile.am         |  6 +---
 c/src/lib/libbsp/lm32/milkymist/Makefile.am        |  6 +---
 .../lm32/shared/milkymist_networking/network.c     |  1 +
 c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c         |  1 +
 c/src/lib/libbsp/m68k/av5282/Makefile.am           |  9 +----
 c/src/lib/libbsp/m68k/av5282/network/network.c     |  2 ++
 c/src/lib/libbsp/m68k/csb360/network/network.c     |  3 ++
 c/src/lib/libbsp/m68k/gen68360/Makefile.am         |  9 +----
 c/src/lib/libbsp/m68k/gen68360/network/network.c   |  3 ++
 c/src/lib/libbsp/m68k/genmcf548x/Makefile.am       | 11 +-----
 c/src/lib/libbsp/m68k/genmcf548x/network/network.c |  2 ++
 c/src/lib/libbsp/m68k/mcf5235/Makefile.am          | 10 +-----
 c/src/lib/libbsp/m68k/mcf5235/network/network.c    |  2 ++
 c/src/lib/libbsp/m68k/mcf5329/Makefile.am          | 11 +-----
 c/src/lib/libbsp/m68k/mcf5329/network/network.c    |  2 ++
 c/src/lib/libbsp/m68k/mvme162/Makefile.am          |  9 +----
 c/src/lib/libbsp/m68k/mvme167/Makefile.am          |  9 +----
 c/src/lib/libbsp/m68k/mvme167/network/network.c    |  1 +
 c/src/lib/libbsp/m68k/uC5282/Makefile.am           |  9 +----
 c/src/lib/libbsp/m68k/uC5282/network/network.c     |  2 ++
 c/src/lib/libbsp/mips/csb350/Makefile.am           | 10 +-----
 c/src/lib/libbsp/mips/csb350/network/network.c     |  2 ++
 c/src/lib/libbsp/powerpc/gen83xx/Makefile.am       | 12 ++-----
 c/src/lib/libbsp/powerpc/gen83xx/network/network.c |  1 +
 c/src/lib/libbsp/powerpc/haleakala/Makefile.am     | 10 +-----
 .../lib/libbsp/powerpc/haleakala/network/network.c |  2 ++
 .../libbsp/powerpc/motorola_powerpc/Makefile.am    | 13 +------
 c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am    | 11 ++----
 .../powerpc/mpc8260ads/network/if_hdlcsubr.c       |  2 ++
 .../libbsp/powerpc/mpc8260ads/network/network.c    |  3 ++
 c/src/lib/libbsp/powerpc/mvme3100/network/tsec.c   |  2 ++
 c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am        | 11 ++----
 .../libbsp/powerpc/tqm8xx/network/network_fec.c    |  3 ++
 .../libbsp/powerpc/tqm8xx/network/network_scc.c    |  3 ++
 c/src/lib/libbsp/powerpc/virtex/Makefile.am        | 11 +-----
 c/src/lib/libbsp/powerpc/virtex/network/xiltemac.c |  8 +----
 c/src/lib/libbsp/sparc/erc32/Makefile.am           |  9 +----
 .../lib/libbsp/sparc/erc32/erc32sonic/erc32sonic.c |  2 ++
 c/src/lib/libbsp/sparc/leon2/Makefile.am           | 32 ++---------------
 .../sparc/leon2/leon_open_eth/leon_open_eth.c      |  2 ++
 .../sparc/leon2/leon_smc91111/leon_smc91111.c      |  2 ++
 c/src/lib/libbsp/sparc/leon3/Makefile.am           | 36 +++----------------
 .../lib/libbsp/sparc/leon3/leon_greth/leon_greth.c |  1 +
 .../sparc/leon3/leon_open_eth/leon_open_eth.c      |  1 +
 .../sparc/leon3/leon_smc91111/leon_smc91111.c      |  2 ++
 c/src/lib/libbsp/sparc/shared/net/greth.c          |  3 ++
 c/src/lib/libcpu/bfin/Makefile.am                  |  3 +-
 c/src/lib/libcpu/bfin/network/ethernet.c           |  2 ++
 c/src/lib/libcpu/powerpc/Makefile.am               |  2 --
 c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c    |  2 ++
 c/src/libchip/Makefile.am                          |  2 --
 c/src/libchip/network/cs8900.c                     |  2 ++
 c/src/libchip/network/dec21140.c                   |  2 ++
 c/src/libchip/network/elnk.c                       |  2 ++
 c/src/libchip/network/greth.c                      |  2 ++
 c/src/libchip/network/i82586.c                     |  2 ++
 c/src/libchip/network/if_dc.c                      |  2 ++
 c/src/libchip/network/if_fxp.c                     |  2 ++
 c/src/libchip/network/open_eth.c                   |  2 ++
 c/src/libchip/network/smc91111.c                   |  2 ++
 c/src/libchip/network/sonic.c                      |  2 ++
 84 files changed, 150 insertions(+), 362 deletions(-)

diff --git a/bsps/powerpc/motorola_powerpc/include/bsp.h b/bsps/powerpc/motorola_powerpc/include/bsp.h
index 675796becf..f641b4885b 100644
--- a/bsps/powerpc/motorola_powerpc/include/bsp.h
+++ b/bsps/powerpc/motorola_powerpc/include/bsp.h
@@ -140,6 +140,11 @@ extern int rtems_dec21140_driver_attach();
 #define RTEMS_BSP_NETWORK_DRIVER_NAME "ne1"
 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_ne_driver_attach
 extern int rtems_ne_driver_attach();
+
+RTEMS_INLINE_ROUTINE const char* bsp_cmdline_arg(const char* arg)
+{
+  return rtems_bsp_cmdline_get_param_raw(arg);
+}
 #endif
 
 #ifdef qemu
diff --git a/c/src/lib/libbsp/arm/csb336/Makefile.am b/c/src/lib/libbsp/arm/csb336/Makefile.am
index 0dc5c54fa0..9ec214921c 100644
--- a/c/src/lib/libbsp/arm/csb336/Makefile.am
+++ b/c/src/lib/libbsp/arm/csb336/Makefile.am
@@ -51,18 +51,11 @@ libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
 libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c network/lan91c11x.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/lan91c11x.c
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/arm920.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
-
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/arm/csb336/headers.am
diff --git a/c/src/lib/libbsp/arm/csb336/network/lan91c11x.c b/c/src/lib/libbsp/arm/csb336/network/lan91c11x.c
index d11f6515bb..37594776d1 100644
--- a/c/src/lib/libbsp/arm/csb336/network/lan91c11x.c
+++ b/c/src/lib/libbsp/arm/csb336/network/lan91c11x.c
@@ -16,6 +16,9 @@
  *  found in the file LICENSE in this distribution or at
  *  http://www.rtems.org/license/LICENSE.
  */
+
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include "lan91c11x.h"
 
diff --git a/c/src/lib/libbsp/arm/csb336/network/network.c b/c/src/lib/libbsp/arm/csb336/network/network.c
index 18428c0519..be3d3f7b3d 100644
--- a/c/src/lib/libbsp/arm/csb336/network/network.c
+++ b/c/src/lib/libbsp/arm/csb336/network/network.c
@@ -8,6 +8,9 @@
  *  found in the file LICENSE in this distribution or at
  *  http://www.rtems.org/license/LICENSE.
  */
+
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
 #include <mc9328mxl.h>
diff --git a/c/src/lib/libbsp/arm/csb337/Makefile.am b/c/src/lib/libbsp/arm/csb337/Makefile.am
index a2d448c3e9..1870f9fba9 100644
--- a/c/src/lib/libbsp/arm/csb337/Makefile.am
+++ b/c/src/lib/libbsp/arm/csb337/Makefile.am
@@ -82,17 +82,10 @@ libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
 libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/arm920.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
 
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/arm/csb337/headers.am
diff --git a/c/src/lib/libbsp/arm/csb337/network/network.c b/c/src/lib/libbsp/arm/csb337/network/network.c
index 9272eab32f..af7150122d 100644
--- a/c/src/lib/libbsp/arm/csb337/network/network.c
+++ b/c/src/lib/libbsp/arm/csb337/network/network.c
@@ -10,6 +10,8 @@
  *             MicroMonitor 1.17.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
 #include <rtems/bspIo.h>
diff --git a/c/src/lib/libbsp/arm/edb7312/Makefile.am b/c/src/lib/libbsp/arm/edb7312/Makefile.am
index 74e235cfeb..bbf555a616 100644
--- a/c/src/lib/libbsp/arm/edb7312/Makefile.am
+++ b/c/src/lib/libbsp/arm/edb7312/Makefile.am
@@ -55,17 +55,7 @@ libbsp_a_SOURCES += ../../shared/include/cache_.h
 libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-# libcpu libraries could go here
-libbsp_a_LIBADD =
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
+libbsp_a_SOURCES += network/network.c
 endif
 
 include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/arm/edb7312/network/network.c b/c/src/lib/libbsp/arm/edb7312/network/network.c
index 05e7bdcebd..480808aeaa 100644
--- a/c/src/lib/libbsp/arm/edb7312/network/network.c
+++ b/c/src/lib/libbsp/arm/edb7312/network/network.c
@@ -1,3 +1,5 @@
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <sys/param.h>
 #include <sys/mbuf.h>
diff --git a/c/src/lib/libbsp/arm/gumstix/Makefile.am b/c/src/lib/libbsp/arm/gumstix/Makefile.am
index d4793d6acd..842c5c0f8c 100644
--- a/c/src/lib/libbsp/arm/gumstix/Makefile.am
+++ b/c/src/lib/libbsp/arm/gumstix/Makefile.am
@@ -50,25 +50,14 @@ libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
 libbsp_a_SOURCES += ../../shared/include/cache_.h
 libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
 
-#framebuffer
 if ON_SKYEYE
 libbsp_a_SOURCES += fb/fb.c
 if HAS_NETWORKING
-rtl8019_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += rtl8019.rel
-rtl8019_rel_SOURCES = rtl8019/rtl8019.c rtl8019/wd80x3.h
-rtl8019_rel_CPPFLAGS = $(AM_CPPFLAGS) $(rtl8019_CPPFLAGS)
-rtl8019_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += rtl8019/rtl8019.c rtl8019/wd80x3.h
 endif
 endif
 
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/arm920.rel
 
-if ON_SKYEYE
-if HAS_NETWORKING
-libbsp_a_LIBADD += rtl8019.rel
-endif
-endif
-
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/arm/gumstix/headers.am
diff --git a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
index b8684f8456..995835c689 100644
--- a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
+++ b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
@@ -8,6 +8,8 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <bsp/irq.h>
 #include "wd80x3.h"
diff --git a/c/src/lib/libbsp/arm/lpc24xx/Makefile.am b/c/src/lib/libbsp/arm/lpc24xx/Makefile.am
index f47733279c..d64806b62a 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc24xx/Makefile.am
@@ -137,15 +137,7 @@ libbsp_a_SOURCES += startup/start-config-pinsel.c
 ###############################################################################
 
 if HAS_NETWORKING
-
-noinst_PROGRAMS = network.rel
-
-network_rel_SOURCES = ../shared/lpc/network/lpc-ethernet.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) -D__INSIDE_RTEMS_BSD_TCPIP_STACK__ -D__BSD_VISIBLE
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-libbsp_a_LIBADD += network.rel
-
+libbsp_a_SOURCES += ../shared/lpc/network/lpc-ethernet.c
 endif
 
 ###############################################################################
diff --git a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
index d92bccceac..08ff91eb91 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
@@ -117,15 +117,7 @@ libbsp_a_SOURCES += startup/bspstarthooks.c
 ###############################################################################
 
 if HAS_NETWORKING
-
-noinst_PROGRAMS = network.rel
-
-network_rel_SOURCES = ../shared/lpc/network/lpc-ethernet.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) -D__INSIDE_RTEMS_BSD_TCPIP_STACK__ -D__BSD_VISIBLE
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-libbsp_a_LIBADD += network.rel
-
+libbsp_a_SOURCES += ../shared/lpc/network/lpc-ethernet.c
 endif
 
 ###############################################################################
diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
index 9404677c07..1fbe34350c 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
+++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
@@ -37,8 +37,6 @@ project_lib_DATA += linkcmds
 noinst_LIBRARIES = libbsp.a
 
 libbsp_a_SOURCES =
-libbsp_a_CPPFLAGS = $(AM_CPPFLAGS)
-libbsp_a_LIBADD =
 
 # Shared
 libbsp_a_SOURCES += ../../shared/bootcard.c
@@ -119,7 +117,7 @@ libbsp_a_SOURCES += spi/spi.c
 libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
 libbsp_a_SOURCES += ../shared/include/arm-cache-l1.h
 libbsp_a_SOURCES += ../shared/armv467ar-basic-cache/cache_.h
-libbsp_a_CPPFLAGS += -I$(srcdir)/../shared/armv467ar-basic-cache
+libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../shared/armv467ar-basic-cache
 
 # Start hooks
 libbsp_a_SOURCES += startup/bspstarthooks.c
@@ -129,23 +127,6 @@ libbsp_a_SOURCES += startup/mm_config_table.c
 libbsp_a_SOURCES += ../shared/mminit.c
 
 ###############################################################################
-# Network                                                    #
-###############################################################################
-
-#if HAS_NETWORKING
-#
-#noinst_PROGRAMS = network.rel
-#
-#network_rel_SOURCES = ../shared/lpc/network/lpc-ethernet.c
-#network_rel_CPPFLAGS = $(AM_CPPFLAGS) -D__INSIDE_RTEMS_BSD_TCPIP_STACK__ -D__BSD_VISIBLE
-#network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-#
-#
-#libbsp_a_LIBADD += network.rel
-#
-#endif
-
-###############################################################################
 #                  Special Rules                                              #
 ###############################################################################
 
diff --git a/c/src/lib/libbsp/arm/rtl22xx/Makefile.am b/c/src/lib/libbsp/arm/rtl22xx/Makefile.am
index f4b164364d..33db14cf0b 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/rtl22xx/Makefile.am
@@ -54,16 +54,7 @@ libbsp_a_SOURCES += ../../shared/include/cache_.h
 libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-libbsp_a_LIBADD =
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
+libbsp_a_SOURCES += network/network.c
 endif
 
 include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/arm/rtl22xx/network/network.c b/c/src/lib/libbsp/arm/rtl22xx/network/network.c
index b4dff95438..b269a6ddfc 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/network/network.c
+++ b/c/src/lib/libbsp/arm/rtl22xx/network/network.c
@@ -1,4 +1,7 @@
 /*Note: this file is copy from 7312 BSP, and untested yet*/
+
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <sys/param.h>
 #include <sys/mbuf.h>
diff --git a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c
index 170de7fcaa..fb8f014963 100644
--- a/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c
+++ b/c/src/lib/libbsp/arm/shared/lpc/network/lpc-ethernet.c
@@ -20,8 +20,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1
-#define __BSD_VISIBLE 1
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
 
 #include <errno.h>
 #include <inttypes.h>
diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am b/c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am
index afa5c9cd20..ffe4ff8a51 100644
--- a/c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am
+++ b/c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am
@@ -32,11 +32,7 @@ libbsp_a_SOURCES += ../../shared/bspreset.c
 libbsp_a_SOURCES += console/console.c
 
 if HAS_NETWORKING
-networkconfig_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += networkconfig.rel
-networkconfig_rel_SOURCES = network/networkconfig.c
-networkconfig_rel_CPPFLAGS = $(AM_CPPFLAGS) $(networkconfig_CPPFLAGS)
-networkconfig_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/networkconfig.c
 endif
 
 libbsp_a_LIBADD  = ../../../libcpu/@RTEMS_CPU@/mmu.rel
@@ -48,7 +44,6 @@ libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/rtc.rel
 libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/timer.rel
 
 if HAS_NETWORKING
-libbsp_a_LIBADD += networkconfig.rel
 libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/network.rel
 endif
 
diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c b/c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c
index 891bce8661..9737530340 100644
--- a/c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c
+++ b/c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c
@@ -11,7 +11,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
 
 #include <bsp.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/c/src/lib/libbsp/i386/pc386/3c509/3c509.c b/c/src/lib/libbsp/i386/pc386/3c509/3c509.c
index 41c1de1572..3cf7ec5226 100644
--- a/c/src/lib/libbsp/i386/pc386/3c509/3c509.c
+++ b/c/src/lib/libbsp/i386/pc386/3c509/3c509.c
@@ -53,6 +53,8 @@
  * eric at skatter.usask.ca
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 
 #include <stdio.h>
diff --git a/c/src/lib/libbsp/i386/pc386/3c509/elink.c b/c/src/lib/libbsp/i386/pc386/3c509/elink.c
index 2132ad29ba..ca637fb0a8 100644
--- a/c/src/lib/libbsp/i386/pc386/3c509/elink.c
+++ b/c/src/lib/libbsp/i386/pc386/3c509/elink.c
@@ -31,6 +31,8 @@
  * Common code for dealing with 3COM ethernet cards.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <sys/types.h>
 
 #include "elink.h"
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am
index 0fc36a6cb9..157d7a6017 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.am
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
@@ -162,34 +162,12 @@ appstart.$(OBJEXT): appcpustart.$(OBJEXT)
 endif
 
 if HAS_NETWORKING
-ne2000_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += ne2000.rel
-ne2000_rel_SOURCES = ne2000/ne2000.c
-ne2000_rel_CPPFLAGS = $(AM_CPPFLAGS) $(ne2000_CPPFLAGS)
-ne2000_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-ne2000_rel_LDFLAGS += -Wl,--undefined=rtems_ne_driver_attach
-endif
-
-if HAS_NETWORKING
-wd8003_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += wd8003.rel
-wd8003_rel_SOURCES = wd8003/wd8003.c
-wd8003_rel_CPPFLAGS = $(AM_CPPFLAGS) $(wd8003_CPPFLAGS)
-wd8003_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-wd8003_rel_LDFLAGS += -Wl,--undefined=rtems_wd_driver_attach
-endif
-
-if HAS_NETWORKING
-3c509_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += 3c509.rel
-3c509_rel_SOURCES = 3c509/3c509.c
-3c509_rel_SOURCES += 3c509/3c509.h
-3c509_rel_SOURCES += 3c509/elink.c
-3c509_rel_SOURCES += 3c509/elink.h
-3c509_rel_CPPFLAGS = $(AM_CPPFLAGS) $(3c509_CPPFLAGS)
-3c509_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-3c509_rel_LDFLAGS += -Wl,--undefined=rtems_3c509_driver_attach
-3c509_rel_LDFLAGS += -Wl,--undefined=ep_board
+libbsp_a_SOURCES += 3c509/3c509.c
+libbsp_a_SOURCES += 3c509/3c509.h
+libbsp_a_SOURCES += 3c509/elink.c
+libbsp_a_SOURCES += 3c509/elink.h
+libbsp_a_SOURCES += ne2000/ne2000.c
+libbsp_a_SOURCES += wd8003/wd8003.c
 endif
 
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/cache.rel
@@ -200,14 +178,6 @@ if HAS_SMP
 libbsp_a_LIBADD += appstart.$(OBJEXT)
 endif
 
-# We only build the Network library if HAS_NETWORKING was defined
-# dec21140 is supported via libchip
-if HAS_NETWORKING
-libbsp_a_LIBADD += ne2000.rel
-libbsp_a_LIBADD += wd8003.rel
-libbsp_a_LIBADD += 3c509.rel
-endif
-
 EXTRA_DIST += HOWTO
 EXTRA_DIST += README.dec21140
 EXTRA_DIST += STATUS
diff --git a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c
index 0b9bdba7ee..17861405a6 100644
--- a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c
+++ b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c
@@ -27,6 +27,8 @@
  *  that.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <libchip/wd80x3.h>
 
diff --git a/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c b/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c
index 1d37f38377..d10361bf2c 100644
--- a/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c
+++ b/c/src/lib/libbsp/i386/pc386/wd8003/wd8003.c
@@ -9,6 +9,8 @@
  *    eric at skatter.usask.ca
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <libchip/wd80x3.h>
 
diff --git a/c/src/lib/libbsp/lm32/lm32_evr/Makefile.am b/c/src/lib/libbsp/lm32/lm32_evr/Makefile.am
index 1cc202819a..7f0cf77cad 100644
--- a/c/src/lib/libbsp/lm32/lm32_evr/Makefile.am
+++ b/c/src/lib/libbsp/lm32/lm32_evr/Makefile.am
@@ -46,11 +46,7 @@ libbsp_a_SOURCES += ../../shared/include/cache_.h
 libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
 
 if HAS_NETWORKING
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = ../../lm32/shared/tsmac/tsmac.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-libbsp_a_LIBADD += network.rel
+libbsp_a_SOURCES += ../../lm32/shared/tsmac/tsmac.c
 endif
 
 
diff --git a/c/src/lib/libbsp/lm32/milkymist/Makefile.am b/c/src/lib/libbsp/lm32/milkymist/Makefile.am
index ee3161a86d..79f6aa8fa6 100644
--- a/c/src/lib/libbsp/lm32/milkymist/Makefile.am
+++ b/c/src/lib/libbsp/lm32/milkymist/Makefile.am
@@ -93,11 +93,7 @@ libbsp_a_SOURCES += ../../shared/include/cache_.h
 libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/../../shared/include
 
 if HAS_NETWORKING
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = ../../lm32/shared/milkymist_networking/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-libbsp_a_LIBADD += network.rel
+libbsp_a_SOURCES += ../../lm32/shared/milkymist_networking/network.c
 endif
 
 include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/lm32/shared/milkymist_networking/network.c b/c/src/lib/libbsp/lm32/shared/milkymist_networking/network.c
index d1b3b04593..2bc518ef25 100644
--- a/c/src/lib/libbsp/lm32/shared/milkymist_networking/network.c
+++ b/c/src/lib/libbsp/lm32/shared/milkymist_networking/network.c
@@ -10,6 +10,7 @@
  *  Copyright (C) 2011 Sebastien Bourdeauducq
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
 #define RTEMS_STATUS_CHECKS_USE_PRINTK
 
 #include <bsp.h>
diff --git a/c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c b/c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c
index 6849ae78ae..6779f336d4 100644
--- a/c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c
+++ b/c/src/lib/libbsp/lm32/shared/tsmac/tsmac.c
@@ -12,6 +12,7 @@
  *  Micro-Research Finland Oy
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
 #define _KERNEL
 
 #include <rtems.h>
diff --git a/c/src/lib/libbsp/m68k/av5282/Makefile.am b/c/src/lib/libbsp/m68k/av5282/Makefile.am
index a3d051a365..d9842e1ca2 100644
--- a/c/src/lib/libbsp/m68k/av5282/Makefile.am
+++ b/c/src/lib/libbsp/m68k/av5282/Makefile.am
@@ -37,20 +37,13 @@ libbsp_a_SOURCES += console/console.c
 libbsp_a_SOURCES += timer/timer.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
     ../../../libcpu/@RTEMS_CPU@/mcf5282/cachepd.rel \
     ../../../libcpu/@RTEMS_CPU@/shared/misc.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
 
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/m68k/av5282/headers.am
diff --git a/c/src/lib/libbsp/m68k/av5282/network/network.c b/c/src/lib/libbsp/m68k/av5282/network/network.c
index 90c0b4a377..457b43c5d6 100644
--- a/c/src/lib/libbsp/m68k/av5282/network/network.c
+++ b/c/src/lib/libbsp/m68k/av5282/network/network.c
@@ -1,3 +1,5 @@
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/c/src/lib/libbsp/m68k/csb360/network/network.c b/c/src/lib/libbsp/m68k/csb360/network/network.c
index 8abba2a1d8..47e0adb44d 100644
--- a/c/src/lib/libbsp/m68k/csb360/network/network.c
+++ b/c/src/lib/libbsp/m68k/csb360/network/network.c
@@ -21,6 +21,9 @@
  *  and Charles-Antoine Gauthier <charles.gauthier at iit.nrc.ca>
  *  Copyright (c) 1999, National Research Council of Canada
  */
+
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <stdio.h>
 #include <rtems/error.h>
diff --git a/c/src/lib/libbsp/m68k/gen68360/Makefile.am b/c/src/lib/libbsp/m68k/gen68360/Makefile.am
index 9bb4369caa..1701c1b83d 100644
--- a/c/src/lib/libbsp/m68k/gen68360/Makefile.am
+++ b/c/src/lib/libbsp/m68k/gen68360/Makefile.am
@@ -39,19 +39,12 @@ libbsp_a_SOURCES += console/console.c ../../shared/dummy_printk_support.c
 libbsp_a_SOURCES += timer/timer.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
     ../../../libcpu/@RTEMS_CPU@/shared/misc.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
 if HAS_FPSP
 libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/fpsp.rel
 endif
diff --git a/c/src/lib/libbsp/m68k/gen68360/network/network.c b/c/src/lib/libbsp/m68k/gen68360/network/network.c
index 3ed3bf5590..0a038d3348 100644
--- a/c/src/lib/libbsp/m68k/gen68360/network/network.c
+++ b/c/src/lib/libbsp/m68k/gen68360/network/network.c
@@ -7,6 +7,9 @@
  * Saskatoon, Saskatchewan, CANADA
  * eric at skatter.usask.ca
  */
+
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <rtems/m68k/m68360.h>
 #include <stdio.h>
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am b/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am
index fd9eac00f3..fba06369c9 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am
+++ b/c/src/lib/libbsp/m68k/genmcf548x/Makefile.am
@@ -54,20 +54,11 @@ libbsp_a_SOURCES += ../include/cache_.h
 libbsp_a_CPPFLAGS += -I$(srcdir)/include
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) \
-    $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/misc.rel \
                   ../../../libcpu/@RTEMS_CPU@/mcf548x/mcdma.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
-
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/m68k/genmcf548x/headers.am
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/network/network.c b/c/src/lib/libbsp/m68k/genmcf548x/network/network.c
index 62acda5990..13cb5fbdce 100644
--- a/c/src/lib/libbsp/m68k/genmcf548x/network/network.c
+++ b/c/src/lib/libbsp/m68k/genmcf548x/network/network.c
@@ -37,6 +37,8 @@
  *
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <rtems/error.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/c/src/lib/libbsp/m68k/mcf5235/Makefile.am b/c/src/lib/libbsp/m68k/mcf5235/Makefile.am
index 8a9027883a..adb474f65e 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5235/Makefile.am
@@ -39,21 +39,13 @@ libbsp_a_SOURCES += console/console.c
 libbsp_a_SOURCES += timer/timer.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) \
-    $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
     ../../../libcpu/@RTEMS_CPU@/mcf5235/cachepd.rel \
     ../../../libcpu/@RTEMS_CPU@/shared/misc.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
 
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/m68k/mcf5235/headers.am
diff --git a/c/src/lib/libbsp/m68k/mcf5235/network/network.c b/c/src/lib/libbsp/m68k/mcf5235/network/network.c
index 7ce20e0400..6c8fa88be2 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/network/network.c
+++ b/c/src/lib/libbsp/m68k/mcf5235/network/network.c
@@ -4,6 +4,8 @@
  * TO DO: Check network stack code -- force longword alignment of all tx mbufs?
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/c/src/lib/libbsp/m68k/mcf5329/Makefile.am b/c/src/lib/libbsp/m68k/mcf5329/Makefile.am
index b6527dbe77..b844e949d6 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mcf5329/Makefile.am
@@ -38,12 +38,7 @@ libbsp_a_SOURCES += console/console.c
 libbsp_a_SOURCES += timer/timer.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) \
-    $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = \
@@ -51,9 +46,5 @@ libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/shared/misc.rel \
     ../../../libcpu/@RTEMS_CPU@/mcf532x/cachepd.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
-
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/m68k/mcf5329/headers.am
diff --git a/c/src/lib/libbsp/m68k/mcf5329/network/network.c b/c/src/lib/libbsp/m68k/mcf5329/network/network.c
index 62d90f1219..c752f8d669 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/network/network.c
+++ b/c/src/lib/libbsp/m68k/mcf5329/network/network.c
@@ -4,6 +4,8 @@
  * TO DO: Check network stack code -- force longword alignment of all tx mbufs?
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/c/src/lib/libbsp/m68k/mvme162/Makefile.am b/c/src/lib/libbsp/m68k/mvme162/Makefile.am
index 9ecf9f56e0..c5e3b92f99 100644
--- a/c/src/lib/libbsp/m68k/mvme162/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme162/Makefile.am
@@ -41,19 +41,12 @@ libbsp_a_SOURCES += timer/timer.c timer/timerisr.S
 libbsp_a_SOURCES += tod/tod.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = ../mvme167/network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += ../mvme167/network/network.c
 endif
 
 libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
     ../../../libcpu/@RTEMS_CPU@/shared/misc.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
 if HAS_FPSP
 libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/fpsp.rel
 endif
diff --git a/c/src/lib/libbsp/m68k/mvme167/Makefile.am b/c/src/lib/libbsp/m68k/mvme167/Makefile.am
index fdea7cb506..84a227008a 100644
--- a/c/src/lib/libbsp/m68k/mvme167/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme167/Makefile.am
@@ -38,20 +38,13 @@ libbsp_a_SOURCES += console/console.c console/console-recording.h
 libbsp_a_SOURCES += timer/timer.c timer/timerisr.S
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
     ../../../libcpu/@RTEMS_CPU@/shared/misc.rel \
     ../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/fpsp.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
 
 EXTRA_DIST += times
 
diff --git a/c/src/lib/libbsp/m68k/mvme167/network/network.c b/c/src/lib/libbsp/m68k/mvme167/network/network.c
index 822db56730..06bcbfa84a 100644
--- a/c/src/lib/libbsp/m68k/mvme167/network/network.c
+++ b/c/src/lib/libbsp/m68k/mvme167/network/network.c
@@ -1,6 +1,7 @@
 /*  network.c: An 82596 ethernet driver for rtems-bsd.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
 #define KERNEL
 
 /*
diff --git a/c/src/lib/libbsp/m68k/uC5282/Makefile.am b/c/src/lib/libbsp/m68k/uC5282/Makefile.am
index 5572d3f3dc..870ff61a20 100644
--- a/c/src/lib/libbsp/m68k/uC5282/Makefile.am
+++ b/c/src/lib/libbsp/m68k/uC5282/Makefile.am
@@ -36,19 +36,12 @@ libbsp_a_SOURCES += console/console.c
 libbsp_a_SOURCES += timer/timer.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
     ../../../libcpu/@RTEMS_CPU@/mcf5282/cachepd.rel \
     ../../../libcpu/@RTEMS_CPU@/shared/misc.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
 
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/m68k/uC5282/headers.am
diff --git a/c/src/lib/libbsp/m68k/uC5282/network/network.c b/c/src/lib/libbsp/m68k/uC5282/network/network.c
index 86a2a50bd1..b8afa0b968 100644
--- a/c/src/lib/libbsp/m68k/uC5282/network/network.c
+++ b/c/src/lib/libbsp/m68k/uC5282/network/network.c
@@ -11,6 +11,8 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/c/src/lib/libbsp/mips/csb350/Makefile.am b/c/src/lib/libbsp/mips/csb350/Makefile.am
index fba96dc185..aa58666dcf 100644
--- a/c/src/lib/libbsp/mips/csb350/Makefile.am
+++ b/c/src/lib/libbsp/mips/csb350/Makefile.am
@@ -50,19 +50,11 @@ libbsp_a_SOURCES += irq/vectorisrs.c
 libbsp_a_SOURCES += ../shared/irq/interruptmask.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD  = ../../../libcpu/mips/shared/cache.rel
 libbsp_a_LIBADD += ../../../libcpu/mips/shared/interrupts.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
-
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/mips/csb350/headers.am
diff --git a/c/src/lib/libbsp/mips/csb350/network/network.c b/c/src/lib/libbsp/mips/csb350/network/network.c
index a9dc5df281..15a1c320df 100644
--- a/c/src/lib/libbsp/mips/csb350/network/network.c
+++ b/c/src/lib/libbsp/mips/csb350/network/network.c
@@ -13,6 +13,8 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
 #include <bsp.h>
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
index 5f9bad706e..e5d681153c 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
@@ -74,11 +74,8 @@ libbsp_a_SOURCES += i2c/i2c_init.c
 libbsp_a_SOURCES += spi/spi_init.c
 
 if HAS_NETWORKING
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES   = network/network.c
-network_rel_CPPFLAGS  = $(AM_CPPFLAGS)
-network_rel_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__  -D__BSD_VISIBLE
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c
+libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/mpc83xx/tsec.rel
 endif
 
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
@@ -91,11 +88,6 @@ libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
 	../../../libcpu/@RTEMS_CPU@/mpc83xx/spi.rel \
 	../../../libcpu/@RTEMS_CPU@/mpc83xx/gtm.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/mpc83xx/tsec.rel
-endif
-
 EXTRA_DIST += README.mpc8349eamds
 
 include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/network/network.c b/c/src/lib/libbsp/powerpc/gen83xx/network/network.c
index 316467feaf..b870673cd3 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/network/network.c
+++ b/c/src/lib/libbsp/powerpc/gen83xx/network/network.c
@@ -18,6 +18,7 @@
 | of the network interface driver                                 |
 \*===============================================================*/
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
 
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/c/src/lib/libbsp/powerpc/haleakala/Makefile.am b/c/src/lib/libbsp/powerpc/haleakala/Makefile.am
index 24b30661a1..022728651a 100644
--- a/c/src/lib/libbsp/powerpc/haleakala/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/haleakala/Makefile.am
@@ -39,11 +39,7 @@ libbsp_a_SOURCES += ../../powerpc/shared/console/uart.c \
 libbsp_a_SOURCES += irq/irq_init.c irq/irq.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS = network.rel
-network_rel_SOURCES = network/network.c 
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network.c 
 endif
 
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
@@ -54,9 +50,5 @@ libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
     ../../../libcpu/@RTEMS_CPU@/ppc403/clock.rel \
     ../../../libcpu/@RTEMS_CPU@/ppc403/timer.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
-
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/powerpc/haleakala/headers.am
diff --git a/c/src/lib/libbsp/powerpc/haleakala/network/network.c b/c/src/lib/libbsp/powerpc/haleakala/network/network.c
index e8731cb954..f77b03648f 100644
--- a/c/src/lib/libbsp/powerpc/haleakala/network/network.c
+++ b/c/src/lib/libbsp/powerpc/haleakala/network/network.c
@@ -12,6 +12,8 @@
  *
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
index 96ec40e15f..bbc0a8e8b6 100644
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
@@ -110,12 +110,7 @@ libbsp_a_SOURCES += ../../powerpc/shared/vme/vme_universe.c
 
 if QEMU
 if HAS_NETWORKING
-ne2000_CPPFLAGS          = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-ne2000_CPPFLAGS         += '-Dbsp_cmdline_arg=rtems_bsp_cmdline_get_param_raw'
-noinst_PROGRAMS         += ne2000.rel
-ne2000_rel_SOURCES       = ../../i386/pc386/ne2000/ne2000.c
-ne2000_rel_CPPFLAGS      = $(AM_CPPFLAGS) $(ne2000_CPPFLAGS)
-ne2000_rel_LDFLAGS       = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += ../../i386/pc386/ne2000/ne2000.c
 endif
 endif
 
@@ -132,12 +127,6 @@ libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/mpc6xx/timer.rel \
     ../../../libcpu/@RTEMS_CPU@/mpc6xx/altivec.rel
 
-if QEMU
-if HAS_NETWORKING
-libbsp_a_LIBADD+=ne2000.rel
-endif
-endif
-
 EXTRA_DIST += BOOTING README.mtx603e README.MVME2100 README.MVME2300 \
               README.MVME2400 \
     README.OTHERBOARDS
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am b/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
index bd84c6c0cc..1f9d2f189d 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am
@@ -50,12 +50,8 @@ libbsp_a_SOURCES += ../../shared/bspclean.c \
 libbsp_a_SOURCES += ../../shared/bspreset.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-network_CPPFLAGS += -D__BSD_VISIBLE
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network.c network/if_hdlcsubr.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/if_hdlcsubr.c
+libbsp_a_SOURCES += network/network.c
 endif
 
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
@@ -66,9 +62,6 @@ libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
     ../../../libcpu/@RTEMS_CPU@/mpc8260/cpm.rel \
     ../../../libcpu/@RTEMS_CPU@/mpc8260/mmu.rel \
     ../../../libcpu/@RTEMS_CPU@/mpc8260/timer.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
 
 EXTRA_DIST += times
 
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/network/if_hdlcsubr.c b/c/src/lib/libbsp/powerpc/mpc8260ads/network/if_hdlcsubr.c
index a083b3978b..350efdbc22 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/network/if_hdlcsubr.c
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/network/if_hdlcsubr.c
@@ -47,6 +47,8 @@
  *	@(#)if_ethersubr.c	8.1 (Berkeley) 6/10/93
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems/rtems_bsdnet.h>
 
 #include <sys/param.h>
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/network/network.c b/c/src/lib/libbsp/powerpc/mpc8260ads/network/network.c
index 5e628963a6..fb87fc0e64 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/network/network.c
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/network/network.c
@@ -23,6 +23,9 @@
  * Saskatoon, Saskatchewan, CANADA
  * eric at skatter.usask.ca
  */
+
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <bsp/irq.h>
 #include <mpc8260.h>
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/network/tsec.c b/c/src/lib/libbsp/powerpc/mvme3100/network/tsec.c
index e2bea25477..37a24099c0 100644
--- a/c/src/lib/libbsp/powerpc/mvme3100/network/tsec.c
+++ b/c/src/lib/libbsp/powerpc/mvme3100/network/tsec.c
@@ -44,6 +44,8 @@
  * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <rtems/error.h>
 #include <bsp/irq.h>
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am b/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am
index 5531021385..9173d6b527 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am
@@ -58,11 +58,8 @@ libbsp_a_SOURCES += ../../shared/bspclean.c \
 libbsp_a_SOURCES += ../../shared/bspreset.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/network_scc.c network/network_fec.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += network/network_fec.c
+libbsp_a_SOURCES += network/network_scc.c
 endif
 
 libbsp_a_LIBADD = \
@@ -76,9 +73,5 @@ libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/mpc8xx/mmu.rel \
     ../../../libcpu/@RTEMS_CPU@/mpc8xx/timer.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
-
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/powerpc/tqm8xx/headers.am
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/network/network_fec.c b/c/src/lib/libbsp/powerpc/tqm8xx/network/network_fec.c
index 11018ea632..71da617d8c 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/network/network_fec.c
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/network/network_fec.c
@@ -47,6 +47,9 @@
  *  and Charles-Antoine Gauthier <charles.gauthier at iit.nrc.ca>
  *  Copyright (c) 1999, National Research Council of Canada
  */
+
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/network/network_scc.c b/c/src/lib/libbsp/powerpc/tqm8xx/network/network_scc.c
index 133dc0f4a2..98acbb3e7a 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/network/network_scc.c
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/network/network_scc.c
@@ -44,6 +44,9 @@
  *  and Charles-Antoine Gauthier <charles.gauthier at iit.nrc.ca>
  *  Copyright (c) 1999, National Research Council of Canada
  */
+
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/c/src/lib/libbsp/powerpc/virtex/Makefile.am b/c/src/lib/libbsp/powerpc/virtex/Makefile.am
index 232ec7b190..0c0e1081e0 100644
--- a/c/src/lib/libbsp/powerpc/virtex/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/virtex/Makefile.am
@@ -59,12 +59,7 @@ libbsp_a_SOURCES += irq/irq_init.c
 libbsp_a_SOURCES += ../shared/clock/clock.c
 
 if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-network_CPPFLAGS += -D__BSD_VISIBLE
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/xiltemac.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += = network/xiltemac.c
 endif
 
 # timer
@@ -77,9 +72,5 @@ libbsp_a_LIBADD += \
     ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
     ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
-
 include $(top_srcdir)/../../../../automake/local.am
 include $(srcdir)/../../../../../../bsps/powerpc/virtex/headers.am
diff --git a/c/src/lib/libbsp/powerpc/virtex/network/xiltemac.c b/c/src/lib/libbsp/powerpc/virtex/network/xiltemac.c
index 0deef00288..1c3a461466 100644
--- a/c/src/lib/libbsp/powerpc/virtex/network/xiltemac.c
+++ b/c/src/lib/libbsp/powerpc/virtex/network/xiltemac.c
@@ -9,15 +9,9 @@
  * http://www.rtems.org/license/LICENSE.
  *
  */
-#define PPC_HAS_CLASSIC_EXCEPTIONS FALSE
 
-#ifndef __INSIDE_RTEMS_BSD_TCPIP_STACK__
 #define __INSIDE_RTEMS_BSD_TCPIP_STACK__
-#endif
-
-#ifndef __BSD_VISIBLE
-#define __BSD_VISIBLE
-#endif
+#define PPC_HAS_CLASSIC_EXCEPTIONS FALSE
 
 #include <bsp.h>
 #include <rtems/bspIo.h>
diff --git a/c/src/lib/libbsp/sparc/erc32/Makefile.am b/c/src/lib/libbsp/sparc/erc32/Makefile.am
index cf499de0d5..cb7ee0a34e 100644
--- a/c/src/lib/libbsp/sparc/erc32/Makefile.am
+++ b/c/src/lib/libbsp/sparc/erc32/Makefile.am
@@ -73,11 +73,7 @@ libbsp_a_SOURCES += ../../shared/bspsmpgetcurrentprocessor.c
 endif
 
 if HAS_NETWORKING
-erc32sonic_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-noinst_PROGRAMS += erc32sonic.rel
-erc32sonic_rel_SOURCES = erc32sonic/erc32sonic.c
-erc32sonic_rel_CPPFLAGS = $(AM_CPPFLAGS) $(erc32sonic_CPPFLAGS)
-erc32sonic_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+libbsp_a_SOURCES += erc32sonic/erc32sonic.c
 endif
 
 libbsp_a_LIBADD  = \
@@ -85,9 +81,6 @@ libbsp_a_LIBADD  = \
     ../../../libcpu/@RTEMS_CPU@/cache.rel \
     ../../../libcpu/@RTEMS_CPU@/reg_win.rel \
     ../../../libcpu/@RTEMS_CPU@/syscall.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += erc32sonic.rel
-endif
 
 EXTRA_DIST += times
 
diff --git a/c/src/lib/libbsp/sparc/erc32/erc32sonic/erc32sonic.c b/c/src/lib/libbsp/sparc/erc32/erc32sonic/erc32sonic.c
index f7d7b61f5d..ce108bd825 100644
--- a/c/src/lib/libbsp/sparc/erc32/erc32sonic/erc32sonic.c
+++ b/c/src/lib/libbsp/sparc/erc32/erc32sonic/erc32sonic.c
@@ -20,6 +20,8 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <libchip/sonic.h>
 #if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
diff --git a/c/src/lib/libbsp/sparc/leon2/Makefile.am b/c/src/lib/libbsp/sparc/leon2/Makefile.am
index 1914c6956f..f7f2fd6937 100644
--- a/c/src/lib/libbsp/sparc/leon2/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon2/Makefile.am
@@ -169,29 +169,9 @@ libbsp_a_SOURCES += ../../shared/bspsmpgetcurrentprocessor.c
 endif
 
 if HAS_NETWORKING
-noinst_PROGRAMS += leon_smc91111.rel
-leon_smc91111_rel_SOURCES = leon_smc91111/leon_smc91111.c
-leon_smc91111_rel_CPPFLAGS = $(AM_CPPFLAGS)
-leon_smc91111_rel_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-leon_smc91111_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-if HAS_NETWORKING
-noinst_PROGRAMS += leon_open_eth.rel
-leon_open_eth_rel_SOURCES = leon_open_eth/leon_open_eth.c
-leon_open_eth_rel_CPPFLAGS = $(AM_CPPFLAGS)
-leon_open_eth_rel_CPPFLAGS +=  -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-leon_open_eth_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-if HAS_NETWORKING
-noinst_PROGRAMS += leon_greth.rel
-leon_greth_rel_SOURCES = ../../sparc/shared/net/greth.c
-leon_greth_rel_CPPFLAGS = $(AM_CPPFLAGS)
-leon_greth_rel_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-leon_greth_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-# BSP Network configuration
+libbsp_a_SOURCES += leon_smc91111/leon_smc91111.c
+libbsp_a_SOURCES += leon_open_eth/leon_open_eth.c
+libbsp_a_SOURCES += ../../sparc/shared/net/greth.c
 libbsp_a_SOURCES += ../../sparc/shared/net/network_interface_add.c
 endif
 
@@ -201,12 +181,6 @@ libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/reg_win.rel \
     ../../../libcpu/@RTEMS_CPU@/syscall.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += leon_greth.rel
-libbsp_a_LIBADD += leon_open_eth.rel
-libbsp_a_LIBADD += leon_smc91111.rel
-endif
-
 EXTRA_DIST += times
 
 include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/sparc/leon2/leon_open_eth/leon_open_eth.c b/c/src/lib/libbsp/sparc/leon2/leon_open_eth/leon_open_eth.c
index ae0e8052f7..27b04cd386 100644
--- a/c/src/lib/libbsp/sparc/leon2/leon_open_eth/leon_open_eth.c
+++ b/c/src/lib/libbsp/sparc/leon2/leon_open_eth/leon_open_eth.c
@@ -13,6 +13,8 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <libchip/open_eth.h>
 #if (OPEN_ETH_DEBUG & OPEN_ETH_DEBUG_PRINT_REGISTERS)
diff --git a/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c b/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
index 45b9a4aab7..748ca35491 100644
--- a/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
+++ b/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
@@ -13,6 +13,8 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 
 #include <bsp.h>
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index 60e2a9044a..2f8480ae97 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -189,35 +189,13 @@ libbsp_a_SOURCES += startup/bspsmp.c
 endif
 
 if HAS_NETWORKING
-noinst_PROGRAMS += leon_smc91111.rel
-leon_smc91111_rel_SOURCES = leon_smc91111/leon_smc91111.c
-leon_smc91111_rel_CPPFLAGS = $(AM_CPPFLAGS)
-leon_smc91111_rel_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-leon_smc91111_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-if HAS_NETWORKING
-noinst_PROGRAMS += leon_open_eth.rel
-leon_open_eth_rel_SOURCES = leon_open_eth/leon_open_eth.c
-leon_open_eth_rel_CPPFLAGS = $(AM_CPPFLAGS)
-leon_open_eth_rel_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-leon_open_eth_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-if HAS_NETWORKING
-noinst_PROGRAMS += leon_greth.rel
+libbsp_a_SOURCES += leon_smc91111/leon_smc91111.c
+libbsp_a_SOURCES += leon_open_eth/leon_open_eth.c
+libbsp_a_SOURCES += ../../sparc/shared/net/greth.c
+libbsp_a_SOURCES += ../../sparc/shared/net/network_interface_add.c
 if !HAS_SMP
 libbsp_a_SOURCES += leon_greth/leon_greth.c
 endif
-leon_greth_rel_SOURCES = ../../sparc/shared/net/greth.c
-leon_greth_rel_CPPFLAGS = $(AM_CPPFLAGS)
-leon_greth_rel_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
-leon_greth_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-# BSP Network configuration
-if HAS_NETWORKING
-libbsp_a_SOURCES += ../../sparc/shared/net/network_interface_add.c
 endif
 
 EXTRA_DIST += shmsupp/README
@@ -232,12 +210,6 @@ libbsp_a_LIBADD = \
     ../../../libcpu/@RTEMS_CPU@/reg_win.rel \
     ../../../libcpu/@RTEMS_CPU@/syscall.rel
 
-if HAS_NETWORKING
-libbsp_a_LIBADD += leon_open_eth.rel
-libbsp_a_LIBADD += leon_greth.rel
-libbsp_a_LIBADD += leon_smc91111.rel
-endif
-
 EXTRA_DIST += times
 
 include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/sparc/leon3/leon_greth/leon_greth.c b/c/src/lib/libbsp/sparc/leon3/leon_greth/leon_greth.c
index 77e4f497ae..d630522a5d 100644
--- a/c/src/lib/libbsp/sparc/leon3/leon_greth/leon_greth.c
+++ b/c/src/lib/libbsp/sparc/leon3/leon_greth/leon_greth.c
@@ -9,6 +9,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
 
 #include <bsp.h>
 #include <libchip/greth.h>
diff --git a/c/src/lib/libbsp/sparc/leon3/leon_open_eth/leon_open_eth.c b/c/src/lib/libbsp/sparc/leon3/leon_open_eth/leon_open_eth.c
index 9de03720e0..c59d613d75 100644
--- a/c/src/lib/libbsp/sparc/leon3/leon_open_eth/leon_open_eth.c
+++ b/c/src/lib/libbsp/sparc/leon3/leon_open_eth/leon_open_eth.c
@@ -13,6 +13,7 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
 
 #include <bsp.h>
 #include <libchip/open_eth.h>
diff --git a/c/src/lib/libbsp/sparc/leon3/leon_smc91111/leon_smc91111.c b/c/src/lib/libbsp/sparc/leon3/leon_smc91111/leon_smc91111.c
index 17218bef9f..e4adac6c2b 100644
--- a/c/src/lib/libbsp/sparc/leon3/leon_smc91111/leon_smc91111.c
+++ b/c/src/lib/libbsp/sparc/leon3/leon_smc91111/leon_smc91111.c
@@ -13,6 +13,8 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <bsp.h>
 #include <libchip/smc91111exp.h>
 #include <rtems/bspIo.h>
diff --git a/c/src/lib/libbsp/sparc/shared/net/greth.c b/c/src/lib/libbsp/sparc/shared/net/greth.c
index 5e2ee49087..eafcb9947a 100644
--- a/c/src/lib/libbsp/sparc/shared/net/greth.c
+++ b/c/src/lib/libbsp/sparc/shared/net/greth.c
@@ -11,6 +11,9 @@
  *              multiple GRETH cores. <daniel at gaisler.com>
  *  2007-09-07, Ported GBIT support from 4.6.5
  */
+
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #define _KERNEL
 #define CPU_U32_FIX
diff --git a/c/src/lib/libcpu/bfin/Makefile.am b/c/src/lib/libcpu/bfin/Makefile.am
index 5f981657f7..9b7ee0c26e 100644
--- a/c/src/lib/libcpu/bfin/Makefile.am
+++ b/c/src/lib/libcpu/bfin/Makefile.am
@@ -80,10 +80,9 @@ timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 
 if HAS_NETWORKING
 ## network
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
 noinst_PROGRAMS += network.rel
 network_rel_SOURCES = network/ethernet.c
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
+network_rel_CPPFLAGS = $(AM_CPPFLAGS)
 network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 endif
 
diff --git a/c/src/lib/libcpu/bfin/network/ethernet.c b/c/src/lib/libcpu/bfin/network/ethernet.c
index 5d7322ba0b..f08ffdd63b 100644
--- a/c/src/lib/libcpu/bfin/network/ethernet.c
+++ b/c/src/lib/libcpu/bfin/network/ethernet.c
@@ -10,6 +10,8 @@
  *
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
 #include <rtems/rtems/cache.h>
diff --git a/c/src/lib/libcpu/powerpc/Makefile.am b/c/src/lib/libcpu/powerpc/Makefile.am
index b56ce691bf..514c93db37 100644
--- a/c/src/lib/libcpu/powerpc/Makefile.am
+++ b/c/src/lib/libcpu/powerpc/Makefile.am
@@ -300,7 +300,6 @@ if mpc83xx
 if HAS_NETWORKING
 noinst_PROGRAMS += mpc83xx/tsec.rel
 mpc83xx_tsec_rel_SOURCES = mpc83xx/network/tsec.c
-mpc83xx_tsec_rel_CPPFLAGS = $(AM_CPPFLAGS) -D__INSIDE_RTEMS_BSD_TCPIP_STACK__ -D__BSD_VISIBLE
 mpc83xx_tsec_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 endif
 
@@ -388,7 +387,6 @@ if qoriq
 if HAS_NETWORKING
 noinst_PROGRAMS += tsec.rel
 tsec_rel_SOURCES = mpc83xx/network/tsec.c
-tsec_rel_CPPFLAGS = $(AM_CPPFLAGS) -D__INSIDE_RTEMS_BSD_TCPIP_STACK__ -D__BSD_VISIBLE
 tsec_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 endif
 
diff --git a/c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c b/c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c
index a16369f0e3..ea1c29052e 100644
--- a/c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c
+++ b/c/src/lib/libcpu/powerpc/mpc83xx/network/tsec.c
@@ -17,6 +17,8 @@
 | this file contains the MPC83xx TSEC networking driver           |
 \*===============================================================*/
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <stdlib.h>
 #include <bsp.h>
 #include <bsp/irq.h>
diff --git a/c/src/libchip/Makefile.am b/c/src/libchip/Makefile.am
index 21892f1736..187773f911 100644
--- a/c/src/libchip/Makefile.am
+++ b/c/src/libchip/Makefile.am
@@ -22,8 +22,6 @@ libide_a_CPPFLAGS = $(AM_CPPFLAGS)
 # network
 if HAS_NETWORKING
 noinst_LIBRARIES += libnetchip.a
-libnetchip_a_CPPFLAGS = $(AM_CPPFLAGS)
-libnetchip_a_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
 libnetchip_a_SOURCES = network/cs8900.c network/dec21140.c network/i82586.c \
     network/sonic.c network/if_fxp.c network/elnk.c network/open_eth.c \
     network/if_dc.c
diff --git a/c/src/libchip/network/cs8900.c b/c/src/libchip/network/cs8900.c
index 5391a9c72e..650a0e1fef 100644
--- a/c/src/libchip/network/cs8900.c
+++ b/c/src/libchip/network/cs8900.c
@@ -23,6 +23,8 @@
 
 */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <errno.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/c/src/libchip/network/dec21140.c b/c/src/libchip/network/dec21140.c
index bc3ab24782..6fd3d5b33f 100644
--- a/c/src/libchip/network/dec21140.c
+++ b/c/src/libchip/network/dec21140.c
@@ -35,6 +35,8 @@
  *
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <inttypes.h>
 
diff --git a/c/src/libchip/network/elnk.c b/c/src/libchip/network/elnk.c
index f0b0264725..29adbe9c21 100644
--- a/c/src/libchip/network/elnk.c
+++ b/c/src/libchip/network/elnk.c
@@ -62,6 +62,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 
 /*
diff --git a/c/src/libchip/network/greth.c b/c/src/libchip/network/greth.c
index 244e4a28df..20be83ee48 100644
--- a/c/src/libchip/network/greth.c
+++ b/c/src/libchip/network/greth.c
@@ -9,6 +9,8 @@
  * 2007-09-07, Ported GBIT support from 4.6.5
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <bsp.h>
 
diff --git a/c/src/libchip/network/i82586.c b/c/src/libchip/network/i82586.c
index e25f6667fc..c79af66e0d 100644
--- a/c/src/libchip/network/i82586.c
+++ b/c/src/libchip/network/i82586.c
@@ -147,6 +147,8 @@ Mode of operation:
    the synchronization.
 */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <rtems/error.h>
 #include <rtems/rtems_bsdnet.h>
diff --git a/c/src/libchip/network/if_dc.c b/c/src/libchip/network/if_dc.c
index 1e138947a9..e822a7c533 100644
--- a/c/src/libchip/network/if_dc.c
+++ b/c/src/libchip/network/if_dc.c
@@ -99,6 +99,8 @@
  *  from being compiled on systems which can't support this driver.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #if defined(DRIVER_SUPPORTED)
 	#undef DRIVER_SUPPORTED
 #endif
diff --git a/c/src/libchip/network/if_fxp.c b/c/src/libchip/network/if_fxp.c
index bd04533bdb..2fe9a5c403 100644
--- a/c/src/libchip/network/if_fxp.c
+++ b/c/src/libchip/network/if_fxp.c
@@ -55,6 +55,8 @@
  *     Original RTEMS modifications.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #if defined(__i386__)
 
 /*#define DEBUG_OUT 0*/
diff --git a/c/src/libchip/network/open_eth.c b/c/src/libchip/network/open_eth.c
index b574253333..88df0882cf 100644
--- a/c/src/libchip/network/open_eth.c
+++ b/c/src/libchip/network/open_eth.c
@@ -19,6 +19,8 @@
  *        that used by this driver.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #if defined(__i386__) || defined(__arm__) || defined(__PPC__)
   #define OPENETH_NOT_SUPPORTED
 #endif
diff --git a/c/src/libchip/network/smc91111.c b/c/src/libchip/network/smc91111.c
index 8c37481b9b..45c87e8245 100644
--- a/c/src/libchip/network/smc91111.c
+++ b/c/src/libchip/network/smc91111.c
@@ -1,3 +1,5 @@
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <errno.h>
 
diff --git a/c/src/libchip/network/sonic.c b/c/src/libchip/network/sonic.c
index d81c25130c..dc97008b8d 100644
--- a/c/src/libchip/network/sonic.c
+++ b/c/src/libchip/network/sonic.c
@@ -31,6 +31,8 @@
  *  interrupt-free transmission by Jiri, 22/03/1999.
  */
 
+#define __INSIDE_RTEMS_BSD_TCPIP_STACK__
+
 #include <rtems.h>
 #include <rtems/rtems_bsdnet.h>
 #include <libchip/sonic.h>
-- 
2.12.3



More information about the devel mailing list