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