acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Add ECANCELED for cygwin.
[gcc.git] / libstdc++-v3 / configure.host
1 # configure.host
2 #
3 # This shell script handles all host based configuration for libstdc++.
4 # It sets various shell variables based on the the host and the
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:
12 # host The configuration host (full CPU-vendor-OS triplet)
13 # host_cpu The configuration host CPU
14 # host_os The configuration host OS
15 #
16 #
17 # It sets the following shell variables:
18 #
19 # cpu_include_dir CPU-specific directory, defaults to cpu/generic
20 # if cpu/host_cpu doesn't exist. This is not used
21 # directly, but sets the default for others.
22 #
23 # os_include_dir OS-specific directory, defaults to os/generic.
24 #
25 # c_model the "C" header model, defaults to c_global.
26 #
27 # c_compatibility if "C" compatibility headers are necessary,
28 # defaults to no.
29 #
30 # abi_baseline_pair directory name for ABI compat testing,
31 # defaults to host_cpu-host_os (as per config.guess)
32 #
33 # abi_tweaks_dir location of cxxabi_tweaks.h,
34 # defaults to cpu_include_dir
35 #
36 # atomicity_dir location of atomicity.h,
37 # defaults to cpu_include_dir
38 #
39 # atomic_word_dir location of atomic_word.h
40 # defaults to generic.
41 #
42 # cpu_defines_dir location of cpu_defines.h
43 # defaults to generic.
44 #
45 #
46 # error_constants_dir location of error_constants.h
47 # defaults to os/generic.
48 #
49 # It possibly modifies the following variables:
50 #
51 # OPT_LDFLAGS extra flags to pass when linking the library, of
52 # the form '-Wl,blah'
53 # (defaults to empty in acinclude.m4)
54 #
55 # port_specific_symbol_files
56 # whitespace-seperated list of files containing
57 # additional symbols to export from the shared
58 # library, when symbol versioning is in use
59 #
60 #
61 # If the defaults will not work for your platform, you need only change the
62 # variables that won't work, i.e., you do not need to explicitly set a
63 # working variable to its default. Most hosts only need to change the two
64 # *_include_dir variables.
65
66
67 # DEFAULTS
68 # Try to guess a default cpu_include_dir based on the name of the CPU. We
69 # cannot do this for os_include_dir; there are too many portable operating
70 # systems out there. :-)
71 c_model=c_global
72 c_compatibility=no
73 atomic_word_dir=cpu/generic
74 atomicity_dir="cpu/generic"
75 cpu_defines_dir="cpu/generic"
76 try_cpu=generic
77 abi_tweaks_dir="cpu/generic"
78 error_constants_dir="os/generic"
79
80 # HOST-SPECIFIC OVERRIDES
81 # Set any CPU-dependent bits.
82
83 # Provide a way to funnel exotic flavors and prefixed/postfixed chip
84 # variants into the established source config/cpu/* sub-directories.
85 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
86 case "${host_cpu}" in
87 alpha*)
88 try_cpu=alpha
89 ;;
90 arm* | xscale | ep9312)
91 try_cpu=arm
92 ;;
93 i[567]86 | x86_64)
94 try_cpu=i486
95 ;;
96 hppa*)
97 try_cpu=hppa
98 ;;
99 mips*)
100 try_cpu=mips
101 ;;
102 m680[246]0)
103 try_cpu=m68k
104 ;;
105 powerpc* | rs6000)
106 try_cpu=powerpc
107 ;;
108 sparc* | ultrasparc)
109 try_cpu=sparc
110 ;;
111 *)
112 if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then
113 try_cpu=${host_cpu}
114 fi
115 esac
116
117
118 # Now look for the file(s) usually tied to a CPU model, and make
119 # default choices for those if they haven't been explicitly set
120 # already.
121 cpu_include_dir=cpu/${try_cpu}
122
123
124 # Set specific CPU overrides for cpu_defines_dir. Most can just use generic.
125 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
126 case "${host_cpu}" in
127 powerpc* | rs6000)
128 cpu_defines_dir=cpu/powerpc
129 ;;
130 esac
131
132
133 # Set specific CPU overrides for atomic_word_dir. Most can just use generic.
134 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
135 case "${host_cpu}" in
136 alpha*)
137 atomic_word_dir=cpu/alpha
138 ;;
139 cris*)
140 atomic_word_dir=cpu/cris
141 ;;
142 ia64)
143 atomic_word_dir=cpu/ia64
144 ;;
145 powerpc* | rs6000)
146 atomic_word_dir=cpu/powerpc
147 ;;
148 sparc* | ultrasparc)
149 atomic_word_dir=cpu/sparc
150 ;;
151 esac
152
153
154 # Set specific CPU overrides for atomicity_dir.
155 # This can be over-ridden in GLIBCXX_ENABLE_ATOMIC_BUILTINS.
156 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
157 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/atomicity.h ; then
158 atomicity_dir=$cpu_include_dir
159 fi
160
161
162 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then
163 abi_tweaks_dir=$cpu_include_dir
164 fi
165
166
167 # Set any OS-dependent bits.
168 # Set the os_include_dir.
169 # Set the error_costants_dir.
170 # Set c_model, c_compatibility here.
171 # If atomic ops and/or numeric limits are OS-specific rather than
172 # CPU-specifc, set those here too.
173 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
174 case "${host_os}" in
175 aix4.[3456789]* | aix[56789]*)
176 # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
177 # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
178 # explicitly duplicate the directory for 4.[<3].
179 os_include_dir="os/aix"
180 atomicity_dir="os/aix"
181 atomic_word_dir="os/aix"
182 OPT_LDFLAGS="-Wl,-G"
183 ;;
184 aix4.*)
185 os_include_dir="os/generic"
186 atomicity_dir="os/aix"
187 atomic_word_dir="os/aix"
188 ;;
189 aix*)
190 os_include_dir="os/generic"
191 atomicity_dir="cpu/generic"
192 ;;
193 bsd*)
194 # Plain BSD attempts to share FreeBSD files.
195 os_include_dir="os/bsd/freebsd"
196 ;;
197 cygwin*)
198 os_include_dir="os/newlib"
199 ;;
200 darwin | darwin[1-7] | darwin[1-7].*)
201 # On Darwin, performance is improved if libstdc++ is single-module.
202 # Up to at least 10.3.7, -flat_namespace is required for proper
203 # treatment of coalesced symbols.
204 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
205 os_include_dir="os/bsd/darwin"
206 ;;
207 darwin[89] | darwin[89].* | darwin[1-9][0-9]* )
208 # On Darwin, performance is improved if libstdc++ is single-module,
209 # and on 8+ compatibility is better if not -flat_namespace.
210 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module"
211 case "${host_cpu}" in
212 i[34567]86 | x86_64)
213 OPTIMIZE_CXXFLAGS="${OPTIMIZE_CXXFLAGS} -fvisibility-inlines-hidden"
214 ;;
215 esac
216 os_include_dir="os/bsd/darwin"
217 ;;
218 *djgpp*) # leading * picks up "msdosdjgpp"
219 os_include_dir="os/djgpp"
220 ;;
221 freebsd*)
222 os_include_dir="os/bsd/freebsd"
223 ;;
224 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
225 if [ "$uclibc" = "yes" ]; then
226 os_include_dir="os/uclibc"
227 else
228 os_include_dir="os/gnu-linux"
229 fi
230 ;;
231 hpux*)
232 os_include_dir="os/hpux"
233 ;;
234 irix[1-6] | irix[1-5].* | irix6.[0-4]*)
235 # This is known to work on at least IRIX 5.2 and 6.3.
236 os_include_dir="os/irix/irix5.2"
237 atomicity_dir=os/irix
238 atomic_word_dir=os/irix
239 ;;
240 irix6.5*)
241 os_include_dir="os/irix/irix6.5"
242 atomicity_dir=os/irix
243 atomic_word_dir=os/irix
244 ;;
245 mingw32*)
246 os_include_dir="os/mingw32"
247 error_constants_dir="os/mingw32"
248 ;;
249 netbsd*)
250 os_include_dir="os/bsd/netbsd"
251 ;;
252 qnx6.[12]*)
253 os_include_dir="os/qnx/qnx6.1"
254 c_model=c
255 ;;
256 solaris2)
257 # This too-vague configuration does not provide enough information
258 # to select a ctype include, and thus os_include_dir is a crap shoot.
259 echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2
260 exit 1
261 ;;
262 solaris2.5 | solaris2.5.[0-9])
263 os_include_dir="os/solaris/solaris2.5"
264 ;;
265 solaris2.6)
266 os_include_dir="os/solaris/solaris2.6"
267 ;;
268 solaris2.[789] | solaris2.1[0-9])
269 os_include_dir="os/solaris/solaris2.7"
270 ;;
271 tpf)
272 os_include_dir="os/tpf"
273 ;;
274 vxworks)
275 os_include_dir="os/vxworks"
276 ;;
277 windiss*)
278 os_include_dir="os/windiss"
279 ;;
280 *)
281 os_include_dir="os/generic"
282 ;;
283 esac
284
285
286 # Set any OS-dependent and CPU-dependent bits.
287 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
288 case "${host}" in
289 *-*-linux*)
290 case "${host_cpu}" in
291 i[567]86)
292 abi_baseline_pair=i486-linux-gnu
293 ;;
294 powerpc64)
295 abi_baseline_pair=powerpc64-linux-gnu
296 ;;
297 s390)
298 abi_baseline_pair=s390-linux-gnu
299 ;;
300 s390x)
301 abi_baseline_pair=s390x-linux-gnu
302 ;;
303 x86_64)
304 abi_baseline_pair=x86_64-linux-gnu
305 ;;
306 *)
307 if test -d ${glibcxx_srcdir}/config/abi/post/${try_cpu}-linux-gnu; then
308 abi_baseline_pair=${try_cpu}-linux-gnu
309 fi
310 esac
311 ;;
312 mips*-*-*)
313 case "${host_os}" in
314 gnu* | linux* | irix*)
315 ;;
316 *)
317 atomicity_dir="cpu/generic"
318 ;;
319 esac
320 ;;
321 powerpc*-*-darwin*)
322 port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
323 ;;
324 esac