]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/configure.host
* configure.host (darwin*): Set os_include_dir to a separate directory
[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_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 OPT_LDFLAGS="-Wl,-G"
159 ;;
160 aix4.*)
161 os_include_dir="os/generic"
162 atomicity_dir="os/aix"
163 ;;
164 aix*)
165 os_include_dir="os/generic"
166 atomicity_dir="cpu/generic"
167 ;;
168 bsd*)
169 # Plain BSD attempts to share FreeBSD files.
170 os_include_dir="os/bsd/freebsd"
171 ;;
172 cygwin*)
173 os_include_dir="os/newlib"
174 ;;
175 darwin*)
176 # On Darwin, performance is improved if libstdc++ is single-module.
177 # Up to at least 10.3.5, -flat_namespace is required for proper
178 # treatment of coalesced symbols.
179 OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
180 os_include_dir="os/bsd/darwin"
181 ;;
182 *djgpp*) # leading * picks up "msdosdjgpp"
183 os_include_dir="os/djgpp"
184 ;;
185 freebsd*)
186 os_include_dir="os/bsd/freebsd"
187 ;;
188 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
189 os_include_dir="os/gnu-linux"
190 ;;
191 hpux*)
192 os_include_dir="os/hpux"
193 ;;
194 irix[1-6] | irix[1-5].* | irix6.[0-4]*)
195 # This is known to work on at least IRIX 5.2 and 6.3.
196 os_include_dir="os/irix/irix5.2"
197 atomicity_dir=os/irix
198 atomic_word_dir=os/irix
199 ;;
200 irix6.5*)
201 os_include_dir="os/irix/irix6.5"
202 atomicity_dir=os/irix
203 atomic_word_dir=os/irix
204 ;;
205 mingw32*)
206 os_include_dir="os/mingw32"
207 ;;
208 netbsd*)
209 os_include_dir="os/bsd/netbsd"
210 ;;
211 qnx6.[12]*)
212 os_include_dir="os/qnx/qnx6.1"
213 c_model=c
214 ;;
215 solaris2)
216 # This too-vague configuration does not provide enough information
217 # to select a ctype include, and thus os_include_dir is a crap shoot.
218 echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2
219 exit 1
220 ;;
221 solaris2.5 | solaris2.5.[0-9])
222 os_include_dir="os/solaris/solaris2.5"
223 ;;
224 solaris2.6)
225 os_include_dir="os/solaris/solaris2.6"
226 ;;
227 solaris2.[789] | solaris2.1[0-9])
228 os_include_dir="os/solaris/solaris2.7"
229 ;;
230 tpf)
231 os_include_dir="os/tpf"
232 ;;
233 vxworks)
234 os_include_dir="os/vxworks"
235 ;;
236 windiss*)
237 os_include_dir="os/windiss"
238 ;;
239 *)
240 os_include_dir="os/generic"
241 ;;
242 esac
243
244
245 # Set any OS-dependent and CPU-dependent bits.
246 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
247 case "${host}" in
248 alpha*-*-freebsd5*)
249 abi_baseline_pair="alpha-freebsd5"
250 ;;
251 arm*-*-linux*)
252 abi_baseline_pair="arm-linux-gnu"
253 ;;
254 i*86-*-freebsd4*)
255 abi_baseline_pair="i386-freebsd4"
256 ;;
257 i*86-*-freebsd5*)
258 abi_baseline_pair="i386-freebsd5"
259 ;;
260 mips*-*-linux*)
261 atomicity_dir="cpu/mips"
262 abi_baseline_pair="mips-linux-gnu"
263 cpu_include_dir="cpu/mips"
264 ;;
265 s390-*-linux*)
266 abi_baseline_pair="s390-linux-gnu"
267 ;;
268 s390x-*-linux*)
269 abi_baseline_pair="s390x-linux-gnu"
270 ;;
271 sparc*-*-freebsd5*)
272 abi_baseline_pair="sparc-freebsd5"
273 ;;
274 x86_64-*-linux*)
275 abi_baseline_pair="x86_64-linux-gnu"
276 ;;
277 esac