From: Liang Li <liang.li@windriver.com>
To: <a.p.zijlstra@chello.nl>, <paulus@samba.org>, <mingo@redhat.com>,
<acme@ghostprotocols.net>
Cc: <linux-kernel@vger.kernel.org>, <richard.purdie@linuxfoundation.org>
Subject: [RFC PATCH] perf: add SLANG_INC for slang.h
Date: Fri, 24 Aug 2012 11:10:39 +0800 [thread overview]
Message-ID: <1345777839-15843-1-git-send-email-liang.li@windriver.com> (raw)
CFLAGS was previously hard coded to contain "-I/usr/include/slang" to
work with hosts that have "/usr/include/slang/slang.h" as well as hosts
that have "/usr/include/slang.h". This path can cause compile warnings
like:
cc1: warning: '/usr/include/slang' doesn't exists.
or
cc1: warning: include location "/usr/include/slang" is unsafe for
cross-compilation [-Wpoison-system-directories]
Then in some cases warnings become errors if WERROR is enabled hence
build errors.
To fix this issue, we can use -idirafter to downgrade the priority of the
default hard coded path. We can also make the slang include directory
a variable, to allow the user to specify SLANG_INC and set their own
include location. And add a '=' prefix to indicate better
compatibility with sysroot/cross compile cases.
Signed-off-by: Liang Li <liang.li@windriver.com>
---
tools/perf/Makefile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index b7a7a87..e403c36 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -496,8 +496,10 @@ else
msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev);
BASIC_CFLAGS += -DNO_NEWT_SUPPORT
else
- # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
- BASIC_CFLAGS += -I/usr/include/slang
+ # Some releases like Fedora has /usr/include/slang/slang.h other than /usr/include/slang.h
+ SLANG_INC ?= -idirafter =/usr/include/slang
+ BASIC_CFLAGS += $(SLANG_INC)
+
EXTLIBS += -lnewt -lslang
LIB_OBJS += $(OUTPUT)ui/setup.o
LIB_OBJS += $(OUTPUT)ui/browser.o
--
1.7.11.4
next reply other threads:[~2012-08-24 3:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-24 3:10 Liang Li [this message]
2012-09-05 20:54 ` [RFC PATCH] perf: add SLANG_INC for slang.h Arnaldo Carvalho de Melo
2012-09-05 21:23 ` Richard Purdie
2012-09-05 22:41 ` Arnaldo Carvalho de Melo
2012-09-06 2:11 ` Liang Li
2012-09-06 13:55 ` Arnaldo Carvalho de Melo
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=1345777839-15843-1-git-send-email-liang.li@windriver.com \
--to=liang.li@windriver.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=richard.purdie@linuxfoundation.org \
/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).