]>
Commit | Line | Data |
---|---|---|
b731048b | 1 | # configure.host |
2c839a4e | 2 | # |
b731048b BK |
3 | # This shell script handles all host based configuration for libstdc++. |
4 | # It sets various shell variables based on the the host and the | |
2c839a4e PE |
5 | # configuration options. You can modify this shell script without needing |
6 | # to rerun autoconf/aclocal/etc. This file is "sourced" not executed. | |
7 | # | |
8 | # You should read docs/html/17_intro/porting.* to make sense of this file. | |
9 | # | |
10 | # | |
11 | # It uses the following shell variables as set by config.guess: | |
b731048b BK |
12 | # host The configuration host (full CPU-vendor-OS triplet) |
13 | # host_cpu The configuration host CPU | |
14 | # host_os The configuration host OS | |
2c839a4e PE |
15 | # |
16 | # | |
17 | # It sets the following shell variables: | |
18 | # | |
19 | # cpu_include_dir CPU-specific directory, defaults to cpu/generic | |
7d3998a4 PE |
20 | # if cpu/host_cpu doesn't exist. This is not used |
21 | # directly, but sets the default for others. | |
2c839a4e PE |
22 | # |
23 | # os_include_dir OS-specific directory, defaults to os/generic. | |
24 | # | |
803f183a | 25 | # c_model the "C" header model, defaults to c_global. |
e01c9849 | 26 | # |
17640f24 | 27 | # c_compatibility if "C" compatibility headers are necessary, |
ef16a298 | 28 | # defaults to no. |
2c839a4e | 29 | # |
ef16a298 BK |
30 | # abi_baseline_pair directory name for ABI compat testing, |
31 | # defaults to host_cpu-host_os (as per config.guess) | |
314b5a68 | 32 | # |
7d3998a4 PE |
33 | # abi_tweaks_dir location of cxxabi_tweaks.h, |
34 | # defaults to cpu_include_dir | |
35 | # | |
2c5d0ae8 | 36 | # atomicity_dir location of atomicity.h, |
ef16a298 | 37 | # defaults to cpu_include_dir |
ca017eef | 38 | # |
2c5d0ae8 BK |
39 | # atomic_word_dir location of atomic_word.h |
40 | # defaults to generic. | |
41 | # | |
c2ba9709 JS |
42 | # atomic_flags extra flags to pass to use atomic instructions |
43 | # defaults to nothing. | |
44 | # | |
4b90c838 PC |
45 | # cpu_defines_dir location of cpu_defines.h |
46 | # defaults to generic. | |
47 | # | |
e4bf5dfc DS |
48 | # |
49 | # error_constants_dir location of error_constants.h | |
50 | # defaults to os/generic. | |
51 | # | |
2c839a4e PE |
52 | # It possibly modifies the following variables: |
53 | # | |
54 | # OPT_LDFLAGS extra flags to pass when linking the library, of | |
ef16a298 BK |
55 | # the form '-Wl,blah' |
56 | # (defaults to empty in acinclude.m4) | |
2c839a4e | 57 | # |
58579a27 | 58 | # port_specific_symbol_files |
e6b7a69a | 59 | # whitespace-seperated list of files containing |
ff66d28f PE |
60 | # additional symbols to export from the shared |
61 | # library, when symbol versioning is in use | |
e6b7a69a | 62 | # |
2c839a4e PE |
63 | # |
64 | # If the defaults will not work for your platform, you need only change the | |
65 | # variables that won't work, i.e., you do not need to explicitly set a | |
b731048b | 66 | # working variable to its default. Most hosts only need to change the two |
2c839a4e | 67 | # *_include_dir variables. |
d0941a31 | 68 | |
d0941a31 | 69 | |
e01c9849 | 70 | # DEFAULTS |
2c839a4e PE |
71 | # Try to guess a default cpu_include_dir based on the name of the CPU. We |
72 | # cannot do this for os_include_dir; there are too many portable operating | |
73 | # systems out there. :-) | |
af13a7a6 | 74 | c_model=c_global |
85ab9d23 | 75 | c_compatibility=no |
2c5d0ae8 | 76 | atomic_word_dir=cpu/generic |
c2ba9709 | 77 | atomic_flags="" |
701a3eee BK |
78 | atomicity_dir="cpu/generic" |
79 | cpu_defines_dir="cpu/generic" | |
80 | try_cpu=generic | |
81 | abi_tweaks_dir="cpu/generic" | |
e4bf5dfc | 82 | error_constants_dir="os/generic" |
2c839a4e | 83 | |
b731048b | 84 | # HOST-SPECIFIC OVERRIDES |
e01c9849 | 85 | # Set any CPU-dependent bits. |
ef16a298 | 86 | |
701a3eee BK |
87 | # Provide a way to funnel exotic flavors and prefixed/postfixed chip |
88 | # variants into the established source config/cpu/* sub-directories. | |
d0941a31 | 89 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
b731048b | 90 | case "${host_cpu}" in |
d0941a31 | 91 | alpha*) |
ef16a298 | 92 | try_cpu=alpha |
d0941a31 | 93 | ;; |
cd985f66 | 94 | arm*) |
7d3998a4 PE |
95 | try_cpu=arm |
96 | ;; | |
06785812 HPN |
97 | crisv32) |
98 | try_cpu=cris | |
99 | ;; | |
e6b7a69a | 100 | i[567]86 | x86_64) |
ef16a298 | 101 | try_cpu=i486 |
d0941a31 | 102 | ;; |
49dd74ef | 103 | hppa*) |
ef16a298 | 104 | try_cpu=hppa |
49dd74ef | 105 | ;; |
92d568f2 | 106 | mips*) |
701a3eee | 107 | try_cpu=mips |
92d568f2 | 108 | ;; |
bd11db39 | 109 | powerpc* | rs6000) |
ef16a298 | 110 | try_cpu=powerpc |
d0941a31 | 111 | ;; |
0fe707cc | 112 | sparc* | ultrasparc) |
ef16a298 BK |
113 | try_cpu=sparc |
114 | ;; | |
115 | *) | |
1568430f | 116 | if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then |
bbdfb3e8 | 117 | try_cpu=${host_cpu} |
bbdfb3e8 | 118 | fi |
d0941a31 PE |
119 | esac |
120 | ||
701a3eee BK |
121 | |
122 | # Now look for the file(s) usually tied to a CPU model, and make | |
123 | # default choices for those if they haven't been explicitly set | |
124 | # already. | |
125 | cpu_include_dir=cpu/${try_cpu} | |
126 | ||
2c5d0ae8 | 127 | |
4b90c838 PC |
128 | # Set specific CPU overrides for cpu_defines_dir. Most can just use generic. |
129 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. | |
130 | case "${host_cpu}" in | |
460d832b | 131 | powerpc* | rs6000) |
4b90c838 PC |
132 | cpu_defines_dir=cpu/powerpc |
133 | ;; | |
134 | esac | |
135 | ||
2c839a4e | 136 | |
c2ba9709 JS |
137 | # Set specific CPU overrides for atomic_word_dir and atomic_flags. |
138 | # Most can just use generic. | |
701a3eee | 139 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
7c499eeb | 140 | case "${host_cpu}" in |
701a3eee BK |
141 | alpha*) |
142 | atomic_word_dir=cpu/alpha | |
7c499eeb | 143 | ;; |
701a3eee BK |
144 | cris*) |
145 | atomic_word_dir=cpu/cris | |
146 | ;; | |
147 | ia64) | |
148 | atomic_word_dir=cpu/ia64 | |
149 | ;; | |
bdfb7c6d | 150 | i[4567]86 | x86_64) |
c2ba9709 JS |
151 | atomic_flags="-march=native" |
152 | ;; | |
701a3eee BK |
153 | powerpc* | rs6000) |
154 | atomic_word_dir=cpu/powerpc | |
155 | ;; | |
156 | sparc* | ultrasparc) | |
157 | atomic_word_dir=cpu/sparc | |
c2ba9709 | 158 | atomic_flags="-mcpu=v9" |
7c499eeb PC |
159 | ;; |
160 | esac | |
1568430f | 161 | |
701a3eee BK |
162 | |
163 | # Set specific CPU overrides for atomicity_dir. | |
164 | # This can be over-ridden in GLIBCXX_ENABLE_ATOMIC_BUILTINS. | |
165 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. | |
166 | if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/atomicity.h ; then | |
167 | atomicity_dir=$cpu_include_dir | |
168 | fi | |
169 | ||
170 | ||
1568430f PB |
171 | if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then |
172 | abi_tweaks_dir=$cpu_include_dir | |
1568430f | 173 | fi |
2c839a4e | 174 | |
701a3eee | 175 | |
e01c9849 | 176 | # Set any OS-dependent bits. |
17640f24 | 177 | # Set the os_include_dir. |
e4bf5dfc | 178 | # Set the error_costants_dir. |
e01c9849 BK |
179 | # Set c_model, c_compatibility here. |
180 | # If atomic ops and/or numeric limits are OS-specific rather than | |
181 | # CPU-specifc, set those here too. | |
d0941a31 | 182 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
b731048b | 183 | case "${host_os}" in |
527b03ed | 184 | aix4.[3456789]* | aix[56789]*) |
2c839a4e | 185 | # We set os_include_dir to os/aix only on AIX 4.3 and newer, but |
d32e25df | 186 | # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we |
2c839a4e PE |
187 | # explicitly duplicate the directory for 4.[<3]. |
188 | os_include_dir="os/aix" | |
2c5d0ae8 | 189 | atomicity_dir="os/aix" |
7afe555c | 190 | atomic_word_dir="os/aix" |
34e3a8d5 | 191 | OPT_LDFLAGS="-Wl,-G" |
d0941a31 | 192 | ;; |
2c839a4e | 193 | aix4.*) |
47395a24 | 194 | os_include_dir="os/generic" |
2c5d0ae8 | 195 | atomicity_dir="os/aix" |
7afe555c | 196 | atomic_word_dir="os/aix" |
2c839a4e PE |
197 | ;; |
198 | aix*) | |
47395a24 | 199 | os_include_dir="os/generic" |
2c5d0ae8 | 200 | atomicity_dir="cpu/generic" |
2c839a4e | 201 | ;; |
8478f170 LR |
202 | bsd*) |
203 | # Plain BSD attempts to share FreeBSD files. | |
2c839a4e | 204 | os_include_dir="os/bsd/freebsd" |
d0941a31 | 205 | ;; |
c383aafd | 206 | cygwin*) |
2c839a4e PE |
207 | os_include_dir="os/newlib" |
208 | ;; | |
ae59b55c | 209 | darwin | darwin[1-7] | darwin[1-7].*) |
f1a66265 | 210 | # On Darwin, performance is improved if libstdc++ is single-module. |
ae59b55c | 211 | # Up to at least 10.3.7, -flat_namespace is required for proper |
f1a66265 GK |
212 | # treatment of coalesced symbols. |
213 | OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace" | |
f9686024 | 214 | os_include_dir="os/bsd/darwin" |
f1a66265 | 215 | ;; |
ae59b55c GK |
216 | darwin[89] | darwin[89].* | darwin[1-9][0-9]* ) |
217 | # On Darwin, performance is improved if libstdc++ is single-module, | |
218 | # and on 8+ compatibility is better if not -flat_namespace. | |
219 | OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module" | |
62801a96 HH |
220 | case "${host_cpu}" in |
221 | i[34567]86 | x86_64) | |
222 | OPTIMIZE_CXXFLAGS="${OPTIMIZE_CXXFLAGS} -fvisibility-inlines-hidden" | |
223 | ;; | |
224 | esac | |
ae59b55c GK |
225 | os_include_dir="os/bsd/darwin" |
226 | ;; | |
2c839a4e PE |
227 | *djgpp*) # leading * picks up "msdosdjgpp" |
228 | os_include_dir="os/djgpp" | |
c383aafd | 229 | ;; |
8478f170 LR |
230 | freebsd*) |
231 | os_include_dir="os/bsd/freebsd" | |
8478f170 | 232 | ;; |
b938ad89 | 233 | gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) |
464aea98 JM |
234 | if [ "$uclibc" = "yes" ]; then |
235 | os_include_dir="os/uclibc" | |
236 | else | |
237 | os_include_dir="os/gnu-linux" | |
238 | fi | |
6f87af20 | 239 | ;; |
2c839a4e PE |
240 | hpux*) |
241 | os_include_dir="os/hpux" | |
d0941a31 | 242 | ;; |
789b7de5 | 243 | irix[1-6] | irix[1-5].* | irix6.[0-4]*) |
2c839a4e PE |
244 | # This is known to work on at least IRIX 5.2 and 6.3. |
245 | os_include_dir="os/irix/irix5.2" | |
00d04db6 BK |
246 | atomicity_dir=os/irix |
247 | atomic_word_dir=os/irix | |
2c839a4e | 248 | ;; |
789b7de5 | 249 | irix6.5*) |
2c839a4e | 250 | os_include_dir="os/irix/irix6.5" |
00d04db6 BK |
251 | atomicity_dir=os/irix |
252 | atomic_word_dir=os/irix | |
d0941a31 | 253 | ;; |
944effb6 | 254 | mingw32*) |
2c839a4e | 255 | os_include_dir="os/mingw32" |
e4bf5dfc | 256 | error_constants_dir="os/mingw32" |
944effb6 | 257 | ;; |
11b176c1 | 258 | netbsd*) |
2c839a4e | 259 | os_include_dir="os/bsd/netbsd" |
11b176c1 | 260 | ;; |
ff66d28f PE |
261 | qnx6.[12]*) |
262 | os_include_dir="os/qnx/qnx6.1" | |
263 | c_model=c | |
264 | ;; | |
43892f8c BK |
265 | solaris2) |
266 | # This too-vague configuration does not provide enough information | |
267 | # to select a ctype include, and thus os_include_dir is a crap shoot. | |
268 | echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2 | |
7d3998a4 | 269 | exit 1 |
43892f8c | 270 | ;; |
51ac684e | 271 | solaris2.[789] | solaris2.1[0-9]) |
2c839a4e | 272 | os_include_dir="os/solaris/solaris2.7" |
598730fe | 273 | ;; |
6e198ee0 UW |
274 | tpf) |
275 | os_include_dir="os/tpf" | |
276 | ;; | |
65fc9769 PE |
277 | vxworks) |
278 | os_include_dir="os/vxworks" | |
279 | ;; | |
d0941a31 | 280 | *) |
2c839a4e | 281 | os_include_dir="os/generic" |
d0941a31 PE |
282 | ;; |
283 | esac | |
284 | ||
285 | ||
e01c9849 | 286 | # Set any OS-dependent and CPU-dependent bits. |
d0941a31 | 287 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
b731048b | 288 | case "${host}" in |
701a3eee BK |
289 | *-*-linux*) |
290 | case "${host_cpu}" in | |
291 | i[567]86) | |
292 | abi_baseline_pair=i486-linux-gnu | |
293 | ;; | |
294 | powerpc64) | |
295 | abi_baseline_pair=powerpc64-linux-gnu | |
296 | ;; | |
297 | s390) | |
298 | abi_baseline_pair=s390-linux-gnu | |
299 | ;; | |
300 | s390x) | |
301 | abi_baseline_pair=s390x-linux-gnu | |
302 | ;; | |
303 | x86_64) | |
304 | abi_baseline_pair=x86_64-linux-gnu | |
305 | ;; | |
306 | *) | |
307 | if test -d ${glibcxx_srcdir}/config/abi/post/${try_cpu}-linux-gnu; then | |
308 | abi_baseline_pair=${try_cpu}-linux-gnu | |
309 | fi | |
310 | esac | |
311 | ;; | |
f9314d01 GK |
312 | powerpc*-*-darwin*) |
313 | port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver" | |
314 | ;; | |
6414587c | 315 | esac |