This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: relative include search path
- From: Denis Onischenko <denis dot onischenko at gmail dot com>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 29 May 2009 12:18:40 +0300
- Subject: Re: relative include search path
- References: <c80516030905250413s63557d13t57913107fa017051@mail.gmail.com> <4A1A8BD7.8010305@gmail.com>
> ?So that you can move the entire installation somewhere else and it will all
> work because it will all be in the same relative locations compared to the new
> $prefix as it was when installed in the original $prefix.
>
> ?What you have done is move a single part of the installation to a new
> location and leave the rest behind. ?That is not supported, and there's no
> simple and direct way in which it could be.
I don't moved a single part of the installation to a new location. I
have built minimal system (grub, linux kernel, libc, bash and gcc)
using cross compiler, and I am trying to compile simple file that
includes <stddef.h>. gcc compiles this file only when I invoke it from
/usr/bin, where it was installed. i.e.
cd /usr/bin
gcc -v test.c
When gcc is invoked from another directory without "cd /usr/bin", it
can not find the stddef.h.
"gcc -v test.c" prints relative include path
("../lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include"), while "gcc -v
test.c", invoked on my main system prints absolute include path, i.e
it prepends directory where the gcc is located to the
"../lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include".
So question is: why gcc can not prepend its location when it searches
for include files ?