1 m4_include([../config/accross.m4])
2 m4_include([../config/acx.m4])
3 m4_include([../config/gettext-sister.m4])
4 m4_include([../config/gcc-lib-path.m4])
5 m4_include([../config/iconv.m4])
6 m4_include([../config/lcmessage.m4])
7 m4_include([../config/lib-ld.m4])
8 m4_include([../config/lib-link.m4])
9 m4_include([../config/lib-prefix.m4])
10 m4_include([../config/progtest.m4])
12 dnl See whether we need a declaration for a function.
13 dnl The result is highly dependent on the INCLUDES passed in, so make sure
14 dnl to use a different cache variable name in this macro if it is invoked
15 dnl in a different context somewhere else.
16 dnl gcc_AC_CHECK_DECL(SYMBOL,
17 dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
18 AC_DEFUN([gcc_AC_CHECK_DECL],
19 [AC_MSG_CHECKING([whether $1 is declared])
20 AC_CACHE_VAL(gcc_cv_have_decl_$1,
23 char *(*pfn) = (char *(*)) $1 ;
24 #endif], eval "gcc_cv_have_decl_$1=yes", eval "gcc_cv_have_decl_$1=no")])
25 if eval "test \"`echo '$gcc_cv_have_decl_'$1`\" = yes"; then
26 AC_MSG_RESULT(yes) ; ifelse([$2], , :, [$2])
28 AC_MSG_RESULT(no) ; ifelse([$3], , :, [$3])
32 dnl Check multiple functions to see whether each needs a declaration.
33 dnl Arrange to define HAVE_DECL_<FUNCTION> to 0 or 1 as appropriate.
34 dnl gcc_AC_CHECK_DECLS(SYMBOLS,
35 dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]])
36 AC_DEFUN([gcc_AC_CHECK_DECLS],
37 [AC_FOREACH([gcc_AC_Func], [$1],
38 [AH_TEMPLATE(AS_TR_CPP(HAVE_DECL_[]gcc_AC_Func),
39 [Define to 1 if we found a declaration for ']gcc_AC_Func[', otherwise
43 ac_tr_decl=AS_TR_CPP([HAVE_DECL_$ac_func])
44 gcc_AC_CHECK_DECL($ac_func,
45 [AC_DEFINE_UNQUOTED($ac_tr_decl, 1) $2],
46 [AC_DEFINE_UNQUOTED($ac_tr_decl, 0) $3],
47 dnl It is possible that the include files passed in here are local headers
48 dnl which supply a backup declaration for the relevant prototype based on
49 dnl the definition of (or lack of) the HAVE_DECL_ macro. If so, this test
50 dnl will always return success. E.g. see libiberty.h's handling of
51 dnl `basename'. To avoid this, we define the relevant HAVE_DECL_ macro to
52 dnl 1 so that any local headers used do not provide their own prototype
61 dnl 'make compare' can be significantly faster, if cmp itself can
62 dnl skip bytes instead of using tail. The test being performed is
63 dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
64 dnl but we need to sink errors and handle broken shells. We also test
65 dnl for the parameter format "cmp file1 file2 skip1 skip2" which is
66 dnl accepted by cmp on some systems.
67 AC_DEFUN([gcc_AC_PROG_CMP_IGNORE_INITIAL],
68 [AC_CACHE_CHECK([for cmp's capabilities], gcc_cv_prog_cmp_skip,
71 gcc_cv_prog_cmp_skip=slowcompare
72 if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
73 if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
76 gcc_cv_prog_cmp_skip=gnucompare
79 if test $gcc_cv_prog_cmp_skip = slowcompare ; then
80 if cmp t1 t2 2 2 > /dev/null 2>&1; then
81 if cmp t1 t2 1 1 > /dev/null 2>&1; then
84 gcc_cv_prog_cmp_skip=fastcompare
90 make_compare_target=$gcc_cv_prog_cmp_skip
91 AC_SUBST(make_compare_target)
94 dnl See if the printf functions in libc support %p in format strings.
95 AC_DEFUN([gcc_AC_FUNC_PRINTF_PTR],
96 [AC_CACHE_CHECK(whether the printf functions support %p,
97 gcc_cv_func_printf_ptr,
98 [AC_TRY_RUN([#include <stdio.h>
103 char *p = buf, *q = NULL;
104 sprintf(buf, "%p", p);
105 sscanf(buf, "%p", &q);
107 }], gcc_cv_func_printf_ptr=yes, gcc_cv_func_printf_ptr=no,
108 gcc_cv_func_printf_ptr=no)
109 rm -f core core.* *.core])
110 if test $gcc_cv_func_printf_ptr = yes ; then
111 AC_DEFINE(HAVE_PRINTF_PTR, 1, [Define if printf supports "%p".])
115 dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
116 AC_DEFUN([gcc_AC_PROG_LN_S],
117 [AC_MSG_CHECKING(whether ln -s works)
118 AC_CACHE_VAL(gcc_cv_prog_LN_S,
119 [rm -f conftestdata_t
121 if ln -s conftestdata_f conftestdata_t 2>/dev/null
123 gcc_cv_prog_LN_S="ln -s"
125 if ln conftestdata_f conftestdata_t 2>/dev/null
129 if cp -p conftestdata_f conftestdata_t 2>/dev/null
131 gcc_cv_prog_LN_S="cp -p"
137 rm -f conftestdata_f conftestdata_t
139 LN_S="$gcc_cv_prog_LN_S"
140 if test "$gcc_cv_prog_LN_S" = "ln -s"; then
143 if test "$gcc_cv_prog_LN_S" = "ln"; then
144 AC_MSG_RESULT([no, using ln])
146 AC_MSG_RESULT([no, and neither does ln, so using $gcc_cv_prog_LN_S])
152 dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
154 AC_DEFUN([gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG],
155 [AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg,
157 #include <sys/types.h>
158 #ifdef HAVE_SYS_STAT_H
159 # include <sys/stat.h>
166 #endif], [mkdir ("foo", 0);],
167 gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)])
168 if test $gcc_cv_mkdir_takes_one_arg = yes ; then
169 AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.])
173 AC_DEFUN([gcc_AC_PROG_INSTALL],
174 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
175 # Find a good install program. We prefer a C program (faster),
176 # so one script is as good as another. But avoid the broken or
177 # incompatible versions:
178 # SysV /etc/install, /usr/sbin/install
179 # SunOS /usr/etc/install
182 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
183 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
184 # ./install, which can be erroneously created by make from ./install.sh.
185 AC_MSG_CHECKING(for a BSD compatible install)
186 if test -z "$INSTALL"; then
187 AC_CACHE_VAL(ac_cv_path_install,
188 [ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
189 for ac_dir in $PATH; do
190 # Account for people who put trailing slashes in PATH elements.
192 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
194 # OSF1 and SCO ODT 3.0 have their own names for install.
195 for ac_prog in ginstall scoinst install; do
196 if test -f $ac_dir/$ac_prog; then
197 if test $ac_prog = install &&
198 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
199 # AIX install. It has an incompatible calling convention.
200 # OSF/1 installbsd also uses dspmsg, but is usable.
203 ac_cv_path_install="$ac_dir/$ac_prog -c"
213 if test "${ac_cv_path_install+set}" = set; then
214 INSTALL="$ac_cv_path_install"
216 # As a last resort, use the slow shell script. We don't cache a
217 # path for INSTALL within a source directory, because that will
218 # break other packages using the cache if that directory is
219 # removed, or if the path is relative.
220 INSTALL="$ac_install_sh"
223 dnl We do special magic for INSTALL instead of AC_SUBST, to get
224 dnl relative paths right.
225 AC_MSG_RESULT($INSTALL)
228 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
229 # It thinks the first close brace ends the variable substitution.
230 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
231 AC_SUBST(INSTALL_PROGRAM)dnl
233 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
234 AC_SUBST(INSTALL_DATA)dnl
237 # mmap(2) blacklisting. Some platforms provide the mmap library routine
238 # but don't support all of the features we need from it.
239 AC_DEFUN([gcc_AC_FUNC_MMAP_BLACKLIST],
241 AC_CHECK_HEADER([sys/mman.h],
242 [gcc_header_sys_mman_h=yes], [gcc_header_sys_mman_h=no])
243 AC_CHECK_FUNC([mmap], [gcc_func_mmap=yes], [gcc_func_mmap=no])
244 if test "$gcc_header_sys_mman_h" != yes \
245 || test "$gcc_func_mmap" != yes; then
246 gcc_cv_func_mmap_file=no
247 gcc_cv_func_mmap_dev_zero=no
248 gcc_cv_func_mmap_anon=no
250 AC_CACHE_CHECK([whether read-only mmap of a plain file works],
251 gcc_cv_func_mmap_file,
252 [# Add a system to this blacklist if
253 # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
254 # memory area containing the same data that you'd get if you applied
255 # read() to the same fd. The only system known to have a problem here
256 # is VMS, where text files have record structure.
259 gcc_cv_func_mmap_file=no ;;
261 gcc_cv_func_mmap_file=yes;;
263 AC_CACHE_CHECK([whether mmap from /dev/zero works],
264 gcc_cv_func_mmap_dev_zero,
265 [# Add a system to this blacklist if it has mmap() but /dev/zero
266 # does not exist, or if mmapping /dev/zero does not give anonymous
267 # zeroed pages with both the following properties:
268 # 1. If you map N consecutive pages in with one call, and then
269 # unmap any subset of those pages, the pages that were not
270 # explicitly unmapped remain accessible.
271 # 2. If you map two adjacent blocks of memory and then unmap them
272 # both at once, they must both go away.
273 # Systems known to be in this category are Windows (all variants),
276 vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
277 gcc_cv_func_mmap_dev_zero=no ;;
279 gcc_cv_func_mmap_dev_zero=yes;;
282 # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
283 AC_CACHE_CHECK([for MAP_ANON(YMOUS)], gcc_cv_decl_map_anon,
285 [#include <sys/types.h>
286 #include <sys/mman.h>
289 #ifndef MAP_ANONYMOUS
290 #define MAP_ANONYMOUS MAP_ANON
293 [int n = MAP_ANONYMOUS;],
294 gcc_cv_decl_map_anon=yes,
295 gcc_cv_decl_map_anon=no)])
297 if test $gcc_cv_decl_map_anon = no; then
298 gcc_cv_func_mmap_anon=no
300 AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works],
301 gcc_cv_func_mmap_anon,
302 [# Add a system to this blacklist if it has mmap() and MAP_ANON or
303 # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
304 # doesn't give anonymous zeroed pages with the same properties listed
305 # above for use of /dev/zero.
306 # Systems known to be in this category are Windows, VMS, and SCO Unix.
308 vms* | cygwin* | pe | mingw* | sco* | udk* )
309 gcc_cv_func_mmap_anon=no ;;
311 gcc_cv_func_mmap_anon=yes;;
316 if test $gcc_cv_func_mmap_file = yes; then
317 AC_DEFINE(HAVE_MMAP_FILE, 1,
318 [Define if read-only mmap of a plain file works.])
320 if test $gcc_cv_func_mmap_dev_zero = yes; then
321 AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1,
322 [Define if mmap of /dev/zero works.])
324 if test $gcc_cv_func_mmap_anon = yes; then
325 AC_DEFINE(HAVE_MMAP_ANON, 1,
326 [Define if mmap with MAP_ANON(YMOUS) works.])
330 dnl Locate a program and check that its version is acceptable.
331 dnl AC_PROG_CHECK_VER(var, name, version-switch,
332 dnl version-extract-regexp, version-glob)
333 AC_DEFUN([gcc_AC_CHECK_PROG_VER],
334 [AC_CHECK_PROG([$1], [$2], [$2])
335 if test -n "[$]$1"; then
336 # Found it, now check the version.
337 AC_CACHE_CHECK(for modern $2, gcc_cv_prog_$2_modern,
338 [changequote(<<,>>)dnl
339 ac_prog_version=`<<$>>$1 $3 2>&1 |
340 sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'`
342 echo "configure:__oline__: version of $2 is $ac_prog_version" >&AC_FD_CC
343 changequote(<<,>>)dnl
344 case $ac_prog_version in
345 '') gcc_cv_prog_$2_modern=no;;
347 gcc_cv_prog_$2_modern=yes;;
348 *) gcc_cv_prog_$2_modern=no;;
353 gcc_cv_prog_$2_modern=no
357 dnl Determine if enumerated bitfields are unsigned. ISO C says they can
358 dnl be either signed or unsigned.
360 AC_DEFUN([gcc_AC_C_ENUM_BF_UNSIGNED],
361 [AC_CACHE_CHECK(for unsigned enumerated bitfields, gcc_cv_enum_bf_unsigned,
362 [AC_TRY_RUN(#include <stdlib.h>
363 enum t { BLAH = 128 } ;
364 struct s_t { enum t member : 8; } s ;
368 if (s.member < 0) exit(1);
371 }, gcc_cv_enum_bf_unsigned=yes, gcc_cv_enum_bf_unsigned=no, gcc_cv_enum_bf_unsigned=yes)])
372 if test $gcc_cv_enum_bf_unsigned = yes; then
373 AC_DEFINE(ENUM_BITFIELDS_ARE_UNSIGNED, 1,
374 [Define if enumerated bitfields are treated as unsigned values.])
377 dnl Probe number of bits in a byte.
378 dnl Note C89 requires CHAR_BIT >= 8.
380 AC_DEFUN([gcc_AC_C_CHAR_BIT],
381 [AC_CACHE_CHECK(for CHAR_BIT, gcc_cv_decl_char_bit,
383 [#ifdef HAVE_LIMITS_H
388 #endif], gcc_cv_decl_char_bit=yes, gcc_cv_decl_char_bit=no)
390 if test $gcc_cv_decl_char_bit = no; then
391 AC_CACHE_CHECK(number of bits in a byte, gcc_cv_c_nbby,
394 while test $i -lt 65; do
397 case (unsigned char)((unsigned long)1 << $i) == ((unsigned long)1 << $i):
398 case (unsigned char)((unsigned long)1<<($i-1)) == ((unsigned long)1<<($i-1)):
400 [gcc_cv_c_nbby=$i; break])
403 test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed
405 if test $gcc_cv_c_nbby = failed; then
406 AC_MSG_ERROR(cannot determine number of bits in a byte)
408 AC_DEFINE_UNQUOTED(CHAR_BIT, $gcc_cv_c_nbby,
409 [Define as the number of bits in a byte, if \`limits.h' doesn't.])
413 dnl Checking for long long.
414 dnl By Caolan McNamara <caolan@skynet.ie>
415 dnl Added check for __int64, Zack Weinberg <zackw@stanford.edu>
417 AC_DEFUN([gcc_AC_C_LONG_LONG],
418 [AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
419 [AC_TRY_COMPILE(,[long long int i;],
420 ac_cv_c_long_long=yes,
421 ac_cv_c_long_long=no)])
422 if test $ac_cv_c_long_long = yes; then
423 AC_DEFINE(HAVE_LONG_LONG, 1,
424 [Define if your compiler supports the \`long long' type.])
426 AC_CACHE_CHECK(for __int64, ac_cv_c___int64,
427 [AC_TRY_COMPILE(,[__int64 i;],
429 ac_cv_c___int64=no)])
430 if test $ac_cv_c___int64 = yes; then
431 AC_DEFINE(HAVE___INT64, 1,
432 [Define if your compiler supports the \`__int64' type.])
436 AC_DEFUN([gcc_AC_INITFINI_ARRAY],
437 [AC_ARG_ENABLE(initfini-array,
438 [ --enable-initfini-array use .init_array/.fini_array sections],
440 AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
441 gcc_cv_initfini_array, [dnl
444 int main (void) { return x; }
445 int foo (void) { x = 0; }
446 int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;],
447 [gcc_cv_initfini_array=yes], [gcc_cv_initfini_array=no],
448 [gcc_cv_initfini_array=no])])
449 enable_initfini_array=$gcc_cv_initfini_array
451 if test $enable_initfini_array = yes; then
452 AC_DEFINE(HAVE_INITFINI_ARRAY, 1,
453 [Define .init_array/.fini_array sections are available and working.])
456 dnl # _gcc_COMPUTE_GAS_VERSION
457 dnl # Used by gcc_GAS_VERSION_GTE_IFELSE
460 dnl # gcc_cv_as_gas_srcdir must be defined before this.
461 dnl # This gross requirement will go away eventually.
462 AC_DEFUN([_gcc_COMPUTE_GAS_VERSION],
463 [gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
464 for f in $gcc_cv_as_bfd_srcdir/configure \
465 $gcc_cv_as_gas_srcdir/configure \
466 $gcc_cv_as_gas_srcdir/configure.in \
467 $gcc_cv_as_gas_srcdir/Makefile.in ; do
468 gcc_cv_gas_version=`sed -n -e 's/^[[ ]]*\(VERSION=[[0-9]]*\.[[0-9]]*.*\)/\1/p' < $f`
469 if test x$gcc_cv_gas_version != x; then
473 gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([[0-9]]*\)"`
474 gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.\([[0-9]]*\)"`
475 gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)"`
476 case $gcc_cv_gas_patch_version in
477 "") gcc_cv_gas_patch_version="0" ;;
479 gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \
480 + $gcc_cv_gas_minor_version \) \* 1000 \
481 + $gcc_cv_gas_patch_version`
482 ]) []dnl # _gcc_COMPUTE_GAS_VERSION
484 dnl # gcc_GAS_VERSION_GTE_IFELSE([elf,] major, minor, patchlevel,
485 dnl # [command_if_true = :], [command_if_false = :])
486 dnl # Check to see if the version of GAS is greater than or
487 dnl # equal to the specified version.
489 dnl # The first ifelse() shortens the shell code if the patchlevel
490 dnl # is unimportant (the usual case). The others handle missing
491 dnl # commands. Note that the tests are structured so that the most
492 dnl # common version number cases are tested first.
493 AC_DEFUN([_gcc_GAS_VERSION_GTE_IFELSE],
495 [if test $in_tree_gas_is_elf = yes \
497 [if]) test $gcc_cv_gas_vers -ge `expr \( \( $2 \* 1000 \) + $3 \) \* 1000 + $4`
499 ifelse([$5],,:,[$5])[]dnl
504 AC_DEFUN([gcc_GAS_VERSION_GTE_IFELSE],
505 [AC_REQUIRE([_gcc_COMPUTE_GAS_VERSION])dnl
506 ifelse([$1], elf, [_gcc_GAS_VERSION_GTE_IFELSE($@)],
507 [_gcc_GAS_VERSION_GTE_IFELSE(,$@)])])
509 dnl gcc_GAS_CHECK_FEATURE(description, cv, [[elf,]major,minor,patchlevel],
510 dnl [extra switches to as], [assembler input],
511 dnl [extra testing logic], [command if feature available])
513 dnl Checks for an assembler feature. If we are building an in-tree
514 dnl gas, the feature is available if the associated assembler version
515 dnl is greater than or equal to major.minor.patchlevel. If not, then
516 dnl ASSEMBLER INPUT is fed to the assembler and the feature is available
517 dnl if assembly succeeds. If EXTRA TESTING LOGIC is not the empty string,
518 dnl then it is run instead of simply setting CV to "yes" - it is responsible
519 dnl for doing so, if appropriate.
520 AC_DEFUN([gcc_GAS_CHECK_FEATURE],
521 [AC_CACHE_CHECK([assembler for $1], [$2],
524 if test $in_tree_gas = yes; then
525 gcc_GAS_VERSION_GTE_IFELSE($3, [[$2]=yes])
526 el])if test x$gcc_cv_as != x; then
527 echo ifelse(m4_substr([$5],0,1),[$], "[$5]", '[$5]') > conftest.s
528 if AC_TRY_COMMAND([$gcc_cv_as $4 -o conftest.o conftest.s >&AC_FD_CC])
530 ifelse([$6],, [$2]=yes, [$6])
532 echo "configure: failed program was" >&AC_FD_CC
533 cat conftest.s >&AC_FD_CC
535 rm -f conftest.o conftest.s
538 if test $[$2] = yes; then
544 # Like AC_PROG_CC_C_O, but changed for automake.
546 # Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
548 # This program is free software; you can redistribute it and/or modify
549 # it under the terms of the GNU General Public License as published by
550 # the Free Software Foundation; either version 2, or (at your option)
553 # This program is distributed in the hope that it will be useful,
554 # but WITHOUT ANY WARRANTY; without even the implied warranty of
555 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
556 # GNU General Public License for more details.
558 # You should have received a copy of the GNU General Public License
559 # along with this program; if not, write to the Free Software
560 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
563 AC_DEFUN([AM_PROG_CC_C_O],
564 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
565 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
566 # FIXME: we rely on the cache variable name because
567 # there is no other way.
569 ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
570 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
571 # Losing compiler, so override with the script.
572 # FIXME: It is wrong to rewrite CC.
573 # But if we don't then we get into trouble of one sort or another.
574 # A longer-term fix would be to have automake use am__CC in this case,
575 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
576 CC="$am_aux_dir/compile $CC"
582 # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
584 # This program is free software; you can redistribute it and/or modify
585 # it under the terms of the GNU General Public License as published by
586 # the Free Software Foundation; either version 2, or (at your option)
589 # This program is distributed in the hope that it will be useful,
590 # but WITHOUT ANY WARRANTY; without even the implied warranty of
591 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
592 # GNU General Public License for more details.
594 # You should have received a copy of the GNU General Public License
595 # along with this program; if not, write to the Free Software
596 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
599 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
600 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
601 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
603 # Of course, Automake must honor this variable whenever it calls a
604 # tool from the auxiliary directory. The problem is that $srcdir (and
605 # therefore $ac_aux_dir as well) can be either absolute or relative,
606 # depending on how configure is run. This is pretty annoying, since
607 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
608 # source directory, any form will work fine, but in subdirectories a
609 # relative path needs to be adjusted first.
611 # $ac_aux_dir/missing
612 # fails when called from a subdirectory if $ac_aux_dir is relative
613 # $top_srcdir/$ac_aux_dir/missing
614 # fails if $ac_aux_dir is absolute,
615 # fails when called from a subdirectory in a VPATH build with
616 # a relative $ac_aux_dir
618 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
619 # are both prefixed by $srcdir. In an in-source build this is usually
620 # harmless because $srcdir is `.', but things will broke when you
621 # start a VPATH build or use an absolute $srcdir.
623 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
624 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
625 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
626 # and then we would define $MISSING as
627 # MISSING="\${SHELL} $am_aux_dir/missing"
628 # This will work as long as MISSING is not called from configure, because
629 # unfortunately $(top_srcdir) has no meaning in configure.
630 # However there are other variables, like CC, which are often used in
631 # configure, and could therefore not use this "fixed" $ac_aux_dir.
633 # Another solution, used here, is to always expand $ac_aux_dir to an
634 # absolute PATH. The drawback is that using absolute paths prevent a
635 # configured tree to be moved without reconfiguration.
637 AC_DEFUN([AM_AUX_DIR_EXPAND],
638 [dnl Rely on autoconf to set up CDPATH properly.
640 # expand $ac_aux_dir to an absolute path
641 am_aux_dir=`cd $ac_aux_dir && pwd`