makefile: Rework SDL/SDL2 package support
This change effectively reverts 8b1af8b862
and solves the Haiku build
problem mentioned in #489 in a platform specific way.
This commit is contained in:
parent
63f55c785e
commit
5ac4aaa1d4
1 changed files with 42 additions and 20 deletions
30
makefile
30
makefile
|
@ -502,9 +502,18 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
||||||
LIBEXTSAVE := $(LIBEXT)
|
LIBEXTSAVE := $(LIBEXT)
|
||||||
LIBEXT = dll.a
|
LIBEXT = dll.a
|
||||||
endif
|
endif
|
||||||
|
ifneq (,$(call find_include,SDL2/SDL))
|
||||||
|
ifneq (,$(call find_lib,SDL2))
|
||||||
|
ifneq (,$(findstring Haiku,$(OSTYPE)))
|
||||||
ifneq (,$(shell which sdl2-config))
|
ifneq (,$(shell which sdl2-config))
|
||||||
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `sdl2-config --cflags`
|
SDL2_CONFIG = sdl2_config
|
||||||
VIDEO_LDFLAGS += `sdl2-config --libs`
|
endif
|
||||||
|
else
|
||||||
|
SDL2_CONFIG = $(realpath $(dir $(call find_include,SDL2/SDL))../../bin/sdl2-config)
|
||||||
|
endif
|
||||||
|
ifneq (,$(SDL2_CONFIG))
|
||||||
|
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(SDL2_CONFIG) --cflags`
|
||||||
|
VIDEO_LDFLAGS += `$(SDL2_CONFIG) --libs`
|
||||||
VIDEO_FEATURES = - video capabilities provided by libSDL2 (Simple Directmedia Layer)
|
VIDEO_FEATURES = - video capabilities provided by libSDL2 (Simple Directmedia Layer)
|
||||||
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
|
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
|
||||||
DISPLAYVT = ${DISPLAYD}/vt11.c
|
DISPLAYVT = ${DISPLAYD}/vt11.c
|
||||||
|
@ -513,10 +522,21 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
||||||
ifeq (Darwin,$(OSTYPE))
|
ifeq (Darwin,$(OSTYPE))
|
||||||
VIDEO_CCDEFS += -DSDL_MAIN_AVAILABLE
|
VIDEO_CCDEFS += -DSDL_MAIN_AVAILABLE
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
|
ifneq (,$(call find_include,SDL/SDL))
|
||||||
|
ifneq (,$(call find_lib,SDL))
|
||||||
|
ifneq (,$(findstring Haiku,$(OSTYPE)))
|
||||||
ifneq (,$(shell which sdl-config))
|
ifneq (,$(shell which sdl-config))
|
||||||
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `sdl-config --cflags`
|
SDL_CONFIG = sdl_config
|
||||||
VIDEO_LDFLAGS += `sdl-config --libs`
|
endif
|
||||||
|
else
|
||||||
|
SDL_CONFIG = $(realpath $(dir $(call find_include,SDL/SDL))../../bin/sdl-config)
|
||||||
|
endif
|
||||||
|
ifneq (,$(SDL_CONFIG))
|
||||||
|
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(SDL_CONFIG) --cflags`
|
||||||
|
VIDEO_LDFLAGS += `$(SDL_CONFIG) --libs`
|
||||||
VIDEO_FEATURES = - video capabilities provided by libSDL (Simple Directmedia Layer)
|
VIDEO_FEATURES = - video capabilities provided by libSDL (Simple Directmedia Layer)
|
||||||
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
|
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
|
||||||
DISPLAYVT = ${DISPLAYD}/vt11.c
|
DISPLAYVT = ${DISPLAYD}/vt11.c
|
||||||
|
@ -527,6 +547,8 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
ifeq (cygwin,$(OSTYPE))
|
ifeq (cygwin,$(OSTYPE))
|
||||||
LIBEXT = $(LIBEXTSAVE)
|
LIBEXT = $(LIBEXTSAVE)
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue