OSDN Git Service

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