blob: ad85b921a60761f669a60de1c742449af31b01c4 [file] [log] [blame]
Arnaldo Carvalho de Melo0a943cb2016-07-22 09:55:53 -03001HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
Namhyung Kimb11db652015-03-02 13:31:03 +09002 -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
Wang Nan235504d2015-03-17 13:29:47 +00003 -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
Jiri Olsaa6cf5f32014-01-03 15:32:32 +01004 -e s/s390x/s390/ -e s/parisc64/parisc/ \
5 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
Zhigang Lu620830b2014-02-11 11:03:48 +08006 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
7 -e s/tile.*/tile/ )
Josh Poimboeuf60cbdf52016-07-22 14:19:20 -05008
Arnaldo Carvalho de Melo0a943cb2016-07-22 09:55:53 -03009ifndef ARCH
10ARCH := $(HOSTARCH)
11endif
Jiri Olsaa6cf5f32014-01-03 15:32:32 +010012
Josh Poimboeuf60cbdf52016-07-22 14:19:20 -050013SRCARCH := $(ARCH)
14
15# Additional ARCH settings for x86
16ifeq ($(ARCH),i386)
17 SRCARCH := x86
18endif
19ifeq ($(ARCH),x86_64)
20 SRCARCH := x86
21endif
22
23# Additional ARCH settings for sparc
24ifeq ($(ARCH),sparc32)
25 SRCARCH := sparc
26endif
27ifeq ($(ARCH),sparc64)
28 SRCARCH := sparc
29endif
30
31# Additional ARCH settings for sh
32ifeq ($(ARCH),sh64)
33 SRCARCH := sh
34endif
35
36# Additional ARCH settings for tile
37ifeq ($(ARCH),tilepro)
38 SRCARCH := tile
39endif
40ifeq ($(ARCH),tilegx)
41 SRCARCH := tile
42endif
43
Namhyung Kimc6e5e9f2015-01-12 10:20:55 +080044LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
45ifeq ($(LP64), 1)
Adrian Huntere477f3f2014-10-23 18:16:03 -030046 IS_64_BIT := 1
Adrian Huntere477f3f2014-10-23 18:16:03 -030047else
Namhyung Kimc6e5e9f2015-01-12 10:20:55 +080048 IS_64_BIT := 0
Adrian Huntere477f3f2014-10-23 18:16:03 -030049endif