Hello Jay, * Jay K wrote on Sat, Nov 06, 2010 at 06:02:54PM CET: > jkr...@current9s :~ > echo "int main(){}" > 1.c > jkr...@current9s :~ > /opt/csw/gcc4/bin/g++ 1.c > jkr...@current9s :~ > ./a.out > ld.so.1: a.out: fatal: libstdc++.so.6: open failed: No such file or directory > Killed > > > now, this is some local problem. > My complaint to autoconf though, is that in this situation, autoconf blithely > produced: > > config.h: > #define SIZEOF_INT 0 > #define SIZEOF_LONG 0 > > I think it should notice that and error out loudly/early.
You can (and probably should) have a test before these tests that ensures that the C++ compiler actually works. It might be a bug that AC_PROG_CXX doesn't always ensures this, but fact is that it is that way with the current Autoconf version. (In fact, it is sometimes necessary in the GCC build tree that AC_PROG_CXX accepts a compiler that doesn't yet fully work, that is part of bootstrapping). The AC_CHECK_SIZEOF tests (and other tests) should not each re-check whether the compiler works. That would slow lost of them down for little gain. > If autoconf were really clever, I'd like it to recognize this situation and > fallback to /usr/bin/CC, which works. > But ok either way. I'm setting CXX to it now. That's another thing that would maybe apply to AC_PROG_CXX, but in order to judge that we'd need to see a full example and why it isn't working that way. > Also, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46334 is maybe an autoconf > bug. > If set CXX=/usr/bin/CC and I don't set CC, then CC gets gcc flags and warns > like crazy. > Or it might be stuff specific in gcc's Makefile... Please report independent issues in independent emails, thanks. Please, when you report bugs, provide enough information to actually reproduce the issue, like the system you're building on, the config.log for the subtree you're building, etc. Thanks, Ralf