Skip to content

Commit

Permalink
Allow building on OpenBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
fcambus committed May 19, 2016
1 parent 18c0111 commit 7541a88
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
24 changes: 24 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ ifeq ($(TARGETOS),netbsd)
OSD := sdl
endif

ifeq ($(TARGETOS),openbsd)
OSD := sdl
endif

ifeq ($(TARGETOS),solaris)
OSD := sdl
endif
Expand Down Expand Up @@ -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
#-------------------------------------------------
Expand Down
27 changes: 27 additions & 0 deletions scripts/toolchain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down Expand Up @@ -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++"
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 7541a88

Please sign in to comment.