From: Kay Sievers Date: Sun, 24 Jan 2010 19:23:05 +0000 Subject: Re: udev, input/linux.h and cross compilation Message-Id: List-Id: References: <4B5749A9.2090005@san.rr.com> In-Reply-To: <4B5749A9.2090005@san.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Fri, Jan 22, 2010 at 15:02, Dan Nicholson wrote: > On Thu, Jan 21, 2010 at 5:29 PM, Paul Bender wrote: >> On 1/21/2010 3:00 AM, Martin Pitt wrote: >>> >>> echo '#include' | 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 ' | cpp -M | sed -n > '/linux\/input.h/s,.* \(.*linux/input.h\).*,\1,p' Yeah, looks fine. I ended up with: $ echo '#include '| \ 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