diff options
author | Jamie Iles <jamie.iles@picochip.com> | 2009-12-11 04:21:00 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-11 05:24:13 -0500 |
commit | cc835752ae3634acd2d487fdf5152f6075f45aef (patch) | |
tree | 04f213117690cac7052cdfd75c8ee9ba429f98ce /tools/perf | |
parent | 0bb38a5cdeb39f543657ec6fb9950343d2de6918 (diff) |
perf tools: Allow cross compiling
For embedded platforms, we want to be able to build the perf
tools on a build machine to run on a different arch. This patch
allows $CROSS_COMPILE to set the cross compiler.
Additionally, if NO_LIBPERL is set, then don't use perl include
paths as they will be for the host arch.
Signed-off-by: Jamie Iles <jamie.iles@picochip.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1260523260-15694-2-git-send-email-jamie.iles@picochip.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/Makefile | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 23ec66098bdc..e2ee3b589af7 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -237,8 +237,8 @@ lib = lib | |||
237 | 237 | ||
238 | export prefix bindir sharedir sysconfdir | 238 | export prefix bindir sharedir sysconfdir |
239 | 239 | ||
240 | CC = gcc | 240 | CC = $(CROSS_COMPILE)gcc |
241 | AR = ar | 241 | AR = $(CROSS_COMPILE)ar |
242 | RM = rm -f | 242 | RM = rm -f |
243 | TAR = tar | 243 | TAR = tar |
244 | FIND = find | 244 | FIND = find |
@@ -492,8 +492,10 @@ else | |||
492 | LIB_OBJS += util/probe-finder.o | 492 | LIB_OBJS += util/probe-finder.o |
493 | endif | 493 | endif |
494 | 494 | ||
495 | ifndef NO_LIBPERL | ||
495 | PERL_EMBED_LDOPTS = `perl -MExtUtils::Embed -e ldopts 2>/dev/null` | 496 | PERL_EMBED_LDOPTS = `perl -MExtUtils::Embed -e ldopts 2>/dev/null` |
496 | PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` | 497 | PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` |
498 | endif | ||
497 | 499 | ||
498 | ifneq ($(shell sh -c "(echo '\#include <EXTERN.h>'; echo '\#include <perl.h>'; echo 'int main(void) { perl_alloc(); return 0; }') | $(CC) -x c - $(PERL_EMBED_CCOPTS) -o /dev/null $(PERL_EMBED_LDOPTS) > /dev/null 2>&1 && echo y"), y) | 500 | ifneq ($(shell sh -c "(echo '\#include <EXTERN.h>'; echo '\#include <perl.h>'; echo 'int main(void) { perl_alloc(); return 0; }') | $(CC) -x c - $(PERL_EMBED_CCOPTS) -o /dev/null $(PERL_EMBED_LDOPTS) > /dev/null 2>&1 && echo y"), y) |
499 | BASIC_CFLAGS += -DNO_LIBPERL | 501 | BASIC_CFLAGS += -DNO_LIBPERL |