Commit 8498369c authored by Jeremy C. Reed's avatar Jeremy C. Reed
Browse files

Check if compiler accepts -Wno-missing-field-initializers.

Use it for nsas build even if not GCC.
(It was already used by default for nsas for past few days,
but that breaks old GCC. This will fix build for Solaris GCC.)


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@3877 e5f2f494-b856-4b98-b285-d166d9295462
parent abe0b529
......@@ -195,6 +195,19 @@ fi
# specify the default warning flags in CXXFLAGS and let specific modules
# "override" the default.
# This may be used to try compiler flags.
AC_DEFUN([BIND10_CXX_TRY_FLAG], [
AC_MSG_CHECKING([whether $CXX supports $1])
bind10_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $1"
AC_COMPILE_IFELSE([ ], [bind10_cxx_flag=yes], [bind10_cxx_flag=no])
CXXFLAGS="$bind10_save_CXXFLAGS"
AC_MSG_RESULT([$bind10_cxx_flag])
])
werror_ok=0
# SunStudio compiler requires special compiler options for boost
......@@ -204,6 +217,10 @@ CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
MULTITHREADING_FLAG="-mt"
fi
BIND10_CXX_TRY_FLAG(-Wno-missing-field-initializers,
[WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG="-Wno-missing-field-initializers"])
AC_SUBST(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
# gcc specific settings:
if test "X$GXX" = "Xyes"; then
B10_CXXFLAGS="-Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
......
......@@ -7,12 +7,11 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/lib/nsas -I$(top_builddir)/src/lib/nsas
AM_CPPFLAGS += $(SQLITE_CFLAGS)
AM_CXXFLAGS = $(B10_CXXFLAGS)
if USE_GXX
# Some versions of GCC warn about some versions of Boost regarding
# missing initializer for members in its posix_time.
# https://svn.boost.org/trac/boost/ticket/3477
AM_CXXFLAGS += -Wno-missing-field-initializers
endif
# But older GCC compilers don't have the flag.
AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
if USE_CLANGPP
# clang++ complains about unused function parameters in some boost header
......
......@@ -11,12 +11,11 @@ if USE_STATIC_LINK
AM_LDFLAGS += -static
endif
if USE_GXX
# Some versions of GCC warn about some versions of Boost regarding
# missing initializer for members in its posix_time.
# https://svn.boost.org/trac/boost/ticket/3477
AM_CXXFLAGS += -Wno-missing-field-initializers
endif
# But older GCC compilers don't have the flag.
AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
if USE_CLANGPP
# see ../Makefile.am
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment