boost.mk: allow building both static and shared
authorJonathan Ben Avraham <yba@tkos.co.il>
Sun, 25 Oct 2015 09:52:53 +0000 (11:52 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 26 Oct 2015 06:28:09 +0000 (07:28 +0100)
Use BR2_SHARED_STATIC_LIBS for building both static and shared boost libs.
The static libs are copied to the staging directory. Only the shared libs are
copied to the rootfs image.

[Thomas:
 - remove empty else clause, and instead add a comment that explains
   why we're doing something only for the BR2_STATIC_LIBS=y and
   BR2_SHARED_LIBS=y.
 - remove trailing backslash at the end of the BOOST_CONF_OPTS
   definition.]

Signed-off-by: Jonathan Ben Avraham <yba@tkos.co.il>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/boost/boost.mk

index 8159ed579f6c25c48441bf19d84700522e01904e..16d05cd99bdad5d4059c46a09df844ced1b11bf3 100644 (file)
@@ -89,9 +89,15 @@ endif
 BOOST_OPTS += toolset=gcc \
             threading=multi \
             abi=$(BOOST_ABI) \
-            variant=$(if $(BR2_ENABLE_DEBUG),debug,release) \
-            link=$(if $(BR2_STATIC_LIBS),static,shared) \
-            runtime-link=$(if $(BR2_STATIC_LIBS),static,shared)
+            variant=$(if $(BR2_ENABLE_DEBUG),debug,release)
+
+# By default, Boost build and installs both the shared and static
+# variants. Override that if we want static only or shared only.
+ifeq ($(BR2_STATIC_LIBS),y)
+BOOST_OPTS += link=static runtime-link=static
+else ifeq ($(BR2_SHARED_LIBS),y)
+BOOST_OPTS += link=shared runtime-link=shared
+endif
 
 ifeq ($(BR2_PACKAGE_BOOST_LOCALE),y)
 ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)