Commit 1c47661a authored by Ingo Molnar's avatar Ingo Molnar

tools/perf/build: Split out feature checks: 'liberty', 'liberty-z', 'cplus-demangle'

Note that these are rarely executed tests, so we call feature_check() explicitly
and don't have them in CORE_FEATURE_CHECKS.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-pvumlx6mbtfxffgrlwO2mRcx@git.kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 73a725f0
...@@ -472,23 +472,19 @@ else ...@@ -472,23 +472,19 @@ else
EXTLIBS += -liberty EXTLIBS += -liberty
CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
else else
FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
ifeq ($(feature-libbfd), 1) ifeq ($(feature-libbfd), 1)
EXTLIBS += -lbfd EXTLIBS += -lbfd
else else
FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty $(feature_check,liberty)
has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty) ifeq ($(feature-liberty), 1)
ifeq ($(has_bfd_iberty),y)
EXTLIBS += -lbfd -liberty EXTLIBS += -lbfd -liberty
else else
FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz $(feature_check,liberty-z)
has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz) ifeq ($(feature-liberty-z), 1)
ifeq ($(has_bfd_iberty_z),y)
EXTLIBS += -lbfd -liberty -lz EXTLIBS += -lbfd -liberty -lz
else else
FLAGS_CPLUS_DEMANGLE=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -liberty $(feature_check,cplus-demangle)
has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle) ifeq ($(feature-cplus-demangle), 1)
ifeq ($(has_cplus_demangle),y)
EXTLIBS += -liberty EXTLIBS += -liberty
CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
else else
......
...@@ -11,6 +11,9 @@ FILES= \ ...@@ -11,6 +11,9 @@ FILES= \
test-hello \ test-hello \
test-libaudit \ test-libaudit \
test-libbfd \ test-libbfd \
test-liberty \
test-liberty-z \
test-cplus-demangle \
test-libelf \ test-libelf \
test-libelf-getphdrnum \ test-libelf-getphdrnum \
test-libelf-mmap \ test-libelf-mmap \
...@@ -122,6 +125,15 @@ test-libpython-version: ...@@ -122,6 +125,15 @@ test-libpython-version:
test-libbfd: test-libbfd:
$(BUILD) -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl $(BUILD) -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl
test-liberty:
$(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl -liberty
test-liberty-z:
$(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl -liberty -lz
test-cplus-demangle:
$(BUILD) -liberty
test-on-exit: test-on-exit:
$(BUILD) $(BUILD)
......
extern char *cplus_demangle(const char *, int);
int main(void)
{
cplus_demangle(0, 0);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment