From fc37423e70527a17b6ff44919ba755b92b78789a Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Fri, 13 Nov 2015 14:24:37 +0100 Subject: [PATCH 1/3] OSD/SDL: add missing header to fix build on NetBSD. --- src/osd/sdl/sdlptty_unix.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osd/sdl/sdlptty_unix.cpp b/src/osd/sdl/sdlptty_unix.cpp index abe4ba8db0b..bd1751c15c2 100644 --- a/src/osd/sdl/sdlptty_unix.cpp +++ b/src/osd/sdl/sdlptty_unix.cpp @@ -19,6 +19,7 @@ # include # include #elif defined(SDLMAME_NETBSD) || defined(SDLMAME_MACOSX) +# include # include #elif defined(SDLMAME_OPENBSD) # include From d0c77ed333fa5e96333cd4ca49ce2e82048f8c88 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Fri, 13 Nov 2015 14:25:24 +0100 Subject: [PATCH 2/3] Remove references to non-existing files. The file was removed from the other gmake.*/genie.make files. The build/gmake.* files do not exist upstream, so this is a purely local problem. I have however filed a PR to get bsd support added upstream: https://github.com/bkaradzic/genie/pull/110 --- 3rdparty/genie/build/gmake.bsd/genie.make | 6 ------ 3rdparty/genie/build/gmake.solaris/genie.make | 6 ------ 2 files changed, 12 deletions(-) diff --git a/3rdparty/genie/build/gmake.bsd/genie.make b/3rdparty/genie/build/gmake.bsd/genie.make index 3bb61d180fb..ab3b36b4f0b 100644 --- a/3rdparty/genie/build/gmake.bsd/genie.make +++ b/3rdparty/genie/build/gmake.bsd/genie.make @@ -56,7 +56,6 @@ ifeq ($(config),release) $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_copyfile.o \ $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/os_getversion.o \ $(OBJDIR)/src/host/os_is64bit.o \ $(OBJDIR)/src/host/os_isdir.o \ $(OBJDIR)/src/host/os_isfile.o \ @@ -134,7 +133,6 @@ ifeq ($(config),debug) $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_copyfile.o \ $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/os_getversion.o \ $(OBJDIR)/src/host/os_is64bit.o \ $(OBJDIR)/src/host/os_isdir.o \ $(OBJDIR)/src/host/os_isfile.o \ @@ -252,10 +250,6 @@ $(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - $(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" diff --git a/3rdparty/genie/build/gmake.solaris/genie.make b/3rdparty/genie/build/gmake.solaris/genie.make index 3487f066b94..4bab804e010 100644 --- a/3rdparty/genie/build/gmake.solaris/genie.make +++ b/3rdparty/genie/build/gmake.solaris/genie.make @@ -56,7 +56,6 @@ ifeq ($(config),release) $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_copyfile.o \ $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/os_getversion.o \ $(OBJDIR)/src/host/os_is64bit.o \ $(OBJDIR)/src/host/os_isdir.o \ $(OBJDIR)/src/host/os_isfile.o \ @@ -134,7 +133,6 @@ ifeq ($(config),debug) $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_copyfile.o \ $(OBJDIR)/src/host/os_getcwd.o \ - $(OBJDIR)/src/host/os_getversion.o \ $(OBJDIR)/src/host/os_is64bit.o \ $(OBJDIR)/src/host/os_isdir.o \ $(OBJDIR)/src/host/os_isfile.o \ @@ -252,10 +250,6 @@ $(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - $(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" From 79fb7f477852fad15cd0343c7600cda45d9a1a54 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Fri, 13 Nov 2015 14:28:32 +0100 Subject: [PATCH 3/3] bx: add NetBSD support. I've filed a more complete patch for this upstream: https://github.com/bkaradzic/bx/pull/61 but this has been ignored since June. This patch is the minimal set to fix the build on NetBSD. --- 3rdparty/bx/include/bx/os.h | 4 +++- 3rdparty/bx/include/bx/platform.h | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/3rdparty/bx/include/bx/os.h b/3rdparty/bx/include/bx/os.h index 0adf87b55ce..9dc1a607404 100644 --- a/3rdparty/bx/include/bx/os.h +++ b/3rdparty/bx/include/bx/os.h @@ -15,6 +15,7 @@ #elif BX_PLATFORM_ANDROID \ || BX_PLATFORM_EMSCRIPTEN \ || BX_PLATFORM_FREEBSD \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ @@ -24,6 +25,7 @@ # include // sched_yield # if BX_PLATFORM_FREEBSD \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_IOS \ || BX_PLATFORM_NACL \ || BX_PLATFORM_OSX \ @@ -103,7 +105,7 @@ namespace bx return (pid_t)::syscall(SYS_gettid); #elif BX_PLATFORM_IOS || BX_PLATFORM_OSX return (mach_port_t)::pthread_mach_thread_np(pthread_self() ); -#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL +#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD // Casting __nc_basic_thread_data*... need better way to do this. return *(uint32_t*)::pthread_self(); #else diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h index 8de637b96ef..c25febcd13f 100644 --- a/3rdparty/bx/include/bx/platform.h +++ b/3rdparty/bx/include/bx/platform.h @@ -15,6 +15,7 @@ #define BX_PLATFORM_ANDROID 0 #define BX_PLATFORM_EMSCRIPTEN 0 #define BX_PLATFORM_FREEBSD 0 +#define BX_PLATFORM_NETBSD 0 #define BX_PLATFORM_IOS 0 #define BX_PLATFORM_LINUX 0 #define BX_PLATFORM_NACL 0 @@ -187,6 +188,9 @@ #elif defined(__FreeBSD__) # undef BX_PLATFORM_FREEBSD # define BX_PLATFORM_FREEBSD 1 +#elif defined(__NetBSD__) +# undef BX_PLATFORM_NETBSD +# define BX_PLATFORM_NETBSD 1 #else # error "BX_PLATFORM_* is not defined!" #endif // @@ -195,6 +199,7 @@ || BX_PLATFORM_ANDROID \ || BX_PLATFORM_EMSCRIPTEN \ || BX_PLATFORM_FREEBSD \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ @@ -244,6 +249,8 @@ BX_STRINGIZE(__EMSCRIPTEN_tiny__) #elif BX_PLATFORM_FREEBSD # define BX_PLATFORM_NAME "FreeBSD" +#elif BX_PLATFORM_NETBSD +# define BX_PLATFORM_NAME "NetBSD" #elif BX_PLATFORM_IOS # define BX_PLATFORM_NAME "iOS" #elif BX_PLATFORM_LINUX