Commit 45b38f38 authored by Ivan A. Melnikov's avatar Ivan A. Melnikov Committed by Michael Shigorin

build.mk: Run mips{,64}el builds natively on mips* machines

parent 98a9c1f3
......@@ -21,13 +21,23 @@ LOWSPACE = 1024
# it's also nice to know how long and much it takes
START += time -f "%E %PCPU %Mk"
# e2k* builds always run natively, and without setarch
ifeq (,$(findstring e2k,$(ARCH)))
# /usr/bin/{i586,x86_64} are setarch(8) symlinks but arm is not;
# armh (armv7l) doesn't have any but should cope with qemu-arm.static;
# also check whether non-x86 build is running native
EARCH := $(patsubst e2k%,e2k,$(subst armh,arm,$(ARCH)))
ifeq (,$(findstring e2k,$(EARCH)))
ifeq (,$(wildcard $(subst :,/$(ARCH) ,$(PATH):)))
ifeq (,$(findstring $(EARCH),$(shell uname -m)))
EARCH := $(subst armh,arm,$(ARCH))
# for mips*el, `uname -m` never has 'el' suffix, but
# qemu-user-static binaries always do.
UARCH := $(subst mipsel,mips,$(EARCH))
UARCH := $(subst mips64el,mips64,$(UARCH))
ifeq (,$(findstring $(UARCH),$(shell uname -m)))
export GLOBAL_HSH_USE_QEMU=$(EARCH)
endif
else
......@@ -35,6 +45,7 @@ START += $(ARCH)
endif
endif
# to be passed into distcfg.mk; suggestions are welcome
IMAGEDIR ?= $(shell \
if [ -d "$$HOME/out" -a -w "$$HOME/out" ]; then \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment