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:
Mark Pizzolato 2017-11-27 06:43:05 -08:00
parent 63f55c785e
commit 5ac4aaa1d4

View file

@ -502,28 +502,50 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
LIBEXTSAVE := $(LIBEXT) LIBEXTSAVE := $(LIBEXT)
LIBEXT = dll.a LIBEXT = dll.a
endif endif
ifneq (,$(shell which sdl2-config)) ifneq (,$(call find_include,SDL2/SDL))
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `sdl2-config --cflags` ifneq (,$(call find_lib,SDL2))
VIDEO_LDFLAGS += `sdl2-config --libs` ifneq (,$(findstring Haiku,$(OSTYPE)))
VIDEO_FEATURES = - video capabilities provided by libSDL2 (Simple Directmedia Layer) ifneq (,$(shell which sdl2-config))
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c SDL2_CONFIG = sdl2_config
DISPLAYVT = ${DISPLAYD}/vt11.c endif
DISPLAY_OPT += -DUSE_DISPLAY $(VIDEO_CCDEFS) $(VIDEO_LDFLAGS) else
$(info using libSDL2: $(call find_include,SDL2/SDL)) SDL2_CONFIG = $(realpath $(dir $(call find_include,SDL2/SDL))../../bin/sdl2-config)
ifeq (Darwin,$(OSTYPE)) endif
VIDEO_CCDEFS += -DSDL_MAIN_AVAILABLE 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)
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
DISPLAYVT = ${DISPLAYD}/vt11.c
DISPLAY_OPT += -DUSE_DISPLAY $(VIDEO_CCDEFS) $(VIDEO_LDFLAGS)
$(info using libSDL2: $(call find_include,SDL2/SDL))
ifeq (Darwin,$(OSTYPE))
VIDEO_CCDEFS += -DSDL_MAIN_AVAILABLE
endif
endif
endif endif
else else
ifneq (,$(shell which sdl-config)) ifneq (,$(call find_include,SDL/SDL))
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `sdl-config --cflags` ifneq (,$(call find_lib,SDL))
VIDEO_LDFLAGS += `sdl-config --libs` ifneq (,$(findstring Haiku,$(OSTYPE)))
VIDEO_FEATURES = - video capabilities provided by libSDL (Simple Directmedia Layer) ifneq (,$(shell which sdl-config))
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c SDL_CONFIG = sdl_config
DISPLAYVT = ${DISPLAYD}/vt11.c endif
DISPLAY_OPT += -DUSE_DISPLAY $(VIDEO_CCDEFS) $(VIDEO_LDFLAGS) else
$(info using libSDL: $(call find_include,SDL/SDL)) SDL_CONFIG = $(realpath $(dir $(call find_include,SDL/SDL))../../bin/sdl-config)
ifeq (Darwin,$(OSTYPE)) endif
VIDEO_CCDEFS += -DSDL_MAIN_AVAILABLE 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)
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
DISPLAYVT = ${DISPLAYD}/vt11.c
DISPLAY_OPT += -DUSE_DISPLAY $(VIDEO_CCDEFS) $(VIDEO_LDFLAGS)
$(info using libSDL: $(call find_include,SDL/SDL))
ifeq (Darwin,$(OSTYPE))
VIDEO_CCDEFS += -DSDL_MAIN_AVAILABLE
endif
endif
endif endif
endif endif
endif endif