]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/configure.host
Eenable -Winvalid-memory-order for C++ [PR99612].
[thirdparty/gcc.git] / libstdc++-v3 / configure.host
CommitLineData
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#
48c7b524 53# cpu_opt_bits_random path name of random.h containing CPU-specific
9bf714c2 54# optimizations
e4bf5dfc 55#
48c7b524
UD
56# cpu_opt_ext_random path name of random.h containing CPU-specific
57# optimizations for extensions
58#
e4bf5dfc
DS
59# error_constants_dir location of error_constants.h
60# defaults to os/generic.
61#
2c839a4e
PE
62# It possibly modifies the following variables:
63#
64# OPT_LDFLAGS extra flags to pass when linking the library, of
ef16a298
BK
65# the form '-Wl,blah'
66# (defaults to empty in acinclude.m4)
2c839a4e 67#
58579a27 68# port_specific_symbol_files
1d77bc54 69# whitespace-separated list of files containing
ff66d28f
PE
70# additional symbols to export from the shared
71# library, when symbol versioning is in use
e6b7a69a 72#
47ddb895
DE
73# tmake_file A list of machine-description-specific
74# makefile fragments.
75#
2c839a4e
PE
76#
77# If the defaults will not work for your platform, you need only change the
78# variables that won't work, i.e., you do not need to explicitly set a
b731048b 79# working variable to its default. Most hosts only need to change the two
2c839a4e 80# *_include_dir variables.
d0941a31 81
d0941a31 82
e01c9849 83# DEFAULTS
2c839a4e
PE
84# Try to guess a default cpu_include_dir based on the name of the CPU. We
85# cannot do this for os_include_dir; there are too many portable operating
86# systems out there. :-)
af13a7a6 87c_model=c_global
85ab9d23 88c_compatibility=no
2c5d0ae8 89atomic_word_dir=cpu/generic
c2ba9709 90atomic_flags=""
701a3eee
BK
91atomicity_dir="cpu/generic"
92cpu_defines_dir="cpu/generic"
93try_cpu=generic
00fc1bf6 94abi_baseline_subdir_switch=--print-multi-directory
701a3eee 95abi_tweaks_dir="cpu/generic"
e4bf5dfc 96error_constants_dir="os/generic"
47ddb895 97tmake_file=
2c839a4e 98
b731048b 99# HOST-SPECIFIC OVERRIDES
e01c9849 100# Set any CPU-dependent bits.
ef16a298 101
701a3eee
BK
102# Provide a way to funnel exotic flavors and prefixed/postfixed chip
103# variants into the established source config/cpu/* sub-directories.
d0941a31 104# THIS TABLE IS SORTED. KEEP IT THAT WAY.
b731048b 105case "${host_cpu}" in
d0941a31 106 alpha*)
ef16a298 107 try_cpu=alpha
d0941a31 108 ;;
cd985f66 109 arm*)
7d3998a4
PE
110 try_cpu=arm
111 ;;
06785812
HPN
112 crisv32)
113 try_cpu=cris
114 ;;
e6b7a69a 115 i[567]86 | x86_64)
ef16a298 116 try_cpu=i486
d0941a31 117 ;;
49dd74ef 118 hppa*)
ef16a298 119 try_cpu=hppa
49dd74ef 120 ;;
92d568f2 121 mips*)
701a3eee 122 try_cpu=mips
92d568f2 123 ;;
bd11db39 124 powerpc* | rs6000)
ef16a298 125 try_cpu=powerpc
d0941a31 126 ;;
0fe707cc 127 sparc* | ultrasparc)
ef16a298
BK
128 try_cpu=sparc
129 ;;
130 *)
1568430f 131 if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then
bbdfb3e8 132 try_cpu=${host_cpu}
bbdfb3e8 133 fi
d0941a31
PE
134esac
135
701a3eee
BK
136
137# Now look for the file(s) usually tied to a CPU model, and make
138# default choices for those if they haven't been explicitly set
139# already.
140cpu_include_dir=cpu/${try_cpu}
141
2c5d0ae8 142
4b90c838
PC
143# Set specific CPU overrides for cpu_defines_dir. Most can just use generic.
144# THIS TABLE IS SORTED. KEEP IT THAT WAY.
145case "${host_cpu}" in
49c65434
RR
146 arm*)
147 cpu_defines_dir=cpu/arm
148 ;;
460d832b 149 powerpc* | rs6000)
4b90c838
PC
150 cpu_defines_dir=cpu/powerpc
151 ;;
152esac
153
2c839a4e 154
c2ba9709
JS
155# Set specific CPU overrides for atomic_word_dir and atomic_flags.
156# Most can just use generic.
701a3eee 157# THIS TABLE IS SORTED. KEEP IT THAT WAY.
7c499eeb 158case "${host_cpu}" in
701a3eee
BK
159 cris*)
160 atomic_word_dir=cpu/cris
161 ;;
bdfb7c6d 162 i[4567]86 | x86_64)
c2ba9709
JS
163 atomic_flags="-march=native"
164 ;;
701a3eee
BK
165 sparc* | ultrasparc)
166 atomic_word_dir=cpu/sparc
c2ba9709 167 atomic_flags="-mcpu=v9"
7c499eeb
PC
168 ;;
169esac
1568430f 170
701a3eee
BK
171
172# Set specific CPU overrides for atomicity_dir.
173# This can be over-ridden in GLIBCXX_ENABLE_ATOMIC_BUILTINS.
174# THIS TABLE IS SORTED. KEEP IT THAT WAY.
175if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/atomicity.h ; then
176 atomicity_dir=$cpu_include_dir
177fi
178
179
1568430f
PB
180if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then
181 abi_tweaks_dir=$cpu_include_dir
1568430f 182fi
2c839a4e 183
701a3eee 184
9bf714c2
UD
185# Set directory with CPU-specific optimization
186cpu_opt_dir=${cpu_include_dir}/opt
187test -d ${glibcxx_srcdir}/config/${cpu_include_dir}/opt ||
188cpu_opt_dir=cpu/generic/opt
189# For each header with CPU-specific optimizations check whether it
190# exists in ${cpu_opt_dir}. If not, point the variable at the
191# appropriate file in the generic directory.
192cpu_opt_ext_random=${cpu_opt_dir}/ext/opt_random.h
193test -f ${glibcxx_srcdir}/config/${cpu_opt_ext_random} ||
194cpu_opt_ext_random=cpu/generic/opt/ext/opt_random.h
195
48c7b524
UD
196cpu_opt_bits_random=${cpu_opt_dir}/bits/opt_random.h
197test -f ${glibcxx_srcdir}/config/${cpu_opt_ext_random} ||
198cpu_opt_ext_random=cpu/generic/opt/bits/opt_random.h
199
9bf714c2 200
e01c9849 201# Set any OS-dependent bits.
17640f24 202# Set the os_include_dir.
e4bf5dfc 203# Set the error_costants_dir.
e01c9849
BK
204# Set c_model, c_compatibility here.
205# If atomic ops and/or numeric limits are OS-specific rather than
206# CPU-specifc, set those here too.
d0941a31 207# THIS TABLE IS SORTED. KEEP IT THAT WAY.
b731048b 208case "${host_os}" in
020bd6f4
DE
209 aix[56789]*)
210 # Newer versions of AIX only support PowerPC architecture, so use
211 # atomic instructions directly.
212 os_include_dir="os/aix"
47ddb895 213 tmake_file="os/aix/t-aix"
2c839a4e
PE
214 ;;
215 aix*)
47395a24 216 os_include_dir="os/generic"
2c5d0ae8 217 atomicity_dir="cpu/generic"
2c839a4e 218 ;;
8478f170
LR
219 bsd*)
220 # Plain BSD attempts to share FreeBSD files.
2c839a4e 221 os_include_dir="os/bsd/freebsd"
d0941a31 222 ;;
c383aafd 223 cygwin*)
2c839a4e 224 os_include_dir="os/newlib"
7de6ba7a 225 OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
2c839a4e 226 ;;
ee959ecb
IS
227 darwin[4-7] | darwin[4-7].*)
228 # For earlier Darwin, performance is improved if libstdc++ is
229 # single-module. Up to at least 10.3.7, -flat_namespace is required
230 # for proper treatment of coalesced symbols.
f1a66265 231 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
f9686024 232 os_include_dir="os/bsd/darwin"
f1a66265 233 ;;
ee959ecb
IS
234 darwin8 | darwin8.* )
235 # For 8+ compatibility is better if not -flat_namespace.
ae59b55c 236 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module"
62801a96
HH
237 case "${host_cpu}" in
238 i[34567]86 | x86_64)
239 OPTIMIZE_CXXFLAGS="${OPTIMIZE_CXXFLAGS} -fvisibility-inlines-hidden"
240 ;;
241 esac
ae59b55c
GK
242 os_include_dir="os/bsd/darwin"
243 ;;
ee959ecb
IS
244 darwin*)
245 # Post Darwin8, defaults should be sufficient.
246 os_include_dir="os/bsd/darwin"
247 ;;
2c839a4e
PE
248 *djgpp*) # leading * picks up "msdosdjgpp"
249 os_include_dir="os/djgpp"
a51d1999 250 error_constants_dir="os/djgpp"
c383aafd 251 ;;
dbed5a9b
JM
252 dragonfly*)
253 os_include_dir="os/bsd/dragonfly"
254 ;;
8478f170
LR
255 freebsd*)
256 os_include_dir="os/bsd/freebsd"
8478f170 257 ;;
85da5c30
SN
258 linux-musl*)
259 os_include_dir="os/generic"
260 ;;
6508fa9c 261 gnu* | linux* | kfreebsd*-gnu | uclinux*)
464aea98
JM
262 if [ "$uclibc" = "yes" ]; then
263 os_include_dir="os/uclibc"
aa6a73b9
MK
264 elif [ "$bionic" = "yes" ]; then
265 os_include_dir="os/bionic"
464aea98
JM
266 else
267 os_include_dir="os/gnu-linux"
268 fi
6f87af20 269 ;;
2c839a4e
PE
270 hpux*)
271 os_include_dir="os/hpux"
d0941a31 272 ;;
944effb6 273 mingw32*)
d7a3ef97
JY
274 case "$host" in
275 *-w64-*)
276 os_include_dir="os/mingw32-w64"
277 error_constants_dir="os/mingw32-w64"
278 ;;
279 *)
280 os_include_dir="os/mingw32"
281 error_constants_dir="os/mingw32"
282 ;;
283 esac
7de6ba7a 284 OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)"
944effb6 285 ;;
11b176c1 286 netbsd*)
2c839a4e 287 os_include_dir="os/bsd/netbsd"
11b176c1 288 ;;
1f726ff8
MK
289 openbsd*)
290 os_include_dir="os/bsd/openbsd"
291 ;;
ff66d28f
PE
292 qnx6.[12]*)
293 os_include_dir="os/qnx/qnx6.1"
294 c_model=c
295 ;;
320c7be3
SH
296 rtems*)
297 # Use libatomic if necessary and avoid libstdc++ specific atomicity support
298 atomicity_dir="cpu/generic/atomicity_builtins"
299 ;;
ccd1242e
RO
300 solaris2*)
301 os_include_dir="os/solaris"
a1998fab 302 ;;
6e198ee0
UW
303 tpf)
304 os_include_dir="os/tpf"
305 ;;
d667beea 306 vxworks*)
65fc9769
PE
307 os_include_dir="os/vxworks"
308 ;;
d0941a31 309 *)
2c839a4e 310 os_include_dir="os/generic"
d0941a31
PE
311 ;;
312esac
313
314
e01c9849 315# Set any OS-dependent and CPU-dependent bits.
d0941a31 316# THIS TABLE IS SORTED. KEEP IT THAT WAY.
b731048b 317case "${host}" in
6508fa9c 318 *-*-linux* | *-*-uclinux*)
701a3eee
BK
319 case "${host_cpu}" in
320 i[567]86)
321 abi_baseline_pair=i486-linux-gnu
322 ;;
8deecedf
AN
323 mips64*)
324 abi_baseline_pair=mips64-linux-gnu
325 ;;
8f7fa4ba 326 powerpc64*)
701a3eee
BK
327 abi_baseline_pair=powerpc64-linux-gnu
328 ;;
329 s390)
330 abi_baseline_pair=s390-linux-gnu
331 ;;
332 s390x)
333 abi_baseline_pair=s390x-linux-gnu
334 ;;
406e4908
EB
335 sparc64)
336 abi_baseline_pair=sparc64-linux-gnu
337 ;;
701a3eee
BK
338 x86_64)
339 abi_baseline_pair=x86_64-linux-gnu
340 ;;
341 *)
2529c937
AS
342 if test $try_cpu = generic; then
343 try_abi_cpu=$host_cpu
344 else
345 try_abi_cpu=$try_cpu
346 fi
347 if test -d ${glibcxx_srcdir}/config/abi/post/${try_abi_cpu}-linux-gnu; then
348 abi_baseline_pair=${try_abi_cpu}-linux-gnu
701a3eee
BK
349 fi
350 esac
5194c5c1 351 case "${host}" in
6508fa9c 352 arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
5194c5c1
MM
353 port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
354 ;;
355 esac
701a3eee 356 ;;
82a19768
AT
357 arm*-*-freebsd*)
358 port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
359 ;;
f9314d01
GK
360 powerpc*-*-darwin*)
361 port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
362 ;;
ccd1242e
RO
363 *-*-solaris2*)
364 abi_baseline_pair=solaris
a76745e6
RO
365 case "${host_cpu}" in
366 i?86 | x86_64)
367 abi_baseline_pair=i386-${abi_baseline_pair}
368 ;;
369 sparc*)
370 abi_baseline_pair=sparc-${abi_baseline_pair}
371 ;;
372 esac
00fc1bf6 373 abi_baseline_subdir_switch=--print-multi-os-directory
c18dc5cc 374 ;;
6414587c 375esac