1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0 2*4882a593SmuzhiyunHOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ 3*4882a593Smuzhiyun -e s/sun4u/sparc/ -e s/sparc64/sparc/ \ 4*4882a593Smuzhiyun -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \ 5*4882a593Smuzhiyun -e s/s390x/s390/ -e s/parisc64/parisc/ \ 6*4882a593Smuzhiyun -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ 7*4882a593Smuzhiyun -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ ) 8*4882a593Smuzhiyun 9*4882a593Smuzhiyunifndef ARCH 10*4882a593SmuzhiyunARCH := $(HOSTARCH) 11*4882a593Smuzhiyunendif 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunSRCARCH := $(ARCH) 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun# Additional ARCH settings for x86 16*4882a593Smuzhiyunifeq ($(ARCH),i386) 17*4882a593Smuzhiyun SRCARCH := x86 18*4882a593Smuzhiyunendif 19*4882a593Smuzhiyunifeq ($(ARCH),x86_64) 20*4882a593Smuzhiyun SRCARCH := x86 21*4882a593Smuzhiyunendif 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun# Additional ARCH settings for sparc 24*4882a593Smuzhiyunifeq ($(ARCH),sparc32) 25*4882a593Smuzhiyun SRCARCH := sparc 26*4882a593Smuzhiyunendif 27*4882a593Smuzhiyunifeq ($(ARCH),sparc64) 28*4882a593Smuzhiyun SRCARCH := sparc 29*4882a593Smuzhiyunendif 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun# Additional ARCH settings for sh 32*4882a593Smuzhiyunifeq ($(ARCH),sh64) 33*4882a593Smuzhiyun SRCARCH := sh 34*4882a593Smuzhiyunendif 35*4882a593Smuzhiyun 36*4882a593SmuzhiyunLP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1) 37*4882a593Smuzhiyunifeq ($(LP64), 1) 38*4882a593Smuzhiyun IS_64_BIT := 1 39*4882a593Smuzhiyunelse 40*4882a593Smuzhiyun IS_64_BIT := 0 41*4882a593Smuzhiyunendif 42