[bind10-dev] nsas build issues
Jeremy C. Reed
jreed at isc.org
Thu Dec 16 19:07:01 UTC 2010
On Wed, 15 Dec 2010, Jelte Jansen wrote:
> attached is a patch for that (also removes the no-missing- from the
> makefile,
I now have the following. Tested on Solaris GCC, SunStudio (CC ignores
because passed to ld, so is added, but linker ignores later so is fine),
NetBSD and Debian. I did not test with clang. I will commit this soon
unless someone has improvements. It is so the Solaris10-Sparc-GCC build
will work again.
Index: src/lib/nsas/tests/Makefile.am
===================================================================
--- src/lib/nsas/tests/Makefile.am (revision 3872)
+++ src/lib/nsas/tests/Makefile.am (working copy)
@@ -11,12 +11,11 @@
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
Index: src/lib/nsas/Makefile.am
===================================================================
--- src/lib/nsas/Makefile.am (revision 3872)
+++ src/lib/nsas/Makefile.am (working copy)
@@ -7,12 +7,11 @@
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
Index: configure.ac
===================================================================
--- configure.ac (revision 3872)
+++ configure.ac (working copy)
@@ -195,6 +195,19 @@
# 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 @@
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"
More information about the bind10-dev
mailing list