From 267663b95166c1ea68b33cd2570da2b46485a87a Mon Sep 17 00:00:00 2001 From: Patrick Oppenlander Date: Mon, 30 May 2016 15:04:34 +1000 Subject: [PATCH] add support for canadian cross build A mingw-w64 -> arm-linux-musleabi canadian cross compiler can be built by setting the following variables in config.mak: TARGET = arm-linux-musleabi GCC_CONFIG += --host=x86_64-w64-mingw32 CANADIAN := y Note that this requires both build->host (x86_64-w64-mingw32) and build->target (arm-linux-musleabi) toolchains to already exist on the build machine. --- litecross/Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/litecross/Makefile b/litecross/Makefile index d3c065a..9b4de6f 100644 --- a/litecross/Makefile +++ b/litecross/Makefile @@ -61,16 +61,22 @@ FULL_TOOLCHAIN_CONFIG = --enable-languages=c,c++ \ FULL_MUSL_CONFIG = $(MUSL_CONFIG) \ --prefix= --host=$(TARGET) -ifeq ($(NATIVE),) +ifneq ($(NATIVE),) +SYSROOT = / +FULL_TOOLCHAIN_CONFIG += --host=$(TARGET) +MUSL_VARS = +else ifneq ($(CANADIAN),) +SYSROOT = /$(TARGET) +FULL_MUSL_CONFIG += CROSS_COMPILE=$(TARGET)- LIBCC="../obj_toolchain/$(TARGET)/libgcc/libgcc.a" +MUSL_VARS = +obj_musl/.lc_built: | obj_toolchain/$(TARGET)/libgcc/libgcc.a +obj_toolchain/.lc_built: | obj_sysroot/.lc_libs obj_sysroot/.lc_headers +else SYSROOT = /$(TARGET) FULL_MUSL_CONFIG += CC="$(XGCC)" LIBCC="../obj_toolchain/$(TARGET)/libgcc/libgcc.a" MUSL_VARS = AR=../obj_toolchain/binutils/ar RANLIB=../obj_toolchain/binutils/ranlib obj_musl/.lc_built: | obj_toolchain/$(TARGET)/libgcc/libgcc.a obj_toolchain/.lc_built: | obj_sysroot/.lc_libs obj_sysroot/.lc_headers -else -SYSROOT = / -FULL_TOOLCHAIN_CONFIG += --host=$(TARGET) -MUSL_VARS = endif ifeq ($(TARGET),)