Skip to contentSkip to conversation

boost: make build with python an option

PATCH Superseded Derycke 4 participants 5 messages Mar 4, 2014

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Derycke

#0 lore raw

PATCH 2/2 boost: make build with python an option

Add an option to boost to build the Boost.Python library.
http://www.boost.org/doc/libs/1_55_0/libs/python/doc/index.html

---
 package/Config.in       |    1 +
 package/boost/Config.in |    4 ++++
 package/boost/boost.mk  |   13 +++++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)
package/Config.in +1 -0
index 6edf18e..47e345a 100644
@@ -442,6 +442,7 @@ source "package/python-id3/Config.in"
 source "package/python-ipy/Config.in"
 source "package/python-json-schema-validator/Config.in"
 source "package/python-keyring/Config.in"
+source "package/python-libconfig/Config.in"
 source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
 source "package/python-msgpack/Config.in"
package/boost/Config.in +4 -0
index 68c3909..a4fb745 100644
@@ -60,6 +60,10 @@ config BR2_PACKAGE_BOOST_MPI
 config BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
        bool "boost-program_options"
 
+config BR2_PACKAGE_BOOST_PYTHON
+       depends on BR2_PACKAGE_PYTHON
+       bool "boost-python"
+
 config BR2_PACKAGE_BOOST_RANDOM
        bool "boost-random"
 
package/boost/boost.mk +11 -2
index 7aab614..53d2b4d 100644
@@ -26,7 +26,7 @@ HOST_BOOST_FLAGS = --without-icu \
 # 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+
-BOOST_WITHOUT_FLAGS = atomic coroutine log python
+BOOST_WITHOUT_FLAGS = atomic coroutine log
 
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CHRONO),,chrono)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTEXT),,context)
@@ -40,6 +40,7 @@ BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_LOCALE),,locale)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MATH),,math)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MPI),,mpi)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PROGRAM_OPTIONS),,program_options)
+BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PYTHON),,python)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_RANDOM),,random)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_REGEX),,regex)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_SERIALIZATION),,serialization)
@@ -50,6 +51,8 @@ BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_THREAD),,thread)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_TIMER),,timer)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_WAVE),,wave)
 
+BOOST_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
+
 ifeq ($(BR2_PACKAGE_ICU),y)
 BOOST_FLAGS += --with-icu=$(STAGING_DIR)/usr
 BOOST_DEPENDENCIES += icu
@@ -61,6 +64,12 @@ ifeq ($(BR2_PACKAGE_BOOST_IOSTREAMS),y)
 BOOST_DEPENDENCIES += bzip2 zlib
 endif
 
+ifeq ($(BR2_PACKAGE_BOOST_PYTHON),y)
+BOOST_FLAGS += --with-python-root=$(HOST_DIR)
+BOOST_TARGET_CXXFLAGS += -I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)/
+BOOST_DEPENDENCIES += python
+endif
+
 HOST_BOOST_OPT += toolset=gcc threading=multi variant=release link=shared \
        runtime-link=shared
 
@@ -84,7 +93,7 @@ BOOST_FLAGS += $(if $(BOOST_WITHOUT_FLAGS_COMMASEPERATED), --without-libraries=$
 
 define BOOST_CONFIGURE_CMDS
        (cd $(@D) && ./bootstrap.sh $(BOOST_FLAGS))
-       echo "using gcc : $(TARGET_CC_VERSION) : $(TARGET_CXX) : <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
+       echo "using gcc : $(TARGET_CC_VERSION) : $(TARGET_CXX) : <cxxflags>\"$(BOOST_TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
        echo "" >> $(@D)/user-config.jam
 endef
 

--
1.7.10.4

Best regards,
Johan Derycke

This message is subject to the following terms and conditions: MAIL DISCLAIMER<http://www.barco.com/en/maildisclaimer>

#1 lore raw

PATCH 2/2 boost: make build with python an option

Hi Johan,

Quoted 15 lines · Johan

Add an option to boost to build the Boost.Python library.
http://www.boost.org/doc/libs/1_55_0/libs/python/doc/index.html

---
 package/Config.in       |    1 +
 package/boost/Config.in |    4 ++++
 package/boost/boost.mk  |   13 +++++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)
package/Config.in +0 -0
index 6edf18e..47e345a 100644

package/Config.in source "package/python-id3/Config.in" · line 445

Quoted 4 lines
package/Config.in +1 -0
@@ -442,6 +442,7 @@ source "package/python-id3/Config.in"
 source "package/python-ipy/Config.in"
 source "package/python-json-schema-validator/Config.in"
 source "package/python-keyring/Config.in"
+source "package/python-libconfig/Config.in"

This hunk should move to the previous patch.

baruch

Quoted 72 lines
package/Config.in +0 -0
 source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
 source "package/python-msgpack/Config.in"
package/boost/Config.in +4 -0
index 68c3909..a4fb745 100644
@@ -60,6 +60,10 @@ config BR2_PACKAGE_BOOST_MPI
 config BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
        bool "boost-program_options"
 
+config BR2_PACKAGE_BOOST_PYTHON
+       depends on BR2_PACKAGE_PYTHON
+       bool "boost-python"
+
 config BR2_PACKAGE_BOOST_RANDOM
        bool "boost-random"
 
package/boost/boost.mk +11 -3
index 7aab614..53d2b4d 100644
@@ -26,7 +26,7 @@ HOST_BOOST_FLAGS = --without-icu \
 # 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+
-BOOST_WITHOUT_FLAGS = atomic coroutine log python
+BOOST_WITHOUT_FLAGS = atomic coroutine log
 
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CHRONO),,chrono)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTEXT),,context)
@@ -40,6 +40,7 @@ BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_LOCALE),,locale)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MATH),,math)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MPI),,mpi)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PROGRAM_OPTIONS),,program_options)
+BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PYTHON),,python)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_RANDOM),,random)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_REGEX),,regex)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_SERIALIZATION),,serialization)
@@ -50,6 +51,8 @@ BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_THREAD),,thread)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_TIMER),,timer)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_WAVE),,wave)
 
+BOOST_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
+
 ifeq ($(BR2_PACKAGE_ICU),y)
 BOOST_FLAGS += --with-icu=$(STAGING_DIR)/usr
 BOOST_DEPENDENCIES += icu
@@ -61,6 +64,12 @@ ifeq ($(BR2_PACKAGE_BOOST_IOSTREAMS),y)
 BOOST_DEPENDENCIES += bzip2 zlib
 endif
 
+ifeq ($(BR2_PACKAGE_BOOST_PYTHON),y)
+BOOST_FLAGS += --with-python-root=$(HOST_DIR)
+BOOST_TARGET_CXXFLAGS += -I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)/
+BOOST_DEPENDENCIES += python
+endif
+
 HOST_BOOST_OPT += toolset=gcc threading=multi variant=release link=shared \
        runtime-link=shared
 
@@ -84,7 +93,7 @@ BOOST_FLAGS += $(if $(BOOST_WITHOUT_FLAGS_COMMASEPERATED), --without-libraries=$
 
 define BOOST_CONFIGURE_CMDS
        (cd $(@D) && ./bootstrap.sh $(BOOST_FLAGS))
-       echo "using gcc : $(TARGET_CC_VERSION) : $(TARGET_CXX) : <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
+       echo "using gcc : $(TARGET_CC_VERSION) : $(TARGET_CXX) : <cxxflags>\"$(BOOST_TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
        echo "" >> $(@D)/user-config.jam
 endef
 
--

1.7.10.4

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH 2/2 boost: make build with python an option

In reply to Derycke

Dear Derycke, Johan,

package/boost/Config.in config BR2_PACKAGE_BOOST_MPI · line 65

Quoted 3 lines · Johan
package/boost/Config.in +3 -0
+config BR2_PACKAGE_BOOST_PYTHON
+       depends on BR2_PACKAGE_PYTHON
+       bool "boost-python"

Just to confirm, boost-python only works with Python 2.x, and not Python 3.x ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/2 boost: make build with python an option

Quoted 10 lines · Thomas Petazzoni

Dear Derycke, Johan,

package/boost/Config.in config BR2_PACKAGE_BOOST_MPI · line 65

Quoted 3 lines · Johan
package/boost/Config.in +3 -0
+config BR2_PACKAGE_BOOST_PYTHON
+       depends on BR2_PACKAGE_PYTHON
+       bool "boost-python"

Just to confirm, boost-python only works with Python 2.x, and not Python 3.x ?

You can have boost-python for both python2 and python3.

Regards,

Signature · 1 line
Samuel
#4 lore raw

PATCH 2/2 boost: make build with python an option

In reply to Derycke

Hi,

Quoted 68 lines · Johan

Add an option to boost to build the Boost.Python library.
http://www.boost.org/doc/libs/1_55_0/libs/python/doc/index.html

---
 package/Config.in       |    1 +
 package/boost/Config.in |    4 ++++
 package/boost/boost.mk  |   13 +++++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)
package/Config.in +1 -0
index 6edf18e..47e345a 100644
@@ -442,6 +442,7 @@ source "package/python-id3/Config.in"
 source "package/python-ipy/Config.in"
 source "package/python-json-schema-validator/Config.in"
 source "package/python-keyring/Config.in"
+source "package/python-libconfig/Config.in"
 source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
 source "package/python-msgpack/Config.in"
package/boost/Config.in +4 -0
index 68c3909..a4fb745 100644
@@ -60,6 +60,10 @@ config BR2_PACKAGE_BOOST_MPI
 config BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
        bool "boost-program_options"
 
+config BR2_PACKAGE_BOOST_PYTHON
+       depends on BR2_PACKAGE_PYTHON
+       bool "boost-python"
+
 config BR2_PACKAGE_BOOST_RANDOM
        bool "boost-random"
 
package/boost/boost.mk +4 -1
index 7aab614..53d2b4d 100644
@@ -26,7 +26,7 @@ HOST_BOOST_FLAGS = --without-icu \
 # 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+
-BOOST_WITHOUT_FLAGS = atomic coroutine log python
+BOOST_WITHOUT_FLAGS = atomic coroutine log
 
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CHRONO),,chrono)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTEXT),,context)
@@ -40,6 +40,7 @@ BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_LOCALE),,locale)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MATH),,math)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MPI),,mpi)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PROGRAM_OPTIONS),,program_options)
+BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PYTHON),,python)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_RANDOM),,random)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_REGEX),,regex)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_SERIALIZATION),,serialization)
@@ -50,6 +51,8 @@ BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_THREAD),,thread)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_TIMER),,timer)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_WAVE),,wave)
 
+BOOST_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
+
 ifeq ($(BR2_PACKAGE_ICU),y)
 BOOST_FLAGS += --with-icu=$(STAGING_DIR)/usr
 BOOST_DEPENDENCIES += icu

package/boost/boost.mk ifeq ($(BR2_PACKAGE_BOOST_IOSTREAMS),y) · line 68

Quoted 5 lines
package/boost/boost.mk +2 -0
@@ -61,6 +64,12 @@ ifeq ($(BR2_PACKAGE_BOOST_IOSTREAMS),y)
 BOOST_DEPENDENCIES += bzip2 zlib
 endif
 
+ifeq ($(BR2_PACKAGE_BOOST_PYTHON),y)
+BOOST_FLAGS += --with-python-root=$(HOST_DIR)

wahoo, better than what i have in stock ;)
(https://github.com/tSed/buildroot/commit/2af8edf3d027892da91a499927d81232645d44c6)

Quoted 23 lines
package/boost/boost.mk +5 -2
+BOOST_TARGET_CXXFLAGS += -I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)/
+BOOST_DEPENDENCIES += python
+endif
+
 HOST_BOOST_OPT += toolset=gcc threading=multi variant=release link=shared \
        runtime-link=shared
 
@@ -84,7 +93,7 @@ BOOST_FLAGS += $(if $(BOOST_WITHOUT_FLAGS_COMMASEPERATED), --without-libraries=$
 
 define BOOST_CONFIGURE_CMDS
        (cd $(@D) && ./bootstrap.sh $(BOOST_FLAGS))
-       echo "using gcc : $(TARGET_CC_VERSION) : $(TARGET_CXX) : <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
+       echo "using gcc : $(TARGET_CC_VERSION) : $(TARGET_CXX) : <cxxflags>\"$(BOOST_TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
        echo "" >> $(@D)/user-config.jam
 endef
 
--

1.7.10.4

Best regards,
Johan Derycke

Quoted 5 lines

This message is subject to the following terms and conditions: MAIL DISCLAIMER<http://www.barco.com/en/maildisclaimer>
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Regards,

Signature · 1 line
Samuel