Kai,
If '/opt/i686-apple-darwin9' is the configured $prefix, then the
installed 'cc1plus' should be in :
/opt/i686-apple-darwin9/libexec/gcc/i686-apple-darwin9/4.0.1
and you could simply try the :
./cc1plus -v
there. This should show the built-in search paths for the C++ and C
headers...
thanks for the tip. it seems that cc1plus looks at some bogus directories:
$ /opt/i686-apple-darwin9/libexec/gcc/i686-apple-darwin9/4.0.1/cc1plus -v
ignoring nonexistent directory
"/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../include/c++/4.0.1"
ignoring nonexistent directory
"/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../include/c++/4.0.1/i686-apple-darwin9"
ignoring nonexistent directory
"/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../include/c++/4.0.1/backward"
ignoring nonexistent directory "/opt/i686-apple-darwin9/usr/local/include"
ignoring nonexistent directory
"/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/include"
ignoring nonexistent directory
"/opt/i686-apple-darwin9/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/include"
ignoring duplicate directory "/opt/i686-apple-darwin9/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/opt/i686-apple-darwin9/usr/include
/opt/i686-apple-darwin9/System/Library/Frameworks (framework directory)
End of search list.
(and, actually the program doesn't exit after this)
it seems there's an extra $prefix in front of the search paths. I
configured gcc compilation using the following command:
$ TARGET=i686-apple-darwin9
$ CFLAGS="-m32" LDFLAGS="-m32" ../gcc-5493/configure
--prefix=/opt/$TARGET --disable-checking
--enable-languages=c,objc,c++,obj-c++
--with-as=/opt/$TARGET/bin/${TARGET}-as
--with-ld=/opt/$TARGET/bin/${TARGET}-ld --target=$TARGET
--with-sysroot=/opt/$TARGET --enable-static --enable-shared
--disable-nls --disable-multilib
did I do something wrong?
When building oneself the chosen $prefix etc. will usually be quite
well thought out (yours shows some "must be different from the other
installed cross-GCCs" idea, usually the $prefix is common for them
all), so changing one's mind and installing elsewhere shouldn't have
happened here...
no, it didn't - I set prefix to /opt/$TARGET, see above, and then just
issued make && make install
The './cc1plus -v' command run in the "install" directory :
..../i686-apple-darwin9-gcc -print-search-dirs
will tell this...
the latter output seems to be OK:
$ /opt/i686-apple-darwin9/bin/i686-apple-darwin9-gcc -print-search-dirs
install: /opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/
programs:
=/opt/i686-apple-darwin9/libexec/gcc/i686-apple-darwin9/4.0.1/:/opt/i686-apple-darwin9/libexec/gcc/i686-apple-darwin9/4.0.1/:/opt/i686-apple-darwin9/libexec/gcc/i686-apple-darwin9/:/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/:/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/:/usr/libexec/gcc/i686-apple-darwin9/4.0.1/:/usr/libexec/gcc/i686-apple-darwin9/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/:/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/bin/i686-apple-darwin9/4.0.1/:/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/bin/
libraries:
=/opt/i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/:/opt/i686-apple-darwin9/lib/:/opt/i686-apple-darwin9/usr/lib/i686-apple-darwin9/4.0.1/:/opt/i686-apple-darwin9/usr/lib/:/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/:/opt/i686-apple-darwin9/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/
but the cc1plus search path has an extra $prefix on it. where would I
look in the gcc source codebase to patch this?
Akos