perf_counter tools: Fix libbfd detection for systems with libz dependency
authorMike Galbraith <efault@gmx.de>
Sat, 8 Aug 2009 12:14:15 +0000 (14:14 +0200)
committerIngo Molnar <mingo@elte.hu>
Sun, 9 Aug 2009 10:54:47 +0000 (12:54 +0200)
Due to a libz dependency in some distro's binutils package,
C++ demangle support isn't compiled in despite the necessary
libraries being available.

Fix this by adding a -lz link test to the dependency detection
rules.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1249733655.6929.5.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/Makefile

index 1916e44b9bb0254cf46de961ed4b43422a98b4f1..60411e94113be47ee778f2d5f3e54b396945850e 100644 (file)
@@ -387,10 +387,14 @@ else
 
        has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty > /dev/null 2>&1 && echo y")
 
+       has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty -lz > /dev/null 2>&1 && echo y")
+
        ifeq ($(has_bfd),y)
                EXTLIBS += -lbfd
        else ifeq ($(has_bfd_iberty),y)
                EXTLIBS += -lbfd -liberty
+       else ifeq ($(has_bfd_iberty_z),y)
+               EXTLIBS += -lbfd -liberty -lz
        else
                msg := $(warning No bfd.h/libbfd found, install binutils-dev[el] to gain symbol demangling)
                BASIC_CFLAGS += -DNO_DEMANGLE