From: Wheeler, Fred (Research) <wheeler@cr...> - 2002-07-23 18:25:48
Should the AC_TRY_COMPILE command for sqrtf in $VXLSRC/aclocal.m4 be an AC_TRY_LINK instead? I think
it should, but I have no autoconf experience, so I'm hesitant to make the change.
In Solaris 2.7 with gcc-3.0.4, the test program produced by the configure script compiles (as a C
program) but does not link due to "undefined reference to `sqrtf'". I get the exact same behavior is
I use "foosqrtf" instead of "sqrtf". It seems like the link step is what a test for sqrtf() should
ride on. During the compile there is an "implicit declaration of function `sqrtf'", but that causes
a warning at most - the compile still succeeds.
( The Solaris dashboard builds find sqrtf for some mysterious reason I do not yet fully understand.
It seems that sqrtf shows up somewhere when you compile a C program that uses it and then link using
g++. This may have something to do with sqrtf being a gcc builtin. Unfortunately, this magic does
not work for all version of gcc and Solaris, so we have run into this problem. )
Fred Wheeler, GE CRD, KWC-303
Phone: 518-387-7225 (GE Internal Dialcom: 8*833-7225)
Fax: 518-387-4042 (GE Internal Dialcom: 8*833-4042)
From: Peter Vanroose <Peter.V<anroose@es...> - 2002-08-06 10:13:56
> Should the AC_TRY_COMPILE command for sqrtf in $VXLSRC/aclocal.m4 be an AC_TRY_LINK instead? I think
> it should, but I have no autoconf experience, so I'm hesitant to make the change.
Yes, you are most probably right. I'm not very familiar with autoconf
neither; I tried to use AC_TRY_LINK but this did not work (for reasons
I have forgotten) so I switched to AC_TRY_COMPILE, under the assumption
that the compile would fail when math.h did not declare sqrtf(). Which
was not a valid assumption, as you pointed out.
Does somebody have a better suggestion?