diff options
author | Tim Angus <tim@ngus.net> | 2013-03-22 13:49:50 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-03-22 19:02:26 +0000 |
commit | 1d4c0f1601e467ae5bb184a2b5f1040a785ba10c (patch) | |
tree | 87223c2fa873906d16224f831f5011dda194526d /Makefile | |
parent | 84962539a2d53bf69f7d3fd180725e307016ef9a (diff) |
Move cross-make-mingw.sh's functionality to the Makefile and remove it
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -466,7 +466,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 @@ -475,6 +475,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 |