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