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_std.
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 # It possibly modifies the following variables:
44 # OPT_LDFLAGS extra flags to pass when linking the library, of
46 # (defaults to empty in acinclude.m4)
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
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.
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. :-)
66 atomic_word_dir=cpu/generic
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).
73 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
78 arm* | xscale | ep9312)
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).
107 if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then
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
119 atomic_word_dir=cpu/cris
122 atomic_word_dir=cpu/sparc
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
129 cpu_include_dir=cpu/${try_cpu}
130 abi_baseline_pair=${try_cpu}-${host_os}
133 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/atomicity.h ; then
134 atomicity_dir=$cpu_include_dir
136 atomicity_dir="cpu/generic"
139 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then
140 abi_tweaks_dir=$cpu_include_dir
142 abi_tweaks_dir="cpu/generic"
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.
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"
161 os_include_dir="os/generic"
162 atomicity_dir="os/aix"
165 os_include_dir="os/generic"
166 atomicity_dir="cpu/generic"
169 # Plain BSD attempts to share FreeBSD files.
170 os_include_dir="os/bsd/freebsd"
173 os_include_dir="os/newlib"
175 *djgpp*) # leading * picks up "msdosdjgpp"
176 os_include_dir="os/djgpp"
179 os_include_dir="os/bsd/freebsd"
181 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
182 os_include_dir="os/gnu-linux"
185 os_include_dir="os/hpux"
187 irix[1-6] | irix[1-5].* | irix6.[0-4]*)
188 # This is known to work on at least IRIX 5.2 and 6.3.
189 os_include_dir="os/irix/irix5.2"
190 atomicity_dir=os/irix
191 atomic_word_dir=os/irix
194 os_include_dir="os/irix/irix6.5"
195 atomicity_dir=os/irix
196 atomic_word_dir=os/irix
199 os_include_dir="os/mingw32"
202 os_include_dir="os/bsd/netbsd"
205 os_include_dir="os/qnx/qnx6.1"
209 # This too-vague configuration does not provide enough information
210 # to select a ctype include, and thus os_include_dir is a crap shoot.
211 echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2
214 solaris2.5 | solaris2.5.[0-9])
215 os_include_dir="os/solaris/solaris2.5"
218 os_include_dir="os/solaris/solaris2.6"
220 solaris2.[789] | solaris2.1[0-9])
221 os_include_dir="os/solaris/solaris2.7"
224 os_include_dir="os/tpf"
227 os_include_dir="os/vxworks"
230 os_include_dir="os/windiss"
233 os_include_dir="os/generic"
238 # Set any OS-dependent and CPU-dependent bits.
239 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
242 abi_baseline_pair="alpha-freebsd5"
245 abi_baseline_pair="arm-linux-gnu"
248 abi_baseline_pair="i386-freebsd4"
251 abi_baseline_pair="i386-freebsd5"
254 atomicity_dir="cpu/mips"
255 abi_baseline_pair="mips-linux-gnu"
256 cpu_include_dir="cpu/mips"
259 abi_baseline_pair="sparc-freebsd5"
262 abi_baseline_pair="x86_64-linux-gnu"