From 647e39de792c01c10815e239112886ea1c1be614 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Tue, 8 Aug 2017 14:23:34 +0200 Subject: [PATCH] scons: add 32bit unix build --- Makefile | 13 +++++++++++-- SConscript.unix | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b0cd9a9ee..6c4445f7c 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,15 @@ BOARDLOADER_BUILD_DIR = build/boardloader BOOTLOADER_BUILD_DIR = build/bootloader FIRMWARE_BUILD_DIR = build/firmware +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) +UNIX_PORT_OPTS ?= TREZOR_X86=0 +else +UNIX_PORT_OPTS ?= TREZOR_X86=1 +endif +CROSS_PORT_OPTS ?= MICROPY_FORCE_32BIT=1 + + ## help commands: help: ## show this help @@ -57,10 +66,10 @@ build_firmware: res build_cross ## build firmware with frozen modules $(SCONS) build/firmware/firmware.bin build_unix: ## build unix port - $(SCONS) build/unix/micropython + $(SCONS) build/unix/micropython $(UNIX_PORT_OPTS) build_unix_noui: ## build unix port without UI support - $(SCONS) build/unix/micropython TREZOR_NOUI=1 + $(SCONS) build/unix/micropython $(UNIX_PORT_OPTS) TREZOR_NOUI=1 build_cross: ## build mpy-cross port $(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS) diff --git a/SConscript.unix b/SConscript.unix index ef4f9a39d..7582aa3d8 100644 --- a/SConscript.unix +++ b/SConscript.unix @@ -270,6 +270,11 @@ env.Replace( MPY_TOOL='$PYTHON vendor/micropython/tools/mpy-tool.py', MPY_CROSS='vendor/micropython/mpy-cross/mpy-cross', ) +if ARGUMENTS.get('TREZOR_X86', 0): + env.Append( + CCFLAGS='-m32', + LINKFLAGS='-m32', ) + # # Micropython version #