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