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.
69 # Darwin versions vary, but the linker should work in a cross environment,
70 # so we just check for all the features here.
71 # Check for available headers.
73 # Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
74 GLIBCXX_CHECK_MATH_SUPPORT
75 GLIBCXX_CHECK_STDLIB_SUPPORT
79 # GLIBCXX_CHECK_MATH_SUPPORT
82 AC_DEFINE(HAVE_FINITE)
83 AC_DEFINE(HAVE_SINCOS)
88 SECTION_FLAGS='-ffunction-sections -fdata-sections'
89 AC_SUBST(SECTION_FLAGS)
90 GLIBCXX_CHECK_LINKER_FEATURES
91 AC_DEFINE(HAVE_SETENV)
92 AC_DEFINE(HAVE_FINITEF)
93 AC_DEFINE(HAVE_FINITE)
94 AC_DEFINE(HAVE_FREXPF)
96 AC_DEFINE(HAVE_HYPOTF)
99 AC_DEFINE(HAVE_ISNANF)
101 AC_DEFINE(HAVE_ACOSF)
102 AC_DEFINE(HAVE_ASINF)
103 AC_DEFINE(HAVE_ATAN2F)
104 AC_DEFINE(HAVE_ATANF)
105 AC_DEFINE(HAVE_CEILF)
107 AC_DEFINE(HAVE_COSHF)
109 AC_DEFINE(HAVE_FABSF)
110 AC_DEFINE(HAVE_FLOORF)
111 AC_DEFINE(HAVE_FMODF)
112 AC_DEFINE(HAVE_FREXPF)
113 AC_DEFINE(HAVE_LDEXPF)
114 AC_DEFINE(HAVE_LOG10F)
116 AC_DEFINE(HAVE_MODFF)
119 AC_DEFINE(HAVE_SINHF)
120 AC_DEFINE(HAVE_SQRTF)
122 AC_DEFINE(HAVE_TANHF)
123 if test x"long_double_math_on_this_cpu" = x"yes"; then
124 AC_DEFINE(HAVE_FINITEL)
125 AC_DEFINE(HAVE_ISINFL)
126 AC_DEFINE(HAVE_ISNANL)
128 AC_CHECK_FUNCS(__cxa_thread_atexit)
129 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
130 AC_CHECK_FUNCS(timespec_get)
131 AC_CHECK_FUNCS(sockatmark)
135 SECTION_FLAGS='-ffunction-sections -fdata-sections'
136 AC_SUBST(SECTION_FLAGS)
140 SECTION_FLAGS='-ffunction-sections -fdata-sections'
141 AC_SUBST(SECTION_FLAGS)
142 GLIBCXX_CHECK_LINKER_FEATURES
144 # GLIBCXX_CHECK_MATH_SUPPORT
145 AC_DEFINE(HAVE_ISNAN)
146 AC_DEFINE(HAVE_HYPOT)
147 AC_DEFINE(HAVE_ACOSF)
148 AC_DEFINE(HAVE_ASINF)
149 AC_DEFINE(HAVE_ATANF)
151 AC_DEFINE(HAVE_COSHF)
153 AC_DEFINE(HAVE_SINHF)
155 AC_DEFINE(HAVE_TANHF)
157 AC_DEFINE(HAVE_ATAN2F)
158 AC_DEFINE(HAVE_FABSF)
159 AC_DEFINE(HAVE_FMODF)
160 AC_DEFINE(HAVE_FREXPF)
162 AC_DEFINE(HAVE_LOG10F)
165 AC_DEFINE(HAVE_SQRTF)
167 # GLIBCXX_CHECK_STDLIB_SUPPORT
168 AC_DEFINE(HAVE_STRTOLD)
173 AC_DEFINE(HAVE_ISINF)
174 AC_DEFINE(HAVE_ISINFF)
175 AC_DEFINE(HAVE_ISNANF)
176 AC_DEFINE(HAVE_FINITE)
177 AC_DEFINE(HAVE_FINITEF)
181 *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-cygwin* | *-solaris*)
182 GLIBCXX_CHECK_COMPILER_FEATURES
183 GLIBCXX_CHECK_LINKER_FEATURES
184 GLIBCXX_CHECK_MATH_SUPPORT
185 GLIBCXX_CHECK_STDLIB_SUPPORT
186 AC_DEFINE(_GLIBCXX_USE_DEV_RANDOM)
187 AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1)
189 AC_CHECK_FUNCS(__cxa_thread_atexit_impl)
190 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
191 AC_CHECK_FUNCS(timespec_get)
192 AC_CHECK_FUNCS(sockatmark)
196 GLIBCXX_CHECK_LINKER_FEATURES
197 GLIBCXX_CHECK_MATH_SUPPORT
198 GLIBCXX_CHECK_STDLIB_SUPPORT
199 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
200 AC_CHECK_FUNCS(_wfopen)
202 *-netbsd* | *-openbsd*)
203 SECTION_FLAGS='-ffunction-sections -fdata-sections'
204 AC_SUBST(SECTION_FLAGS)
205 GLIBCXX_CHECK_LINKER_FEATURES
206 AC_DEFINE(HAVE_FINITEF)
207 AC_DEFINE(HAVE_FINITE)
208 AC_DEFINE(HAVE_FREXPF)
209 AC_DEFINE(HAVE_HYPOTF)
210 AC_DEFINE(HAVE_ISINF)
211 AC_DEFINE(HAVE_ISINFF)
212 AC_DEFINE(HAVE_ISNAN)
213 AC_DEFINE(HAVE_ISNANF)
214 if test x"long_double_math_on_this_cpu" = x"yes"; then
215 AC_DEFINE(HAVE_FINITEL)
216 AC_DEFINE(HAVE_ISINFL)
217 AC_DEFINE(HAVE_ISNANL)
219 AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
220 AC_CHECK_FUNCS(timespec_get)
221 AC_CHECK_FUNCS(sockatmark)
223 *-qnx6.1* | *-qnx6.2*)
224 SECTION_FLAGS='-ffunction-sections -fdata-sections'
225 AC_SUBST(SECTION_FLAGS)
226 GLIBCXX_CHECK_LINKER_FEATURES
229 AC_DEFINE(HAVE_COSHF)
230 AC_DEFINE(HAVE_COSHL)
233 AC_DEFINE(HAVE_LOG10F)
234 AC_DEFINE(HAVE_LOG10L)
237 AC_DEFINE(HAVE_SINHF)
238 AC_DEFINE(HAVE_SINHL)
241 GLIBCXX_CHECK_COMPILER_FEATURES
242 GLIBCXX_CHECK_LINKER_FEATURES
243 GLIBCXX_CHECK_MATH_SUPPORT
244 GLIBCXX_CHECK_STDLIB_SUPPORT
247 SECTION_FLAGS='-ffunction-sections -fdata-sections'
248 SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS'
249 AC_SUBST(SECTION_FLAGS)
250 AC_DEFINE(HAVE_FINITE)
251 AC_DEFINE(HAVE_FINITEF)
252 AC_DEFINE(HAVE_FREXPF)
253 AC_DEFINE(HAVE_HYPOTF)
254 AC_DEFINE(HAVE_ISINF)
255 AC_DEFINE(HAVE_ISINFF)
256 AC_DEFINE(HAVE_ISNAN)
257 AC_DEFINE(HAVE_ISNANF)
258 AC_DEFINE(HAVE_SINCOS)
259 AC_DEFINE(HAVE_SINCOSF)
260 if test x"long_double_math_on_this_cpu" = x"yes"; then
261 AC_DEFINE(HAVE_FINITEL)
262 AC_DEFINE(HAVE_HYPOTL)
263 AC_DEFINE(HAVE_ISINFL)
264 AC_DEFINE(HAVE_ISNANL)
268 # Check for available headers.
269 # Don't call GLIBCXX_CHECK_LINKER_FEATURES, VMS doesn't have a GNU ld
270 GLIBCXX_CHECK_MATH_SUPPORT
271 GLIBCXX_CHECK_STDLIB_SUPPORT
274 AC_DEFINE(HAVE_ACOSF)
275 AC_DEFINE(HAVE_ASINF)
276 AC_DEFINE(HAVE_ATAN2F)
277 AC_DEFINE(HAVE_ATANF)
278 AC_DEFINE(HAVE_CEILF)
280 AC_DEFINE(HAVE_COSHF)
282 AC_DEFINE(HAVE_FABSF)
283 AC_DEFINE(HAVE_FLOORF)
284 AC_DEFINE(HAVE_FMODF)
285 AC_DEFINE(HAVE_HYPOT)
286 AC_DEFINE(HAVE_LOG10F)
290 AC_DEFINE(HAVE_SINHF)
291 AC_DEFINE(HAVE_SQRTF)
293 AC_DEFINE(HAVE_TANHF)
295 dnl # Different versions and execution modes implement different
296 dnl # subsets of these functions. Instead of hard-coding, test for C
297 dnl # declarations in headers. The C primitives could be defined as
298 dnl # macros, in which case the tests might fail, and we might have to
299 dnl # switch to more elaborate tests.
300 GLIBCXX_CHECK_MATH_DECLS([
301 acosl asinl atan2l atanl ceill cosl coshl expl fabsl floorl fmodl
302 frexpl ldexpl log10l logl modfl powl sinl sinhl sqrtl tanl tanhl])
303 dnl # sincosl is the only one missing here, compared with the *l
304 dnl # functions in the list guarded by
305 dnl # long_double_math_on_this_cpu in configure.ac, right after
306 dnl # the expansion of the present macro.
309 AC_MSG_ERROR([No support for this host/target combination.])
316 dnl Check to see if the (math function) argument passed is
317 dnl declared when using the c compiler
319 dnl Define HAVE_CARGF etc if "cargf" is declared
321 dnl argument 1 is name of function to check
323 dnl ASSUMES argument is a math function
325 dnl GLIBCXX_CHECK_MATH_DECL
326 AC_DEFUN([GLIBCXX_CHECK_MATH_DECL], [
327 AC_CACHE_CHECK([for $1 declaration],
328 [glibcxx_cv_func_$1_use], [
337 void (*f)(void) = (void (*)(void))$1;
338 ], [glibcxx_cv_func_$1_use=yes
339 ], [glibcxx_cv_func_$1_use=no])])
340 if test "x$glibcxx_cv_func_$1_use" = xyes; then
341 AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]))
346 dnl Check to see whether multiple math functions are
347 dnl declared when using the c compiler
349 dnl Define HAVE_CARGF HAVE_POWL etc if "cargf" and "powl"
352 dnl argument 1 is a word list naming function to check
354 dnl ASSUMES arguments are math functions
356 dnl GLIBCXX_CHECK_MATH_DECLS
357 AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS], [
358 m4_foreach_w([glibcxx_func], [$1], [
359 GLIBCXX_CHECK_MATH_DECL(glibcxx_func)