Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc835752 authored by Jamie Iles's avatar Jamie Iles Committed by Ingo Molnar
Browse files

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: default avatarJamie 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: default avatarIngo Molnar <mingo@elte.hu>
parent 0bb38a5c
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -237,8 +237,8 @@ lib = lib


export prefix bindir sharedir sysconfdir
export prefix bindir sharedir sysconfdir


CC = gcc
CC = $(CROSS_COMPILE)gcc
AR = ar
AR = $(CROSS_COMPILE)ar
RM = rm -f
RM = rm -f
TAR = tar
TAR = tar
FIND = find
FIND = find
@@ -492,8 +492,10 @@ else
	LIB_OBJS += util/probe-finder.o
	LIB_OBJS += util/probe-finder.o
endif
endif


ifndef NO_LIBPERL
PERL_EMBED_LDOPTS = `perl -MExtUtils::Embed -e ldopts 2>/dev/null`
PERL_EMBED_LDOPTS = `perl -MExtUtils::Embed -e ldopts 2>/dev/null`
PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
endif


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)
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)
	BASIC_CFLAGS += -DNO_LIBPERL
	BASIC_CFLAGS += -DNO_LIBPERL