]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/configure.host
config.gcc [...]: Ignore --with-dwarf2 option.
[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#
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 74c_model=c_global
85ab9d23 75c_compatibility=no
2c5d0ae8 76atomic_word_dir=cpu/generic
c2ba9709 77atomic_flags=""
701a3eee
BK
78atomicity_dir="cpu/generic"
79cpu_defines_dir="cpu/generic"
80try_cpu=generic
81abi_tweaks_dir="cpu/generic"
e4bf5dfc 82error_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 90case "${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 ;;
7acf4da6
DD
106 mep*)
107 EXTRA_CXX_FLAGS=-mm
108 try_cpu=generic
109 ;;
92d568f2 110 mips*)
701a3eee 111 try_cpu=mips
92d568f2 112 ;;
bd11db39 113 powerpc* | rs6000)
ef16a298 114 try_cpu=powerpc
d0941a31 115 ;;
0fe707cc 116 sparc* | ultrasparc)
ef16a298
BK
117 try_cpu=sparc
118 ;;
119 *)
1568430f 120 if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then
bbdfb3e8 121 try_cpu=${host_cpu}
bbdfb3e8 122 fi
d0941a31
PE
123esac
124
701a3eee
BK
125
126# Now look for the file(s) usually tied to a CPU model, and make
127# default choices for those if they haven't been explicitly set
128# already.
129cpu_include_dir=cpu/${try_cpu}
130
2c5d0ae8 131
4b90c838
PC
132# Set specific CPU overrides for cpu_defines_dir. Most can just use generic.
133# THIS TABLE IS SORTED. KEEP IT THAT WAY.
134case "${host_cpu}" in
460d832b 135 powerpc* | rs6000)
4b90c838
PC
136 cpu_defines_dir=cpu/powerpc
137 ;;
138esac
139
2c839a4e 140
c2ba9709
JS
141# Set specific CPU overrides for atomic_word_dir and atomic_flags.
142# Most can just use generic.
701a3eee 143# THIS TABLE IS SORTED. KEEP IT THAT WAY.
7c499eeb 144case "${host_cpu}" in
701a3eee
BK
145 alpha*)
146 atomic_word_dir=cpu/alpha
7c499eeb 147 ;;
701a3eee
BK
148 cris*)
149 atomic_word_dir=cpu/cris
150 ;;
151 ia64)
152 atomic_word_dir=cpu/ia64
153 ;;
bdfb7c6d 154 i[4567]86 | x86_64)
c2ba9709
JS
155 atomic_flags="-march=native"
156 ;;
701a3eee
BK
157 powerpc* | rs6000)
158 atomic_word_dir=cpu/powerpc
159 ;;
160 sparc* | ultrasparc)
161 atomic_word_dir=cpu/sparc
c2ba9709 162 atomic_flags="-mcpu=v9"
7c499eeb
PC
163 ;;
164esac
1568430f 165
701a3eee
BK
166
167# Set specific CPU overrides for atomicity_dir.
168# This can be over-ridden in GLIBCXX_ENABLE_ATOMIC_BUILTINS.
169# THIS TABLE IS SORTED. KEEP IT THAT WAY.
170if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/atomicity.h ; then
171 atomicity_dir=$cpu_include_dir
172fi
173
174
1568430f
PB
175if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then
176 abi_tweaks_dir=$cpu_include_dir
1568430f 177fi
2c839a4e 178
701a3eee 179
e01c9849 180# Set any OS-dependent bits.
17640f24 181# Set the os_include_dir.
e4bf5dfc 182# Set the error_costants_dir.
e01c9849
BK
183# Set c_model, c_compatibility here.
184# If atomic ops and/or numeric limits are OS-specific rather than
185# CPU-specifc, set those here too.
d0941a31 186# THIS TABLE IS SORTED. KEEP IT THAT WAY.
b731048b 187case "${host_os}" in
527b03ed 188 aix4.[3456789]* | aix[56789]*)
2c839a4e 189 # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
d32e25df 190 # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
2c839a4e
PE
191 # explicitly duplicate the directory for 4.[<3].
192 os_include_dir="os/aix"
2c5d0ae8 193 atomicity_dir="os/aix"
7afe555c 194 atomic_word_dir="os/aix"
34e3a8d5 195 OPT_LDFLAGS="-Wl,-G"
d0941a31 196 ;;
2c839a4e 197 aix4.*)
47395a24 198 os_include_dir="os/generic"
2c5d0ae8 199 atomicity_dir="os/aix"
7afe555c 200 atomic_word_dir="os/aix"
2c839a4e
PE
201 ;;
202 aix*)
47395a24 203 os_include_dir="os/generic"
2c5d0ae8 204 atomicity_dir="cpu/generic"
2c839a4e 205 ;;
8478f170
LR
206 bsd*)
207 # Plain BSD attempts to share FreeBSD files.
2c839a4e 208 os_include_dir="os/bsd/freebsd"
d0941a31 209 ;;
c383aafd 210 cygwin*)
2c839a4e 211 os_include_dir="os/newlib"
f7e413e2 212 OPT_LDFLAGS="${OPT_LDFLAGS} -no-undefined -bindir \$(bindir)"
2c839a4e 213 ;;
ae59b55c 214 darwin | darwin[1-7] | darwin[1-7].*)
f1a66265 215 # On Darwin, performance is improved if libstdc++ is single-module.
ae59b55c 216 # Up to at least 10.3.7, -flat_namespace is required for proper
f1a66265
GK
217 # treatment of coalesced symbols.
218 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
f9686024 219 os_include_dir="os/bsd/darwin"
f1a66265 220 ;;
ae59b55c
GK
221 darwin[89] | darwin[89].* | darwin[1-9][0-9]* )
222 # On Darwin, performance is improved if libstdc++ is single-module,
223 # and on 8+ compatibility is better if not -flat_namespace.
224 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module"
62801a96
HH
225 case "${host_cpu}" in
226 i[34567]86 | x86_64)
227 OPTIMIZE_CXXFLAGS="${OPTIMIZE_CXXFLAGS} -fvisibility-inlines-hidden"
228 ;;
229 esac
ae59b55c
GK
230 os_include_dir="os/bsd/darwin"
231 ;;
2c839a4e
PE
232 *djgpp*) # leading * picks up "msdosdjgpp"
233 os_include_dir="os/djgpp"
a51d1999 234 error_constants_dir="os/djgpp"
c383aafd 235 ;;
8478f170
LR
236 freebsd*)
237 os_include_dir="os/bsd/freebsd"
8478f170 238 ;;
b938ad89 239 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
464aea98
JM
240 if [ "$uclibc" = "yes" ]; then
241 os_include_dir="os/uclibc"
aa6a73b9
MK
242 elif [ "$bionic" = "yes" ]; then
243 os_include_dir="os/bionic"
464aea98
JM
244 else
245 os_include_dir="os/gnu-linux"
246 fi
6f87af20 247 ;;
2c839a4e
PE
248 hpux*)
249 os_include_dir="os/hpux"
d0941a31 250 ;;
789b7de5 251 irix6.5*)
2c839a4e 252 os_include_dir="os/irix/irix6.5"
00d04db6
BK
253 atomicity_dir=os/irix
254 atomic_word_dir=os/irix
d0941a31 255 ;;
944effb6 256 mingw32*)
2c839a4e 257 os_include_dir="os/mingw32"
e4bf5dfc 258 error_constants_dir="os/mingw32"
f7e413e2 259 OPT_LDFLAGS="${OPT_LDFLAGS} -no-undefined -bindir \$(bindir)"
944effb6 260 ;;
11b176c1 261 netbsd*)
2c839a4e 262 os_include_dir="os/bsd/netbsd"
11b176c1 263 ;;
f986c466
RO
264 osf*)
265 os_include_dir="os/generic"
266 # libstdc++.so relies on emutls on Tru64 UNIX, which only works with the
267 # real functions implemented in libpthread.so, not with the dummies in
268 # libgcc, so always pass -lpthread.
269 OPT_LDFLAGS="${OPT_LDFLAGS} -lpthread"
270 ;;
ff66d28f
PE
271 qnx6.[12]*)
272 os_include_dir="os/qnx/qnx6.1"
273 c_model=c
274 ;;
43892f8c
BK
275 solaris2)
276 # This too-vague configuration does not provide enough information
277 # to select a ctype include, and thus os_include_dir is a crap shoot.
278 echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2
7d3998a4 279 exit 1
43892f8c 280 ;;
c7392d11 281 solaris2.[89] | solaris2.1[0-9])
2c839a4e 282 os_include_dir="os/solaris/solaris2.7"
598730fe 283 ;;
6e198ee0
UW
284 tpf)
285 os_include_dir="os/tpf"
286 ;;
65fc9769
PE
287 vxworks)
288 os_include_dir="os/vxworks"
289 ;;
d0941a31 290 *)
2c839a4e 291 os_include_dir="os/generic"
d0941a31
PE
292 ;;
293esac
294
295
e01c9849 296# Set any OS-dependent and CPU-dependent bits.
d0941a31 297# THIS TABLE IS SORTED. KEEP IT THAT WAY.
b731048b 298case "${host}" in
701a3eee
BK
299 *-*-linux*)
300 case "${host_cpu}" in
301 i[567]86)
302 abi_baseline_pair=i486-linux-gnu
303 ;;
8deecedf
AN
304 mips64*)
305 abi_baseline_pair=mips64-linux-gnu
306 ;;
701a3eee
BK
307 powerpc64)
308 abi_baseline_pair=powerpc64-linux-gnu
309 ;;
310 s390)
311 abi_baseline_pair=s390-linux-gnu
312 ;;
313 s390x)
314 abi_baseline_pair=s390x-linux-gnu
315 ;;
316 x86_64)
317 abi_baseline_pair=x86_64-linux-gnu
318 ;;
319 *)
320 if test -d ${glibcxx_srcdir}/config/abi/post/${try_cpu}-linux-gnu; then
321 abi_baseline_pair=${try_cpu}-linux-gnu
322 fi
323 esac
5194c5c1
MM
324 case "${host}" in
325 arm*-*-linux-*eabi)
326 port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
327 ;;
328 esac
701a3eee 329 ;;
f9314d01
GK
330 powerpc*-*-darwin*)
331 port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
332 ;;
33f49367
RO
333 *-*-solaris2.[89])
334 abi_baseline_pair=solaris2.8
335 ;;
336 *-*-solaris2.1[0-9])
337 abi_baseline_pair=solaris2.10
c18dc5cc 338 ;;
6414587c 339esac