From 9b02e16ce49425feb3b0b9748dba5012aade68f8 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 21 Sep 2014 16:31:49 -0700 Subject: [PATCH] ETHER: Remove support for statically linking libpcap on Linux and OS X platforms --- 0readme_ethernet.txt | 5 ++-- build_mingw.bat | 2 +- build_mingw_ether.bat | 18 +++--------- build_mingw_noasync.bat | 2 +- makefile | 63 ++++++++++++++++++++++++----------------- 5 files changed, 46 insertions(+), 44 deletions(-) diff --git a/0readme_ethernet.txt b/0readme_ethernet.txt index c4388b04..73655984 100644 --- a/0readme_ethernet.txt +++ b/0readme_ethernet.txt @@ -325,8 +325,9 @@ Building on Linux, {Free|Net|Open}BSD, OS/X, Solaris, other *nix: binaries will run on any system whether or not libpcap is installed. If you want to force direct libpcap linking during a build you do so by typing 'make USE_NETWORK=1'. You must build with gcc to do this. There - is no observable benefit to statically linking against libpcap and as - such support for this ia deprecated and will be removed in the future. + is no observable benefit to statically linking against libpcap. Support + for statically linking libpcap ia deprecated on all platforms except + Linux and OS X where it has already been removed. 4. Some platforms (HP-UX in particular) may not have vendor supplied libpcap components available and installed with the operating system. The packages diff --git a/build_mingw.bat b/build_mingw.bat index a87e8c0d..b145f403 100644 --- a/build_mingw.bat +++ b/build_mingw.bat @@ -7,7 +7,7 @@ rem run with networking support when the WinPcap environment rem is installed on the running system. rem rem Individual simulator sources are in .\simulator_name -rem Individual simulator executables are to .\bin +rem Individual simulator executables are to .\BIN rem rem If needed, define the path for the MINGW bin directory. rem (this should already be set if MINGW was installed correctly) diff --git a/build_mingw_ether.bat b/build_mingw_ether.bat index e50f29fd..5a977142 100644 --- a/build_mingw_ether.bat +++ b/build_mingw_ether.bat @@ -1,16 +1,6 @@ @echo off -rem Built in Ethernet support (requires WinPcap installed) +rem Built in Ethernet support (requires WinPcap installed). +rem The normal Windows build always builds with Ethernet support +rem so, this procedure is un-necessary. Just call the normal build rem -rem Compile all of SIMH using MINGW make and gcc environment -rem Individual simulator sources are in .\simulator_name -rem Individual simulator executables are to .\bin -rem -rem If needed, define the path for the MINGW bin directory. -rem (this should already be set if MINGW was installed correctly) -rem -gcc -v 1>NUL 2>NUL -if ERRORLEVEL 1 path C:\MinGW\bin;%path% -if not exist BIN mkdir BIN -gcc -v 1>NUL 2>NUL -if ERRORLEVEL 1 echo "MinGW Environment Unavailable" -mingw32-make WIN32=1 USE_NETWORK=1 -f makefile %* +%~p0\build_mingw.bat %* diff --git a/build_mingw_noasync.bat b/build_mingw_noasync.bat index a53eab53..bfd204b3 100644 --- a/build_mingw_noasync.bat +++ b/build_mingw_noasync.bat @@ -2,7 +2,7 @@ rem Build without SIM_ASYNCH_IO defined (avoiding the use of pthreads) rem Compile all of SIMH using MINGW make and gcc environment rem Individual simulator sources are in .\simulator_name -rem Individual simulator executables are to .\bin +rem Individual simulator executables are to .\BIN rem rem If needed, define the path for the MINGW bin directory. rem (this should already be set if MINGW was installed correctly) diff --git a/makefile b/makefile index 65533098..45176eb5 100644 --- a/makefile +++ b/makefile @@ -369,13 +369,13 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) endif endif ifeq (,$(findstring HAVE_LIBSDL,$(OS_CCDEFS))) - $(info *** Warning ***) - $(info *** Warning *** The simulator$(BUILD_MULTIPLE) you are building could provide more) - $(info *** Warning *** functionality if video support were available on your system.) - $(info *** Warning *** Install the development components of libSDL packaged by your) - $(info *** Warning *** operating system distribution and rebuild your simulator to) - $(info *** Warning *** enable this extra functionality.) - $(info *** Warning ***) + $(info *** Info ***) + $(info *** Info *** The simulator$(BUILD_MULTIPLE) you are building could provide more) + $(info *** Info *** functionality if video support were available on your system.) + $(info *** Info *** Install the development components of libSDL packaged by your) + $(info *** Info *** operating system distribution and rebuild your simulator to) + $(info *** Info *** enable this extra functionality.) + $(info *** Info ***) endif endif ifneq (,$(NETWORK_USEFUL)) @@ -393,13 +393,24 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) ifneq (,$(call find_lib,$(PCAPLIB))) ifneq ($(USE_NETWORK),) # Network support specified on the GNU make command line NETWORK_CCDEFS += -DUSE_NETWORK - $(info *** Warning ***) - $(info *** Warning *** Statically linking against libpcap is provides no measurable) - $(info *** Warning *** benefits over dynamically linking libpcap.) - $(info *** Warning ***) - $(info *** Warning *** Support for linking this way is currently deprecated and may be removed) - $(info *** Warning *** in the future.) - $(info *** Warning ***) + ifeq (,$(findstring Linux,$(OSTYPE))$(findstring Darwin,$(OSTYPE))) + $(info *** Warning ***) + $(info *** Warning *** Statically linking against libpcap is provides no measurable) + $(info *** Warning *** benefits over dynamically linking libpcap.) + $(info *** Warning ***) + $(info *** Warning *** Support for linking this way is currently deprecated and may be removed) + $(info *** Warning *** in the future.) + $(info *** Warning ***) + else + $(info *** Error ***) + $(info *** Error *** Statically linking against libpcap is provides no measurable) + $(info *** Error *** benefits over dynamically linking libpcap.) + $(info *** Error ***) + $(info *** Error *** Support for linking statically has been removed on the $(OSTYPE)) + $(info *** Error *** platform.) + $(info *** Error ***) + $(error Retry your build without specifying USE_NETWORK=1) + endif ifeq (cygwin,$(OSTYPE)) # cygwin has no ldconfig so explicitly specify pcap object library NETWORK_LDFLAGS = -L$(dir $(call find_lib,$(PCAPLIB))) -Wl,-R,$(dir $(call find_lib,$(PCAPLIB))) -l$(PCAPLIB) @@ -514,19 +525,19 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) # Support is available on Linux for libvdeplug. Advise on its usage ifneq (,$(findstring Linux,$(OSTYPE))) ifneq (,$(findstring USE_NETWORK,$(NETWORK_CCDEFS))$(findstring USE_SHARED,$(NETWORK_CCDEFS))) - $(info *** Warning ***) - $(info *** Warning *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) are being built with) - $(info *** Warning *** minimal libpcap networking support) - $(info *** Warning ***) + $(info *** Info ***) + $(info *** Info *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) are being built with) + $(info *** Info *** minimal libpcap networking support) + $(info *** Info ***) endif - $(info *** Warning *** Simulators on your $(OSNAME) platform can also be built with) - $(info *** Warning *** extended LAN Ethernet networking support by using VDE Ethernet.) - $(info *** Warning ***) - $(info *** Warning *** To build simulator(s) with extended networking support you) - $(info *** Warning *** should read 0readme_ethernet.txt and follow the instructions) - $(info *** Warning *** regarding the needed libvdeplug components for your $(OSNAME)) - $(info *** Warning *** platform) - $(info *** Warning ***) + $(info *** Info *** Simulators on your $(OSNAME) platform can also be built with) + $(info *** Info *** extended LAN Ethernet networking support by using VDE Ethernet.) + $(info *** Info ***) + $(info *** Info *** To build simulator(s) with extended networking support you) + $(info *** Info *** should read 0readme_ethernet.txt and follow the instructions) + $(info *** Info *** regarding the needed libvdeplug components for your $(OSNAME)) + $(info *** Info *** platform) + $(info *** Info ***) endif endif ifneq (,$(call find_include,linux/if_tun))