annotate gcc/doc/cppdiropts.texi @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1 @c Copyright (C) 1999-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
2 @c This is part of the CPP and GCC manuals.
kono
parents:
diff changeset
3 @c For copying conditions, see the file gcc.texi.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 @c ---------------------------------------------------------------------
kono
parents:
diff changeset
6 @c Options affecting include directory search in the preprocessor
kono
parents:
diff changeset
7 @c ---------------------------------------------------------------------
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 @c If this file is included with the flag ``cppmanual'' set, it is
kono
parents:
diff changeset
10 @c formatted for inclusion in the CPP manual; otherwise the main GCC manual.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 @item -I @var{dir}
kono
parents:
diff changeset
13 @itemx -iquote @var{dir}
kono
parents:
diff changeset
14 @itemx -isystem @var{dir}
kono
parents:
diff changeset
15 @itemx -idirafter @var{dir}
kono
parents:
diff changeset
16 @opindex I
kono
parents:
diff changeset
17 @opindex iquote
kono
parents:
diff changeset
18 @opindex isystem
kono
parents:
diff changeset
19 @opindex idirafter
kono
parents:
diff changeset
20 Add the directory @var{dir} to the list of directories to be searched
kono
parents:
diff changeset
21 for header files during preprocessing.
kono
parents:
diff changeset
22 @ifset cppmanual
kono
parents:
diff changeset
23 @xref{Search Path}.
kono
parents:
diff changeset
24 @end ifset
kono
parents:
diff changeset
25 If @var{dir} begins with @samp{=} or @code{$SYSROOT}, then the @samp{=}
kono
parents:
diff changeset
26 or @code{$SYSROOT} is replaced by the sysroot prefix; see
kono
parents:
diff changeset
27 @option{--sysroot} and @option{-isysroot}.
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 Directories specified with @option{-iquote} apply only to the quote
kono
parents:
diff changeset
30 form of the directive, @code{@w{#include "@var{file}"}}.
kono
parents:
diff changeset
31 Directories specified with @option{-I}, @option{-isystem},
kono
parents:
diff changeset
32 or @option{-idirafter} apply to lookup for both the
kono
parents:
diff changeset
33 @code{@w{#include "@var{file}"}} and
kono
parents:
diff changeset
34 @code{@w{#include <@var{file}>}} directives.
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 You can specify any number or combination of these options on the
kono
parents:
diff changeset
37 command line to search for header files in several directories.
kono
parents:
diff changeset
38 The lookup order is as follows:
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 @enumerate
kono
parents:
diff changeset
41 @item
kono
parents:
diff changeset
42 For the quote form of the include directive, the directory of the current
kono
parents:
diff changeset
43 file is searched first.
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 @item
kono
parents:
diff changeset
46 For the quote form of the include directive, the directories specified
kono
parents:
diff changeset
47 by @option{-iquote} options are searched in left-to-right order,
kono
parents:
diff changeset
48 as they appear on the command line.
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 @item
kono
parents:
diff changeset
51 Directories specified with @option{-I} options are scanned in
kono
parents:
diff changeset
52 left-to-right order.
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 @item
kono
parents:
diff changeset
55 Directories specified with @option{-isystem} options are scanned in
kono
parents:
diff changeset
56 left-to-right order.
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 @item
kono
parents:
diff changeset
59 Standard system directories are scanned.
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 @item
kono
parents:
diff changeset
62 Directories specified with @option{-idirafter} options are scanned in
kono
parents:
diff changeset
63 left-to-right order.
kono
parents:
diff changeset
64 @end enumerate
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 You can use @option{-I} to override a system header
kono
parents:
diff changeset
67 file, substituting your own version, since these directories are
kono
parents:
diff changeset
68 searched before the standard system header file directories.
kono
parents:
diff changeset
69 However, you should
kono
parents:
diff changeset
70 not use this option to add directories that contain vendor-supplied
kono
parents:
diff changeset
71 system header files; use @option{-isystem} for that.
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 The @option{-isystem} and @option{-idirafter} options also mark the directory
kono
parents:
diff changeset
74 as a system directory, so that it gets the same special treatment that
kono
parents:
diff changeset
75 is applied to the standard system directories.
kono
parents:
diff changeset
76 @ifset cppmanual
kono
parents:
diff changeset
77 @xref{System Headers}.
kono
parents:
diff changeset
78 @end ifset
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 If a standard system include directory, or a directory specified with
kono
parents:
diff changeset
81 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
kono
parents:
diff changeset
82 option is ignored. The directory is still searched but as a
kono
parents:
diff changeset
83 system directory at its normal position in the system include chain.
kono
parents:
diff changeset
84 This is to ensure that GCC's procedure to fix buggy system headers and
kono
parents:
diff changeset
85 the ordering for the @code{#include_next} directive are not inadvertently
kono
parents:
diff changeset
86 changed.
kono
parents:
diff changeset
87 If you really need to change the search order for system directories,
kono
parents:
diff changeset
88 use the @option{-nostdinc} and/or @option{-isystem} options.
kono
parents:
diff changeset
89 @ifset cppmanual
kono
parents:
diff changeset
90 @xref{System Headers}.
kono
parents:
diff changeset
91 @end ifset
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 @item -I-
kono
parents:
diff changeset
94 @opindex I-
kono
parents:
diff changeset
95 Split the include path.
kono
parents:
diff changeset
96 This option has been deprecated. Please use @option{-iquote} instead for
kono
parents:
diff changeset
97 @option{-I} directories before the @option{-I-} and remove the @option{-I-}
kono
parents:
diff changeset
98 option.
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 Any directories specified with @option{-I}
kono
parents:
diff changeset
101 options before @option{-I-} are searched only for headers requested with
kono
parents:
diff changeset
102 @code{@w{#include "@var{file}"}}; they are not searched for
kono
parents:
diff changeset
103 @code{@w{#include <@var{file}>}}. If additional directories are
kono
parents:
diff changeset
104 specified with @option{-I} options after the @option{-I-}, those
kono
parents:
diff changeset
105 directories are searched for all @samp{#include} directives.
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 In addition, @option{-I-} inhibits the use of the directory of the current
kono
parents:
diff changeset
108 file directory as the first search directory for @code{@w{#include
kono
parents:
diff changeset
109 "@var{file}"}}. There is no way to override this effect of @option{-I-}.
kono
parents:
diff changeset
110 @ifset cppmanual
kono
parents:
diff changeset
111 @xref{Search Path}.
kono
parents:
diff changeset
112 @end ifset
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 @item -iprefix @var{prefix}
kono
parents:
diff changeset
115 @opindex iprefix
kono
parents:
diff changeset
116 Specify @var{prefix} as the prefix for subsequent @option{-iwithprefix}
kono
parents:
diff changeset
117 options. If the prefix represents a directory, you should include the
kono
parents:
diff changeset
118 final @samp{/}.
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 @item -iwithprefix @var{dir}
kono
parents:
diff changeset
121 @itemx -iwithprefixbefore @var{dir}
kono
parents:
diff changeset
122 @opindex iwithprefix
kono
parents:
diff changeset
123 @opindex iwithprefixbefore
kono
parents:
diff changeset
124 Append @var{dir} to the prefix specified previously with
kono
parents:
diff changeset
125 @option{-iprefix}, and add the resulting directory to the include search
kono
parents:
diff changeset
126 path. @option{-iwithprefixbefore} puts it in the same place @option{-I}
kono
parents:
diff changeset
127 would; @option{-iwithprefix} puts it where @option{-idirafter} would.
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129 @item -isysroot @var{dir}
kono
parents:
diff changeset
130 @opindex isysroot
kono
parents:
diff changeset
131 This option is like the @option{--sysroot} option, but applies only to
kono
parents:
diff changeset
132 header files (except for Darwin targets, where it applies to both header
kono
parents:
diff changeset
133 files and libraries). See the @option{--sysroot} option for more
kono
parents:
diff changeset
134 information.
kono
parents:
diff changeset
135
kono
parents:
diff changeset
136 @item -imultilib @var{dir}
kono
parents:
diff changeset
137 @opindex imultilib
kono
parents:
diff changeset
138 Use @var{dir} as a subdirectory of the directory containing
kono
parents:
diff changeset
139 target-specific C++ headers.
kono
parents:
diff changeset
140
kono
parents:
diff changeset
141 @item -nostdinc
kono
parents:
diff changeset
142 @opindex nostdinc
kono
parents:
diff changeset
143 Do not search the standard system directories for header files.
kono
parents:
diff changeset
144 Only the directories explicitly specified with @option{-I},
kono
parents:
diff changeset
145 @option{-iquote}, @option{-isystem}, and/or @option{-idirafter}
kono
parents:
diff changeset
146 options (and the directory of the current file, if appropriate)
kono
parents:
diff changeset
147 are searched.
kono
parents:
diff changeset
148
kono
parents:
diff changeset
149 @item -nostdinc++
kono
parents:
diff changeset
150 @opindex nostdinc++
kono
parents:
diff changeset
151 Do not search for header files in the C++-specific standard directories,
kono
parents:
diff changeset
152 but do still search the other standard directories. (This option is
kono
parents:
diff changeset
153 used when building the C++ library.)
kono
parents:
diff changeset
154