]>
Commit | Line | Data |
---|---|---|
d0941a31 | 1 | # configure.target |
2c839a4e | 2 | # |
d0941a31 PE |
3 | # This shell script handles all target based configuration for libstdc++. |
4 | # It sets various shell variables based on the the target 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: | |
12 | # target The configuration target (full CPU-vendor-OS triplet) | |
d0941a31 PE |
13 | # target_cpu The configuration target CPU |
14 | # target_os The configuration target OS | |
2c839a4e PE |
15 | # |
16 | # | |
17 | # It sets the following shell variables: | |
18 | # | |
19 | # cpu_include_dir CPU-specific directory, defaults to cpu/generic | |
20 | # if cpu/target_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 PE |
30 | # abi_baseline_triplet directory name for ABI compat testing, |
31 | # defaults to target (as per config.guess) | |
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 | |
45 | # working variable to its default. Most targets only need to change the two | |
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. :-) | |
85ab9d23 BK |
53 | abi_baseline_triplet=${target} |
54 | c_model=c_std | |
55 | c_compatibility=no | |
2c839a4e PE |
56 | if test -d ${glibcpp_srcdir}/config/cpu/${target_cpu}; then |
57 | cpu_include_dir="cpu/${target_cpu}" | |
58 | else | |
59 | cpu_include_dir="cpu/generic" | |
60 | fi | |
d0941a31 | 61 | |
2c839a4e | 62 | |
17640f24 | 63 | # TARGET-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. |
d0941a31 PE |
68 | case "${target_cpu}" in |
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 | ;; | |
85ab9d23 | 78 | m680[246]0) |
2c839a4e PE |
79 | cpu_include_dir="cpu/m68k" |
80 | ;; | |
bd11db39 | 81 | powerpc* | rs6000) |
2c839a4e | 82 | cpu_include_dir="cpu/powerpc" |
d0941a31 | 83 | ;; |
85ab9d23 | 84 | s390x) |
2c839a4e | 85 | cpu_include_dir="cpu/s390" |
35495312 | 86 | ;; |
0fe707cc JJ |
87 | sparc* | ultrasparc) |
88 | cpu_include_dir="cpu/sparc" | |
d0941a31 | 89 | ;; |
d0941a31 PE |
90 | esac |
91 | ||
92 | ||
ca017eef | 93 | # Now look for the file(s) usually tied to a CPU model, and make default |
2c839a4e PE |
94 | # choices for those if they haven't been explicitly set already. |
95 | _cpu_incdir_fullpath=${glibcpp_srcdir}/config/${cpu_include_dir} | |
96 | if test x${ATOMICITYH+set} != xset; then | |
d32e25df | 97 | if test -f ${_cpu_incdir_fullpath}/atomicity.h; then |
2c839a4e PE |
98 | ATOMICITYH=$cpu_include_dir |
99 | else | |
100 | ATOMICITYH="cpu/generic" | |
101 | fi | |
102 | fi | |
2c839a4e PE |
103 | unset _cpu_incdir_fullpath |
104 | ||
105 | ||
e01c9849 | 106 | # Set any OS-dependent bits. |
17640f24 | 107 | # Set the os_include_dir. |
e01c9849 BK |
108 | # Set c_model, c_compatibility here. |
109 | # If atomic ops and/or numeric limits are OS-specific rather than | |
110 | # CPU-specifc, set those here too. | |
d0941a31 | 111 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
d0941a31 | 112 | case "${target_os}" in |
527b03ed | 113 | aix4.[3456789]* | aix[56789]*) |
2c839a4e | 114 | # We set os_include_dir to os/aix only on AIX 4.3 and newer, but |
d32e25df | 115 | # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we |
2c839a4e PE |
116 | # explicitly duplicate the directory for 4.[<3]. |
117 | os_include_dir="os/aix" | |
118 | ATOMICITYH="os/aix" | |
34e3a8d5 | 119 | OPT_LDFLAGS="-Wl,-G" |
d0941a31 | 120 | ;; |
2c839a4e PE |
121 | aix4.*) |
122 | ATOMICITYH="os/aix" | |
123 | ;; | |
124 | aix*) | |
125 | ATOMICITYH="cpu/generic" | |
126 | ;; | |
8478f170 LR |
127 | bsd*) |
128 | # Plain BSD attempts to share FreeBSD files. | |
2c839a4e | 129 | os_include_dir="os/bsd/freebsd" |
d0941a31 | 130 | ;; |
c383aafd | 131 | cygwin*) |
2c839a4e PE |
132 | os_include_dir="os/newlib" |
133 | ;; | |
134 | *djgpp*) # leading * picks up "msdosdjgpp" | |
135 | os_include_dir="os/djgpp" | |
c383aafd | 136 | ;; |
8478f170 LR |
137 | freebsd*) |
138 | os_include_dir="os/bsd/freebsd" | |
139 | # The FreeBSD ABI is expressed in the major version number only. | |
140 | abi_baseline_triplet=`echo ${target} | sed 's,\(\.[0-9]*\)*$,,'` | |
141 | ;; | |
2c839a4e PE |
142 | gnu* | linux*) |
143 | os_include_dir="os/gnu-linux" | |
6f87af20 | 144 | ;; |
2c839a4e PE |
145 | hpux*) |
146 | os_include_dir="os/hpux" | |
d0941a31 | 147 | ;; |
789b7de5 | 148 | irix[1-6] | irix[1-5].* | irix6.[0-4]*) |
2c839a4e PE |
149 | # This is known to work on at least IRIX 5.2 and 6.3. |
150 | os_include_dir="os/irix/irix5.2" | |
151 | ATOMICITYH=$os_include_dir | |
152 | ;; | |
789b7de5 | 153 | irix6.5*) |
2c839a4e PE |
154 | os_include_dir="os/irix/irix6.5" |
155 | ATOMICITYH=$os_include_dir | |
d0941a31 | 156 | ;; |
944effb6 | 157 | mingw32*) |
2c839a4e | 158 | os_include_dir="os/mingw32" |
944effb6 | 159 | ;; |
11b176c1 | 160 | netbsd*) |
2c839a4e | 161 | os_include_dir="os/bsd/netbsd" |
11b176c1 | 162 | ;; |
d0941a31 | 163 | solaris2.5*) |
2c839a4e | 164 | os_include_dir="os/solaris/solaris2.5" |
d0941a31 PE |
165 | ;; |
166 | solaris2.6*) | |
2c839a4e | 167 | os_include_dir="os/solaris/solaris2.6" |
d0941a31 | 168 | ;; |
3d838e28 | 169 | solaris2.[789]*) |
2c839a4e | 170 | os_include_dir="os/solaris/solaris2.7" |
598730fe | 171 | ;; |
522e3d22 | 172 | windiss*) |
2c839a4e | 173 | os_include_dir="os/windiss" |
522e3d22 | 174 | ;; |
f62bef48 | 175 | qnx6.[12]*) |
2c839a4e | 176 | os_include_dir="os/qnx/qnx6.1" |
e01c9849 | 177 | c_model=c |
f62bef48 | 178 | ;; |
d0941a31 | 179 | *) |
2c839a4e | 180 | os_include_dir="os/generic" |
d0941a31 PE |
181 | ;; |
182 | esac | |
183 | ||
184 | ||
e01c9849 | 185 | # Set any OS-dependent and CPU-dependent bits. |
d0941a31 | 186 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
6414587c | 187 | case "${target}" in |
17640f24 EC |
188 | mips*-*-linux*) |
189 | ATOMICITYH="cpu/mips" | |
190 | ;; | |
6414587c | 191 | esac |