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