Jiri Olsa | 8bd407b | 2013-03-15 16:28:49 +0100 | [diff] [blame] | 1 | uname_M := $(shell uname -m 2>/dev/null || echo not) |
| 2 | |
| 3 | ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ |
| 4 | -e s/arm.*/arm/ -e s/sa110/arm/ \ |
| 5 | -e s/s390x/s390/ -e s/parisc64/parisc/ \ |
| 6 | -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ |
| 7 | -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ ) |
| 8 | NO_PERF_REGS := 1 |
| 9 | |
| 10 | # Additional ARCH settings for x86 |
| 11 | ifeq ($(ARCH),i386) |
| 12 | override ARCH := x86 |
| 13 | NO_PERF_REGS := 0 |
| 14 | LIBUNWIND_LIBS = -lunwind -lunwind-x86 |
| 15 | endif |
| 16 | |
| 17 | ifeq ($(ARCH),x86_64) |
| 18 | override ARCH := x86 |
| 19 | IS_X86_64 := 0 |
| 20 | ifeq (, $(findstring m32,$(EXTRA_CFLAGS))) |
| 21 | IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1) |
| 22 | endif |
| 23 | ifeq (${IS_X86_64}, 1) |
| 24 | RAW_ARCH := x86_64 |
| 25 | ARCH_CFLAGS := -DARCH_X86_64 |
| 26 | ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S |
| 27 | endif |
| 28 | NO_PERF_REGS := 0 |
| 29 | LIBUNWIND_LIBS = -lunwind -lunwind-x86_64 |
| 30 | endif |
| 31 | |
| 32 | ifeq ($(NO_PERF_REGS),0) |
| 33 | BASIC_CFLAGS += -DHAVE_PERF_REGS |
| 34 | endif |
Jiri Olsa | a32f493 | 2013-03-25 00:32:01 +0100 | [diff] [blame^] | 35 | |
| 36 | -include config/feature-tests.mak |
| 37 | |
| 38 | ifeq ($(call get-executable,$(FLEX)),) |
| 39 | dummy := $(error Error: $(FLEX) is missing on this system, please install it) |
| 40 | endif |
| 41 | |
| 42 | ifeq ($(call get-executable,$(BISON)),) |
| 43 | dummy := $(error Error: $(BISON) is missing on this system, please install it) |
| 44 | endif |