Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1627484

Re: [PATCH] tools: iio: add ability to pass kernel headers

From Sekhar Nori <nsekhar@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH] tools: iio: add ability to pass kernel headers
Date 2017-04-20 16:00 +0200
Message-ID <tykMP-1ck-39@gated-at.bofh.it> (permalink)
References <tv1Qm-6cc-7@gated-at.bofh.it> <twaHT-2g9-5@gated-at.bofh.it> <twbkC-2J3-5@gated-at.bofh.it> <twbkC-2J3-3@gated-at.bofh.it> <txyoO-4Yj-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tuesday 18 April 2017 03:42 PM, Sekhar Nori wrote:
> Hi Jonathan, Randy,
> 
> On Friday 14 April 2017 08:53 PM, Jonathan Cameron wrote:
>> On 14/04/17 16:23, Randy Dunlap wrote:
>>> On 04/14/17 07:42, Jonathan Cameron wrote:
>>>> 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=<absolute-path>
>>>>> $ make -C tools/iio ARCH=arm INSTALL_HDR_PATH=<absolute-path>
>>>>>
>>>>> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
>>>>
>>>> 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.
>>>
>>> Whatever the solution is, it should be used for all tools/, not just iio.
>>>
>> Agreed!
> 
> Alright, I will try to come up with something more generic and post
> another version.

I have been looking at this, and coming up with something generic is
more complicated than I thought. The problem is the flexibility thats
allowed in building many of the tools. For example, you can build the
led tools using any of these three methods:

$ make -C <kernelsrcdir> tools/leds
$ make -C <kernelsrcdir>/tools leds
$ make -C <kernelsrcdir>/tools/leds

The last one is specifically complicated because it totally bypasses all
top level makefiles. I think adding dependency with a top level makefile
will be a step backwards at least for leds.

Currently the leds makefile adds '-I../../include/uapi' to CFLAGS to
access the latest kernel headers. Something similar is done for some
other tools too. This makes it work for all the build cases above. I
propose we do something similar for iio too.

Thanks,
Sekhar

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] tools: iio: add ability to pass kernel headers Sekhar Nori <nsekhar@ti.com> - 2017-04-11 13:10 +0200
  Re: [PATCH] tools: iio: add ability to pass kernel headers Jonathan Cameron <jic23@kernel.org> - 2017-04-14 16:50 +0200
    Re: [PATCH] tools: iio: add ability to pass kernel headers Jonathan Cameron <jic23@kernel.org> - 2017-04-14 17:30 +0200
      Re: [PATCH] tools: iio: add ability to pass kernel headers Sekhar Nori <nsekhar@ti.com> - 2017-04-18 12:20 +0200
        Re: [PATCH] tools: iio: add ability to pass kernel headers Sekhar Nori <nsekhar@ti.com> - 2017-04-20 16:00 +0200
          Re: [PATCH] tools: iio: add ability to pass kernel headers Randy Dunlap <rdunlap@infradead.org> - 2017-04-20 17:30 +0200
    Re: [PATCH] tools: iio: add ability to pass kernel headers Randy Dunlap <rdunlap@infradead.org> - 2017-04-14 17:30 +0200

csiph-web