0001
0002 HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
0003 -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
0004 -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
0005 -e s/s390x/s390/ -e s/parisc64/parisc/ \
0006 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
0007 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
0008 -e s/riscv.*/riscv/)
0009
0010 ifndef ARCH
0011 ARCH := $(HOSTARCH)
0012 endif
0013
0014 SRCARCH := $(ARCH)
0015
0016
0017 ifeq ($(ARCH),i386)
0018 SRCARCH := x86
0019 endif
0020 ifeq ($(ARCH),x86_64)
0021 SRCARCH := x86
0022 endif
0023
0024
0025 ifeq ($(ARCH),sparc32)
0026 SRCARCH := sparc
0027 endif
0028 ifeq ($(ARCH),sparc64)
0029 SRCARCH := sparc
0030 endif
0031
0032
0033 ifeq ($(ARCH),sh64)
0034 SRCARCH := sh
0035 endif
0036
0037 LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
0038 ifeq ($(LP64), 1)
0039 IS_64_BIT := 1
0040 else
0041 IS_64_BIT := 0
0042 endif