[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#830974: mame: FTBFS[kfreebsd-*]: multiple issues



Package: mame
Version: 0.175-1
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd
Forwarded: https://github.com/mamedev/mame/pull/1093

Hi,

mame currently FTBFS on kfreebsd-* with:
| ../../../../../3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_draw.cpp:439:100: error: 'alloca' was not declared in this scope
https://buildd.debian.org/status/fetch.php?pkg=mame&arch=kfreebsd-amd64&ver=0.175-1&stamp=1468325637

There are many other small issues later in the build.

Please find patches in the attached kfreebsd.patch or upstream pull
request at 

Please avoid building a bundled libuv if possible, as it has portability
bugs that are fixed in the Debian-packaged libuv.  (see attached
use_system_lib_uv.patch)

And please consider showing the compile and link command lines in the
build output.  debian/rules does already set VERBOSE=1, but it seems that
should rather be verbose=1 (attached verbose_build_log.patch)

Thanks!

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 10.1-0-amd64
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
diff --git a/3rdparty/bx/include/bx/thread.h b/3rdparty/bx/include/bx/thread.h
index add66ab..9e105db 100644
--- a/3rdparty/bx/include/bx/thread.h
+++ b/3rdparty/bx/include/bx/thread.h
@@ -8,7 +8,7 @@
 
 #if BX_PLATFORM_POSIX
 #	include <pthread.h>
-#	if BX_PLATFORM_BSD
+#	if defined(BX_PLATFORM_BSD) && !defined(__GLIBC__)
 #		include <pthread_np.h>
 #	endif
 #	if defined(__GLIBC__) && !( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12) ) )
@@ -157,12 +157,10 @@ namespace bx
 		{
 #if BX_PLATFORM_OSX || BX_PLATFORM_IOS
 			pthread_setname_np(_name);
-#elif BX_PLATFORM_LINUX
-#	if defined(__GLIBC__) && (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12) )
+#elif defined(__GLIBC__) && (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12) )
 			pthread_setname_np(m_handle, _name);
-#	else
+#elif BX_PLATFORM_LINUX
 			prctl(PR_SET_NAME,_name, 0, 0, 0);
-#	endif // defined(__GLIBC__) ...
 #elif BX_PLATFORM_BSD
 #ifdef __NetBSD__
 			pthread_setname_np(m_handle, "%s", (void *)_name);
diff --git a/3rdparty/bx/include/compat/freebsd/alloca.h b/3rdparty/bx/include/compat/freebsd/alloca.h
index c8b49f2..12a69ea 100644
--- a/3rdparty/bx/include/compat/freebsd/alloca.h
+++ b/3rdparty/bx/include/compat/freebsd/alloca.h
@@ -1 +1,5 @@
+#ifdef __GLIBC__
+#include_next <alloca.h>
+#else
 #include <stdlib.h>
+#endif
diff --git a/3rdparty/bx/include/compat/freebsd/signal.h b/3rdparty/bx/include/compat/freebsd/signal.h
index fd7d90f..3040b56 100644
--- a/3rdparty/bx/include/compat/freebsd/signal.h
+++ b/3rdparty/bx/include/compat/freebsd/signal.h
@@ -1 +1,5 @@
+#ifdef __GLIBC__
+#include_next <signal.h>
+#else
 #include <sys/signal.h>
+#endif
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index 4094e48..ce45034 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -340,7 +340,7 @@ project ("qtdbg_" .. _OPTIONS["osd"])
 		MAME_DIR .. "src/osd/modules/render",
 		MAME_DIR .. "3rdparty",
 	}
-	configuration { "linux-*" }
+	configuration { "linux-* or freebsd" }
 		buildoptions {
 			"-fPIC",
 		}
diff --git a/src/osd/modules/file/posixptty.cpp b/src/osd/modules/file/posixptty.cpp
index 164c2fc..3eab9e4 100644
--- a/src/osd/modules/file/posixptty.cpp
+++ b/src/osd/modules/file/posixptty.cpp
@@ -19,7 +19,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 #include <termios.h>
 #include <libutil.h>
 #elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__ANDROID__)
diff -Nru a/mame-0.175/debian/control b/mame-0.175/debian/control
--- a/mame-0.175/debian/control	2016-07-05 10:07:37.000000000 +0100
+++ b/mame-0.175/debian/control	2016-07-13 13:23:26.128012799 +0100
@@ -15,6 +15,7 @@
  libsdl2-ttf-dev,
  libsdl2-dev,
  libsqlite3-dev,
+ libuv1-dev,
  libxinerama-dev,
  portaudio19-dev,
  python-dev,
diff -Nru a/mame-0.175/debian/rules b/mame-0.175/debian/rules
--- a/mame-0.175/debian/rules	2016-07-05 17:12:42.000000000 +0100
+++ b/mame-0.175/debian/rules	2016-07-13 13:11:55.683060773 +0100
@@ -45,7 +45,8 @@
     USE_SYSTEM_LIB_LUA=lua5.3:/usr/include/lua5.3 \
     USE_SYSTEM_LIB_SQLITE3=1 \
     USE_SYSTEM_LIB_PORTMIDI=1 \
-    USE_SYSTEM_LIB_PORTAUDIO=1
+    USE_SYSTEM_LIB_PORTAUDIO=1 \
+    USE_SYSTEM_LIB_UV=1
 
 # Override make variables for specific archs
 # Linux architectures
diff -Nru a/mame-0.175/debian/rules b/mame-0.175/debian/rules
--- a/mame-0.175/debian/rules	2016-07-05 17:12:42.000000000 +0100
+++ b/mame-0.175/debian/rules	2016-07-13 13:11:55.683060773 +0100
@@ -153,7 +154,7 @@
 
 # Enable full building log when verbose output required
 ifdef DH_VERBOSE
-DEB_OPTS += VERBOSE=1
+DEB_OPTS += verbose=1
 endif
 
 DEB_MAME_OPTS = \

Reply to: