This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't require C++ bootstrap compiler (PR bootstrap/46810)
On Tue, Dec 07, 2010 at 10:45:10AM -0800, Ian Lance Taylor wrote:
> This is an example of the alternative approach I was thinking of: only
> run the C++ tests if the C++ compiler works. Does this look OK?
It could work, but I think you should
a) rm -f conftest.*
b) C++ ac_compile is
$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext
so you should probably use $CXXFLAGS $CPPFLAGS too, not sure if
.cc vs. .cpp extension could matter for any weird compilers.
c) >&5 should probably be >&AS_MESSAGE_LOG_FD
> 2010-12-07 Ian Lance Taylor <iant@google.com>
>
> PR bootstrap/46810
> * configure.ac: Only run C++ tests if the C++ compiler works.
>
>
> Index: configure.ac
> ===================================================================
> --- configure.ac (revision 167515)
> +++ configure.ac (working copy)
> @@ -913,13 +913,17 @@ AC_C_BIGENDIAN
> # Checks for C++ headers
> # ----------------------
>
> -AC_LANG_PUSH(C++)
> +# Only run the tests if the C++ compiler works.
> +echo "int i;" > conftest.cc
> +if $CXX -c conftest.cc >&5; then
> + AC_LANG_PUSH(C++)
> +
> + AC_CHECK_HEADERS(unordered_map)
> + AC_CHECK_HEADERS(tr1/unordered_map)
> + AC_CHECK_HEADERS(ext/hash_map)
>
> -AC_CHECK_HEADERS(unordered_map)
> -AC_CHECK_HEADERS(tr1/unordered_map)
> -AC_CHECK_HEADERS(ext/hash_map)
> -
> -AC_LANG_POP(C++)
> + AC_LANG_POP(C++)
> +fi
>
> # --------
> # UNSORTED
Jakub