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
21 # used to set atomicity_include_dir.
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 # atomicity_dir location of atomicity.h,
34 # defaults to cpu_include_dir
36 # atomic_word_dir location of atomic_word.h
37 # defaults to generic.
39 # It possibly modifies the following variables:
41 # OPT_LDFLAGS extra flags to pass when linking the library, of
43 # (defaults to empty in acinclude.m4)
45 # port_specific_symbol_files
46 # whitespace-seperated list of files containing
47 # additional symbols to export from the shared
48 # library, when symbol versioning is in use
51 # If the defaults will not work for your platform, you need only change the
52 # variables that won't work, i.e., you do not need to explicitly set a
53 # working variable to its default. Most hosts only need to change the two
54 # *_include_dir variables.
58 # Try to guess a default cpu_include_dir based on the name of the CPU. We
59 # cannot do this for os_include_dir; there are too many portable operating
60 # systems out there. :-)
63 atomic_word_dir=cpu/generic
65 # HOST-SPECIFIC OVERRIDES
66 # Set any CPU-dependent bits.
67 # Here we override defaults and catch more general cases due to naming
68 # conventions (e.g., chip_name* to catch all variants).
70 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
82 # NB: cpu/mips/atomicity.h needs MIPS II or above.
83 # Of course, there is no sane way to test for this, no ABI macro,
84 # and no consistent host_cpu name differentiation. Therefore, only
85 # use it where it is known to be safe, ie it runs linux (see below).
100 arm* | xscale | ep9312)
104 if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then
112 # Set specific CPU overrides for atomic_word_dir. Most can just use generic.
113 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
114 case "${host_cpu}" in
116 atomic_word_dir=cpu/cris
119 atomic_word_dir=cpu/sparc
123 # Now look for the file(s) usually tied to a CPU model, and make
124 # default choices for those if they haven't been explicitly set
126 cpu_include_dir="cpu/${try_cpu}"
127 abi_baseline_pair=${try_cpu}-${host_os}
129 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/atomicity.h ; then
130 atomicity_dir=$cpu_include_dir
132 atomicity_dir="cpu/generic"
135 if test -f ${glibcxx_srcdir}/config/${cpu_include_dir}/cxxabi_tweaks.h ; then
136 abi_tweaks_dir=$cpu_include_dir
138 abi_tweaks_dir="cpu/generic"
141 # Set any OS-dependent bits.
142 # Set the os_include_dir.
143 # Set c_model, c_compatibility here.
144 # If atomic ops and/or numeric limits are OS-specific rather than
145 # CPU-specifc, set those here too.
146 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
148 aix4.[3456789]* | aix[56789]*)
149 # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
150 # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
151 # explicitly duplicate the directory for 4.[<3].
152 os_include_dir="os/aix"
153 atomicity_dir="os/aix"
157 os_include_dir="os/generic"
158 atomicity_dir="os/aix"
161 os_include_dir="os/generic"
162 atomicity_dir="cpu/generic"
165 # Plain BSD attempts to share FreeBSD files.
166 os_include_dir="os/bsd/freebsd"
169 os_include_dir="os/newlib"
171 *djgpp*) # leading * picks up "msdosdjgpp"
172 os_include_dir="os/djgpp"
175 os_include_dir="os/bsd/freebsd"
177 gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
178 os_include_dir="os/gnu-linux"
181 os_include_dir="os/hpux"
183 irix[1-6] | irix[1-5].* | irix6.[0-4]*)
184 # This is known to work on at least IRIX 5.2 and 6.3.
185 os_include_dir="os/irix/irix5.2"
186 atomicity_dir=os/irix
187 atomic_word_dir=os/irix
190 os_include_dir="os/irix/irix6.5"
191 atomicity_dir=os/irix
192 atomic_word_dir=os/irix
195 os_include_dir="os/mingw32"
198 os_include_dir="os/bsd/netbsd"
201 os_include_dir="os/qnx/qnx6.1"
205 # This too-vague configuration does not provide enough information
206 # to select a ctype include, and thus os_include_dir is a crap shoot.
207 echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2
210 solaris2.5 | solaris2.5.[0-9])
211 os_include_dir="os/solaris/solaris2.5"
214 os_include_dir="os/solaris/solaris2.6"
216 solaris2.[789] | solaris2.1[0-9])
217 os_include_dir="os/solaris/solaris2.7"
220 os_include_dir="os/tpf"
223 os_include_dir="os/vxworks"
226 os_include_dir="os/windiss"
229 os_include_dir="os/generic"
234 # Set any OS-dependent and CPU-dependent bits.
235 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
238 atomicity_dir="cpu/mips"
241 abi_baseline_pair="x86_64-linux-gnu"
244 abi_baseline_pair="alpha-freebsd5"
247 abi_baseline_pair="i386-freebsd4"
250 abi_baseline_pair="i386-freebsd5"
253 abi_baseline_pair="sparc-freebsd5"