Bernie Bright wrote:Erik,
/ Compiles okay on Mandrake 9.2/10.0 (glibc-2.3.3 and gcc-3.3.2). However this/>/ should really be tested for by the configure script - AC_CHECK_FUNCS(truncf) />/ and panel.cxx should then contain: / I'll add a test for it.
Erik
Unfortunately, FlightGear still doesn't compile on RedHat 7.3, even with the above configure script check for truncf (I haven't checked it out on RedHat 9 yet). I did figure out how to get it to work though (see below).
The problem is that although truncf is present in Red Hat 7.3's glibc libraries, a declaration for truncf is not provided in <math.h>, unless _ISOC99_SOURCE is defined (maybe this is a Red Hat peculiarity, since Bernie said that he had no problems compiling on Mandrake -- can any other Red Hat users confirm this compilation problem?). The configure script effectively only tests for the presence of the truncf function in the library, so the check succeeds. When I run 'make' to compile FlightGear however, compilation fails with the error that truncf is undeclared (even though the configure script check passed!).
I can get around this problem by using the preprocessor option "-D_GNU_SOURCE", which in turn defines _ISOC99_SOURCE (you can't simply define _ISOC99_SOURCE, since that will cause some other macros to be un-defined, which causes the configure script check for plib to fail. Maddening!). With _GNU_SOURCE defined, truncf gets declared and compilation proceeds without error.
So, my question to the autoconf gurus is this: Is there a way to test in the configure script to see if truncf is declared in math.h, and if not, to add "-D_GNU_SOURCE" to the preprocessor options (if the compiler is gcc) and check for a declaration of truncf again? I'm willing to drop the subject and just add "-D_GNU_SOURCE" to the CPPFLAGS environment variable in my personal FlightGear build script, but if a test is available that will automagically sort out all these issues for all platforms, that would be a better solution.
Thanks, -Eric Hathaway
_______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel