18 test-libelf-getphdrnum \
23 test-libpython-version \
26 test-libunwind-debug-frame \
28 test-stackprotector-all \
36 BUILD
= $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$(OUTPUT
)$@
$@.c
38 ###############################
41 $(BUILD
) -Werror
-fstack-protector
-fstack-protector-all
-O2
-Werror
-D_FORTIFY_SOURCE
=2 -ldw
-lelf
-lnuma
$(LIBUNWIND_LIBS
) -lelf
-laudit
-I
/usr
/include/slang
-lslang
$(shell pkg-config
--libs
--cflags gtk
+-2.0 2>/dev
/null
) $(FLAGS_PERL_EMBED
) $(FLAGS_PYTHON_EMBED
) -DPACKAGE
='"perf"' -lbfd
-ldl
46 test-stackprotector-all
:
47 $(BUILD
) -Werror
-fstack-protector-all
50 $(BUILD
) -Werror
-fstack-protector
-Wstack-protector
53 $(BUILD
) -O2
-Werror
-D_FORTIFY_SOURCE
=2
70 test-libelf-getphdrnum
:
77 $(BUILD
) $(LIBUNWIND_LIBS
) -lelf
79 test-libunwind-debug-frame
:
80 $(BUILD
) $(LIBUNWIND_LIBS
) -lelf
86 $(BUILD
) -I
/usr
/include/slang
-lslang
89 $(BUILD
) $(shell pkg-config
--libs
--cflags gtk
+-2.0 2>/dev
/null
)
92 $(BUILD
) $(shell pkg-config
--libs
--cflags gtk
+-2.0 2>/dev
/null
)
94 grep-libs
= $(filter -l
%,$(1))
95 strip-libs
= $(filter-out -l
%,$(1))
97 PERL_EMBED_LDOPTS
= $(shell perl
-MExtUtils
::Embed
-e ldopts
2>/dev
/null
)
98 PERL_EMBED_LDFLAGS
= $(call strip-libs
,$(PERL_EMBED_LDOPTS
))
99 PERL_EMBED_LIBADD
= $(call grep-libs
,$(PERL_EMBED_LDOPTS
))
100 PERL_EMBED_CCOPTS
= `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
101 FLAGS_PERL_EMBED
=$(PERL_EMBED_CCOPTS
) $(PERL_EMBED_LDOPTS
)
104 $(BUILD
) $(FLAGS_PERL_EMBED
)
106 override PYTHON
:= python
107 override PYTHON_CONFIG
:= python-config
109 escape-for-shell-sq
= $(subst ','\'',$(1))
110 shell-sq = '$(escape-for-shell-sq
)'
112 PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG))
114 PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
115 PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
116 PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
117 PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
118 FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
121 $(BUILD) $(FLAGS_PYTHON_EMBED)
123 test-libpython-version:
124 $(BUILD) $(FLAGS_PYTHON_EMBED)
127 $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
130 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
133 $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
149 ###############################