Move cross-make-mingw.sh's functionality to the Makefile and remove it

This commit is contained in:
Tim Angus 2013-03-22 13:49:50 +00:00
parent e4151c1d55
commit b720b60295
5 changed files with 35 additions and 70 deletions

View file

@ -478,7 +478,7 @@ else # ifeq darwin
ifeq ($(PLATFORM),mingw32)
# Some MinGW installations define CC to cc, but don't actually provide cc,
# so explicitly use gcc instead (which is the only option anyway)
# so check that CC points to a real binary and use gcc if it doesn't
ifeq ($(call bin_path, $(CC)),)
CC=gcc
endif
@ -487,6 +487,30 @@ ifeq ($(PLATFORM),mingw32)
WINDRES=windres
endif
ifeq ($(CROSS_COMPILING),1)
# If CC is already set to something generic, we probably want to use
# something more specific
ifneq ($(findstring $(CC),cc gcc),)
CC=
endif
# We need to figure out the correct compiler
ifeq ($(CC),)
ifeq ($(ARCH),x86_64)
MINGW_PREFIXES=amd64-mingw32msvc x86_64-w64-mingw32
endif
ifeq ($(ARCH),x86)
MINGW_PREFIXES=i586-mingw32msvc i686-w64-mingw32
endif
CC=$(strip $(foreach MINGW_PREFIX, $(MINGW_PREFIXES), \
$(call bin_path, $(MINGW_PREFIX)-gcc)))
WINDRES=$(strip $(foreach MINGW_PREFIX, $(MINGW_PREFIXES), \
$(call bin_path, $(MINGW_PREFIX)-windres)))
endif
endif
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-DUSE_ICON