From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753884AbdDNOnh (ORCPT ); Fri, 14 Apr 2017 10:43:37 -0400 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:56476 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751521AbdDNOmD (ORCPT ); Fri, 14 Apr 2017 10:42:03 -0400 Subject: Re: [PATCH] tools: iio: add ability to pass kernel headers To: Sekhar Nori References: Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org From: Jonathan Cameron Message-ID: <1f009aa7-f1c0-cf7b-344b-fe83f3b4b7b9@kernel.org> Date: Fri, 14 Apr 2017 15:42:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/04/17 12:06, Sekhar Nori wrote: > Very often, especially when cross compiling, there is a need > to pass kernel headers different from those installed on the > build machine. > > Add support for doing this for iio utils by using the > 'INSTALL_HDR_PATH' environment variable. This is supported by > 'make headers_install' for installing kernel headers at a > user specified location. So you will do: > > $ make headers_install ARCH=arm INSTALL_HDR_PATH= > $ make -C tools/iio ARCH=arm INSTALL_HDR_PATH= > > Signed-off-by: Sekhar Nori It's a bit of an oddity as that usually refers to where to put the headers rather than where they are. Is there a more general solution? I couldn't find anything particularly consistent in tools. > --- > tools/iio/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/iio/Makefile b/tools/iio/Makefile > index 5446d625e17d..75607043d6e2 100644 > --- a/tools/iio/Makefile > +++ b/tools/iio/Makefile > @@ -1,5 +1,5 @@ > CC = $(CROSS_COMPILE)gcc > -CFLAGS += -Wall -g -D_GNU_SOURCE > +CFLAGS += -Wall -g -D_GNU_SOURCE -I$(INSTALL_HDR_PATH)/include > > BINDIR=usr/bin > INSTALL_PROGRAM=install -m 755 -p >