From 53a1b20433230a1d67a43561b5d7e8efc10a6faa Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Fri, 23 Nov 2018 10:32:58 +0100 Subject: [PATCH] fix WIN32CROSS build --- tools/sdl_image_test/Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tools/sdl_image_test/Makefile b/tools/sdl_image_test/Makefile index ff402a31..4d183d57 100644 --- a/tools/sdl_image_test/Makefile +++ b/tools/sdl_image_test/Makefile @@ -14,12 +14,27 @@ BIN = showimage CFLAGS += -DUSE_SDL endif +ifdef WIN32CROSS +CC = $(shell which i686-w64-mingw32-gcc || which mingw32-gcc) +PKGCONFIG_PATH = $(shell if [ -d ../../3rdparty/usr ] ; then echo "PKG_CONFIG_LIBDIR=$${PWD}/../../3rdparty/usr/lib/pkgconfig" ; fi ) +PKGCONFIG = $(PKGCONFIG_PATH) $(shell which i686-w64-mingw32-pkg-config || which mingw32-pkg-config || which pkg-config) +SDLCONFIG = $(shell which ../../3rdparty/usr/bin/sdl-config || which /usr/local/cross-tools/i386-mingw32/bin/sdl-config) +BIN := $(BIN).exe +else +PKGCONFIG = pkg-config +endif + CFLAGS += $(shell $(SDLCONFIG) --cflags) LDLIBS = $(shell $(SDLCONFIG) --libs) -LDLIBS += $(shell pkg-config $(SDLIMAGE) --libs-only-l) -LDFLAGS = $(shell pkg-config $(SDLIMAGE) --libs-only-L) +ifdef WIN32CROSS +LDLIBS += -lSDL_image +else +LDLIBS += $(shell $(PKGCONFIG) $(SDLIMAGE) --libs-only-l) + +LDFLAGS = $(shell $(PKGCONFIG) $(SDLIMAGE) --libs-only-L) +endif .PHONY: all clean