Since the C++ compiler is used only for testing, use TEST_CXX as the C++
compiler if available. If C++ link test fails, clear both CXX and
TEST_CXX so that the C++ compiler isn't used for glibc build nor test.
Tested for m68k-linux-gnu-coldfire build and native build on x86-64.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
if test -z "$TEST_CXX"; then
- saved_CXX=
TEST_CXX="$CXX"
else
- saved_CXX="$CXX"
CXX="$TEST_CXX"
fi
# It's useless to us if it can't link programs (e.g. missing -lstdc++).
printf "%s\n" "$libc_cv_cxx_link_ok" >&6; }
if test $libc_cv_cxx_link_ok != yes
then :
- CXX=
-fi
-if test -n "$saved_CXX"; then
- CXX="$saved_CXX"
+ CXX=; TEST_CXX=
fi
if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then
AC_ARG_VAR([TEST_CXX],
[C++ compiler for testing])
if test -z "$TEST_CXX"; then
- saved_CXX=
TEST_CXX="$CXX"
else
- saved_CXX="$CXX"
CXX="$TEST_CXX"
fi
# It's useless to us if it can't link programs (e.g. missing -lstdc++).
LDFLAGS="$old_LDFLAGS"
fi
AC_LANG_POP([C++])])
-AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=])
-if test -n "$saved_CXX"; then
- CXX="$saved_CXX"
-fi
+AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=; TEST_CXX=])
if test "`cd $srcdir; pwd -P`" = "`pwd -P`"; then
AC_MSG_ERROR([you must configure in a separate build directory])