]>
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 | |
b731048b | 20 | # if cpu/host_cpu doesn't exist. This is |
974e336b | 21 | # used to set ATOMICITYH. |
2c839a4e PE |
22 | # |
23 | # os_include_dir OS-specific directory, defaults to os/generic. | |
24 | # | |
e01c9849 BK |
25 | # c_model the model to use for "C" headers, defaults to c_std. |
26 | # | |
17640f24 | 27 | # c_compatibility if "C" compatibility headers are necessary, |
e01c9849 | 28 | # defaults to no. |
2c839a4e | 29 | # |
314b5a68 | 30 | # abi_baseline_triplet directory name for ABI compat testing, |
b731048b | 31 | # defaults to host (as per config.guess) |
314b5a68 | 32 | # |
ca017eef BK |
33 | # ATOMICITYH location of atomicity.h, |
34 | # defaults to cpu_include_dir | |
35 | # | |
2c839a4e PE |
36 | # It possibly modifies the following variables: |
37 | # | |
38 | # OPT_LDFLAGS extra flags to pass when linking the library, of | |
39 | # the form '-Wl,blah' | |
40 | # (defaults to empty in acinclude.m4) | |
41 | # | |
42 | # | |
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 | |
b731048b | 45 | # working variable to its default. Most hosts only need to change the two |
2c839a4e | 46 | # *_include_dir variables. |
d0941a31 | 47 | |
d0941a31 | 48 | |
e01c9849 | 49 | # DEFAULTS |
2c839a4e PE |
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. :-) | |
b731048b | 53 | abi_baseline_triplet=${host} |
85ab9d23 BK |
54 | c_model=c_std |
55 | c_compatibility=no | |
b731048b BK |
56 | if test -d ${glibcpp_srcdir}/config/cpu/${host_cpu}; then |
57 | cpu_include_dir="cpu/${host_cpu}" | |
2c839a4e PE |
58 | else |
59 | cpu_include_dir="cpu/generic" | |
60 | fi | |
d0941a31 | 61 | |
2c839a4e | 62 | |
b731048b | 63 | # HOST-SPECIFIC OVERRIDES |
e01c9849 | 64 | # Set any CPU-dependent bits. |
2c839a4e | 65 | # Here we override defaults and catch more general cases due to naming |
17640f24 | 66 | # conventions (e.g., chip_name* to catch all variants). |
d0941a31 | 67 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
b731048b | 68 | case "${host_cpu}" in |
d0941a31 | 69 | alpha*) |
2c839a4e | 70 | cpu_include_dir="cpu/alpha" |
d0941a31 | 71 | ;; |
85ab9d23 | 72 | athlon* | i586 | i686 | i786 | x86_64) |
2c839a4e | 73 | cpu_include_dir="cpu/i486" |
d0941a31 | 74 | ;; |
49dd74ef JDA |
75 | hppa*) |
76 | cpu_include_dir="cpu/hppa" | |
77 | ;; | |
92d568f2 RS |
78 | mips*) |
79 | # cpu/mips/atomicity.h needs MIPS II or above. Only use it | |
80 | # where it is known to be safe. | |
81 | ATOMICITYH="cpu/generic" | |
82 | ;; | |
85ab9d23 | 83 | m680[246]0) |
2c839a4e PE |
84 | cpu_include_dir="cpu/m68k" |
85 | ;; | |
bd11db39 | 86 | powerpc* | rs6000) |
2c839a4e | 87 | cpu_include_dir="cpu/powerpc" |
d0941a31 | 88 | ;; |
85ab9d23 | 89 | s390x) |
2c839a4e | 90 | cpu_include_dir="cpu/s390" |
35495312 | 91 | ;; |
0fe707cc JJ |
92 | sparc* | ultrasparc) |
93 | cpu_include_dir="cpu/sparc" | |
d0941a31 | 94 | ;; |
d0941a31 PE |
95 | esac |
96 | ||
97 | ||
ca017eef | 98 | # Now look for the file(s) usually tied to a CPU model, and make default |
2c839a4e PE |
99 | # choices for those if they haven't been explicitly set already. |
100 | _cpu_incdir_fullpath=${glibcpp_srcdir}/config/${cpu_include_dir} | |
101 | if test x${ATOMICITYH+set} != xset; then | |
d32e25df | 102 | if test -f ${_cpu_incdir_fullpath}/atomicity.h; then |
2c839a4e PE |
103 | ATOMICITYH=$cpu_include_dir |
104 | else | |
105 | ATOMICITYH="cpu/generic" | |
106 | fi | |
107 | fi | |
2c839a4e PE |
108 | unset _cpu_incdir_fullpath |
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" | |
144 | # The FreeBSD ABI is expressed in the major version number only. | |
b731048b | 145 | abi_baseline_triplet=`echo ${host} | sed 's,\(\.[0-9]*\)*$,,'` |
8478f170 | 146 | ;; |
2c839a4e PE |
147 | gnu* | linux*) |
148 | os_include_dir="os/gnu-linux" | |
6f87af20 | 149 | ;; |
2c839a4e PE |
150 | hpux*) |
151 | os_include_dir="os/hpux" | |
d0941a31 | 152 | ;; |
789b7de5 | 153 | irix[1-6] | irix[1-5].* | irix6.[0-4]*) |
2c839a4e PE |
154 | # This is known to work on at least IRIX 5.2 and 6.3. |
155 | os_include_dir="os/irix/irix5.2" | |
156 | ATOMICITYH=$os_include_dir | |
157 | ;; | |
789b7de5 | 158 | irix6.5*) |
2c839a4e PE |
159 | os_include_dir="os/irix/irix6.5" |
160 | ATOMICITYH=$os_include_dir | |
d0941a31 | 161 | ;; |
944effb6 | 162 | mingw32*) |
2c839a4e | 163 | os_include_dir="os/mingw32" |
944effb6 | 164 | ;; |
11b176c1 | 165 | netbsd*) |
2c839a4e | 166 | os_include_dir="os/bsd/netbsd" |
11b176c1 | 167 | ;; |
d0941a31 | 168 | solaris2.5*) |
2c839a4e | 169 | os_include_dir="os/solaris/solaris2.5" |
d0941a31 PE |
170 | ;; |
171 | solaris2.6*) | |
2c839a4e | 172 | os_include_dir="os/solaris/solaris2.6" |
d0941a31 | 173 | ;; |
3d838e28 | 174 | solaris2.[789]*) |
2c839a4e | 175 | os_include_dir="os/solaris/solaris2.7" |
598730fe | 176 | ;; |
522e3d22 | 177 | windiss*) |
2c839a4e | 178 | os_include_dir="os/windiss" |
522e3d22 | 179 | ;; |
f62bef48 | 180 | qnx6.[12]*) |
2c839a4e | 181 | os_include_dir="os/qnx/qnx6.1" |
e01c9849 | 182 | c_model=c |
f62bef48 | 183 | ;; |
d0941a31 | 184 | *) |
2c839a4e | 185 | os_include_dir="os/generic" |
d0941a31 PE |
186 | ;; |
187 | esac | |
188 | ||
189 | ||
e01c9849 | 190 | # Set any OS-dependent and CPU-dependent bits. |
d0941a31 | 191 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
b731048b | 192 | case "${host}" in |
17640f24 EC |
193 | mips*-*-linux*) |
194 | ATOMICITYH="cpu/mips" | |
195 | ;; | |
6414587c | 196 | esac |