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