[svn] commit: r2310 - in /trunk: ./ src/bin/auth/ src/bin/host/ src/bin/xfrin/ src/lib/cc/ src/lib/datasrc/ src/lib/dns/ src/lib/dns/rdata/generic/ src/lib/dns/tests/
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jun 28 17:21:47 UTC 2010
Author: jinmei
Date: Mon Jun 28 17:21:47 2010
New Revision: 2310
Log:
merged branches/trac251 (sunstudio compiler support)
Modified:
trunk/ (props changed)
trunk/configure.ac
trunk/src/bin/auth/Makefile.am
trunk/src/bin/auth/asio_link.cc
trunk/src/bin/auth/asio_link.h
trunk/src/bin/host/host.cc
trunk/src/bin/xfrin/ (props changed)
trunk/src/lib/cc/ (props changed)
trunk/src/lib/cc/Makefile.am
trunk/src/lib/cc/session.cc
trunk/src/lib/datasrc/ (props changed)
trunk/src/lib/dns/ (props changed)
trunk/src/lib/dns/message.cc
trunk/src/lib/dns/rdata/generic/rrsig_46.cc (props changed)
trunk/src/lib/dns/rrsetlist.h
trunk/src/lib/dns/tests/ (props changed)
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Jun 28 17:21:47 2010
@@ -9,11 +9,23 @@
# Checks for programs.
AC_PROG_CXX
-AC_PROG_CC
AC_PROG_LIBTOOL
# Use C++ language
-AC_LANG_CPLUSPLUS
+AC_LANG([C++])
+
+# Identify the compiler: this check must be after AC_PROG_CXX and AC_LANG.
+AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes")
+AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"])
+
+# OS dependent compiler flags
+case "$host" in
+*-solaris*)
+ # Solaris requires special definitions to get some standard libraries
+ # (e.g. getopt(3)) available with common used header files.
+ CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
+ ;;
+esac
m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1])
AC_ARG_WITH([pythonpath],
@@ -87,8 +99,8 @@
# TODO: check for _sqlite3.py module
-#
-# B10_CXXFLAGS is the default C++ compiler flags. This will (and should) be
+# Compiler dependent settings: define some mandatory CXXFLAGS here.
+# We also use a separate variable B10_CXXFLAGS. This will (and should) be
# used as the default value for each specifc AM_CXXFLAGS:
# AM_CXXFLAGS = $(B10_CXXFLAGS)
# AM_CXXFLAGS += ... # add module specific flags
@@ -97,17 +109,24 @@
# gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot
# specify the default warning flags in CXXFLAGS and let specific modules
# "override" the default.
-#
-B10_CXXFLAGS=
-
-if test "X$GCC" = "Xyes"; then
-B10_CXXFLAGS="-g -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
+
+CXXFLAGS=-g
+werror_ok=0
+
+# SunStudio compiler requires special compiler options for boost
+# (http://blogs.sun.com/sga/entry/boost_mini_howto)
+if test "$SUNCXX" = "yes"; then
+CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
+fi
+
+# gcc specific settings:
+if test "X$GXX" = "Xyes"; then
+B10_CXXFLAGS="-Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
UNUSED_PARAM_ATTRIBUTE='__attribute__((unused))'
# Certain versions of gcc (g++) have a bug that incorrectly warns about
# the use of anonymous name spaces even if they're closed in a single
# translation unit. For these versions we have to disable -Werror.
-werror_ok=0
CXXFLAGS_SAVED="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror"
AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
@@ -118,13 +137,13 @@
B10_CXXFLAGS="$B10_CXXFLAGS -Werror"],
[AC_MSG_RESULT(yes)])
CXXFLAGS="$CXXFLAGS_SAVED"
-fi dnl GCC = yes
+fi dnl GXX = yes
AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
AC_DEFINE_UNQUOTED(UNUSED_PARAM, $UNUSED_PARAM_ATTRIBUTE, Define to compiler keyword indicating a function argument is intentionally unused)
# produce PIC unless we disable shared libraries. need this for python bindings.
-if test $enable_shared != "no" -a "X$GCC" = "Xyes"; then
+if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
B10_CXXFLAGS="$B10_CXXFLAGS -fPIC"
fi
@@ -364,7 +383,7 @@
# run time performance. Hpefully we can find a better solution or the ASIO
# code will be updated by the time we really need it.
AC_CHECK_HEADERS(sys/devpoll.h, ac_cv_have_devpoll=yes, ac_cv_have_devpoll=no)
-if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GCC" = "Xyes"; then
+if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_DEV_POLL=1"
fi
Modified: trunk/src/bin/auth/Makefile.am
==============================================================================
--- trunk/src/bin/auth/Makefile.am (original)
+++ trunk/src/bin/auth/Makefile.am Mon Jun 28 17:21:47 2010
@@ -36,7 +36,10 @@
libasio_link_a_SOURCES = asio_link.cc asio_link.h
# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
# B10_CXXFLAGS)
-libasio_link_a_CXXFLAGS = $(AM_CXXFLAGS) -Wno-unused-parameter
+libasio_link_a_CXXFLAGS = $(AM_CXXFLAGS)
+if USE_GXX
+libasio_link_a_CXXFLAGS += -Wno-unused-parameter
+endif
libasio_link_a_CPPFLAGS = $(AM_CPPFLAGS)
BUILT_SOURCES = spec_config.h
Modified: trunk/src/bin/auth/asio_link.cc
==============================================================================
--- trunk/src/bin/auth/asio_link.cc (original)
+++ trunk/src/bin/auth/asio_link.cc Mon Jun 28 17:21:47 2010
@@ -16,6 +16,7 @@
#include <config.h>
+#include <unistd.h> // for some IPC/network system calls
#include <asio.hpp>
#include <boost/bind.hpp>
Modified: trunk/src/bin/auth/asio_link.h
==============================================================================
--- trunk/src/bin/auth/asio_link.h (original)
+++ trunk/src/bin/auth/asio_link.h Mon Jun 28 17:21:47 2010
@@ -24,8 +24,8 @@
class IOService {
public:
- IOService(AuthSrv* auth_server, const char* port, bool use_ipv4,
- bool use_ipv6);
+ IOService(AuthSrv* auth_server, const char* const port,
+ const bool use_ipv4, const bool use_ipv6);
~IOService();
void run();
void stop();
Modified: trunk/src/bin/host/host.cc
==============================================================================
--- trunk/src/bin/host/host.cc (original)
+++ trunk/src/bin/host/host.cc Mon Jun 28 17:21:47 2010
@@ -19,6 +19,8 @@
#include <sys/time.h> // for gettimeofday
#include <sys/socket.h> // networking functions and definitions on FreeBSD
+#include <unistd.h>
+
#include <string>
#include <iostream>
Modified: trunk/src/lib/cc/Makefile.am
==============================================================================
--- trunk/src/lib/cc/Makefile.am (original)
+++ trunk/src/lib/cc/Makefile.am Mon Jun 28 17:21:47 2010
@@ -6,7 +6,9 @@
# error. Unfortunately there doesn't seem to be an easy way to selectively
# avoid the error. As a short term workaround we suppress this warning
# for the entire this module. See also src/bin/auth/Makefile.am.
+if USE_GXX
AM_CXXFLAGS += -Wno-unused-parameter
+endif
lib_LIBRARIES = libcc.a
libcc_a_SOURCES = data.cc data.h session.cc session.h
Modified: trunk/src/lib/cc/session.cc
==============================================================================
--- trunk/src/lib/cc/session.cc (original)
+++ trunk/src/lib/cc/session.cc Mon Jun 28 17:21:47 2010
@@ -25,6 +25,7 @@
// A middle term solution is to generalize our local wrapper interface
// (currently only available for the auth server), where all such portability
// issues are hidden, and to have other modules use the wrapper.
+#include <unistd.h> // for some IPC/network system calls
#include <asio.hpp>
#include <asio/error_code.hpp>
#include <asio/system_error.hpp>
Modified: trunk/src/lib/dns/message.cc
==============================================================================
--- trunk/src/lib/dns/message.cc (original)
+++ trunk/src/lib/dns/message.cc Mon Jun 28 17:21:47 2010
@@ -923,7 +923,7 @@
template <typename T>
const T*
SectionIterator<T>::operator->() const {
- return (impl_->it_.operator->());
+ return (&(operator*()));
}
template <typename T>
Modified: trunk/src/lib/dns/rrsetlist.h
==============================================================================
--- trunk/src/lib/dns/rrsetlist.h (original)
+++ trunk/src/lib/dns/rrsetlist.h Mon Jun 28 17:21:47 2010
@@ -60,7 +60,7 @@
}
P operator->() const
{
- return (it_.operator->());
+ return (&(operator*()));
}
bool operator==(const RRsetListIterator& other)
{
More information about the bind10-changes
mailing list