]>
Commit | Line | Data |
---|---|---|
b731048b | 1 | # configure.host |
2c839a4e | 2 | # |
b731048b BK |
3 | # This shell script handles all host based configuration for libstdc++. |
4 | # It sets various shell variables based on the the host and the | |
2c839a4e PE |
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: | |
b731048b BK |
12 | # host The configuration host (full CPU-vendor-OS triplet) |
13 | # host_cpu The configuration host CPU | |
14 | # host_os The configuration host OS | |
2c839a4e PE |
15 | # |
16 | # | |
17 | # It sets the following shell variables: | |
18 | # | |
19 | # cpu_include_dir CPU-specific directory, defaults to cpu/generic | |
ef16a298 | 20 | # if cpu/host_cpu doesn't exist. This is |
ff66d28f | 21 | # used to set atomicity_include_dir. |
2c839a4e PE |
22 | # |
23 | # os_include_dir OS-specific directory, defaults to os/generic. | |
24 | # | |
ef16a298 | 25 | # c_model the "C" header model, defaults to c_std. |
e01c9849 | 26 | # |
17640f24 | 27 | # c_compatibility if "C" compatibility headers are necessary, |
ef16a298 | 28 | # defaults to no. |
2c839a4e | 29 | # |
ef16a298 BK |
30 | # abi_baseline_pair directory name for ABI compat testing, |
31 | # defaults to host_cpu-host_os (as per config.guess) | |
314b5a68 | 32 | # |
ff66d28f | 33 | # atomicity_include_dir location of atomicity.h, |
ef16a298 | 34 | # defaults to cpu_include_dir |
ca017eef | 35 | # |
2c839a4e PE |
36 | # It possibly modifies the following variables: |
37 | # | |
38 | # OPT_LDFLAGS extra flags to pass when linking the library, of | |
ef16a298 BK |
39 | # the form '-Wl,blah' |
40 | # (defaults to empty in acinclude.m4) | |
2c839a4e | 41 | # |
58579a27 | 42 | # port_specific_symbol_files |
e6b7a69a | 43 | # whitespace-seperated list of files containing |
ff66d28f PE |
44 | # additional symbols to export from the shared |
45 | # library, when symbol versioning is in use | |
e6b7a69a | 46 | # |
2c839a4e PE |
47 | # |
48 | # If the defaults will not work for your platform, you need only change the | |
49 | # variables that won't work, i.e., you do not need to explicitly set a | |
b731048b | 50 | # working variable to its default. Most hosts only need to change the two |
2c839a4e | 51 | # *_include_dir variables. |
d0941a31 | 52 | |
d0941a31 | 53 | |
e01c9849 | 54 | # DEFAULTS |
2c839a4e PE |
55 | # Try to guess a default cpu_include_dir based on the name of the CPU. We |
56 | # cannot do this for os_include_dir; there are too many portable operating | |
57 | # systems out there. :-) | |
85ab9d23 BK |
58 | c_model=c_std |
59 | c_compatibility=no | |
2c839a4e | 60 | |
b731048b | 61 | # HOST-SPECIFIC OVERRIDES |
e01c9849 | 62 | # Set any CPU-dependent bits. |
2c839a4e | 63 | # Here we override defaults and catch more general cases due to naming |
17640f24 | 64 | # conventions (e.g., chip_name* to catch all variants). |
ef16a298 | 65 | |
d0941a31 | 66 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
b731048b | 67 | case "${host_cpu}" in |
d0941a31 | 68 | alpha*) |
ef16a298 | 69 | try_cpu=alpha |
d0941a31 | 70 | ;; |
e6b7a69a | 71 | i[567]86 | x86_64) |
ef16a298 | 72 | try_cpu=i486 |
d0941a31 | 73 | ;; |
49dd74ef | 74 | hppa*) |
ef16a298 | 75 | try_cpu=hppa |
49dd74ef | 76 | ;; |
92d568f2 | 77 | mips*) |
ef16a298 BK |
78 | # NB: cpu/mips/atomicity.h needs MIPS II or above. |
79 | # Of course, there is no sane way to test for this, no ABI macro, | |
80 | # and no consistent host_cpu name differentiation. Therefore, only | |
81 | # use it where it is known to be safe, ie it runs linux (see below). | |
82 | try_cpu=generic | |
92d568f2 | 83 | ;; |
85ab9d23 | 84 | m680[246]0) |
ef16a298 | 85 | try_cpu=m68k |
2c839a4e | 86 | ;; |
bd11db39 | 87 | powerpc* | rs6000) |
ef16a298 | 88 | try_cpu=powerpc |
d0941a31 | 89 | ;; |
85ab9d23 | 90 | s390x) |
ef16a298 | 91 | try_cpu=s390 |
35495312 | 92 | ;; |
0fe707cc | 93 | sparc* | ultrasparc) |
ef16a298 BK |
94 | try_cpu=sparc |
95 | ;; | |
96 | *) | |
3d7c150e | 97 | if test -d ${glibcxx_srcdir}/config/cpu/${host_cpu}; then |
bbdfb3e8 MK |
98 | try_cpu=${host_cpu} |
99 | else | |
100 | try_cpu=generic | |
101 | fi | |
d0941a31 | 102 | ;; |
d0941a31 PE |
103 | esac |
104 | ||
5ab481e0 BK |
105 | # Now look for the file(s) usually tied to a CPU model, and make |
106 | # default choices for those if they haven't been explicitly set | |
107 | # already. | |
108 | cpu_include_dir="cpu/${try_cpu}" | |
ff66d28f | 109 | atomicity_include_dir=$cpu_include_dir |
ef16a298 | 110 | abi_baseline_pair=${try_cpu}-${host_os} |
2c839a4e PE |
111 | |
112 | ||
e01c9849 | 113 | # Set any OS-dependent bits. |
17640f24 | 114 | # Set the os_include_dir. |
e01c9849 BK |
115 | # Set c_model, c_compatibility here. |
116 | # If atomic ops and/or numeric limits are OS-specific rather than | |
117 | # CPU-specifc, set those here too. | |
d0941a31 | 118 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
b731048b | 119 | case "${host_os}" in |
527b03ed | 120 | aix4.[3456789]* | aix[56789]*) |
2c839a4e | 121 | # We set os_include_dir to os/aix only on AIX 4.3 and newer, but |
d32e25df | 122 | # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we |
2c839a4e PE |
123 | # explicitly duplicate the directory for 4.[<3]. |
124 | os_include_dir="os/aix" | |
ff66d28f | 125 | atomicity_include_dir="os/aix" |
34e3a8d5 | 126 | OPT_LDFLAGS="-Wl,-G" |
d0941a31 | 127 | ;; |
2c839a4e | 128 | aix4.*) |
47395a24 | 129 | os_include_dir="os/generic" |
ff66d28f | 130 | atomicity_include_dir="os/aix" |
2c839a4e PE |
131 | ;; |
132 | aix*) | |
47395a24 | 133 | os_include_dir="os/generic" |
ff66d28f | 134 | atomicity_include_dir="cpu/generic" |
2c839a4e | 135 | ;; |
8478f170 LR |
136 | bsd*) |
137 | # Plain BSD attempts to share FreeBSD files. | |
2c839a4e | 138 | os_include_dir="os/bsd/freebsd" |
d0941a31 | 139 | ;; |
c383aafd | 140 | cygwin*) |
2c839a4e PE |
141 | os_include_dir="os/newlib" |
142 | ;; | |
143 | *djgpp*) # leading * picks up "msdosdjgpp" | |
144 | os_include_dir="os/djgpp" | |
c383aafd | 145 | ;; |
8478f170 LR |
146 | freebsd*) |
147 | os_include_dir="os/bsd/freebsd" | |
8478f170 | 148 | ;; |
b938ad89 | 149 | gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) |
2c839a4e | 150 | os_include_dir="os/gnu-linux" |
6f87af20 | 151 | ;; |
2c839a4e PE |
152 | hpux*) |
153 | os_include_dir="os/hpux" | |
d0941a31 | 154 | ;; |
789b7de5 | 155 | irix[1-6] | irix[1-5].* | irix6.[0-4]*) |
2c839a4e PE |
156 | # This is known to work on at least IRIX 5.2 and 6.3. |
157 | os_include_dir="os/irix/irix5.2" | |
ff66d28f | 158 | atomicity_include_dir=$os_include_dir |
2c839a4e | 159 | ;; |
789b7de5 | 160 | irix6.5*) |
2c839a4e | 161 | os_include_dir="os/irix/irix6.5" |
ff66d28f | 162 | atomicity_include_dir=$os_include_dir |
d0941a31 | 163 | ;; |
944effb6 | 164 | mingw32*) |
2c839a4e | 165 | os_include_dir="os/mingw32" |
944effb6 | 166 | ;; |
11b176c1 | 167 | netbsd*) |
2c839a4e | 168 | os_include_dir="os/bsd/netbsd" |
11b176c1 | 169 | ;; |
ff66d28f PE |
170 | qnx6.[12]*) |
171 | os_include_dir="os/qnx/qnx6.1" | |
172 | c_model=c | |
173 | ;; | |
43892f8c BK |
174 | solaris2) |
175 | # This too-vague configuration does not provide enough information | |
176 | # to select a ctype include, and thus os_include_dir is a crap shoot. | |
177 | echo "Please specify the full version of Solaris, ie. solaris2.9 " 1>&2 | |
178 | exit 1; | |
179 | ;; | |
51ac684e | 180 | solaris2.5 | solaris2.5.[0-9]) |
2c839a4e | 181 | os_include_dir="os/solaris/solaris2.5" |
d0941a31 | 182 | ;; |
51ac684e | 183 | solaris2.6) |
2c839a4e | 184 | os_include_dir="os/solaris/solaris2.6" |
d0941a31 | 185 | ;; |
51ac684e | 186 | solaris2.[789] | solaris2.1[0-9]) |
2c839a4e | 187 | os_include_dir="os/solaris/solaris2.7" |
598730fe | 188 | ;; |
6e198ee0 UW |
189 | tpf) |
190 | os_include_dir="os/tpf" | |
191 | ;; | |
65fc9769 PE |
192 | vxworks) |
193 | os_include_dir="os/vxworks" | |
194 | ;; | |
522e3d22 | 195 | windiss*) |
2c839a4e | 196 | os_include_dir="os/windiss" |
522e3d22 | 197 | ;; |
d0941a31 | 198 | *) |
2c839a4e | 199 | os_include_dir="os/generic" |
d0941a31 PE |
200 | ;; |
201 | esac | |
202 | ||
203 | ||
e01c9849 | 204 | # Set any OS-dependent and CPU-dependent bits. |
d0941a31 | 205 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
b731048b | 206 | case "${host}" in |
17640f24 | 207 | mips*-*-linux*) |
ff66d28f | 208 | atomicity_include_dir="cpu/mips" |
17640f24 | 209 | ;; |
5ab481e0 BK |
210 | x86_64-*-linux*) |
211 | abi_baseline_pair="x86_64-linux-gnu" | |
212 | ;; | |
9eb6e1d3 LR |
213 | alpha*-*-freebsd5*) |
214 | abi_baseline_pair="alpha-freebsd5" | |
215 | ;; | |
5ab481e0 BK |
216 | i*86-*-freebsd4*) |
217 | abi_baseline_pair="i386-freebsd4" | |
218 | ;; | |
9eb6e1d3 LR |
219 | i*86-*-freebsd5*) |
220 | abi_baseline_pair="i386-freebsd5" | |
221 | ;; | |
222 | sparc*-*-freebsd5*) | |
223 | abi_baseline_pair="sparc-freebsd5" | |
224 | ;; | |
6414587c | 225 | esac |