Support mxe build environment for windows cross builds

Override all tools with prefixed versions if the CROSS variable has
been set. This is the recommended way to enable cross compilation using
mxe without touching lots of environment variables first.
This commit is contained in:
Stefan Gehn 2014-08-23 18:25:18 +02:00
parent 534ab2dfa9
commit 45898d3826
1 changed files with 12 additions and 4 deletions

View File

@ -1,9 +1,17 @@
# makefile variables and rules shared by both gkrellm and gkrellmd
CC ?= gcc
AR ?= ar
PKG_CONFIG ?= pkg-config
WINDRES ?= windres
ifdef CROSS
# enforce overriding tools for mxe cross builds (http://mxe.cc)
CC = $(CROSS)gcc
AR = $(CROSS)ar
PKG_CONFIG = $(CROSS)pkg-config
WINDRES = $(CROSS)windres
else
CC ?= gcc
AR ?= ar
PKG_CONFIG ?= pkg-config
WINDRES ?= windres
endif
PREFIX ?= /usr/local
INSTALLROOT ?= $(DESTDIR)$(PREFIX)