libretro / desmume

DeSmuME is a Nintendo DS emulator
http://desmume.org
GNU General Public License v2.0
35 stars 33 forks source link

Build fails with libpcap-1.8.1 #58

Closed orbea closed 4 years ago

orbea commented 5 years ago

When building the libretro core with libpcap-1.8.1 in Slackware 14.2 I recieve this build error.

In file included from /usr/include/pcap.h:43:0,
                 from ../../wifi.cpp:73:
/usr/include/pcap/pcap.h:531:26: fatal error: remote-ext.h: No such file or directory
compilation terminated.
g++ -DGIT_VERSION=\"b9b515f\" -DHAVE_OPENGL -std=gnu++11 -DHAVE_JIT -O3 -DNDEBUG -D__LIBRETRO__ -fPIC  -I../../libretro-common/include -I../.. -I../../libretro   -fpermissive -c -o../../NDSSystem.o ../../NDSSystem.cpp
Makefile.libretro:581: recipe for target '../../wifi.o' failed
make: *** [../../wifi.o] Error 1

From the relevant code in /usr/include/pcap/pcap.h.

#ifdef HAVE_REMOTE
  /* Includes most of the public stuff that is needed for the remote capture */
  #include <remote-ext.h>
#endif   /* HAVE_REMOTE */

And this diff in desmume gets me past it, but maybe there is a better way?

diff --git a/desmume/src/wifi.cpp b/desmume/src/wifi.cpp
index 63bf44bb4..dba487873 100755
--- a/desmume/src/wifi.cpp
+++ b/desmume/src/wifi.cpp
@@ -59,7 +59,7 @@

 // Some platforms need HAVE_REMOTE to work with libpcap, but
 // Apple platforms are not among them.
-#ifndef __APPLE__
+#if !defined( __APPLE__) && !defined(__LIBRETRO__)
        #define HAVE_REMOTE
 #endif

This is not a problem in Slackware current with libpcap-1.9.0.

orbea commented 5 years ago

@bearoso Would you be willing to help with this issue? Its a blocker for updating the libretro core for Slackware. I can't confirm if this issue affects standalone or not since the compiler for Slackware 14.2 is too old (gcc-5.5.0).

bearoso commented 5 years ago

I think patching with that change in the package build is the best you can do. Makefiles don't have the ability to check library version, but we don't want to disable that part of the wifi functions on other platforms.

orbea commented 5 years ago

Thanks for the feedback, I guess I'll do that until the next Slackware release although it would be preferable to fix this in the repo if possible.