First of all, I want to tell that I solved this problem, but probably
there's a better way to fix it, that's what I would like to know.
I have "gcc version 2.9-gnupro-98r2" in LynxOS 178. The problem about
it is that it returns 0 always, no matter succeeded it in compiling or
not. So no surprise configure script fails wherever it uses gcc to
compile conftest.c
There's a solution here http://old.nabble.com/Workaround-for-incorrect-gcc-exit-code--td21740259.html
I didn't quite get what is recommended there. I guess it suggests
filling config.site with manual determined options that configure
script usually determines automatically, but it is pretty time
consuming to do it every time.
So I solved this problem like this: I run configure script with gcc-
wrapper. It runs gcc, checks whether gcc printed any errors and then
exits with a proper exit code:
---------------
#!/bin/bash
gcc $* > /tmp/gcc-wrap.out 2> /tmp/gcc-wrap.err
ret=$?
cat /tmp/gcc-wrap.err >&2
cat /tmp/gcc-wrap.out
[[ -n "`cat /tmp/gcc-wrap.err | grep \": error:\"`" ]] && exit 1
exit $ret
--------------
So all you have to do is run like:
env CC=gcc-wrap ./configure
Well unfortunately I'm on windows now :) And its cygwin has no
"mktemp" there. So this script obviously won't behave correctly on
parallel compiling, you should create temporary files for output with
mktemp.
If you did fix this problem the other way how did you do that?
some tags for searching: old ancient gcc compiler returns incorrect
wrong unexpected exit code