From 7541a888dc493d8e50e3b8a2856fe07f57d515a1 Mon Sep 17 00:00:00 2001 From: Frederic Cambus Date: Thu, 19 May 2016 23:11:43 +0200 Subject: [PATCH] Allow building on OpenBSD --- makefile | 24 ++++++++++++++++++++++++ scripts/toolchain.lua | 27 +++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/makefile b/makefile index 726d734285a..c5c83c41b86 100644 --- a/makefile +++ b/makefile @@ -366,6 +366,10 @@ ifeq ($(TARGETOS),netbsd) OSD := sdl endif +ifeq ($(TARGETOS),openbsd) +OSD := sdl +endif + ifeq ($(TARGETOS),solaris) OSD := sdl endif @@ -1329,6 +1333,26 @@ netbsd_x86: generate $(PROJECTDIR)/gmake-netbsd/Makefile $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-netbsd config=$(CONFIG)32 precompile $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-netbsd config=$(CONFIG)32 +#------------------------------------------------- +# gmake-openbsd +#------------------------------------------------- + +$(PROJECTDIR)/gmake-openbsd/Makefile: makefile $(SCRIPTS) $(GENIE) + $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=openbsd --gcc_version=$(GCC_VERSION) gmake + +.PHONY: openbsd_x64 +openbsd_x64: generate $(PROJECTDIR)/gmake-openbsd/Makefile + $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-openbsd config=$(CONFIG)64 precompile + $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-openbsd config=$(CONFIG)64 + +.PHONY: openbsd +openbsd: openbsd_x86 + +.PHONY: openbsd_x86 +openbsd_x86: generate $(PROJECTDIR)/gmake-openbsd/Makefile + $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-openbsd config=$(CONFIG)32 precompile + $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-openbsd config=$(CONFIG)32 + #------------------------------------------------- # gmake-steamlink #------------------------------------------------- diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 2a5490fab06..e717102f44e 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -31,6 +31,7 @@ newoption { { "mingw64-gcc", "MinGW64" }, { "mingw-clang", "MinGW (clang compiler)" }, { "netbsd", "NetBSD" }, + { "openbsd", "OpenBSD" }, { "osx", "OSX (GCC compiler)" }, { "osx-clang", "OSX (Clang compiler)" }, { "pnacl", "Native Client - PNaCl" }, @@ -211,6 +212,10 @@ function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-netbsd") end + if "openbsd" == _OPTIONS["gcc"] then + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-openbsd") + end + if "ios-arm" == _OPTIONS["gcc"] then premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" @@ -785,6 +790,28 @@ function toolchain(_buildDir, _subDir) configuration { "netbsd", "x64", "Debug" } targetdir (_buildDir .. "netbsd" .. "/bin/x64/Debug") + configuration { "openbsd", "x32" } + objdir (_buildDir .. "openbsd" .. "/obj") + buildoptions { + "-m32", + } + configuration { "openbsd", "x32", "Release" } + targetdir (_buildDir .. "openbsd" .. "/bin/x32/Release") + + configuration { "openbsd", "x32", "Debug" } + targetdir (_buildDir .. "openbsd" .. "/bin/x32/Debug") + + configuration { "openbsd", "x64" } + objdir (_buildDir .. "openbsd" .. "/obj") + buildoptions { + "-m64", + } + configuration { "openbsd", "x64", "Release" } + targetdir (_buildDir .. "openbsd" .. "/bin/x64/Release") + + configuration { "openbsd", "x64", "Debug" } + targetdir (_buildDir .. "openbsd" .. "/bin/x64/Debug") + configuration { "android-*" } includedirs { MAME_DIR .. "3rdparty/bgfx/3rdparty/khronos",