2 dnl This file contains details for non-native builds.
5 AC_DEFUN([GLIBCXX_CROSSCONFIG],[
6 # Base decisions on target environment.
9 # This is a freestanding configuration; there is nothing to do here.
15 AC_DEFINE(HAVE_ATAN2F)
22 AC_DEFINE(HAVE_FLOORF)
24 AC_DEFINE(HAVE_FREXPF)
26 AC_DEFINE(HAVE_HYPOTF)
27 AC_DEFINE(HAVE_LDEXPF)
28 AC_DEFINE(HAVE_LOG10F)
39 # These definitions are for the SDE C library rather than newlib.
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
45 GLIBCXX_CHECK_STDLIB_SUPPORT
47 AC_DEFINE(HAVE_FINITE)
52 AC_DEFINE(HAVE_LDEXPF)
58 GLIBCXX_CHECK_LINKER_FEATURES
59 GLIBCXX_CHECK_MATH_SUPPORT
60 GLIBCXX_CHECK_STDLIB_SUPPORT
61 AC_DEFINE(_GLIBCXX_USE_DEV_RANDOM)
62 AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1)
63 # We don't yet support AIX's TLS ABI.
67 AC_DEFINE(HAVE_USELOCALE)
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.
75 # Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
76 GLIBCXX_CHECK_MATH_SUPPORT
77 GLIBCXX_CHECK_STDLIB_SUPPORT
79 AC_CHECK_FUNCS(uselocale)
83 # GLIBCXX_CHECK_MATH_SUPPORT
86 AC_DEFINE(HAVE_FINITE)
87 AC_DEFINE(HAVE_SINCOS)
92 SECTION_FLAGS='-ffunction-sections -fdata-sections'
93 AC_SUBST(SECTION_FLAGS)
94 GLIBCXX_CHECK_LINKER_FEATURES
95 AC_DEFINE(HAVE_SETENV)
96 AC_DEFINE(HAVE_FINITEF)
97 AC_DEFINE(HAVE_FINITE)
98 AC_DEFINE(HAVE_FREXPF)
100 AC_DEFINE(HAVE_HYPOTF)
101 AC_DEFINE(HAVE_ISINF)
102 AC_DEFINE(HAVE_ISNAN)
103 AC_DEFINE(HAVE_ISNANF)
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)
111 AC_DEFINE(HAVE_COSHF)
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)
120 AC_DEFINE(HAVE_MODFF)
123 AC_DEFINE(HAVE_SINHF)
124 AC_DEFINE(HAVE_SQRTF)
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)
132 AC_CHECK_FUNCS(__cxa_thread_atexit)
133 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
134 AC_CHECK_FUNCS(timespec_get)
135 AC_CHECK_FUNCS(sockatmark)
136 AC_CHECK_FUNCS(uselocale)
140 SECTION_FLAGS='-ffunction-sections -fdata-sections'
141 AC_SUBST(SECTION_FLAGS)
145 SECTION_FLAGS='-ffunction-sections -fdata-sections'
146 AC_SUBST(SECTION_FLAGS)
147 GLIBCXX_CHECK_LINKER_FEATURES
149 # GLIBCXX_CHECK_MATH_SUPPORT
150 AC_DEFINE(HAVE_ISNAN)
151 AC_DEFINE(HAVE_HYPOT)
152 AC_DEFINE(HAVE_ACOSF)
153 AC_DEFINE(HAVE_ASINF)
154 AC_DEFINE(HAVE_ATANF)
156 AC_DEFINE(HAVE_COSHF)
158 AC_DEFINE(HAVE_SINHF)
160 AC_DEFINE(HAVE_TANHF)
162 AC_DEFINE(HAVE_ATAN2F)
163 AC_DEFINE(HAVE_FABSF)
164 AC_DEFINE(HAVE_FMODF)
165 AC_DEFINE(HAVE_FREXPF)
167 AC_DEFINE(HAVE_LOG10F)
170 AC_DEFINE(HAVE_SQRTF)
172 # GLIBCXX_CHECK_STDLIB_SUPPORT
173 AC_DEFINE(HAVE_STRTOLD)
178 AC_DEFINE(HAVE_ISINF)
179 AC_DEFINE(HAVE_ISINFF)
180 AC_DEFINE(HAVE_ISNANF)
181 AC_DEFINE(HAVE_FINITE)
182 AC_DEFINE(HAVE_FINITEF)
186 *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-cygwin* | *-solaris*)
187 GLIBCXX_CHECK_COMPILER_FEATURES
188 GLIBCXX_CHECK_LINKER_FEATURES
189 GLIBCXX_CHECK_MATH_SUPPORT
190 GLIBCXX_CHECK_STDLIB_SUPPORT
191 AC_DEFINE(_GLIBCXX_USE_DEV_RANDOM)
192 AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1)
194 AC_CHECK_FUNCS(__cxa_thread_atexit_impl)
195 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
196 AC_CHECK_FUNCS(timespec_get)
197 AC_CHECK_FUNCS(sockatmark)
198 AC_CHECK_FUNCS(uselocale)
202 GLIBCXX_CHECK_LINKER_FEATURES
203 GLIBCXX_CHECK_MATH_SUPPORT
204 GLIBCXX_CHECK_STDLIB_SUPPORT
205 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
206 AC_CHECK_FUNCS(_wfopen)
209 *-netbsd* | *-openbsd*)
210 SECTION_FLAGS='-ffunction-sections -fdata-sections'
211 AC_SUBST(SECTION_FLAGS)
212 GLIBCXX_CHECK_LINKER_FEATURES
213 AC_DEFINE(HAVE_FINITEF)
214 AC_DEFINE(HAVE_FINITE)
215 AC_DEFINE(HAVE_FREXPF)
216 AC_DEFINE(HAVE_HYPOTF)
217 AC_DEFINE(HAVE_ISINF)
218 AC_DEFINE(HAVE_ISINFF)
219 AC_DEFINE(HAVE_ISNAN)
220 AC_DEFINE(HAVE_ISNANF)
221 if test x"long_double_math_on_this_cpu" = x"yes"; then
222 AC_DEFINE(HAVE_FINITEL)
223 AC_DEFINE(HAVE_ISINFL)
224 AC_DEFINE(HAVE_ISNANL)
226 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
227 AC_CHECK_FUNCS(timespec_get)
228 AC_CHECK_FUNCS(sockatmark)
230 *-qnx6.1* | *-qnx6.2*)
231 SECTION_FLAGS='-ffunction-sections -fdata-sections'
232 AC_SUBST(SECTION_FLAGS)
233 GLIBCXX_CHECK_LINKER_FEATURES
236 AC_DEFINE(HAVE_COSHF)
237 AC_DEFINE(HAVE_COSHL)
240 AC_DEFINE(HAVE_LOG10F)
241 AC_DEFINE(HAVE_LOG10L)
244 AC_DEFINE(HAVE_SINHF)
245 AC_DEFINE(HAVE_SINHL)
248 GLIBCXX_CHECK_COMPILER_FEATURES
249 GLIBCXX_CHECK_LINKER_FEATURES
250 GLIBCXX_CHECK_MATH_SUPPORT
251 GLIBCXX_CHECK_STDLIB_SUPPORT
254 SECTION_FLAGS='-ffunction-sections -fdata-sections'
255 SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS'
256 AC_SUBST(SECTION_FLAGS)
257 AC_DEFINE(HAVE_FINITE)
258 AC_DEFINE(HAVE_FINITEF)
259 AC_DEFINE(HAVE_FREXPF)
260 AC_DEFINE(HAVE_HYPOTF)
261 AC_DEFINE(HAVE_ISINF)
262 AC_DEFINE(HAVE_ISINFF)
263 AC_DEFINE(HAVE_ISNAN)
264 AC_DEFINE(HAVE_ISNANF)
265 AC_DEFINE(HAVE_SINCOS)
266 AC_DEFINE(HAVE_SINCOSF)
267 if test x"long_double_math_on_this_cpu" = x"yes"; then
268 AC_DEFINE(HAVE_FINITEL)
269 AC_DEFINE(HAVE_HYPOTL)
270 AC_DEFINE(HAVE_ISINFL)
271 AC_DEFINE(HAVE_ISNANL)
275 # Check for available headers.
276 # Don't call GLIBCXX_CHECK_LINKER_FEATURES, VMS doesn't have a GNU ld
277 GLIBCXX_CHECK_MATH_SUPPORT
278 GLIBCXX_CHECK_STDLIB_SUPPORT
281 AC_DEFINE(HAVE_ACOSF)
282 AC_DEFINE(HAVE_ASINF)
283 AC_DEFINE(HAVE_ATAN2F)
284 AC_DEFINE(HAVE_ATANF)
285 AC_DEFINE(HAVE_CEILF)
287 AC_DEFINE(HAVE_COSHF)
289 AC_DEFINE(HAVE_FABSF)
290 AC_DEFINE(HAVE_FLOORF)
291 AC_DEFINE(HAVE_FMODF)
292 AC_DEFINE(HAVE_HYPOT)
293 AC_DEFINE(HAVE_LOG10F)
297 AC_DEFINE(HAVE_SINHF)
298 AC_DEFINE(HAVE_SQRTF)
300 AC_DEFINE(HAVE_TANHF)
302 dnl # Different versions and execution modes implement different
303 dnl # subsets of these functions. Instead of hard-coding, test for C
304 dnl # declarations in headers. The C primitives could be defined as
305 dnl # macros, in which case the tests might fail, and we might have to
306 dnl # switch to more elaborate tests.
307 GLIBCXX_CHECK_MATH_DECLS([
308 acosl asinl atan2l atanl ceill cosl coshl expl fabsl floorl fmodl
309 frexpl ldexpl log10l logl modfl powl sinl sinhl sqrtl tanl tanhl hypotl
310 ldexpf modff hypotf frexpf])
311 dnl # sincosl is the only one missing here, compared with the *l
312 dnl # functions in the list guarded by
313 dnl # long_double_math_on_this_cpu in configure.ac, right after
314 dnl # the expansion of the present macro.
317 AC_MSG_ERROR([No support for this host/target combination.])
324 dnl Check to see if the (math function) argument passed is
325 dnl declared when using the c compiler
327 dnl Define HAVE_CARGF etc if "cargf" is declared
329 dnl argument 1 is name of function to check
331 dnl ASSUMES argument is a math function
333 dnl GLIBCXX_CHECK_MATH_DECL
334 AC_DEFUN([GLIBCXX_CHECK_MATH_DECL], [
335 AC_CACHE_CHECK([for $1 declaration],
336 [glibcxx_cv_func_$1_use], [
346 void (*f)(void) = (void (*)(void))$1;
347 ], [glibcxx_cv_func_$1_use=yes
348 ], [glibcxx_cv_func_$1_use=no])])
349 if test "x$glibcxx_cv_func_$1_use" = xyes; then
350 AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]))
355 dnl Check to see whether multiple math functions are
356 dnl declared when using the c compiler
358 dnl Define HAVE_CARGF HAVE_POWL etc if "cargf" and "powl"
361 dnl argument 1 is a word list naming function to check
363 dnl ASSUMES arguments are math functions
365 dnl GLIBCXX_CHECK_MATH_DECLS
366 AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS], [
367 m4_foreach_w([glibcxx_func], [$1], [
368 GLIBCXX_CHECK_MATH_DECL(glibcxx_func)