Navigation Menu

Skip to content

Commit

Permalink
add -Wall option to gcc and g++ if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 27, 2011
1 parent 2f36b96 commit 7d305c7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions configure.ac
Expand Up @@ -24,6 +24,41 @@ AC_PROG_CXX
AC_PROG_CPP
AC_PROG_LIBTOOL

AC_DEFUN([CHECK_CFLAG], [
AC_MSG_CHECKING([if gcc supports $1])
old_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $1 -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[check_cflag=yes],
[check_cflag=no])
CFLAGS="$old_CFLAGS"
if test "x$check_cflag" = "xyes"; then
CFLAGS="$CFLAGS $1"
fi
AC_MSG_RESULT([$check_cflag])
])

AC_DEFUN([CHECK_CXXFLAG], [
AC_MSG_CHECKING([if g++ supports $1])
old_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $1 -Werror"
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[check_cxxflag=yes],
[check_cxxflag=no])
AC_LANG_POP([C++])
CXXFLAGS="$old_CXXFLAGS"
if test "x$check_cxxflag" = "xyes"; then
CXXFLAGS="$CXXFLAGS $1"
fi
AC_MSG_RESULT([$check_cxxflag])
])

if test "$GCC" = "yes"; then
CHECK_CFLAG([-Wall])
CHECK_CXXFLAG([-Wall])
fi

standalone_build=

AC_DEFUN([CONFIG_OPTION_PLUGINS],
Expand Down

0 comments on commit 7d305c7

Please sign in to comment.