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)
177 *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-cygwin* | *-solaris*)
178 GLIBCXX_CHECK_COMPILER_FEATURES
179 GLIBCXX_CHECK_LINKER_FEATURES
180 GLIBCXX_CHECK_MATH_SUPPORT
181 GLIBCXX_CHECK_STDLIB_SUPPORT
182 AC_DEFINE(_GLIBCXX_USE_DEV_RANDOM)
183 AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1)
185 AC_CHECK_FUNCS(__cxa_thread_atexit_impl)
186 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
187 AC_CHECK_FUNCS(timespec_get)
188 AC_CHECK_FUNCS(sockatmark)
189 AC_CHECK_FUNCS(uselocale)
190 AC_CHECK_FUNCS(secure_getenv)
194 GLIBCXX_CHECK_LINKER_FEATURES
195 GLIBCXX_CHECK_MATH_SUPPORT
196 GLIBCXX_CHECK_STDLIB_SUPPORT
197 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
198 AC_CHECK_FUNCS(_wfopen)
201 *-netbsd* | *-openbsd*)
202 SECTION_FLAGS='-ffunction-sections -fdata-sections'
203 AC_SUBST(SECTION_FLAGS)
204 GLIBCXX_CHECK_LINKER_FEATURES
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)
218 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
219 AC_CHECK_FUNCS(timespec_get)
220 AC_CHECK_FUNCS(sockatmark)
222 *-qnx6.1* | *-qnx6.2*)
223 SECTION_FLAGS='-ffunction-sections -fdata-sections'
224 AC_SUBST(SECTION_FLAGS)
225 GLIBCXX_CHECK_LINKER_FEATURES
228 AC_DEFINE(HAVE_COSHF)
229 AC_DEFINE(HAVE_COSHL)
232 AC_DEFINE(HAVE_LOG10F)
233 AC_DEFINE(HAVE_LOG10L)
236 AC_DEFINE(HAVE_SINHF)
237 AC_DEFINE(HAVE_SINHL)
240 SECTION_FLAGS='-ffunction-sections -fdata-sections'
241 SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS'
242 AC_SUBST(SECTION_FLAGS)
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)
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
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)
273 AC_DEFINE(HAVE_COSHF)
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)
283 AC_DEFINE(HAVE_SINHF)
284 AC_DEFINE(HAVE_SQRTF)
286 AC_DEFINE(HAVE_TANHF)
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
295 frexpl ldexpl log10l logl modfl powl sinl sinhl sqrtl tanl tanhl hypotl
296 ldexpf modff hypotf frexpf])
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.
303 AC_MSG_ERROR([No support for this host/target combination.])
310 dnl Check to see if the (math function) argument passed is
311 dnl declared when using the c compiler
313 dnl Define HAVE_CARGF etc if "cargf" is declared
315 dnl argument 1 is name of function to check
317 dnl ASSUMES argument is a math function
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], [
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]))
341 dnl Check to see whether multiple math functions are
342 dnl declared when using the c compiler
344 dnl Define HAVE_CARGF HAVE_POWL etc if "cargf" and "powl"
347 dnl argument 1 is a word list naming function to check
349 dnl ASSUMES arguments are math functions
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)