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