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