Bug 933047 - Add a configure check whether the C++ compiler actually is a C++ compiler. r=ted

This commit is contained in:
Mike Hommey 2013-11-01 10:30:46 +09:00
Родитель d162c6c32d
Коммит aefaa836ba
2 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -192,6 +192,18 @@ if test "$CLANG_CXX"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags"
fi
AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually is a C++ compiler])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_LIBS=$LIBS
LIBS=
AC_TRY_LINK([#include <new>], [int *foo = new int;],,
AC_MSG_RESULT([no])
AC_MSG_ERROR([$CXX $CXXFLAGS $LDFLAGS failed to compile and link a simple C++ source.]))
LIBS=$_SAVE_LIBS
AC_LANG_RESTORE
AC_MSG_RESULT([yes])
if test -z "$GNU_CC"; then
case "$target" in
*-mingw*)

Просмотреть файл

@ -192,6 +192,18 @@ if test "$CLANG_CXX"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags"
fi
AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually is a C++ compiler])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_LIBS=$LIBS
LIBS=
AC_TRY_LINK([#include <new>], [int *foo = new int;],,
AC_MSG_RESULT([no])
AC_MSG_ERROR([$CXX $CXXFLAGS $LDFLAGS failed to compile and link a simple C++ source.]))
LIBS=$_SAVE_LIBS
AC_LANG_RESTORE
AC_MSG_RESULT([yes])
if test -z "$GNU_CC"; then
case "$target" in
*-mingw*)