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