summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-09 10:32:23 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-09 10:32:23 +0000
commit9d135bb6fd95b12a9e1a076a48cc2b4c0a5a2c2e (patch)
tree2e4596e9549c064794426f4a44005559b7d52198 /libcpp
parent9e0a5037e5ef6125706bad548d0d5def983abb22 (diff)
downloadgcc-9d135bb6fd95b12a9e1a076a48cc2b4c0a5a2c2e.tar.gz
PR bootstrap/44432
* configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++, check that C++ compiler works. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160460 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog7
-rwxr-xr-xlibcpp/configure26
-rw-r--r--libcpp/configure.ac4
3 files changed, 35 insertions, 2 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 84201a4a510..d6d9b6cf7c2 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR bootstrap/44432
+ * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
+ check that C++ compiler works.
+ * configure: Regenerate.
+
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* include/symtab.h (ht_identifier_ptr): New.
diff --git a/libcpp/configure b/libcpp/configure
index cf17de447f2..a4700e63a92 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -4400,6 +4400,29 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
fi
else
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ as_fn_error "C++ compiler missing or inoperational" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
depcc="$CXX" am_compiler_list=
am_depcomp=$ac_aux_dir/depcomp
@@ -4997,8 +5020,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-ac_ext=cpp
+ ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index 9dcec239bc1..ceea29ce165 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -45,6 +45,10 @@ ZW_CREATE_DEPDIR
if test "$ENABLE_BUILD_WITH_CXX" = "no"; then
ZW_PROG_COMPILER_DEPENDENCIES([CC])
else
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([[int i;]], [],
+ [AC_MSG_ERROR([C++ compiler missing or inoperational])])
+AC_LANG_POP([C++])
ZW_PROG_COMPILER_DEPENDENCIES([CXX])
fi