]>
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: | |
22 | # ATOMICITYH location of bits/atomicity.h, | |
23 | # defaults to cpu_include_dir | |
24 | # CPULIMITSH location of bits/cpu_limits.h, | |
25 | # defaults to cpu_include_dir | |
26 | # | |
27 | # os_include_dir OS-specific directory, defaults to os/generic. | |
28 | # | |
29 | # | |
30 | # It possibly modifies the following variables: | |
31 | # | |
32 | # OPT_LDFLAGS extra flags to pass when linking the library, of | |
33 | # the form '-Wl,blah' | |
34 | # (defaults to empty in acinclude.m4) | |
35 | # | |
36 | # | |
37 | # If the defaults will not work for your platform, you need only change the | |
38 | # variables that won't work, i.e., you do not need to explicitly set a | |
39 | # working variable to its default. Most targets only need to change the two | |
40 | # *_include_dir variables. | |
d0941a31 | 41 | |
d0941a31 | 42 | |
2c839a4e PE |
43 | # Try to guess a default cpu_include_dir based on the name of the CPU. We |
44 | # cannot do this for os_include_dir; there are too many portable operating | |
45 | # systems out there. :-) | |
46 | if test -d ${glibcpp_srcdir}/config/cpu/${target_cpu}; then | |
47 | cpu_include_dir="cpu/${target_cpu}" | |
48 | else | |
49 | cpu_include_dir="cpu/generic" | |
50 | fi | |
d0941a31 | 51 | |
2c839a4e PE |
52 | |
53 | # Here we override defaults and catch more general cases due to naming | |
54 | # conventions (e.g., chip_name* to catch all variants). Also set any | |
55 | # CPU-dependent compiler flags. | |
d0941a31 | 56 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
d0941a31 PE |
57 | case "${target_cpu}" in |
58 | alpha*) | |
2c839a4e | 59 | cpu_include_dir="cpu/alpha" |
d0941a31 PE |
60 | ;; |
61 | arm*) | |
2c839a4e | 62 | cpu_include_dir="cpu/arm" |
d0941a31 PE |
63 | ;; |
64 | i486 | i586 | i686 | i786) | |
2c839a4e PE |
65 | cpu_include_dir="cpu/i486" |
66 | CPULIMITSH="cpu/i386" | |
d0941a31 | 67 | ;; |
8d36d722 | 68 | m68k | m680[246]0) |
2c839a4e PE |
69 | cpu_include_dir="cpu/m68k" |
70 | ;; | |
71 | mmix) | |
72 | ATOMICITYH="cpu/generic" | |
8d36d722 | 73 | ;; |
d0941a31 | 74 | powerpc | rs6000) |
2c839a4e | 75 | cpu_include_dir="cpu/powerpc" |
d0941a31 | 76 | ;; |
35495312 | 77 | s390 | s390x) |
2c839a4e | 78 | cpu_include_dir="cpu/s390" |
35495312 | 79 | ;; |
d0941a31 | 80 | sparc64 | ultrasparc) |
2c839a4e | 81 | cpu_include_dir="cpu/sparc/sparc64" |
d0941a31 PE |
82 | ;; |
83 | sparc*) | |
2c839a4e | 84 | cpu_include_dir="cpu/sparc/sparc32" |
d0941a31 | 85 | ;; |
aa3340ba | 86 | x86_64*) |
2c839a4e | 87 | cpu_include_dir="cpu/x86-64" |
d0941a31 PE |
88 | ;; |
89 | esac | |
90 | ||
91 | ||
2c839a4e PE |
92 | # Now look for the two files usually tied to a CPU model, and make default |
93 | # choices for those if they haven't been explicitly set already. | |
94 | _cpu_incdir_fullpath=${glibcpp_srcdir}/config/${cpu_include_dir} | |
95 | if test x${ATOMICITYH+set} != xset; then | |
96 | if test -f ${_cpu_incdir_fullpath}/bits/atomicity.h; then | |
97 | ATOMICITYH=$cpu_include_dir | |
98 | else | |
99 | ATOMICITYH="cpu/generic" | |
100 | fi | |
101 | fi | |
102 | if test x${CPULIMITSH+set} != xset; then | |
103 | if test -f ${_cpu_incdir_fullpath}/bits/cpu_limits.h; then | |
104 | CPULIMITSH=$cpu_include_dir | |
105 | else | |
106 | CPULIMITSH="cpu/generic" | |
107 | fi | |
108 | fi | |
109 | unset _cpu_incdir_fullpath | |
110 | ||
111 | ||
112 | # Set the os_include_dir. If atomic ops and/or numeric limits are OS-specific | |
113 | # rather than CPU-specifc, set those here too. Also set any OS-dependent | |
114 | # compiler flags. | |
d0941a31 | 115 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
d0941a31 | 116 | case "${target_os}" in |
527b03ed | 117 | aix4.[3456789]* | aix[56789]*) |
2c839a4e PE |
118 | # We set os_include_dir to os/aix only on AIX 4.3 and newer, but |
119 | # os/aix/bits/atomicity.h works on earlier versions of AIX 4.*, so we | |
120 | # explicitly duplicate the directory for 4.[<3]. | |
121 | os_include_dir="os/aix" | |
122 | ATOMICITYH="os/aix" | |
34e3a8d5 | 123 | OPT_LDFLAGS="-Wl,-G" |
d0941a31 | 124 | ;; |
2c839a4e PE |
125 | aix4.*) |
126 | ATOMICITYH="os/aix" | |
127 | ;; | |
128 | aix*) | |
129 | ATOMICITYH="cpu/generic" | |
130 | ;; | |
11b176c1 | 131 | bsd* | freebsd* ) |
2c839a4e | 132 | os_include_dir="os/bsd/freebsd" |
d0941a31 | 133 | ;; |
c383aafd | 134 | cygwin*) |
2c839a4e PE |
135 | os_include_dir="os/newlib" |
136 | ;; | |
137 | *djgpp*) # leading * picks up "msdosdjgpp" | |
138 | os_include_dir="os/djgpp" | |
c383aafd | 139 | ;; |
2c839a4e PE |
140 | gnu* | linux*) |
141 | os_include_dir="os/gnu-linux" | |
6f87af20 | 142 | ;; |
2c839a4e PE |
143 | hpux*) |
144 | os_include_dir="os/hpux" | |
145 | CPULIMITSH="os/hpux" | |
d0941a31 | 146 | ;; |
dd1f09c2 | 147 | irix[1-6] | irix[1-5].* | irix6.[0-4]) |
2c839a4e PE |
148 | # This is known to work on at least IRIX 5.2 and 6.3. |
149 | os_include_dir="os/irix/irix5.2" | |
150 | ATOMICITYH=$os_include_dir | |
151 | ;; | |
dd1f09c2 | 152 | irix6.5) |
2c839a4e PE |
153 | os_include_dir="os/irix/irix6.5" |
154 | ATOMICITYH=$os_include_dir | |
d0941a31 | 155 | ;; |
944effb6 | 156 | mingw32*) |
2c839a4e | 157 | os_include_dir="os/mingw32" |
944effb6 | 158 | ;; |
11b176c1 | 159 | netbsd*) |
2c839a4e | 160 | os_include_dir="os/bsd/netbsd" |
11b176c1 | 161 | ;; |
d0941a31 | 162 | solaris2.5*) |
2c839a4e | 163 | os_include_dir="os/solaris/solaris2.5" |
d0941a31 PE |
164 | ;; |
165 | solaris2.6*) | |
2c839a4e | 166 | os_include_dir="os/solaris/solaris2.6" |
d0941a31 | 167 | ;; |
2c839a4e PE |
168 | solaris2.[78]*) |
169 | os_include_dir="os/solaris/solaris2.7" | |
598730fe | 170 | ;; |
522e3d22 | 171 | windiss*) |
2c839a4e | 172 | os_include_dir="os/windiss" |
522e3d22 | 173 | ;; |
f62bef48 | 174 | qnx6.[12]*) |
2c839a4e | 175 | os_include_dir="os/qnx/qnx6.1" |
f62bef48 | 176 | ;; |
d0941a31 | 177 | *) |
2c839a4e | 178 | os_include_dir="os/generic" |
d0941a31 PE |
179 | ;; |
180 | esac | |
181 | ||
182 | ||
c5504edb | 183 | # Set any flags dependent on the full target triplet. |
d0941a31 | 184 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. |
6414587c | 185 | case "${target}" in |
2c839a4e PE |
186 | alpha*-*-*osf5*) |
187 | CPULIMITSH="os/osf/osf5.0" | |
188 | ;; | |
6414587c | 189 | esac |
9f3c078e | 190 |