diff options
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r-- | tools/perf/Makefile | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 4b20fa47c3ab..ff905aceb4fd 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -345,7 +345,6 @@ BUILTIN_OBJS += builtin-stat.o | |||
345 | BUILTIN_OBJS += builtin-top.o | 345 | BUILTIN_OBJS += builtin-top.o |
346 | 346 | ||
347 | PERFLIBS = $(LIB_FILE) | 347 | PERFLIBS = $(LIB_FILE) |
348 | EXTLIBS = -lbfd -liberty | ||
349 | 348 | ||
350 | # | 349 | # |
351 | # Platform specific tweaks | 350 | # Platform specific tweaks |
@@ -374,6 +373,23 @@ ifeq ($(uname_S),Darwin) | |||
374 | PTHREAD_LIBS = | 373 | PTHREAD_LIBS = |
375 | endif | 374 | endif |
376 | 375 | ||
376 | ifdef NO_DEMANGLE | ||
377 | BASIC_CFLAGS += -DNO_DEMANGLE | ||
378 | else | ||
379 | |||
380 | has_bfd := $(shell sh -c "(echo '\#include <stdio.h>'; echo '\#include <bfd.h>'; echo '\#ifndef DMGL_PARAMS'; echo '\#define DMGL_PARAMS (1 << 0)'; echo '\#define DMGL_ANSI (1 << 1)'; echo '\#endif'; echo 'int main(int argc, char **argv) { bfd_demangle(NULL, argv[0], DMGL_PARAMS | DMGL_ANSI); return 0; }') | gcc -x c - -lbfd > /dev/null 2>&1 && echo y") | ||
381 | |||
382 | has_bfd_iberty := $(shell sh -c "(echo '\#include <stdio.h>'; echo '\#include <bfd.h>'; echo '\#ifndef DMGL_PARAMS'; echo '\#define DMGL_PARAMS (1 << 0)'; echo '\#define DMGL_ANSI (1 << 1)'; echo '\#endif'; echo 'int main(int argc, char **argv) { bfd_demangle(NULL, argv[0], DMGL_PARAMS | DMGL_ANSI); return 0; }') | gcc -x c - -lbfd -liberty > /dev/null 2>&1 && echo y") | ||
383 | |||
384 | ifeq ($(has_bfd),y) | ||
385 | EXTLIBS += -lbfd | ||
386 | else ifeq ($(has_bfd_iberty),y) | ||
387 | EXTLIBS += -lbfd -liberty | ||
388 | else | ||
389 | BASIC_CFLAGS += -DNO_DEMANGLE | ||
390 | endif | ||
391 | endif | ||
392 | |||
377 | ifndef CC_LD_DYNPATH | 393 | ifndef CC_LD_DYNPATH |
378 | ifdef NO_R_TO_GCC_LINKER | 394 | ifdef NO_R_TO_GCC_LINKER |
379 | # Some gcc does not accept and pass -R to the linker to specify | 395 | # Some gcc does not accept and pass -R to the linker to specify |