]>
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 | |
21 | # used to set the next two: | |
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. :-) | |
53 | if test -d ${glibcpp_srcdir}/config/cpu/${target_cpu}; then | |
54 | cpu_include_dir="cpu/${target_cpu}" | |
55 | else | |
56 | cpu_include_dir="cpu/generic" | |
57 | fi | |
d0941a31 | 58 | |
314b5a68 PE |
59 | abi_baseline_triplet=${target} |
60 | ||
e01c9849 BK |
61 | c_model=c_std |
62 | c_compatibility=no | |
63 | ||
2c839a4e | 64 | |
17640f24 | 65 | # TARGET-SPECIFIC OVERRIDES |
e01c9849 | 66 | # Set any CPU-dependent bits. |
2c839a4e | 67 | # Here we override defaults and catch more general cases due to naming |
17640f24 | 68 | # conventions (e.g., chip_name* to catch all variants). |
d0941a31 | 69 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
d0941a31 PE |
70 | case "${target_cpu}" in |
71 | alpha*) | |
2c839a4e | 72 | cpu_include_dir="cpu/alpha" |
d0941a31 | 73 | ;; |
25cf8398 | 74 | arm* | strongarm* | xscale* ) |
2c839a4e | 75 | cpu_include_dir="cpu/arm" |
d0941a31 PE |
76 | ;; |
77 | i486 | i586 | i686 | i786) | |
314b5a68 | 78 | # add athlons here maybe |
2c839a4e | 79 | cpu_include_dir="cpu/i486" |
d0941a31 | 80 | ;; |
8d36d722 | 81 | m68k | m680[246]0) |
2c839a4e PE |
82 | cpu_include_dir="cpu/m68k" |
83 | ;; | |
17640f24 EC |
84 | mips*) |
85 | # MIPS chips are unreliable as to sc/ll support. By default | |
86 | # don't use atomic instructions and override for the OS. | |
9d7b4c5a PE |
87 | cpu_include_dir="cpu/generic" |
88 | ;; | |
2c839a4e PE |
89 | mmix) |
90 | ATOMICITYH="cpu/generic" | |
8d36d722 | 91 | ;; |
bd11db39 | 92 | powerpc* | rs6000) |
2c839a4e | 93 | cpu_include_dir="cpu/powerpc" |
d0941a31 | 94 | ;; |
35495312 | 95 | s390 | s390x) |
2c839a4e | 96 | cpu_include_dir="cpu/s390" |
35495312 | 97 | ;; |
0fe707cc JJ |
98 | sparc* | ultrasparc) |
99 | cpu_include_dir="cpu/sparc" | |
d0941a31 | 100 | ;; |
aa3340ba | 101 | x86_64*) |
2c839a4e | 102 | cpu_include_dir="cpu/x86-64" |
d0941a31 PE |
103 | ;; |
104 | esac | |
105 | ||
106 | ||
ca017eef | 107 | # Now look for the file(s) usually tied to a CPU model, and make default |
2c839a4e PE |
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 | |
d32e25df | 111 | if test -f ${_cpu_incdir_fullpath}/atomicity.h; then |
2c839a4e PE |
112 | ATOMICITYH=$cpu_include_dir |
113 | else | |
114 | ATOMICITYH="cpu/generic" | |
115 | fi | |
116 | fi | |
2c839a4e PE |
117 | unset _cpu_incdir_fullpath |
118 | ||
119 | ||
e01c9849 | 120 | # Set any OS-dependent bits. |
17640f24 | 121 | # Set the os_include_dir. |
e01c9849 BK |
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. | |
d0941a31 | 125 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
d0941a31 | 126 | case "${target_os}" in |
527b03ed | 127 | aix4.[3456789]* | aix[56789]*) |
2c839a4e | 128 | # We set os_include_dir to os/aix only on AIX 4.3 and newer, but |
d32e25df | 129 | # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we |
2c839a4e PE |
130 | # explicitly duplicate the directory for 4.[<3]. |
131 | os_include_dir="os/aix" | |
132 | ATOMICITYH="os/aix" | |
34e3a8d5 | 133 | OPT_LDFLAGS="-Wl,-G" |
d0941a31 | 134 | ;; |
2c839a4e PE |
135 | aix4.*) |
136 | ATOMICITYH="os/aix" | |
137 | ;; | |
138 | aix*) | |
139 | ATOMICITYH="cpu/generic" | |
140 | ;; | |
11b176c1 | 141 | bsd* | freebsd* ) |
2c839a4e | 142 | os_include_dir="os/bsd/freebsd" |
d0941a31 | 143 | ;; |
c383aafd | 144 | cygwin*) |
2c839a4e PE |
145 | os_include_dir="os/newlib" |
146 | ;; | |
147 | *djgpp*) # leading * picks up "msdosdjgpp" | |
148 | os_include_dir="os/djgpp" | |
c383aafd | 149 | ;; |
2c839a4e PE |
150 | gnu* | linux*) |
151 | os_include_dir="os/gnu-linux" | |
6f87af20 | 152 | ;; |
2c839a4e PE |
153 | hpux*) |
154 | os_include_dir="os/hpux" | |
d0941a31 | 155 | ;; |
789b7de5 | 156 | irix[1-6] | irix[1-5].* | irix6.[0-4]*) |
2c839a4e PE |
157 | # This is known to work on at least IRIX 5.2 and 6.3. |
158 | os_include_dir="os/irix/irix5.2" | |
159 | ATOMICITYH=$os_include_dir | |
160 | ;; | |
789b7de5 | 161 | irix6.5*) |
2c839a4e PE |
162 | os_include_dir="os/irix/irix6.5" |
163 | ATOMICITYH=$os_include_dir | |
d0941a31 | 164 | ;; |
944effb6 | 165 | mingw32*) |
2c839a4e | 166 | os_include_dir="os/mingw32" |
944effb6 | 167 | ;; |
11b176c1 | 168 | netbsd*) |
2c839a4e | 169 | os_include_dir="os/bsd/netbsd" |
11b176c1 | 170 | ;; |
d0941a31 | 171 | solaris2.5*) |
2c839a4e | 172 | os_include_dir="os/solaris/solaris2.5" |
d0941a31 PE |
173 | ;; |
174 | solaris2.6*) | |
2c839a4e | 175 | os_include_dir="os/solaris/solaris2.6" |
d0941a31 | 176 | ;; |
2c839a4e PE |
177 | solaris2.[78]*) |
178 | os_include_dir="os/solaris/solaris2.7" | |
598730fe | 179 | ;; |
522e3d22 | 180 | windiss*) |
2c839a4e | 181 | os_include_dir="os/windiss" |
522e3d22 | 182 | ;; |
f62bef48 | 183 | qnx6.[12]*) |
2c839a4e | 184 | os_include_dir="os/qnx/qnx6.1" |
e01c9849 | 185 | c_model=c |
f62bef48 | 186 | ;; |
d0941a31 | 187 | *) |
2c839a4e | 188 | os_include_dir="os/generic" |
d0941a31 PE |
189 | ;; |
190 | esac | |
191 | ||
192 | ||
e01c9849 | 193 | # Set any OS-dependent and CPU-dependent bits. |
d0941a31 | 194 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
6414587c | 195 | case "${target}" in |
17640f24 EC |
196 | mips*-*-linux*) |
197 | ATOMICITYH="cpu/mips" | |
198 | ;; | |
6414587c | 199 | esac |