linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev, input/linux.h and cross compilation
@ 2010-01-20 18:21 Paul Bender
  2010-01-20 18:30 ` Kay Sievers
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Paul Bender @ 2010-01-20 18:21 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

The top level Makefile.am hard codes /usr/include/linux/input.h for use 
in the generation of extras/keymap/keys.txt. Such hard coding does not 
work when cross compiling as the linux/input.h file that should be used 
is the cross environment's linux/include.h not /usr/include/linux/input.h.

I have attached a patch that determines the correct linux/include.h file 
during configure. The configure change makes use of the 
AX_ABOLUTE_HEADER 
http://www.nongnu.org/autoconf-archive/ax_absolute_header.html, which 
the patch adds to the m4.

[-- Attachment #2: udev-150-absolute_linux_input_h.patch.gz --]
[-- Type: application/gzip, Size: 1902 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev, input/linux.h and cross compilation
  2010-01-20 18:21 udev, input/linux.h and cross compilation Paul Bender
@ 2010-01-20 18:30 ` Kay Sievers
  2010-01-20 18:59 ` Paul Bender
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2010-01-20 18:30 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Jan 20, 2010 at 19:21, Paul Bender <pebender@san.rr.com> wrote:
> The top level Makefile.am hard codes /usr/include/linux/input.h for use in
> the generation of extras/keymap/keys.txt. Such hard coding does not work
> when cross compiling as the linux/input.h file that should be used is the
> cross environment's linux/include.h not /usr/include/linux/input.h.
>
> I have attached a patch that determines the correct linux/include.h file
> during configure. The configure change makes use of the AX_ABOLUTE_HEADER
> http://www.nongnu.org/autoconf-archive/ax_absolute_header.html, which the
> patch adds to the m4.

Why is all this magic needed? Can't you just use:
  extras/keymap/keys.txt: $(includedir)/linux/input.h

Thanks,
Kay

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev, input/linux.h and cross compilation
  2010-01-20 18:21 udev, input/linux.h and cross compilation Paul Bender
  2010-01-20 18:30 ` Kay Sievers
@ 2010-01-20 18:59 ` Paul Bender
  2010-01-21 11:00 ` Martin Pitt
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Paul Bender @ 2010-01-20 18:59 UTC (permalink / raw)
  To: linux-hotplug

On 1/20/2010 10:30 AM, Kay Sievers wrote:
> On Wed, Jan 20, 2010 at 19:21, Paul Bender<pebender@san.rr.com>  wrote:
>> The top level Makefile.am hard codes /usr/include/linux/input.h for use in
>> the generation of extras/keymap/keys.txt. Such hard coding does not work
>> when cross compiling as the linux/input.h file that should be used is the
>> cross environment's linux/include.h not /usr/include/linux/input.h.
>>
>> I have attached a patch that determines the correct linux/include.h file
>> during configure. The configure change makes use of the AX_ABOLUTE_HEADER
>> http://www.nongnu.org/autoconf-archive/ax_absolute_header.html, which the
>> patch adds to the m4.
>
> Why is all this magic needed? Can't you just use:
>    extras/keymap/keys.txt: $(includedir)/linux/input.h
>
> Thanks,
> Kay

Using ${includedir} is not sufficient because ${includedir} is in the 
run time path. The cross build files are installed in 
${DESTDIR}${includedir} not ${includedir} on the build system.

For me, ${DESTDIR}${includedir} would be sufficient. However, I figured 
that depending on a detection macro used by (and therefore fixed for) 
multiple packages on multiple distributions was better than hard coding 
${DESTDIR}${includedir}.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev, input/linux.h and cross compilation
  2010-01-20 18:21 udev, input/linux.h and cross compilation Paul Bender
  2010-01-20 18:30 ` Kay Sievers
  2010-01-20 18:59 ` Paul Bender
@ 2010-01-21 11:00 ` Martin Pitt
  2010-01-22  1:29 ` Paul Bender
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Martin Pitt @ 2010-01-21 11:00 UTC (permalink / raw)
  To: linux-hotplug

Hello,

Paul Bender [2010-01-20 10:21 -0800]:
> The top level Makefile.am hard codes /usr/include/linux/input.h for
> use in the generation of extras/keymap/keys.txt. Such hard coding
> does not work when cross compiling as the linux/input.h file that
> should be used is the cross environment's linux/include.h not
> /usr/include/linux/input.h.

Could we use

  $ echo '#include <linux/input.h>' | cpp -M | xargs -n1 | grep linux/input.h
  /usr/include/linux/input.h

to figure out the real path?

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev, input/linux.h and cross compilation
  2010-01-20 18:21 udev, input/linux.h and cross compilation Paul Bender
                   ` (2 preceding siblings ...)
  2010-01-21 11:00 ` Martin Pitt
@ 2010-01-22  1:29 ` Paul Bender
  2010-01-22 14:02 ` Dan Nicholson
  2010-01-24 19:23 ` Kay Sievers
  5 siblings, 0 replies; 7+ messages in thread
From: Paul Bender @ 2010-01-22  1:29 UTC (permalink / raw)
  To: linux-hotplug

On 1/21/2010 3:00 AM, Martin Pitt wrote:
> echo '#include<linux/input.h>' | cpp -M | xargs -n1 | grep linux/input.h

I believe that would work once cpp is replaced with $ac_cpp so that the 
correct cpp is used (the one pointed to by $CPP) and the correct cpp 
flags are used (the flags in $CPPFLAGS). However, it adds dependencies 
on grep and xargs, both of which would need to be tested for.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev, input/linux.h and cross compilation
  2010-01-20 18:21 udev, input/linux.h and cross compilation Paul Bender
                   ` (3 preceding siblings ...)
  2010-01-22  1:29 ` Paul Bender
@ 2010-01-22 14:02 ` Dan Nicholson
  2010-01-24 19:23 ` Kay Sievers
  5 siblings, 0 replies; 7+ messages in thread
From: Dan Nicholson @ 2010-01-22 14:02 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Jan 21, 2010 at 5:29 PM, Paul Bender <pebender@san.rr.com> wrote:
> On 1/21/2010 3:00 AM, Martin Pitt wrote:
>>
>> echo '#include<linux/input.h>' | cpp -M | xargs -n1 | grep linux/input.h
>
> I believe that would work once cpp is replaced with $ac_cpp so that the
> correct cpp is used (the one pointed to by $CPP) and the correct cpp flags
> are used (the flags in $CPPFLAGS). However, it adds dependencies on grep and
> xargs, both of which would need to be tested for.

I'm pretty sure libtool is already using grep. However, here's an
alternative just using sed:

echo '#include <linux/input.h>' | cpp -M | sed -n
'/linux\/input.h/s,.* \(.*linux/input.h\).*,\1,p'

--
Dan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev, input/linux.h and cross compilation
  2010-01-20 18:21 udev, input/linux.h and cross compilation Paul Bender
                   ` (4 preceding siblings ...)
  2010-01-22 14:02 ` Dan Nicholson
@ 2010-01-24 19:23 ` Kay Sievers
  5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2010-01-24 19:23 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Jan 22, 2010 at 15:02, Dan Nicholson <dbn.lists@gmail.com> wrote:
> On Thu, Jan 21, 2010 at 5:29 PM, Paul Bender <pebender@san.rr.com> wrote:
>> On 1/21/2010 3:00 AM, Martin Pitt wrote:
>>>
>>> echo '#include<linux/input.h>' | cpp -M | xargs -n1 | grep linux/input.h
>>
>> I believe that would work once cpp is replaced with $ac_cpp so that the
>> correct cpp is used (the one pointed to by $CPP) and the correct cpp flags
>> are used (the flags in $CPPFLAGS). However, it adds dependencies on grep and
>> xargs, both of which would need to be tested for.
>
> I'm pretty sure libtool is already using grep. However, here's an
> alternative just using sed:
>
> echo '#include <linux/input.h>' | cpp -M | sed -n
> '/linux\/input.h/s,.* \(.*linux/input.h\).*,\1,p'

Yeah, looks fine. I ended up with:
  $ echo '#include <linux/errno.h>'| \
    cpp -E| \
    sed '/linux\/errno.h/!d; s:.*"\(.*\)/linux/errno.h".*:\1:; /.*/q'
  /usr/include

to find the prefix for the current system include we can use in the Makefile.

Kay

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-24 19:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 18:21 udev, input/linux.h and cross compilation Paul Bender
2010-01-20 18:30 ` Kay Sievers
2010-01-20 18:59 ` Paul Bender
2010-01-21 11:00 ` Martin Pitt
2010-01-22  1:29 ` Paul Bender
2010-01-22 14:02 ` Dan Nicholson
2010-01-24 19:23 ` Kay Sievers

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).