summaryrefslogtreecommitdiff
path: root/meta-pkgs
diff options
context:
space:
mode:
authorfhajny <fhajny@pkgsrc.org>2014-08-18 10:35:13 +0000
committerfhajny <fhajny@pkgsrc.org>2014-08-18 10:35:13 +0000
commit5082ac4549b4c391e8bee0dc932aad3b67961816 (patch)
tree84e1e6cdfd32cd064bc18c66ec194d9ed65f761d /meta-pkgs
parent60407180f10b8872213b49c9e4cfad503c7d68d6 (diff)
downloadpkgsrc-5082ac4549b4c391e8bee0dc932aad3b67961816.tar.gz
Fix build on SunOS: transform _XOPEN_SOURCE=500 args where needed, and
revert an upstream commit (https://svn.boost.org/trac/boost/ticket/10350). The latter part deserves a better fix (finish what upstream neglected).
Diffstat (limited to 'meta-pkgs')
-rw-r--r--meta-pkgs/boost/Makefile.common6
-rw-r--r--meta-pkgs/boost/distinfo6
-rw-r--r--meta-pkgs/boost/patches/patch-boost_asio_detail_impl_select__reactor.ipp49
-rw-r--r--meta-pkgs/boost/patches/patch-boost_asio_detail_posix__fd__set__adapter.hpp55
-rw-r--r--meta-pkgs/boost/patches/patch-boost_asio_detail_reactor__op__queue.hpp211
-rw-r--r--meta-pkgs/boost/patches/patch-boost_asio_detail_win__fd__set__adapter.hpp98
6 files changed, 423 insertions, 2 deletions
diff --git a/meta-pkgs/boost/Makefile.common b/meta-pkgs/boost/Makefile.common
index c92272d3cf7..7bc94df6bcb 100644
--- a/meta-pkgs/boost/Makefile.common
+++ b/meta-pkgs/boost/Makefile.common
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.45 2014/08/13 10:56:35 adam Exp $
+# $NetBSD: Makefile.common,v 1.46 2014/08/18 10:35:13 fhajny Exp $
#
# used by devel/boost-build/Makefile
# used by devel/boost-docs/Makefile
@@ -61,6 +61,10 @@ SUBST_SED.darwin= -e 's,-install_name ",-install_name "${PREFIX}/lib/,g'
# On SunOS, extract using pkgsrc nbtar to avoid warnings from native gtar.
.if ${OPSYS} == "SunOS"
TOOLS_PLATFORM.tar= #empty
+. include "../../mk/compiler.mk"
+. if !empty(CC_VERSION:Mgcc-4.[6-9]*)
+BUILDLINK_TRANSFORM+= rename:-D_XOPEN_SOURCE=500:-D_XOPEN_SOURCE=600
+. endif
.endif
.if ${OPSYS} == "Darwin"
diff --git a/meta-pkgs/boost/distinfo b/meta-pkgs/boost/distinfo
index 1971e387988..945bd76108c 100644
--- a/meta-pkgs/boost/distinfo
+++ b/meta-pkgs/boost/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.69 2014/08/17 00:10:11 markd Exp $
+$NetBSD: distinfo,v 1.70 2014/08/18 10:35:13 fhajny Exp $
SHA1 (boost_1_56_0.tar.bz2) = f94bb008900ed5ba1994a1072140590784b9b5df
RMD160 (boost_1_56_0.tar.bz2) = cef8907987b4187ff913cbf266fd5d99b40137c4
@@ -12,6 +12,10 @@ SHA1 (patch-ag) = 117eabbbbc26d04bb5e56df5ad92e55b5061c0f8
SHA1 (patch-aq) = 355a58864bf4d07617250d2587e0f7cf62a7b825
SHA1 (patch-ar) = 2fec2c51272cc4ee376e6538d8f1fd8561a7f0a3
SHA1 (patch-boost_asio_detail_config.hpp) = b95ca6b0bb6c805624cb81c91c3f1b691a7425ca
+SHA1 (patch-boost_asio_detail_impl_select__reactor.ipp) = dbb9df5248af0eb5438c601ad29b1a423777f025
+SHA1 (patch-boost_asio_detail_posix__fd__set__adapter.hpp) = 447c0b598985a601f7b4701cd355debe55982273
+SHA1 (patch-boost_asio_detail_reactor__op__queue.hpp) = eaa1a880ce15befedce274610e7613ebf7832155
+SHA1 (patch-boost_asio_detail_win__fd__set__adapter.hpp) = ace29389978d7e97ecba3c6ed21ae3df7fd6ea8f
SHA1 (patch-boost_config_posix__features.hpp) = c3e7187af35a2a25901b37388d3194e22d005323
SHA1 (patch-boost_config_stdlib_libcpp.hpp) = d243325d3aeb180e4ed7a1fd7d89782d832fa9fc
SHA1 (patch-boost_config_stdlib_libstdcpp3.hpp) = 173271c60b3e2ba7bb1fe9390dcd864ce9742588
diff --git a/meta-pkgs/boost/patches/patch-boost_asio_detail_impl_select__reactor.ipp b/meta-pkgs/boost/patches/patch-boost_asio_detail_impl_select__reactor.ipp
new file mode 100644
index 00000000000..0ec3b484a4e
--- /dev/null
+++ b/meta-pkgs/boost/patches/patch-boost_asio_detail_impl_select__reactor.ipp
@@ -0,0 +1,49 @@
+$NetBSD: patch-boost_asio_detail_impl_select__reactor.ipp,v 1.1 2014/08/18 10:35:13 fhajny Exp $
+
+Revert a upstream Windows optimization commit that breaks /dev/poll platforms
+like SunOS. See https://svn.boost.org/trac/boost/ticket/10350
+
+--- boost/asio/detail/impl/select_reactor.ipp.orig 2014-08-13 12:13:05.240414272 +0000
++++ boost/asio/detail/impl/select_reactor.ipp
+@@ -182,7 +182,7 @@ void select_reactor::run(bool block, op_
+ for (int i = 0; i < max_select_ops; ++i)
+ {
+ have_work_to_do = have_work_to_do || !op_queue_[i].empty();
+- fd_sets_[i].set(op_queue_[i], ops);
++ op_queue_[i].get_descriptors(fd_sets_[i], ops);
+ if (fd_sets_[i].max_descriptor() > max_fd)
+ max_fd = fd_sets_[i].max_descriptor();
+ }
+@@ -190,10 +190,10 @@ void select_reactor::run(bool block, op_
+ #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+ // Connection operations on Windows use both except and write fd_sets.
+ have_work_to_do = have_work_to_do || !op_queue_[connect_op].empty();
+- fd_sets_[write_op].set(op_queue_[connect_op], ops);
++ op_queue_[connect_op].get_descriptors(fd_sets_[write_op], ops);
+ if (fd_sets_[write_op].max_descriptor() > max_fd)
+ max_fd = fd_sets_[write_op].max_descriptor();
+- fd_sets_[except_op].set(op_queue_[connect_op], ops);
++ op_queue_[connect_op].get_descriptors(fd_sets_[except_op], ops);
+ if (fd_sets_[except_op].max_descriptor() > max_fd)
+ max_fd = fd_sets_[except_op].max_descriptor();
+ #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+@@ -228,14 +228,16 @@ void select_reactor::run(bool block, op_
+ {
+ #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+ // Connection operations on Windows use both except and write fd_sets.
+- fd_sets_[except_op].perform(op_queue_[connect_op], ops);
+- fd_sets_[write_op].perform(op_queue_[connect_op], ops);
++ op_queue_[connect_op].perform_operations_for_descriptors(
++ fd_sets_[except_op], ops);
++ op_queue_[connect_op].perform_operations_for_descriptors(
++ fd_sets_[write_op], ops);
+ #endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+
+ // Exception operations must be processed first to ensure that any
+ // out-of-band data is read before normal data.
+ for (int i = max_select_ops - 1; i >= 0; --i)
+- fd_sets_[i].perform(op_queue_[i], ops);
++ op_queue_[i].perform_operations_for_descriptors(fd_sets_[i], ops);
+ }
+ timer_queues_.get_ready_timers(ops);
+ }
diff --git a/meta-pkgs/boost/patches/patch-boost_asio_detail_posix__fd__set__adapter.hpp b/meta-pkgs/boost/patches/patch-boost_asio_detail_posix__fd__set__adapter.hpp
new file mode 100644
index 00000000000..9fa907b4827
--- /dev/null
+++ b/meta-pkgs/boost/patches/patch-boost_asio_detail_posix__fd__set__adapter.hpp
@@ -0,0 +1,55 @@
+$NetBSD: patch-boost_asio_detail_posix__fd__set__adapter.hpp,v 1.1 2014/08/18 10:35:13 fhajny Exp $
+
+Revert a upstream Windows optimization commit that breaks /dev/poll platforms
+like SunOS. See https://svn.boost.org/trac/boost/ticket/10350
+
+--- boost/asio/detail/posix_fd_set_adapter.hpp.orig 2014-08-13 12:13:05.246078647 +0000
++++ boost/asio/detail/posix_fd_set_adapter.hpp
+@@ -23,7 +23,6 @@
+
+ #include <cstring>
+ #include <boost/asio/detail/noncopyable.hpp>
+-#include <boost/asio/detail/reactor_op_queue.hpp>
+ #include <boost/asio/detail/socket_types.hpp>
+
+ #include <boost/asio/detail/push_options.hpp>
+@@ -61,20 +60,6 @@ public:
+ return false;
+ }
+
+- void set(reactor_op_queue<socket_type>& operations, op_queue<operation>& ops)
+- {
+- reactor_op_queue<socket_type>::iterator i = operations.begin();
+- while (i != operations.end())
+- {
+- reactor_op_queue<socket_type>::iterator op_iter = i++;
+- if (!set(op_iter->first))
+- {
+- boost::system::error_code ec(error::fd_set_failure);
+- operations.cancel_operations(op_iter, ops, ec);
+- }
+- }
+- }
+-
+ bool is_set(socket_type descriptor) const
+ {
+ return FD_ISSET(descriptor, &fd_set_) != 0;
+@@ -90,18 +75,6 @@ public:
+ return max_descriptor_;
+ }
+
+- void perform(reactor_op_queue<socket_type>& operations,
+- op_queue<operation>& ops) const
+- {
+- reactor_op_queue<socket_type>::iterator i = operations.begin();
+- while (i != operations.end())
+- {
+- reactor_op_queue<socket_type>::iterator op_iter = i++;
+- if (is_set(op_iter->first))
+- operations.perform_operations(op_iter, ops);
+- }
+- }
+-
+ private:
+ mutable fd_set fd_set_;
+ socket_type max_descriptor_;
diff --git a/meta-pkgs/boost/patches/patch-boost_asio_detail_reactor__op__queue.hpp b/meta-pkgs/boost/patches/patch-boost_asio_detail_reactor__op__queue.hpp
new file mode 100644
index 00000000000..a84b6179279
--- /dev/null
+++ b/meta-pkgs/boost/patches/patch-boost_asio_detail_reactor__op__queue.hpp
@@ -0,0 +1,211 @@
+$NetBSD: patch-boost_asio_detail_reactor__op__queue.hpp,v 1.1 2014/08/18 10:35:13 fhajny Exp $
+
+Revert a upstream Windows optimization commit that breaks /dev/poll platforms
+like SunOS. See https://svn.boost.org/trac/boost/ticket/10350
+
+--- boost/asio/detail/reactor_op_queue.hpp.orig 2014-08-13 12:13:05.258739735 +0000
++++ boost/asio/detail/reactor_op_queue.hpp
+@@ -33,54 +33,41 @@ class reactor_op_queue
+ : private noncopyable
+ {
+ public:
+- typedef Descriptor key_type;
+-
+- struct mapped_type : op_queue<reactor_op>
+- {
+- mapped_type() {}
+- mapped_type(const mapped_type&) {}
+- void operator=(const mapped_type&) {}
+- };
+-
+- typedef typename hash_map<key_type, mapped_type>::value_type value_type;
+- typedef typename hash_map<key_type, mapped_type>::iterator iterator;
+-
+ // Constructor.
+ reactor_op_queue()
+ : operations_()
+ {
+ }
+
+- // Obtain iterators to all registered descriptors.
+- iterator begin() { return operations_.begin(); }
+- iterator end() { return operations_.end(); }
+-
+ // Add a new operation to the queue. Returns true if this is the only
+ // operation for the given descriptor, in which case the reactor's event
+ // demultiplexing function call may need to be interrupted and restarted.
+ bool enqueue_operation(Descriptor descriptor, reactor_op* op)
+ {
++ typedef typename operations_map::iterator iterator;
++ typedef typename operations_map::value_type value_type;
+ std::pair<iterator, bool> entry =
+- operations_.insert(value_type(descriptor, mapped_type()));
+- entry.first->second.push(op);
++ operations_.insert(value_type(descriptor, operations()));
++ entry.first->second.op_queue_.push(op);
+ return entry.second;
+ }
+
+- // Cancel all operations associated with the descriptor identified by the
+- // supplied iterator. Any operations pending for the descriptor will be
+- // cancelled. Returns true if any operations were cancelled, in which case
+- // the reactor's event demultiplexing function may need to be interrupted and
+- // restarted.
+- bool cancel_operations(iterator i, op_queue<operation>& ops,
++ // Cancel all operations associated with the descriptor. Any operations
++ // pending for the descriptor will be notified that they have been cancelled
++ // next time perform_cancellations is called. Returns true if any operations
++ // were cancelled, in which case the reactor's event demultiplexing function
++ // may need to be interrupted and restarted.
++ bool cancel_operations(Descriptor descriptor, op_queue<operation>& ops,
+ const boost::system::error_code& ec =
+ boost::asio::error::operation_aborted)
+ {
++ typename operations_map::iterator i = operations_.find(descriptor);
+ if (i != operations_.end())
+ {
+- while (reactor_op* op = i->second.front())
++ while (reactor_op* op = i->second.op_queue_.front())
+ {
+ op->ec_ = ec;
+- i->second.pop();
++ i->second.op_queue_.pop();
+ ops.push(op);
+ }
+ operations_.erase(i);
+@@ -90,17 +77,6 @@ public:
+ return false;
+ }
+
+- // Cancel all operations associated with the descriptor. Any operations
+- // pending for the descriptor will be cancelled. Returns true if any
+- // operations were cancelled, in which case the reactor's event
+- // demultiplexing function may need to be interrupted and restarted.
+- bool cancel_operations(Descriptor descriptor, op_queue<operation>& ops,
+- const boost::system::error_code& ec =
+- boost::asio::error::operation_aborted)
+- {
+- return this->cancel_operations(operations_.find(descriptor), ops, ec);
+- }
+-
+ // Whether there are no operations in the queue.
+ bool empty() const
+ {
+@@ -113,18 +89,18 @@ public:
+ return operations_.find(descriptor) != operations_.end();
+ }
+
+- // Perform the operations corresponding to the descriptor identified by the
+- // supplied iterator. Returns true if there are still unfinished operations
+- // queued for the descriptor.
+- bool perform_operations(iterator i, op_queue<operation>& ops)
++ // Perform the operations corresponding to the descriptor. Returns true if
++ // there are still unfinished operations queued for the descriptor.
++ bool perform_operations(Descriptor descriptor, op_queue<operation>& ops)
+ {
++ typename operations_map::iterator i = operations_.find(descriptor);
+ if (i != operations_.end())
+ {
+- while (reactor_op* op = i->second.front())
++ while (reactor_op* op = i->second.op_queue_.front())
+ {
+ if (op->perform())
+ {
+- i->second.pop();
++ i->second.op_queue_.pop();
+ ops.push(op);
+ }
+ else
+@@ -137,28 +113,84 @@ public:
+ return false;
+ }
+
+- // Perform the operations corresponding to the descriptor. Returns true if
+- // there are still unfinished operations queued for the descriptor.
+- bool perform_operations(Descriptor descriptor, op_queue<operation>& ops)
++ // Fill a descriptor set with the descriptors corresponding to each active
++ // operation. The op_queue is used only when descriptors fail to be added to
++ // the descriptor set.
++ template <typename Descriptor_Set>
++ void get_descriptors(Descriptor_Set& descriptors, op_queue<operation>& ops)
+ {
+- return this->perform_operations(operations_.find(descriptor), ops);
++ typename operations_map::iterator i = operations_.begin();
++ while (i != operations_.end())
++ {
++ Descriptor descriptor = i->first;
++ ++i;
++ if (!descriptors.set(descriptor))
++ {
++ boost::system::error_code ec(error::fd_set_failure);
++ cancel_operations(descriptor, ops, ec);
++ }
++ }
++ }
++
++ // Perform the operations corresponding to the ready file descriptors
++ // contained in the given descriptor set.
++ template <typename Descriptor_Set>
++ void perform_operations_for_descriptors(
++ const Descriptor_Set& descriptors, op_queue<operation>& ops)
++ {
++ typename operations_map::iterator i = operations_.begin();
++ while (i != operations_.end())
++ {
++ typename operations_map::iterator op_iter = i++;
++ if (descriptors.is_set(op_iter->first))
++ {
++ while (reactor_op* op = op_iter->second.op_queue_.front())
++ {
++ if (op->perform())
++ {
++ op_iter->second.op_queue_.pop();
++ ops.push(op);
++ }
++ else
++ {
++ break;
++ }
++ }
++
++ if (op_iter->second.op_queue_.empty())
++ operations_.erase(op_iter);
++ }
++ }
+ }
+
+ // Get all operations owned by the queue.
+ void get_all_operations(op_queue<operation>& ops)
+ {
+- iterator i = operations_.begin();
++ typename operations_map::iterator i = operations_.begin();
+ while (i != operations_.end())
+ {
+- iterator op_iter = i++;
+- ops.push(op_iter->second);
++ typename operations_map::iterator op_iter = i++;
++ ops.push(op_iter->second.op_queue_);
+ operations_.erase(op_iter);
+ }
+ }
+
+ private:
++ struct operations
++ {
++ operations() {}
++ operations(const operations&) {}
++ void operator=(const operations&) {}
++
++ // The operations waiting on the desccriptor.
++ op_queue<reactor_op> op_queue_;
++ };
++
++ // The type for a map of operations.
++ typedef hash_map<Descriptor, operations> operations_map;
++
+ // The operations that are currently executing asynchronously.
+- hash_map<key_type, mapped_type> operations_;
++ operations_map operations_;
+ };
+
+ } // namespace detail
diff --git a/meta-pkgs/boost/patches/patch-boost_asio_detail_win__fd__set__adapter.hpp b/meta-pkgs/boost/patches/patch-boost_asio_detail_win__fd__set__adapter.hpp
new file mode 100644
index 00000000000..0c1148e38cb
--- /dev/null
+++ b/meta-pkgs/boost/patches/patch-boost_asio_detail_win__fd__set__adapter.hpp
@@ -0,0 +1,98 @@
+$NetBSD: patch-boost_asio_detail_win__fd__set__adapter.hpp,v 1.1 2014/08/18 10:35:13 fhajny Exp $
+
+Revert a upstream Windows optimization commit that breaks /dev/poll platforms
+like SunOS. See https://svn.boost.org/trac/boost/ticket/10350
+
+--- boost/asio/detail/win_fd_set_adapter.hpp.orig 2014-08-13 12:13:05.251499093 +0000
++++ boost/asio/detail/win_fd_set_adapter.hpp
+@@ -20,7 +20,6 @@
+ #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+
+ #include <boost/asio/detail/noncopyable.hpp>
+-#include <boost/asio/detail/reactor_op_queue.hpp>
+ #include <boost/asio/detail/socket_types.hpp>
+
+ #include <boost/asio/detail/push_options.hpp>
+@@ -62,20 +61,24 @@ public:
+ if (fd_set_->fd_array[i] == descriptor)
+ return true;
+
+- reserve(fd_set_->fd_count + 1);
+- fd_set_->fd_array[fd_set_->fd_count++] = descriptor;
+- return true;
+- }
+-
+- void set(reactor_op_queue<socket_type>& operations, op_queue<operation>&)
+- {
+- reactor_op_queue<socket_type>::iterator i = operations.begin();
+- while (i != operations.end())
++ if (fd_set_->fd_count == capacity_)
+ {
+- reactor_op_queue<socket_type>::iterator op_iter = i++;
+- reserve(fd_set_->fd_count + 1);
+- fd_set_->fd_array[fd_set_->fd_count++] = op_iter->first;
++ u_int new_capacity = capacity_ + capacity_ / 2;
++ win_fd_set* new_fd_set = static_cast<win_fd_set*>(::operator new(
++ sizeof(win_fd_set) - sizeof(SOCKET)
++ + sizeof(SOCKET) * (new_capacity)));
++
++ new_fd_set->fd_count = fd_set_->fd_count;
++ for (u_int i = 0; i < fd_set_->fd_count; ++i)
++ new_fd_set->fd_array[i] = fd_set_->fd_array[i];
++
++ ::operator delete(fd_set_);
++ fd_set_ = new_fd_set;
++ capacity_ = new_capacity;
+ }
++
++ fd_set_->fd_array[fd_set_->fd_count++] = descriptor;
++ return true;
+ }
+
+ bool is_set(socket_type descriptor) const
+@@ -94,14 +97,8 @@ public:
+ return max_descriptor_;
+ }
+
+- void perform(reactor_op_queue<socket_type>& operations,
+- op_queue<operation>& ops) const
+- {
+- for (u_int i = 0; i < fd_set_->fd_count; ++i)
+- operations.perform_operations(fd_set_->fd_array[i], ops);
+- }
+-
+ private:
++
+ // This structure is defined to be compatible with the Windows API fd_set
+ // structure, but without being dependent on the value of FD_SETSIZE. We use
+ // the "struct hack" to allow the number of descriptors to be varied at
+@@ -112,29 +109,6 @@ private:
+ SOCKET fd_array[1];
+ };
+
+- // Increase the fd_set_ capacity to at least the specified number of elements.
+- void reserve(u_int n)
+- {
+- if (n <= capacity_)
+- return;
+-
+- u_int new_capacity = capacity_ + capacity_ / 2;
+- if (new_capacity < n)
+- new_capacity = n;
+-
+- win_fd_set* new_fd_set = static_cast<win_fd_set*>(::operator new(
+- sizeof(win_fd_set) - sizeof(SOCKET)
+- + sizeof(SOCKET) * (new_capacity)));
+-
+- new_fd_set->fd_count = fd_set_->fd_count;
+- for (u_int i = 0; i < fd_set_->fd_count; ++i)
+- new_fd_set->fd_array[i] = fd_set_->fd_array[i];
+-
+- ::operator delete(fd_set_);
+- fd_set_ = new_fd_set;
+- capacity_ = new_capacity;
+- }
+-
+ win_fd_set* fd_set_;
+ u_int capacity_;
+ socket_type max_descriptor_;