From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Bender Date: Sat, 20 Feb 2010 19:15:52 +0000 Subject: Re: Hi, how can I compile udev with cross compilation? Message-Id: <4B8034E8.1000607@san.rr.com> List-Id: References: <4B7FB0C6.5070901@gmail.com> In-Reply-To: <4B7FB0C6.5070901@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On 2/20/2010 10:20 AM, Dan Nicholson wrote: > On Sat, Feb 20, 2010 at 8:37 AM, Paul Bender wrote: >> On 2/20/2010 1:52 AM, huyle wrote: >>> >>> Hi, >>> I am currently building an linux system for arm board. I am stuck with >>> udev. So can you help me with some commands to compile udev with cross >>> compilation? >>> Thanks for your time >> >> I am cross compiling udev, but not for the ARM. >> >> The only trouble that I have encountered when cross compiling version 151 is >> with the configure scripts determination of the pci.ids file location. This >> is caused by autoconf's AC_CHECK_FILES macro generating an error when cross >> compiling. However, this can be worked around by setting >> >> ac_cv_file__usr_share_pci_ids='no' >> ac_cv_file__usr_share_hwdata_pci_ids='no' >> ac_cv_file__usr_share_misc_pci_ids='no' >> >> in the build system's environment before running configure and setting the >> configure script's --with-pci-ids-path argument. >> >> I have had this work around for so long that I have not given it much >> thought. However, it is relatively easy to fix the configure script so that >> it only attempting to determine the pci.ids file location when >> --with-pci-ids-path is not set. Therefore, I have created and attached a >> patch that should do this. Of course, after applying, you would need to >> rerun autoconf or autoreconf. > > I think it would be better to just make the AC_CHECK_FILES conditional > on cross compiling: > > if test $cross_compiling != yes; then > AC_CHECK_FILES...pci.ids not found, try --with-pci-ids-path > else > # just assume pciids location > pciids=/usr/share/pci.ids > fi > > Otherwise, people cross compiling will bomb unless they pass > --with-pci-ids-path. Unless I misunderstand AC_ARG_WITH, its third argument is for what to do when the corresponding --with configure argument is not provided, which is how it behaves in my build system (with autoconf 2.63). That is why I put the AC_CHECK_FILES in the third argument. I like your patch better than mine as it does not generate the unhelpful error message: "cannot check for file existence when cross compiling". when the --with-pci-ids-path is not provided. However, for cross compiling, it might be better to force the user to provide --with-pci-ids-path rather than assuming one since an incorrect assumed path would not be discovered until on target runtime. > Likewise, you changed the 'test -n "$pciids"' to > a 'test -x'. I don't know a lot of people with an executable pci > database. Attached is a patch to do this. Doh, that was supposed to be -z. Thanks for the catch.