tools/perf/build: Split out feature check: 'libpython'
[linux-2.6-block.git] / tools / perf / config / feature-checks / Makefile
CommitLineData
b6aa9979 1
3ae069cf
IM
2FILES= \
3 test-hello \
90ac5422 4 test-stackprotector-all \
430be5ab 5 test-stackprotector \
c2510445 6 test-volatile-register-var \
1ea6f99e 7 test-fortify-source \
78e9d655 8 test-bionic \
8f7f8005 9 test-libelf \
e12762cf 10 test-glibc \
8295d4e2 11 test-dwarf \
8869b17e 12 test-libelf-mmap \
b7bcef6f 13 test-libelf-getphdrnum \
058f952d 14 test-libunwind \
d795a658 15 test-libaudit \
b9498b50 16 test-libslang \
7ef9e055 17 test-gtk2 \
c7a79e96 18 test-gtk2-infobar \
7181a671 19 test-libperl \
9734163b 20 test-libpython \
3ae069cf 21 test-libnuma
b6aa9979 22
8b6eb56a
IM
23CC := $(CC) -MD
24
b6aa9979
IM
25all: $(FILES)
26
27BUILD = $(CC) -o $(OUTPUT)$@ $@.c
28
29###############################
30
8b6eb56a 31test-hello:
b6aa9979
IM
32 $(BUILD)
33
90ac5422
IM
34test-stackprotector-all:
35 $(BUILD) -Werror -fstack-protector-all
36
430be5ab
IM
37test-stackprotector:
38 $(BUILD) -Werror -fstack-protector
39
c2510445
IM
40test-volatile-register-var:
41 $(BUILD) -Werror -Wvolatile-register-var
42
1ea6f99e
IM
43test-fortify-source:
44 $(BUILD) -O2 -Werror -D_FORTIFY_SOURCE=2
45
78e9d655
IM
46test-bionic:
47 $(BUILD)
48
8f7f8005
IM
49test-libelf:
50 $(BUILD) -lelf
51
e12762cf
IM
52test-glibc:
53 $(BUILD)
54
8295d4e2
IM
55test-dwarf:
56 $(BUILD) -ldw
57
8869b17e
IM
58test-libelf-mmap:
59 $(BUILD) -lelf
60
b7bcef6f
IM
61test-libelf-getphdrnum:
62 $(BUILD) -lelf
63
3ae069cf
IM
64test-libnuma:
65 $(BUILD) -lnuma
66
058f952d
IM
67test-libunwind:
68 $(BUILD) -lunwind -lunwind-x86_64 -lelf
69
d795a658
IM
70test-libaudit:
71 $(BUILD) -laudit
72
b9498b50
IM
73test-libslang:
74 $(BUILD) -I/usr/include/slang -lslang
75
7ef9e055
IM
76test-gtk2:
77 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
78
c7a79e96
IM
79test-gtk2-infobar:
80 $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
81
7181a671
IM
82grep-libs = $(filter -l%,$(1))
83strip-libs = $(filter-out -l%,$(1))
84
85PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
86PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
87PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
88PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
89FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
90
91test-libperl:
92 $(BUILD) $(FLAGS_PERL_EMBED)
93
9734163b
IM
94override PYTHON := python
95override PYTHON_CONFIG := python-config
96
97escape-for-shell-sq = $(subst ','\'',$(1))
98shell-sq = '$(escape-for-shell-sq)'
99
100PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
101
102PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
103PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
104PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
105PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
106FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
107
108test-libpython:
109 $(BUILD) $(FLAGS_PYTHON_EMBED)
110
8b6eb56a
IM
111-include *.d */*.d
112
b6aa9979
IM
113###############################
114
115clean:
8b6eb56a 116 rm -f $(FILES) *.d