[Bug bootstrap/12746] configure fails to find out whether a system has ANSI C header files
falemagn at studenti dot unina dot it
gcc-bugzilla@gcc.gnu.org
Wed Nov 12 16:09:00 GMT 2003
------- Additional Comments From falemagn at studenti dot unina dot it 2003-11-12 16:09 -------
(In reply to comment #1)
> I don't quite understand the problem here. GCC doesn't try and run conftest,
> it only tries to build (compile and like) it.
I must disagree here. Looking at the configure file, I see this:
[...]
if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && t
est -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_header_stdc=no
fi
[...]
And as you see, it does (./conftest; exit).
However, the above code *shouldn't* be run if the compiler used is a cross
compiler, because of this:
[...]
if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
[...]
It should take the "then" branch in my case, but it does not. In fact, running
the configure script shows that it tries to detect whether ANSI C header files
are present *before* it detects whether the compiler used is a crosscompiler:
[...]
checking for ANSI C header files... no
checking for uintptr_t... yes
checking for pid_t... yes
checking whether the C compiler (i386-aros-gcc -nix -g -O2 ) works... yes
checking whether the C compiler (i386-aros-gcc -nix -g -O2 ) is a
cross-compiler... yes
[...]
So the problem really is that the last check should be done first.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12746
More information about the Gcc-bugs
mailing list