mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-03 15:01:28 +00:00
Merge remote-tracking branch 'origin/public_next' into 2214
This commit is contained in:
commit
3ffbc2bb9c
6 changed files with 91 additions and 7 deletions
|
@ -172,6 +172,11 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku")
|
||||||
|
target_compile_definitions(SRB2SDL2 PRIVATE -DNOEXECINFO)
|
||||||
|
target_link_libraries(SRB2SDL2 PRIVATE network)
|
||||||
|
endif()
|
||||||
|
|
||||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
|
if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
|
||||||
target_compile_definitions(SRB2SDL2 PRIVATE -DMACOSX)
|
target_compile_definitions(SRB2SDL2 PRIVATE -DMACOSX)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
# Previously featured:\
|
# Previously featured:\
|
||||||
PANDORA\
|
PANDORA\
|
||||||
HAIKU\
|
|
||||||
DUMMY\
|
DUMMY\
|
||||||
DJGPPDOS\
|
DJGPPDOS\
|
||||||
SOLARIS\
|
SOLARIS\
|
||||||
|
@ -17,6 +16,7 @@ all_systems:=\
|
||||||
UNIX\
|
UNIX\
|
||||||
LINUX\
|
LINUX\
|
||||||
FREEBSD\
|
FREEBSD\
|
||||||
|
HAIKU\
|
||||||
|
|
||||||
# check for user specified system
|
# check for user specified system
|
||||||
ifeq (,$(filter $(all_systems),$(.VARIABLES)))
|
ifeq (,$(filter $(all_systems),$(.VARIABLES)))
|
||||||
|
@ -35,6 +35,8 @@ system:=$(shell uname -s)
|
||||||
|
|
||||||
ifeq ($(system),Linux)
|
ifeq ($(system),Linux)
|
||||||
new_system:=LINUX
|
new_system:=LINUX
|
||||||
|
else ifeq ($(system),Haiku)
|
||||||
|
new_system:=HAIKU
|
||||||
else
|
else
|
||||||
|
|
||||||
$(error \
|
$(error \
|
||||||
|
|
71
src/Makefile.d/haiku.mk
Normal file
71
src/Makefile.d/haiku.mk
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
#
|
||||||
|
# Makefile options for Haiku
|
||||||
|
#
|
||||||
|
|
||||||
|
opts+=-DUNIXCOMMON -DLUA_USE_POSIX
|
||||||
|
|
||||||
|
ifndef DEDICATED
|
||||||
|
ifndef DUMMY
|
||||||
|
SDL?=1
|
||||||
|
DEDICATED?=0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
NOEXECINFO=1
|
||||||
|
|
||||||
|
ifeq (${SDL},1)
|
||||||
|
EXENAME?=srb2haiku
|
||||||
|
else ifeq (${DEDICATED},1)
|
||||||
|
EXENAME?=srb2haikud
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef NONET
|
||||||
|
libs+=-lnetwork
|
||||||
|
endif
|
||||||
|
|
||||||
|
define _set =
|
||||||
|
$(1)_CFLAGS?=$($(1)_opts)
|
||||||
|
$(1)_LDFLAGS?=$($(1)_libs)
|
||||||
|
endef
|
||||||
|
|
||||||
|
lib:=../libs/gme
|
||||||
|
LIBGME_opts:=-I$(lib)/include
|
||||||
|
LIBGME_libs:=-l:libgme.so.0
|
||||||
|
$(eval $(call _set,LIBGME))
|
||||||
|
|
||||||
|
lib:=../libs/libopenmpt
|
||||||
|
LIBOPENMPT_opts:=-I$(lib)/inc
|
||||||
|
LIBOPENMPT_libs:=-l:libopenmpt.so.0
|
||||||
|
$(eval $(call _set,LIBOPENMPT))
|
||||||
|
|
||||||
|
ifdef SDL
|
||||||
|
lib:=../libs/SDL2_mixer
|
||||||
|
mixer_opts:=-I$(lib)/include
|
||||||
|
mixer_libs:=-l:libSDL2_mixer-2.0.so.0
|
||||||
|
|
||||||
|
lib:=../libs/SDL2
|
||||||
|
SDL_opts:=-I$(lib)/include $(mixer_opts)
|
||||||
|
SDL_libs:=$(mixer_libs) -l:libSDL2-2.0.so.0
|
||||||
|
$(eval $(call _set,SDL))
|
||||||
|
endif
|
||||||
|
|
||||||
|
lib:=../libs/zlib
|
||||||
|
ZLIB_opts:=-I$(lib)
|
||||||
|
ZLIB_libs:=-l:libz.so.1
|
||||||
|
$(eval $(call _set,ZLIB))
|
||||||
|
|
||||||
|
ifndef PNG_CONFIG
|
||||||
|
PNG_opts:=
|
||||||
|
PNG_libs:=-l:libpng16.so.16
|
||||||
|
$(eval $(call _set,PNG))
|
||||||
|
endif
|
||||||
|
|
||||||
|
lib:=../libs/curl
|
||||||
|
CURL_opts:=-I$(lib)/include
|
||||||
|
CURL_libs:=-l:libcurl.so.4
|
||||||
|
$(eval $(call _set,CURL))
|
||||||
|
|
||||||
|
lib:=../libs/miniupnpc
|
||||||
|
MINIUPNPC_opts:=-I$(lib)/include
|
||||||
|
MINIUPNPC_libs:=-l:libminiupnpc.so.17
|
||||||
|
$(eval $(call _set,MINIUPNPC))
|
|
@ -35,6 +35,10 @@ endif
|
||||||
else ifdef FREEBSD
|
else ifdef FREEBSD
|
||||||
UNIX=1
|
UNIX=1
|
||||||
platform=freebsd
|
platform=freebsd
|
||||||
|
else ifdef HAIKU
|
||||||
|
# Give Haiku its own configuration, since it
|
||||||
|
# isn't actually UNIX.
|
||||||
|
include Makefile.d/haiku.mk
|
||||||
else ifdef SOLARIS # FIXME: UNTESTED
|
else ifdef SOLARIS # FIXME: UNTESTED
|
||||||
UNIX=1
|
UNIX=1
|
||||||
platform=solaris
|
platform=solaris
|
||||||
|
|
|
@ -33,11 +33,13 @@ else
|
||||||
opts+=-DHAVE_MIXER
|
opts+=-DHAVE_MIXER
|
||||||
sources+=sdl/mixer_sound.c
|
sources+=sdl/mixer_sound.c
|
||||||
|
|
||||||
ifdef HAVE_MIXERX
|
ifndef HAIKU # Haiku has a special import path
|
||||||
opts+=-DHAVE_MIXERX
|
ifdef HAVE_MIXERX
|
||||||
libs+=-lSDL2_mixer_ext
|
opts+=-DHAVE_MIXERX
|
||||||
else
|
libs+=-lSDL2_mixer_ext
|
||||||
libs+=-lSDL2_mixer
|
else
|
||||||
|
libs+=-lSDL2_mixer
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -2307,7 +2307,7 @@ void I_Sleep(UINT32 ms)
|
||||||
|
|
||||||
void I_SleepDuration(precise_t duration)
|
void I_SleepDuration(precise_t duration)
|
||||||
{
|
{
|
||||||
#if defined(__linux__) || defined(__FreeBSD__)
|
#if defined(__linux__) || defined(__FreeBSD__) || defined(__HAIKU__)
|
||||||
UINT64 precision = I_GetPrecisePrecision();
|
UINT64 precision = I_GetPrecisePrecision();
|
||||||
struct timespec ts = {
|
struct timespec ts = {
|
||||||
.tv_sec = duration / precision,
|
.tv_sec = duration / precision,
|
||||||
|
|
Loading…
Reference in a new issue