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.
8 # You should read docs/html/17_intro/porting.* to make sense of this file.
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
17 # It sets the following shell variables:
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.
23 # os_include_dir OS-specific directory, defaults to os/generic.
25 # c_model the "C" header model, defaults to c_global.
27 # c_compatibility if "C" compatibility headers are necessary,
30 # abi_baseline_pair directory name for ABI compat testing,
31 # defaults to host_cpu-host_os (as per config.guess)
33 # abi_tweaks_dir location of cxxabi_tweaks.h,
34 # defaults to cpu_include_dir
36 # atomicity_dir location of atomicity.h,
37 # defaults to cpu_include_dir
39 # atomic_word_dir location of atomic_word.h
40 # defaults to generic.
42 # cpu_defines_dir location of cpu_defines.h
43 # defaults to generic.
46 # error_constants_dir location of error_constants.h
47 # defaults to os/generic.
49 # It possibly modifies the following variables:
51 # OPT_LDFLAGS extra flags to pass when linking the library, of
53 # (defaults to empty in acinclude.m4)
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
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.
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. :-)
73 atomic_word_dir=cpu/generic
74 atomicity_dir="cpu/generic"
75 cpu_defines_dir="cpu/generic"
77 abi_tweaks_dir="cpu/generic"
78 error_constants_dir="os/generic"
80 # HOST-SPECIFIC OVERRIDES
81 # Set any CPU-dependent bits.
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.
90 arm* | xscale | ep9312)
112 if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then
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
121 cpu_include_dir=cpu/${try_cpu}
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
128 cpu_defines_dir=cpu/powerpc
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
137 atomic_word_dir=cpu/alpha
140 atomic_word_dir=cpu/cris
143 atomic_word_dir=cpu/ia64
146 atomic_word_dir=cpu/powerpc
149 atomic_word_dir=cpu/sparc
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
162 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then
163 abi_tweaks_dir=$cpu_include_dir
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.
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"
185 os_include_dir="os/generic"
186 atomicity_dir="os/aix"
187 atomic_word_dir="os/aix"
190 os_include_dir="os/generic"
191 atomicity_dir="cpu/generic"
194 # Plain BSD attempts to share FreeBSD files.
195 os_include_dir="os/bsd/freebsd"
198 os_include_dir="os/newlib"
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"
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
213 OPTIMIZE_CXXFLAGS="${OPTIMIZE_CXXFLAGS} -fvisibility-inlines-hidden"
216 os_include_dir="os/bsd/darwin"
218 *djgpp*) # leading * picks up "msdosdjgpp"
219 os_include_dir="os/djgpp"
222 os_include_dir="os/bsd/freebsd"
224 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
225 if [ "$uclibc" = "yes" ]; then
226 os_include_dir="os/uclibc"
228 os_include_dir="os/gnu-linux"
232 os_include_dir="os/hpux"
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
241 os_include_dir="os/irix/irix6.5"
242 atomicity_dir=os/irix
243 atomic_word_dir=os/irix
246 os_include_dir="os/mingw32"
247 error_constants_dir="os/mingw32"
250 os_include_dir="os/bsd/netbsd"
253 os_include_dir="os/qnx/qnx6.1"
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
262 solaris2.5 | solaris2.5.[0-9])
263 os_include_dir="os/solaris/solaris2.5"
266 os_include_dir="os/solaris/solaris2.6"
268 solaris2.[789] | solaris2.1[0-9])
269 os_include_dir="os/solaris/solaris2.7"
272 os_include_dir="os/tpf"
275 os_include_dir="os/vxworks"
278 os_include_dir="os/windiss"
281 os_include_dir="os/generic"
286 # Set any OS-dependent and CPU-dependent bits.
287 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
290 case "${host_cpu}" in
292 abi_baseline_pair=i486-linux-gnu
295 abi_baseline_pair=powerpc64-linux-gnu
298 abi_baseline_pair=s390-linux-gnu
301 abi_baseline_pair=s390x-linux-gnu
304 abi_baseline_pair=x86_64-linux-gnu
307 if test -d ${glibcxx_srcdir}/config/abi/post/${try_cpu}-linux-gnu; then
308 abi_baseline_pair=${try_cpu}-linux-gnu
314 gnu* | linux* | irix*)
317 atomicity_dir="cpu/generic"
322 port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"