diff mbox

[2/5] boost: add host variant

Message ID 1382703323-31038-2-git-send-email-gustavo@zacarias.com.ar
State Superseded
Headers show

Commit Message

Gustavo Zacarias Oct. 25, 2013, 12:15 p.m. UTC
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/boost/boost.mk | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Ryan Barnett Oct. 25, 2013, 9:53 p.m. UTC | #1
Gustavo,

Please see my comment below, otherwise looks good.

Gustavo Zacarias <gustavo@zacarias.com.ar> wrote on 10/25/2013 07:15:20 
AM:

> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
>  package/boost/boost.mk | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/package/boost/boost.mk b/package/boost/boost.mk
> index b0b3352..8a1a8f7 100644
> --- a/package/boost/boost.mk
> +++ b/package/boost/boost.mk
> @@ -11,11 +11,19 @@ BOOST_SITE = 
http://downloads.sourceforge.net/project/boost/boost/$(BOOST_VERSIO
>  BOOST_INSTALL_STAGING = YES
> 
>  TARGET_CC_VERSION = $(shell $(TARGET_CC) -dumpversion)
> +HOST_CC_VERSION = $(shell $(HOSTCC) -dumpversion)
> 
>  BOOST_DEPENDENCIES =
> 
>  BOOST_FLAGS =
> 
> +# keep host variant as minimal as possible

Could you expand more on what you are leaving enabled and why?

> +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)
> +
>  # atomic library compile only with upstream version, wait for next 
release
>  # coroutine breaks on some weak toolchains and it's new for 1.54+
>  # log breaks with some toolchain combinations and it's new for 1.54+
> @@ -54,6 +62,9 @@ ifeq ($(BR2_PACKAGE_BOOST_IOSTREAMS),y)
>  BOOST_DEPENDENCIES += bzip2 zlib
>  endif
> 
> +HOST_BOOST_OPT += toolset=gcc threading=multi variant=release 
link=shared \
> +   runtime-link=shared
> +
>  BOOST_OPT += toolset=gcc \
>          threading=multi \
>          variant=$(if $(BR2_ENABLE_DEBUG),debug,release) \
> @@ -78,6 +89,12 @@ define BOOST_CONFIGURE_CMDS
>     echo "" >> $(@D)/user-config.jam
>  endef
> 
> +define HOST_BOOST_CONFIGURE_CMDS
> +   (cd $(@D) && ./bootstrap.sh $(HOST_BOOST_FLAGS))
> +   echo "using gcc : $(HOST_CC_VERSION) : $(HOSTCXX) : 
<cxxflags>\"$(HOST_CXXFLAGS)\" <linkflags>\"$(HOST_LDFLAGS)\" ;" > 
$(@D)/user-config.jam
> +   echo "" >> $(@D)/user-config.jam
> +endef
> +
>  define BOOST_INSTALL_TARGET_CMDS
>     (cd $(@D) && ./b2 -j$(PARALLEL_JOBS) -q -d+1 \
>     --user-config=$(@D)/user-config.jam \
> @@ -86,6 +103,21 @@ define BOOST_INSTALL_TARGET_CMDS
>     --layout=system install )
>  endef
> 
> +define HOST_BOOST_BUILD_CMDS
> +   (cd $(@D) && ./b2 -j$(PARALLEL_JOBS) -q -d+1 \
> +   --user-config=$(@D)/user-config.jam \
> +   $(HOST_BOOST_OPT) \
> +   --prefix=$(HOST_DIR)/usr )
> +endef
> +
> +define HOST_BOOST_INSTALL_CMDS
> +   (cd $(@D) && ./b2 -j$(PARALLEL_JOBS) -q -d+1 \
> +   --user-config=$(@D)/user-config.jam \
> +   $(HOST_BOOST_OPT) \
> +   --prefix=$(HOST_DIR)/usr \
> +   --layout=system install )
> +endef
> +
>  define BOOST_INSTALL_STAGING_CMDS
>     (cd $(@D) && ./bjam -j$(PARALLEL_JOBS) -d+1 \
>     --user-config=$(@D)/user-config.jam \
> @@ -95,3 +127,4 @@ define BOOST_INSTALL_STAGING_CMDS
>  endef
> 
>  $(eval $(generic-package))
> +$(eval $(host-autotools-package))
> -- 
> 1.8.1.5
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Gustavo Zacarias Oct. 25, 2013, 10:23 p.m. UTC | #2
On 10/25/2013 06:53 PM, Ryan Barnett wrote:

> Gustavo,
> 
> Please see my comment below, otherwise looks good.
> 
> Gustavo Zacarias <gustavo@zacarias.com.ar> wrote on 10/25/2013 07:15:20 
> AM:
> 
>> +# keep host variant as minimal as possible
> 
> Could you expand more on what you are leaving enabled and why?

Just the barebones is enough for host-thrift (the tool) hence there's
nothing to gain from a full host-boost other than longer build times.
If the need arises it can be expanded in the future for other host-* users.
Regards.
Arnout Vandecappelle Oct. 25, 2013, 11:21 p.m. UTC | #3
On 25/10/13 14:15, Gustavo Zacarias wrote:
[snip]
> @@ -95,3 +127,4 @@ define BOOST_INSTALL_STAGING_CMDS
>   endef
>
>   $(eval $(generic-package))
> +$(eval $(host-autotools-package))

  Wow, did it suddenly become an autotools package? :-)

  Regards,
  Arnout
Gustavo Zacarias Oct. 25, 2013, 11:52 p.m. UTC | #4
On 10/25/2013 08:21 PM, Arnout Vandecappelle wrote:

> On 25/10/13 14:15, Gustavo Zacarias wrote:
> [snip]
>> @@ -95,3 +127,4 @@ define BOOST_INSTALL_STAGING_CMDS
>>   endef
>>
>>   $(eval $(generic-package))
>> +$(eval $(host-autotools-package))
> 
>  Wow, did it suddenly become an autotools package? :-)

Damn copy/paste!
For all intents and purposes it works since all the important steps are
redefined.
I'll sent a v2 tomorrow after seeing if there's anything else to touch
in the other patches.
Regards.
Ryan Barnett Oct. 26, 2013, 2:29 a.m. UTC | #5
Gustavo,

Gustavo Zacarias <gustavo@zacarias.com.ar> wrote on 10/25/2013 05:23:28 
PM:

> On 10/25/2013 06:53 PM, Ryan Barnett wrote:
> 
> > Gustavo,
> > 
> > Please see my comment below, otherwise looks good.
> > 
> > Gustavo Zacarias <gustavo@zacarias.com.ar> wrote on 10/25/2013 
07:15:20 
> > AM:
> > 
> >> +# keep host variant as minimal as possible
> > 
> > Could you expand more on what you are leaving enabled and why?
> 
> Just the barebones is enough for host-thrift (the tool) hence there's
> nothing to gain from a full host-boost other than longer build times.
> If the need arises it can be expanded in the future for other host-* 
users.

Mind adding a small comment along these lines - minimal configuration for 
host-thrift?

Thanks,
-Ryan
diff mbox

Patch

diff --git a/package/boost/boost.mk b/package/boost/boost.mk
index b0b3352..8a1a8f7 100644
--- a/package/boost/boost.mk
+++ b/package/boost/boost.mk
@@ -11,11 +11,19 @@  BOOST_SITE = http://downloads.sourceforge.net/project/boost/boost/$(BOOST_VERSIO
 BOOST_INSTALL_STAGING = YES
 
 TARGET_CC_VERSION = $(shell $(TARGET_CC) -dumpversion)
+HOST_CC_VERSION = $(shell $(HOSTCC) -dumpversion)
 
 BOOST_DEPENDENCIES =
 
 BOOST_FLAGS =
 
+# 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)
+
 # atomic library compile only with upstream version, wait for next release
 # coroutine breaks on some weak toolchains and it's new for 1.54+
 # log breaks with some toolchain combinations and it's new for 1.54+
@@ -54,6 +62,9 @@  ifeq ($(BR2_PACKAGE_BOOST_IOSTREAMS),y)
 BOOST_DEPENDENCIES += bzip2 zlib
 endif
 
+HOST_BOOST_OPT += toolset=gcc threading=multi variant=release link=shared \
+	runtime-link=shared
+
 BOOST_OPT += toolset=gcc \
 	     threading=multi \
 	     variant=$(if $(BR2_ENABLE_DEBUG),debug,release) \
@@ -78,6 +89,12 @@  define BOOST_CONFIGURE_CMDS
 	echo "" >> $(@D)/user-config.jam
 endef
 
+define HOST_BOOST_CONFIGURE_CMDS
+	(cd $(@D) && ./bootstrap.sh $(HOST_BOOST_FLAGS))
+	echo "using gcc : $(HOST_CC_VERSION) : $(HOSTCXX) : <cxxflags>\"$(HOST_CXXFLAGS)\" <linkflags>\"$(HOST_LDFLAGS)\" ;" > $(@D)/user-config.jam
+	echo "" >> $(@D)/user-config.jam
+endef
+
 define BOOST_INSTALL_TARGET_CMDS
 	(cd $(@D) && ./b2 -j$(PARALLEL_JOBS) -q -d+1 \
 	--user-config=$(@D)/user-config.jam \
@@ -86,6 +103,21 @@  define BOOST_INSTALL_TARGET_CMDS
 	--layout=system install )
 endef
 
+define HOST_BOOST_BUILD_CMDS
+	(cd $(@D) && ./b2 -j$(PARALLEL_JOBS) -q -d+1 \
+	--user-config=$(@D)/user-config.jam \
+	$(HOST_BOOST_OPT) \
+	--prefix=$(HOST_DIR)/usr )
+endef
+
+define HOST_BOOST_INSTALL_CMDS
+	(cd $(@D) && ./b2 -j$(PARALLEL_JOBS) -q -d+1 \
+	--user-config=$(@D)/user-config.jam \
+	$(HOST_BOOST_OPT) \
+	--prefix=$(HOST_DIR)/usr \
+	--layout=system install )
+endef
+
 define BOOST_INSTALL_STAGING_CMDS
 	(cd $(@D) && ./bjam -j$(PARALLEL_JOBS) -d+1 \
 	--user-config=$(@D)/user-config.jam \
@@ -95,3 +127,4 @@  define BOOST_INSTALL_STAGING_CMDS
 endef
 
 $(eval $(generic-package))
+$(eval $(host-autotools-package))