Merge tag 'dm-4.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
[sfrench/cifs-2.6.git] / tools / perf / config / Makefile.arch
1
2 uname_M := $(shell uname -m 2>/dev/null || echo not)
3
4 RAW_ARCH := $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
5                                   -e s/arm.*/arm/ -e s/sa110/arm/ \
6                                   -e s/s390x/s390/ -e s/parisc64/parisc/ \
7                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
8                                   -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
9                                   -e s/tile.*/tile/ )
10
11 # Additional ARCH settings for x86
12 ifeq ($(RAW_ARCH),i386)
13   ARCH ?= x86
14 endif
15
16 ifeq ($(RAW_ARCH),x86_64)
17   ARCH ?= x86
18
19   ifneq (, $(findstring m32,$(CFLAGS)))
20     RAW_ARCH := x86_32
21   endif
22 endif
23
24 ifeq ($(RAW_ARCH),sparc64)
25   ARCH ?= sparc
26 endif
27
28 ARCH ?= $(RAW_ARCH)
29
30 LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
31 ifeq ($(LP64), 1)
32   IS_64_BIT := 1
33 else
34   IS_64_BIT := 0
35 endif