Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 473970 - dev-util/ragel-6.7-r1 fails in configure phase when cross-compiling due to AC_CHECK_FILES usage
Summary: dev-util/ragel-6.7-r1 fails in configure phase when cross-compiling due to AC...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Luca Barbato
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-20 21:59 UTC by jshin
Modified: 2013-08-28 06:26 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
suggested patch (ragel-6.7.diff.v2.txt,574 bytes, patch)
2013-06-20 22:03 UTC, jshin
Details | Diff
output of emerge --info =dev-util/ragel-6.7-r2 (ragel.emerge.info.txt,4.90 KB, text/plain)
2013-06-20 22:06 UTC, jshin
Details
ragel-6.7-r2 build log (ragel-6.7-r1.build.log,4.05 KB, text/plain)
2013-06-20 22:07 UTC, jshin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jshin 2013-06-20 21:59:18 UTC
When ragel-6.7-r1 is cross-compiled, it fails in configure phase because AC_CHECK_FILES used in configure.in does not work with cross-compiling. 

A fix is to replace AC_CHECK_FILES with 'test -r'. Note that AC_CHECK_FILES is meant to check for the presence of a host file as opposed to a build file in the source / build directory. ragel's configure.in uses it to check the presence of DIST file in the source directory. 



Reproducible: Always

Steps to Reproduce:
1. Run 'emerge-arm-generic ragel' inside Chrome OS chroot 
2. 
3.
Actual Results:  
emerge fails in configure.phase. 

Expected Results:  
emerge succeeds and ragel is built for arm-generic. 

I only tried it to build ragel for Chrome OS, but it should happen whenever ragel is cross-compiled because AC_CHECK_FILES bails out whenever it's invoked by autoconf for cross-compilation. See  http://lists.gnu.org/archive/html/autoconf/2000-10/msg00018.html about AC_CHECK_FILES. 

You'll find a suggested patch. (I'll attach this patch as well). 

https://gerrit.chromium.org/gerrit/#/c/59299/3/dev-util/ragel/files/ragel-6.7-config.patch
Comment 1 jshin 2013-06-20 22:03:04 UTC
Created attachment 351496 [details, diff]
suggested patch

This replaces AC_CHECK_FILES with 'test -r'. I also tried adding AC_CHECK_BUILD_FILE to m4 directory and 

I also tried a more sophisticated method, but it didn't work well. I copied the definition of AC_CHECK_FILE from /usr/share/autoconf/autoconf/general.m4 and removed the check for cross-compile, put it in m4/check-file.m4, replaced AC_CHECK_FILE with AC_CHECK_BUILD_FILE in configure.in and ran 'autoreconf -Im4 --force'. However, for a mysterious reason, "aclocal -I m4" (actually m4 processor) went into a seemingly infinite loop. 

The same happened when I tried with  'AT_M4DIR="m4" eautoreconf' in ebuild. 

I believe just using 'test -r' is sufficient in this case.
Comment 2 jshin 2013-06-20 22:06:32 UTC
Created attachment 351498 [details]
output of emerge --info =dev-util/ragel-6.7-r2

emerge -pqv =dev-util/ragel-6.7-r2 has the following:

[ebuild  N    ] dev-util/ragel-6.7-r2  USE="-vim-syntax" 


BTW, don't be confused by 'r2' instead of 'r1'. I meant to make a local change in r2, but 'emerge ragel' was run without any change. r2 is exactly the same as r1.
Comment 3 jshin 2013-06-20 22:07:05 UTC
Created attachment 351500 [details]
ragel-6.7-r2 build log
Comment 4 jshin 2013-06-20 22:07:31 UTC
I also reported this to the ragel's developer by email.
Comment 5 jshin 2013-06-20 22:10:04 UTC
AC_CHECK_FILES($srcdir/DIST) fails with the following error when cross-compiling :

checking for ./DIST... configure: error: cannot check for file existence when cross compiling
Comment 6 SpanKY gentoo-dev 2013-06-20 22:52:54 UTC
(In reply to jshin from comment #1)

i can take care of merging if people are ok with it
Comment 7 jshin 2013-07-03 16:48:26 UTC
(In reply to SpanKY from comment #6)
> (In reply to jshin from comment #1)
> 
> i can take care of merging if people are ok with it

That'd be great (well, I'm nobody here :-)). BTW, I haven't heard back from the upstream developer of ragel.