1 # Autoconf M4 include file defining utility macros for complex Canadian
5 dnl # _GCC_TOPLEV_NONCANONICAL_BUILD
6 dnl # $build_alias or canonical $build if blank.
7 dnl # Used when we would use $build_alias, but empty is not OK.
8 AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_BUILD],
9 [AC_REQUIRE([AC_CANONICAL_BUILD]) []dnl
10 case ${build_alias} in
11 "") build_noncanonical=${build} ;;
12 *) build_noncanonical=${build_alias} ;;
14 ]) []dnl # _GCC_TOPLEV_NONCANONICAL_BUILD
17 dnl # _GCC_TOPLEV_NONCANONICAL_HOST
18 dnl # $host_alias, or $build_noncanonical if blank.
19 dnl # Used when we would use $host_alias, but empty is not OK.
20 AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_HOST],
21 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
23 "") host_noncanonical=${build_noncanonical} ;;
24 *) host_noncanonical=${host_alias} ;;
26 ]) []dnl # _GCC_TOPLEV_NONCANONICAL_HOST
29 dnl # _GCC_TOPLEV_NONCANONICAL_TARGET
30 dnl # $target_alias or $host_noncanonical if blank.
31 dnl # Used when we would use $target_alias, but empty is not OK.
32 AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_TARGET],
33 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_HOST]) []dnl
34 case ${target_alias} in
35 "") target_noncanonical=${host_noncanonical} ;;
36 *) target_noncanonical=${target_alias} ;;
38 ]) []dnl # _GCC_TOPLEV_NONCANONICAL_TARGET
41 dnl # ACX_NONCANONICAL_BUILD
42 dnl # Like underscored version, but AC_SUBST's.
43 AC_DEFUN([ACX_NONCANONICAL_BUILD],
44 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
45 AC_SUBST(build_noncanonical)
46 ]) []dnl # ACX_NONCANONICAL_BUILD
49 dnl # ACX_NONCANONICAL_HOST
50 dnl # Like underscored version, but AC_SUBST's.
51 AC_DEFUN([ACX_NONCANONICAL_HOST],
52 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_HOST]) []dnl
53 AC_SUBST(host_noncanonical)
54 ]) []dnl # ACX_NONCANONICAL_HOST
57 dnl # ACX_NONCANONICAL_TARGET
58 dnl # Like underscored version, but AC_SUBST's.
59 AC_DEFUN([ACX_NONCANONICAL_TARGET],
60 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_TARGET]) []dnl
61 AC_SUBST(target_noncanonical)
62 ]) []dnl # ACX_NONCANONICAL_TARGET
65 dnl # GCC_TOPLEV_SUBDIRS
66 dnl # GCC & friends build 'build', 'host', and 'target' tools. These must
67 dnl # be separated into three well-known subdirectories of the build directory:
68 dnl # build_subdir, host_subdir, and target_subdir. The values are determined
69 dnl # here so that they can (theoretically) be changed in the future. They
70 dnl # were previously reproduced across many different files.
72 dnl # This logic really amounts to very little with autoconf 2.13; it will
73 dnl # amount to a lot more with autoconf 2.5x.
74 AC_DEFUN([GCC_TOPLEV_SUBDIRS],
75 [AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_TARGET]) []dnl
76 AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_BUILD]) []dnl
78 # post-stage1 host modules use a different CC_FOR_BUILD so, in order to
79 # have matching libraries, they should use host libraries: Makefile.tpl
80 # arranges to pass --with-build-libsubdir=$(HOST_SUBDIR).
81 # However, they still use the build modules, because the corresponding
82 # host modules (e.g. bison) are only built for the host when bootstrap
84 # - build_subdir is where we find build modules, and never changes.
85 # - build_libsubdir is where we find build libraries, and can be overridden.
87 # Prefix 'build-' so this never conflicts with target_subdir.
88 build_subdir="build-${build_noncanonical}"
89 AC_ARG_WITH(build-libsubdir,
90 [ --with-build-libsubdir=[DIR] Directory where to find libraries for build system],
91 build_libsubdir="$withval",
92 build_libsubdir="$build_subdir")
93 # --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
94 if ( test $srcdir = . && test -d gcc ) \
95 || test -d $srcdir/../host-${host_noncanonical}; then
96 host_subdir="host-${host_noncanonical}"
101 target_subdir=${target_noncanonical}
102 AC_SUBST([build_libsubdir]) []dnl
103 AC_SUBST([build_subdir]) []dnl
104 AC_SUBST([host_subdir]) []dnl
105 AC_SUBST([target_subdir]) []dnl
106 ]) []dnl # GCC_TOPLEV_SUBDIRS
110 # _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_SYSTEM
112 # These demand that AC_CANONICAL_SYSTEM be called beforehand.
113 AC_DEFUN([_NCN_TOOL_PREFIXES],
115 test -n "$host_alias" && ncn_tool_prefix=$host_alias-
116 ncn_target_tool_prefix=
117 test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
118 ]) []dnl # _NCN_TOOL_PREFIXES
121 # NCN_STRICT_CHECK_TOOLS(variable, progs-to-check-for,[value-if-not-found],[path])
122 # Like plain AC_CHECK_TOOLS, but require prefix if build!=host.
124 AC_DEFUN([NCN_STRICT_CHECK_TOOLS],
125 [AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
126 AC_ARG_VAR([$1], [$1 for the host])
128 if test -n "[$]$1"; then
130 elif test -n "$ac_cv_prog_$1"; then
134 if test -n "$ac_cv_prog_$1"; then
135 for ncn_progname in $2; do
136 AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4])
140 for ncn_progname in $2; do
141 if test -n "$ncn_tool_prefix"; then
142 AC_CHECK_PROG([$1], [${ncn_tool_prefix}${ncn_progname}],
143 [${ncn_tool_prefix}${ncn_progname}], , [$4])
145 if test -z "$ac_cv_prog_$1" && test $build = $host ; then
146 AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4])
148 test -n "$ac_cv_prog_$1" && break
151 if test -z "$ac_cv_prog_$1" ; then
152 ifelse([$3],[], [set dummy $2
153 if test $build = $host ; then
156 $1="${ncn_tool_prefix}[$]2"
159 ]) []dnl # NCN_STRICT_CHECK_TOOLS
162 # NCN_STRICT_CHECK_TARGET_TOOLS(variable, progs-to-check-for,[value-if-not-found],[path])
163 # Like CVS Autoconf AC_CHECK_TARGET_TOOLS, but require prefix if build!=target.
165 AC_DEFUN([NCN_STRICT_CHECK_TARGET_TOOLS],
166 [AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
167 AC_ARG_VAR([$1], patsubst([$1], [_FOR_TARGET$], [])[ for the target])
169 if test -n "[$]$1"; then
171 elif test -n "$ac_cv_prog_$1"; then
175 if test -n "$ac_cv_prog_$1"; then
176 for ncn_progname in $2; do
177 AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4])
181 if test -z "$ac_cv_prog_$1" && test -n "$with_build_time_tools"; then
182 for ncn_progname in $2; do
183 AC_MSG_CHECKING([for ${ncn_progname} in $with_build_time_tools])
184 if test -x $with_build_time_tools/${ncn_progname}; then
185 ac_cv_prog_$1=$with_build_time_tools/${ncn_progname}
194 if test -z "$ac_cv_prog_$1"; then
195 for ncn_progname in $2; do
196 if test -n "$ncn_target_tool_prefix"; then
197 AC_CHECK_PROG([$1], [${ncn_target_tool_prefix}${ncn_progname}],
198 [${ncn_target_tool_prefix}${ncn_progname}], , [$4])
200 if test -z "$ac_cv_prog_$1" && test $build = $target ; then
201 AC_CHECK_PROG([$1], [${ncn_progname}], [${ncn_progname}], , [$4])
203 test -n "$ac_cv_prog_$1" && break
207 if test -z "$ac_cv_prog_$1" ; then
208 ifelse([$3],[], [set dummy $2
209 if test $build = $target ; then
212 $1="${ncn_target_tool_prefix}[$]2"
217 ]) []dnl # NCN_STRICT_CHECK_TARGET_TOOLS
220 # Backported from Autoconf 2.5x; can go away when and if
221 # we switch. Put the OS path separator in $PATH_SEPARATOR.
222 AC_DEFUN([ACX_PATH_SEP], [
223 # The user is always right.
224 if test "${PATH_SEPARATOR+set}" != set; then
225 echo "#! /bin/sh" >conf$$.sh
226 echo "exit 0" >>conf$$.sh
228 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
240 dnl # Determine GCC version number to use in compiler directories.
242 AC_DEFUN([GCC_BASE_VER],
244 get_gcc_base_ver="cat"
245 AC_ARG_WITH(gcc-major-version-only,
246 [AS_HELP_STRING([--with-gcc-major-version-only], [use only GCC major number in filesystem paths])],
247 [if test x$with_gcc_major_version_only = xyes ; then
249 get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'"
253 AC_SUBST(get_gcc_base_ver)
257 AC_DEFUN([ACX_TOOL_DIRS], [
258 AC_REQUIRE([ACX_PATH_SEP])
259 AC_REQUIRE([GCC_BASE_VER])
260 if test "x$exec_prefix" = xNONE; then
261 if test "x$prefix" = xNONE; then
262 gcc_cv_tool_prefix=$ac_default_prefix
264 gcc_cv_tool_prefix=$prefix
267 gcc_cv_tool_prefix=$exec_prefix
270 # If there is no compiler in the tree, use the PATH only. In any
271 # case, if there is no compiler in the tree nobody should use
272 # AS_FOR_TARGET and LD_FOR_TARGET.
273 if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then
274 if test x$with_gcc_major_version_only = xyes ; then
276 gcc_version=`sed -e 's/^\([0-9]*\).*$/\1/' $srcdir/gcc/BASE-VER`
279 gcc_version=`cat $srcdir/gcc/BASE-VER`
281 gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
282 gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR"
283 gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
284 gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical$PATH_SEPARATOR"
285 gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
286 gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin$PATH_SEPARATOR"
291 if test x$build = x$target && test -n "$md_exec_prefix"; then
292 gcc_cv_tool_dirs="$gcc_cv_tool_dirs$md_exec_prefix$PATH_SEPARATOR"
295 ]) []dnl # ACX_TOOL_DIRS
297 # ACX_HAVE_GCC_FOR_TARGET
298 # Check if the variable GCC_FOR_TARGET really points to a GCC binary.
299 AC_DEFUN([ACX_HAVE_GCC_FOR_TARGET], [
300 cat > conftest.c << \EOF
305 if ($GCC_FOR_TARGET -E conftest.c | grep gcc_yay) > /dev/null 2>&1; then
306 have_gcc_for_target=yes
308 GCC_FOR_TARGET=${ncn_target_tool_prefix}gcc
309 have_gcc_for_target=no
314 # ACX_CHECK_INSTALLED_TARGET_TOOL(VAR, PROG)
315 # Searching for installed target binutils. We need to take extra care,
316 # else we may find the wrong assembler, linker, etc., and lose.
318 # First try --with-build-time-tools, if specified.
320 # For build != host, we ask the installed GCC for the name of the tool it
321 # uses, and accept it if it is an absolute path. This is because the
322 # only good choice for a compiler is the same GCC version that is being
323 # installed (or we couldn't make target libraries), and we assume that
324 # on the host system we'll have not only the same GCC version, but also
325 # the same binutils version.
327 # For build == host, search the same directories that the installed
328 # compiler will search. We used to do this for the assembler, linker,
329 # and nm only; for simplicity of configuration, however, we extend this
330 # criterion to tools (such as ar and ranlib) that are never invoked by
331 # the compiler, to avoid mismatches.
333 # Also note we have to check MD_EXEC_PREFIX before checking the user's path
334 # if build == target. This makes the most sense only when bootstrapping,
335 # but we also do so when build != host. In this case, we hope that the
336 # build and host systems will have similar contents of MD_EXEC_PREFIX.
338 # If we do not find a suitable binary, then try the user's path.
340 AC_DEFUN([ACX_CHECK_INSTALLED_TARGET_TOOL], [
341 AC_REQUIRE([ACX_TOOL_DIRS])
342 AC_REQUIRE([ACX_HAVE_GCC_FOR_TARGET])
343 if test -z "$ac_cv_path_$1" ; then
344 if test -n "$with_build_time_tools"; then
345 AC_MSG_CHECKING([for $2 in $with_build_time_tools])
346 if test -x $with_build_time_tools/$2; then
347 $1=`cd $with_build_time_tools && pwd`/$2
349 AC_MSG_RESULT([$ac_cv_path_$1])
353 elif test $build != $host && test $have_gcc_for_target = yes; then
354 $1=`$GCC_FOR_TARGET --print-prog-name=$2`
355 test [$]$1 = $2 && $1=
356 test -n "[$]$1" && ac_cv_path_$1=[$]$1
359 if test -z "$ac_cv_path_$1" && test -n "$gcc_cv_tool_dirs"; then
360 AC_PATH_PROG([$1], [$2], [], [$gcc_cv_tool_dirs])
362 if test -z "$ac_cv_path_$1" ; then
363 NCN_STRICT_CHECK_TARGET_TOOLS([$1], [$2])
367 ]) []dnl # ACX_CHECK_INSTALLED_TARGET_TOOL
371 # Used for autoconf 2.5x to force AC_PREPROC_IFELSE to reject code which
372 # triggers warnings from the preprocessor. Will be in autoconf 2.58.
373 # For now, using this also overrides header checks to use only the
374 # preprocessor (matches 2.13 behavior; matching 2.58's behavior is a
375 # bit harder from here).
376 # Eventually autoconf will default to checking headers with the compiler
377 # instead, and we'll have to do this differently.
379 AC_DEFUN([AC_PROG_CPP_WERROR],
380 [AC_REQUIRE([AC_PROG_CPP])dnl
381 m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_OLD]))
382 ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR
385 # We require the gnatbind & gnatmake programs, as well as a compiler driver
386 # that understands Ada. We use the user's CC setting, already found, and
387 # possibly add $1 to the command-line parameters.
389 # Sets the shell variable have_gnat to yes or no as appropriate, and
390 # substitutes GNATBIND and GNATMAKE.
391 AC_DEFUN([ACX_PROG_GNAT],
392 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
393 AC_REQUIRE([AC_PROG_CC])
394 AC_CHECK_TOOL(GNATBIND, gnatbind, no)
395 AC_CHECK_TOOL(GNATMAKE, gnatmake, no)
396 AC_CACHE_CHECK([whether compiler driver understands Ada and is recent enough],
397 acx_cv_cc_gcc_supports_ada,
398 [cat >conftest.adb <<EOF
399 pragma Warnings (Off);
401 pragma Warnings (On);
402 use type System.CRTL.int64;
403 procedure conftest is begin null; end conftest;
405 acx_cv_cc_gcc_supports_ada=no
406 # There is a bug in old released versions of GCC which causes the
407 # driver to exit successfully when the appropriate language module
408 # has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
409 # Therefore we must check for the error message as well as an
411 # Other compilers, like HP Tru64 UNIX cc, exit successfully when
412 # given a .adb file, but produce no object file. So we must check
413 # if an object file was really produced to guard against this.
414 errors=`(${CC} $1[]m4_ifval([$1], [ ])-c conftest.adb) 2>&1 || echo failure`
415 if test x"$errors" = x && test -f conftest.$ac_objext; then
416 acx_cv_cc_gcc_supports_ada=yes
420 if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
428 # We require cargo and rustc for some parts of the rust compiler.
429 AC_DEFUN([ACX_PROG_CARGO],
430 [AC_CHECK_PROGS(CARGO, cargo, no)
431 if test "x$CARGO" != xno; then
438 AC_DEFUN([ACX_PROG_GDC],
439 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
440 AC_REQUIRE([AC_PROG_CC])
441 AC_CHECK_TOOL(GDC, gdc, no)
442 AC_CACHE_CHECK([whether the D compiler works],
443 acx_cv_d_compiler_works,
444 [cat >conftest.d <<EOF
445 module conftest; int main() { return 0; }
447 acx_cv_d_compiler_works=no
448 if test "x$GDC" != xno; then
449 errors=`(${GDC} $1[]m4_ifval([$1], [ ])-c conftest.d) 2>&1 || echo failure`
450 if test x"$errors" = x && test -f conftest.$ac_objext; then
451 acx_cv_d_compiler_works=yes
455 if test "x$GDC" != xno && test x$acx_cv_d_compiler_works != xno; then
462 dnl 'make compare' can be significantly faster, if cmp itself can
463 dnl skip bytes instead of using tail. The test being performed is
464 dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
465 dnl but we need to sink errors and handle broken shells. We also test
466 dnl for the parameter format "cmp file1 file2 skip1 skip2" which is
467 dnl accepted by cmp on some systems.
468 AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL],
469 [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip,
472 gcc_cv_prog_cmp_skip='tail -c +17 $$f1 > tmp-foo1; tail -c +17 $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
473 if cmp t1 t2 2 2 > /dev/null 2>&1; then
474 if cmp t1 t2 1 1 > /dev/null 2>&1; then
477 gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
480 if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
481 if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
484 gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
489 do_compare="$gcc_cv_prog_cmp_skip"
493 dnl See whether we can include both string.h and strings.h.
494 AC_DEFUN([ACX_HEADER_STRING],
495 [AC_CACHE_CHECK([whether string.h and strings.h may both be included],
496 gcc_cv_header_string,
497 [AC_TRY_COMPILE([#include <string.h>
498 #include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
499 if test $gcc_cv_header_string = yes; then
500 AC_DEFINE(STRING_WITH_STRINGS, 1, [Define if you can safely include both <string.h> and <strings.h>.])
504 dnl See if stdbool.h properly defines bool and true/false.
505 dnl Check whether _Bool is built-in.
506 AC_DEFUN([ACX_HEADER_STDBOOL],
507 [AC_CACHE_CHECK([for working stdbool.h],
508 ac_cv_header_stdbool_h,
509 [AC_TRY_COMPILE([#include <stdbool.h>],
511 ac_cv_header_stdbool_h=yes, ac_cv_header_stdbool_h=no)])
512 if test $ac_cv_header_stdbool_h = yes; then
513 AC_DEFINE(HAVE_STDBOOL_H, 1,
514 [Define if you have a working <stdbool.h> header file.])
516 AC_CACHE_CHECK(for built-in _Bool, gcc_cv_c__bool,
519 gcc_cv_c__bool=yes, gcc_cv_c__bool=no)
521 if test $gcc_cv_c__bool = yes; then
522 AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.])
526 dnl See if hard links work and if not, try to substitute $1 or simple copy.
527 AC_DEFUN([ACX_PROG_LN],
528 [AC_MSG_CHECKING(whether ln works)
529 AC_CACHE_VAL(acx_cv_prog_LN,
530 [rm -f conftestdata_t
532 if ln conftestdata_f conftestdata_t 2>/dev/null
538 rm -f conftestdata_f conftestdata_t
540 if test $acx_cv_prog_LN = no; then
541 LN="ifelse([$1],,cp,[$1])"
542 AC_MSG_RESULT([no, using $LN])
550 dnl GCC_TARGET_TOOL(PROGRAM, TARGET-VAR, HOST-VAR, IN-TREE-TOOL, LANGUAGE)
551 AC_DEFUN([GCC_TARGET_TOOL],
552 [AC_MSG_CHECKING(where to find the target $1)
553 if test "x${build}" != "x${host}" ; then
554 if expr "x[$]$2" : "x/" > /dev/null; then
555 # We already found the complete path
556 ac_dir=`dirname [$]$2`
557 AC_MSG_RESULT(pre-installed in $ac_dir)
559 # Canadian cross, just use what we found
560 AC_MSG_RESULT(pre-installed)
565 case " ${configdirs} " in
566 *" patsubst([$4], [/.*], []) "*) ;;
570 [case ,${enable_languages}, in
574 if test $ok = yes; then
575 # An in-tree tool is available and we can use it
576 $2='$$r/$(HOST_SUBDIR)/$4'
577 AC_MSG_RESULT(just compiled)
578 el])if expr "x[$]$2" : "x/" > /dev/null; then
579 # We already found the complete path
580 ac_dir=`dirname [$]$2`
581 AC_MSG_RESULT(pre-installed in $ac_dir)
582 elif test "x$target" = "x$host"; then
583 # We can use an host tool
585 AC_MSG_RESULT(host tool)
587 # We need a cross tool
588 AC_MSG_RESULT(pre-installed)
594 dnl Locate a program and check that its version is acceptable.
595 dnl ACX_PROG_CHECK_VER(var, name, version-switch,
596 dnl version-extract-regexp, version-glob)
597 AC_DEFUN([ACX_CHECK_PROG_VER],[
598 AC_CHECK_PROG([$1], [$2], [$2])
599 if test -n "[$]$1"; then
600 # Found it, now check the version.
601 AC_CACHE_CHECK([for modern $2],
602 [gcc_cv_prog_$2_modern],
603 [ac_prog_version=`eval [$]$1 $3 2>&1 |
604 sed -n 's/^.*patsubst([[$4]],/,\/).*$/\1/p'`
606 [case $ac_prog_version in
607 '') gcc_cv_prog_$2_modern=no;;
608 $5) gcc_cv_prog_$2_modern=yes;;
609 *) gcc_cv_prog_$2_modern=no;;
613 gcc_cv_prog_$2_modern=no
615 if test $gcc_cv_prog_$2_modern = no; then
616 $1="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing $2"
620 dnl Support the --with-pkgversion configure option.
621 dnl ACX_PKGVERSION(default-pkgversion)
622 AC_DEFUN([ACX_PKGVERSION],[
623 AC_ARG_WITH(pkgversion,
624 AS_HELP_STRING([--with-pkgversion=PKG],
625 [Use PKG in the version string in place of "$1"]),
627 yes) AC_MSG_ERROR([package version not specified]) ;;
629 *) PKGVERSION="($withval) " ;;
636 dnl Support the --with-bugurl configure option.
637 dnl ACX_BUGURL(default-bugurl)
638 AC_DEFUN([ACX_BUGURL],[
640 AS_HELP_STRING([--with-bugurl=URL],
641 [Direct users to URL to report a bug]),
643 yes) AC_MSG_ERROR([bug URL not specified]) ;;
657 REPORT_BUGS_TO="<$BUGURL>"
658 REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`}
661 AC_SUBST(REPORT_BUGS_TO)
662 AC_SUBST(REPORT_BUGS_TEXI)
666 dnl # ACX_CHECK_CYGWIN_CAT_WORKS
667 dnl # On Cygwin hosts, check that the cat command ignores
668 dnl # carriage returns as otherwise builds will not work.
669 dnl # See binutils PR 4334 for more details.
670 AC_DEFUN([ACX_CHECK_CYGWIN_CAT_WORKS],[
671 AC_MSG_CHECKING([to see if cat works as expected])
672 echo a >cygwin-cat-check
673 if test `cat cygwin-cat-check` = a ; then
679 AC_MSG_ERROR([The cat command does not ignore carriage return characters.
680 Please either mount the build directory in binary mode or run the following
681 commands before running any configure script: