3 # This shell script handles all target based configuration for libstdc++.
4 # It sets various shell variables based on the the target 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 # target The configuration target (full CPU-vendor-OS triplet)
13 # target_cpu The configuration target CPU
14 # target_os The configuration target OS
17 # It sets the following shell variables:
19 # cpu_include_dir CPU-specific directory, defaults to cpu/generic
20 # if cpu/target_cpu doesn't exist. This is
21 # used to set the next two:
23 # os_include_dir OS-specific directory, defaults to os/generic.
25 # c_model the model to use for "C" headers, defaults to c_std.
27 # c_compatibility if "C" compatibility headers are necessary,
30 # abi_baseline_triplet directory name for ABI compat testing,
31 # defaults to target (as per config.guess)
33 # ATOMICITYH location of atomicity.h,
34 # defaults to cpu_include_dir
36 # It possibly modifies the following variables:
38 # OPT_LDFLAGS extra flags to pass when linking the library, of
40 # (defaults to empty in acinclude.m4)
43 # If the defaults will not work for your platform, you need only change the
44 # variables that won't work, i.e., you do not need to explicitly set a
45 # working variable to its default. Most targets only need to change the two
46 # *_include_dir variables.
50 # Try to guess a default cpu_include_dir based on the name of the CPU. We
51 # cannot do this for os_include_dir; there are too many portable operating
52 # systems out there. :-)
53 if test -d ${glibcpp_srcdir}/config/cpu/${target_cpu}; then
54 cpu_include_dir="cpu/${target_cpu}"
56 cpu_include_dir="cpu/generic"
59 abi_baseline_triplet=${target}
65 # TARGET-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).
69 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
70 case "${target_cpu}" in
72 cpu_include_dir="cpu/alpha"
74 arm* | strongarm* | xscale* )
75 cpu_include_dir="cpu/arm"
77 i486 | i586 | i686 | i786)
78 # add athlons here maybe
79 cpu_include_dir="cpu/i486"
82 cpu_include_dir="cpu/m68k"
85 # MIPS chips are unreliable as to sc/ll support. By default
86 # don't use atomic instructions and override for the OS.
87 cpu_include_dir="cpu/generic"
90 ATOMICITYH="cpu/generic"
93 cpu_include_dir="cpu/powerpc"
96 cpu_include_dir="cpu/s390"
99 cpu_include_dir="cpu/sparc"
102 cpu_include_dir="cpu/x86-64"
107 # Now look for the file(s) usually tied to a CPU model, and make default
108 # choices for those if they haven't been explicitly set already.
109 _cpu_incdir_fullpath=${glibcpp_srcdir}/config/${cpu_include_dir}
110 if test x${ATOMICITYH+set} != xset; then
111 if test -f ${_cpu_incdir_fullpath}/atomicity.h; then
112 ATOMICITYH=$cpu_include_dir
114 ATOMICITYH="cpu/generic"
117 unset _cpu_incdir_fullpath
120 # Set any OS-dependent bits.
121 # Set the os_include_dir.
122 # Set c_model, c_compatibility here.
123 # If atomic ops and/or numeric limits are OS-specific rather than
124 # CPU-specifc, set those here too.
125 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
126 case "${target_os}" in
127 aix4.[3456789]* | aix[56789]*)
128 # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
129 # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
130 # explicitly duplicate the directory for 4.[<3].
131 os_include_dir="os/aix"
139 ATOMICITYH="cpu/generic"
142 # Plain BSD attempts to share FreeBSD files.
143 os_include_dir="os/bsd/freebsd"
146 os_include_dir="os/newlib"
148 *djgpp*) # leading * picks up "msdosdjgpp"
149 os_include_dir="os/djgpp"
152 os_include_dir="os/bsd/freebsd"
153 # The FreeBSD ABI is expressed in the major version number only.
154 abi_baseline_triplet=`echo ${target} | sed 's,\(\.[0-9]*\)*$,,'`
157 os_include_dir="os/gnu-linux"
160 os_include_dir="os/hpux"
162 irix[1-6] | irix[1-5].* | irix6.[0-4]*)
163 # This is known to work on at least IRIX 5.2 and 6.3.
164 os_include_dir="os/irix/irix5.2"
165 ATOMICITYH=$os_include_dir
168 os_include_dir="os/irix/irix6.5"
169 ATOMICITYH=$os_include_dir
172 os_include_dir="os/mingw32"
175 os_include_dir="os/bsd/netbsd"
178 os_include_dir="os/solaris/solaris2.5"
181 os_include_dir="os/solaris/solaris2.6"
184 os_include_dir="os/solaris/solaris2.7"
187 os_include_dir="os/windiss"
190 os_include_dir="os/qnx/qnx6.1"
194 os_include_dir="os/generic"
199 # Set any OS-dependent and CPU-dependent bits.
200 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
203 ATOMICITYH="cpu/mips"