FTGL and fedora-mingw

Chris Thielen chris at epiar.net
Wed Oct 6 18:14:46 UTC 2010


Hi folks,

I've been attempting to cross compile FTGL (Freetype-based OpenGL font 
rendering library) on Fedora 13 using MinGW. The latest release seems to 
have its trivial issues with MinGW (not using MinGW's OpenGL linker 
flags, etc.) but a snapshot of their SVN today is much better. I only 
ran into one issue.

The following two lines from FTGL's configure.ac seem to cause the problem:
BC_COMPILER_AND_LINKER_RECOGNIZES([-W -Wall -Wundef -Wfloat-equal 
-Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare 
-Winline -Waggregate-return], [warning])
BC_COMPILER_AND_LINKER_RECOGNIZES([-Wstrict-prototypes 
-Wmissing-prototypes -Wnested-externs], [warncflags], [no])

I've never used BC_COMPILER_AND_LINKER_RECOGNIZES personally, but it 
seems to be used in a few different open source packages, though the 
compiler.m4 file it comes from seems distributed with each package 
instead of being part of the system. That compiles a test which it then 
tries to run, issuing the error:

checking if compiler and linker recognize -W -Wall -Wundef -Wfloat-equal 
  -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare 
-Winline -Waggregate-return... configure: error: in 
`/usr/local/src/ftgl/trunk':
configure: error: cannot run test program while cross compiling
See `config.log' for more details.

That particular error, 'cannot run test program while cross compiling' 
does not seem to be generated from within the FTGL's configure macros 
and must be coming from the system.

My guess is this compiler.m4 needs to be updated with cross-compiling in 
mind, perhaps assuming a valid compile with no running test will be good 
enough when cross-compiling.

I'm asking on fedora-mingw as I imagine folks on this list have run into 
this error before, or issues like it, though I realize it is perhaps 
more specifically a GNU autotools question. Does anybody have any advice 
on the proper way to fix this .m4 file?

The .m4 in question is here: 
http://ftgl.svn.sourceforge.net/viewvc/ftgl/trunk/m4/compiler.m4?revision=1260&view=markup 
and the configure.ac in question is here: 
http://ftgl.svn.sourceforge.net/viewvc/ftgl/trunk/configure.ac?revision=1260&view=markup

Thanks in advance for any advice that can be given. I'm also 
familiarizing myself with the Fedora package maintainer process and hope 
to add a mingw32-ftgl package to the repos soon -- which begs a separate 
question: as FTGL's SVN seems to have cross compiling fixed up a bit 
better than their last release, would it be inadvisable to construct a 
package for the repos based on SVN? Is it typical to wait for the next 
point release?

- Chris Thielen


More information about the mingw mailing list