This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Mac OS X cross-compiler not finding system include files?
- From: Andrew Haley <aph at redhat dot com>
- To: MarÃy Ãkos <akos at maroy dot hu>
- Cc: Kai Ruottu <kai dot ruottu at wippies dot com>, gcc-help at gcc dot gnu dot org
- Date: Wed, 08 Jul 2009 16:59:26 +0100
- Subject: Re: Mac OS X cross-compiler not finding system include files?
- References: <4A5486E3.9020302@maroy.hu> <4A54A3E2.8000407@wippies.com> <4A54BFE1.4040305@maroy.hu>
MarÃy Ãkos wrote:
> 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?
With this, your prefix is going to the same as your sysroot. I can't imagine
that this is what you really want. The prefix is supposed to be where your cross-
toolchain gets installed, the sysroot, is where you put the target headers and
libraries.
Andrew.