]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/aclocal.m4
libstdc++-v3: New directory.
[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
169dnl Check to see if g++ can compile this library.
170dnl
171dnl Define OPTLEVEL='-O2' if new inlining code present.
172dnl
173dnl GLIBCPP_CHECK_COMPILER_VERSION
174AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
175 AC_MSG_CHECKING([for g++ that will successfullly compile this code])
176 AC_EGREP_CPP([ok], [
177 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
178 ok
179 #endif
180 ], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above"))
181 AC_MSG_RESULT($gpp_satisfactory)
182
183 AC_MSG_CHECKING([for g++ that supports new inlining mechanism])
184 AC_EGREP_CPP([ok], [
185 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
186 ok
187 #endif
188 ], [OPTLEVEL='-O2'
189 WERRORSUPPRESS=
190 ], [OPTLEVEL=
191 WERRORSUPPRESS=-Wno-error
192 ])
193 if test "$OPTLEVEL" = ""; then
194 AC_MSG_RESULT(no)
195 else
196 AC_MSG_RESULT(yes)
197 fi
198 AC_SUBST(OPTLEVEL)
199 AC_SUBST(WERRORSUPPRESS)
200])
201
202
203dnl
204dnl Check to see what builtin math functions are supported
205dnl
206dnl Define _GLIBCPP_HAS_BUILTIN_SINF if __builtin_sinf
207dnl Define _GLIBCPP_HAS_BUILTIN_COSF if __builtin_cosf
208dnl Define _GLIBCPP_HAS_BUILTIN_FABSF if __builtin_fabsf
209dnl Define _GLIBCPP_HAS_BUILTIN_SQRTF if __builtin_sqrtf
210dnl
211dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
212AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
213 dnl Test for builtin math functions.
214 AC_MSG_CHECKING([for __builtin_sinf])
215 AC_TRY_COMPILE([#include <math.h>],
216 [float foo(void) { __builtin_sinf(0.0); }],
217 use_builtin_sinf=yes, use_builtin_sinf=no)
218 AC_MSG_RESULT($use_builtin_sinf)
219 if test $use_builtin_sinf = "yes"; then
220 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_SINF)
221 fi
222
223 AC_MSG_CHECKING([for __builtin_cosf])
224 AC_TRY_COMPILE([#include <math.h>],
225 [float foo(void) { __builtin_cosf(0.0); }],
226 use_builtin_cosf=yes, use_builtin_cosf=no)
227 AC_MSG_RESULT($use_builtin_cosf)
228 if test $use_builtin_cosf = "yes"; then
229 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_COSF)
230 fi
231
232 AC_MSG_CHECKING([for __builtin_fabsf])
233 AC_TRY_COMPILE([#include <math.h>],
234 [float foo(void) { __builtin_fabsf(0.0); }],
235 use_builtin_fabsf=yes, use_builtin_fabsf=no)
236 AC_MSG_RESULT($use_builtin_fabsf)
237 if test $use_builtin_fabsf = "yes"; then
238 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_FABSF)
239 fi
240
241 AC_MSG_CHECKING([for __builtin_sqrtf])
242 AC_TRY_COMPILE([#include <math.h>],
243 [float foo(void) { __builtin_sqrtf(0.0); }],
244 use_builtin_sqrtf=yes, use_builtin_sqrtf=no)
245 AC_MSG_RESULT($use_builtin_sqrtf)
246 if test $use_builtin_sqrtf = "yes"; then
247 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_SQRTF)
248 fi
249])
250
251
252dnl
253dnl Check to see what architecture we are compiling for. If it's
254dnl supported, use special hand-crafted routines to provide thread
255dnl primitives.
256dnl
257dnl Depending on what is found, select various configure/cpu/*/atomicity.h
258dnl If not found, select configure/cpu/generic/atomicity.h
259dnl
260dnl GLIBCPP_CHECK_CPU
261AC_DEFUN(GLIBCPP_CHECK_CPU, [
262 AC_MSG_CHECKING([for cpu primitives directory])
263 case "$target_cpu" in
264 alpha*)
265 cpu_include_dir="config/cpu/alpha"
266 ;;
267 arm*)
268 cpu_include_dir="config/cpu/arm"
269 ;;
270 i486 | i586 | i686 | i786)
271 cpu_include_dir="config/cpu/i386"
272 ;;
273 powerpc | rs6000)
274 cpu_include_dir="config/cpu/powerpc"
275 ;;
276 sparc64 | ultrasparc)
277 cpu_include_dir="config/cpu/sparc/sparc64"
278 ;;
279 sparc*)
280 cpu_include_dir="config/cpu/sparc/sparc32"
281 ;;
282 *)
283 cpu_include_dir="config/cpu/generic"
284 ;;
285 esac
286 AC_MSG_RESULT($cpu_include_dir)
287 AC_SUBST(cpu_include_dir)
288])
289
290
291dnl
292dnl Check to see what the underlying c library's interface to ctype looks
293dnl like. Bits of locale rely on things like isspace, toupper, etc. This
294dnl stuff makes sure the right bits from the clibrary get called.
295dnl
296dnl Depending on what is found, select various configure/*/bits/ctype_base.h
297dnl Depending on what is found, select various configure/*/ctype.cc
298dnl
299dnl GLIBCPP_CHECK_CTYPE
300AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
301 AC_CHECK_HEADER(ctype.h, [
302
303 dnl If doesn't match any specified, go with defaults.
304 ctype_default=yes
305
306 dnl Test for <ctype> functionality -- gnu-linux
307 AC_MSG_CHECKING([for gnu-linux <ctype>])
308 AC_TRY_COMPILE([#include <ctype.h>],
309 [int
310 foo (int a)
311 { return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \
312 + _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \
313 + __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \
314 ctype_linux=yes, ctype_linux=no)
315 AC_MSG_RESULT($ctype_linux)
316 if test $ctype_linux = "yes"; then
317 ctype_include_dir="config/gnu-linux"
318 ctype_default=no
319 fi
320
321 dnl Test for <ctype> functionality -- solaris 2.6 and 2.7
322 if test $ctype_default = "yes"; then
323 AC_MSG_CHECKING([for solaris 2.6 or 2.7 <ctype>])
324 AC_TRY_COMPILE([#include <ctype.h>],
325 [int
326 foo (int a)
327 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
328 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
329 + __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \
330 ctype_solaris=yes, ctype_solaris=no)
331 AC_MSG_RESULT($ctype_solaris)
332
333 if test $ctype_solaris = "yes"; then
334 AC_MSG_CHECKING([ for version])
335 AC_LANG_CPLUSPLUS
336 AC_TRY_COMPILE([#include <ctype.h>],
337 [typedef long* __to_type; __to_type const& _M_toupper = __trans_upper;],\
338 ctype_solaris26=yes, ctype_solaris26=no)
339 AC_LANG_C
340 if test $ctype_solaris26 = "yes"; then
341 ctype_include_dir="config/solaris/solaris2.6"
342 AC_MSG_RESULT("solaris2.6")
343 ctype_default=no
344 else
345 ctype_include_dir="config/solaris/solaris2.7"
346 AC_MSG_RESULT("solaris2.7")
347 ctype_default=no
348 fi
349 fi
350 fi
351
352 dnl Test for <ctype> functionality -- solaris 2.5.1
353 if test $ctype_default = "yes"; then
354 AC_MSG_CHECKING([for solaris 2.5.1 <ctype>])
355 AC_TRY_COMPILE([#include <ctype.h>],
356 [int
357 foo (int a)
358 { return _U + _L + _N + _S + _P + _C + _X + _B \
359 + __ctype[a];}], \
360 ctype_solaris25=yes, ctype_solaris25=no)
361 AC_MSG_RESULT($ctype_solaris25)
362 if test $ctype_solaris25 = "yes"; then
363 ctype_include_dir="config/solaris/solaris2.5"
364 ctype_default=no
365 fi
366 fi
367
368 dnl Test for <ctype> functionality -- aix
369 if test $ctype_default = "yes"; then
370 AC_MSG_CHECKING([for aix <ctype>])
371 AC_TRY_COMPILE([#include <ctype.h>],
372 [int
373 foo (int a)
374 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
375 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
376 + _VALC('a') + _IS('c', 0);}], \
377 ctype_aix=yes, ctype_aix=no)
378 AC_MSG_RESULT($ctype_aix)
379 if test $ctype_aix = "yes"; then
380 ctype_include_dir="config/aix"
381 ctype_default=no
382 fi
383 fi
384
385 dnl Test for <ctype> functionality -- newlib
386 if test $ctype_default = "yes"; then
387 AC_MSG_CHECKING([for newlib <ctype>])
388 AC_TRY_COMPILE([#include <ctype.h>],
389 [int
390 foo (int a)
391 { return _U + _L + _N + _S + _P + _C + _X + _B \
392 + _ctype_[a];}], \
393 ctype_newlib=yes, ctype_newlib=no)
394 AC_MSG_RESULT($ctype_newlib)
395 if test $ctype_newlib = "yes"; then
396 ctype_include_dir="config/newlib"
397 ctype_default=no
398 fi
399 fi
400
401 if test $ctype_default = "yes"; then
402 ctype_include_dir="config/generic"
403 AC_MSG_WARN("Using default ctype headers.")
404 fi
405 AC_SUBST(ctype_include_dir)
406 ])
407])
408
409
410dnl
411dnl Check to see what the underlying c library or math library is like.
412dnl
413dnl Define HAVE_CARGF etc if "cargf" is found.
414dnl
415dnl GLIBCPP_CHECK_MATH_SUPPORT
416AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
417 AC_CHECK_LIB(m, sin, libm="-lm")
418 save_LIBS="$LIBS"
419 LIBS="$LIBS $libm"
420
421 dnl Check for complex versions of math functions of platform.
422 AC_CHECK_HEADERS([complex.h])
423 AC_REPLACE_MATHFUNCS(ccos ccosf ccosh ccoshf cexp cexpf c_log c_logf \
424 clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt csqrtf \
425 ctan ctanf ctanh ctanhf \
426 carg cargf nan hypot hypotf atan2f expf copysignf)
427
428 dnl We compile the long double complex functions only if the function
429 dnl provides the non-complex functions.
430 USE_LONG_DOUBLE=no
431 AC_CHECK_FUNC(sinl,
432 USE_LONG_DOUBLE=yes
433 AC_REPLACE_MATHFUNCS(ccoshl ccosl cexpl cpowl csinhl csinl \
434 csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l))
435 AC_SUBST(USE_LONG_DOUBLE)
436
437 dnl Check to see if basic C math functions have faster float versions.
438 AC_CHECK_FUNCS(modf isnan isnanf isnanl isinf isinff isinfl copysign \
439 copysignl cosf coshf logf log10f powf sinf sinhf sqrtf tanf tanhf \
440 strtof strtold fabsf sincos sincosf sincosl finite finite fqfinite \
441 fpclass qfpclass)
442
443#Some runtimes have these functions with a preceding underscore. Please
444# keep this sync'd with the one above. And if you add any new symbol,
445# please add the corresponding block in the @BOTTOM@ section of
446# acconfig.h.
447AC_CHECK_FUNCS(_modf _isnan _isnanf _isnanl _isinf _isinff _isinfl _copysign \
448_copysignl _cosf _coshf _logf _log10f _powf _sinf _sinhf _sqrtf _tanf _tanhf \
449_strtof _strtold _fabsf _sincos _sincosf _sincosl _finite _finitef _qfinite \
450_fpclass _qfpclass)
451
452LIBS="$save_LIBS"
453])
454
455
456dnl
457dnl Check to see if this target can enable the wchar_t parts of libstdc++.
458dnl
459dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
460dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h
461dnl Define _GLIBCPP_HAS_WCHAR_MIN_MAX if WCHAR_MIN, WCHAR_MAX in wchar.h
462dnl
463dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
464AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
465 AC_CHECK_HEADER(wchar.h,[
466 dnl Test wchar.h for mbstate_t, which is needed for char_traits and others.
467 AC_MSG_CHECKING([for native mbstate_t])
468 AC_TRY_COMPILE([#include <wchar.h>],
469 [mbstate_t teststate;],
470 use_native_mbstatet=yes, use_native_mbstatet=no)
471 AC_MSG_RESULT($use_native_mbstatet)
472 if test $use_native_mbstatet = "no"; then
473 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
474 fi
475
476 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
477 dnl numeric_limits can instantiate type_traits<wchar_t>
478 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
479 AC_TRY_COMPILE([#include <wchar.h>],
480 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
481 has_wchar_minmax=yes, has_wchar_minmax=no)
482 AC_MSG_RESULT($has_wchar_minmax)
483 if test $has_wchar_minmax = "yes"; then
484 AC_DEFINE(_GLIBCPP_HAS_WCHAR_MIN_MAX)
485 fi
486
487 # Test wchar.h for WEOF, which is what we use to determine whether
488 # to specialize for wchar_t or not.
489 AC_MSG_CHECKING([for WEOF])
490 AC_TRY_COMPILE([
491 #include <wchar.h>
492 #include <stddef.h>],
493 [wint_t i = WEOF;],
494 has_weof=yes, has_weof=no)
495 AC_MSG_RESULT($has_weof)
496
497 dnl Tests for wide character functions.
498 AC_REPLACE_STRINGFUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset)
499
500 AC_MSG_CHECKING([for wide character support])
501 if test $has_weof = "yes" && test $has_wchar_minmax = "yes"; then
502 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
503 AC_MSG_RESULT(ok)
504 else
505 AC_MSG_RESULT("not specializing for wchar_t")
506 fi
507 ],[
508 AC_MSG_WARN([<wchar.h> not found])
509 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
510 ])
511])
512
513
514dnl
515dnl Check to see if this version of GNU C++ is afflicted by bugs in
516dnl __complex__ float support.
517dnl
518dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
519dnl
520dnl GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT
521AC_DEFUN(GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT, [
522 AC_REQUIRE([AC_PROG_CXX])
523 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
524 AC_CACHE_VAL(glibcpp_cv_float_complex, [
525 AC_LANG_SAVE
526 AC_LANG_CPLUSPLUS
527 rm -f conftest.h
528 cat > conftest.h <<EOB
529 //
530 // Check for buggy __complex__ that causes ICE in most versions of egcs
531 // and gcc-2.95.x on certain platforms (eg., x86-win32).
532 //
533 // See http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00845.html for
534 // more info on the bug itself.
535 //
536 struct
537 float_complex
538 {
539 __complex__ float m_value;
540 float_complex (float = 0.0f, float = 0.0f);
541 float_complex (__complex__ float val) : m_value (val) {}
542 float_complex foo (const float_complex &val)
543 { return float_complex (~val.m_value); }
544 };
545EOB
546 AC_TRY_COMPILE([#include "conftest.h"], ,
547 glibcpp_cv_float_complex=ok,
548 glibcpp_cv_float_complex=buggy
549 )
550 AC_LANG_RESTORE
551 ])
552 AC_MSG_RESULT($glibcpp_cv_float_complex)
553 if test $glibcpp_cv_float_complex = buggy; then
554 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
555 fi
556])
557
558
559dnl
560dnl
561dnl Check to see if this version of GNU C++ is afflicted by bugs in
562dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
563dnl gcc-2.95.x when using the library, unless we define the default copy
564dnl ctor in the specializations of complex<>.
565dnl
566dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
567dnl
568dnl GLIBCPP_CHECK_COMPLEX_SUPPORT
569AC_DEFUN(GLIBCPP_CHECK_COMPLEX_SUPPORT, [
570 AC_REQUIRE([AC_PROG_CXX])
571 AC_MSG_CHECKING([for GNU C++ __complex__ support])
572 AC_CACHE_VAL(glibcpp_cv_complex, [
573 AC_LANG_SAVE
574 AC_LANG_CPLUSPLUS
575 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
576 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
577 [ dcomplex x; f(x); ],
578 glibcpp_cv_complex=ok,
579 glibcpp_cv_complex=buggy
580 )
581 AC_LANG_RESTORE
582 ])
583 AC_MSG_RESULT($glibcpp_cv_complex)
584 if test $glibcpp_cv_complex = buggy; then
585 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
586 fi
587])
588
589
590dnl
591dnl Check for certain special build configurations.
592dnl
593dnl GLIBCPP_ENABLE_DEBUG
594dnl --enable-debug sets '-ggdb -O0'.
595dnl --disable-debug sets '-g' and whatever optimization options the
596dnl compiler can handle.
597dnl + Perhaps --enable-maintainer-mode should automatically turn this on?
598dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
599dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
600dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
601dnl defaults to `no'.
602AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
603define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
604AC_ARG_ENABLE(debug,
605changequote(<<, >>)dnl
606<< --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
607changequote([, ])dnl
608[case "$enableval" in
609 yes) enable_debug=yes ;;
610 no) enable_debug=no ;;
611 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
612 esac],
613enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
614dnl Option parsed, now set things appropriately
615case "$enable_debug" in
616 yes) DEBUGFLAGS='-ggdb -O0'
617 ;;
618 no) DEBUGFLAGS='-g'
619 ;;
620esac
621AC_SUBST(DEBUGFLAGS)
622])
623
624
625dnl
626dnl Check for certain special build configurations.
627dnl
628dnl GLIBCPP_ENABLE_NAMESPACES
629dnl --enable-namespaces sets '-fhonor-std' and defines _GLIBCPP_USE_NAMESPACES
630dnl --disable-namespaces sets '-fno-honor-std' (the macro should be
631dnl undefined by default in whatever.h.in).
632dnl + Eventually, this will go away.
633dnl + Usage: GLIBCPP_ENABLE_NAMESPACES[(DEFAULT)]
634dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
635dnl defaults to `no'.
636AC_DEFUN(GLIBCPP_ENABLE_NAMESPACES, [dnl
637define([GLIBCPP_ENABLE_NAMESPACES_DEFAULT], ifelse($1, yes, yes, no))dnl
638AC_ARG_ENABLE(namespaces,
639changequote(<<, >>)dnl
640<< --enable-namespaces turns on 'std' [default=>>GLIBCPP_ENABLE_NAMESPACES_DEFAULT],
641changequote([, ])dnl
642[case "$enableval" in
643 yes) enable_namespaces=yes ;;
644 no) enable_namespaces=no ;;
645 *) AC_MSG_ERROR([Unknown argument to enable/disable namespaces]) ;;
646 esac],
647enable_namespaces=GLIBCPP_ENABLE_NAMESPACES_DEFAULT)dnl
648dnl Option parsed, now set things appropriately
649case "$enable_namespaces" in
650 yes) NAMESPACES='-fhonor-std'
651 AC_DEFINE(_GLIBCPP_USE_NAMESPACES)
652 ;;
653 no) NAMESPACES='-fno-honor-std'
654 ;;
655esac
656AC_SUBST(NAMESPACES)
657])
658
659
660dnl
661dnl Check for instructions to automatically rebuild libgcc.a. Requires,
662dnl of course, the location of the gcc objdir. Note that if --disable-
663dnl namespaces is in effect, rebuilding libgcc.a is an expensive no-op.
664dnl
665dnl GLIBCPP_ENABLE_RELIBGCC
666dnl --enable-libgcc-rebuild=/absolute/path/to/gcc/objdir sets GCC_OBJDIR
667dnl (presumably in the top-level Makefile) to /absol.../objdir
668dnl --disable-libgcc-rebuild will not touch libgcc.a at all (maybe print
669dnl a warning if this is given along with --enable-namespaces), by
670dnl setting GCC_OBJDIR to `no'.
671dnl + Doing this by default is going to be interesting. What default
672dnl "on" value can there be?
673dnl + Usage: GLIBCPP_ENABLE_RELIBGCC[(DEFAULT)]
674dnl The default path should be ../.. if bundled with GCC source.
675dnl If ommitted, it defaults to `no'.
676dnl
677AC_DEFUN(GLIBCPP_ENABLE_RELIBGCC, [dnl
678define([GLIBCPP_ENABLE_RELIBGCC_DEFAULT], ifelse($1,, no, $1))dnl
679AC_ARG_ENABLE(libgcc-rebuild,
680changequote(<<, >>)dnl
681<< --enable-libgcc-rebuild=DIR also rebuild libgcc.a; DIR is
682 the GCC objdir; see install.html>>,
683changequote([, ])dnl
684[case "$enableval" in
685 yes) AC_MSG_ERROR([--enable-libgcc-rebuild needs a pathname]) ;;
686 no) enable_libgcc_rebuild=no ;;
687 *) if test -d "$enableval" && test -d "${enableval}/gcc" && \
688 test -d "${enableval}/libiberty"
689 then
690 enable_libgcc_rebuild="$enableval"
691 else
692 AC_MSG_ERROR(["$enableval" does not appear to be the GCC objdir])
693 fi
694 ;;
695 esac],
696enable_libgcc_rebuild=GLIBCPP_ENABLE_RELIBGCC_DEFAULT)dnl
697GCC_OBJDIR="$enable_libgcc_rebuild"
698AC_SUBST(GCC_OBJDIR)
699])
700
701
702dnl
703dnl Check for certain special build configurations.
704dnl
705dnl GLIBCPP_ENABLE_CSTDIO
706dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
707dnl
708dnl default is libio
709dnl
710AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
711 AC_MSG_CHECKING([for cstdio to use])
712 AC_ARG_ENABLE(cstdio,
713 [ --enable-cstdio enable GNU libio for target io package. (default)
714 --enable-cstdio=LIB use LIB target-speific io package.],
715 if test x$enable_cstdio = xno; then
716 enable_cstdio=libio
717 fi,
718 enable_cstdio=libio)
719
720 enable_cstdio_flag=$enable_cstdio
721
722 dnl Check if a valid thread package
723 case x${enable_cstdio_flag} in
724 xlibio | x | xno | xnone | xyes)
725 # default
726 CSTDIO_H=c_io_libio.h
727 CSTDIO_CC=c_io_libio.cc
728 AC_MSG_RESULT(libio)
729
730 # see if we are on a system with libio native (ie, linux)
731 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
732 if test $has_libio = "yes"; then
733 BUILD_LIBIO_INCLUDE=
734 need_libio=no
735 else
736 BUILD_LIBIO_INCLUDE='-I../libio'
737 need_libio=yes
738 fi
739 AC_SUBST(BUILD_LIBIO_INCLUDE)
740 ;;
741 xwince)
742 CSTDIO_H=c_io_wince.h
743 CSTDIO_CC=c_io_wince.cc
744 AC_MSG_RESULT(wince)
745
746 need_libio=no
747 BUILD_LIBIO_INCLUDE=
748 AC_SUBST(BUILD_LIBIO_INCLUDE)
749 ;;
750 *)
751 echo "$enable_cstdio is an unknown io package" 1>&2
752 exit 1
753 ;;
754 esac
755 AC_SUBST(CSTDIO_H)
756 AC_SUBST(CSTDIO_CC)
757 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
758])
759
760
761dnl
762dnl Check for certain special build configurations.
763dnl
764dnl GLIBCPP_ENABLE_THREADS
765dnl --enable-threads=posix sets config/threads-posix.h et. al.
766dnl
767dnl default is no threads
768dnl
769AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
770 dnl Note this comes from the gcc/config.in and libjava/config.in
771 dnl Efforts should be made to keep this in sync.
772 AC_MSG_CHECKING([for threads package to use])
773 AC_ARG_ENABLE(threads,
774 [ --enable-threads enable thread usage for target GCC.
775 --enable-threads=LIB use LIB thread package for target GCC.],
776 if test x$enable_threads = xno; then
777 enable_threads=''
778 fi,
779 enable_threads='')
780
781 enable_threads_flag=$enable_threads
782
783 dnl Check if a valid thread package
784 case x${enable_threads_flag} in
785 x | xno | xnone)
786 # No threads
787 target_thread_file='single'
788 ;;
789 xyes)
790 # default
791 target_thread_file=''
792 ;;
793 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
794 xsolaris | xwin32 | xdce | xvxworks)
795 target_thread_file=$enable_threads_flag
796 ;;
797 *)
798 echo "$enable_threads is an unknown thread package" 1>&2
799 exit 1
800 ;;
801 esac
802
803 dnl Check for thread package actually supported in libstdc++
804 case "$target_thread_file" in
805 no | none | single)
806 THREADS=none
807 ;;
808 posix | pthreads)
809 THREADS=posix
810 case "$host" in
811 *-*-linux*)
812 ;;
813 esac
814 ;;
815 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
816 AC_MSG_ERROR(thread package $THREADS not yet supported)
817 ;;
818 *)
819 AC_MSG_ERROR($THREADS is an unknown thread package)
820 ;;
821 esac
822 AC_MSG_RESULT($THREADS)
823
824 THREADLIBS=
825 THREADINCS=
826 THREADDEPS=
827 THREADOBJS=
828 THREADH=
829 THREADSPEC=
830 case "$THREADS" in
831 posix)
832 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
833 THREADLIBS=-lpthread
834 THREADSPEC=-lpthread
835 dnl Not presently used
836 dnl THREADOBJS=threads-posix.lo
837 THREADH=threads-posix.h
838 ;;
839 none)
840 dnl Not presently used
841 dnl THREADOBJS=threads-no.lo
842 THREADH=threads-no.h
843 ;;
844 esac
845 AC_SUBST(THREADLIBS)
846 AC_SUBST(THREADINCS)
847 AC_SUBST(THREADDEPS)
848 AC_SUBST(THREADOBJS)
849 AC_SUBST(THREADSPEC)
850])
851
852
853dnl
854dnl Check for certain special build configurations.
855dnl
856dnl GLIBCPP_ENABLE_LONG_LONG
857dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
858dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
859dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
860dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
861dnl defaults to `no'.
862dnl
863dnl GLIBCPP_ENABLE_LONG_LONG
864AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
865 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
866 AC_ARG_ENABLE(long-long,
867 changequote(<<, >>)dnl
868 <<--enable-long_long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
869 changequote([, ])dnl
870 [case "$enableval" in
871 yes) enable_long_long=yes ;;
872 no) enable_long_long=no ;;
873 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
874 esac],
875 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
876 dnl Option parsed, now set things appropriately
877 case "$enable_long_long" in
878 yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
879 ;;
880 esac
881])
882
883
884
885
886
887
888
889
890
891
892
893
894
895# Do all the work for Automake. This macro actually does too much --
896# some checks are only needed if your package does certain things.
897# But this isn't really a big deal.
898
899# serial 1
900
901dnl Usage:
902dnl AM_INIT_AUTOMAKE(package,version, [no-define])
903
904AC_DEFUN(AM_INIT_AUTOMAKE,
905[AC_REQUIRE([AC_PROG_INSTALL])
906PACKAGE=[$1]
907AC_SUBST(PACKAGE)
908VERSION=[$2]
909AC_SUBST(VERSION)
910dnl test to see if srcdir already configured
911if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
912 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
913fi
914ifelse([$3],,
915AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
916AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
917AC_REQUIRE([AM_SANITY_CHECK])
918AC_REQUIRE([AC_ARG_PROGRAM])
919dnl FIXME This is truly gross.
920missing_dir=`cd $ac_aux_dir && pwd`
921AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
922AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
923AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
924AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
925AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
926AC_REQUIRE([AC_PROG_MAKE_SET])])
927
928#
929# Check to make sure that the build environment is sane.
930#
931
932AC_DEFUN(AM_SANITY_CHECK,
933[AC_MSG_CHECKING([whether build environment is sane])
934# Just in case
935sleep 1
936echo timestamp > conftestfile
937# Do `set' in a subshell so we don't clobber the current shell's
938# arguments. Must try -L first in case configure is actually a
939# symlink; some systems play weird games with the mod time of symlinks
940# (eg FreeBSD returns the mod time of the symlink's containing
941# directory).
942if (
943 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
944 if test "[$]*" = "X"; then
945 # -L didn't work.
946 set X `ls -t $srcdir/configure conftestfile`
947 fi
948 if test "[$]*" != "X $srcdir/configure conftestfile" \
949 && test "[$]*" != "X conftestfile $srcdir/configure"; then
950
951 # If neither matched, then we have a broken ls. This can happen
952 # if, for instance, CONFIG_SHELL is bash and it inherits a
953 # broken ls alias from the environment. This has actually
954 # happened. Such a system could not be considered "sane".
955 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
956alias in your environment])
957 fi
958
959 test "[$]2" = conftestfile
960 )
961then
962 # Ok.
963 :
964else
965 AC_MSG_ERROR([newly created file is older than distributed files!
966Check your system clock])
967fi
968rm -f conftest*
969AC_MSG_RESULT(yes)])
970
971dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
972dnl The program must properly implement --version.
973AC_DEFUN(AM_MISSING_PROG,
974[AC_MSG_CHECKING(for working $2)
975# Run test in a subshell; some versions of sh will print an error if
976# an executable is not found, even if stderr is redirected.
977# Redirect stdin to placate older versions of autoconf. Sigh.
978if ($2 --version) < /dev/null > /dev/null 2>&1; then
979 $1=$2
980 AC_MSG_RESULT(found)
981else
982 $1="$3/missing $2"
983 AC_MSG_RESULT(missing)
984fi
985AC_SUBST($1)])
986
987# Add --enable-maintainer-mode option to configure.
988# From Jim Meyering
989
990# serial 1
991
992AC_DEFUN(AM_MAINTAINER_MODE,
993[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
994 dnl maintainer-mode is disabled by default
995 AC_ARG_ENABLE(maintainer-mode,
996[ --enable-maintainer-mode enable make rules and dependencies not useful
997 (and sometimes confusing) to the casual installer],
998 USE_MAINTAINER_MODE=$enableval,
999 USE_MAINTAINER_MODE=no)
1000 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1001 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1002 MAINT=$MAINTAINER_MODE_TRUE
1003 AC_SUBST(MAINT)dnl
1004]
1005)
1006
1007# Define a conditional.
1008
1009AC_DEFUN(AM_CONDITIONAL,
1010[AC_SUBST($1_TRUE)
1011AC_SUBST($1_FALSE)
1012if $2; then
1013 $1_TRUE=
1014 $1_FALSE='#'
1015else
1016 $1_TRUE='#'
1017 $1_FALSE=
1018fi])
1019
1020# Check for functions in math library.
1021# Ulrich Drepper <drepper@cygnus.com>, 1998.
1022#
1023# This file can be copied and used freely without restrictions. It can
1024# be used in projects which are not available under the GNU Public License
1025# but which still want to provide support for the GNU gettext functionality.
1026# Please note that the actual code is *not* freely available.
1027
1028# serial 1
1029
1030dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1031AC_DEFUN(AC_REPLACE_MATHFUNCS,
1032[AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1033AC_SUBST(LIBMATHOBJS)dnl
1034])
1035
1036# Check for string functions.
1037# Ulrich Drepper <drepper@cygnus.com>, 1998.
1038#
1039# This file can be copied and used freely without restrictions. It can
1040# be used in projects which are not available under the GNU Public License
1041# but which still want to provide support for the GNU gettext functionality.
1042# Please note that the actual code is *not* freely available.
1043
1044# serial 1
1045
1046dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1047AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1048[AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1049AC_SUBST(LIBSTRINGOBJS)dnl
1050])
1051
1052
1053# serial 40 AC_PROG_LIBTOOL
1054AC_DEFUN(AC_PROG_LIBTOOL,
1055[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1056
1057# Save cache, so that ltconfig can load it
1058AC_CACHE_SAVE
1059
1060# Actually configure libtool. ac_aux_dir is where install-sh is found.
1061CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
1062LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1063LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
1064DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
1065${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
1066$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
1067|| AC_MSG_ERROR([libtool configure failed])
1068
1069# Reload cache, that may have been modified by ltconfig
1070AC_CACHE_LOAD
1071
1072# This can be used to rebuild libtool when needed
1073LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
1074
1075# Always use our own libtool.
1076LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1077AC_SUBST(LIBTOOL)dnl
1078
1079# Redirect the config.log output again, so that the ltconfig log is not
1080# clobbered by the next message.
1081exec 5>>./config.log
1082])
1083
1084AC_DEFUN(AC_LIBTOOL_SETUP,
1085[AC_PREREQ(2.13)dnl
1086AC_REQUIRE([AC_ENABLE_SHARED])dnl
1087AC_REQUIRE([AC_ENABLE_STATIC])dnl
1088AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1089AC_REQUIRE([AC_CANONICAL_HOST])dnl
1090AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1091AC_REQUIRE([AC_PROG_RANLIB])dnl
1092AC_REQUIRE([AC_PROG_CC])dnl
1093AC_REQUIRE([AC_PROG_LD])dnl
1094AC_REQUIRE([AC_PROG_NM])dnl
1095AC_REQUIRE([AC_PROG_LN_S])dnl
1096dnl
1097
1098case "$target" in
1099NONE) lt_target="$host" ;;
1100*) lt_target="$target" ;;
1101esac
1102
1103# Check for any special flags to pass to ltconfig.
1104libtool_flags="--cache-file=$cache_file"
1105test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1106test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1107test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
1108test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1109test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1110ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1111[libtool_flags="$libtool_flags --enable-dlopen"])
1112ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1113[libtool_flags="$libtool_flags --enable-win32-dll"])
1114AC_ARG_ENABLE(libtool-lock,
1115 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1116test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1117test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1118
1119# Some flags need to be propagated to the compiler or linker for good
1120# libtool support.
1121case "$lt_target" in
1122*-*-irix6*)
1123 # Find out which ABI we are using.
1124 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1125 if AC_TRY_EVAL(ac_compile); then
1126 case "`/usr/bin/file conftest.o`" in
1127 *32-bit*)
1128 LD="${LD-ld} -32"
1129 ;;
1130 *N32*)
1131 LD="${LD-ld} -n32"
1132 ;;
1133 *64-bit*)
1134 LD="${LD-ld} -64"
1135 ;;
1136 esac
1137 fi
1138 rm -rf conftest*
1139 ;;
1140
1141*-*-sco3.2v5*)
1142 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1143 SAVE_CFLAGS="$CFLAGS"
1144 CFLAGS="$CFLAGS -belf"
1145 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1146 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
1147 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1148 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1149 CFLAGS="$SAVE_CFLAGS"
1150 fi
1151 ;;
1152
1153ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1154[*-*-cygwin* | *-*-mingw*)
1155 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1156 AC_CHECK_TOOL(AS, as, false)
1157 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1158 ;;
1159])
1160esac
1161])
1162
1163# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1164AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1165
1166# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1167AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1168
1169# AC_ENABLE_SHARED - implement the --enable-shared flag
1170# Usage: AC_ENABLE_SHARED[(DEFAULT)]
1171# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1172# `yes'.
1173AC_DEFUN(AC_ENABLE_SHARED, [dnl
1174define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1175AC_ARG_ENABLE(shared,
1176changequote(<<, >>)dnl
1177<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1178changequote([, ])dnl
1179[p=${PACKAGE-default}
1180case "$enableval" in
1181yes) enable_shared=yes ;;
1182no) enable_shared=no ;;
1183*)
1184 enable_shared=no
1185 # Look at the argument we got. We use all the common list separators.
1186 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1187 for pkg in $enableval; do
1188 if test "X$pkg" = "X$p"; then
1189 enable_shared=yes
1190 fi
1191 done
1192 IFS="$ac_save_ifs"
1193 ;;
1194esac],
1195enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1196])
1197
1198# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1199AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1200AC_ENABLE_SHARED(no)])
1201
1202# AC_ENABLE_STATIC - implement the --enable-static flag
1203# Usage: AC_ENABLE_STATIC[(DEFAULT)]
1204# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1205# `yes'.
1206AC_DEFUN(AC_ENABLE_STATIC, [dnl
1207define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1208AC_ARG_ENABLE(static,
1209changequote(<<, >>)dnl
1210<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1211changequote([, ])dnl
1212[p=${PACKAGE-default}
1213case "$enableval" in
1214yes) enable_static=yes ;;
1215no) enable_static=no ;;
1216*)
1217 enable_static=no
1218 # Look at the argument we got. We use all the common list separators.
1219 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1220 for pkg in $enableval; do
1221 if test "X$pkg" = "X$p"; then
1222 enable_static=yes
1223 fi
1224 done
1225 IFS="$ac_save_ifs"
1226 ;;
1227esac],
1228enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1229])
1230
1231# AC_DISABLE_STATIC - set the default static flag to --disable-static
1232AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1233AC_ENABLE_STATIC(no)])
1234
1235
1236# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1237# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1238# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1239# `yes'.
1240AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1241define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1242AC_ARG_ENABLE(fast-install,
1243changequote(<<, >>)dnl
1244<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1245changequote([, ])dnl
1246[p=${PACKAGE-default}
1247case "$enableval" in
1248yes) enable_fast_install=yes ;;
1249no) enable_fast_install=no ;;
1250*)
1251 enable_fast_install=no
1252 # Look at the argument we got. We use all the common list separators.
1253 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1254 for pkg in $enableval; do
1255 if test "X$pkg" = "X$p"; then
1256 enable_fast_install=yes
1257 fi
1258 done
1259 IFS="$ac_save_ifs"
1260 ;;
1261esac],
1262enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1263])
1264
1265# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1266AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1267AC_ENABLE_FAST_INSTALL(no)])
1268
1269# AC_PROG_LD - find the path to the GNU or non-GNU linker
1270AC_DEFUN(AC_PROG_LD,
1271[AC_ARG_WITH(gnu-ld,
1272[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1273test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1274AC_REQUIRE([AC_PROG_CC])dnl
1275AC_REQUIRE([AC_CANONICAL_HOST])dnl
1276AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1277ac_prog=ld
1278if test "$ac_cv_prog_gcc" = yes; then
1279 # Check if gcc -print-prog-name=ld gives a path.
1280 AC_MSG_CHECKING([for ld used by GCC])
1281 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1282 case "$ac_prog" in
1283 # Accept absolute paths.
1284changequote(,)dnl
1285 [\\/]* | [A-Za-z]:[\\/]*)
1286 re_direlt='/[^/][^/]*/\.\./'
1287changequote([,])dnl
1288 # Canonicalize the path of ld
1289 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1290 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1291 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1292 done
1293 test -z "$LD" && LD="$ac_prog"
1294 ;;
1295 "")
1296 # If it fails, then pretend we aren't using GCC.
1297 ac_prog=ld
1298 ;;
1299 *)
1300 # If it is relative, then search for the first ld in PATH.
1301 with_gnu_ld=unknown
1302 ;;
1303 esac
1304elif test "$with_gnu_ld" = yes; then
1305 AC_MSG_CHECKING([for GNU ld])
1306else
1307 AC_MSG_CHECKING([for non-GNU ld])
1308fi
1309AC_CACHE_VAL(ac_cv_path_LD,
1310[if test -z "$LD"; then
1311 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1312 for ac_dir in $PATH; do
1313 test -z "$ac_dir" && ac_dir=.
1314 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1315 ac_cv_path_LD="$ac_dir/$ac_prog"
1316 # Check to see if the program is GNU ld. I'd rather use --version,
1317 # but apparently some GNU ld's only accept -v.
1318 # Break only if it was the GNU/non-GNU ld that we prefer.
1319 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1320 test "$with_gnu_ld" != no && break
1321 else
1322 test "$with_gnu_ld" != yes && break
1323 fi
1324 fi
1325 done
1326 IFS="$ac_save_ifs"
1327else
1328 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1329fi])
1330LD="$ac_cv_path_LD"
1331if test -n "$LD"; then
1332 AC_MSG_RESULT($LD)
1333else
1334 AC_MSG_RESULT(no)
1335fi
1336test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1337AC_PROG_LD_GNU
1338])
1339
1340AC_DEFUN(AC_PROG_LD_GNU,
1341[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1342[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1343if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1344 ac_cv_prog_gnu_ld=yes
1345else
1346 ac_cv_prog_gnu_ld=no
1347fi])
1348])
1349
1350# AC_PROG_NM - find the path to a BSD-compatible name lister
1351AC_DEFUN(AC_PROG_NM,
1352[AC_MSG_CHECKING([for BSD-compatible nm])
1353AC_CACHE_VAL(ac_cv_path_NM,
1354[if test -n "$NM"; then
1355 # Let the user override the test.
1356 ac_cv_path_NM="$NM"
1357else
1358 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1359 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1360 test -z "$ac_dir" && ac_dir=.
1361 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1362 # Check to see if the nm accepts a BSD-compat flag.
1363 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1364 # nm: unknown option "B" ignored
1365 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1366 ac_cv_path_NM="$ac_dir/nm -B"
1367 break
1368 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1369 ac_cv_path_NM="$ac_dir/nm -p"
1370 break
1371 else
1372 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1373 continue # so that we can try to find one that supports BSD flags
1374 fi
1375 fi
1376 done
1377 IFS="$ac_save_ifs"
1378 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1379fi])
1380NM="$ac_cv_path_NM"
1381AC_MSG_RESULT([$NM])
1382])
1383
1384# AC_CHECK_LIBM - check for math library
1385AC_DEFUN(AC_CHECK_LIBM,
1386[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1387LIBM=
1388case "$lt_target" in
1389*-*-beos* | *-*-cygwin*)
1390 # These system don't have libm
1391 ;;
1392*-ncr-sysv4.3*)
1393 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1394 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1395 ;;
1396*)
1397 AC_CHECK_LIB(m, main, LIBM="-lm")
1398 ;;
1399esac
1400])
1401
1402# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1403# the libltdl convenience library, adds --enable-ltdl-convenience to
1404# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1405# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1406# to be `${top_builddir}/libltdl'. Make sure you start DIR with
1407# '${top_builddir}/' (note the single quotes!) if your package is not
1408# flat, and, if you're not using automake, define top_builddir as
1409# appropriate in the Makefiles.
1410AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1411 case "$enable_ltdl_convenience" in
1412 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1413 "") enable_ltdl_convenience=yes
1414 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1415 esac
1416 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1417 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1418])
1419
1420# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1421# the libltdl installable library, and adds --enable-ltdl-install to
1422# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1423# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1424# to be `${top_builddir}/libltdl'. Make sure you start DIR with
1425# '${top_builddir}/' (note the single quotes!) if your package is not
1426# flat, and, if you're not using automake, define top_builddir as
1427# appropriate in the Makefiles.
1428# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1429AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1430 AC_CHECK_LIB(ltdl, main,
1431 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1432 [if test x"$enable_ltdl_install" = xno; then
1433 AC_MSG_WARN([libltdl not installed, but installation disabled])
1434 else
1435 enable_ltdl_install=yes
1436 fi
1437 ])
1438 if test x"$enable_ltdl_install" = x"yes"; then
1439 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1440 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1441 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1442 else
1443 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1444 LIBLTDL="-lltdl"
1445 INCLTDL=
1446 fi
1447])
1448
1449dnl old names
1450AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1451AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1452AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1453AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1454AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1455AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1456AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1457
1458dnl This is just to silence aclocal about the macro not being used
1459ifelse([AC_DISABLE_FAST_INSTALL])dnl
1460
1461# Like AC_CONFIG_HEADER, but automatically create stamp file.
1462
1463AC_DEFUN(AM_CONFIG_HEADER,
1464[AC_PREREQ([2.12])
1465AC_CONFIG_HEADER([$1])
1466dnl When config.status generates a header, we must update the stamp-h file.
1467dnl This file resides in the same directory as the config header
1468dnl that is generated. We must strip everything past the first ":",
1469dnl and everything past the last "/".
1470AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1471ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1472<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1473<<am_indx=1
1474for am_file in <<$1>>; do
1475 case " <<$>>CONFIG_HEADERS " in
1476 *" <<$>>am_file "*<<)>>
1477 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1478 ;;
1479 esac
1480 am_indx=`expr "<<$>>am_indx" + 1`
1481done<<>>dnl>>)
1482changequote([,]))])
1483
1484# Check whether LC_MESSAGES is available in <locale.h>.
1485# Ulrich Drepper <drepper@cygnus.com>, 1995.
1486#
1487# This file file be copied and used freely without restrictions. It can
1488# be used in projects which are not available under the GNU Public License
1489# but which still want to provide support for the GNU gettext functionality.
1490# Please note that the actual code is *not* freely available.
1491
1492# serial 1
1493
1494AC_DEFUN(AC_LC_MESSAGES,
1495 [if test $ac_cv_header_locale_h = yes; then
1496 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1497 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1498 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1499 if test $ac_cv_val_LC_MESSAGES = yes; then
1500 AC_DEFINE(HAVE_LC_MESSAGES)
1501 fi
1502 fi])
1503