diff mbox

[3/3] package/boost: add library coroutine2

Message ID 1449842279-22712-3-git-send-email-joerg.krause@embedded.rocks
State Accepted
Headers show

Commit Message

Jörg Krause Dec. 11, 2015, 1:57 p.m. UTC
Coroutine2 is a new (C++14) library added in boost 1.59.0. We also add
coroutine2 to the '--without-libraries' configuration flag for the host
variant.

Build successfully tested with Arago ARMv5 2011.09 - a gcc v4.5.3 toolchain.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
 package/boost/Config.in | 4 ++++
 package/boost/boost.mk  | 7 ++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

Comments

Vicente Olivert Riera Dec. 11, 2015, 3:08 p.m. UTC | #1
Dear Jörg Krause,

I was trying to test your patch and I have noticed that despite of
having coroutine2 selected...

BR2_PACKAGE_BOOST_COROUTINE2=y

...there isn't any libboost_coroutine2.so file installed on target. Is
that normal?

Regards,

Vincent.

On 11/12/15 13:57, Jörg Krause wrote:
> Coroutine2 is a new (C++14) library added in boost 1.59.0. We also add
> coroutine2 to the '--without-libraries' configuration flag for the host
> variant.
> 
> Build successfully tested with Arago ARMv5 2011.09 - a gcc v4.5.3 toolchain.
> 
> Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
> ---
>  package/boost/Config.in | 4 ++++
>  package/boost/boost.mk  | 7 ++++---
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/package/boost/Config.in b/package/boost/Config.in
> index 97d0802..83f6871 100644
> --- a/package/boost/Config.in
> +++ b/package/boost/Config.in
> @@ -78,6 +78,10 @@ config BR2_PACKAGE_BOOST_COROUTINE
>  	bool "boost-coroutine"
>  	depends on BR2_PACKAGE_BOOST_CONTEXT
>  
> +config BR2_PACKAGE_BOOST_COROUTINE2
> +	bool "boost-coroutine2"
> +	depends on BR2_PACKAGE_BOOST_CONTEXT
> +
>  config BR2_PACKAGE_BOOST_DATE_TIME
>  	bool "boost-date_time"
>  
> diff --git a/package/boost/boost.mk b/package/boost/boost.mk
> index 2f23fe1..0161d68 100644
> --- a/package/boost/boost.mk
> +++ b/package/boost/boost.mk
> @@ -16,15 +16,16 @@ HOST_BOOST_DEPENDENCIES =
>  # keep host variant as minimal as possible
>  HOST_BOOST_FLAGS = --without-icu \
>  	--without-libraries=$(subst $(space),$(comma),atomic chrono context \
> -	coroutine date_time exception filesystem graph graph_parallel \
> -	iostreams locale log math mpi program_options python random regex \
> -	serialization signals system test thread timer wave)
> +	coroutine coroutine2 date_time exception filesystem graph \
> +	graph_parallel iostreams locale log math mpi program_options python \
> +	random regex serialization signals system test thread timer wave)
>  
>  BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_ATOMIC),,atomic)
>  BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CHRONO),,chrono)
>  BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTAINER),,container)
>  BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTEXT),,context)
>  BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_COROUTINE),,coroutine)
> +BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_COROUTINE2),,coroutine2)
>  BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_DATE_TIME),,date_time)
>  BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_EXCEPTION),,exception)
>  BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_FILESYSTEM),,filesystem)
>
Thomas Petazzoni Dec. 11, 2015, 3:30 p.m. UTC | #2
Vicente,

On Fri, 11 Dec 2015 15:08:26 +0000, Vicente Olivert Riera wrote:

> I was trying to test your patch and I have noticed that despite of
> having coroutine2 selected...
> 
> BR2_PACKAGE_BOOST_COROUTINE2=y
> 
> ...there isn't any libboost_coroutine2.so file installed on target. Is
> that normal?

The vast majority of Boost "libraries" are not libraries in the .so
sense, but purely header based libraries, i.e just a bunch of .h with
very complicated C++ code.

Thomas
Vicente Olivert Riera Dec. 11, 2015, 3:36 p.m. UTC | #3
Hi Thomas,

On 11/12/15 15:30, Thomas Petazzoni wrote:
> Vicente,
> 
> On Fri, 11 Dec 2015 15:08:26 +0000, Vicente Olivert Riera wrote:
> 
>> I was trying to test your patch and I have noticed that despite of
>> having coroutine2 selected...
>>
>> BR2_PACKAGE_BOOST_COROUTINE2=y
>>
>> ...there isn't any libboost_coroutine2.so file installed on target. Is
>> that normal?
> 
> The vast majority of Boost "libraries" are not libraries in the .so
> sense, but purely header based libraries, i.e just a bunch of .h with
> very complicated C++ code.

But there is a libboost_coroutine.so library, that's why I asked. Is it
expected to have a lib for coroutine and not for coroutine2? That's my
doubt.

Regards,

Vincent.

> 
> Thomas
>
Jörg Krause Dec. 11, 2015, 3:46 p.m. UTC | #4
Hi Vicente,
Hi Thomas,

On Fr, 2015-12-11 at 15:36 +0000, Vicente Olivert Riera wrote:
> Hi Thomas,
> 
> On 11/12/15 15:30, Thomas Petazzoni wrote:
> > Vicente,
> > 
> > On Fri, 11 Dec 2015 15:08:26 +0000, Vicente Olivert Riera wrote:
> > 
> > > I was trying to test your patch and I have noticed that despite
> > > of
> > > having coroutine2 selected...
> > > 
> > > BR2_PACKAGE_BOOST_COROUTINE2=y
> > > 
> > > ...there isn't any libboost_coroutine2.so file installed on
> > > target. Is
> > > that normal?
> > 
> > The vast majority of Boost "libraries" are not libraries in the .so
> > sense, but purely header based libraries, i.e just a bunch of .h
> > with
> > very complicated C++ code.
> 
> But there is a libboost_coroutine.so library, that's why I asked. Is
> it
> expected to have a lib for coroutine and not for coroutine2? That's
> my
> doubt.

The Jamfile for coroutine contains:

lib boost_coroutine
    : detail/coroutine_context.cpp
      exceptions.cpp
      stack_traits_sources
    : <link>shared:<library>../../context/build//boost_context
      <link>shared:<library>../../system/build//boost_system
      <link>shared:<library>../../thread/build//boost_thread
    ;

While the Jamfile for coroutine2 contains:

lib boost_coroutine2
    : 
    : <link>shared:<library>../../context/build//boost_context
    ;

So, coroutine has some sources to link with, while coroutine2 does not.
Also, look at the config.hpp in coroutine2:

    #if (defined(BOOST_ALL_DYN_LINK) ||
    defined(BOOST_COROUTINES2_DYN_LINK) ) && !
    defined(BOOST_COROUTINES2_STATIC_LINK)
    # if defined(BOOST_COROUTINES2_SOURCE)
    #  define BOOST_COROUTINES2_DECL BOOST_SYMBOL_EXPORT
    #  define BOOST_COROUTINES2_BUILD_DLL
    # else
    #  define BOOST_COROUTINES2_DECL BOOST_SYMBOL_IMPORT
    # endif
    #endif

    #if ! defined(BOOST_COROUTINES2_DECL)
    # define BOOST_COROUTINES2_DECL
    #endif

    #if ! defined(BOOST_COROUTINES2_SOURCE) && !
    defined(BOOST_ALL_NO_LIB) && ! defined(BOOST_COROUTINES2_NO_LIB)
    # define BOOST_LIB_NAME boost_coroutine
    # if defined(BOOST_ALL_DYN_LINK) ||
    defined(BOOST_COROUTINES2_DYN_LINK)
    #  define BOOST_DYN_LINK
    # endif
    # include <boost/config/auto_link.hpp>
    #endif

For coroutine a library name is defined, for coroutine2 not.

Jörg
Jörg Krause Dec. 11, 2015, 4 p.m. UTC | #5
On Fr, 2015-12-11 at 16:46 +0100, Jörg Krause wrote:
> Hi Vicente,
> Hi Thomas,
> 
> Also, look at the config.hpp in coroutine2:
> 
>     #if (defined(BOOST_ALL_DYN_LINK) ||
>     defined(BOOST_COROUTINES2_DYN_LINK) ) && !
>     defined(BOOST_COROUTINES2_STATIC_LINK)
>     # if defined(BOOST_COROUTINES2_SOURCE)
>     #  define BOOST_COROUTINES2_DECL BOOST_SYMBOL_EXPORT
>     #  define BOOST_COROUTINES2_BUILD_DLL
>     # else
>     #  define BOOST_COROUTINES2_DECL BOOST_SYMBOL_IMPORT
>     # endif
>     #endif
> 
>     #if ! defined(BOOST_COROUTINES2_DECL)
>     # define BOOST_COROUTINES2_DECL
>     #endif
> 
>     #if ! defined(BOOST_COROUTINES2_SOURCE) && !
>     defined(BOOST_ALL_NO_LIB) && ! defined(BOOST_COROUTINES2_NO_LIB)
>     # define BOOST_LIB_NAME boost_coroutine
>     # if defined(BOOST_ALL_DYN_LINK) ||
>     defined(BOOST_COROUTINES2_DYN_LINK)
>     #  define BOOST_DYN_LINK
>     # endif
>     # include <boost/config/auto_link.hpp>
>     #endif
> 
> For coroutine a library name is defined, for coroutine2 not.

Sorry, I got this wrong.

What I really meant is that there would be no library name
boost_coroutine2, but one named boost_coroutine, but only in case it is
built. Since coroutine2 is just a bunch of header files as Thomas
explained, no shared library named boost_coroutine is built at all.

Jörg
Vicente Olivert Riera Dec. 11, 2015, 4:18 p.m. UTC | #6
Dear Jörg Krause,

On 11/12/15 16:00, Jörg Krause wrote:
> On Fr, 2015-12-11 at 16:46 +0100, Jörg Krause wrote:
>> Hi Vicente,
>> Hi Thomas,
>>
>> Also, look at the config.hpp in coroutine2:
>>
>>     #if (defined(BOOST_ALL_DYN_LINK) ||
>>     defined(BOOST_COROUTINES2_DYN_LINK) ) && !
>>     defined(BOOST_COROUTINES2_STATIC_LINK)
>>     # if defined(BOOST_COROUTINES2_SOURCE)
>>     #  define BOOST_COROUTINES2_DECL BOOST_SYMBOL_EXPORT
>>     #  define BOOST_COROUTINES2_BUILD_DLL
>>     # else
>>     #  define BOOST_COROUTINES2_DECL BOOST_SYMBOL_IMPORT
>>     # endif
>>     #endif
>>
>>     #if ! defined(BOOST_COROUTINES2_DECL)
>>     # define BOOST_COROUTINES2_DECL
>>     #endif
>>
>>     #if ! defined(BOOST_COROUTINES2_SOURCE) && !
>>     defined(BOOST_ALL_NO_LIB) && ! defined(BOOST_COROUTINES2_NO_LIB)
>>     # define BOOST_LIB_NAME boost_coroutine
>>     # if defined(BOOST_ALL_DYN_LINK) ||
>>     defined(BOOST_COROUTINES2_DYN_LINK)
>>     #  define BOOST_DYN_LINK
>>     # endif
>>     # include <boost/config/auto_link.hpp>
>>     #endif
>>
>> For coroutine a library name is defined, for coroutine2 not.
> 
> Sorry, I got this wrong.
> 
> What I really meant is that there would be no library name
> boost_coroutine2, but one named boost_coroutine, but only in case it is
> built. Since coroutine2 is just a bunch of header files as Thomas
> explained, no shared library named boost_coroutine is built at all.
> 
> Jörg
> 

understood, thanks for the clarification. Here you have my...

Reviewed-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Tested-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>

$ find output/staging/usr/include/boost/coroutine2/ -type f
output/staging/usr/include/boost/coroutine2/detail/pull_coroutine.ipp
output/staging/usr/include/boost/coroutine2/detail/pull_control_block.hpp
output/staging/usr/include/boost/coroutine2/detail/push_control_block.hpp
...

Regards,

Vincent.
diff mbox

Patch

diff --git a/package/boost/Config.in b/package/boost/Config.in
index 97d0802..83f6871 100644
--- a/package/boost/Config.in
+++ b/package/boost/Config.in
@@ -78,6 +78,10 @@  config BR2_PACKAGE_BOOST_COROUTINE
 	bool "boost-coroutine"
 	depends on BR2_PACKAGE_BOOST_CONTEXT
 
+config BR2_PACKAGE_BOOST_COROUTINE2
+	bool "boost-coroutine2"
+	depends on BR2_PACKAGE_BOOST_CONTEXT
+
 config BR2_PACKAGE_BOOST_DATE_TIME
 	bool "boost-date_time"
 
diff --git a/package/boost/boost.mk b/package/boost/boost.mk
index 2f23fe1..0161d68 100644
--- a/package/boost/boost.mk
+++ b/package/boost/boost.mk
@@ -16,15 +16,16 @@  HOST_BOOST_DEPENDENCIES =
 # keep host variant as minimal as possible
 HOST_BOOST_FLAGS = --without-icu \
 	--without-libraries=$(subst $(space),$(comma),atomic chrono context \
-	coroutine date_time exception filesystem graph graph_parallel \
-	iostreams locale log math mpi program_options python random regex \
-	serialization signals system test thread timer wave)
+	coroutine coroutine2 date_time exception filesystem graph \
+	graph_parallel iostreams locale log math mpi program_options python \
+	random regex serialization signals system test thread timer wave)
 
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_ATOMIC),,atomic)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CHRONO),,chrono)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTAINER),,container)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTEXT),,context)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_COROUTINE),,coroutine)
+BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_COROUTINE2),,coroutine2)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_DATE_TIME),,date_time)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_EXCEPTION),,exception)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_FILESYSTEM),,filesystem)