Hey guys, I'm trying to build dosbox from the latest source and adding the ne2000 patch (http://sourceforge.net/p/dosbox/patches/238/). I'm trying to use mingw and gcc/g++ 4.8.1.
Building the sdl-1.2.15 and sdl_net-1.2.8 was just fine, and I applied the patch to the source (seemingly) without issue (when I build the source, it has a section that looks for pcap.h and such):
1checking pcap.h usability... no 2checking pcap.h presence... no 3checking for pcap.h... no 4checking for pcap_open_live in -lpcap... no 5configure: WARNING: Can't find libpcap, NE2000 ethernet passthrough disabled
However, I'm a little lost as to whether I should build libpcap, or winpcap, or both so that I can include the necessary files. Most of what I looked up implied I should build winpcap (since I'm on windows), however when I attempt to build it, I get the error message:
1. download winpcap from here: http://www.winpcap.org
2. move *.a files to /usr/lib/ and *.h files to /usr/include/pcap/
3. copy packet.dll, pthreadvc.dll, wanpacket.dll, wpcap.dll to /usr/bin (extract these files from binary install files; perhaps UniExtract will perform extraction)
4. Edit dosbox/configure.ac so the pcap function appears like this (mainly editing pcap to wpcap on some lines):
1--- configure.ac 2014-01-29 07:10:04 -0500 2+++ configure2.ac 2014-01-16 01:37:03 -0500 3@@ -351,6 +351,16 @@ else 4 AC_MSG_WARN([Can't find libpng, screenshot support disabled]) 5 fi 6 7+AH_TEMPLATE(C_NE2000,[Define to 1 to enable NE2000 ethernet passthrough, requires libwpcap]) 8+AC_CHECK_HEADER(pcap.h,have_pcap_h=yes,) 9+AC_CHECK_LIB(wpcap, pcap_open_live, have_wpcap_lib=yes, ,) 10+if test x$have_wpcap_lib = xyes -a x$have_pcap_h = xyes ; then 11+ LIBS="$LIBS -lwpcap"; 12+ AC_DEFINE(C_NE2000,1) 13+else 14+ AC_MSG_WARN([Can't find libwpcap, NE2000 ethernet passthrough disabled]) 15+fi 16+ 17 AH_TEMPLATE(C_MODEM,[Define to 1 to enable internal modem support, requires SDL_net]) 18 AH_TEMPLATE(C_IPX,[Define to 1 to enable IPX over Internet networking, requires SDL_net]) 19 AC_CHECK_HEADER(SDL_net.h,have_sdl_net_h=yes,)
5. add flag to configure commandline: CPPFLAGS="-I/usr/include/pcap"
note: /usr/ directory is typically /MinGW/msys/1.0/ (or c:\MinGW\msys\1.0\); I haven't tried moving the files to /mingw/ instead. Also, if there is a linker error in misc_util.cpp, missing getsockname function, then report back for a solution.
truth5678 wrote:1. download winpcap from here: http://www.winpcap.org
2. move *.a files to /usr/lib/ and *.h files to /usr/include/pcap/
3. copy […] Show full quote
1. download winpcap from here: http://www.winpcap.org
2. move *.a files to /usr/lib/ and *.h files to /usr/include/pcap/
3. copy packet.dll, pthreadvc.dll, wanpacket.dll, wpcap.dll to /usr/bin (extract these files from binary install files; perhaps UniExtract will perform extraction)
4. Edit dosbox/configure.ac so the pcap function appears like this (mainly editing pcap to wpcap on some lines):
1--- configure.ac 2014-01-29 07:10:04 -0500 2+++ configure2.ac 2014-01-16 01:37:03 -0500 3@@ -351,6 +351,16 @@ else 4 AC_MSG_WARN([Can't find libpng, screenshot support disabled]) 5 fi 6 7+AH_TEMPLATE(C_NE2000,[Define to 1 to enable NE2000 ethernet passthrough, requires libwpcap]) 8+AC_CHECK_HEADER(pcap.h,have_pcap_h=yes,) 9+AC_CHECK_LIB(wpcap, pcap_open_live, have_wpcap_lib=yes, ,) 10+if test x$have_wpcap_lib = xyes -a x$have_pcap_h = xyes ; then 11+ LIBS="$LIBS -lwpcap"; 12+ AC_DEFINE(C_NE2000,1) 13+else 14+ AC_MSG_WARN([Can't find libwpcap, NE2000 ethernet passthrough disabled]) 15+fi 16+ 17 AH_TEMPLATE(C_MODEM,[Define to 1 to enable internal modem support, requires SDL_net]) 18 AH_TEMPLATE(C_IPX,[Define to 1 to enable IPX over Internet networking, requires SDL_net]) 19 AC_CHECK_HEADER(SDL_net.h,have_sdl_net_h=yes,)
5. add flag to configure commandline: CPPFLAGS="-I/usr/include/pcap"
note: /usr/ directory is typically /MinGW/msys/1.0/ (or c:\MinGW\msys\1.0\); I haven't tried moving the files to /mingw/ instead. Also, if there is a linker error in misc_util.cpp, missing getsockname function, then report back for a solution.
Thanks! Couple of questions, though, if I may
Am I grabbing the source, or the developer's pack, or something else entirely?
Is it any and all .h and .a file in either of these packages? Or files from a specific location? (I'm not seeing any .a files in the source, I'll comb through the developer's pack though)
Can I grab the packet.dll, pthreadvc.dll, wanpacket.dll, and wpcap.dll from my install of Winpcap (C:\Windows\SysWOW64)? Or do I need to extract them from the binary itself?
The files should be in the developer's pack and the regular installation package; it's been a while since I checked. However, you shouldn't need source to compile.
Compile a 32-bit dosbox binary and use 32-bit pcap binaries.
Leave out the -lz parameter for initial testing. Once it compiles, then you could experiment with adding back the zlib library.
The files should be in the developer's pack and the regular installation package; it's been a while since I checked. However, you shouldn't need source to compile.
Compile a 32-bit dosbox binary and use 32-bit pcap binaries.
Leave out the -lz parameter for initial testing. Once it compiles, then you could experiment with adding back the zlib library.
Hmm...I'm guessing I placed a file wrong, or some include statement should be changed to wpcap instead of pcap. Here's my configure result:
1checking pcap.h usability... no 2checking pcap.h presence... yes 3configure: WARNING: pcap.h: present but cannot be compiled 4configure: WARNING: pcap.h: check for missing prerequisite headers? 5configure: WARNING: pcap.h: see the Autoconf documentation 6configure: WARNING: pcap.h: section "Present But Cannot Be Compiled" 7configure: WARNING: pcap.h: proceeding with the compiler's result 8checking for pcap.h... no 9checking for pcap_open_live in -lwpcap... no 10configure: WARNING: Can't find libwpcap, NE2000 ethernet passthrough disabled
Ensure you run ./autogen.sh after patching dosbox, then run the ./configure line. I use winpcap 4.0.1, perhaps find this version if the problem persists. I have some recollection of trying different versions until one worked. Also, list the true directory name of /usr/include and /usr/lib and which pcap files were copied to which directory. And show the configure line.
truth5678 wrote:Ensure you run ./autogen.sh after patching dosbox, then run the ./configure line. I use winpcap 4.0.1, perhaps find this versio […] Show full quote
Ensure you run ./autogen.sh after patching dosbox, then run the ./configure line. I use winpcap 4.0.1, perhaps find this version if the problem persists. I have some recollection of trying different versions until one worked. Also, list the true directory name of /usr/include and /usr/lib and which pcap files were copied to which directory. And show the configure line.
Cool, thanks. Ok, so, I opened and extracted the .dlls from the zip (using 7zip).
Step 1 - I moved lipwpcap.a and libpacket.a (from WpdPack\Lib) to C:\mingw\lib, C:\mingw\mingw32\lib, and C:\mingw\msys\1.0\lib
Step 2 - I moved everything from WpdPack\include (all the .h files) to C:\mingw\include\pcap, C:\mingw\mingw32\include\pcap, and C:\msys\1.0\include\pcap
Step 3 - I moved the packet.dll, pthreadvc.dll, wanpacket.dll, wpcap.dll to C:\mingw\bin, C:\mingw\mingw32\bin, and C:\msys\1.0\bin
Step 4 - Ran ./autogen.sh
1$ ./autogen.sh 2Generating build information using aclocal, autoheader, automake and autoconf 3This may take a while ... 4Now you are ready to run ./configure. 5You can also run ./configure --help for extra features to enable/disable.
Step 5 - Ran ./configure
1$ ./configure 2checking build system type... i686-pc-mingw32 3checking host system type... i686-pc-mingw32 4checking for a BSD-compatible install... /bin/install -c 5checking whether build environment is sane... yes 6checking for a thread-safe mkdir -p... /bin/mkdir -p 7checking for gawk... gawk 8checking whether make sets $(MAKE)... yes 9checking whether make sets $(MAKE)... (cached) yes 10checking for gcc... gcc 11checking whether the C compiler works... yes 12checking for C compiler default output file name... a.exe 13checking for suffix of executables... .exe 14checking whether we are cross compiling... no 15checking for suffix of object files... o 16checking whether we are using the GNU C compiler... yes 17checking whether gcc accepts -g... yes 18checking for gcc option to accept ISO C89... none needed 19checking for style of include used by make... GNU 20checking dependency style of gcc... gcc3 21checking how to run the C preprocessor... gcc -E 22checking for g++... g++ 23checking whether we are using the GNU C++ compiler... yes 24checking whether g++ accepts -g... yes 25checking dependency style of g++... gcc3 26checking for ranlib... ranlib 27checking for sdl-config... /usr/local/bin/sdl-config 28checking for SDL - version >= 1.2.0... yes 29checking SDL version only being 1.2.X... yes 30checking for an ANSI C-conforming const... yes 31checking for inline... inline 32checking for grep that handles long lines and -e... /bin/grep 33checking for egrep... /bin/grep -E 34checking for ANSI C header files... yes 35checking for sys/types.h... yes 36checking for sys/stat.h... yes 37checking for stdlib.h... yes 38checking for string.h... yes 39checking for memory.h... yes 40checking for strings.h... yes 41checking for inttypes.h... yes 42checking for stdint.h... yes 43checking for unistd.h... yes 44checking for size_t... yes 45checking whether struct tm is in sys/time.h or time.h... time.h 46checking size of unsigned char... 1 47checking size of unsigned short... 2 48checking size of unsigned int... 4 49checking size of unsigned long... 4 50checking size of unsigned long long... 8 51checking size of int *... 4 52checking for stdlib.h... (cached) yes 53checking for sys/types.h... (cached) yes 54checking for sys/socket.h... no 55checking for netinet/in.h... no 56checking for pwd.h... no 57checking if environ can be included... yes 58checking if environ can be linked... yes 59checking if dirent includes d_type... no 60checking for powf in libm... yes
…Show last 82 lines
61checking if compiler allows __attribute__... yes 62checking if compiler allows __attribute__((always_inline)) ... yes 63checking if compiler allows __attribute__((fastcall)) ... yes 64checking if compiler allows __builtin_expect... yes 65checking for ALSA CFLAGS... 66checking for ALSA LDFLAGS... -lasound -lm -ldl -lpthread 67checking for libasound headers version >= 0.9.0... not present. 68checking for snd_ctl_open in -lasound... no 69checking whether byte ordering is bigendian... no 70checking for target cpu type... x86 compatible 71checking whether x86 dynamic cpu core will be enabled... yes 72checking whether recompiling cpu core will be enabled... no, using dynamic-x86 73checking whether fpu emulation will be enabled... yes 74checking whether x86 assembly fpu core will be enabled... yes 75checking whether to enable unaligned memory access... yes 76checking png.h usability... no 77checking png.h presence... no 78checking for png.h... no 79checking for png_get_io_ptr in -lpng... no 80configure: WARNING: Can't find libpng, screenshot support disabled 81checking pcap.h usability... no 82checking pcap.h presence... no 83checking for pcap.h... no 84checking for pcap_open_live in -lwpcap... yes 85configure: WARNING: Can't find libwpcap, NE2000 ethernet passthrough disabled 86checking SDL_net.h usability... yes 87checking SDL_net.h presence... yes 88checking for SDL_net.h... yes 89checking for SDLNet_Init in -lSDL_net... yes 90checking for main in -lX11... no 91checking X11/XKBlib.h usability... no 92checking X11/XKBlib.h presence... no 93checking for X11/XKBlib.h... no 94checking for XKBlib support... no 95checking for main in -lGL... no 96checking for main in -lopengl32... yes 97checking GL/gl.h usability... yes 98checking GL/gl.h presence... yes 99checking for GL/gl.h... yes 100checking whether opengl display output will be enabled... yes 101checking SDL_sound.h usability... no 102checking SDL_sound.h presence... no 103checking for SDL_sound.h... no 104checking for Sound_Init in -lSDL_sound... no 105checking for Sound_Seek in -lSDL_sound... no 106configure: WARNING: Can't find libSDL_sound, libSDL_sound support disabled 107checking sys/mman.h usability... no 108checking sys/mman.h presence... no 109checking for sys/mman.h... no 110checking for setpriority support... no 111checking ddraw.h usability... no 112checking ddraw.h presence... no 113checking for ddraw.h... no 114checking for windres... windres 115configure: creating ./config.status 116config.status: creating Makefile 117config.status: creating src/Makefile 118config.status: creating src/cpu/Makefile 119config.status: creating src/cpu/core_full/Makefile 120config.status: creating src/cpu/core_normal/Makefile 121config.status: creating src/cpu/core_dyn_x86/Makefile 122config.status: creating src/cpu/core_dynrec/Makefile 123config.status: creating src/debug/Makefile 124config.status: creating src/dos/Makefile 125config.status: creating src/fpu/Makefile 126config.status: creating src/gui/Makefile 127config.status: creating src/hardware/Makefile 128config.status: creating src/hardware/serialport/Makefile 129config.status: creating src/ints/Makefile 130config.status: creating src/libs/Makefile 131config.status: creating src/libs/zmbv/Makefile 132config.status: creating src/libs/gui_tk/Makefile 133config.status: creating src/misc/Makefile 134config.status: creating src/shell/Makefile 135config.status: creating src/platform/Makefile 136config.status: creating src/platform/visualc/Makefile 137config.status: creating visualc_net/Makefile 138config.status: creating include/Makefile 139config.status: creating docs/Makefile 140config.status: creating config.h 141config.status: config.h is unchanged 142config.status: executing depfiles commands
Interesting, now it's not seeing the pcap.h. Hmm...maybe I should add the .h files to the /include folders as well as /include/pcap?
Well, I tried that, and it is visible again, but it's not able to compile it.
1$ ./configure 2checking build system type... i686-pc-mingw32 3checking host system type... i686-pc-mingw32 4checking for a BSD-compatible install... /bin/install -c 5checking whether build environment is sane... yes 6checking for a thread-safe mkdir -p... /bin/mkdir -p 7checking for gawk... gawk 8checking whether make sets $(MAKE)... yes 9checking whether make sets $(MAKE)... (cached) yes 10checking for gcc... gcc 11checking whether the C compiler works... yes 12checking for C compiler default output file name... a.exe 13checking for suffix of executables... .exe 14checking whether we are cross compiling... no 15checking for suffix of object files... o 16checking whether we are using the GNU C compiler... yes 17checking whether gcc accepts -g... yes 18checking for gcc option to accept ISO C89... none needed 19checking for style of include used by make... GNU 20checking dependency style of gcc... gcc3 21checking how to run the C preprocessor... gcc -E 22checking for g++... g++ 23checking whether we are using the GNU C++ compiler... yes 24checking whether g++ accepts -g... yes 25checking dependency style of g++... gcc3 26checking for ranlib... ranlib 27checking for sdl-config... /usr/local/bin/sdl-config 28checking for SDL - version >= 1.2.0... yes 29checking SDL version only being 1.2.X... yes 30checking for an ANSI C-conforming const... yes 31checking for inline... inline 32checking for grep that handles long lines and -e... /bin/grep 33checking for egrep... /bin/grep -E 34checking for ANSI C header files... yes 35checking for sys/types.h... yes 36checking for sys/stat.h... yes 37checking for stdlib.h... yes 38checking for string.h... yes 39checking for memory.h... yes 40checking for strings.h... yes 41checking for inttypes.h... yes 42checking for stdint.h... yes 43checking for unistd.h... yes 44checking for size_t... yes 45checking whether struct tm is in sys/time.h or time.h... time.h 46checking size of unsigned char... 1 47checking size of unsigned short... 2 48checking size of unsigned int... 4 49checking size of unsigned long... 4 50checking size of unsigned long long... 8 51checking size of int *... 4 52checking for stdlib.h... (cached) yes 53checking for sys/types.h... (cached) yes 54checking for sys/socket.h... no 55checking for netinet/in.h... no 56checking for pwd.h... no 57checking if environ can be included... yes 58checking if environ can be linked... yes 59checking if dirent includes d_type... no 60checking for powf in libm... yes
…Show last 87 lines
61checking if compiler allows __attribute__... yes 62checking if compiler allows __attribute__((always_inline)) ... yes 63checking if compiler allows __attribute__((fastcall)) ... yes 64checking if compiler allows __builtin_expect... yes 65checking for ALSA CFLAGS... 66checking for ALSA LDFLAGS... -lasound -lm -ldl -lpthread 67checking for libasound headers version >= 0.9.0... not present. 68checking for snd_ctl_open in -lasound... no 69checking whether byte ordering is bigendian... no 70checking for target cpu type... x86 compatible 71checking whether x86 dynamic cpu core will be enabled... yes 72checking whether recompiling cpu core will be enabled... no, using dynamic-x86 73checking whether fpu emulation will be enabled... yes 74checking whether x86 assembly fpu core will be enabled... yes 75checking whether to enable unaligned memory access... yes 76checking png.h usability... no 77checking png.h presence... no 78checking for png.h... no 79checking for png_get_io_ptr in -lpng... no 80configure: WARNING: Can't find libpng, screenshot support disabled 81checking pcap.h usability... no 82checking pcap.h presence... yes 83configure: WARNING: pcap.h: present but cannot be compiled 84configure: WARNING: pcap.h: check for missing prerequisite headers? 85configure: WARNING: pcap.h: see the Autoconf documentation 86configure: WARNING: pcap.h: section "Present But Cannot Be Compiled" 87configure: WARNING: pcap.h: proceeding with the compiler's result 88checking for pcap.h... no 89checking for pcap_open_live in -lwpcap... yes 90configure: WARNING: Can't find libwpcap, NE2000 ethernet passthrough disabled 91checking SDL_net.h usability... yes 92checking SDL_net.h presence... yes 93checking for SDL_net.h... yes 94checking for SDLNet_Init in -lSDL_net... yes 95checking for main in -lX11... no 96checking X11/XKBlib.h usability... no 97checking X11/XKBlib.h presence... no 98checking for X11/XKBlib.h... no 99checking for XKBlib support... no 100checking for main in -lGL... no 101checking for main in -lopengl32... yes 102checking GL/gl.h usability... yes 103checking GL/gl.h presence... yes 104checking for GL/gl.h... yes 105checking whether opengl display output will be enabled... yes 106checking SDL_sound.h usability... no 107checking SDL_sound.h presence... no 108checking for SDL_sound.h... no 109checking for Sound_Init in -lSDL_sound... no 110checking for Sound_Seek in -lSDL_sound... no 111configure: WARNING: Can't find libSDL_sound, libSDL_sound support disabled 112checking sys/mman.h usability... no 113checking sys/mman.h presence... no 114checking for sys/mman.h... no 115checking for setpriority support... no 116checking ddraw.h usability... no 117checking ddraw.h presence... no 118checking for ddraw.h... no 119checking for windres... windres 120configure: creating ./config.status 121config.status: creating Makefile 122config.status: creating src/Makefile 123config.status: creating src/cpu/Makefile 124config.status: creating src/cpu/core_full/Makefile 125config.status: creating src/cpu/core_normal/Makefile 126config.status: creating src/cpu/core_dyn_x86/Makefile 127config.status: creating src/cpu/core_dynrec/Makefile 128config.status: creating src/debug/Makefile 129config.status: creating src/dos/Makefile 130config.status: creating src/fpu/Makefile 131config.status: creating src/gui/Makefile 132config.status: creating src/hardware/Makefile 133config.status: creating src/hardware/serialport/Makefile 134config.status: creating src/ints/Makefile 135config.status: creating src/libs/Makefile 136config.status: creating src/libs/zmbv/Makefile 137config.status: creating src/libs/gui_tk/Makefile 138config.status: creating src/misc/Makefile 139config.status: creating src/shell/Makefile 140config.status: creating src/platform/Makefile 141config.status: creating src/platform/visualc/Makefile 142config.status: creating visualc_net/Makefile 143config.status: creating include/Makefile 144config.status: creating docs/Makefile 145config.status: creating config.h 146config.status: config.h is unchanged 147config.status: executing depfiles commands
I'm pretty sure everything is looking in the root of C:\mingw (either \include, \bin, or \lib) for files. But, I'm also getting the feeling that something is being pointed wrong somewhere with pcap.h, hence why it is present but not usable. I'll start searching through some of the files and see what I can dig up
Hmmm...here's something interesting. Checking out the config.log, looks like it might be trying to grab something incorrectly from SDL? There seems to be a lot of errors around that section, at least.
There is a guide for the novice to compile dosbox. Please see the link in my signature.
Thanks! While I appreciate the resource, I'm pretty sure the issue is narrowed down to how I'm adding the headers to mingw. Dosbox itself, the SDL net and SDL libraries are going in no problem, and the build runs. I'm just botching the libraries the ne2000 patch is looking for.
Some of your load scripts looked interesting though, so I'll definitely take a look if and when I get the ne2000 built successfuly.
I would follow my mingw guide. First, your gcc version is reported as 4.5.2 in your config.log, yet you are expecting 4.8.1. Your msys/ directory is reported in two separate locations in your post above. Also, your ./configure commandline has no parameters although parameters are necessary in this case. The configure commandline is listed in the guide along with another parameter value suggested in a post above.
These are the minor infractions I have found at a glance. If you follow the guide and go step by step, then it will be easier to trace any errors.
I would follow my mingw guide. First, your gcc version is reported as 4.5.2 in your config.log, yet you are expecting 4.8.1. Your msys/ directory is reported in two separate locations in your post above. Also, your ./configure commandline has no parameters although parameters are necessary in this case. The configure commandline is listed in the guide along with another parameter value suggested in a post above.
These are the minor infractions I have found at a glance. If you follow the guide and go step by step, then it will be easier to trace any errors.
Oh, right, forgot to mention that. From what I read on the wiki (and it was the case when I first built dosbox vanilla), 4.8.1, and even 4.7 versions, kinda screw up the mount command. So ever time I go to build dosbox itself, I revert to gcc 4.5.2-1. (I also double check to include my .dll's, .h's, and .a's that get wiped by doing this).
I'll try building again from your guide, see where it lands me though. Thanks!
Is sourceforge ftp having issues today? I'm trying to run the mingw-get-setup.exe for a fresh install and it's been crashing on trying to get almost any file. This is even on fresh virtual machines I set up with nothing to them, xp or 7, 32 and 64 bit.