]> gcc.gnu.org Git - gcc.git/blob - libstdc++-v3/configure.host
configure.host (darwin): On darwin8 or later, no need to build libstdc++ with -flat_n...
[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_std.
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 # It possibly modifies the following variables:
43 #
44 # OPT_LDFLAGS extra flags to pass when linking the library, of
45 # the form '-Wl,blah'
46 # (defaults to empty in acinclude.m4)
47 #
48 # port_specific_symbol_files
49 # whitespace-seperated list of files containing
50 # additional symbols to export from the shared
51 # library, when symbol versioning is in use
52 #
53 #
54 # If the defaults will not work for your platform, you need only change the
55 # variables that won't work, i.e., you do not need to explicitly set a
56 # working variable to its default. Most hosts only need to change the two
57 # *_include_dir variables.
58
59
60 # DEFAULTS
61 # Try to guess a default cpu_include_dir based on the name of the CPU. We
62 # cannot do this for os_include_dir; there are too many portable operating
63 # systems out there. :-)
64 c_model=c_std
65 c_compatibility=no
66 atomic_word_dir=cpu/generic
67
68 # HOST-SPECIFIC OVERRIDES
69 # Set any CPU-dependent bits.
70 # Here we override defaults and catch more general cases due to naming
71 # conventions (e.g., chip_name* to catch all variants).
72
73 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
74 case "${host_cpu}" in
75 alpha*)
76 try_cpu=alpha
77 ;;
78 arm* | xscale | ep9312)
79 try_cpu=arm
80 ;;
81 i[567]86 | x86_64)
82 try_cpu=i486
83 ;;
84 hppa*)
85 try_cpu=hppa
86 ;;
87 mips*)
88 # NB: cpu/mips/atomicity.h needs MIPS II or above.
89 # Of course, there is no sane way to test for this, no ABI macro,
90 # and no consistent host_cpu name differentiation. Therefore, only
91 # use it where it is known to be safe, ie it runs linux (see below).
92 try_cpu=generic
93 ;;
94 m680[246]0)
95 try_cpu=m68k
96 ;;
97 powerpc* | rs6000)
98 try_cpu=powerpc
99 ;;
100 s390x)
101 try_cpu=s390
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 else
110 try_cpu=generic
111 fi
112 ;;
113 esac
114
115 # Set specific CPU overrides for atomic_word_dir. Most can just use generic.
116 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
117 case "${host_cpu}" in
118 cris*)
119 atomic_word_dir=cpu/cris
120 ;;
121 sparc* | ultrasparc)
122 atomic_word_dir=cpu/sparc
123 ;;
124 esac
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.
129 cpu_include_dir=cpu/${try_cpu}
130 abi_baseline_pair=${try_cpu}-${host_os}
131 unset try_cpu
132
133 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/atomicity.h ; then
134 atomicity_dir=$cpu_include_dir
135 else
136 atomicity_dir="cpu/generic"
137 fi
138
139 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then
140 abi_tweaks_dir=$cpu_include_dir
141 else
142 abi_tweaks_dir="cpu/generic"
143 fi
144
145 # Set any OS-dependent bits.
146 # Set the os_include_dir.
147 # Set c_model, c_compatibility here.
148 # If atomic ops and/or numeric limits are OS-specific rather than
149 # CPU-specifc, set those here too.
150 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
151 case "${host_os}" in
152 aix4.[3456789]* | aix[56789]*)
153 # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
154 # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
155 # explicitly duplicate the directory for 4.[<3].
156 os_include_dir="os/aix"
157 atomicity_dir="os/aix"
158 atomic_word_dir="os/aix"
159 OPT_LDFLAGS="-Wl,-G"
160 ;;
161 aix4.*)
162 os_include_dir="os/generic"
163 atomicity_dir="os/aix"
164 atomic_word_dir="os/aix"
165 ;;
166 aix*)
167 os_include_dir="os/generic"
168 atomicity_dir="cpu/generic"
169 ;;
170 bsd*)
171 # Plain BSD attempts to share FreeBSD files.
172 os_include_dir="os/bsd/freebsd"
173 ;;
174 cygwin*)
175 os_include_dir="os/newlib"
176 ;;
177 darwin | darwin[1-7] | darwin[1-7].*)
178 # On Darwin, performance is improved if libstdc++ is single-module.
179 # Up to at least 10.3.7, -flat_namespace is required for proper
180 # treatment of coalesced symbols.
181 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
182 os_include_dir="os/bsd/darwin"
183 ;;
184 darwin[89] | darwin[89].* | darwin[1-9][0-9]* )
185 # On Darwin, performance is improved if libstdc++ is single-module,
186 # and on 8+ compatibility is better if not -flat_namespace.
187 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module"
188 os_include_dir="os/bsd/darwin"
189 ;;
190 *djgpp*) # leading * picks up "msdosdjgpp"
191 os_include_dir="os/djgpp"
192 ;;
193 freebsd*)
194 os_include_dir="os/bsd/freebsd"
195 ;;
196 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
197 os_include_dir="os/gnu-linux"
198 ;;
199 hpux*)
200 os_include_dir="os/hpux"
201 ;;
202 irix[1-6] | irix[1-5].* | irix6.[0-4]*)
203 # This is known to work on at least IRIX 5.2 and 6.3.
204 os_include_dir="os/irix/irix5.2"
205 atomicity_dir=os/irix
206 atomic_word_dir=os/irix
207 ;;
208 irix6.5*)
209 os_include_dir="os/irix/irix6.5"
210 atomicity_dir=os/irix
211 atomic_word_dir=os/irix
212 ;;
213 mingw32*)
214 os_include_dir="os/mingw32"
215 ;;
216 netbsd*)
217 os_include_dir="os/bsd/netbsd"
218 ;;
219 qnx6.[12]*)
220 os_include_dir="os/qnx/qnx6.1"
221 c_model=c
222 ;;
223 solaris2)
224 # This too-vague configuration does not provide enough information
225 # to select a ctype include, and thus os_include_dir is a crap shoot.
226 echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2
227 exit 1
228 ;;
229 solaris2.5 | solaris2.5.[0-9])
230 os_include_dir="os/solaris/solaris2.5"
231 ;;
232 solaris2.6)
233 os_include_dir="os/solaris/solaris2.6"
234 ;;
235 solaris2.[789] | solaris2.1[0-9])
236 os_include_dir="os/solaris/solaris2.7"
237 ;;
238 tpf)
239 os_include_dir="os/tpf"
240 ;;
241 vxworks)
242 os_include_dir="os/vxworks"
243 ;;
244 windiss*)
245 os_include_dir="os/windiss"
246 ;;
247 *)
248 os_include_dir="os/generic"
249 ;;
250 esac
251
252
253 # Set any OS-dependent and CPU-dependent bits.
254 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
255 case "${host}" in
256 alpha*-*-freebsd5*)
257 abi_baseline_pair="alpha-freebsd5"
258 ;;
259 arm*-*-linux*)
260 abi_baseline_pair="arm-linux-gnu"
261 ;;
262 i*86-*-freebsd4*)
263 abi_baseline_pair="i386-freebsd4"
264 ;;
265 i*86-*-freebsd5*)
266 abi_baseline_pair="i386-freebsd5"
267 ;;
268 mips*-*-linux*)
269 atomicity_dir="cpu/mips"
270 abi_baseline_pair="mips-linux-gnu"
271 cpu_include_dir="cpu/mips"
272 ;;
273 s390-*-linux*)
274 abi_baseline_pair="s390-linux-gnu"
275 ;;
276 s390x-*-linux*)
277 abi_baseline_pair="s390x-linux-gnu"
278 ;;
279 sparc*-*-freebsd5*)
280 abi_baseline_pair="sparc-freebsd5"
281 ;;
282 x86_64-*-linux*)
283 abi_baseline_pair="x86_64-linux-gnu"
284 ;;
285 esac
This page took 0.054421 seconds and 6 git commands to generate.