[svn] commit: r2227 - in /branches/trac251: configure.ac src/bin/auth/Makefile.am src/bin/auth/asio_link.cc src/bin/auth/asio_link.h src/bin/host/host.cc src/lib/cc/Makefile.am src/lib/cc/session.cc src/lib/dns/message.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Jun 23 06:25:16 UTC 2010


Author: jinmei
Date: Wed Jun 23 06:25:14 2010
New Revision: 2227

Log:
minimal fixes for SunStudio support

Modified:
    branches/trac251/configure.ac
    branches/trac251/src/bin/auth/Makefile.am
    branches/trac251/src/bin/auth/asio_link.cc
    branches/trac251/src/bin/auth/asio_link.h
    branches/trac251/src/bin/host/host.cc
    branches/trac251/src/lib/cc/Makefile.am
    branches/trac251/src/lib/cc/session.cc
    branches/trac251/src/lib/dns/message.cc

Modified: branches/trac251/configure.ac
==============================================================================
--- branches/trac251/configure.ac (original)
+++ branches/trac251/configure.ac Wed Jun 23 06:25:14 2010
@@ -9,11 +9,19 @@
 
 # Checks for programs.
 AC_PROG_CXX
-AC_PROG_CC
 AC_PROG_LIBTOOL
+
+AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes")
 
 # Use C++ language
 AC_LANG_CPLUSPLUS
+
+# OS dependent compiler flags
+case "$host" in
+	*-solaris*)
+		CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
+		;;
+esac
 
 m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1])
 AC_ARG_WITH([pythonpath],
@@ -98,16 +106,16 @@
 # 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"
+B10_CXXFLAGS=-g
+
+werror_ok=0
+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 +126,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 +372,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: branches/trac251/src/bin/auth/Makefile.am
==============================================================================
--- branches/trac251/src/bin/auth/Makefile.am (original)
+++ branches/trac251/src/bin/auth/Makefile.am Wed Jun 23 06:25:14 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: branches/trac251/src/bin/auth/asio_link.cc
==============================================================================
--- branches/trac251/src/bin/auth/asio_link.cc (original)
+++ branches/trac251/src/bin/auth/asio_link.cc Wed Jun 23 06:25:14 2010
@@ -16,6 +16,7 @@
 
 #include <config.h>
 
+#include <unistd.h> 
 #include <asio.hpp>
 #include <boost/bind.hpp>
 

Modified: branches/trac251/src/bin/auth/asio_link.h
==============================================================================
--- branches/trac251/src/bin/auth/asio_link.h (original)
+++ branches/trac251/src/bin/auth/asio_link.h Wed Jun 23 06:25:14 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: branches/trac251/src/bin/host/host.cc
==============================================================================
--- branches/trac251/src/bin/host/host.cc (original)
+++ branches/trac251/src/bin/host/host.cc Wed Jun 23 06:25:14 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: branches/trac251/src/lib/cc/Makefile.am
==============================================================================
--- branches/trac251/src/lib/cc/Makefile.am (original)
+++ branches/trac251/src/lib/cc/Makefile.am Wed Jun 23 06:25:14 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: branches/trac251/src/lib/cc/session.cc
==============================================================================
--- branches/trac251/src/lib/cc/session.cc (original)
+++ branches/trac251/src/lib/cc/session.cc Wed Jun 23 06:25:14 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>
 #include <asio.hpp>
 #include <asio/error_code.hpp>
 #include <asio/system_error.hpp>

Modified: branches/trac251/src/lib/dns/message.cc
==============================================================================
--- branches/trac251/src/lib/dns/message.cc (original)
+++ branches/trac251/src/lib/dns/message.cc Wed Jun 23 06:25:14 2010
@@ -923,7 +923,7 @@
 template <typename T>
 const T*
 SectionIterator<T>::operator->() const {
-    return (impl_->it_.operator->());
+    return (&(operator*()));
 }
 
 template <typename T>




More information about the bind10-changes mailing list