OSDN Git Service

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