BBS水木清华站∶精华区
DIRECTORY OPTIONS
These options specify directories to search for header
files, for libraries and for parts of the compiler:
^^^^^^^^^^^^^^^^^^^^^????
这个选项可将一些 header file、程式库及部份之编译器副程式的搜
寻路径告诉编译器。
-Idir Append directory dir to the list of directories
searched for include files.
-I- Any directories you specify with `-I' options be-
fore the `-I-' option are searched only for the
case of `#include "file"'; they are not searched
for `#include <file>'.
If additional directories are specified with `-I'
options after the `-I-', these directories are
searched for all `#include' directives. (Ordinari-
ly all `-I' directories are used this way.)
In addition, the `-I-' option inhibits the use of
the current directory (where the current input file
came from) as the first search directory for `#in-
clude "file"'. There is no way to override this
effect of `-I-'. With `-I.' you can specify
searching the directory which was current when the
compiler was invoked. That is not exactly the same
as what the preprocessor does by default, but it is
often satisfactory.
`-I-' does not inhibit the use of the standard sys-
tem directories for header files. Thus, `-I-' and
`-nostdinc' are independent.
-Ldir Add directory dir to the list of directories to be
searched for `-l'.
-Bprefix
This option specifies where to find the executa-
bles, libraries and data files of the compiler it-
self.
The compiler driver program runs one or more of the
subprograms `cpp', `cc1' (or, for C++, `cc1plus'),
`as' and `ld'. It tries prefix as a prefix for
each program it tries to run, both with and without
`machine/version/'.
For each subprogram to be run, the compiler driver
first tries the `-B' prefix, if any. If that name
is not found, or if `-B' was not specified, the
driver tries two standard prefixes, which are
`/usr/lib/gcc/' and `/usr/local/lib/gcc-lib/'. If
neither of those results in a file name that is
found, the compiler driver searches for the unmodi-
fied program name, using the directories specified
in your `PATH' environment variable.
The run-time support file `libgcc.a' is also
searched for using the `-B' prefix, if needed. If
it is not found there, the two standard prefixes
above are tried, and that is all. The file is left
out of the link if it is not found by those means.
Most of the time, on most machines, `libgcc.a' is
not actually necessary.
You can get a similar result from the environment
variable GCC_EXEC_PREFIX; if it is defined, its
value is used as a prefix in the same way. If both
the `-B' option and the GCC_EXEC_PREFIX variable
are present, the `-B' option is used first and the
environment variable value second.
BBS水木清华站∶精华区