]>
Commit | Line | Data |
---|---|---|
ff66d28f | 1 | dnl |
552afe9e | 2 | dnl This file contains details for non-native builds. |
ff66d28f PE |
3 | dnl |
4 | ||
c41f82b2 | 5 | AC_DEFUN([GLIBCXX_CROSSCONFIG],[ |
ff66d28f PE |
6 | # Base decisions on target environment. |
7 | case "${host}" in | |
4c24b21a MM |
8 | arm*-*-symbianelf*) |
9 | # This is a freestanding configuration; there is nothing to do here. | |
10 | ;; | |
11 | ||
6649ad7e FMA |
12 | avr*-*-*) |
13 | AC_DEFINE(HAVE_ACOSF) | |
14 | AC_DEFINE(HAVE_ASINF) | |
15 | AC_DEFINE(HAVE_ATAN2F) | |
16 | AC_DEFINE(HAVE_ATANF) | |
17 | AC_DEFINE(HAVE_CEILF) | |
18 | AC_DEFINE(HAVE_COSF) | |
19 | AC_DEFINE(HAVE_COSHF) | |
20 | AC_DEFINE(HAVE_EXPF) | |
21 | AC_DEFINE(HAVE_FABSF) | |
22 | AC_DEFINE(HAVE_FLOORF) | |
23 | AC_DEFINE(HAVE_FMODF) | |
24 | AC_DEFINE(HAVE_FREXPF) | |
25 | AC_DEFINE(HAVE_SQRTF) | |
26 | AC_DEFINE(HAVE_HYPOTF) | |
27 | AC_DEFINE(HAVE_LDEXPF) | |
28 | AC_DEFINE(HAVE_LOG10F) | |
29 | AC_DEFINE(HAVE_LOGF) | |
30 | AC_DEFINE(HAVE_MODFF) | |
31 | AC_DEFINE(HAVE_POWF) | |
32 | AC_DEFINE(HAVE_SINF) | |
33 | AC_DEFINE(HAVE_SINHF) | |
34 | AC_DEFINE(HAVE_TANF) | |
35 | AC_DEFINE(HAVE_TANHF) | |
36 | ;; | |
37 | ||
d9dced13 RS |
38 | mips*-sde-elf*) |
39 | # These definitions are for the SDE C library rather than newlib. | |
d9dced13 RS |
40 | SECTION_FLAGS='-ffunction-sections -fdata-sections' |
41 | AC_SUBST(SECTION_FLAGS) | |
42 | GLIBCXX_CHECK_COMPILER_FEATURES | |
43 | GLIBCXX_CHECK_LINKER_FEATURES | |
44 | GLIBCXX_CHECK_MATH_SUPPORT | |
d9dced13 | 45 | GLIBCXX_CHECK_STDLIB_SUPPORT |
d9dced13 | 46 | |
d9dced13 RS |
47 | AC_DEFINE(HAVE_FINITE) |
48 | AC_DEFINE(HAVE_HYPOT) | |
49 | AC_DEFINE(HAVE_ISNAN) | |
50 | AC_DEFINE(HAVE_ISINF) | |
51 | ||
52 | AC_DEFINE(HAVE_LDEXPF) | |
53 | AC_DEFINE(HAVE_MODF) | |
54 | AC_DEFINE(HAVE_SQRTF) | |
55 | ;; | |
56 | ||
70ed7339 RS |
57 | *-aix*) |
58 | GLIBCXX_CHECK_LINKER_FEATURES | |
59 | GLIBCXX_CHECK_MATH_SUPPORT | |
60 | GLIBCXX_CHECK_STDLIB_SUPPORT | |
5ae2c32a | 61 | AC_DEFINE(_GLIBCXX_USE_DEV_RANDOM) |
70ed7339 RS |
62 | AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1) |
63 | # We don't yet support AIX's TLS ABI. | |
64 | #GCC_CHECK_TLS | |
65 | AM_ICONV | |
932fbc86 JW |
66 | |
67 | AC_DEFINE(HAVE_USELOCALE) | |
70ed7339 RS |
68 | ;; |
69 | ||
a6f3e253 GK |
70 | *-darwin*) |
71 | # Darwin versions vary, but the linker should work in a cross environment, | |
72 | # so we just check for all the features here. | |
73 | # Check for available headers. | |
a6f3e253 | 74 | |
a6f3e253 GK |
75 | # Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld |
76 | GLIBCXX_CHECK_MATH_SUPPORT | |
a6f3e253 | 77 | GLIBCXX_CHECK_STDLIB_SUPPORT |
932fbc86 JW |
78 | |
79 | AC_CHECK_FUNCS(uselocale) | |
a6f3e253 GK |
80 | ;; |
81 | ||
185fca74 | 82 | *djgpp) |
9f1fd474 | 83 | # GLIBCXX_CHECK_MATH_SUPPORT |
9bb68d2a DD |
84 | AC_DEFINE(HAVE_ISINF) |
85 | AC_DEFINE(HAVE_ISNAN) | |
86 | AC_DEFINE(HAVE_FINITE) | |
9bb68d2a DD |
87 | AC_DEFINE(HAVE_SINCOS) |
88 | AC_DEFINE(HAVE_HYPOT) | |
185fca74 AH |
89 | ;; |
90 | ||
ff66d28f | 91 | *-freebsd*) |
ff66d28f PE |
92 | SECTION_FLAGS='-ffunction-sections -fdata-sections' |
93 | AC_SUBST(SECTION_FLAGS) | |
94 | GLIBCXX_CHECK_LINKER_FEATURES | |
ff66d28f | 95 | AC_DEFINE(HAVE_SETENV) |
ff66d28f PE |
96 | AC_DEFINE(HAVE_FINITEF) |
97 | AC_DEFINE(HAVE_FINITE) | |
98 | AC_DEFINE(HAVE_FREXPF) | |
99 | AC_DEFINE(HAVE_HYPOT) | |
100 | AC_DEFINE(HAVE_HYPOTF) | |
101 | AC_DEFINE(HAVE_ISINF) | |
102 | AC_DEFINE(HAVE_ISNAN) | |
103 | AC_DEFINE(HAVE_ISNANF) | |
104 | ||
ff66d28f PE |
105 | AC_DEFINE(HAVE_ACOSF) |
106 | AC_DEFINE(HAVE_ASINF) | |
107 | AC_DEFINE(HAVE_ATAN2F) | |
108 | AC_DEFINE(HAVE_ATANF) | |
109 | AC_DEFINE(HAVE_CEILF) | |
ff66d28f PE |
110 | AC_DEFINE(HAVE_COSF) |
111 | AC_DEFINE(HAVE_COSHF) | |
112 | AC_DEFINE(HAVE_EXPF) | |
113 | AC_DEFINE(HAVE_FABSF) | |
114 | AC_DEFINE(HAVE_FLOORF) | |
115 | AC_DEFINE(HAVE_FMODF) | |
116 | AC_DEFINE(HAVE_FREXPF) | |
117 | AC_DEFINE(HAVE_LDEXPF) | |
118 | AC_DEFINE(HAVE_LOG10F) | |
119 | AC_DEFINE(HAVE_LOGF) | |
120 | AC_DEFINE(HAVE_MODFF) | |
121 | AC_DEFINE(HAVE_POWF) | |
122 | AC_DEFINE(HAVE_SINF) | |
123 | AC_DEFINE(HAVE_SINHF) | |
124 | AC_DEFINE(HAVE_SQRTF) | |
125 | AC_DEFINE(HAVE_TANF) | |
126 | AC_DEFINE(HAVE_TANHF) | |
127 | if test x"long_double_math_on_this_cpu" = x"yes"; then | |
128 | AC_DEFINE(HAVE_FINITEL) | |
129 | AC_DEFINE(HAVE_ISINFL) | |
130 | AC_DEFINE(HAVE_ISNANL) | |
131 | fi | |
ea4ad78e | 132 | AC_CHECK_FUNCS(__cxa_thread_atexit) |
97ca95ac | 133 | AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc) |
a61ae535 | 134 | AC_CHECK_FUNCS(timespec_get) |
187fdaea | 135 | AC_CHECK_FUNCS(sockatmark) |
932fbc86 | 136 | AC_CHECK_FUNCS(uselocale) |
ff66d28f | 137 | ;; |
93f90f7b JC |
138 | |
139 | *-fuchsia*) | |
140 | SECTION_FLAGS='-ffunction-sections -fdata-sections' | |
141 | AC_SUBST(SECTION_FLAGS) | |
142 | ;; | |
143 | ||
ff66d28f | 144 | *-hpux*) |
ff66d28f PE |
145 | SECTION_FLAGS='-ffunction-sections -fdata-sections' |
146 | AC_SUBST(SECTION_FLAGS) | |
147 | GLIBCXX_CHECK_LINKER_FEATURES | |
55c8e6a3 BK |
148 | |
149 | # GLIBCXX_CHECK_MATH_SUPPORT | |
150 | AC_DEFINE(HAVE_ISNAN) | |
55c8e6a3 BK |
151 | AC_DEFINE(HAVE_HYPOT) |
152 | AC_DEFINE(HAVE_ACOSF) | |
153 | AC_DEFINE(HAVE_ASINF) | |
154 | AC_DEFINE(HAVE_ATANF) | |
155 | AC_DEFINE(HAVE_COSF) | |
156 | AC_DEFINE(HAVE_COSHF) | |
157 | AC_DEFINE(HAVE_SINF) | |
158 | AC_DEFINE(HAVE_SINHF) | |
159 | AC_DEFINE(HAVE_TANF) | |
160 | AC_DEFINE(HAVE_TANHF) | |
161 | AC_DEFINE(HAVE_EXPF) | |
162 | AC_DEFINE(HAVE_ATAN2F) | |
4564ac62 | 163 | AC_DEFINE(HAVE_FABSF) |
55c8e6a3 | 164 | AC_DEFINE(HAVE_FMODF) |
ff66d28f | 165 | AC_DEFINE(HAVE_FREXPF) |
55c8e6a3 BK |
166 | AC_DEFINE(HAVE_LOGF) |
167 | AC_DEFINE(HAVE_LOG10F) | |
168 | AC_DEFINE(HAVE_MODF) | |
169 | AC_DEFINE(HAVE_POWF) | |
170 | AC_DEFINE(HAVE_SQRTF) | |
171 | ||
55c8e6a3 BK |
172 | # GLIBCXX_CHECK_STDLIB_SUPPORT |
173 | AC_DEFINE(HAVE_STRTOLD) | |
174 | ||
175 | GCC_CHECK_TLS | |
ff66d28f | 176 | ;; |
e34fd4dc | 177 | *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-cygwin* | *-solaris*) |
464aea98 | 178 | GLIBCXX_CHECK_COMPILER_FEATURES |
ff66d28f | 179 | GLIBCXX_CHECK_LINKER_FEATURES |
464aea98 | 180 | GLIBCXX_CHECK_MATH_SUPPORT |
464aea98 | 181 | GLIBCXX_CHECK_STDLIB_SUPPORT |
5ae2c32a | 182 | AC_DEFINE(_GLIBCXX_USE_DEV_RANDOM) |
bffc9d79 | 183 | AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1) |
55c8e6a3 | 184 | GCC_CHECK_TLS |
3c97fe77 | 185 | AC_CHECK_FUNCS(__cxa_thread_atexit_impl) |
77e6870d | 186 | AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc) |
a61ae535 | 187 | AC_CHECK_FUNCS(timespec_get) |
187fdaea | 188 | AC_CHECK_FUNCS(sockatmark) |
932fbc86 | 189 | AC_CHECK_FUNCS(uselocale) |
637e3668 | 190 | AC_CHECK_FUNCS(secure_getenv) |
bffc9d79 | 191 | AM_ICONV |
ff66d28f PE |
192 | ;; |
193 | *-mingw32*) | |
ff66d28f | 194 | GLIBCXX_CHECK_LINKER_FEATURES |
53f506ed BK |
195 | GLIBCXX_CHECK_MATH_SUPPORT |
196 | GLIBCXX_CHECK_STDLIB_SUPPORT | |
97ca95ac | 197 | AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc) |
b0292359 | 198 | AC_CHECK_FUNCS(_wfopen) |
cc1e2887 | 199 | GCC_CHECK_TLS |
ff66d28f | 200 | ;; |
4f9eae9f | 201 | *-netbsd* | *-openbsd*) |
ff66d28f PE |
202 | SECTION_FLAGS='-ffunction-sections -fdata-sections' |
203 | AC_SUBST(SECTION_FLAGS) | |
204 | GLIBCXX_CHECK_LINKER_FEATURES | |
ff66d28f PE |
205 | AC_DEFINE(HAVE_FINITEF) |
206 | AC_DEFINE(HAVE_FINITE) | |
207 | AC_DEFINE(HAVE_FREXPF) | |
208 | AC_DEFINE(HAVE_HYPOTF) | |
209 | AC_DEFINE(HAVE_ISINF) | |
210 | AC_DEFINE(HAVE_ISINFF) | |
211 | AC_DEFINE(HAVE_ISNAN) | |
212 | AC_DEFINE(HAVE_ISNANF) | |
213 | if test x"long_double_math_on_this_cpu" = x"yes"; then | |
214 | AC_DEFINE(HAVE_FINITEL) | |
215 | AC_DEFINE(HAVE_ISINFL) | |
216 | AC_DEFINE(HAVE_ISNANL) | |
217 | fi | |
95c921d1 | 218 | AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc) |
a61ae535 | 219 | AC_CHECK_FUNCS(timespec_get) |
187fdaea | 220 | AC_CHECK_FUNCS(sockatmark) |
ff66d28f PE |
221 | ;; |
222 | *-qnx6.1* | *-qnx6.2*) | |
ff66d28f PE |
223 | SECTION_FLAGS='-ffunction-sections -fdata-sections' |
224 | AC_SUBST(SECTION_FLAGS) | |
225 | GLIBCXX_CHECK_LINKER_FEATURES | |
ff66d28f PE |
226 | AC_DEFINE(HAVE_COSF) |
227 | AC_DEFINE(HAVE_COSL) | |
228 | AC_DEFINE(HAVE_COSHF) | |
229 | AC_DEFINE(HAVE_COSHL) | |
230 | AC_DEFINE(HAVE_LOGF) | |
231 | AC_DEFINE(HAVE_LOGL) | |
232 | AC_DEFINE(HAVE_LOG10F) | |
233 | AC_DEFINE(HAVE_LOG10L) | |
234 | AC_DEFINE(HAVE_SINF) | |
235 | AC_DEFINE(HAVE_SINL) | |
236 | AC_DEFINE(HAVE_SINHF) | |
237 | AC_DEFINE(HAVE_SINHL) | |
238 | ;; | |
6e198ee0 | 239 | *-tpf) |
6e198ee0 | 240 | SECTION_FLAGS='-ffunction-sections -fdata-sections' |
40f93bb5 | 241 | SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS' |
6e198ee0 | 242 | AC_SUBST(SECTION_FLAGS) |
6e198ee0 UW |
243 | AC_DEFINE(HAVE_FINITE) |
244 | AC_DEFINE(HAVE_FINITEF) | |
245 | AC_DEFINE(HAVE_FREXPF) | |
246 | AC_DEFINE(HAVE_HYPOTF) | |
247 | AC_DEFINE(HAVE_ISINF) | |
248 | AC_DEFINE(HAVE_ISINFF) | |
249 | AC_DEFINE(HAVE_ISNAN) | |
250 | AC_DEFINE(HAVE_ISNANF) | |
251 | AC_DEFINE(HAVE_SINCOS) | |
252 | AC_DEFINE(HAVE_SINCOSF) | |
253 | if test x"long_double_math_on_this_cpu" = x"yes"; then | |
254 | AC_DEFINE(HAVE_FINITEL) | |
255 | AC_DEFINE(HAVE_HYPOTL) | |
256 | AC_DEFINE(HAVE_ISINFL) | |
257 | AC_DEFINE(HAVE_ISNANL) | |
258 | fi | |
259 | ;; | |
db435dce TG |
260 | *-*vms*) |
261 | # Check for available headers. | |
262 | # Don't call GLIBCXX_CHECK_LINKER_FEATURES, VMS doesn't have a GNU ld | |
263 | GLIBCXX_CHECK_MATH_SUPPORT | |
264 | GLIBCXX_CHECK_STDLIB_SUPPORT | |
265 | ;; | |
d667beea | 266 | *-vxworks*) |
65fc9769 PE |
267 | AC_DEFINE(HAVE_ACOSF) |
268 | AC_DEFINE(HAVE_ASINF) | |
269 | AC_DEFINE(HAVE_ATAN2F) | |
270 | AC_DEFINE(HAVE_ATANF) | |
271 | AC_DEFINE(HAVE_CEILF) | |
272 | AC_DEFINE(HAVE_COSF) | |
273 | AC_DEFINE(HAVE_COSHF) | |
274 | AC_DEFINE(HAVE_EXPF) | |
275 | AC_DEFINE(HAVE_FABSF) | |
276 | AC_DEFINE(HAVE_FLOORF) | |
277 | AC_DEFINE(HAVE_FMODF) | |
278 | AC_DEFINE(HAVE_HYPOT) | |
279 | AC_DEFINE(HAVE_LOG10F) | |
280 | AC_DEFINE(HAVE_LOGF) | |
281 | AC_DEFINE(HAVE_POWF) | |
282 | AC_DEFINE(HAVE_SINF) | |
283 | AC_DEFINE(HAVE_SINHF) | |
284 | AC_DEFINE(HAVE_SQRTF) | |
285 | AC_DEFINE(HAVE_TANF) | |
286 | AC_DEFINE(HAVE_TANHF) | |
85129ff1 AO |
287 | |
288 | dnl # Different versions and execution modes implement different | |
289 | dnl # subsets of these functions. Instead of hard-coding, test for C | |
290 | dnl # declarations in headers. The C primitives could be defined as | |
291 | dnl # macros, in which case the tests might fail, and we might have to | |
292 | dnl # switch to more elaborate tests. | |
293 | GLIBCXX_CHECK_MATH_DECLS([ | |
294 | acosl asinl atan2l atanl ceill cosl coshl expl fabsl floorl fmodl | |
0edfc1fd DR |
295 | frexpl ldexpl log10l logl modfl powl sinl sinhl sqrtl tanl tanhl hypotl |
296 | ldexpf modff hypotf frexpf]) | |
85129ff1 AO |
297 | dnl # sincosl is the only one missing here, compared with the *l |
298 | dnl # functions in the list guarded by | |
299 | dnl # long_double_math_on_this_cpu in configure.ac, right after | |
300 | dnl # the expansion of the present macro. | |
65fc9769 | 301 | ;; |
ff66d28f PE |
302 | *) |
303 | AC_MSG_ERROR([No support for this host/target combination.]) | |
304 | ;; | |
305 | esac | |
c41f82b2 | 306 | ]) |
85129ff1 AO |
307 | |
308 | ||
309 | dnl | |
310 | dnl Check to see if the (math function) argument passed is | |
311 | dnl declared when using the c compiler | |
312 | dnl | |
313 | dnl Define HAVE_CARGF etc if "cargf" is declared | |
314 | dnl | |
315 | dnl argument 1 is name of function to check | |
316 | dnl | |
317 | dnl ASSUMES argument is a math function | |
318 | dnl | |
319 | dnl GLIBCXX_CHECK_MATH_DECL | |
320 | AC_DEFUN([GLIBCXX_CHECK_MATH_DECL], [ | |
321 | AC_CACHE_CHECK([for $1 declaration], | |
322 | [glibcxx_cv_func_$1_use], [ | |
323 | AC_LANG_SAVE | |
324 | AC_LANG_C | |
325 | AC_TRY_COMPILE([ | |
326 | #include <math.h> | |
327 | #ifdef HAVE_IEEEFP_H | |
328 | # include <ieeefp.h> | |
329 | #endif | |
f9e84b31 | 330 | #undef $1 |
85129ff1 AO |
331 | ], [ |
332 | void (*f)(void) = (void (*)(void))$1; | |
333 | ], [glibcxx_cv_func_$1_use=yes | |
334 | ], [glibcxx_cv_func_$1_use=no])]) | |
335 | if test "x$glibcxx_cv_func_$1_use" = xyes; then | |
336 | AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1])) | |
337 | fi | |
338 | ]) | |
339 | ||
340 | dnl | |
341 | dnl Check to see whether multiple math functions are | |
342 | dnl declared when using the c compiler | |
343 | dnl | |
344 | dnl Define HAVE_CARGF HAVE_POWL etc if "cargf" and "powl" | |
345 | dnl are declared | |
346 | dnl | |
347 | dnl argument 1 is a word list naming function to check | |
348 | dnl | |
349 | dnl ASSUMES arguments are math functions | |
350 | dnl | |
351 | dnl GLIBCXX_CHECK_MATH_DECLS | |
352 | AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS], [ | |
353 | m4_foreach_w([glibcxx_func], [$1], [ | |
354 | GLIBCXX_CHECK_MATH_DECL(glibcxx_func) | |
355 | ]) | |
356 | ]) |