diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-23 21:41:01 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-23 21:41:01 +0000 |
commit | 7ad4d118520980bfdf25e8658f9d2789d7e9c1b6 (patch) | |
tree | 8569fa9a80de684d9c6d72e6ad485659e80b5b6e /libstdc++-v3/acinclude.m4 | |
parent | 3a47db1ed1a9176b40509cefb5b24e6699b8b5a2 (diff) | |
download | gcc-7ad4d118520980bfdf25e8658f9d2789d7e9c1b6.tar.gz |
* acinclude.m4 (GLIBCXX_ENABLE_PCH): Rework test such that it
tests not only generation of pch files, but also their use.
* aclocal.m4, configure: Rebuilt.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69727 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 8f748112422..5e5ebf97753 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1394,7 +1394,7 @@ AC_ARG_ENABLE(libstdcxx_pch, changequote(<<, >>)dnl << --enable-libstdcxx-pch build pre-compiled libstdc++ includes [default=>>GLIBCXX_ENABLE_PCH_DEFAULT], changequote([, ])dnl -[case "${enableval}" in +[case ${enableval} in yes) enable_libstdcxx_pch=yes ;; no) enable_libstdcxx_pch=no ;; *) AC_MSG_ERROR([Unknown argument to enable/disable PCH]) ;; @@ -1402,27 +1402,30 @@ changequote([, ])dnl enable_libstdcxx_pch=GLIBCXX_ENABLE_PCH_DEFAULT)dnl if test x$enable_libstdcxx_pch = xyes; then - ac_test_CXXFLAGS="${CXXFLAGS+set}" - ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS='-Werror -Winvalid-pch -Wno-deprecated -x c++-header' - - AC_MSG_CHECKING([for compiler that seems to compile .gch files]) - if test x${pch_comp+set} != xset; then - AC_CACHE_VAL(pch_comp, [ + AC_CACHE_CHECK([for pch support], [libstdcxx_cv_pch_comp],[ AC_LANG_SAVE AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([#include <math.h>], , - [pch_comp=yes], [pch_comp=no]) + ac_save_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated" + echo '#include <math.h>' > conftest.h + if ${CXX-g++} $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \ + -o conftest.h.gch 1>&5 2>&1 && + echo '#error "pch failed"' > conftest.h && + echo '#include "conftest.h"' > conftest.C && + ${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.C 1>&5 2>&1 ; then + libstdcxx_cv_pch_comp=yes + else + libstdcxx_cv_pch_comp=no + fi + rm -f conftest* + CXXFLAGS=$ac_save_CXXFLAGS AC_LANG_RESTORE - ]) - fi - AC_MSG_RESULT([$pch_comp]) - - CXXFLAGS="$ac_save_CXXFLAGS" + ]) fi - if test x"$enable_libstdcxx_pch" = xyes && test x"$pch_comp" = xno; then - enable_pch=no + if test x"$enable_libstdcxx_pch" = xyes && + test x"$libstdcxx_cv_pch_comp" = xno; then + enable_libstdcxx_pch=no fi AC_MSG_CHECKING([for enabled PCH]) |