]>
Commit | Line | Data |
---|---|---|
b2dad0e3 BK |
1 | dnl aclocal.m4 generated automatically by aclocal 1.4 |
2 | ||
3 | dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. | |
4 | dnl This file is free software; the Free Software Foundation | |
5 | dnl gives unlimited permission to copy and/or distribute it, | |
6 | dnl with or without modifications, as long as this notice is preserved. | |
7 | ||
8 | dnl This program is distributed in the hope that it will be useful, | |
9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
11 | dnl PARTICULAR PURPOSE. | |
12 | ||
13 | dnl | |
14 | dnl Initialize configure bits. | |
15 | dnl | |
16 | dnl Define OPTLEVEL='-O2' if new inlining code present. | |
17 | dnl | |
18 | dnl GLIBCPP_CONFIGURE | |
19 | AC_DEFUN(GLIBCPP_CONFIGURE, [ | |
20 | dnl Default to --enable-multilib | |
21 | AC_ARG_ENABLE(multilib, | |
22 | [ --enable-multilib build hella library versions (default)], | |
23 | [case "${enableval}" in | |
24 | yes) multilib=yes ;; | |
25 | no) multilib=no ;; | |
26 | *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; | |
27 | esac], [multilib=yes])dnl | |
28 | ||
29 | dnl We may get other options which we dont document: | |
30 | dnl --with-target-subdir, --with-multisrctop, --with-multisubdir | |
31 | if test "[$]{srcdir}" = "."; then | |
32 | if test "[$]{with_target_subdir}" != "."; then | |
33 | glibcpp_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" | |
34 | else | |
35 | glibcpp_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" | |
36 | fi | |
37 | else | |
38 | glibcpp_basedir="[$]{srcdir}/$1" | |
39 | fi | |
40 | AC_SUBST(glibcpp_basedir) | |
41 | ||
42 | AC_CANONICAL_HOST | |
43 | ||
44 | AM_INIT_AUTOMAKE(libstdc++, 2.90.8) | |
45 | ||
46 | # FIXME: We temporarily define our own version of AC_PROG_CC. This is | |
47 | # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We | |
48 | # are probably using a cross compiler, which will not be able to fully | |
49 | # link an executable. This should really be fixed in autoconf | |
50 | # itself. | |
51 | ||
52 | AC_DEFUN(LIB_AC_PROG_CC, | |
53 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl | |
54 | dnl Fool anybody using AC_PROG_CC. | |
55 | AC_PROVIDE([AC_PROG_CC]) | |
56 | AC_CHECK_PROG(CC, gcc, gcc) | |
57 | if test -z "$CC"; then | |
58 | AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) | |
59 | test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) | |
60 | fi | |
61 | ||
62 | AC_PROG_CC_GNU | |
63 | ||
64 | if test $ac_cv_prog_gcc = yes; then | |
65 | GCC=yes | |
66 | dnl Check whether -g works, even if CFLAGS is set, in case the package | |
67 | dnl plays around with CFLAGS (such as to build both debugging and | |
68 | dnl normal versions of a library), tasteless as that idea is. | |
69 | ac_test_CFLAGS="${CFLAGS+set}" | |
70 | ac_save_CFLAGS="$CFLAGS" | |
71 | CFLAGS= | |
72 | AC_PROG_CC_G | |
73 | if test "$ac_test_CFLAGS" = set; then | |
74 | CFLAGS="$ac_save_CFLAGS" | |
75 | elif test $ac_cv_prog_cc_g = yes; then | |
76 | CFLAGS="-g -O2" | |
77 | else | |
78 | CFLAGS="-O2" | |
79 | fi | |
80 | else | |
81 | GCC= | |
82 | test "${CFLAGS+set}" = set || CFLAGS="-g" | |
83 | fi | |
84 | ]) | |
85 | ||
86 | LIB_AC_PROG_CC | |
87 | ||
88 | # Likewise for AC_PROG_CXX. | |
89 | AC_DEFUN(LIB_AC_PROG_CXX, | |
90 | [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl | |
91 | dnl Fool anybody using AC_PROG_CXX. | |
92 | AC_PROVIDE([AC_PROG_CXX]) | |
93 | AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) | |
94 | test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) | |
95 | ||
96 | AC_PROG_CXX_GNU | |
97 | ||
98 | if test $ac_cv_prog_gxx = yes; then | |
99 | GXX=yes | |
100 | dnl Check whether -g works, even if CXXFLAGS is set, in case the package | |
101 | dnl plays around with CXXFLAGS (such as to build both debugging and | |
102 | dnl normal versions of a library), tasteless as that idea is. | |
103 | ac_test_CXXFLAGS="${CXXFLAGS+set}" | |
104 | ac_save_CXXFLAGS="$CXXFLAGS" | |
105 | CXXFLAGS= | |
106 | AC_PROG_CXX_G | |
107 | if test "$ac_test_CXXFLAGS" = set; then | |
108 | CXXFLAGS="$ac_save_CXXFLAGS" | |
109 | elif test $ac_cv_prog_cxx_g = yes; then | |
110 | CXXFLAGS="-g -O2" | |
111 | else | |
112 | CXXFLAGS="-O2" | |
113 | fi | |
114 | else | |
115 | GXX= | |
116 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" | |
117 | fi | |
118 | ]) | |
119 | ||
120 | LIB_AC_PROG_CXX | |
121 | ||
122 | # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we dont | |
123 | # run it explicitly here, it will be run implicitly before | |
124 | # LIBGCJ_CONFIGURE, which doesn't work because that means that it will | |
125 | # be run before AC_CANONICAL_HOST. | |
126 | AC_CANONICAL_BUILD | |
127 | ||
128 | AC_CHECK_TOOL(AS, as) | |
129 | AC_CHECK_TOOL(AR, ar) | |
130 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
131 | ||
132 | AC_PROG_INSTALL | |
133 | ||
134 | AM_MAINTAINER_MODE | |
135 | ||
136 | # We need AC_EXEEXT to keep automake happy in cygnus mode. However, | |
137 | # at least currently, we never actually build a program, so we never | |
138 | # need to use $(EXEEXT). Moreover, the test for EXEEXT normally | |
139 | # fails, because we are probably configuring with a cross compiler | |
140 | # which cant create executables. So we include AC_EXEEXT to keep | |
141 | # automake happy, but we dont execute it, since we dont care about | |
142 | # the result. | |
143 | if false; then | |
144 | AC_EXEEXT | |
145 | fi | |
146 | ||
147 | # configure.host sets the following important variables | |
148 | # glibcpp_cflags - host specific C compiler flags | |
149 | # glibcpp_cxxflags - host specific C++ compiler flags | |
150 | ||
151 | glibcpp_cflags= | |
152 | glibcpp_cxxflags= | |
153 | ||
154 | . [$]{glibcpp_basedir}/configure.host | |
155 | ||
156 | case [$]{glibcpp_basedir} in | |
157 | /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;; | |
158 | *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;; | |
159 | esac | |
160 | ||
161 | GLIBCPP_CFLAGS="[$]{glibcpp_cflags}" | |
162 | GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}" | |
163 | AC_SUBST(GLIBCPP_CFLAGS) | |
164 | AC_SUBST(GLIBCPP_CXXFLAGS) | |
165 | ]) | |
166 | ||
167 | ||
168 | dnl | |
8bd636c5 | 169 | dnl Check to see if g++ can compile this library, and if so, if any version- |
c470c17d BK |
170 | dnl specific precautions need to be taken. |
171 | dnl | |
172 | dnl GLIBCPP_CHECK_COMPILER_VERSION | |
173 | AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [ | |
174 | ||
175 | # Sanity check that g++ is capable of dealing with v-3. | |
176 | AC_MSG_CHECKING([for g++ that will successfully compile this code]) | |
177 | AC_EGREP_CPP([ok], [ | |
178 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) | |
179 | ok | |
180 | #endif | |
181 | ], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above")) | |
182 | AC_MSG_RESULT($gpp_satisfactory) | |
183 | ]) | |
184 | ||
185 | ||
186 | dnl | |
187 | dnl Test for newer compiler features, or features that are present in newer | |
d3a12960 BK |
188 | dnl compiler version but not older compiler versions should be placed |
189 | dnl here. | |
b2dad0e3 | 190 | dnl |
c470c17d BK |
191 | dnl Define WFMT_FLAGS='-fdiagnostics-show-location=once' if possible |
192 | dnl | |
8bd636c5 | 193 | dnl Define WERROR='-Werror' if possible; g++'s that lack the new inlining |
c470c17d | 194 | dnl code or the new system_header pragma will die. |
b2dad0e3 | 195 | dnl |
c470c17d BK |
196 | dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if |
197 | dnl compiler supports it. | |
198 | dnl GLIBCPP_CHECK_COMPILER_FEATURES | |
199 | AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [ | |
a4e99046 PE |
200 | # All these tests are for C++; save the language and the compiler flags. |
201 | # The CXXFLAGS thing is suspicious, but based on similar bits | |
202 | # found in GLIBCPP_CONFIGURE. | |
203 | AC_LANG_SAVE | |
204 | AC_LANG_CPLUSPLUS | |
205 | ac_test_CXXFLAGS="${CXXFLAGS+set}" | |
206 | ac_save_CXXFLAGS="$CXXFLAGS" | |
207 | WERROR='-Werror' | |
208 | ||
d3a12960 BK |
209 | # Check for pragma system_header. |
210 | AC_MSG_CHECKING([for g++ that supports pragma system_header]) | |
8bd636c5 PE |
211 | CXXFLAGS='-Wunknown-pragmas -Werror' |
212 | AC_TRY_COMPILE([#pragma system_header], [int foo; | |
11a6e9a7 | 213 | ], [ac_newpragma=yes], [ac_newpragma=no]) |
8bd636c5 PE |
214 | if test "$ac_test_CXXFLAGS" = set; then |
215 | CXXFLAGS="$ac_save_CXXFLAGS" | |
216 | else | |
217 | # this is the suspicious part | |
218 | CXXFLAGS='' | |
219 | fi | |
11a6e9a7 PE |
220 | if test "$ac_newpragma" = "no"; then |
221 | WERROR="$WERROR -Wno-unknown-pragmas" | |
8bd636c5 | 222 | fi |
11a6e9a7 | 223 | AC_MSG_RESULT($ac_newpragma) |
8bd636c5 | 224 | |
d3a12960 BK |
225 | # Check for more sophisticated diagnostic control. |
226 | AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once]) | |
a4e99046 PE |
227 | CXXFLAGS='-fdiagnostics-show-location=once' |
228 | AC_TRY_COMPILE(, [int foo; | |
229 | ], [ac_gabydiags=yes], [ac_gabydiags=no]) | |
230 | if test "$ac_test_CXXFLAGS" = set; then | |
231 | CXXFLAGS="$ac_save_CXXFLAGS" | |
232 | else | |
233 | # this is the suspicious part | |
234 | CXXFLAGS='' | |
235 | fi | |
236 | if test "$ac_gabydiags" = "yes"; then | |
c470c17d | 237 | WFMT_FLAGS='-fdiagnostics-show-location=once' |
a4e99046 PE |
238 | fi |
239 | AC_MSG_RESULT($ac_gabydiags) | |
240 | ||
c470c17d BK |
241 | # Check for -ffunction-sections -fdata-sections |
242 | AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections]) | |
243 | CXXFLAGS='-ffunction-sections -fdata-sections' | |
244 | AC_TRY_COMPILE(, [int foo; | |
245 | ], [ac_fdsections=yes], [ac_fdsections=no]) | |
246 | if test "$ac_test_CXXFLAGS" = set; then | |
247 | CXXFLAGS="$ac_save_CXXFLAGS" | |
248 | else | |
249 | # this is the suspicious part | |
250 | CXXFLAGS='' | |
251 | fi | |
252 | if test "$ac_fdsections" = "yes"; then | |
253 | SECTION_FLAGS='-ffunction-sections -fdata-sections' | |
254 | fi | |
255 | AC_MSG_RESULT($ac_fdsections) | |
256 | ||
a4e99046 | 257 | AC_LANG_RESTORE |
8bd636c5 | 258 | AC_SUBST(WERROR) |
c470c17d BK |
259 | AC_SUBST(WFMT_FLAGS) |
260 | AC_SUBST(SECTION_FLAGS) | |
b2dad0e3 BK |
261 | ]) |
262 | ||
c470c17d BK |
263 | |
264 | dnl | |
265 | dnl Check to see if tricky linker opts can be used. | |
266 | dnl | |
267 | dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible | |
268 | dnl GLIBCPP_CHECK_LINKER_FEATURES | |
269 | AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [ | |
270 | # All these tests are for C++; save the language and the compiler flags. | |
271 | # The CXXFLAGS thing is suspicious, but based on similar bits | |
272 | # found in GLIBCPP_CONFIGURE. | |
273 | AC_LANG_SAVE | |
274 | AC_LANG_CPLUSPLUS | |
275 | ||
276 | # Check for -Wl,--gc-sections | |
277 | AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections]) | |
278 | CXXFLAGS='-Wl,--gc-sections' | |
279 | AC_TRY_COMPILE(, [int foo; | |
280 | ], [ac_sectionLDflags=yes], [ac_sectionLFflags=no]) | |
281 | if test "$ac_test_CXXFLAGS" = set; then | |
282 | CXXFLAGS="$ac_save_CXXFLAGS" | |
283 | else | |
284 | # this is the suspicious part | |
285 | CXXFLAGS='' | |
286 | fi | |
287 | if test "$ac_sectionLDflags" = "yes"; then | |
288 | SECTION_LDFLAGS='-Wl,--gc-sections' | |
289 | fi | |
290 | AC_MSG_RESULT($ac_sectionLDflags) | |
291 | ||
292 | AC_LANG_RESTORE | |
293 | AC_SUBST(SECTION_LDFLAGS) | |
294 | ]) | |
295 | ||
296 | ||
b2dad0e3 BK |
297 | dnl |
298 | dnl Check to see what builtin math functions are supported | |
299 | dnl | |
54fa7415 SK |
300 | dnl check for __builtin_acos |
301 | dnl check for __builtin_acosf | |
302 | dnl check for __builtin_acosl | |
303 | dnl check for __builtin_asin | |
304 | dnl check for __builtin_asinf | |
305 | dnl check for __builtin_asinl | |
306 | dnl check for __builtin_atan | |
307 | dnl check for __builtin_atanf | |
308 | dnl check for __builtin_atanl | |
309 | dnl check for __builtin_atan2 | |
310 | dnl check for __builtin_atan2f | |
311 | dnl check for __builtin_atan2l | |
312 | dnl check for __builtin_ceil | |
313 | dnl check for __builtin_ceilf | |
314 | dnl check for __builtin_ceill | |
315 | dnl check for __builtin_cos | |
316 | dnl check for __builtin_cosf | |
317 | dnl check for __builtin_cosl | |
318 | dnl check for __builtin_cosh | |
319 | dnl check for __builtin_coshf | |
320 | dnl check for __builtin_coshl | |
321 | dnl check for __builtin_exp | |
322 | dnl check for __builtin_expf | |
323 | dnl check for __builtin_expl | |
324 | dnl check for __builtin_fabs | |
325 | dnl check for __builtin_fabsf | |
326 | dnl check for __builtin_fabsl | |
327 | dnl check for __builtin_floor | |
328 | dnl check for __builtin_floorf | |
329 | dnl check for __builtin_floorl | |
5ae55a2e BK |
330 | dnl check for __builtin_fmod |
331 | dnl check for __builtin_fmodf | |
332 | dnl check for __builtin_fmodl | |
54fa7415 SK |
333 | dnl check for __builtin_frexp |
334 | dnl check for __builtin_frexpf | |
335 | dnl check for __builtin_frexpl | |
336 | dnl check for __builtin_ldexp | |
337 | dnl check for __builtin_ldexpf | |
338 | dnl check for __builtin_ldexpl | |
339 | dnl check for __builtin_log | |
340 | dnl check for __builtin_logf | |
341 | dnl check for __builtin_logl | |
342 | dnl check for __builtin_log10 | |
343 | dnl check for __builtin_log10f | |
344 | dnl check for __builtin_log10l | |
345 | dnl check for __builtin_modf | |
346 | dnl check for __builtin_modff | |
347 | dnl check for __builtin_modfl | |
348 | dnl check for __builtin_pow | |
349 | dnl check for __builtin_powf | |
350 | dnl check for __builtin_powl | |
351 | dnl check for __builtin_sin | |
352 | dnl check for __builtin_sinf | |
353 | dnl check for __builtin_sinl | |
354 | dnl check for __builtin_sinh | |
355 | dnl check for __builtin_sinhf | |
356 | dnl check for __builtin_sinhl | |
357 | dnl check for __builtin_sqrt | |
358 | dnl check for __builtin_sqrtf | |
359 | dnl check for __builtin_sqrtl | |
360 | dnl check for __builtin_tan | |
361 | dnl check for __builtin_tanf | |
362 | dnl check for __builtin_tanl | |
363 | dnl check for __builtin_tanh | |
364 | dnl check for __builtin_tanhf | |
365 | dnl check for __builtin_tanhl | |
b2dad0e3 BK |
366 | dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT |
367 | AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [ | |
368 | dnl Test for builtin math functions. | |
54fa7415 SK |
369 | AC_LANG_SAVE |
370 | AC_LANG_CPLUSPLUS | |
371 | AC_MSG_CHECKING([for __builtin_acos]) | |
b2dad0e3 | 372 | AC_TRY_COMPILE([#include <math.h>], |
54fa7415 SK |
373 | [ __builtin_acos(0.0);], |
374 | use_builtin_acos=yes, use_builtin_acos=no) | |
375 | AC_MSG_RESULT($use_builtin_acos) | |
376 | if test $use_builtin_acos = "yes"; then | |
377 | AC_DEFINE(HAVE_BUILTIN_ACOS) | |
378 | fi | |
379 | AC_MSG_CHECKING([for __builtin_acosf]) | |
380 | AC_TRY_COMPILE([#include <math.h>], | |
381 | [ __builtin_acosf(0.0);], | |
382 | use_builtin_acosf=yes, use_builtin_acosf=no) | |
383 | AC_MSG_RESULT($use_builtin_acosf) | |
384 | if test $use_builtin_acosf = "yes"; then | |
385 | AC_DEFINE(HAVE_BUILTIN_ACOSF) | |
386 | fi | |
387 | AC_MSG_CHECKING([for __builtin_acosl]) | |
388 | AC_TRY_COMPILE([#include <math.h>], | |
389 | [ __builtin_acosl(0.0);], | |
390 | use_builtin_acosl=yes, use_builtin_acosl=no) | |
391 | AC_MSG_RESULT($use_builtin_acosl) | |
392 | if test $use_builtin_acosl = "yes"; then | |
393 | AC_DEFINE(HAVE_BUILTIN_ACOSL) | |
394 | fi | |
395 | AC_MSG_CHECKING([for __builtin_asin]) | |
396 | AC_TRY_COMPILE([#include <math.h>], | |
397 | [ __builtin_asin(0.0);], | |
398 | use_builtin_asin=yes, use_builtin_asin=no) | |
399 | AC_MSG_RESULT($use_builtin_asin) | |
400 | if test $use_builtin_asin = "yes"; then | |
401 | AC_DEFINE(HAVE_BUILTIN_ASIN) | |
402 | fi | |
403 | AC_MSG_CHECKING([for __builtin_asinf]) | |
404 | AC_TRY_COMPILE([#include <math.h>], | |
405 | [ __builtin_asinf(0.0);], | |
406 | use_builtin_asinf=yes, use_builtin_asinf=no) | |
407 | AC_MSG_RESULT($use_builtin_asinf) | |
408 | if test $use_builtin_asinf = "yes"; then | |
409 | AC_DEFINE(HAVE_BUILTIN_ASINF) | |
410 | fi | |
411 | AC_MSG_CHECKING([for __builtin_asinl]) | |
412 | AC_TRY_COMPILE([#include <math.h>], | |
413 | [ __builtin_asinl(0.0);], | |
414 | use_builtin_asinl=yes, use_builtin_asinl=no) | |
415 | AC_MSG_RESULT($use_builtin_asinl) | |
416 | if test $use_builtin_asinl = "yes"; then | |
417 | AC_DEFINE(HAVE_BUILTIN_ASINL) | |
418 | fi | |
419 | AC_MSG_CHECKING([for __builtin_atan]) | |
420 | AC_TRY_COMPILE([#include <math.h>], | |
421 | [ __builtin_atan(0.0);], | |
422 | use_builtin_atan=yes, use_builtin_atan=no) | |
423 | AC_MSG_RESULT($use_builtin_atan) | |
424 | if test $use_builtin_atan = "yes"; then | |
425 | AC_DEFINE(HAVE_BUILTIN_ATAN) | |
426 | fi | |
427 | AC_MSG_CHECKING([for __builtin_atanf]) | |
428 | AC_TRY_COMPILE([#include <math.h>], | |
429 | [ __builtin_atanf(0.0);], | |
430 | use_builtin_atanf=yes, use_builtin_atanf=no) | |
431 | AC_MSG_RESULT($use_builtin_atanf) | |
432 | if test $use_builtin_atanf = "yes"; then | |
433 | AC_DEFINE(HAVE_BUILTIN_ATANF) | |
434 | fi | |
435 | AC_MSG_CHECKING([for __builtin_atanl]) | |
436 | AC_TRY_COMPILE([#include <math.h>], | |
437 | [ __builtin_atanl(0.0);], | |
438 | use_builtin_atanl=yes, use_builtin_atanl=no) | |
439 | AC_MSG_RESULT($use_builtin_atanl) | |
440 | if test $use_builtin_atanl = "yes"; then | |
441 | AC_DEFINE(HAVE_BUILTIN_ATANL) | |
442 | fi | |
443 | AC_MSG_CHECKING([for __builtin_atan2]) | |
444 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 445 | [ __builtin_atan2(0.0, 0.0);], |
54fa7415 SK |
446 | use_builtin_atan2=yes, use_builtin_atan2=no) |
447 | AC_MSG_RESULT($use_builtin_atan2) | |
448 | if test $use_builtin_atan2 = "yes"; then | |
449 | AC_DEFINE(HAVE_BUILTIN_ATAN2) | |
450 | fi | |
451 | AC_MSG_CHECKING([for __builtin_atan2f]) | |
452 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 453 | [ __builtin_atan2f(0.0, 0.0);], |
54fa7415 SK |
454 | use_builtin_atan2f=yes, use_builtin_atan2f=no) |
455 | AC_MSG_RESULT($use_builtin_atan2f) | |
456 | if test $use_builtin_atan2f = "yes"; then | |
457 | AC_DEFINE(HAVE_BUILTIN_ATAN2F) | |
458 | fi | |
459 | AC_MSG_CHECKING([for __builtin_atan2l]) | |
460 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 461 | [ __builtin_atan2l(0.0, 0.0);], |
54fa7415 SK |
462 | use_builtin_atan2l=yes, use_builtin_atan2l=no) |
463 | AC_MSG_RESULT($use_builtin_atan2l) | |
464 | if test $use_builtin_atan2l = "yes"; then | |
465 | AC_DEFINE(HAVE_BUILTIN_ATAN2L) | |
466 | fi | |
467 | AC_MSG_CHECKING([for __builtin_ceil]) | |
468 | AC_TRY_COMPILE([#include <math.h>], | |
469 | [ __builtin_fceil(0.0);], | |
470 | use_builtin_ceil=yes, use_builtin_ceil=no) | |
471 | AC_MSG_RESULT($use_builtin_ceil) | |
472 | if test $use_builtin_ceil = "yes"; then | |
473 | AC_DEFINE(HAVE_BUILTIN_CEIL) | |
474 | fi | |
475 | AC_MSG_CHECKING([for __builtin_ceilf]) | |
476 | AC_TRY_COMPILE([#include <math.h>], | |
477 | [ __builtin_ceilf(0.0);], | |
478 | use_builtin_ceilf=yes, use_builtin_ceilf=no) | |
479 | AC_MSG_RESULT($use_builtin_ceilf) | |
480 | if test $use_builtin_ceilf = "yes"; then | |
481 | AC_DEFINE(HAVE_BUILTIN_CEILF) | |
482 | fi | |
483 | AC_MSG_CHECKING([for __builtin_ceill]) | |
484 | AC_TRY_COMPILE([#include <math.h>], | |
485 | [ __builtin_ceill(0.0);], | |
486 | use_builtin_ceill=yes, use_builtin_ceill=no) | |
487 | AC_MSG_RESULT($use_builtin_ceill) | |
488 | if test $use_builtin_ceill = "yes"; then | |
489 | AC_DEFINE(HAVE_BUILTIN_CEILL) | |
490 | fi | |
491 | AC_MSG_CHECKING([for __builtin_cos]) | |
492 | AC_TRY_COMPILE([#include <math.h>], | |
493 | [ __builtin_cos(0.0);], | |
494 | use_builtin_cos=yes, use_builtin_cos=no) | |
495 | AC_MSG_RESULT($use_builtin_cos) | |
496 | if test $use_builtin_cos = "yes"; then | |
497 | AC_DEFINE(HAVE_BUILTIN_COS) | |
b2dad0e3 | 498 | fi |
b2dad0e3 BK |
499 | AC_MSG_CHECKING([for __builtin_cosf]) |
500 | AC_TRY_COMPILE([#include <math.h>], | |
54fa7415 | 501 | [ __builtin_cosf(0.0);], |
b2dad0e3 BK |
502 | use_builtin_cosf=yes, use_builtin_cosf=no) |
503 | AC_MSG_RESULT($use_builtin_cosf) | |
504 | if test $use_builtin_cosf = "yes"; then | |
54fa7415 SK |
505 | AC_DEFINE(HAVE_BUILTIN_COSF) |
506 | fi | |
507 | AC_MSG_CHECKING([for __builtin_cosl]) | |
508 | AC_TRY_COMPILE([#include <math.h>], | |
509 | [ __builtin_cosl(0.0);], | |
510 | use_builtin_cosl=yes, use_builtin_cosl=no) | |
511 | AC_MSG_RESULT($use_builtin_cosl) | |
512 | if test $use_builtin_cosl = "yes"; then | |
513 | AC_DEFINE(HAVE_BUILTIN_COSL) | |
514 | fi | |
515 | AC_MSG_CHECKING([for __builtin_cosh]) | |
516 | AC_TRY_COMPILE([#include <math.h>], | |
517 | [ __builtin_cosh(0.0);], | |
518 | use_builtin_cosh=yes, use_builtin_cosh=no) | |
519 | AC_MSG_RESULT($use_builtin_cosh) | |
520 | if test $use_builtin_cosh = "yes"; then | |
521 | AC_DEFINE(HAVE_BUILTIN_COSH) | |
522 | fi | |
523 | AC_MSG_CHECKING([for __builtin_coshf]) | |
524 | AC_TRY_COMPILE([#include <math.h>], | |
525 | [ __builtin_coshf(0.0);], | |
526 | use_builtin_coshf=yes, use_builtin_coshf=no) | |
527 | AC_MSG_RESULT($use_builtin_coshf) | |
528 | if test $use_builtin_coshf = "yes"; then | |
529 | AC_DEFINE(HAVE_BUILTIN_COSHF) | |
530 | fi | |
531 | AC_MSG_CHECKING([for __builtin_coshl]) | |
532 | AC_TRY_COMPILE([#include <math.h>], | |
533 | [ __builtin_coshl(0.0);], | |
534 | use_builtin_coshl=yes, use_builtin_coshl=no) | |
535 | AC_MSG_RESULT($use_builtin_coshl) | |
536 | if test $use_builtin_coshl = "yes"; then | |
537 | AC_DEFINE(HAVE_BUILTIN_COSHL) | |
538 | fi | |
539 | AC_MSG_CHECKING([for __builtin_exp]) | |
540 | AC_TRY_COMPILE([#include <math.h>], | |
541 | [ __builtin_exp(0.0);], | |
542 | use_builtin_exp=yes, use_builtin_exp=no) | |
543 | AC_MSG_RESULT($use_builtin_exp) | |
544 | if test $use_builtin_exp = "yes"; then | |
545 | AC_DEFINE(HAVE_BUILTIN_EXP) | |
546 | fi | |
547 | AC_MSG_CHECKING([for __builtin_expf]) | |
548 | AC_TRY_COMPILE([#include <math.h>], | |
549 | [ __builtin_expf(0.0);], | |
550 | use_builtin_expf=yes, use_builtin_expf=no) | |
551 | AC_MSG_RESULT($use_builtin_expf) | |
552 | if test $use_builtin_expf = "yes"; then | |
553 | AC_DEFINE(HAVE_BUILTIN_EXPF) | |
554 | fi | |
555 | AC_MSG_CHECKING([for __builtin_expl]) | |
556 | AC_TRY_COMPILE([#include <math.h>], | |
557 | [ __builtin_expl(0.0);], | |
558 | use_builtin_expl=yes, use_builtin_expl=no) | |
559 | AC_MSG_RESULT($use_builtin_expl) | |
560 | if test $use_builtin_expl = "yes"; then | |
561 | AC_DEFINE(HAVE_BUILTIN_EXPL) | |
562 | fi | |
563 | AC_MSG_CHECKING([for __builtin_fabs]) | |
564 | AC_TRY_COMPILE([#include <math.h>], | |
565 | [ __builtin_fabs(0.0);], | |
566 | use_builtin_fabs=yes, use_builtin_fabs=no) | |
567 | AC_MSG_RESULT($use_builtin_fabs) | |
568 | if test $use_builtin_fabs = "yes"; then | |
569 | AC_DEFINE(HAVE_BUILTIN_FABS) | |
b2dad0e3 | 570 | fi |
b2dad0e3 BK |
571 | AC_MSG_CHECKING([for __builtin_fabsf]) |
572 | AC_TRY_COMPILE([#include <math.h>], | |
54fa7415 | 573 | [ __builtin_fabsf(0.0);], |
b2dad0e3 BK |
574 | use_builtin_fabsf=yes, use_builtin_fabsf=no) |
575 | AC_MSG_RESULT($use_builtin_fabsf) | |
576 | if test $use_builtin_fabsf = "yes"; then | |
54fa7415 SK |
577 | AC_DEFINE(HAVE_BUILTIN_FABSF) |
578 | fi | |
579 | AC_MSG_CHECKING([for __builtin_fabsl]) | |
580 | AC_TRY_COMPILE([#include <math.h>], | |
581 | [ __builtin_fabsl(0.0);], | |
582 | use_builtin_fabsl=yes, use_builtin_fabsl=no) | |
583 | AC_MSG_RESULT($use_builtin_fabsl) | |
584 | if test $use_builtin_fabsl = "yes"; then | |
585 | AC_DEFINE(HAVE_BUILTIN_FABSL) | |
586 | fi | |
587 | AC_MSG_CHECKING([for __builtin_floor]) | |
588 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 589 | [ __builtin_floor(0.0);], |
54fa7415 SK |
590 | use_builtin_floor=yes, use_builtin_floor=no) |
591 | AC_MSG_RESULT($use_builtin_floor) | |
592 | if test $use_builtin_floor = "yes"; then | |
593 | AC_DEFINE(HAVE_BUILTIN_FLOOR) | |
594 | fi | |
595 | AC_MSG_CHECKING([for __builtin_floorf]) | |
596 | AC_TRY_COMPILE([#include <math.h>], | |
597 | [ __builtin_floorf(0.0);], | |
598 | use_builtin_floorf=yes, use_builtin_floorf=no) | |
599 | AC_MSG_RESULT($use_builtin_floorf) | |
600 | if test $use_builtin_floorf = "yes"; then | |
601 | AC_DEFINE(HAVE_BUILTIN_FLOORF) | |
602 | fi | |
603 | AC_MSG_CHECKING([for __builtin_floorl]) | |
604 | AC_TRY_COMPILE([#include <math.h>], | |
605 | [ __builtin_floorl(0.0);], | |
606 | use_builtin_floorl=yes, use_builtin_floorl=no) | |
607 | AC_MSG_RESULT($use_builtin_floorl) | |
608 | if test $use_builtin_floorl = "yes"; then | |
609 | AC_DEFINE(HAVE_BUILTIN_FLOORL) | |
610 | fi | |
5ae55a2e BK |
611 | AC_MSG_CHECKING([for __builtin_fmod]) |
612 | AC_TRY_COMPILE([#include <math.h>], | |
613 | [ __builtin_fmod(0.0, 0.0);], | |
614 | use_builtin_fmod=yes, use_builtin_fmod=no) | |
615 | AC_MSG_RESULT($use_builtin_fmod) | |
616 | if test $use_builtin_fmod = "yes"; then | |
617 | AC_DEFINE(HAVE_BUILTIN_FMOD) | |
618 | fi | |
619 | AC_MSG_CHECKING([for __builtin_fmodf]) | |
620 | AC_TRY_COMPILE([#include <math.h>], | |
621 | [ __builtin_fmodf(0.0, 0.0);], | |
622 | use_builtin_fmodf=yes, use_builtin_fmodf=no) | |
623 | AC_MSG_RESULT($use_builtin_fmodf) | |
624 | if test $use_builtin_fmodf = "yes"; then | |
625 | AC_DEFINE(HAVE_BUILTIN_FMODF) | |
626 | fi | |
627 | AC_MSG_CHECKING([for __builtin_fmodl]) | |
628 | AC_TRY_COMPILE([#include <math.h>], | |
629 | [ __builtin_fmodl(0.0, 0.0);], | |
630 | use_builtin_fmodl=yes, use_builtin_fmodl=no) | |
631 | AC_MSG_RESULT($use_builtin_fmodl) | |
632 | if test $use_builtin_fmodl = "yes"; then | |
633 | AC_DEFINE(HAVE_BUILTIN_FMODL) | |
634 | fi | |
54fa7415 SK |
635 | AC_MSG_CHECKING([for __builtin_frexp]) |
636 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 637 | [ __builtin_frexp(0.0, 0);], |
54fa7415 SK |
638 | use_builtin_frexp=yes, use_builtin_frexp=no) |
639 | AC_MSG_RESULT($use_builtin_frexp) | |
640 | if test $use_builtin_frexp = "yes"; then | |
641 | AC_DEFINE(HAVE_BUILTIN_FREXP) | |
642 | fi | |
643 | AC_MSG_CHECKING([for __builtin_frexpf]) | |
644 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 645 | [ __builtin_frexpf(0.0, 0);], |
54fa7415 SK |
646 | use_builtin_frexpf=yes, use_builtin_frexpf=no) |
647 | AC_MSG_RESULT($use_builtin_frexpf) | |
648 | if test $use_builtin_frexpf = "yes"; then | |
649 | AC_DEFINE(HAVE_BUILTIN_FREXPF) | |
650 | fi | |
651 | AC_MSG_CHECKING([for __builtin_frexpl]) | |
652 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 653 | [ __builtin_frexpl(0.0, 0);], |
54fa7415 SK |
654 | use_builtin_frexpl=yes, use_builtin_frexpl=no) |
655 | AC_MSG_RESULT($use_builtin_frexpl) | |
656 | if test $use_builtin_frexpl = "yes"; then | |
657 | AC_DEFINE(HAVE_BUILTIN_FREXPL) | |
658 | fi | |
659 | AC_MSG_CHECKING([for __builtin_ldexp]) | |
660 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 661 | [ __builtin_ldexp(0.0, 0);], |
54fa7415 SK |
662 | use_builtin_ldexp=yes, use_builtin_ldexp=no) |
663 | AC_MSG_RESULT($use_builtin_ldexp) | |
664 | if test $use_builtin_ldexp = "yes"; then | |
665 | AC_DEFINE(HAVE_BUILTIN_LDEXP) | |
666 | fi | |
667 | AC_MSG_CHECKING([for __builtin_ldexpf]) | |
668 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 669 | [ __builtin_ldexpf(0.0, 0);], |
54fa7415 SK |
670 | use_builtin_ldexpf=yes, use_builtin_ldexpf=no) |
671 | AC_MSG_RESULT($use_builtin_ldexpf) | |
672 | if test $use_builtin_ldexpf = "yes"; then | |
673 | AC_DEFINE(HAVE_BUILTIN_LDEXPF) | |
674 | fi | |
675 | AC_MSG_CHECKING([for __builtin_ldexpl]) | |
676 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 677 | [ __builtin_ldexpl(0.0, 0);], |
54fa7415 SK |
678 | use_builtin_ldexpl=yes, use_builtin_ldexpl=no) |
679 | AC_MSG_RESULT($use_builtin_ldexpl) | |
680 | if test $use_builtin_ldexpl = "yes"; then | |
681 | AC_DEFINE(HAVE_BUILTIN_LDEXPL) | |
682 | fi | |
683 | AC_MSG_CHECKING([for __builtin_log]) | |
684 | AC_TRY_COMPILE([#include <math.h>], | |
685 | [ __builtin_log(0.0);], | |
686 | use_builtin_log=yes, use_builtin_log=no) | |
687 | AC_MSG_RESULT($use_builtin_log) | |
688 | if test $use_builtin_log = "yes"; then | |
689 | AC_DEFINE(HAVE_BUILTIN_LOG) | |
690 | fi | |
691 | AC_MSG_CHECKING([for __builtin_logf]) | |
692 | AC_TRY_COMPILE([#include <math.h>], | |
693 | [ __builtin_logf(0.0);], | |
694 | use_builtin_logf=yes, use_builtin_logf=no) | |
695 | AC_MSG_RESULT($use_builtin_logf) | |
696 | if test $use_builtin_logf = "yes"; then | |
697 | AC_DEFINE(HAVE_BUILTIN_LOGF) | |
698 | fi | |
699 | AC_MSG_CHECKING([for __builtin_logl]) | |
700 | AC_TRY_COMPILE([#include <math.h>], | |
701 | [ __builtin_logl(0.0);], | |
702 | use_builtin_logl=yes, use_builtin_logl=no) | |
703 | AC_MSG_RESULT($use_builtin_logl) | |
704 | if test $use_builtin_logl = "yes"; then | |
705 | AC_DEFINE(HAVE_BUILTIN_LOGL) | |
706 | fi | |
707 | AC_MSG_CHECKING([for __builtin_log10]) | |
708 | AC_TRY_COMPILE([#include <math.h>], | |
709 | [ __builtin_log10(0.0);], | |
710 | use_builtin_log10=yes, use_builtin_log10=no) | |
711 | AC_MSG_RESULT($use_builtin_log10) | |
712 | if test $use_builtin_log10 = "yes"; then | |
713 | AC_DEFINE(HAVE_BUILTIN_LOG10) | |
714 | fi | |
715 | AC_MSG_CHECKING([for __builtin_log10f]) | |
716 | AC_TRY_COMPILE([#include <math.h>], | |
717 | [ __builtin_log10f(0.0);], | |
718 | use_builtin_log10f=yes, use_builtin_log10f=no) | |
719 | AC_MSG_RESULT($use_builtin_log10f) | |
720 | if test $use_builtin_log10f = "yes"; then | |
721 | AC_DEFINE(HAVE_BUILTIN_LOG10F) | |
722 | fi | |
723 | AC_MSG_CHECKING([for __builtin_log10l]) | |
724 | AC_TRY_COMPILE([#include <math.h>], | |
725 | [ __builtin_log10l(0.0);], | |
726 | use_builtin_log10l=yes, use_builtin_log10l=no) | |
727 | AC_MSG_RESULT($use_builtin_log10l) | |
728 | if test $use_builtin_log10l = "yes"; then | |
729 | AC_DEFINE(HAVE_BUILTIN_LOG10L) | |
730 | fi | |
731 | AC_MSG_CHECKING([for __builtin_modf]) | |
732 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 733 | [ __builtin_modf(0.0, 0);], |
54fa7415 SK |
734 | use_builtin_modf=yes, use_builtin_modf=no) |
735 | AC_MSG_RESULT($use_builtin_modf) | |
736 | if test $use_builtin_modf = "yes"; then | |
737 | AC_DEFINE(HAVE_BUILTIN_MODF) | |
738 | fi | |
739 | AC_MSG_CHECKING([for __builtin_modff]) | |
740 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 741 | [ __builtin_modff(0.0, 0);], |
54fa7415 SK |
742 | use_builtin_modff=yes, use_builtin_modff=no) |
743 | AC_MSG_RESULT($use_builtin_modff) | |
744 | if test $use_builtin_modff = "yes"; then | |
745 | AC_DEFINE(HAVE_BUILTIN_MODFF) | |
746 | fi | |
747 | AC_MSG_CHECKING([for __builtin_modfl]) | |
748 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 749 | [ __builtin_modfl(0.0, 0);], |
54fa7415 SK |
750 | use_builtin_modfl=yes, use_builtin_modfl=no) |
751 | AC_MSG_RESULT($use_builtin_modfl) | |
752 | if test $use_builtin_modfl = "yes"; then | |
753 | AC_DEFINE(HAVE_BUILTIN_MODFL) | |
754 | fi | |
755 | AC_MSG_CHECKING([for __builtin_pow]) | |
756 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 757 | [ __builtin_pow(0.0, 0.0);], |
54fa7415 SK |
758 | use_builtin_pow=yes, use_builtin_pow=no) |
759 | AC_MSG_RESULT($use_builtin_pow) | |
760 | if test $use_builtin_pow = "yes"; then | |
761 | AC_DEFINE(HAVE_BUILTIN_POW) | |
762 | fi | |
763 | AC_MSG_CHECKING([for __builtin_powf]) | |
764 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 765 | [ __builtin_powf(0.0, 0.0);], |
54fa7415 SK |
766 | use_builtin_powf=yes, use_builtin_powf=no) |
767 | AC_MSG_RESULT($use_builtin_powf) | |
768 | if test $use_builtin_powf = "yes"; then | |
769 | AC_DEFINE(HAVE_BUILTIN_POWF) | |
770 | fi | |
771 | AC_MSG_CHECKING([for __builtin_powl]) | |
772 | AC_TRY_COMPILE([#include <math.h>], | |
5ae55a2e | 773 | [ __builtin_powl(0.0, 0.0);], |
54fa7415 SK |
774 | use_builtin_powl=yes, use_builtin_powl=no) |
775 | AC_MSG_RESULT($use_builtin_powl) | |
776 | if test $use_builtin_powl = "yes"; then | |
777 | AC_DEFINE(HAVE_BUILTIN_POWL) | |
778 | fi | |
779 | AC_MSG_CHECKING([for __builtin_sin]) | |
780 | AC_TRY_COMPILE([#include <math.h>], | |
781 | [ __builtin_sin(0.0);], | |
782 | use_builtin_sin=yes, use_builtin_sin=no) | |
783 | AC_MSG_RESULT($use_builtin_sin) | |
784 | if test $use_builtin_sin = "yes"; then | |
785 | AC_DEFINE(HAVE_BUILTIN_SIN) | |
786 | fi | |
787 | AC_MSG_CHECKING([for __builtin_sinf]) | |
788 | AC_TRY_COMPILE([#include <math.h>], | |
789 | [ __builtin_sinf(0.0);], | |
790 | use_builtin_sinf=yes, use_builtin_sinf=no) | |
791 | AC_MSG_RESULT($use_builtin_sinf) | |
792 | if test $use_builtin_sinf = "yes"; then | |
793 | AC_DEFINE(HAVE_BUILTIN_SINF) | |
794 | fi | |
795 | AC_MSG_CHECKING([for __builtin_sinl]) | |
796 | AC_TRY_COMPILE([#include <math.h>], | |
797 | [ __builtin_sinl(0.0);], | |
798 | use_builtin_sinl=yes, use_builtin_sinl=no) | |
799 | AC_MSG_RESULT($use_builtin_sinl) | |
800 | if test $use_builtin_sinl = "yes"; then | |
801 | AC_DEFINE(HAVE_BUILTIN_SINL) | |
802 | fi | |
803 | AC_MSG_CHECKING([for __builtin_sinh]) | |
804 | AC_TRY_COMPILE([#include <math.h>], | |
805 | [ __builtin_sinh(0.0);], | |
806 | use_builtin_sinh=yes, use_builtin_sinh=no) | |
807 | AC_MSG_RESULT($use_builtin_sinh) | |
808 | if test $use_builtin_sinh = "yes"; then | |
809 | AC_DEFINE(HAVE_BUILTIN_SINH) | |
810 | fi | |
811 | AC_MSG_CHECKING([for __builtin_sinhf]) | |
812 | AC_TRY_COMPILE([#include <math.h>], | |
813 | [ __builtin_sinhf(0.0);], | |
814 | use_builtin_sinhf=yes, use_builtin_sinhf=no) | |
815 | AC_MSG_RESULT($use_builtin_sinhf) | |
816 | if test $use_builtin_sinhf = "yes"; then | |
817 | AC_DEFINE(HAVE_BUILTIN_SINHF) | |
818 | fi | |
819 | AC_MSG_CHECKING([for __builtin_sinhl]) | |
820 | AC_TRY_COMPILE([#include <math.h>], | |
821 | [ __builtin_sinhl(0.0);], | |
822 | use_builtin_sinhl=yes, use_builtin_sinhl=no) | |
823 | AC_MSG_RESULT($use_builtin_sinhl) | |
824 | if test $use_builtin_sinhl = "yes"; then | |
825 | AC_DEFINE(HAVE_BUILTIN_SINHL) | |
826 | fi | |
827 | AC_MSG_CHECKING([for __builtin_sqrt]) | |
828 | AC_TRY_COMPILE([#include <math.h>], | |
829 | [ __builtin_fsqrt(0.0);], | |
830 | use_builtin_sqrt=yes, use_builtin_sqrt=no) | |
831 | AC_MSG_RESULT($use_builtin_sqrt) | |
832 | if test $use_builtin_sqrt = "yes"; then | |
833 | AC_DEFINE(HAVE_BUILTIN_SQRT) | |
b2dad0e3 | 834 | fi |
b2dad0e3 BK |
835 | AC_MSG_CHECKING([for __builtin_sqrtf]) |
836 | AC_TRY_COMPILE([#include <math.h>], | |
54fa7415 | 837 | [ __builtin_sqrtf(0.0);], |
b2dad0e3 BK |
838 | use_builtin_sqrtf=yes, use_builtin_sqrtf=no) |
839 | AC_MSG_RESULT($use_builtin_sqrtf) | |
840 | if test $use_builtin_sqrtf = "yes"; then | |
54fa7415 | 841 | AC_DEFINE(HAVE_BUILTIN_SQRTF) |
b2dad0e3 | 842 | fi |
54fa7415 SK |
843 | AC_MSG_CHECKING([for __builtin_sqrtl]) |
844 | AC_TRY_COMPILE([#include <math.h>], | |
845 | [ __builtin_sqrtl(0.0);], | |
846 | use_builtin_sqrtl=yes, use_builtin_sqrtl=no) | |
847 | AC_MSG_RESULT($use_builtin_sqrtl) | |
848 | if test $use_builtin_sqrtl = "yes"; then | |
849 | AC_DEFINE(HAVE_BUILTIN_SQRTL) | |
850 | fi | |
851 | AC_MSG_CHECKING([for __builtin_tan]) | |
852 | AC_TRY_COMPILE([#include <math.h>], | |
853 | [ __builtin_tan(0.0);], | |
854 | use_builtin_tan=yes, use_builtin_tan=no) | |
855 | AC_MSG_RESULT($use_builtin_tan) | |
856 | if test $use_builtin_tan = "yes"; then | |
857 | AC_DEFINE(HAVE_BUILTIN_TAN) | |
858 | fi | |
859 | AC_MSG_CHECKING([for __builtin_tanf]) | |
860 | AC_TRY_COMPILE([#include <math.h>], | |
861 | [ __builtin_tanf(0.0);], | |
862 | use_builtin_tanf=yes, use_builtin_tanf=no) | |
863 | AC_MSG_RESULT($use_builtin_tanf) | |
864 | if test $use_builtin_tanf = "yes"; then | |
865 | AC_DEFINE(HAVE_BUILTIN_TANF) | |
866 | fi | |
867 | AC_MSG_CHECKING([for __builtin_tanl]) | |
868 | AC_TRY_COMPILE([#include <math.h>], | |
869 | [ __builtin_tanl(0.0);], | |
870 | use_builtin_tanl=yes, use_builtin_tanl=no) | |
871 | AC_MSG_RESULT($use_builtin_tanl) | |
872 | if test $use_builtin_tanl = "yes"; then | |
873 | AC_DEFINE(HAVE_BUILTIN_TANL) | |
874 | fi | |
875 | AC_MSG_CHECKING([for __builtin_tanh]) | |
876 | AC_TRY_COMPILE([#include <math.h>], | |
877 | [ __builtin_tanh(0.0);], | |
878 | use_builtin_tanh=yes, use_builtin_tanh=no) | |
879 | AC_MSG_RESULT($use_builtin_tanh) | |
880 | if test $use_builtin_tanh = "yes"; then | |
881 | AC_DEFINE(HAVE_BUILTIN_TANH) | |
882 | fi | |
883 | AC_MSG_CHECKING([for __builtin_tanhf]) | |
884 | AC_TRY_COMPILE([#include <math.h>], | |
885 | [ __builtin_tanhf(0.0);], | |
886 | use_builtin_tanhf=yes, use_builtin_tanhf=no) | |
887 | AC_MSG_RESULT($use_builtin_tanhf) | |
888 | if test $use_builtin_tanhf = "yes"; then | |
889 | AC_DEFINE(HAVE_BUILTIN_TANHF) | |
890 | fi | |
891 | AC_MSG_CHECKING([for __builtin_tanhl]) | |
892 | AC_TRY_COMPILE([#include <math.h>], | |
893 | [ __builtin_tanhl(0.0);], | |
894 | use_builtin_tanhl=yes, use_builtin_tanhl=no) | |
895 | AC_MSG_RESULT($use_builtin_tanhl) | |
896 | if test $use_builtin_tanhl = "yes"; then | |
897 | AC_DEFINE(HAVE_BUILTIN_TANHL) | |
898 | fi | |
899 | AC_LANG_RESTORE | |
b2dad0e3 BK |
900 | ]) |
901 | ||
902 | ||
54fa7415 | 903 | |
b2dad0e3 BK |
904 | dnl Check to see what architecture we are compiling for. If it's |
905 | dnl supported, use special hand-crafted routines to provide thread | |
cde28f0d BK |
906 | dnl primitives. Also, if architecture-specific flags are required for |
907 | dnl compilation, add them here. | |
b2dad0e3 | 908 | dnl |
f3b004d8 BK |
909 | dnl Depending on what is found, select configure/cpu/*/bits/atomicity.h |
910 | dnl If not found, select configure/cpu/generic/bits/atomicity.h | |
b2dad0e3 BK |
911 | dnl |
912 | dnl GLIBCPP_CHECK_CPU | |
913 | AC_DEFUN(GLIBCPP_CHECK_CPU, [ | |
914 | AC_MSG_CHECKING([for cpu primitives directory]) | |
c470c17d | 915 | CPU_FLAGS= |
b2dad0e3 BK |
916 | case "$target_cpu" in |
917 | alpha*) | |
918 | cpu_include_dir="config/cpu/alpha" | |
919 | ;; | |
920 | arm*) | |
921 | cpu_include_dir="config/cpu/arm" | |
922 | ;; | |
bf93f43b | 923 | i386) |
b2dad0e3 | 924 | cpu_include_dir="config/cpu/i386" |
bf93f43b BK |
925 | ;; |
926 | i486 | i586 | i686 | i786) | |
927 | cpu_include_dir="config/cpu/i486" | |
b2dad0e3 BK |
928 | ;; |
929 | powerpc | rs6000) | |
930 | cpu_include_dir="config/cpu/powerpc" | |
c470c17d | 931 | CPU_FLAGS='-mcpu=powerpc' |
b2dad0e3 BK |
932 | ;; |
933 | sparc64 | ultrasparc) | |
934 | cpu_include_dir="config/cpu/sparc/sparc64" | |
935 | ;; | |
936 | sparc*) | |
937 | cpu_include_dir="config/cpu/sparc/sparc32" | |
938 | ;; | |
939 | *) | |
940 | cpu_include_dir="config/cpu/generic" | |
941 | ;; | |
942 | esac | |
943 | AC_MSG_RESULT($cpu_include_dir) | |
944 | AC_SUBST(cpu_include_dir) | |
c470c17d | 945 | AC_SUBST(CPU_FLAGS) |
b2dad0e3 BK |
946 | ]) |
947 | ||
948 | ||
949 | dnl | |
950 | dnl Check to see what the underlying c library's interface to ctype looks | |
951 | dnl like. Bits of locale rely on things like isspace, toupper, etc. This | |
952 | dnl stuff makes sure the right bits from the clibrary get called. | |
953 | dnl | |
954 | dnl Depending on what is found, select various configure/*/bits/ctype_base.h | |
955 | dnl Depending on what is found, select various configure/*/ctype.cc | |
956 | dnl | |
957 | dnl GLIBCPP_CHECK_CTYPE | |
958 | AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ | |
959 | AC_CHECK_HEADER(ctype.h, [ | |
960 | ||
961 | dnl If doesn't match any specified, go with defaults. | |
962 | ctype_default=yes | |
963 | ||
964 | dnl Test for <ctype> functionality -- gnu-linux | |
8445e42a | 965 | AC_MSG_CHECKING([<ctype> for gnu-linux ]) |
b2dad0e3 BK |
966 | AC_TRY_COMPILE([#include <ctype.h>], |
967 | [int | |
968 | foo (int a) | |
969 | { return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \ | |
970 | + _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \ | |
971 | + __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \ | |
972 | ctype_linux=yes, ctype_linux=no) | |
973 | AC_MSG_RESULT($ctype_linux) | |
974 | if test $ctype_linux = "yes"; then | |
975 | ctype_include_dir="config/gnu-linux" | |
976 | ctype_default=no | |
977 | fi | |
978 | ||
6ad50467 | 979 | dnl Test for <ctype> functionality -- FreeBSD 4.0 |
65dd21b7 | 980 | if test $ctype_default = "yes"; then |
6ad50467 | 981 | AC_MSG_CHECKING([<ctype> for freebsd 4.0 ]) |
7b267e3e BK |
982 | AC_TRY_COMPILE([#include <ctype.h>], |
983 | [int | |
984 | foo (int a) | |
985 | { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \ | |
986 | + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \ | |
987 | ctype_bsd=yes, ctype_bsd=no) | |
988 | AC_MSG_RESULT($ctype_bsd) | |
989 | if test $ctype_bsd = "yes"; then | |
6ad50467 BK |
990 | ctype_include_dir="config/bsd" |
991 | ctype_default=no | |
992 | fi | |
65dd21b7 | 993 | fi |
6ad50467 BK |
994 | |
995 | dnl Test for <ctype> functionality -- FreeBSD 3.4 | |
65dd21b7 | 996 | if test $ctype_default = "yes"; then |
6ad50467 BK |
997 | AC_MSG_CHECKING([<ctype> for freebsd 3.4 ]) |
998 | AC_TRY_COMPILE([#include <ctype.h>], | |
999 | [int | |
1000 | foo (int a) | |
1001 | { return _S + _R + _C + _U + _L + _A \ | |
1002 | + _D + _P + _X + _G + __istype (a, 0);}], \ | |
1003 | ctype_freebsd34=yes, ctype_freebsd34=no) | |
1004 | AC_MSG_RESULT($ctype_freebsd34) | |
1005 | if test $ctype_freebsd34 = "yes"; then | |
7b267e3e BK |
1006 | ctype_include_dir="config/bsd" |
1007 | ctype_default=no | |
1008 | fi | |
65dd21b7 | 1009 | fi |
7b267e3e | 1010 | |
b2dad0e3 BK |
1011 | dnl Test for <ctype> functionality -- solaris 2.6 and 2.7 |
1012 | if test $ctype_default = "yes"; then | |
8445e42a | 1013 | AC_MSG_CHECKING([<ctype> for solaris 2.[6,7,8] ]) |
b2dad0e3 BK |
1014 | AC_TRY_COMPILE([#include <ctype.h>], |
1015 | [int | |
1016 | foo (int a) | |
1017 | { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \ | |
1018 | + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \ | |
1019 | + __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \ | |
1020 | ctype_solaris=yes, ctype_solaris=no) | |
1021 | AC_MSG_RESULT($ctype_solaris) | |
1022 | ||
1023 | if test $ctype_solaris = "yes"; then | |
1024 | AC_MSG_CHECKING([ for version]) | |
1025 | AC_LANG_CPLUSPLUS | |
1026 | AC_TRY_COMPILE([#include <ctype.h>], | |
1027 | [typedef long* __to_type; __to_type const& _M_toupper = __trans_upper;],\ | |
1028 | ctype_solaris26=yes, ctype_solaris26=no) | |
1029 | AC_LANG_C | |
1030 | if test $ctype_solaris26 = "yes"; then | |
1031 | ctype_include_dir="config/solaris/solaris2.6" | |
1032 | AC_MSG_RESULT("solaris2.6") | |
1033 | ctype_default=no | |
1034 | else | |
1035 | ctype_include_dir="config/solaris/solaris2.7" | |
32a4595e | 1036 | AC_MSG_RESULT("solaris2.[7,8]") |
b2dad0e3 BK |
1037 | ctype_default=no |
1038 | fi | |
1039 | fi | |
1040 | fi | |
1041 | ||
1042 | dnl Test for <ctype> functionality -- solaris 2.5.1 | |
1043 | if test $ctype_default = "yes"; then | |
8445e42a | 1044 | AC_MSG_CHECKING([<ctype> for solaris 2.5.1 ]) |
b2dad0e3 BK |
1045 | AC_TRY_COMPILE([#include <ctype.h>], |
1046 | [int | |
1047 | foo (int a) | |
1048 | { return _U + _L + _N + _S + _P + _C + _X + _B \ | |
1049 | + __ctype[a];}], \ | |
1050 | ctype_solaris25=yes, ctype_solaris25=no) | |
1051 | AC_MSG_RESULT($ctype_solaris25) | |
1052 | if test $ctype_solaris25 = "yes"; then | |
1053 | ctype_include_dir="config/solaris/solaris2.5" | |
1054 | ctype_default=no | |
1055 | fi | |
1056 | fi | |
1057 | ||
1058 | dnl Test for <ctype> functionality -- aix | |
1059 | if test $ctype_default = "yes"; then | |
8445e42a | 1060 | AC_MSG_CHECKING([<ctype> for aix ]) |
b2dad0e3 BK |
1061 | AC_TRY_COMPILE([#include <ctype.h>], |
1062 | [int | |
1063 | foo (int a) | |
1064 | { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \ | |
1065 | + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \ | |
1066 | + _VALC('a') + _IS('c', 0);}], \ | |
1067 | ctype_aix=yes, ctype_aix=no) | |
1068 | AC_MSG_RESULT($ctype_aix) | |
1069 | if test $ctype_aix = "yes"; then | |
1070 | ctype_include_dir="config/aix" | |
1071 | ctype_default=no | |
1072 | fi | |
1073 | fi | |
1074 | ||
1075 | dnl Test for <ctype> functionality -- newlib | |
1076 | if test $ctype_default = "yes"; then | |
8445e42a | 1077 | AC_MSG_CHECKING([<ctype> for newlib ]) |
b2dad0e3 BK |
1078 | AC_TRY_COMPILE([#include <ctype.h>], |
1079 | [int | |
1080 | foo (int a) | |
1081 | { return _U + _L + _N + _S + _P + _C + _X + _B \ | |
1082 | + _ctype_[a];}], \ | |
1083 | ctype_newlib=yes, ctype_newlib=no) | |
1084 | AC_MSG_RESULT($ctype_newlib) | |
1085 | if test $ctype_newlib = "yes"; then | |
1086 | ctype_include_dir="config/newlib" | |
1087 | ctype_default=no | |
1088 | fi | |
1089 | fi | |
1090 | ||
1091 | if test $ctype_default = "yes"; then | |
1092 | ctype_include_dir="config/generic" | |
1093 | AC_MSG_WARN("Using default ctype headers.") | |
1094 | fi | |
1095 | AC_SUBST(ctype_include_dir) | |
1096 | ]) | |
1097 | ]) | |
1098 | ||
1099 | ||
1100 | dnl | |
1101 | dnl Check to see what the underlying c library or math library is like. | |
1102 | dnl | |
1103 | dnl Define HAVE_CARGF etc if "cargf" is found. | |
1104 | dnl | |
1105 | dnl GLIBCPP_CHECK_MATH_SUPPORT | |
1106 | AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [ | |
1107 | AC_CHECK_LIB(m, sin, libm="-lm") | |
1108 | save_LIBS="$LIBS" | |
1109 | LIBS="$LIBS $libm" | |
1110 | ||
1111 | dnl Check for complex versions of math functions of platform. | |
1112 | AC_CHECK_HEADERS([complex.h]) | |
1113 | AC_REPLACE_MATHFUNCS(ccos ccosf ccosh ccoshf cexp cexpf c_log c_logf \ | |
1114 | clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt csqrtf \ | |
1115 | ctan ctanf ctanh ctanhf \ | |
1116 | carg cargf nan hypot hypotf atan2f expf copysignf) | |
1117 | ||
1118 | dnl We compile the long double complex functions only if the function | |
f3b004d8 | 1119 | dnl provides the non-complex long double functions. |
b2dad0e3 | 1120 | USE_LONG_DOUBLE=no |
f3b004d8 | 1121 | AC_CHECK_FUNC(copysignl, |
b2dad0e3 BK |
1122 | USE_LONG_DOUBLE=yes |
1123 | AC_REPLACE_MATHFUNCS(ccoshl ccosl cexpl cpowl csinhl csinl \ | |
1124 | csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l)) | |
1125 | AC_SUBST(USE_LONG_DOUBLE) | |
1126 | ||
54fa7415 | 1127 | dnl Check to see if basic C math functions have float, long double versions. |
6c820cf2 | 1128 | AC_REPLACE_MATHFUNCS(cosf fabsf sinf sqrtf) |
54fa7415 | 1129 | AC_CHECK_FUNCS(isnan isnanf isnanl isinf isinff isinfl copysign copysignl \ |
6c820cf2 | 1130 | acosf acosl asinf asinl atanf atanl atan2f atan2l ceilf ceill cosl \ |
5ae55a2e BK |
1131 | coshf coshl expf expl fabsl floorf floorl fmodf fmodl frexpf frexpl ldexpf \ |
1132 | ldexpl logf logl log10f log10l modff modfl powf powl sinl sinhf \ | |
6c820cf2 | 1133 | sinhl sqrtl tanf tanl tanhf tanhl strtof strtold sincos sincosf \ |
54fa7415 | 1134 | sincosl finite finitef finitel fqfinite fpclass qfpclass) |
b2dad0e3 BK |
1135 | |
1136 | #Some runtimes have these functions with a preceding underscore. Please | |
1137 | # keep this sync'd with the one above. And if you add any new symbol, | |
1138 | # please add the corresponding block in the @BOTTOM@ section of | |
1139 | # acconfig.h. | |
54fa7415 SK |
1140 | |
1141 | AC_CHECK_FUNCS(_isnan _isnanf _isnanl _isinf _isinff _isinfl _copysign \ | |
1142 | _copysignl _acosf _acosl _asinf _asinl _atanf _atanl _atan2f _atan2l \ | |
1143 | _ceilf _ceill _cosf _cosl _coshf _coshl _expf _expl _fabsf _fabsl \ | |
5ae55a2e BK |
1144 | _floorf _floorl _fmodf _fmodl _frexpf _frexpl _ldexpf _ldexpl _logf _logl \ |
1145 | _log10f _log10l _modff _modfl _powf _powl _sinf _sinl _sinhf _sinhl \ | |
1146 | _sqrtf _sqrtl _tanf _tanl _tanhf _tanhl _strtof _strtold _sincos _sincosf \ | |
1147 | _sincosl _finite _finitef _finitel _fqfinite _fpclass _qfpclass) | |
b2dad0e3 BK |
1148 | |
1149 | LIBS="$save_LIBS" | |
1150 | ]) | |
1151 | ||
1152 | ||
1153 | dnl | |
1154 | dnl Check to see if this target can enable the wchar_t parts of libstdc++. | |
1155 | dnl | |
1156 | dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found | |
1157 | dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h | |
b2dad0e3 BK |
1158 | dnl |
1159 | dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT | |
1160 | AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [ | |
3840fa2a BK |
1161 | |
1162 | dnl Sanity check for existence of ISO C9X headers for extended encoding. | |
1163 | AC_CHECK_HEADER(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no) | |
1164 | AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no) | |
1165 | ||
1166 | dnl Only continue checking if the ISO C9X headers exist. | |
1167 | if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then | |
1168 | ||
1169 | dnl Test wchar.h for mbstate_t, which is needed for char_traits and others. | |
1170 | AC_MSG_CHECKING([for mbstate_t]) | |
1171 | AC_TRY_COMPILE([#include <wchar.h>], | |
1172 | [mbstate_t teststate;], | |
1173 | use_native_mbstatet=yes, use_native_mbstatet=no) | |
1174 | AC_MSG_RESULT($use_native_mbstatet) | |
1175 | if test x"$use_native_mbstatet" = xno; then | |
1176 | AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T) | |
1177 | fi | |
b2dad0e3 | 1178 | |
3840fa2a BK |
1179 | dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before |
1180 | dnl numeric_limits can instantiate type_traits<wchar_t> | |
1181 | AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX]) | |
1182 | AC_TRY_COMPILE([#include <wchar.h>], | |
1183 | [int i = WCHAR_MIN; int j = WCHAR_MAX;], | |
1184 | has_wchar_minmax=yes, has_wchar_minmax=no) | |
1185 | AC_MSG_RESULT($has_wchar_minmax) | |
b2dad0e3 | 1186 | |
3840fa2a BK |
1187 | dnl Test wchar.h for WEOF, which is what we use to determine whether |
1188 | dnl to specialize for char_traits<wchar_t> or not. | |
1189 | AC_MSG_CHECKING([for WEOF]) | |
1190 | AC_TRY_COMPILE([ | |
1191 | #include <wchar.h> | |
1192 | #include <stddef.h>], | |
1193 | [wint_t i = WEOF;], | |
1194 | has_weof=yes, has_weof=no) | |
1195 | AC_MSG_RESULT($has_weof) | |
1196 | ||
1197 | dnl Tests for wide character functions used in char_traits<wchar_t>. | |
1198 | AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset, ac_wfuncs=yes, ac_wfuncs=no) | |
1199 | ||
1200 | AC_MSG_CHECKING([for ISO C9X wchar_t support]) | |
1201 | if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes && test x"$ac_wfuncs" = xyes; then | |
1202 | ac_isoC9X_wchar_t=yes | |
1203 | else | |
1204 | ac_isoC9X_wchar_t=no | |
1205 | fi | |
1206 | AC_MSG_RESULT($ac_isoC9X_wchar_t) | |
1207 | ||
1208 | dnl Use iconv for wchar_t to char conversions. As such, check for | |
1209 | dnl X/Open Portability Guide, version 2 features (XPG2). | |
1210 | AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no) | |
1211 | AC_CHECK_FUNCS(iconv_open iconv_close iconv, ac_XPG2funcs=yes, ac_XPG2funcs=no) | |
1212 | ||
1213 | AC_MSG_CHECKING([for XPG2 wchar_t support]) | |
1214 | if test x"$ac_has_iconv_h" = xyes && test x"$ac_XPG2funcs" = xyes; then | |
1215 | ac_XPG2_wchar_t=yes | |
1216 | else | |
1217 | ac_XPG2_wchar_t=no | |
1218 | fi | |
1219 | AC_MSG_RESULT($ac_XPG2_wchar_t) | |
1220 | ||
1221 | dnl At the moment, only enable wchar_t specializations if all the | |
1222 | dnl above support is present. | |
1223 | AC_MSG_CHECKING([for enabled wchar_t specializations]) | |
1224 | if test x"$ac_isoC9X_wchar_t" = xyes && test x"$ac_XPG2_wchar_t" = xyes; then | |
1225 | libinst_wstring_la="libinst-wstring.la" | |
1226 | AC_DEFINE(_GLIBCPP_USE_WCHAR_T) | |
1227 | AC_MSG_RESULT("yes") | |
1228 | else | |
1229 | libinst_wstring_la="" | |
1230 | AC_MSG_RESULT("no") | |
1231 | fi | |
1232 | AC_SUBST(libinst_wstring_la) | |
1233 | ||
b2dad0e3 | 1234 | else |
3840fa2a BK |
1235 | AC_MSG_WARN([<wchar.h> not found]) |
1236 | AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T) | |
b2dad0e3 | 1237 | fi |
b2dad0e3 BK |
1238 | ]) |
1239 | ||
1240 | ||
1241 | dnl | |
1242 | dnl Check to see if this version of GNU C++ is afflicted by bugs in | |
1243 | dnl __complex__ float support. | |
1244 | dnl | |
1245 | dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy. | |
1246 | dnl | |
1247 | dnl GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT | |
1248 | AC_DEFUN(GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT, [ | |
1249 | AC_REQUIRE([AC_PROG_CXX]) | |
1250 | AC_MSG_CHECKING([for GNU C++ __complex__ float support]) | |
1251 | AC_CACHE_VAL(glibcpp_cv_float_complex, [ | |
1252 | AC_LANG_SAVE | |
1253 | AC_LANG_CPLUSPLUS | |
1254 | rm -f conftest.h | |
1255 | cat > conftest.h <<EOB | |
1256 | // | |
1257 | // Check for buggy __complex__ that causes ICE in most versions of egcs | |
1258 | // and gcc-2.95.x on certain platforms (eg., x86-win32). | |
1259 | // | |
1260 | // See http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00845.html for | |
1261 | // more info on the bug itself. | |
1262 | // | |
1263 | struct | |
1264 | float_complex | |
1265 | { | |
1266 | __complex__ float m_value; | |
1267 | float_complex (float = 0.0f, float = 0.0f); | |
1268 | float_complex (__complex__ float val) : m_value (val) {} | |
1269 | float_complex foo (const float_complex &val) | |
1270 | { return float_complex (~val.m_value); } | |
1271 | }; | |
1272 | EOB | |
1273 | AC_TRY_COMPILE([#include "conftest.h"], , | |
1274 | glibcpp_cv_float_complex=ok, | |
1275 | glibcpp_cv_float_complex=buggy | |
1276 | ) | |
1277 | AC_LANG_RESTORE | |
1278 | ]) | |
1279 | AC_MSG_RESULT($glibcpp_cv_float_complex) | |
1280 | if test $glibcpp_cv_float_complex = buggy; then | |
1281 | AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX) | |
1282 | fi | |
1283 | ]) | |
1284 | ||
1285 | ||
1286 | dnl | |
1287 | dnl | |
1288 | dnl Check to see if this version of GNU C++ is afflicted by bugs in | |
1289 | dnl __complex__ support.Check for buggy __complex__ that will cause ICE in | |
1290 | dnl gcc-2.95.x when using the library, unless we define the default copy | |
1291 | dnl ctor in the specializations of complex<>. | |
1292 | dnl | |
1293 | dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy. | |
1294 | dnl | |
1295 | dnl GLIBCPP_CHECK_COMPLEX_SUPPORT | |
1296 | AC_DEFUN(GLIBCPP_CHECK_COMPLEX_SUPPORT, [ | |
1297 | AC_REQUIRE([AC_PROG_CXX]) | |
1298 | AC_MSG_CHECKING([for GNU C++ __complex__ support]) | |
1299 | AC_CACHE_VAL(glibcpp_cv_complex, [ | |
1300 | AC_LANG_SAVE | |
1301 | AC_LANG_CPLUSPLUS | |
1302 | AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \ | |
1303 | dcomplex f(const dcomplex& x) { return dcomplex(x); }], \ | |
1304 | [ dcomplex x; f(x); ], | |
1305 | glibcpp_cv_complex=ok, | |
1306 | glibcpp_cv_complex=buggy | |
1307 | ) | |
1308 | AC_LANG_RESTORE | |
1309 | ]) | |
1310 | AC_MSG_RESULT($glibcpp_cv_complex) | |
1311 | if test $glibcpp_cv_complex = buggy; then | |
1312 | AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX) | |
1313 | fi | |
1314 | ]) | |
1315 | ||
1316 | ||
1317 | dnl | |
8bd636c5 | 1318 | dnl Check for special debugging mode; not for production use. |
b2dad0e3 BK |
1319 | dnl |
1320 | dnl GLIBCPP_ENABLE_DEBUG | |
1321 | dnl --enable-debug sets '-ggdb -O0'. | |
1322 | dnl --disable-debug sets '-g' and whatever optimization options the | |
1323 | dnl compiler can handle. | |
1324 | dnl + Perhaps --enable-maintainer-mode should automatically turn this on? | |
1325 | dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...? | |
1326 | dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)] | |
1327 | dnl Where DEFAULT is either `yes' or `no'. If ommitted, it | |
1328 | dnl defaults to `no'. | |
1329 | AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl | |
1330 | define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl | |
1331 | AC_ARG_ENABLE(debug, | |
1332 | changequote(<<, >>)dnl | |
1333 | << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT], | |
1334 | changequote([, ])dnl | |
1335 | [case "$enableval" in | |
1336 | yes) enable_debug=yes ;; | |
1337 | no) enable_debug=no ;; | |
1338 | *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;; | |
1339 | esac], | |
1340 | enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl | |
1341 | dnl Option parsed, now set things appropriately | |
1342 | case "$enable_debug" in | |
cde28f0d | 1343 | yes) |
c470c17d | 1344 | DEBUG_FLAGS='-O0 -ggdb' |
cde28f0d | 1345 | ;; |
f3b004d8 | 1346 | no) |
c470c17d | 1347 | DEBUG_FLAGS='-g' |
f3b004d8 | 1348 | ;; |
b2dad0e3 | 1349 | esac |
c470c17d | 1350 | AC_SUBST(DEBUG_FLAGS) |
b2dad0e3 BK |
1351 | ]) |
1352 | ||
1353 | ||
dcfa0bc8 PE |
1354 | dnl |
1355 | dnl Check for "unusual" flags to pass to the compiler while building. | |
1356 | dnl | |
1357 | dnl GLIBCPP_ENABLE_CXX_FLAGS | |
1358 | dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing | |
1359 | dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc. | |
1360 | dnl Somehow this same set of flags must be passed when [re]building | |
1361 | dnl libgcc. | |
1362 | dnl --disable-cxx-flags passes nothing. | |
32a4595e PE |
1363 | dnl + See http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00131.html |
1364 | dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00284.html | |
1365 | dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q1/msg00035.html | |
dcfa0bc8 | 1366 | dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags) |
32a4595e PE |
1367 | dnl If "default flags" is an empty string (or "none"), the effect is |
1368 | dnl the same as --disable or --enable=no. | |
dcfa0bc8 PE |
1369 | AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl |
1370 | define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl | |
1371 | AC_ARG_ENABLE(cxx-flags, | |
1372 | changequote(<<, >>)dnl | |
1373 | << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library; | |
1374 | [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], | |
1375 | changequote([, ])dnl | |
1376 | [case "x$enableval" in | |
1377 | xyes) AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;; | |
32a4595e | 1378 | xno|x) enable_cxx_flags='' ;; |
dcfa0bc8 PE |
1379 | *) enable_cxx_flags="$enableval" ;; |
1380 | esac], | |
1381 | enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')dnl | |
32a4595e PE |
1382 | dnl Thinko on my part during design. This kludge is the workaround. |
1383 | if test "$enable_cxx_flags" = "none"; then enable_cxx_flags=''; fi | |
1384 | dnl Run through flags (either default or command-line) and set anything | |
1385 | dnl extra (e.g., #defines) that must accompany particular g++ options. | |
dcfa0bc8 PE |
1386 | if test -n "$enable_cxx_flags"; then |
1387 | for f in $enable_cxx_flags; do | |
1388 | case "$f" in | |
991a40fc | 1389 | -fhonor-std) ;; |
dcfa0bc8 PE |
1390 | -*) ;; |
1391 | *) # and we're trying to pass /what/ exactly? | |
1392 | AC_MSG_ERROR([compiler flags start with a -]) ;; | |
1393 | esac | |
1394 | done | |
1395 | fi | |
1396 | EXTRA_CXX_FLAGS="$enable_cxx_flags" | |
1397 | AC_SUBST(EXTRA_CXX_FLAGS) | |
1398 | ]) | |
1399 | ||
1400 | ||
b2dad0e3 BK |
1401 | dnl |
1402 | dnl Check for instructions to automatically rebuild libgcc.a. Requires, | |
1403 | dnl of course, the location of the gcc objdir. Note that if --disable- | |
1404 | dnl namespaces is in effect, rebuilding libgcc.a is an expensive no-op. | |
1405 | dnl | |
1406 | dnl GLIBCPP_ENABLE_RELIBGCC | |
1407 | dnl --enable-libgcc-rebuild=/absolute/path/to/gcc/objdir sets GCC_OBJDIR | |
1408 | dnl (presumably in the top-level Makefile) to /absol.../objdir | |
1409 | dnl --disable-libgcc-rebuild will not touch libgcc.a at all (maybe print | |
1410 | dnl a warning if this is given along with --enable-namespaces), by | |
1411 | dnl setting GCC_OBJDIR to `no'. | |
1412 | dnl + Doing this by default is going to be interesting. What default | |
1413 | dnl "on" value can there be? | |
1414 | dnl + Usage: GLIBCPP_ENABLE_RELIBGCC[(DEFAULT)] | |
1415 | dnl The default path should be ../.. if bundled with GCC source. | |
1416 | dnl If ommitted, it defaults to `no'. | |
1417 | dnl | |
1418 | AC_DEFUN(GLIBCPP_ENABLE_RELIBGCC, [dnl | |
1419 | define([GLIBCPP_ENABLE_RELIBGCC_DEFAULT], ifelse($1,, no, $1))dnl | |
1420 | AC_ARG_ENABLE(libgcc-rebuild, | |
1421 | changequote(<<, >>)dnl | |
1422 | << --enable-libgcc-rebuild=DIR also rebuild libgcc.a; DIR is | |
1423 | the GCC objdir; see install.html>>, | |
1424 | changequote([, ])dnl | |
1425 | [case "$enableval" in | |
1426 | yes) AC_MSG_ERROR([--enable-libgcc-rebuild needs a pathname]) ;; | |
1427 | no) enable_libgcc_rebuild=no ;; | |
1428 | *) if test -d "$enableval" && test -d "${enableval}/gcc" && \ | |
1429 | test -d "${enableval}/libiberty" | |
1430 | then | |
1431 | enable_libgcc_rebuild="$enableval" | |
1432 | else | |
1433 | AC_MSG_ERROR(["$enableval" does not appear to be the GCC objdir]) | |
1434 | fi | |
1435 | ;; | |
1436 | esac], | |
1437 | enable_libgcc_rebuild=GLIBCPP_ENABLE_RELIBGCC_DEFAULT)dnl | |
1438 | GCC_OBJDIR="$enable_libgcc_rebuild" | |
1439 | AC_SUBST(GCC_OBJDIR) | |
1440 | ]) | |
1441 | ||
1442 | ||
1443 | dnl | |
8bd636c5 | 1444 | dnl Check for which I/O library to use: libio, or something specific. |
b2dad0e3 BK |
1445 | dnl |
1446 | dnl GLIBCPP_ENABLE_CSTDIO | |
1447 | dnl --enable-cstdio=libio sets config/c_io_libio.h and friends | |
1448 | dnl | |
1449 | dnl default is libio | |
1450 | dnl | |
1451 | AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ | |
1452 | AC_MSG_CHECKING([for cstdio to use]) | |
1453 | AC_ARG_ENABLE(cstdio, | |
1454 | [ --enable-cstdio enable GNU libio for target io package. (default) | |
1455 | --enable-cstdio=LIB use LIB target-speific io package.], | |
1456 | if test x$enable_cstdio = xno; then | |
1457 | enable_cstdio=libio | |
1458 | fi, | |
1459 | enable_cstdio=libio) | |
1460 | ||
1461 | enable_cstdio_flag=$enable_cstdio | |
1462 | ||
1463 | dnl Check if a valid thread package | |
1464 | case x${enable_cstdio_flag} in | |
1465 | xlibio | x | xno | xnone | xyes) | |
1466 | # default | |
1467 | CSTDIO_H=c_io_libio.h | |
1468 | CSTDIO_CC=c_io_libio.cc | |
1469 | AC_MSG_RESULT(libio) | |
1470 | ||
1471 | # see if we are on a system with libio native (ie, linux) | |
1472 | AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no) | |
1473 | if test $has_libio = "yes"; then | |
1474 | BUILD_LIBIO_INCLUDE= | |
1475 | need_libio=no | |
1476 | else | |
1477 | BUILD_LIBIO_INCLUDE='-I../libio' | |
1478 | need_libio=yes | |
1479 | fi | |
1480 | AC_SUBST(BUILD_LIBIO_INCLUDE) | |
f3b004d8 BK |
1481 | |
1482 | # see if the _G_config.h header needs to be built. | |
1483 | # NB: This replaces the _G_CONFIG_H machinery in libio-v2 | |
1484 | AC_CHECK_HEADER(_G_config.h, has_gconf_h=yes, has_gconf_h=no) | |
1485 | AM_CONDITIONAL(GLIBCPP_NEED_LIBIO_CONFIG_H, test "$has_gconf_h" = no) | |
b2dad0e3 BK |
1486 | ;; |
1487 | xwince) | |
1488 | CSTDIO_H=c_io_wince.h | |
1489 | CSTDIO_CC=c_io_wince.cc | |
1490 | AC_MSG_RESULT(wince) | |
1491 | ||
1492 | need_libio=no | |
1493 | BUILD_LIBIO_INCLUDE= | |
1494 | AC_SUBST(BUILD_LIBIO_INCLUDE) | |
1495 | ;; | |
1496 | *) | |
1497 | echo "$enable_cstdio is an unknown io package" 1>&2 | |
1498 | exit 1 | |
1499 | ;; | |
1500 | esac | |
1501 | AC_SUBST(CSTDIO_H) | |
1502 | AC_SUBST(CSTDIO_CC) | |
1503 | AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes) | |
1504 | ]) | |
1505 | ||
1506 | ||
1507 | dnl | |
8bd636c5 | 1508 | dnl Check for which threading library to use. |
b2dad0e3 BK |
1509 | dnl |
1510 | dnl GLIBCPP_ENABLE_THREADS | |
1511 | dnl --enable-threads=posix sets config/threads-posix.h et. al. | |
1512 | dnl | |
1513 | dnl default is no threads | |
1514 | dnl | |
1515 | AC_DEFUN(GLIBCPP_ENABLE_THREADS, [ | |
1516 | dnl Note this comes from the gcc/config.in and libjava/config.in | |
1517 | dnl Efforts should be made to keep this in sync. | |
1518 | AC_MSG_CHECKING([for threads package to use]) | |
1519 | AC_ARG_ENABLE(threads, | |
1520 | [ --enable-threads enable thread usage for target GCC. | |
1521 | --enable-threads=LIB use LIB thread package for target GCC.], | |
1522 | if test x$enable_threads = xno; then | |
1523 | enable_threads='' | |
1524 | fi, | |
1525 | enable_threads='') | |
1526 | ||
1527 | enable_threads_flag=$enable_threads | |
1528 | ||
1529 | dnl Check if a valid thread package | |
1530 | case x${enable_threads_flag} in | |
1531 | x | xno | xnone) | |
1532 | # No threads | |
1533 | target_thread_file='single' | |
1534 | ;; | |
1535 | xyes) | |
1536 | # default | |
1537 | target_thread_file='' | |
1538 | ;; | |
1539 | xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \ | |
1540 | xsolaris | xwin32 | xdce | xvxworks) | |
1541 | target_thread_file=$enable_threads_flag | |
1542 | ;; | |
1543 | *) | |
1544 | echo "$enable_threads is an unknown thread package" 1>&2 | |
1545 | exit 1 | |
1546 | ;; | |
1547 | esac | |
1548 | ||
1549 | dnl Check for thread package actually supported in libstdc++ | |
1550 | case "$target_thread_file" in | |
1551 | no | none | single) | |
1552 | THREADS=none | |
1553 | ;; | |
1554 | posix | pthreads) | |
1555 | THREADS=posix | |
1556 | case "$host" in | |
1557 | *-*-linux*) | |
1558 | ;; | |
1559 | esac | |
1560 | ;; | |
1561 | decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks) | |
1562 | AC_MSG_ERROR(thread package $THREADS not yet supported) | |
1563 | ;; | |
1564 | *) | |
1565 | AC_MSG_ERROR($THREADS is an unknown thread package) | |
1566 | ;; | |
1567 | esac | |
1568 | AC_MSG_RESULT($THREADS) | |
1569 | ||
1570 | THREADLIBS= | |
1571 | THREADINCS= | |
1572 | THREADDEPS= | |
1573 | THREADOBJS= | |
1574 | THREADH= | |
1575 | THREADSPEC= | |
1576 | case "$THREADS" in | |
1577 | posix) | |
1578 | AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=]) | |
1579 | THREADLIBS=-lpthread | |
1580 | THREADSPEC=-lpthread | |
1581 | dnl Not presently used | |
1582 | dnl THREADOBJS=threads-posix.lo | |
1583 | THREADH=threads-posix.h | |
1584 | ;; | |
1585 | none) | |
1586 | dnl Not presently used | |
1587 | dnl THREADOBJS=threads-no.lo | |
1588 | THREADH=threads-no.h | |
1589 | ;; | |
1590 | esac | |
1591 | AC_SUBST(THREADLIBS) | |
1592 | AC_SUBST(THREADINCS) | |
1593 | AC_SUBST(THREADDEPS) | |
1594 | AC_SUBST(THREADOBJS) | |
1595 | AC_SUBST(THREADSPEC) | |
1596 | ]) | |
1597 | ||
1598 | ||
1599 | dnl | |
8bd636c5 | 1600 | dnl Check for template specializations for the 'long long' type extension. |
b2dad0e3 BK |
1601 | dnl |
1602 | dnl GLIBCPP_ENABLE_LONG_LONG | |
1603 | dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG | |
1604 | dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined | |
1605 | dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)] | |
1606 | dnl Where DEFAULT is either `yes' or `no'. If ommitted, it | |
1607 | dnl defaults to `no'. | |
0137be2d | 1608 | dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'. |
b2dad0e3 BK |
1609 | dnl |
1610 | dnl GLIBCPP_ENABLE_LONG_LONG | |
1611 | AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl | |
1612 | define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl | |
209fe19b | 1613 | |
b2dad0e3 BK |
1614 | AC_ARG_ENABLE(long-long, |
1615 | changequote(<<, >>)dnl | |
d0d88ce3 | 1616 | <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT], |
b2dad0e3 BK |
1617 | changequote([, ])dnl |
1618 | [case "$enableval" in | |
1619 | yes) enable_long_long=yes ;; | |
1620 | no) enable_long_long=no ;; | |
1621 | *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;; | |
1622 | esac], | |
1623 | enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl | |
209fe19b BK |
1624 | |
1625 | # Check for the existance of functions used if long long is enabled. | |
1626 | AC_CHECK_FUNC(strtoll,,ac_strtoll=no) | |
1627 | AC_CHECK_FUNC(strtoull,,ac_strtoull=no) | |
1628 | ||
3840fa2a | 1629 | AC_MSG_CHECKING([for enabled long long]) |
209fe19b | 1630 | if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then |
3840fa2a BK |
1631 | enable_long_long=no; |
1632 | fi; | |
d0d88ce3 | 1633 | AC_MSG_RESULT($enable_long_long) |
3840fa2a | 1634 | |
b2dad0e3 BK |
1635 | dnl Option parsed, now set things appropriately |
1636 | case "$enable_long_long" in | |
1637 | yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG) | |
1638 | ;; | |
1639 | esac | |
1640 | ]) | |
1641 | ||
1642 | ||
99246c90 | 1643 | dnl |
8bd636c5 | 1644 | dnl Check for whether or not to do shadowed C headers. |
99246c90 PE |
1645 | dnl |
1646 | dnl GLIBCPP_ENABLE_SHADOW | |
d0d88ce3 BK |
1647 | dnl --enable-cshadow-headers [does stuff]. |
1648 | dnl --disable-cshadow-headers [does not do stuff]. | |
99246c90 PE |
1649 | dnl + This will eventually need to be on by default. |
1650 | dnl + Usage: GLIBCPP_ENABLE_SHADOW[(DEFAULT)] | |
1651 | dnl Where DEFAULT is either `yes' or `no'. If ommitted, it | |
1652 | dnl defaults to `no'. | |
1653 | AC_DEFUN(GLIBCPP_ENABLE_SHADOW, [dnl | |
1654 | define([GLIBCPP_ENABLE_SHADOW_DEFAULT], ifelse($1, yes, yes, no))dnl | |
d0d88ce3 BK |
1655 | AC_MSG_CHECKING([for enabled cshadow headers]) |
1656 | AC_ARG_ENABLE(cshadow-headers, | |
99246c90 | 1657 | changequote(<<, >>)dnl |
d0d88ce3 BK |
1658 | << --enable-cshadow-headers construct "shadowed" C header files for |
1659 | g++ [default=>>GLIBCPP_ENABLE_SHADOW_DEFAULT], | |
99246c90 PE |
1660 | changequote([, ])dnl |
1661 | [case "$enableval" in | |
d0d88ce3 BK |
1662 | yes) enable_cshadow_headers=yes |
1663 | ;; | |
1664 | no) enable_cshadow_headers=no | |
1665 | ;; | |
1666 | *) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers]) | |
1667 | ;; | |
99246c90 | 1668 | esac], |
d0d88ce3 BK |
1669 | enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)dnl |
1670 | AC_MSG_RESULT($enable_cshadow_headers) | |
99246c90 | 1671 | dnl Option parsed, now set things appropriately |
d0d88ce3 | 1672 | case "$enable_cshadow_headers" in |
99246c90 | 1673 | yes) |
e95706d5 | 1674 | CSHADOWFLAGS="-D_GNU_SOURCE" |
5b80666b | 1675 | CSHADOW_INCLUDES=" -I$srcdir/shadow -I$blddir/cshadow" |
99246c90 PE |
1676 | ;; |
1677 | no) | |
5b80666b BK |
1678 | CSHADOWFLAGS="" |
1679 | CSHADOW_INCLUDES="" | |
99246c90 PE |
1680 | ;; |
1681 | esac | |
5b80666b BK |
1682 | |
1683 | AC_SUBST(CSHADOWFLAGS) | |
1684 | AC_SUBST(CSHADOW_INCLUDES) | |
1685 | AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes) | |
99246c90 | 1686 | ]) |
b2dad0e3 BK |
1687 | |
1688 | ||
af9fe0d1 BK |
1689 | # Check whether LC_MESSAGES is available in <locale.h>. |
1690 | # Ulrich Drepper <drepper@cygnus.com>, 1995. | |
1691 | # | |
1692 | # This file file be copied and used freely without restrictions. It can | |
1693 | # be used in projects which are not available under the GNU Public License | |
1694 | # but which still want to provide support for the GNU gettext functionality. | |
1695 | # Please note that the actual code is *not* freely available. | |
1696 | ||
1697 | # serial 1 | |
1698 | ||
1699 | AC_DEFUN(AC_LC_MESSAGES, | |
1700 | [if test $ac_cv_header_locale_h = yes; then | |
1701 | AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES, | |
1702 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | |
1703 | ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)]) | |
1704 | if test $ac_cv_val_LC_MESSAGES = yes; then | |
1705 | AC_DEFINE(HAVE_LC_MESSAGES) | |
1706 | fi | |
1707 | fi]) | |
1708 | ||
1709 | ||
1710 | # Check for functions in math library. | |
1711 | # Ulrich Drepper <drepper@cygnus.com>, 1998. | |
1712 | # | |
1713 | # This file can be copied and used freely without restrictions. It can | |
1714 | # be used in projects which are not available under the GNU Public License | |
1715 | # but which still want to provide support for the GNU gettext functionality. | |
1716 | # Please note that the actual code is *not* freely available. | |
1717 | ||
1718 | # serial 1 | |
1719 | ||
1720 | dnl AC_REPLACE_MATHFUNCS(FUNCTION...) | |
1721 | AC_DEFUN(AC_REPLACE_MATHFUNCS, | |
1722 | [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"]) | |
1723 | AC_SUBST(LIBMATHOBJS)dnl | |
1724 | ]) | |
1725 | ||
1726 | ||
1727 | # Check for string functions. | |
1728 | # Ulrich Drepper <drepper@cygnus.com>, 1998. | |
1729 | # | |
1730 | # This file can be copied and used freely without restrictions. It can | |
1731 | # be used in projects which are not available under the GNU Public License | |
1732 | # but which still want to provide support for the GNU gettext functionality. | |
1733 | # Please note that the actual code is *not* freely available. | |
1734 | ||
1735 | # serial 1 | |
1736 | ||
1737 | dnl AC_REPLACE_STRINGFUNCS(FUNCTION...) | |
1738 | AC_DEFUN(AC_REPLACE_STRINGFUNCS, | |
1739 | [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"]) | |
1740 | AC_SUBST(LIBSTRINGOBJS)dnl | |
1741 | ]) | |
b2dad0e3 BK |
1742 | |
1743 | # Do all the work for Automake. This macro actually does too much -- | |
1744 | # some checks are only needed if your package does certain things. | |
1745 | # But this isn't really a big deal. | |
1746 | ||
1747 | # serial 1 | |
1748 | ||
1749 | dnl Usage: | |
1750 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
1751 | ||
1752 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
1753 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
1754 | PACKAGE=[$1] | |
1755 | AC_SUBST(PACKAGE) | |
1756 | VERSION=[$2] | |
1757 | AC_SUBST(VERSION) | |
1758 | dnl test to see if srcdir already configured | |
1759 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
1760 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | |
1761 | fi | |
1762 | ifelse([$3],, | |
1763 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) | |
1764 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) | |
1765 | AC_REQUIRE([AM_SANITY_CHECK]) | |
1766 | AC_REQUIRE([AC_ARG_PROGRAM]) | |
1767 | dnl FIXME This is truly gross. | |
1768 | missing_dir=`cd $ac_aux_dir && pwd` | |
1769 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
1770 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
1771 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
1772 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
1773 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
1774 | AC_REQUIRE([AC_PROG_MAKE_SET])]) | |
1775 | ||
1776 | # | |
1777 | # Check to make sure that the build environment is sane. | |
1778 | # | |
1779 | ||
1780 | AC_DEFUN(AM_SANITY_CHECK, | |
1781 | [AC_MSG_CHECKING([whether build environment is sane]) | |
1782 | # Just in case | |
1783 | sleep 1 | |
1784 | echo timestamp > conftestfile | |
1785 | # Do `set' in a subshell so we don't clobber the current shell's | |
1786 | # arguments. Must try -L first in case configure is actually a | |
1787 | # symlink; some systems play weird games with the mod time of symlinks | |
1788 | # (eg FreeBSD returns the mod time of the symlink's containing | |
1789 | # directory). | |
1790 | if ( | |
1791 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
1792 | if test "[$]*" = "X"; then | |
1793 | # -L didn't work. | |
1794 | set X `ls -t $srcdir/configure conftestfile` | |
1795 | fi | |
1796 | if test "[$]*" != "X $srcdir/configure conftestfile" \ | |
1797 | && test "[$]*" != "X conftestfile $srcdir/configure"; then | |
1798 | ||
1799 | # If neither matched, then we have a broken ls. This can happen | |
1800 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
1801 | # broken ls alias from the environment. This has actually | |
1802 | # happened. Such a system could not be considered "sane". | |
1803 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
1804 | alias in your environment]) | |
1805 | fi | |
1806 | ||
1807 | test "[$]2" = conftestfile | |
1808 | ) | |
1809 | then | |
1810 | # Ok. | |
1811 | : | |
1812 | else | |
1813 | AC_MSG_ERROR([newly created file is older than distributed files! | |
1814 | Check your system clock]) | |
1815 | fi | |
1816 | rm -f conftest* | |
1817 | AC_MSG_RESULT(yes)]) | |
1818 | ||
1819 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
1820 | dnl The program must properly implement --version. | |
1821 | AC_DEFUN(AM_MISSING_PROG, | |
1822 | [AC_MSG_CHECKING(for working $2) | |
1823 | # Run test in a subshell; some versions of sh will print an error if | |
1824 | # an executable is not found, even if stderr is redirected. | |
1825 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
1826 | if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
1827 | $1=$2 | |
1828 | AC_MSG_RESULT(found) | |
1829 | else | |
1830 | $1="$3/missing $2" | |
1831 | AC_MSG_RESULT(missing) | |
1832 | fi | |
1833 | AC_SUBST($1)]) | |
1834 | ||
1835 | # Add --enable-maintainer-mode option to configure. | |
1836 | # From Jim Meyering | |
1837 | ||
1838 | # serial 1 | |
1839 | ||
1840 | AC_DEFUN(AM_MAINTAINER_MODE, | |
1841 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
1842 | dnl maintainer-mode is disabled by default | |
1843 | AC_ARG_ENABLE(maintainer-mode, | |
1844 | [ --enable-maintainer-mode enable make rules and dependencies not useful | |
1845 | (and sometimes confusing) to the casual installer], | |
1846 | USE_MAINTAINER_MODE=$enableval, | |
1847 | USE_MAINTAINER_MODE=no) | |
1848 | AC_MSG_RESULT($USE_MAINTAINER_MODE) | |
1849 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) | |
1850 | MAINT=$MAINTAINER_MODE_TRUE | |
1851 | AC_SUBST(MAINT)dnl | |
1852 | ] | |
1853 | ) | |
1854 | ||
1855 | # Define a conditional. | |
1856 | ||
1857 | AC_DEFUN(AM_CONDITIONAL, | |
1858 | [AC_SUBST($1_TRUE) | |
1859 | AC_SUBST($1_FALSE) | |
1860 | if $2; then | |
1861 | $1_TRUE= | |
1862 | $1_FALSE='#' | |
1863 | else | |
1864 | $1_TRUE='#' | |
1865 | $1_FALSE= | |
1866 | fi]) | |
1867 | ||
b2dad0e3 | 1868 | |
3840fa2a | 1869 | # serial 40 AC_PROG_LIBTOOL |
b2dad0e3 BK |
1870 | AC_DEFUN(AC_PROG_LIBTOOL, |
1871 | [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl | |
1872 | ||
1873 | # Save cache, so that ltconfig can load it | |
1874 | AC_CACHE_SAVE | |
1875 | ||
1876 | # Actually configure libtool. ac_aux_dir is where install-sh is found. | |
1877 | CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ | |
3840fa2a BK |
1878 | LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ |
1879 | LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ | |
1880 | DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ | |
b2dad0e3 | 1881 | ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ |
3840fa2a | 1882 | $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ |
b2dad0e3 BK |
1883 | || AC_MSG_ERROR([libtool configure failed]) |
1884 | ||
1885 | # Reload cache, that may have been modified by ltconfig | |
1886 | AC_CACHE_LOAD | |
1887 | ||
1888 | # This can be used to rebuild libtool when needed | |
1889 | LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" | |
1890 | ||
1891 | # Always use our own libtool. | |
1892 | LIBTOOL='$(SHELL) $(top_builddir)/libtool' | |
1893 | AC_SUBST(LIBTOOL)dnl | |
1894 | ||
1895 | # Redirect the config.log output again, so that the ltconfig log is not | |
1896 | # clobbered by the next message. | |
1897 | exec 5>>./config.log | |
1898 | ]) | |
1899 | ||
1900 | AC_DEFUN(AC_LIBTOOL_SETUP, | |
1901 | [AC_PREREQ(2.13)dnl | |
1902 | AC_REQUIRE([AC_ENABLE_SHARED])dnl | |
1903 | AC_REQUIRE([AC_ENABLE_STATIC])dnl | |
1904 | AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl | |
1905 | AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
1906 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl | |
1907 | AC_REQUIRE([AC_PROG_RANLIB])dnl | |
1908 | AC_REQUIRE([AC_PROG_CC])dnl | |
1909 | AC_REQUIRE([AC_PROG_LD])dnl | |
1910 | AC_REQUIRE([AC_PROG_NM])dnl | |
1911 | AC_REQUIRE([AC_PROG_LN_S])dnl | |
1912 | dnl | |
1913 | ||
3840fa2a BK |
1914 | case "$target" in |
1915 | NONE) lt_target="$host" ;; | |
1916 | *) lt_target="$target" ;; | |
1917 | esac | |
1918 | ||
b2dad0e3 BK |
1919 | # Check for any special flags to pass to ltconfig. |
1920 | libtool_flags="--cache-file=$cache_file" | |
1921 | test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" | |
1922 | test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" | |
1923 | test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" | |
1924 | test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" | |
1925 | test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" | |
3840fa2a BK |
1926 | ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], |
1927 | [libtool_flags="$libtool_flags --enable-dlopen"]) | |
1928 | ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], | |
1929 | [libtool_flags="$libtool_flags --enable-win32-dll"]) | |
1930 | AC_ARG_ENABLE(libtool-lock, | |
1931 | [ --disable-libtool-lock avoid locking (might break parallel builds)]) | |
1932 | test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" | |
1933 | test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" | |
b2dad0e3 BK |
1934 | |
1935 | # Some flags need to be propagated to the compiler or linker for good | |
1936 | # libtool support. | |
3840fa2a | 1937 | case "$lt_target" in |
b2dad0e3 BK |
1938 | *-*-irix6*) |
1939 | # Find out which ABI we are using. | |
1940 | echo '[#]line __oline__ "configure"' > conftest.$ac_ext | |
1941 | if AC_TRY_EVAL(ac_compile); then | |
1942 | case "`/usr/bin/file conftest.o`" in | |
1943 | *32-bit*) | |
1944 | LD="${LD-ld} -32" | |
1945 | ;; | |
1946 | *N32*) | |
1947 | LD="${LD-ld} -n32" | |
1948 | ;; | |
1949 | *64-bit*) | |
1950 | LD="${LD-ld} -64" | |
1951 | ;; | |
1952 | esac | |
1953 | fi | |
1954 | rm -rf conftest* | |
1955 | ;; | |
1956 | ||
1957 | *-*-sco3.2v5*) | |
1958 | # On SCO OpenServer 5, we need -belf to get full-featured binaries. | |
1959 | SAVE_CFLAGS="$CFLAGS" | |
1960 | CFLAGS="$CFLAGS -belf" | |
1961 | AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, | |
1962 | [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) | |
1963 | if test x"$lt_cv_cc_needs_belf" != x"yes"; then | |
1964 | # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf | |
1965 | CFLAGS="$SAVE_CFLAGS" | |
1966 | fi | |
1967 | ;; | |
1968 | ||
3840fa2a BK |
1969 | ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], |
1970 | [*-*-cygwin* | *-*-mingw*) | |
1971 | AC_CHECK_TOOL(DLLTOOL, dlltool, false) | |
1972 | AC_CHECK_TOOL(AS, as, false) | |
1973 | AC_CHECK_TOOL(OBJDUMP, objdump, false) | |
b2dad0e3 | 1974 | ;; |
3840fa2a | 1975 | ]) |
b2dad0e3 | 1976 | esac |
209fe19b BK |
1977 | ]) |
1978 | ||
3840fa2a BK |
1979 | # AC_LIBTOOL_DLOPEN - enable checks for dlopen support |
1980 | AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) | |
1981 | ||
1982 | # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's | |
1983 | AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) | |
b2dad0e3 BK |
1984 | |
1985 | # AC_ENABLE_SHARED - implement the --enable-shared flag | |
1986 | # Usage: AC_ENABLE_SHARED[(DEFAULT)] | |
1987 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
1988 | # `yes'. | |
3840fa2a BK |
1989 | AC_DEFUN(AC_ENABLE_SHARED, [dnl |
1990 | define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl | |
b2dad0e3 BK |
1991 | AC_ARG_ENABLE(shared, |
1992 | changequote(<<, >>)dnl | |
1993 | << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], | |
1994 | changequote([, ])dnl | |
1995 | [p=${PACKAGE-default} | |
1996 | case "$enableval" in | |
1997 | yes) enable_shared=yes ;; | |
1998 | no) enable_shared=no ;; | |
1999 | *) | |
2000 | enable_shared=no | |
2001 | # Look at the argument we got. We use all the common list separators. | |
2002 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
2003 | for pkg in $enableval; do | |
2004 | if test "X$pkg" = "X$p"; then | |
2005 | enable_shared=yes | |
2006 | fi | |
2007 | done | |
2008 | IFS="$ac_save_ifs" | |
2009 | ;; | |
2010 | esac], | |
2011 | enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl | |
2012 | ]) | |
2013 | ||
2014 | # AC_DISABLE_SHARED - set the default shared flag to --disable-shared | |
3840fa2a BK |
2015 | AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
2016 | AC_ENABLE_SHARED(no)]) | |
b2dad0e3 BK |
2017 | |
2018 | # AC_ENABLE_STATIC - implement the --enable-static flag | |
2019 | # Usage: AC_ENABLE_STATIC[(DEFAULT)] | |
2020 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
2021 | # `yes'. | |
3840fa2a BK |
2022 | AC_DEFUN(AC_ENABLE_STATIC, [dnl |
2023 | define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl | |
b2dad0e3 BK |
2024 | AC_ARG_ENABLE(static, |
2025 | changequote(<<, >>)dnl | |
2026 | << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], | |
2027 | changequote([, ])dnl | |
2028 | [p=${PACKAGE-default} | |
2029 | case "$enableval" in | |
2030 | yes) enable_static=yes ;; | |
2031 | no) enable_static=no ;; | |
2032 | *) | |
2033 | enable_static=no | |
2034 | # Look at the argument we got. We use all the common list separators. | |
2035 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
2036 | for pkg in $enableval; do | |
2037 | if test "X$pkg" = "X$p"; then | |
2038 | enable_static=yes | |
2039 | fi | |
2040 | done | |
2041 | IFS="$ac_save_ifs" | |
2042 | ;; | |
2043 | esac], | |
2044 | enable_static=AC_ENABLE_STATIC_DEFAULT)dnl | |
2045 | ]) | |
2046 | ||
2047 | # AC_DISABLE_STATIC - set the default static flag to --disable-static | |
3840fa2a BK |
2048 | AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
2049 | AC_ENABLE_STATIC(no)]) | |
b2dad0e3 BK |
2050 | |
2051 | ||
2052 | # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag | |
2053 | # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] | |
2054 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
2055 | # `yes'. | |
3840fa2a BK |
2056 | AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl |
2057 | define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl | |
b2dad0e3 BK |
2058 | AC_ARG_ENABLE(fast-install, |
2059 | changequote(<<, >>)dnl | |
2060 | << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], | |
2061 | changequote([, ])dnl | |
2062 | [p=${PACKAGE-default} | |
2063 | case "$enableval" in | |
2064 | yes) enable_fast_install=yes ;; | |
2065 | no) enable_fast_install=no ;; | |
2066 | *) | |
2067 | enable_fast_install=no | |
2068 | # Look at the argument we got. We use all the common list separators. | |
2069 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
2070 | for pkg in $enableval; do | |
2071 | if test "X$pkg" = "X$p"; then | |
2072 | enable_fast_install=yes | |
2073 | fi | |
2074 | done | |
2075 | IFS="$ac_save_ifs" | |
2076 | ;; | |
2077 | esac], | |
2078 | enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl | |
2079 | ]) | |
2080 | ||
2081 | # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install | |
3840fa2a BK |
2082 | AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
2083 | AC_ENABLE_FAST_INSTALL(no)]) | |
b2dad0e3 BK |
2084 | |
2085 | # AC_PROG_LD - find the path to the GNU or non-GNU linker | |
2086 | AC_DEFUN(AC_PROG_LD, | |
2087 | [AC_ARG_WITH(gnu-ld, | |
2088 | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], | |
2089 | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) | |
2090 | AC_REQUIRE([AC_PROG_CC])dnl | |
2091 | AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
2092 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl | |
2093 | ac_prog=ld | |
2094 | if test "$ac_cv_prog_gcc" = yes; then | |
2095 | # Check if gcc -print-prog-name=ld gives a path. | |
2096 | AC_MSG_CHECKING([for ld used by GCC]) | |
2097 | ac_prog=`($CC -print-prog-name=ld) 2>&5` | |
2098 | case "$ac_prog" in | |
2099 | # Accept absolute paths. | |
2100 | changequote(,)dnl | |
3840fa2a | 2101 | [\\/]* | [A-Za-z]:[\\/]*) |
b2dad0e3 BK |
2102 | re_direlt='/[^/][^/]*/\.\./' |
2103 | changequote([,])dnl | |
2104 | # Canonicalize the path of ld | |
2105 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` | |
2106 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do | |
2107 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` | |
2108 | done | |
2109 | test -z "$LD" && LD="$ac_prog" | |
2110 | ;; | |
2111 | "") | |
2112 | # If it fails, then pretend we aren't using GCC. | |
2113 | ac_prog=ld | |
2114 | ;; | |
2115 | *) | |
2116 | # If it is relative, then search for the first ld in PATH. | |
2117 | with_gnu_ld=unknown | |
2118 | ;; | |
2119 | esac | |
2120 | elif test "$with_gnu_ld" = yes; then | |
2121 | AC_MSG_CHECKING([for GNU ld]) | |
2122 | else | |
2123 | AC_MSG_CHECKING([for non-GNU ld]) | |
2124 | fi | |
2125 | AC_CACHE_VAL(ac_cv_path_LD, | |
2126 | [if test -z "$LD"; then | |
3840fa2a | 2127 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
b2dad0e3 BK |
2128 | for ac_dir in $PATH; do |
2129 | test -z "$ac_dir" && ac_dir=. | |
3840fa2a | 2130 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then |
b2dad0e3 BK |
2131 | ac_cv_path_LD="$ac_dir/$ac_prog" |
2132 | # Check to see if the program is GNU ld. I'd rather use --version, | |
2133 | # but apparently some GNU ld's only accept -v. | |
2134 | # Break only if it was the GNU/non-GNU ld that we prefer. | |
2135 | if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then | |
2136 | test "$with_gnu_ld" != no && break | |
2137 | else | |
2138 | test "$with_gnu_ld" != yes && break | |
2139 | fi | |
2140 | fi | |
2141 | done | |
2142 | IFS="$ac_save_ifs" | |
2143 | else | |
2144 | ac_cv_path_LD="$LD" # Let the user override the test with a path. | |
2145 | fi]) | |
2146 | LD="$ac_cv_path_LD" | |
2147 | if test -n "$LD"; then | |
2148 | AC_MSG_RESULT($LD) | |
2149 | else | |
2150 | AC_MSG_RESULT(no) | |
2151 | fi | |
2152 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) | |
2153 | AC_PROG_LD_GNU | |
2154 | ]) | |
2155 | ||
2156 | AC_DEFUN(AC_PROG_LD_GNU, | |
2157 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, | |
2158 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. | |
2159 | if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then | |
2160 | ac_cv_prog_gnu_ld=yes | |
2161 | else | |
2162 | ac_cv_prog_gnu_ld=no | |
2163 | fi]) | |
2164 | ]) | |
2165 | ||
2166 | # AC_PROG_NM - find the path to a BSD-compatible name lister | |
2167 | AC_DEFUN(AC_PROG_NM, | |
2168 | [AC_MSG_CHECKING([for BSD-compatible nm]) | |
2169 | AC_CACHE_VAL(ac_cv_path_NM, | |
2170 | [if test -n "$NM"; then | |
2171 | # Let the user override the test. | |
2172 | ac_cv_path_NM="$NM" | |
2173 | else | |
3840fa2a | 2174 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
b2dad0e3 BK |
2175 | for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do |
2176 | test -z "$ac_dir" && ac_dir=. | |
3840fa2a | 2177 | if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then |
b2dad0e3 BK |
2178 | # Check to see if the nm accepts a BSD-compat flag. |
2179 | # Adding the `sed 1q' prevents false positives on HP-UX, which says: | |
2180 | # nm: unknown option "B" ignored | |
2181 | if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then | |
2182 | ac_cv_path_NM="$ac_dir/nm -B" | |
2183 | break | |
2184 | elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then | |
2185 | ac_cv_path_NM="$ac_dir/nm -p" | |
2186 | break | |
2187 | else | |
2188 | ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but | |
2189 | continue # so that we can try to find one that supports BSD flags | |
2190 | fi | |
2191 | fi | |
2192 | done | |
2193 | IFS="$ac_save_ifs" | |
2194 | test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm | |
2195 | fi]) | |
2196 | NM="$ac_cv_path_NM" | |
2197 | AC_MSG_RESULT([$NM]) | |
2198 | ]) | |
2199 | ||
3840fa2a BK |
2200 | # AC_CHECK_LIBM - check for math library |
2201 | AC_DEFUN(AC_CHECK_LIBM, | |
b2dad0e3 | 2202 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl |
3840fa2a BK |
2203 | LIBM= |
2204 | case "$lt_target" in | |
2205 | *-*-beos* | *-*-cygwin*) | |
2206 | # These system don't have libm | |
b2dad0e3 | 2207 | ;; |
3840fa2a BK |
2208 | *-ncr-sysv4.3*) |
2209 | AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") | |
2210 | AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") | |
209fe19b | 2211 | ;; |
3840fa2a BK |
2212 | *) |
2213 | AC_CHECK_LIB(m, main, LIBM="-lm") | |
b2dad0e3 BK |
2214 | ;; |
2215 | esac | |
2216 | ]) | |
2217 | ||
2218 | # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for | |
2219 | # the libltdl convenience library, adds --enable-ltdl-convenience to | |
2220 | # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor | |
2221 | # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed | |
2222 | # to be `${top_builddir}/libltdl'. Make sure you start DIR with | |
2223 | # '${top_builddir}/' (note the single quotes!) if your package is not | |
2224 | # flat, and, if you're not using automake, define top_builddir as | |
2225 | # appropriate in the Makefiles. | |
3840fa2a | 2226 | AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
b2dad0e3 BK |
2227 | case "$enable_ltdl_convenience" in |
2228 | no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; | |
2229 | "") enable_ltdl_convenience=yes | |
2230 | ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; | |
2231 | esac | |
2232 | LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la | |
3840fa2a | 2233 | INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) |
b2dad0e3 BK |
2234 | ]) |
2235 | ||
2236 | # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for | |
2237 | # the libltdl installable library, and adds --enable-ltdl-install to | |
2238 | # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor | |
2239 | # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed | |
2240 | # to be `${top_builddir}/libltdl'. Make sure you start DIR with | |
2241 | # '${top_builddir}/' (note the single quotes!) if your package is not | |
2242 | # flat, and, if you're not using automake, define top_builddir as | |
2243 | # appropriate in the Makefiles. | |
2244 | # In the future, this macro may have to be called after AC_PROG_LIBTOOL. | |
3840fa2a BK |
2245 | AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl |
2246 | AC_CHECK_LIB(ltdl, main, | |
2247 | [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], | |
2248 | [if test x"$enable_ltdl_install" = xno; then | |
2249 | AC_MSG_WARN([libltdl not installed, but installation disabled]) | |
2250 | else | |
2251 | enable_ltdl_install=yes | |
2252 | fi | |
b2dad0e3 | 2253 | ]) |
3840fa2a BK |
2254 | if test x"$enable_ltdl_install" = x"yes"; then |
2255 | ac_configure_args="$ac_configure_args --enable-ltdl-install" | |
b2dad0e3 | 2256 | LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la |
3840fa2a BK |
2257 | INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) |
2258 | else | |
2259 | ac_configure_args="$ac_configure_args --enable-ltdl-install=no" | |
2260 | LIBLTDL="-lltdl" | |
2261 | INCLTDL= | |
b2dad0e3 BK |
2262 | fi |
2263 | ]) | |
2264 | ||
2265 | dnl old names | |
2266 | AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl | |
2267 | AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl | |
2268 | AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl | |
2269 | AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl | |
2270 | AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl | |
2271 | AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl | |
2272 | AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl | |
3840fa2a BK |
2273 | |
2274 | dnl This is just to silence aclocal about the macro not being used | |
2275 | ifelse([AC_DISABLE_FAST_INSTALL])dnl | |
b2dad0e3 BK |
2276 | |
2277 | # Like AC_CONFIG_HEADER, but automatically create stamp file. | |
2278 | ||
2279 | AC_DEFUN(AM_CONFIG_HEADER, | |
2280 | [AC_PREREQ([2.12]) | |
2281 | AC_CONFIG_HEADER([$1]) | |
2282 | dnl When config.status generates a header, we must update the stamp-h file. | |
2283 | dnl This file resides in the same directory as the config header | |
2284 | dnl that is generated. We must strip everything past the first ":", | |
2285 | dnl and everything past the last "/". | |
2286 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl | |
2287 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, | |
2288 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, | |
2289 | <<am_indx=1 | |
2290 | for am_file in <<$1>>; do | |
2291 | case " <<$>>CONFIG_HEADERS " in | |
2292 | *" <<$>>am_file "*<<)>> | |
2293 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx | |
2294 | ;; | |
2295 | esac | |
2296 | am_indx=`expr "<<$>>am_indx" + 1` | |
2297 | done<<>>dnl>>) | |
2298 | changequote([,]))]) | |
2299 |