OSDN Git Service

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