How to find out about system paths?
Zack Weinberg
zackw@stanford.edu
Mon Dec 11 22:08:00 GMT 2000
On Mon, Dec 11, 2000 at 09:20:09PM -0800, Stephen C. Biggs wrote:
> My question is: how do you see what your local version has already
> defined...
Run the compiler with -v on a trivial source file. For instance:
$ echo > test.c
$ gcc -v -c test.c
...
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i386-linux/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3
/usr/lib/gcc-lib/i386-linux/2.95.2/../../../../i386-linux/include
End of omitted list.
...
There's unfortunately a lot of other junk in the output, too. You can
try -Wp,-v instead of -v but I don't guarantee it will work.
> AND how hard is it to define it system-wide? I would like
> to be able to have /usr/local/include come before /usr/include and
> the "fixedheader" directory... also /usr/local/lib before /lib,
This is impossible - but as you can see, /usr/local/include is already
searched when you want it to be. /usr/local/lib may or may not be
automatically searched depending on your linker, but -L directories
are put before the default ones, so you can get the search behavior
you want with -L /usr/local/lib (you might also need -R /usr/local/lib
depending on what you're doing...)
> since I would rather not have to pass this through every
> makefile...
Sorry. We feel that having environment variables affect the behavior
of the compiler only leads to user confusion.
zw
More information about the Gcc
mailing list