From fb36c22058bd3ccadd1f38d6306ab428cd527536 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 27 Mar 2016 14:00:17 -0700 Subject: [PATCH] makefile: simplify building Video support by leveraging sdl-config and sdl2-config --- makefile | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/makefile b/makefile index e016f075..1b22051a 100644 --- a/makefile +++ b/makefile @@ -424,30 +424,24 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) endif ifneq (,$(call find_include,SDL2/SDL)) ifneq (,$(call find_lib,SDL2)) - VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO -I$(dir $(call find_include,SDL2/SDL)) - VIDEO_LDFLAGS += -lSDL2 + VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(realpath $(dir $(call find_include,SDL2/SDL))../../bin/sdl2-config) --cflags` + VIDEO_LDFLAGS += `$(realpath $(dir $(call find_include,SDL2/SDL))../../bin/sdl2-config) --static-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_lib,SDL2) $(call find_include,SDL2/SDL)) - ifeq (Darwin,$(OSTYPE)) - VIDEO_LDFLAGS += -lobjc -framework cocoa -DSDL_MAIN_AVAILABLE - endif + $(info using libSDL2: $(call find_include,SDL2/SDL)) endif else ifneq (,$(call find_include,SDL/SDL)) ifneq (,$(call find_lib,SDL)) - VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO -I$(dir $(call find_include,SDL/SDL)) - VIDEO_LDFLAGS += -lSDL + VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(realpath $(dir $(call find_include,SDL/SDL))../../bin/sdl-config) --cflags` + VIDEO_LDFLAGS += `$(realpath $(dir $(call find_include,SDL/SDL))../../bin/sdl-config) --static-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_lib,SDL) $(call find_include,SDL/SDL)) - ifeq (Darwin,$(OSTYPE)) - VIDEO_LDFLAGS += -lobjc -framework cocoa -DSDL_MAIN_AVAILABLE - endif + $(info using libSDL: $(call find_include,SDL/SDL)) endif endif endif