From: tip-bot for Joonsoo Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
mingo@redhat.com, hpa@zytor.com, mingo@kernel.org,
a.p.zijlstra@chello.nl, namhyung@kernel.org, tglx@linutronix.de,
iamjoonsoo.kim@lge.com
Subject: [tip:perf/urgent] tools lib lk: Fix for cross build
Date: Fri, 12 Jul 2013 01:50:09 -0700 [thread overview]
Message-ID: <tip-079787f209416416383c74ea5d5044be2d586f5e@git.kernel.org> (raw)
In-Reply-To: <1371603750-15053-2-git-send-email-iamjoonsoo.kim@lge.com>
Commit-ID: 079787f209416416383c74ea5d5044be2d586f5e
Gitweb: http://git.kernel.org/tip/079787f209416416383c74ea5d5044be2d586f5e
Author: Joonsoo Kim <iamjoonsoo.kim@lge.com>
AuthorDate: Wed, 19 Jun 2013 10:02:29 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 8 Jul 2013 17:36:17 -0300
tools lib lk: Fix for cross build
Currently, lib lk doesn't use CROSS_COMPILE environment variable, so
cross build always fails.
This is a quick fix for this problem.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1371603750-15053-2-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/lk/Makefile | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tools/lib/lk/Makefile b/tools/lib/lk/Makefile
index 2c5a197..f0ecc0a 100644
--- a/tools/lib/lk/Makefile
+++ b/tools/lib/lk/Makefile
@@ -3,6 +3,21 @@ include ../../scripts/Makefile.include
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
+# Makefiles suck: This macro sets a default value of $(2) for the
+# variable named by $(1), unless the variable has been set by
+# environment or command line. This is necessary for CC and AR
+# because make sets default values, so the simpler ?= approach
+# won't work as expected.
+define allow-override
+ $(if $(or $(findstring environment,$(origin $(1))),\
+ $(findstring command line,$(origin $(1)))),,\
+ $(eval $(1) = $(2)))
+endef
+
+# Allow setting CC and AR, or setting CROSS_COMPILE as a prefix.
+$(call allow-override,CC,$(CROSS_COMPILE)gcc)
+$(call allow-override,AR,$(CROSS_COMPILE)ar)
+
# guard against environment variables
LIB_H=
LIB_OBJS=
next prev parent reply other threads:[~2013-07-12 8:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 1:02 [PATCH 1/3] perf record: support duration option to run during specified time Joonsoo Kim
2013-06-19 1:02 ` [PATCH 2/3] tools lib lk: Fix for cross build Joonsoo Kim
2013-07-12 8:50 ` tip-bot for Joonsoo Kim [this message]
2013-06-19 1:02 ` [PATCH 3/3] perf tools: include termios.h explicitly Joonsoo Kim
2013-06-19 11:33 ` Ingo Molnar
2013-06-19 12:16 ` Namhyung Kim
2013-06-20 1:45 ` Joonsoo Kim
2013-06-19 14:52 ` David Ahern
2013-07-12 8:49 ` [tip:perf/urgent] perf tools: Include " tip-bot for Joonsoo Kim
2013-06-29 0:27 ` [PATCH 1/3] perf record: support duration option to run during specified time Sukadev Bhattiprolu
2013-07-01 5:46 ` Joonsoo Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-079787f209416416383c74ea5d5044be2d586f5e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=hpa@zytor.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).