]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/aclocal.m4
std_cwctype.h: Clean.
[thirdparty/gcc.git] / libstdc++-v3 / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 dnl
14 dnl Initialize configure bits.
15 dnl
16 dnl Define OPTLEVEL='-O2' if new inlining code present.
17 dnl
18 dnl GLIBCPP_CONFIGURE
19 AC_DEFUN(GLIBCPP_CONFIGURE, [
20 dnl Default to --enable-multilib
21 AC_ARG_ENABLE(multilib,
22 [ --enable-multilib build hella library versions (default)],
23 [case "${enableval}" in
24 yes) multilib=yes ;;
25 no) multilib=no ;;
26 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
27 esac], [multilib=yes])dnl
28
29 dnl We may get other options which we dont document:
30 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
31 if test "[$]{srcdir}" = "."; then
32 if test "[$]{with_target_subdir}" != "."; then
33 glibcpp_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
34 else
35 glibcpp_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
36 fi
37 else
38 glibcpp_basedir="[$]{srcdir}/$1"
39 fi
40 AC_SUBST(glibcpp_basedir)
41
42 AC_CANONICAL_HOST
43
44 AM_INIT_AUTOMAKE(libstdc++, 2.90.8)
45
46 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
47 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
48 # are probably using a cross compiler, which will not be able to fully
49 # link an executable. This should really be fixed in autoconf
50 # itself.
51
52 AC_DEFUN(LIB_AC_PROG_CC,
53 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
54 dnl Fool anybody using AC_PROG_CC.
55 AC_PROVIDE([AC_PROG_CC])
56 AC_CHECK_PROG(CC, gcc, gcc)
57 if test -z "$CC"; then
58 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
59 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
60 fi
61
62 AC_PROG_CC_GNU
63
64 if test $ac_cv_prog_gcc = yes; then
65 GCC=yes
66 dnl Check whether -g works, even if CFLAGS is set, in case the package
67 dnl plays around with CFLAGS (such as to build both debugging and
68 dnl normal versions of a library), tasteless as that idea is.
69 ac_test_CFLAGS="${CFLAGS+set}"
70 ac_save_CFLAGS="$CFLAGS"
71 CFLAGS=
72 AC_PROG_CC_G
73 if test "$ac_test_CFLAGS" = set; then
74 CFLAGS="$ac_save_CFLAGS"
75 elif test $ac_cv_prog_cc_g = yes; then
76 CFLAGS="-g -O2"
77 else
78 CFLAGS="-O2"
79 fi
80 else
81 GCC=
82 test "${CFLAGS+set}" = set || CFLAGS="-g"
83 fi
84 ])
85
86 LIB_AC_PROG_CC
87
88 # Likewise for AC_PROG_CXX.
89 AC_DEFUN(LIB_AC_PROG_CXX,
90 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
91 dnl Fool anybody using AC_PROG_CXX.
92 AC_PROVIDE([AC_PROG_CXX])
93 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
94 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
95
96 AC_PROG_CXX_GNU
97
98 if test $ac_cv_prog_gxx = yes; then
99 GXX=yes
100 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
101 dnl plays around with CXXFLAGS (such as to build both debugging and
102 dnl normal versions of a library), tasteless as that idea is.
103 ac_test_CXXFLAGS="${CXXFLAGS+set}"
104 ac_save_CXXFLAGS="$CXXFLAGS"
105 CXXFLAGS=
106 AC_PROG_CXX_G
107 if test "$ac_test_CXXFLAGS" = set; then
108 CXXFLAGS="$ac_save_CXXFLAGS"
109 elif test $ac_cv_prog_cxx_g = yes; then
110 CXXFLAGS="-g -O2"
111 else
112 CXXFLAGS="-O2"
113 fi
114 else
115 GXX=
116 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
117 fi
118 ])
119
120 LIB_AC_PROG_CXX
121
122 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we dont
123 # run it explicitly here, it will be run implicitly before
124 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
125 # be run before AC_CANONICAL_HOST.
126 AC_CANONICAL_BUILD
127
128 AC_CHECK_TOOL(AS, as)
129 AC_CHECK_TOOL(AR, ar)
130 AC_CHECK_TOOL(RANLIB, ranlib, :)
131
132 AC_PROG_INSTALL
133
134 AM_MAINTAINER_MODE
135
136 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
137 # at least currently, we never actually build a program, so we never
138 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
139 # fails, because we are probably configuring with a cross compiler
140 # which cant create executables. So we include AC_EXEEXT to keep
141 # automake happy, but we dont execute it, since we dont care about
142 # the result.
143 if false; then
144 AC_EXEEXT
145 fi
146
147 # configure.host sets the following important variables
148 # glibcpp_cflags - host specific C compiler flags
149 # glibcpp_cxxflags - host specific C++ compiler flags
150
151 glibcpp_cflags=
152 glibcpp_cxxflags=
153
154 . [$]{glibcpp_basedir}/configure.host
155
156 case [$]{glibcpp_basedir} in
157 /* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
158 *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
159 esac
160
161 GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
162 GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
163 AC_SUBST(GLIBCPP_CFLAGS)
164 AC_SUBST(GLIBCPP_CXXFLAGS)
165 ])
166
167
168 dnl
169 dnl Check to see if g++ can compile this library, and if so, if any version-
170 dnl specific precautions need to be taken. In particular, test for
171 dnl newer compiler features, or features that are present in newer
172 dnl compiler version but not older compiler versions should be placed
173 dnl here.
174 dnl
175 dnl Define FMTFLAGS='-fdiagnostics-show-location=once' if possible
176 dnl Define WERROR='-Werror' if possible; g++'s that lack the new inlining
177 dnl code or the new system_header pragma will die. Other options dealing
178 dnl with warnings, errors, and compiler complaints may be folded into
179 dnl the WERROR variable.
180 dnl
181 dnl GLIBCPP_CHECK_COMPILER_VERSION
182 AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
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
192 # Sanity check that g++ is capable of dealing with v-3.
193 AC_MSG_CHECKING([for g++ that will successfully compile this code])
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
201 # Check for pragma system_header.
202 AC_MSG_CHECKING([for g++ that supports pragma system_header])
203 CXXFLAGS='-Wunknown-pragmas -Werror'
204 AC_TRY_COMPILE([#pragma system_header], [int foo;
205 ], [ac_newpragma=yes], [ac_newpragma=no])
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
212 if test "$ac_newpragma" = "no"; then
213 WERROR="$WERROR -Wno-unknown-pragmas"
214 fi
215 AC_MSG_RESULT($ac_newpragma)
216
217 # Check for more sophisticated diagnostic control.
218 AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once])
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
229 FMTFLAGS='-fdiagnostics-show-location=once'
230 fi
231 AC_MSG_RESULT($ac_gabydiags)
232
233 AC_LANG_RESTORE
234 AC_SUBST(WERROR)
235 AC_SUBST(FMTFLAGS)
236 ])
237
238
239 dnl
240 dnl Check to see what builtin math functions are supported
241 dnl
242 dnl Define _GLIBCPP_HAS_BUILTIN_SINF if __builtin_sinf
243 dnl Define _GLIBCPP_HAS_BUILTIN_COSF if __builtin_cosf
244 dnl Define _GLIBCPP_HAS_BUILTIN_FABSF if __builtin_fabsf
245 dnl Define _GLIBCPP_HAS_BUILTIN_SQRTF if __builtin_sqrtf
246 dnl
247 dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
248 AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
249 dnl Test for builtin math functions.
250 AC_MSG_CHECKING([for __builtin_sinf])
251 AC_TRY_COMPILE([#include <math.h>],
252 [float foo(void) { __builtin_sinf(0.0); }],
253 use_builtin_sinf=yes, use_builtin_sinf=no)
254 AC_MSG_RESULT($use_builtin_sinf)
255 if test $use_builtin_sinf = "yes"; then
256 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_SINF)
257 fi
258
259 AC_MSG_CHECKING([for __builtin_cosf])
260 AC_TRY_COMPILE([#include <math.h>],
261 [float foo(void) { __builtin_cosf(0.0); }],
262 use_builtin_cosf=yes, use_builtin_cosf=no)
263 AC_MSG_RESULT($use_builtin_cosf)
264 if test $use_builtin_cosf = "yes"; then
265 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_COSF)
266 fi
267
268 AC_MSG_CHECKING([for __builtin_fabsf])
269 AC_TRY_COMPILE([#include <math.h>],
270 [float foo(void) { __builtin_fabsf(0.0); }],
271 use_builtin_fabsf=yes, use_builtin_fabsf=no)
272 AC_MSG_RESULT($use_builtin_fabsf)
273 if test $use_builtin_fabsf = "yes"; then
274 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_FABSF)
275 fi
276
277 AC_MSG_CHECKING([for __builtin_sqrtf])
278 AC_TRY_COMPILE([#include <math.h>],
279 [float foo(void) { __builtin_sqrtf(0.0); }],
280 use_builtin_sqrtf=yes, use_builtin_sqrtf=no)
281 AC_MSG_RESULT($use_builtin_sqrtf)
282 if test $use_builtin_sqrtf = "yes"; then
283 AC_DEFINE(_GLIBCPP_HAS_BUILTIN_SQRTF)
284 fi
285 ])
286
287
288 dnl Check to see what architecture we are compiling for. If it's
289 dnl supported, use special hand-crafted routines to provide thread
290 dnl primitives. Also, if architecture-specific flags are required for
291 dnl compilation, add them here.
292 dnl
293 dnl Depending on what is found, select configure/cpu/*/bits/atomicity.h
294 dnl If not found, select configure/cpu/generic/bits/atomicity.h
295 dnl
296 dnl GLIBCPP_CHECK_CPU
297 AC_DEFUN(GLIBCPP_CHECK_CPU, [
298 AC_MSG_CHECKING([for cpu primitives directory])
299 CPUFLAGS=
300 case "$target_cpu" in
301 alpha*)
302 cpu_include_dir="config/cpu/alpha"
303 ;;
304 arm*)
305 cpu_include_dir="config/cpu/arm"
306 ;;
307 i386)
308 cpu_include_dir="config/cpu/i386"
309 ;;
310 i486 | i586 | i686 | i786)
311 cpu_include_dir="config/cpu/i486"
312 ;;
313 powerpc | rs6000)
314 cpu_include_dir="config/cpu/powerpc"
315 CPUFLAGS='-mcpu=powerpc'
316 ;;
317 sparc64 | ultrasparc)
318 cpu_include_dir="config/cpu/sparc/sparc64"
319 ;;
320 sparc*)
321 cpu_include_dir="config/cpu/sparc/sparc32"
322 ;;
323 *)
324 cpu_include_dir="config/cpu/generic"
325 ;;
326 esac
327 AC_MSG_RESULT($cpu_include_dir)
328 AC_SUBST(cpu_include_dir)
329 AC_SUBST(CPUFLAGS)
330 ])
331
332
333 dnl
334 dnl Check to see what the underlying c library's interface to ctype looks
335 dnl like. Bits of locale rely on things like isspace, toupper, etc. This
336 dnl stuff makes sure the right bits from the clibrary get called.
337 dnl
338 dnl Depending on what is found, select various configure/*/bits/ctype_base.h
339 dnl Depending on what is found, select various configure/*/ctype.cc
340 dnl
341 dnl GLIBCPP_CHECK_CTYPE
342 AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
343 AC_CHECK_HEADER(ctype.h, [
344
345 dnl If doesn't match any specified, go with defaults.
346 ctype_default=yes
347
348 dnl Test for <ctype> functionality -- gnu-linux
349 AC_MSG_CHECKING([<ctype> for gnu-linux ])
350 AC_TRY_COMPILE([#include <ctype.h>],
351 [int
352 foo (int a)
353 { return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \
354 + _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \
355 + __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \
356 ctype_linux=yes, ctype_linux=no)
357 AC_MSG_RESULT($ctype_linux)
358 if test $ctype_linux = "yes"; then
359 ctype_include_dir="config/gnu-linux"
360 ctype_default=no
361 fi
362
363 dnl Test for <ctype> functionality -- FreeBSD 4.0
364 if test $ctype_default = "yes"; then
365 AC_MSG_CHECKING([<ctype> for freebsd 4.0 ])
366 AC_TRY_COMPILE([#include <ctype.h>],
367 [int
368 foo (int a)
369 { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
370 + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \
371 ctype_bsd=yes, ctype_bsd=no)
372 AC_MSG_RESULT($ctype_bsd)
373 if test $ctype_bsd = "yes"; then
374 ctype_include_dir="config/bsd"
375 ctype_default=no
376 fi
377 fi
378
379 dnl Test for <ctype> functionality -- FreeBSD 3.4
380 if test $ctype_default = "yes"; then
381 AC_MSG_CHECKING([<ctype> for freebsd 3.4 ])
382 AC_TRY_COMPILE([#include <ctype.h>],
383 [int
384 foo (int a)
385 { return _S + _R + _C + _U + _L + _A \
386 + _D + _P + _X + _G + __istype (a, 0);}], \
387 ctype_freebsd34=yes, ctype_freebsd34=no)
388 AC_MSG_RESULT($ctype_freebsd34)
389 if test $ctype_freebsd34 = "yes"; then
390 ctype_include_dir="config/bsd"
391 ctype_default=no
392 fi
393 fi
394
395 dnl Test for <ctype> functionality -- solaris 2.6 and 2.7
396 if test $ctype_default = "yes"; then
397 AC_MSG_CHECKING([<ctype> for solaris 2.[6,7,8] ])
398 AC_TRY_COMPILE([#include <ctype.h>],
399 [int
400 foo (int a)
401 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
402 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
403 + __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \
404 ctype_solaris=yes, ctype_solaris=no)
405 AC_MSG_RESULT($ctype_solaris)
406
407 if test $ctype_solaris = "yes"; then
408 AC_MSG_CHECKING([ for version])
409 AC_LANG_CPLUSPLUS
410 AC_TRY_COMPILE([#include <ctype.h>],
411 [typedef long* __to_type; __to_type const& _M_toupper = __trans_upper;],\
412 ctype_solaris26=yes, ctype_solaris26=no)
413 AC_LANG_C
414 if test $ctype_solaris26 = "yes"; then
415 ctype_include_dir="config/solaris/solaris2.6"
416 AC_MSG_RESULT("solaris2.6")
417 ctype_default=no
418 else
419 ctype_include_dir="config/solaris/solaris2.7"
420 AC_MSG_RESULT("solaris2.[7,8]")
421 ctype_default=no
422 fi
423 fi
424 fi
425
426 dnl Test for <ctype> functionality -- solaris 2.5.1
427 if test $ctype_default = "yes"; then
428 AC_MSG_CHECKING([<ctype> for solaris 2.5.1 ])
429 AC_TRY_COMPILE([#include <ctype.h>],
430 [int
431 foo (int a)
432 { return _U + _L + _N + _S + _P + _C + _X + _B \
433 + __ctype[a];}], \
434 ctype_solaris25=yes, ctype_solaris25=no)
435 AC_MSG_RESULT($ctype_solaris25)
436 if test $ctype_solaris25 = "yes"; then
437 ctype_include_dir="config/solaris/solaris2.5"
438 ctype_default=no
439 fi
440 fi
441
442 dnl Test for <ctype> functionality -- aix
443 if test $ctype_default = "yes"; then
444 AC_MSG_CHECKING([<ctype> for aix ])
445 AC_TRY_COMPILE([#include <ctype.h>],
446 [int
447 foo (int a)
448 { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
449 + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
450 + _VALC('a') + _IS('c', 0);}], \
451 ctype_aix=yes, ctype_aix=no)
452 AC_MSG_RESULT($ctype_aix)
453 if test $ctype_aix = "yes"; then
454 ctype_include_dir="config/aix"
455 ctype_default=no
456 fi
457 fi
458
459 dnl Test for <ctype> functionality -- newlib
460 if test $ctype_default = "yes"; then
461 AC_MSG_CHECKING([<ctype> for newlib ])
462 AC_TRY_COMPILE([#include <ctype.h>],
463 [int
464 foo (int a)
465 { return _U + _L + _N + _S + _P + _C + _X + _B \
466 + _ctype_[a];}], \
467 ctype_newlib=yes, ctype_newlib=no)
468 AC_MSG_RESULT($ctype_newlib)
469 if test $ctype_newlib = "yes"; then
470 ctype_include_dir="config/newlib"
471 ctype_default=no
472 fi
473 fi
474
475 if test $ctype_default = "yes"; then
476 ctype_include_dir="config/generic"
477 AC_MSG_WARN("Using default ctype headers.")
478 fi
479 AC_SUBST(ctype_include_dir)
480 ])
481 ])
482
483
484 dnl
485 dnl Check to see what the underlying c library or math library is like.
486 dnl
487 dnl Define HAVE_CARGF etc if "cargf" is found.
488 dnl
489 dnl GLIBCPP_CHECK_MATH_SUPPORT
490 AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
491 AC_CHECK_LIB(m, sin, libm="-lm")
492 save_LIBS="$LIBS"
493 LIBS="$LIBS $libm"
494
495 dnl Check for complex versions of math functions of platform.
496 AC_CHECK_HEADERS([complex.h])
497 AC_REPLACE_MATHFUNCS(ccos ccosf ccosh ccoshf cexp cexpf c_log c_logf \
498 clog10 clog10f cpow cpowf csin csinf csinh csinhf csqrt csqrtf \
499 ctan ctanf ctanh ctanhf \
500 carg cargf nan hypot hypotf atan2f expf copysignf)
501
502 dnl We compile the long double complex functions only if the function
503 dnl provides the non-complex long double functions.
504 USE_LONG_DOUBLE=no
505 AC_CHECK_FUNC(copysignl,
506 USE_LONG_DOUBLE=yes
507 AC_REPLACE_MATHFUNCS(ccoshl ccosl cexpl cpowl csinhl csinl \
508 csqrtl ctanhl ctanl cargl hypotl signbitl c_logl clog10l))
509 AC_SUBST(USE_LONG_DOUBLE)
510
511 dnl Check to see if basic C math functions have faster float versions.
512 AC_CHECK_FUNCS(modf isnan isnanf isnanl isinf isinff isinfl copysign \
513 copysignl cosf coshf logf log10f powf sinf sinhf sqrtf tanf tanhf \
514 strtof strtold fabsf sincos sincosf sincosl finite finite fqfinite \
515 fpclass qfpclass)
516
517 #Some runtimes have these functions with a preceding underscore. Please
518 # keep this sync'd with the one above. And if you add any new symbol,
519 # please add the corresponding block in the @BOTTOM@ section of
520 # acconfig.h.
521 AC_CHECK_FUNCS(_modf _isnan _isnanf _isnanl _isinf _isinff _isinfl _copysign \
522 _copysignl _cosf _coshf _logf _log10f _powf _sinf _sinhf _sqrtf _tanf _tanhf \
523 _strtof _strtold _fabsf _sincos _sincosf _sincosl _finite _finitef _qfinite \
524 _fpclass _qfpclass)
525
526 LIBS="$save_LIBS"
527 ])
528
529
530 dnl
531 dnl Check to see if this target can enable the wchar_t parts of libstdc++.
532 dnl
533 dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
534 dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h
535 dnl
536 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
537 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
538
539 dnl Sanity check for existence of ISO C9X headers for extended encoding.
540 AC_CHECK_HEADER(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
541 AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
542
543 dnl Only continue checking if the ISO C9X headers exist.
544 if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then
545
546 dnl Test wchar.h for mbstate_t, which is needed for char_traits and others.
547 AC_MSG_CHECKING([for mbstate_t])
548 AC_TRY_COMPILE([#include <wchar.h>],
549 [mbstate_t teststate;],
550 use_native_mbstatet=yes, use_native_mbstatet=no)
551 AC_MSG_RESULT($use_native_mbstatet)
552 if test x"$use_native_mbstatet" = xno; then
553 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
554 fi
555
556 dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
557 dnl numeric_limits can instantiate type_traits<wchar_t>
558 AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
559 AC_TRY_COMPILE([#include <wchar.h>],
560 [int i = WCHAR_MIN; int j = WCHAR_MAX;],
561 has_wchar_minmax=yes, has_wchar_minmax=no)
562 AC_MSG_RESULT($has_wchar_minmax)
563
564 dnl Test wchar.h for WEOF, which is what we use to determine whether
565 dnl to specialize for char_traits<wchar_t> or not.
566 AC_MSG_CHECKING([for WEOF])
567 AC_TRY_COMPILE([
568 #include <wchar.h>
569 #include <stddef.h>],
570 [wint_t i = WEOF;],
571 has_weof=yes, has_weof=no)
572 AC_MSG_RESULT($has_weof)
573
574 dnl Tests for wide character functions used in char_traits<wchar_t>.
575 AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset, ac_wfuncs=yes, ac_wfuncs=no)
576
577 AC_MSG_CHECKING([for ISO C9X wchar_t support])
578 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes && test x"$ac_wfuncs" = xyes; then
579 ac_isoC9X_wchar_t=yes
580 else
581 ac_isoC9X_wchar_t=no
582 fi
583 AC_MSG_RESULT($ac_isoC9X_wchar_t)
584
585 dnl Use iconv for wchar_t to char conversions. As such, check for
586 dnl X/Open Portability Guide, version 2 features (XPG2).
587 AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
588 AC_CHECK_FUNCS(iconv_open iconv_close iconv, ac_XPG2funcs=yes, ac_XPG2funcs=no)
589
590 AC_MSG_CHECKING([for XPG2 wchar_t support])
591 if test x"$ac_has_iconv_h" = xyes && test x"$ac_XPG2funcs" = xyes; then
592 ac_XPG2_wchar_t=yes
593 else
594 ac_XPG2_wchar_t=no
595 fi
596 AC_MSG_RESULT($ac_XPG2_wchar_t)
597
598 dnl At the moment, only enable wchar_t specializations if all the
599 dnl above support is present.
600 AC_MSG_CHECKING([for enabled wchar_t specializations])
601 if test x"$ac_isoC9X_wchar_t" = xyes && test x"$ac_XPG2_wchar_t" = xyes; then
602 libinst_wstring_la="libinst-wstring.la"
603 AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
604 AC_MSG_RESULT("yes")
605 else
606 libinst_wstring_la=""
607 AC_MSG_RESULT("no")
608 fi
609 AC_SUBST(libinst_wstring_la)
610
611 else
612 AC_MSG_WARN([<wchar.h> not found])
613 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
614 fi
615 ])
616
617
618 dnl
619 dnl Check to see if this version of GNU C++ is afflicted by bugs in
620 dnl __complex__ float support.
621 dnl
622 dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
623 dnl
624 dnl GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT
625 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT, [
626 AC_REQUIRE([AC_PROG_CXX])
627 AC_MSG_CHECKING([for GNU C++ __complex__ float support])
628 AC_CACHE_VAL(glibcpp_cv_float_complex, [
629 AC_LANG_SAVE
630 AC_LANG_CPLUSPLUS
631 rm -f conftest.h
632 cat > conftest.h <<EOB
633 //
634 // Check for buggy __complex__ that causes ICE in most versions of egcs
635 // and gcc-2.95.x on certain platforms (eg., x86-win32).
636 //
637 // See http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00845.html for
638 // more info on the bug itself.
639 //
640 struct
641 float_complex
642 {
643 __complex__ float m_value;
644 float_complex (float = 0.0f, float = 0.0f);
645 float_complex (__complex__ float val) : m_value (val) {}
646 float_complex foo (const float_complex &val)
647 { return float_complex (~val.m_value); }
648 };
649 EOB
650 AC_TRY_COMPILE([#include "conftest.h"], ,
651 glibcpp_cv_float_complex=ok,
652 glibcpp_cv_float_complex=buggy
653 )
654 AC_LANG_RESTORE
655 ])
656 AC_MSG_RESULT($glibcpp_cv_float_complex)
657 if test $glibcpp_cv_float_complex = buggy; then
658 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
659 fi
660 ])
661
662
663 dnl
664 dnl
665 dnl Check to see if this version of GNU C++ is afflicted by bugs in
666 dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
667 dnl gcc-2.95.x when using the library, unless we define the default copy
668 dnl ctor in the specializations of complex<>.
669 dnl
670 dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
671 dnl
672 dnl GLIBCPP_CHECK_COMPLEX_SUPPORT
673 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_SUPPORT, [
674 AC_REQUIRE([AC_PROG_CXX])
675 AC_MSG_CHECKING([for GNU C++ __complex__ support])
676 AC_CACHE_VAL(glibcpp_cv_complex, [
677 AC_LANG_SAVE
678 AC_LANG_CPLUSPLUS
679 AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
680 dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
681 [ dcomplex x; f(x); ],
682 glibcpp_cv_complex=ok,
683 glibcpp_cv_complex=buggy
684 )
685 AC_LANG_RESTORE
686 ])
687 AC_MSG_RESULT($glibcpp_cv_complex)
688 if test $glibcpp_cv_complex = buggy; then
689 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
690 fi
691 ])
692
693
694 dnl
695 dnl Check for special debugging mode; not for production use.
696 dnl
697 dnl GLIBCPP_ENABLE_DEBUG
698 dnl --enable-debug sets '-ggdb -O0'.
699 dnl --disable-debug sets '-g' and whatever optimization options the
700 dnl compiler can handle.
701 dnl + Perhaps --enable-maintainer-mode should automatically turn this on?
702 dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...?
703 dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
704 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
705 dnl defaults to `no'.
706 AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
707 define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
708 AC_ARG_ENABLE(debug,
709 changequote(<<, >>)dnl
710 << --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
711 changequote([, ])dnl
712 [case "$enableval" in
713 yes) enable_debug=yes ;;
714 no) enable_debug=no ;;
715 *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
716 esac],
717 enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
718 dnl Option parsed, now set things appropriately
719 case "$enable_debug" in
720 yes)
721 DEBUGFLAGS='-O0 -ggdb'
722 ;;
723 no)
724 DEBUGFLAGS='-g'
725 ;;
726 esac
727 AC_SUBST(DEBUGFLAGS)
728 ])
729
730
731 dnl
732 dnl Check for "unusual" flags to pass to the compiler while building.
733 dnl
734 dnl GLIBCPP_ENABLE_CXX_FLAGS
735 dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
736 dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
737 dnl Somehow this same set of flags must be passed when [re]building
738 dnl libgcc.
739 dnl --disable-cxx-flags passes nothing.
740 dnl + See http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00131.html
741 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q2/msg00284.html
742 dnl http://sourceware.cygnus.com/ml/libstdc++/2000-q1/msg00035.html
743 dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
744 dnl If "default flags" is an empty string (or "none"), the effect is
745 dnl the same as --disable or --enable=no.
746 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
747 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
748 AC_ARG_ENABLE(cxx-flags,
749 changequote(<<, >>)dnl
750 << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
751 [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
752 changequote([, ])dnl
753 [case "x$enableval" in
754 xyes) AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
755 xno|x) enable_cxx_flags='' ;;
756 *) enable_cxx_flags="$enableval" ;;
757 esac],
758 enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')dnl
759 dnl Thinko on my part during design. This kludge is the workaround.
760 if test "$enable_cxx_flags" = "none"; then enable_cxx_flags=''; fi
761 dnl Run through flags (either default or command-line) and set anything
762 dnl extra (e.g., #defines) that must accompany particular g++ options.
763 if test -n "$enable_cxx_flags"; then
764 for f in $enable_cxx_flags; do
765 case "$f" in
766 -fhonor-std) ;;
767 -*) ;;
768 *) # and we're trying to pass /what/ exactly?
769 AC_MSG_ERROR([compiler flags start with a -]) ;;
770 esac
771 done
772 fi
773 EXTRA_CXX_FLAGS="$enable_cxx_flags"
774 AC_SUBST(EXTRA_CXX_FLAGS)
775 ])
776
777
778 dnl
779 dnl Check for instructions to automatically rebuild libgcc.a. Requires,
780 dnl of course, the location of the gcc objdir. Note that if --disable-
781 dnl namespaces is in effect, rebuilding libgcc.a is an expensive no-op.
782 dnl
783 dnl GLIBCPP_ENABLE_RELIBGCC
784 dnl --enable-libgcc-rebuild=/absolute/path/to/gcc/objdir sets GCC_OBJDIR
785 dnl (presumably in the top-level Makefile) to /absol.../objdir
786 dnl --disable-libgcc-rebuild will not touch libgcc.a at all (maybe print
787 dnl a warning if this is given along with --enable-namespaces), by
788 dnl setting GCC_OBJDIR to `no'.
789 dnl + Doing this by default is going to be interesting. What default
790 dnl "on" value can there be?
791 dnl + Usage: GLIBCPP_ENABLE_RELIBGCC[(DEFAULT)]
792 dnl The default path should be ../.. if bundled with GCC source.
793 dnl If ommitted, it defaults to `no'.
794 dnl
795 AC_DEFUN(GLIBCPP_ENABLE_RELIBGCC, [dnl
796 define([GLIBCPP_ENABLE_RELIBGCC_DEFAULT], ifelse($1,, no, $1))dnl
797 AC_ARG_ENABLE(libgcc-rebuild,
798 changequote(<<, >>)dnl
799 << --enable-libgcc-rebuild=DIR also rebuild libgcc.a; DIR is
800 the GCC objdir; see install.html>>,
801 changequote([, ])dnl
802 [case "$enableval" in
803 yes) AC_MSG_ERROR([--enable-libgcc-rebuild needs a pathname]) ;;
804 no) enable_libgcc_rebuild=no ;;
805 *) if test -d "$enableval" && test -d "${enableval}/gcc" && \
806 test -d "${enableval}/libiberty"
807 then
808 enable_libgcc_rebuild="$enableval"
809 else
810 AC_MSG_ERROR(["$enableval" does not appear to be the GCC objdir])
811 fi
812 ;;
813 esac],
814 enable_libgcc_rebuild=GLIBCPP_ENABLE_RELIBGCC_DEFAULT)dnl
815 GCC_OBJDIR="$enable_libgcc_rebuild"
816 AC_SUBST(GCC_OBJDIR)
817 ])
818
819
820 dnl
821 dnl Check for which I/O library to use: libio, or something specific.
822 dnl
823 dnl GLIBCPP_ENABLE_CSTDIO
824 dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
825 dnl
826 dnl default is libio
827 dnl
828 AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
829 AC_MSG_CHECKING([for cstdio to use])
830 AC_ARG_ENABLE(cstdio,
831 [ --enable-cstdio enable GNU libio for target io package. (default)
832 --enable-cstdio=LIB use LIB target-speific io package.],
833 if test x$enable_cstdio = xno; then
834 enable_cstdio=libio
835 fi,
836 enable_cstdio=libio)
837
838 enable_cstdio_flag=$enable_cstdio
839
840 dnl Check if a valid thread package
841 case x${enable_cstdio_flag} in
842 xlibio | x | xno | xnone | xyes)
843 # default
844 CSTDIO_H=c_io_libio.h
845 CSTDIO_CC=c_io_libio.cc
846 AC_MSG_RESULT(libio)
847
848 # see if we are on a system with libio native (ie, linux)
849 AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
850 if test $has_libio = "yes"; then
851 BUILD_LIBIO_INCLUDE=
852 need_libio=no
853 else
854 BUILD_LIBIO_INCLUDE='-I../libio'
855 need_libio=yes
856 fi
857 AC_SUBST(BUILD_LIBIO_INCLUDE)
858
859 # see if the _G_config.h header needs to be built.
860 # NB: This replaces the _G_CONFIG_H machinery in libio-v2
861 AC_CHECK_HEADER(_G_config.h, has_gconf_h=yes, has_gconf_h=no)
862 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO_CONFIG_H, test "$has_gconf_h" = no)
863 ;;
864 xwince)
865 CSTDIO_H=c_io_wince.h
866 CSTDIO_CC=c_io_wince.cc
867 AC_MSG_RESULT(wince)
868
869 need_libio=no
870 BUILD_LIBIO_INCLUDE=
871 AC_SUBST(BUILD_LIBIO_INCLUDE)
872 ;;
873 *)
874 echo "$enable_cstdio is an unknown io package" 1>&2
875 exit 1
876 ;;
877 esac
878 AC_SUBST(CSTDIO_H)
879 AC_SUBST(CSTDIO_CC)
880 AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
881 ])
882
883
884 dnl
885 dnl Check for which threading library to use.
886 dnl
887 dnl GLIBCPP_ENABLE_THREADS
888 dnl --enable-threads=posix sets config/threads-posix.h et. al.
889 dnl
890 dnl default is no threads
891 dnl
892 AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
893 dnl Note this comes from the gcc/config.in and libjava/config.in
894 dnl Efforts should be made to keep this in sync.
895 AC_MSG_CHECKING([for threads package to use])
896 AC_ARG_ENABLE(threads,
897 [ --enable-threads enable thread usage for target GCC.
898 --enable-threads=LIB use LIB thread package for target GCC.],
899 if test x$enable_threads = xno; then
900 enable_threads=''
901 fi,
902 enable_threads='')
903
904 enable_threads_flag=$enable_threads
905
906 dnl Check if a valid thread package
907 case x${enable_threads_flag} in
908 x | xno | xnone)
909 # No threads
910 target_thread_file='single'
911 ;;
912 xyes)
913 # default
914 target_thread_file=''
915 ;;
916 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
917 xsolaris | xwin32 | xdce | xvxworks)
918 target_thread_file=$enable_threads_flag
919 ;;
920 *)
921 echo "$enable_threads is an unknown thread package" 1>&2
922 exit 1
923 ;;
924 esac
925
926 dnl Check for thread package actually supported in libstdc++
927 case "$target_thread_file" in
928 no | none | single)
929 THREADS=none
930 ;;
931 posix | pthreads)
932 THREADS=posix
933 case "$host" in
934 *-*-linux*)
935 ;;
936 esac
937 ;;
938 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
939 AC_MSG_ERROR(thread package $THREADS not yet supported)
940 ;;
941 *)
942 AC_MSG_ERROR($THREADS is an unknown thread package)
943 ;;
944 esac
945 AC_MSG_RESULT($THREADS)
946
947 THREADLIBS=
948 THREADINCS=
949 THREADDEPS=
950 THREADOBJS=
951 THREADH=
952 THREADSPEC=
953 case "$THREADS" in
954 posix)
955 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
956 THREADLIBS=-lpthread
957 THREADSPEC=-lpthread
958 dnl Not presently used
959 dnl THREADOBJS=threads-posix.lo
960 THREADH=threads-posix.h
961 ;;
962 none)
963 dnl Not presently used
964 dnl THREADOBJS=threads-no.lo
965 THREADH=threads-no.h
966 ;;
967 esac
968 AC_SUBST(THREADLIBS)
969 AC_SUBST(THREADINCS)
970 AC_SUBST(THREADDEPS)
971 AC_SUBST(THREADOBJS)
972 AC_SUBST(THREADSPEC)
973 ])
974
975
976 dnl
977 dnl Check for template specializations for the 'long long' type extension.
978 dnl
979 dnl GLIBCPP_ENABLE_LONG_LONG
980 dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
981 dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
982 dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
983 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
984 dnl defaults to `no'.
985 dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
986 dnl
987 dnl GLIBCPP_ENABLE_LONG_LONG
988 AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
989 define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
990
991 AC_ARG_ENABLE(long-long,
992 changequote(<<, >>)dnl
993 <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
994 changequote([, ])dnl
995 [case "$enableval" in
996 yes) enable_long_long=yes ;;
997 no) enable_long_long=no ;;
998 *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
999 esac],
1000 enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
1001
1002 # Check for the existance of functions used if long long is enabled.
1003 AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
1004 AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
1005
1006 AC_MSG_CHECKING([for enabled long long])
1007 if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
1008 enable_long_long=no;
1009 fi;
1010 AC_MSG_RESULT($enable_long_long)
1011
1012 dnl Option parsed, now set things appropriately
1013 case "$enable_long_long" in
1014 yes) AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
1015 ;;
1016 esac
1017 ])
1018
1019
1020 dnl
1021 dnl Check for whether or not to do shadowed C headers.
1022 dnl
1023 dnl GLIBCPP_ENABLE_SHADOW
1024 dnl --enable-cshadow-headers [does stuff].
1025 dnl --disable-cshadow-headers [does not do stuff].
1026 dnl + This will eventually need to be on by default.
1027 dnl + Usage: GLIBCPP_ENABLE_SHADOW[(DEFAULT)]
1028 dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
1029 dnl defaults to `no'.
1030 AC_DEFUN(GLIBCPP_ENABLE_SHADOW, [dnl
1031 define([GLIBCPP_ENABLE_SHADOW_DEFAULT], ifelse($1, yes, yes, no))dnl
1032 AC_MSG_CHECKING([for enabled cshadow headers])
1033 AC_ARG_ENABLE(cshadow-headers,
1034 changequote(<<, >>)dnl
1035 << --enable-cshadow-headers construct "shadowed" C header files for
1036 g++ [default=>>GLIBCPP_ENABLE_SHADOW_DEFAULT],
1037 changequote([, ])dnl
1038 [case "$enableval" in
1039 yes) enable_cshadow_headers=yes
1040 ;;
1041 no) enable_cshadow_headers=no
1042 ;;
1043 *) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
1044 ;;
1045 esac],
1046 enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)dnl
1047 AC_MSG_RESULT($enable_cshadow_headers)
1048 dnl Option parsed, now set things appropriately
1049 case "$enable_cshadow_headers" in
1050 yes)
1051 CSHADOWFLAGS="-D_ISOC9X_SOURCE"
1052 CSHADOW_INCLUDES=" -I$srcdir/shadow -I$blddir/cshadow"
1053 ;;
1054 no)
1055 CSHADOWFLAGS=""
1056 CSHADOW_INCLUDES=""
1057 ;;
1058 esac
1059
1060 AC_SUBST(CSHADOWFLAGS)
1061 AC_SUBST(CSHADOW_INCLUDES)
1062 AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
1063 ])
1064
1065
1066 # Check whether LC_MESSAGES is available in <locale.h>.
1067 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1068 #
1069 # This file file be copied and used freely without restrictions. It can
1070 # be used in projects which are not available under the GNU Public License
1071 # but which still want to provide support for the GNU gettext functionality.
1072 # Please note that the actual code is *not* freely available.
1073
1074 # serial 1
1075
1076 AC_DEFUN(AC_LC_MESSAGES,
1077 [if test $ac_cv_header_locale_h = yes; then
1078 AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
1079 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1080 ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
1081 if test $ac_cv_val_LC_MESSAGES = yes; then
1082 AC_DEFINE(HAVE_LC_MESSAGES)
1083 fi
1084 fi])
1085
1086
1087 # Check for functions in math library.
1088 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1089 #
1090 # This file can be copied and used freely without restrictions. It can
1091 # be used in projects which are not available under the GNU Public License
1092 # but which still want to provide support for the GNU gettext functionality.
1093 # Please note that the actual code is *not* freely available.
1094
1095 # serial 1
1096
1097 dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
1098 AC_DEFUN(AC_REPLACE_MATHFUNCS,
1099 [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])
1100 AC_SUBST(LIBMATHOBJS)dnl
1101 ])
1102
1103
1104 # Check for string functions.
1105 # Ulrich Drepper <drepper@cygnus.com>, 1998.
1106 #
1107 # This file can be copied and used freely without restrictions. It can
1108 # be used in projects which are not available under the GNU Public License
1109 # but which still want to provide support for the GNU gettext functionality.
1110 # Please note that the actual code is *not* freely available.
1111
1112 # serial 1
1113
1114 dnl AC_REPLACE_STRINGFUNCS(FUNCTION...)
1115 AC_DEFUN(AC_REPLACE_STRINGFUNCS,
1116 [AC_CHECK_FUNCS([$1], , [LIBSTRINGOBJS="$LIBSTRINGOBJS ${ac_func}.lo"])
1117 AC_SUBST(LIBSTRINGOBJS)dnl
1118 ])
1119
1120 # Do all the work for Automake. This macro actually does too much --
1121 # some checks are only needed if your package does certain things.
1122 # But this isn't really a big deal.
1123
1124 # serial 1
1125
1126 dnl Usage:
1127 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
1128
1129 AC_DEFUN(AM_INIT_AUTOMAKE,
1130 [AC_REQUIRE([AC_PROG_INSTALL])
1131 PACKAGE=[$1]
1132 AC_SUBST(PACKAGE)
1133 VERSION=[$2]
1134 AC_SUBST(VERSION)
1135 dnl test to see if srcdir already configured
1136 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1137 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1138 fi
1139 ifelse([$3],,
1140 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1141 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
1142 AC_REQUIRE([AM_SANITY_CHECK])
1143 AC_REQUIRE([AC_ARG_PROGRAM])
1144 dnl FIXME This is truly gross.
1145 missing_dir=`cd $ac_aux_dir && pwd`
1146 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
1147 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
1148 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
1149 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
1150 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
1151 AC_REQUIRE([AC_PROG_MAKE_SET])])
1152
1153 #
1154 # Check to make sure that the build environment is sane.
1155 #
1156
1157 AC_DEFUN(AM_SANITY_CHECK,
1158 [AC_MSG_CHECKING([whether build environment is sane])
1159 # Just in case
1160 sleep 1
1161 echo timestamp > conftestfile
1162 # Do `set' in a subshell so we don't clobber the current shell's
1163 # arguments. Must try -L first in case configure is actually a
1164 # symlink; some systems play weird games with the mod time of symlinks
1165 # (eg FreeBSD returns the mod time of the symlink's containing
1166 # directory).
1167 if (
1168 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1169 if test "[$]*" = "X"; then
1170 # -L didn't work.
1171 set X `ls -t $srcdir/configure conftestfile`
1172 fi
1173 if test "[$]*" != "X $srcdir/configure conftestfile" \
1174 && test "[$]*" != "X conftestfile $srcdir/configure"; then
1175
1176 # If neither matched, then we have a broken ls. This can happen
1177 # if, for instance, CONFIG_SHELL is bash and it inherits a
1178 # broken ls alias from the environment. This has actually
1179 # happened. Such a system could not be considered "sane".
1180 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1181 alias in your environment])
1182 fi
1183
1184 test "[$]2" = conftestfile
1185 )
1186 then
1187 # Ok.
1188 :
1189 else
1190 AC_MSG_ERROR([newly created file is older than distributed files!
1191 Check your system clock])
1192 fi
1193 rm -f conftest*
1194 AC_MSG_RESULT(yes)])
1195
1196 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1197 dnl The program must properly implement --version.
1198 AC_DEFUN(AM_MISSING_PROG,
1199 [AC_MSG_CHECKING(for working $2)
1200 # Run test in a subshell; some versions of sh will print an error if
1201 # an executable is not found, even if stderr is redirected.
1202 # Redirect stdin to placate older versions of autoconf. Sigh.
1203 if ($2 --version) < /dev/null > /dev/null 2>&1; then
1204 $1=$2
1205 AC_MSG_RESULT(found)
1206 else
1207 $1="$3/missing $2"
1208 AC_MSG_RESULT(missing)
1209 fi
1210 AC_SUBST($1)])
1211
1212 # Add --enable-maintainer-mode option to configure.
1213 # From Jim Meyering
1214
1215 # serial 1
1216
1217 AC_DEFUN(AM_MAINTAINER_MODE,
1218 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1219 dnl maintainer-mode is disabled by default
1220 AC_ARG_ENABLE(maintainer-mode,
1221 [ --enable-maintainer-mode enable make rules and dependencies not useful
1222 (and sometimes confusing) to the casual installer],
1223 USE_MAINTAINER_MODE=$enableval,
1224 USE_MAINTAINER_MODE=no)
1225 AC_MSG_RESULT($USE_MAINTAINER_MODE)
1226 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
1227 MAINT=$MAINTAINER_MODE_TRUE
1228 AC_SUBST(MAINT)dnl
1229 ]
1230 )
1231
1232 # Define a conditional.
1233
1234 AC_DEFUN(AM_CONDITIONAL,
1235 [AC_SUBST($1_TRUE)
1236 AC_SUBST($1_FALSE)
1237 if $2; then
1238 $1_TRUE=
1239 $1_FALSE='#'
1240 else
1241 $1_TRUE='#'
1242 $1_FALSE=
1243 fi])
1244
1245
1246 # serial 40 AC_PROG_LIBTOOL
1247 AC_DEFUN(AC_PROG_LIBTOOL,
1248 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1249
1250 # Save cache, so that ltconfig can load it
1251 AC_CACHE_SAVE
1252
1253 # Actually configure libtool. ac_aux_dir is where install-sh is found.
1254 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
1255 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
1256 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
1257 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
1258 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
1259 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
1260 || AC_MSG_ERROR([libtool configure failed])
1261
1262 # Reload cache, that may have been modified by ltconfig
1263 AC_CACHE_LOAD
1264
1265 # This can be used to rebuild libtool when needed
1266 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
1267
1268 # Always use our own libtool.
1269 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1270 AC_SUBST(LIBTOOL)dnl
1271
1272 # Redirect the config.log output again, so that the ltconfig log is not
1273 # clobbered by the next message.
1274 exec 5>>./config.log
1275 ])
1276
1277 AC_DEFUN(AC_LIBTOOL_SETUP,
1278 [AC_PREREQ(2.13)dnl
1279 AC_REQUIRE([AC_ENABLE_SHARED])dnl
1280 AC_REQUIRE([AC_ENABLE_STATIC])dnl
1281 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1282 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1283 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1284 AC_REQUIRE([AC_PROG_RANLIB])dnl
1285 AC_REQUIRE([AC_PROG_CC])dnl
1286 AC_REQUIRE([AC_PROG_LD])dnl
1287 AC_REQUIRE([AC_PROG_NM])dnl
1288 AC_REQUIRE([AC_PROG_LN_S])dnl
1289 dnl
1290
1291 case "$target" in
1292 NONE) lt_target="$host" ;;
1293 *) lt_target="$target" ;;
1294 esac
1295
1296 # Check for any special flags to pass to ltconfig.
1297 libtool_flags="--cache-file=$cache_file"
1298 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
1299 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
1300 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
1301 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
1302 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
1303 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
1304 [libtool_flags="$libtool_flags --enable-dlopen"])
1305 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1306 [libtool_flags="$libtool_flags --enable-win32-dll"])
1307 AC_ARG_ENABLE(libtool-lock,
1308 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1309 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
1310 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
1311
1312 # Some flags need to be propagated to the compiler or linker for good
1313 # libtool support.
1314 case "$lt_target" in
1315 *-*-irix6*)
1316 # Find out which ABI we are using.
1317 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1318 if AC_TRY_EVAL(ac_compile); then
1319 case "`/usr/bin/file conftest.o`" in
1320 *32-bit*)
1321 LD="${LD-ld} -32"
1322 ;;
1323 *N32*)
1324 LD="${LD-ld} -n32"
1325 ;;
1326 *64-bit*)
1327 LD="${LD-ld} -64"
1328 ;;
1329 esac
1330 fi
1331 rm -rf conftest*
1332 ;;
1333
1334 *-*-sco3.2v5*)
1335 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1336 SAVE_CFLAGS="$CFLAGS"
1337 CFLAGS="$CFLAGS -belf"
1338 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1339 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
1340 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1341 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1342 CFLAGS="$SAVE_CFLAGS"
1343 fi
1344 ;;
1345
1346 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1347 [*-*-cygwin* | *-*-mingw*)
1348 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1349 AC_CHECK_TOOL(AS, as, false)
1350 AC_CHECK_TOOL(OBJDUMP, objdump, false)
1351 ;;
1352 ])
1353 esac
1354 ])
1355
1356 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1357 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1358
1359 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1360 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1361
1362 # AC_ENABLE_SHARED - implement the --enable-shared flag
1363 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
1364 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1365 # `yes'.
1366 AC_DEFUN(AC_ENABLE_SHARED, [dnl
1367 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1368 AC_ARG_ENABLE(shared,
1369 changequote(<<, >>)dnl
1370 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1371 changequote([, ])dnl
1372 [p=${PACKAGE-default}
1373 case "$enableval" in
1374 yes) enable_shared=yes ;;
1375 no) enable_shared=no ;;
1376 *)
1377 enable_shared=no
1378 # Look at the argument we got. We use all the common list separators.
1379 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1380 for pkg in $enableval; do
1381 if test "X$pkg" = "X$p"; then
1382 enable_shared=yes
1383 fi
1384 done
1385 IFS="$ac_save_ifs"
1386 ;;
1387 esac],
1388 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1389 ])
1390
1391 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1392 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1393 AC_ENABLE_SHARED(no)])
1394
1395 # AC_ENABLE_STATIC - implement the --enable-static flag
1396 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
1397 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1398 # `yes'.
1399 AC_DEFUN(AC_ENABLE_STATIC, [dnl
1400 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1401 AC_ARG_ENABLE(static,
1402 changequote(<<, >>)dnl
1403 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1404 changequote([, ])dnl
1405 [p=${PACKAGE-default}
1406 case "$enableval" in
1407 yes) enable_static=yes ;;
1408 no) enable_static=no ;;
1409 *)
1410 enable_static=no
1411 # Look at the argument we got. We use all the common list separators.
1412 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1413 for pkg in $enableval; do
1414 if test "X$pkg" = "X$p"; then
1415 enable_static=yes
1416 fi
1417 done
1418 IFS="$ac_save_ifs"
1419 ;;
1420 esac],
1421 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1422 ])
1423
1424 # AC_DISABLE_STATIC - set the default static flag to --disable-static
1425 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1426 AC_ENABLE_STATIC(no)])
1427
1428
1429 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1430 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1431 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1432 # `yes'.
1433 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1434 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1435 AC_ARG_ENABLE(fast-install,
1436 changequote(<<, >>)dnl
1437 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1438 changequote([, ])dnl
1439 [p=${PACKAGE-default}
1440 case "$enableval" in
1441 yes) enable_fast_install=yes ;;
1442 no) enable_fast_install=no ;;
1443 *)
1444 enable_fast_install=no
1445 # Look at the argument we got. We use all the common list separators.
1446 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1447 for pkg in $enableval; do
1448 if test "X$pkg" = "X$p"; then
1449 enable_fast_install=yes
1450 fi
1451 done
1452 IFS="$ac_save_ifs"
1453 ;;
1454 esac],
1455 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1456 ])
1457
1458 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1459 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1460 AC_ENABLE_FAST_INSTALL(no)])
1461
1462 # AC_PROG_LD - find the path to the GNU or non-GNU linker
1463 AC_DEFUN(AC_PROG_LD,
1464 [AC_ARG_WITH(gnu-ld,
1465 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1466 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1467 AC_REQUIRE([AC_PROG_CC])dnl
1468 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1469 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1470 ac_prog=ld
1471 if test "$ac_cv_prog_gcc" = yes; then
1472 # Check if gcc -print-prog-name=ld gives a path.
1473 AC_MSG_CHECKING([for ld used by GCC])
1474 ac_prog=`($CC -print-prog-name=ld) 2>&5`
1475 case "$ac_prog" in
1476 # Accept absolute paths.
1477 changequote(,)dnl
1478 [\\/]* | [A-Za-z]:[\\/]*)
1479 re_direlt='/[^/][^/]*/\.\./'
1480 changequote([,])dnl
1481 # Canonicalize the path of ld
1482 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1483 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1484 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1485 done
1486 test -z "$LD" && LD="$ac_prog"
1487 ;;
1488 "")
1489 # If it fails, then pretend we aren't using GCC.
1490 ac_prog=ld
1491 ;;
1492 *)
1493 # If it is relative, then search for the first ld in PATH.
1494 with_gnu_ld=unknown
1495 ;;
1496 esac
1497 elif test "$with_gnu_ld" = yes; then
1498 AC_MSG_CHECKING([for GNU ld])
1499 else
1500 AC_MSG_CHECKING([for non-GNU ld])
1501 fi
1502 AC_CACHE_VAL(ac_cv_path_LD,
1503 [if test -z "$LD"; then
1504 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1505 for ac_dir in $PATH; do
1506 test -z "$ac_dir" && ac_dir=.
1507 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1508 ac_cv_path_LD="$ac_dir/$ac_prog"
1509 # Check to see if the program is GNU ld. I'd rather use --version,
1510 # but apparently some GNU ld's only accept -v.
1511 # Break only if it was the GNU/non-GNU ld that we prefer.
1512 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1513 test "$with_gnu_ld" != no && break
1514 else
1515 test "$with_gnu_ld" != yes && break
1516 fi
1517 fi
1518 done
1519 IFS="$ac_save_ifs"
1520 else
1521 ac_cv_path_LD="$LD" # Let the user override the test with a path.
1522 fi])
1523 LD="$ac_cv_path_LD"
1524 if test -n "$LD"; then
1525 AC_MSG_RESULT($LD)
1526 else
1527 AC_MSG_RESULT(no)
1528 fi
1529 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1530 AC_PROG_LD_GNU
1531 ])
1532
1533 AC_DEFUN(AC_PROG_LD_GNU,
1534 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1535 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1536 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1537 ac_cv_prog_gnu_ld=yes
1538 else
1539 ac_cv_prog_gnu_ld=no
1540 fi])
1541 ])
1542
1543 # AC_PROG_NM - find the path to a BSD-compatible name lister
1544 AC_DEFUN(AC_PROG_NM,
1545 [AC_MSG_CHECKING([for BSD-compatible nm])
1546 AC_CACHE_VAL(ac_cv_path_NM,
1547 [if test -n "$NM"; then
1548 # Let the user override the test.
1549 ac_cv_path_NM="$NM"
1550 else
1551 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1552 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1553 test -z "$ac_dir" && ac_dir=.
1554 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1555 # Check to see if the nm accepts a BSD-compat flag.
1556 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1557 # nm: unknown option "B" ignored
1558 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1559 ac_cv_path_NM="$ac_dir/nm -B"
1560 break
1561 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1562 ac_cv_path_NM="$ac_dir/nm -p"
1563 break
1564 else
1565 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1566 continue # so that we can try to find one that supports BSD flags
1567 fi
1568 fi
1569 done
1570 IFS="$ac_save_ifs"
1571 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1572 fi])
1573 NM="$ac_cv_path_NM"
1574 AC_MSG_RESULT([$NM])
1575 ])
1576
1577 # AC_CHECK_LIBM - check for math library
1578 AC_DEFUN(AC_CHECK_LIBM,
1579 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1580 LIBM=
1581 case "$lt_target" in
1582 *-*-beos* | *-*-cygwin*)
1583 # These system don't have libm
1584 ;;
1585 *-ncr-sysv4.3*)
1586 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1587 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1588 ;;
1589 *)
1590 AC_CHECK_LIB(m, main, LIBM="-lm")
1591 ;;
1592 esac
1593 ])
1594
1595 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1596 # the libltdl convenience library, adds --enable-ltdl-convenience to
1597 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1598 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1599 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1600 # '${top_builddir}/' (note the single quotes!) if your package is not
1601 # flat, and, if you're not using automake, define top_builddir as
1602 # appropriate in the Makefiles.
1603 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1604 case "$enable_ltdl_convenience" in
1605 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1606 "") enable_ltdl_convenience=yes
1607 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1608 esac
1609 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
1610 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1611 ])
1612
1613 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1614 # the libltdl installable library, and adds --enable-ltdl-install to
1615 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
1616 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
1617 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
1618 # '${top_builddir}/' (note the single quotes!) if your package is not
1619 # flat, and, if you're not using automake, define top_builddir as
1620 # appropriate in the Makefiles.
1621 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1622 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1623 AC_CHECK_LIB(ltdl, main,
1624 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1625 [if test x"$enable_ltdl_install" = xno; then
1626 AC_MSG_WARN([libltdl not installed, but installation disabled])
1627 else
1628 enable_ltdl_install=yes
1629 fi
1630 ])
1631 if test x"$enable_ltdl_install" = x"yes"; then
1632 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1633 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
1634 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
1635 else
1636 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1637 LIBLTDL="-lltdl"
1638 INCLTDL=
1639 fi
1640 ])
1641
1642 dnl old names
1643 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1644 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1645 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1646 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1647 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1648 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1649 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1650
1651 dnl This is just to silence aclocal about the macro not being used
1652 ifelse([AC_DISABLE_FAST_INSTALL])dnl
1653
1654 # Like AC_CONFIG_HEADER, but automatically create stamp file.
1655
1656 AC_DEFUN(AM_CONFIG_HEADER,
1657 [AC_PREREQ([2.12])
1658 AC_CONFIG_HEADER([$1])
1659 dnl When config.status generates a header, we must update the stamp-h file.
1660 dnl This file resides in the same directory as the config header
1661 dnl that is generated. We must strip everything past the first ":",
1662 dnl and everything past the last "/".
1663 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
1664 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
1665 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
1666 <<am_indx=1
1667 for am_file in <<$1>>; do
1668 case " <<$>>CONFIG_HEADERS " in
1669 *" <<$>>am_file "*<<)>>
1670 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
1671 ;;
1672 esac
1673 am_indx=`expr "<<$>>am_indx" + 1`
1674 done<<>>dnl>>)
1675 changequote([,]))])
1676