]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/configure.host
natFilePosix.cc (performSetLastModified): Return true on success, false otherwise.
[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
4b90c838 70cpu_defines_dir=cpu/generic
2c839a4e 71
b731048b 72# HOST-SPECIFIC OVERRIDES
e01c9849 73# Set any CPU-dependent bits.
2c839a4e 74# Here we override defaults and catch more general cases due to naming
17640f24 75# conventions (e.g., chip_name* to catch all variants).
ef16a298 76
d0941a31 77# THIS TABLE IS SORTED. KEEP IT THAT WAY.
b731048b 78case "${host_cpu}" in
d0941a31 79 alpha*)
ef16a298 80 try_cpu=alpha
d0941a31 81 ;;
7d3998a4
PE
82 arm* | xscale | ep9312)
83 try_cpu=arm
84 ;;
e6b7a69a 85 i[567]86 | x86_64)
ef16a298 86 try_cpu=i486
d0941a31 87 ;;
49dd74ef 88 hppa*)
ef16a298 89 try_cpu=hppa
49dd74ef 90 ;;
92d568f2 91 mips*)
ef16a298
BK
92 # NB: cpu/mips/atomicity.h needs MIPS II or above.
93 # Of course, there is no sane way to test for this, no ABI macro,
94 # and no consistent host_cpu name differentiation. Therefore, only
95 # use it where it is known to be safe, ie it runs linux (see below).
96 try_cpu=generic
92d568f2 97 ;;
85ab9d23 98 m680[246]0)
ef16a298 99 try_cpu=m68k
2c839a4e 100 ;;
bd11db39 101 powerpc* | rs6000)
ef16a298 102 try_cpu=powerpc
d0941a31 103 ;;
85ab9d23 104 s390x)
ef16a298 105 try_cpu=s390
35495312 106 ;;
0fe707cc 107 sparc* | ultrasparc)
ef16a298
BK
108 try_cpu=sparc
109 ;;
110 *)
1568430f 111 if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then
bbdfb3e8
MK
112 try_cpu=${host_cpu}
113 else
114 try_cpu=generic
115 fi
d0941a31 116 ;;
d0941a31
PE
117esac
118
2c5d0ae8
BK
119# Set specific CPU overrides for atomic_word_dir. Most can just use generic.
120# THIS TABLE IS SORTED. KEEP IT THAT WAY.
121case "${host_cpu}" in
122 cris*)
123 atomic_word_dir=cpu/cris
124 ;;
125 sparc* | ultrasparc)
126 atomic_word_dir=cpu/sparc
127 ;;
128esac
129
4b90c838
PC
130# Set specific CPU overrides for cpu_defines_dir. Most can just use generic.
131# THIS TABLE IS SORTED. KEEP IT THAT WAY.
132case "${host_cpu}" in
460d832b 133 powerpc* | rs6000)
4b90c838
PC
134 cpu_defines_dir=cpu/powerpc
135 ;;
136esac
137
5ab481e0
BK
138# Now look for the file(s) usually tied to a CPU model, and make
139# default choices for those if they haven't been explicitly set
140# already.
7d3998a4 141cpu_include_dir=cpu/${try_cpu}
ef16a298 142abi_baseline_pair=${try_cpu}-${host_os}
7d3998a4 143unset try_cpu
2c839a4e 144
7c499eeb
PC
145case "${host_cpu}" in
146 alpha* | ia64 | powerpc* | rs6000 | s390*)
147 atomicity_dir="cpu/generic/atomic_builtins"
148 ;;
149 *)
150 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/atomicity.h ; then
151 atomicity_dir=$cpu_include_dir
152 else
153 atomicity_dir="cpu/generic"
154 fi
155 ;;
156esac
1568430f
PB
157
158if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then
159 abi_tweaks_dir=$cpu_include_dir
160else
161 abi_tweaks_dir="cpu/generic"
162fi
2c839a4e 163
e01c9849 164# Set any OS-dependent bits.
17640f24 165# Set the os_include_dir.
e01c9849
BK
166# Set c_model, c_compatibility here.
167# If atomic ops and/or numeric limits are OS-specific rather than
168# CPU-specifc, set those here too.
d0941a31 169# THIS TABLE IS SORTED. KEEP IT THAT WAY.
b731048b 170case "${host_os}" in
527b03ed 171 aix4.[3456789]* | aix[56789]*)
2c839a4e 172 # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
d32e25df 173 # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
2c839a4e
PE
174 # explicitly duplicate the directory for 4.[<3].
175 os_include_dir="os/aix"
2c5d0ae8 176 atomicity_dir="os/aix"
7afe555c 177 atomic_word_dir="os/aix"
34e3a8d5 178 OPT_LDFLAGS="-Wl,-G"
d0941a31 179 ;;
2c839a4e 180 aix4.*)
47395a24 181 os_include_dir="os/generic"
2c5d0ae8 182 atomicity_dir="os/aix"
7afe555c 183 atomic_word_dir="os/aix"
2c839a4e
PE
184 ;;
185 aix*)
47395a24 186 os_include_dir="os/generic"
2c5d0ae8 187 atomicity_dir="cpu/generic"
2c839a4e 188 ;;
8478f170
LR
189 bsd*)
190 # Plain BSD attempts to share FreeBSD files.
2c839a4e 191 os_include_dir="os/bsd/freebsd"
d0941a31 192 ;;
c383aafd 193 cygwin*)
2c839a4e
PE
194 os_include_dir="os/newlib"
195 ;;
ae59b55c 196 darwin | darwin[1-7] | darwin[1-7].*)
f1a66265 197 # On Darwin, performance is improved if libstdc++ is single-module.
ae59b55c 198 # Up to at least 10.3.7, -flat_namespace is required for proper
f1a66265
GK
199 # treatment of coalesced symbols.
200 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
f9686024 201 os_include_dir="os/bsd/darwin"
f1a66265 202 ;;
ae59b55c
GK
203 darwin[89] | darwin[89].* | darwin[1-9][0-9]* )
204 # On Darwin, performance is improved if libstdc++ is single-module,
205 # and on 8+ compatibility is better if not -flat_namespace.
206 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module"
207 os_include_dir="os/bsd/darwin"
208 ;;
2c839a4e
PE
209 *djgpp*) # leading * picks up "msdosdjgpp"
210 os_include_dir="os/djgpp"
c383aafd 211 ;;
8478f170
LR
212 freebsd*)
213 os_include_dir="os/bsd/freebsd"
8478f170 214 ;;
b938ad89 215 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
464aea98
JM
216 if [ "$uclibc" = "yes" ]; then
217 os_include_dir="os/uclibc"
218 else
219 os_include_dir="os/gnu-linux"
220 fi
6f87af20 221 ;;
2c839a4e
PE
222 hpux*)
223 os_include_dir="os/hpux"
d0941a31 224 ;;
789b7de5 225 irix[1-6] | irix[1-5].* | irix6.[0-4]*)
2c839a4e
PE
226 # This is known to work on at least IRIX 5.2 and 6.3.
227 os_include_dir="os/irix/irix5.2"
00d04db6
BK
228 atomicity_dir=os/irix
229 atomic_word_dir=os/irix
2c839a4e 230 ;;
789b7de5 231 irix6.5*)
2c839a4e 232 os_include_dir="os/irix/irix6.5"
00d04db6
BK
233 atomicity_dir=os/irix
234 atomic_word_dir=os/irix
d0941a31 235 ;;
944effb6 236 mingw32*)
2c839a4e 237 os_include_dir="os/mingw32"
944effb6 238 ;;
11b176c1 239 netbsd*)
2c839a4e 240 os_include_dir="os/bsd/netbsd"
11b176c1 241 ;;
ff66d28f
PE
242 qnx6.[12]*)
243 os_include_dir="os/qnx/qnx6.1"
244 c_model=c
245 ;;
43892f8c
BK
246 solaris2)
247 # This too-vague configuration does not provide enough information
248 # to select a ctype include, and thus os_include_dir is a crap shoot.
249 echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2
7d3998a4 250 exit 1
43892f8c 251 ;;
51ac684e 252 solaris2.5 | solaris2.5.[0-9])
2c839a4e 253 os_include_dir="os/solaris/solaris2.5"
d0941a31 254 ;;
51ac684e 255 solaris2.6)
2c839a4e 256 os_include_dir="os/solaris/solaris2.6"
d0941a31 257 ;;
51ac684e 258 solaris2.[789] | solaris2.1[0-9])
2c839a4e 259 os_include_dir="os/solaris/solaris2.7"
598730fe 260 ;;
6e198ee0
UW
261 tpf)
262 os_include_dir="os/tpf"
263 ;;
65fc9769
PE
264 vxworks)
265 os_include_dir="os/vxworks"
266 ;;
522e3d22 267 windiss*)
2c839a4e 268 os_include_dir="os/windiss"
522e3d22 269 ;;
d0941a31 270 *)
2c839a4e 271 os_include_dir="os/generic"
d0941a31
PE
272 ;;
273esac
274
275
e01c9849 276# Set any OS-dependent and CPU-dependent bits.
d0941a31 277# THIS TABLE IS SORTED. KEEP IT THAT WAY.
b731048b 278case "${host}" in
9eb6e1d3
LR
279 alpha*-*-freebsd5*)
280 abi_baseline_pair="alpha-freebsd5"
281 ;;
23a62f7f
MK
282 arm*-*-linux*)
283 abi_baseline_pair="arm-linux-gnu"
284 ;;
5ab481e0
BK
285 i*86-*-freebsd4*)
286 abi_baseline_pair="i386-freebsd4"
287 ;;
9eb6e1d3
LR
288 i*86-*-freebsd5*)
289 abi_baseline_pair="i386-freebsd5"
290 ;;
23a62f7f
MK
291 mips*-*-linux*)
292 atomicity_dir="cpu/mips"
293 abi_baseline_pair="mips-linux-gnu"
a2fddff9 294 cpu_include_dir="cpu/mips"
23a62f7f 295 ;;
f9314d01
GK
296 powerpc*-*-darwin*)
297 port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
298 ;;
3ff13f48
PC
299 powerpc64-*-linux*)
300 abi_baseline_pair="powerpc64-linux-gnu"
301 ;;
29cb3c21
UW
302 s390-*-linux*)
303 abi_baseline_pair="s390-linux-gnu"
304 ;;
305 s390x-*-linux*)
306 abi_baseline_pair="s390x-linux-gnu"
307 ;;
9eb6e1d3
LR
308 sparc*-*-freebsd5*)
309 abi_baseline_pair="sparc-freebsd5"
310 ;;
23a62f7f
MK
311 x86_64-*-linux*)
312 abi_baseline_pair="x86_64-linux-gnu"
313 ;;
6414587c 314esac