24400179 libtorrent/rtorrent needs to be updated to work with an updated sigcpp
authorNiveditha Rau <Niveditha.Rau@Oracle.COM>
Fri, 05 Aug 2016 09:36:11 +0000
changeset 6583 d6703a724425
parent 6582 4fb5be1315a8
child 6584 28dfbcb64733
24400179 libtorrent/rtorrent needs to be updated to work with an updated sigcpp
components/libtorrent/Makefile
components/libtorrent/patches/rlibtorrent-08-gcc.patch
components/rtorrent/Makefile
components/rtorrent/depend.mk
components/rtorrent/patches/rtorrent-06-gcc.patch
--- a/components/libtorrent/Makefile	Fri Aug 05 08:57:09 2016 +0000
+++ b/components/libtorrent/Makefile	Fri Aug 05 09:36:11 2016 +0000
@@ -23,6 +23,7 @@
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 BUILD_BITS= 64_and_32
+COMPILER= gcc
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		libtorrent
@@ -36,6 +37,14 @@
 TPNO=			9038
 
 TEST_TARGET= $(NO_TESTS)
+
+# Needs updated sigcpp, not available on S11.
+ifeq ($(BUILD_TYPE), evaluation)
+BUILD_32_and_64=
+INSTALL_32_and_64=
+PUBLISH_STAMP=
+endif
+
 include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PRE_CONFIGURE_ACTION = \
@@ -43,17 +52,9 @@
 
 # requires an older automake to reconfigure.
 COMPONENT_PREP_ACTION = \
-        (cd $(@D) ; ACLOCAL=aclocal-1.11 AUTOMAKE=automake-1.11 autoreconf -fiv)
+	(cd $(@D) ; ACLOCAL=aclocal-1.11 AUTOMAKE=automake-1.11 autoreconf -fiv)
 
-# Although -norunpath is set for CXXFLAGS, we need to put -norunpath 
-# here, otherwise -norunpath doesn't get set when creating the shared 
-# libraries (CC -G).
-CXX+=   $(studio_NORUNPATH)
-
-# this is needed or we can't compile the rak headers
-CC=$(CXX)
-
-CXXFLAGS.studio +=	-i
+CXXFLAGS += -std=c++11
 
 CONFIGURE_OPTIONS  +=	--enable-shared
 CONFIGURE_OPTIONS  +=	--disable-debug
@@ -68,3 +69,7 @@
 REQUIRED_PACKAGES += library/c++/sigcpp
 REQUIRED_PACKAGES += library/security/openssl
 REQUIRED_PACKAGES += system/library/c++-runtime
+REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
+REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime
+REQUIRED_PACKAGES += system/library/math
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libtorrent/patches/rlibtorrent-08-gcc.patch	Fri Aug 05 09:36:11 2016 +0000
@@ -0,0 +1,66 @@
+Changes for successful compilation on Solaris.  
+
+Evaluate to possibly send upstream
+
+
+--- libtorrent-0.12.2/src/dht/dht_hash_map.h	2016-07-21 14:25:16.783986236 -0700
++++ libtorrent-0.12.2/src/dht/dht_hash_map.h	2016-07-21 14:25:27.729767142 -0700
+@@ -167,7 +167,7 @@
+ 
+ inline
+ DhtNode* DhtNodeList::add_node(DhtNode* n) {
+-  insert(std::make_pair<const HashString*, DhtNode*>(n, n));
++  insert(std::pair<const HashString*, DhtNode*>(n, n));
+   return n;
+ }
+ 
+--- libtorrent-0.12.2/src/torrent/data/block.h	2008-05-07 05:19:13.000000000 -0700
++++ libtorrent-0.12.2/src/torrent/data/block.h	2016-07-21 14:22:47.000352058 -0700
+@@ -37,6 +37,7 @@
+ #ifndef LIBTORRENT_BLOCK_H
+ #define LIBTORRENT_BLOCK_H
+ 
++#include <cstring>
+ #include <vector>
+ #include <torrent/common.h>
+ #include <torrent/data/block_transfer.h>
+--- libtorrent-0.12.2/src/torrent/exceptions.cc	2016-07-21 14:32:05.972670769 -0700
++++ libtorrent-0.12.2/src/torrent/exceptions.cc	2016-07-21 14:32:23.871378484 -0700
+@@ -37,6 +37,7 @@
+ #include "config.h"
+ 
+ #include <cerrno>
++#include <cstring>
+ 
+ #include "exceptions.h"
+ 
+--- libtorrent-0.12.2/src/torrent/object_stream.cc	2016-07-21 14:34:49.458499366 -0700
++++ libtorrent-0.12.2/src/torrent/object_stream.cc	2016-07-21 14:35:46.590821537 -0700
+@@ -38,6 +38,7 @@
+ 
+ #include <iterator>
+ #include <iostream>
++#include <cstring>
+ #include <rak/functional.h>
+ #include <rak/algorithm.h>
+ 
+--- libtorrent-0.12.2/src/data/chunk.cc	2016-07-21 14:36:43.901801737 -0700
++++ libtorrent-0.12.2/src/data/chunk.cc	2016-07-21 14:37:40.676713436 -0700
+@@ -38,6 +38,7 @@
+ 
+ #include <algorithm>
+ #include <functional>
++#include <cstring>
+ 
+ #include "torrent/exceptions.h"
+ 
+--- libtorrent-0.12.2/src/utils/diffie_hellman.cc	2016-07-21 14:41:11.573426007 -0700
++++ libtorrent-0.12.2/src/utils/diffie_hellman.cc	2016-07-21 14:41:26.800532608 -0700
+@@ -37,6 +37,7 @@
+ #include "config.h"
+ 
+ #include <string>
++#include <cstring>
+ 
+ #ifdef USE_OPENSSL
+ #include <openssl/bn.h>
--- a/components/rtorrent/Makefile	Fri Aug 05 08:57:09 2016 +0000
+++ b/components/rtorrent/Makefile	Fri Aug 05 09:36:11 2016 +0000
@@ -23,9 +23,9 @@
 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 BUILD_BITS= 64
-# we really need to use studio, mostly because that's what
-# sigc++ uses, so we don't like that parfait is clang/llvm in disguise
+COMPILER= gcc
 export PARFAIT_BUILD=no
+
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		rtorrent
@@ -38,6 +38,14 @@
 TPNO=			8824
 
 TEST_TARGET= $(NO_TESTS)
+
+# Needs updated sigcpp, not available on S11.
+ifeq ($(BUILD_TYPE), evaluation)
+BUILD_64=
+INSTALL_64=
+PUBLISH_STAMP=
+endif
+
 include $(WS_MAKE_RULES)/common.mk
 
 COMPONENT_PRE_CONFIGURE_ACTION = \
@@ -52,24 +60,31 @@
 	    automake-1.11; \
 	    autoconf )
 
-# this is needed or we can't compile the rak headers
-CC=$(CXX)
+CXXFLAGS += -std=c++11
 
-LDFLAGS += -L/usr/gnu/lib/$(MACH64) -R/usr/gnu/lib/$(MACH64)
+LDFLAGS += -L$(GNULIB64) -R$(GNULIB64)
 ifeq ($(OS_VERSION),5.11)
 LDFLAGS += -lnsl -lsocket
 endif
 
-CXXFLAGS +=	-i
-CXXFLAGS +=	-template=no%extdef
 CXXFLAGS +=	-I$(USRINCDIR)/ncurses
 CONFIGURE_OPTIONS.64 +=         --srcdir=$(BUILD_DIR_64)
 CONFIGURE_OPTIONS +=		--disable-debug
 
+# Delete this when libtorrent is updated in the build servers
+LIBTORRENT_BASE = $(WS_COMPONENTS)/libtorrent/build/prototype/$(MACH)
+PKG_CONFIG_PATHS += $(LIBTORRENT_BASE)$(PKG_CONFIG_PATH.$(BITS)) 
+LD_OPTIONS += -L$(LIBTORRENT_BASE)$(USRLIB.$(BITS)) 
+CXXFLAGS += -I$(LIBTORRENT_BASE)$(USRINCDIR)/torrent 
+COMPONENT_BUILD_ENV += LD_LIBRARY_PATH_$(BITS)="$(LIBTORRENT_BASE)$(USRLIB.$(BITS))" 
+#end Delete
+
 REQUIRED_PACKAGES += developer/build/automake-111
 REQUIRED_PACKAGES += library/c++/sigcpp
 REQUIRED_PACKAGES += library/libtorrent
 REQUIRED_PACKAGES += library/ncurses
 REQUIRED_PACKAGES += system/library/c++-runtime
+REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
+REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime
 REQUIRED_PACKAGES += system/library/math
 REQUIRED_PACKAGES += web/curl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/rtorrent/depend.mk	Fri Aug 05 09:36:11 2016 +0000
@@ -0,0 +1,1 @@
+rtorrent: libtorrent
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/rtorrent/patches/rtorrent-06-gcc.patch	Fri Aug 05 09:36:11 2016 +0000
@@ -0,0 +1,14 @@
+Changes for successful compilation on Solaris.
+
+Evaluate to possibly send upstream
+
+--- rtorrent-0.8.2/src/rpc/parse.cc	2016-07-21 14:56:37.128876142 -0700
++++ rtorrent-0.8.2/src/rpc/parse.cc	2016-07-21 14:56:47.788833146 -0700
+@@ -37,6 +37,7 @@
+ #include "config.h"
+ 
+ #include <locale>
++#include <cstring>
+ #include <rak/algorithm.h>
+ #include <rak/path.h>
+ #include <torrent/exceptions.h>