提交 9bb82592 编写于 作者: H Heikki Linnakangas

Fix disabling of -Werror in PGAC_PROG_CXX_CXXFLAGS_OPT macro

This was copy-pasted from PGAC_PROG_CC_CFLAGS_OPT, but for the g++
compiler, we need to set ac_cxx_werror rather than ac_c_werror.

The point of this dance with Werror is to detect if the compiler accepts a
flags, but causes warnings, like:

cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++

We don't want to use such a flag.
上级 b9133c98
...@@ -6,13 +6,13 @@ AC_DEFUN([PGAC_PROG_CXX_CXXFLAGS_OPT], ...@@ -6,13 +6,13 @@ AC_DEFUN([PGAC_PROG_CXX_CXXFLAGS_OPT],
[AC_MSG_CHECKING([if $CXX supports $1]) [AC_MSG_CHECKING([if $CXX supports $1])
pgac_save_CXXFLAGS=$CXXFLAGS pgac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$pgac_save_CXXFLAGS $1" CXXFLAGS="$pgac_save_CXXFLAGS $1"
ac_save_c_werror_flag=$ac_c_werror_flag ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_c_werror_flag=yes ac_cxx_werror_flag=yes
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
AC_MSG_RESULT(yes), AC_MSG_RESULT(yes),
[CXXFLAGS="$pgac_save_CXXFLAGS" [CXXFLAGS="$pgac_save_CXXFLAGS"
AC_MSG_RESULT(no)]) AC_MSG_RESULT(no)])
AC_LANG_POP([C++]) AC_LANG_POP([C++])
ac_c_werror_flag=$ac_save_c_werror_flag ac_cxx_werror_flag=$ac_save_cxx_werror_flag
])# PGAC_PROG_CXX_CXXFLAGS_OPT ])# PGAC_PROG_CXX_CXXFLAGS_OPT
...@@ -4990,8 +4990,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ...@@ -4990,8 +4990,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
$as_echo_n "checking if $CXX supports -fno-aggressive-loop-optimizations... " >&6; } $as_echo_n "checking if $CXX supports -fno-aggressive-loop-optimizations... " >&6; }
pgac_save_CXXFLAGS=$CXXFLAGS pgac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$pgac_save_CXXFLAGS -fno-aggressive-loop-optimizations" CXXFLAGS="$pgac_save_CXXFLAGS -fno-aggressive-loop-optimizations"
ac_save_c_werror_flag=$ac_c_werror_flag ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_c_werror_flag=yes ac_cxx_werror_flag=yes
ac_ext=cpp ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS' ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
...@@ -5024,7 +5024,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ...@@ -5024,7 +5024,7 @@ 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_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_c_werror_flag=$ac_save_c_werror_flag ac_cxx_werror_flag=$ac_save_cxx_werror_flag
# Silence compiler warnings that you get with modern versions of GCC. # Silence compiler warnings that you get with modern versions of GCC.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册