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)
208 *-netbsd* | *-openbsd*)
209 SECTION_FLAGS='-ffunction-sections -fdata-sections'
210 AC_SUBST(SECTION_FLAGS)
211 GLIBCXX_CHECK_LINKER_FEATURES
212 AC_DEFINE(HAVE_FINITEF)
213 AC_DEFINE(HAVE_FINITE)
214 AC_DEFINE(HAVE_FREXPF)
215 AC_DEFINE(HAVE_HYPOTF)
216 AC_DEFINE(HAVE_ISINF)
217 AC_DEFINE(HAVE_ISINFF)
218 AC_DEFINE(HAVE_ISNAN)
219 AC_DEFINE(HAVE_ISNANF)
220 if test x"long_double_math_on_this_cpu" = x"yes"; then
221 AC_DEFINE(HAVE_FINITEL)
222 AC_DEFINE(HAVE_ISINFL)
223 AC_DEFINE(HAVE_ISNANL)
225 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
226 AC_CHECK_FUNCS(timespec_get)
227 AC_CHECK_FUNCS(sockatmark)
229 *-qnx6.1* | *-qnx6.2*)
230 SECTION_FLAGS='-ffunction-sections -fdata-sections'
231 AC_SUBST(SECTION_FLAGS)
232 GLIBCXX_CHECK_LINKER_FEATURES
235 AC_DEFINE(HAVE_COSHF)
236 AC_DEFINE(HAVE_COSHL)
239 AC_DEFINE(HAVE_LOG10F)
240 AC_DEFINE(HAVE_LOG10L)
243 AC_DEFINE(HAVE_SINHF)
244 AC_DEFINE(HAVE_SINHL)
247 GLIBCXX_CHECK_COMPILER_FEATURES
248 GLIBCXX_CHECK_LINKER_FEATURES
249 GLIBCXX_CHECK_MATH_SUPPORT
250 GLIBCXX_CHECK_STDLIB_SUPPORT
253 SECTION_FLAGS='-ffunction-sections -fdata-sections'
254 SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS'
255 AC_SUBST(SECTION_FLAGS)
256 AC_DEFINE(HAVE_FINITE)
257 AC_DEFINE(HAVE_FINITEF)
258 AC_DEFINE(HAVE_FREXPF)
259 AC_DEFINE(HAVE_HYPOTF)
260 AC_DEFINE(HAVE_ISINF)
261 AC_DEFINE(HAVE_ISINFF)
262 AC_DEFINE(HAVE_ISNAN)
263 AC_DEFINE(HAVE_ISNANF)
264 AC_DEFINE(HAVE_SINCOS)
265 AC_DEFINE(HAVE_SINCOSF)
266 if test x"long_double_math_on_this_cpu" = x"yes"; then
267 AC_DEFINE(HAVE_FINITEL)
268 AC_DEFINE(HAVE_HYPOTL)
269 AC_DEFINE(HAVE_ISINFL)
270 AC_DEFINE(HAVE_ISNANL)
274 # Check for available headers.
275 # Don't call GLIBCXX_CHECK_LINKER_FEATURES, VMS doesn't have a GNU ld
276 GLIBCXX_CHECK_MATH_SUPPORT
277 GLIBCXX_CHECK_STDLIB_SUPPORT
280 AC_DEFINE(HAVE_ACOSF)
281 AC_DEFINE(HAVE_ASINF)
282 AC_DEFINE(HAVE_ATAN2F)
283 AC_DEFINE(HAVE_ATANF)
284 AC_DEFINE(HAVE_CEILF)
286 AC_DEFINE(HAVE_COSHF)
288 AC_DEFINE(HAVE_FABSF)
289 AC_DEFINE(HAVE_FLOORF)
290 AC_DEFINE(HAVE_FMODF)
291 AC_DEFINE(HAVE_HYPOT)
292 AC_DEFINE(HAVE_LOG10F)
296 AC_DEFINE(HAVE_SINHF)
297 AC_DEFINE(HAVE_SQRTF)
299 AC_DEFINE(HAVE_TANHF)
301 dnl # Different versions and execution modes implement different
302 dnl # subsets of these functions. Instead of hard-coding, test for C
303 dnl # declarations in headers. The C primitives could be defined as
304 dnl # macros, in which case the tests might fail, and we might have to
305 dnl # switch to more elaborate tests.
306 GLIBCXX_CHECK_MATH_DECLS([
307 acosl asinl atan2l atanl ceill cosl coshl expl fabsl floorl fmodl
308 frexpl ldexpl log10l logl modfl powl sinl sinhl sqrtl tanl tanhl hypotl
309 ldexpf modff hypotf frexpf])
310 dnl # sincosl is the only one missing here, compared with the *l
311 dnl # functions in the list guarded by
312 dnl # long_double_math_on_this_cpu in configure.ac, right after
313 dnl # the expansion of the present macro.
316 AC_MSG_ERROR([No support for this host/target combination.])
323 dnl Check to see if the (math function) argument passed is
324 dnl declared when using the c compiler
326 dnl Define HAVE_CARGF etc if "cargf" is declared
328 dnl argument 1 is name of function to check
330 dnl ASSUMES argument is a math function
332 dnl GLIBCXX_CHECK_MATH_DECL
333 AC_DEFUN([GLIBCXX_CHECK_MATH_DECL], [
334 AC_CACHE_CHECK([for $1 declaration],
335 [glibcxx_cv_func_$1_use], [
345 void (*f)(void) = (void (*)(void))$1;
346 ], [glibcxx_cv_func_$1_use=yes
347 ], [glibcxx_cv_func_$1_use=no])])
348 if test "x$glibcxx_cv_func_$1_use" = xyes; then
349 AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]))
354 dnl Check to see whether multiple math functions are
355 dnl declared when using the c compiler
357 dnl Define HAVE_CARGF HAVE_POWL etc if "cargf" and "powl"
360 dnl argument 1 is a word list naming function to check
362 dnl ASSUMES arguments are math functions
364 dnl GLIBCXX_CHECK_MATH_DECLS
365 AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS], [
366 m4_foreach_w([glibcxx_func], [$1], [
367 GLIBCXX_CHECK_MATH_DECL(glibcxx_func)