Skip to contentSkip to conversation

boost-asio: Add recipe

PATCH New Gustav Lindberg 1 participant 1 message Aug 26

lore
Share & tools
lore
#0 lore raw

PATCH 141/141 boost-asio: Add recipe

This is needed to build boost asio as a shared library rather than a header-only library, which is needed to save memory.

Change-Id I3ac5ed0ccadae3e9d042b9c4eed3a1ab7220a009
---
 .../boost-asio/boost-asio_1.90.0.bb           | 33 +++++++++++++++++++
 .../boost-asio/files/boost_asio.cpp           |  2 ++
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-support/boost-asio/boost-asio_1.90.0.bb
 create mode 100644 meta/recipes-support/boost-asio/files/boost_asio.cpp
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +33 -0
new file mode 100644
index 0000000000..ea534ff172
@@ -0,0 +1,33 @@
+SUMMARY = "Boost.Asio shared library shim"
+DESCRIPTION = "Builds libboost_asio as a shared library from boost/asio/impl/src.hpp"
+HOMEPAGE = "https://www.boost.org/doc/libs/1_90_0/doc/html/boost_asio.html"
+
+# Reuse Boost source and licensing metadata from openembedded-core.
+require recipes-support/boost/boost-${PV}.inc
+
+SRC_URI += " file://boost_asio.cpp"
+
+DEPENDS = "boost"
+
+do_compile() {
+	${CXX} ${CPPFLAGS} ${CXXFLAGS} \
+		-std=c++23 \
+		-DBOOST_ASIO_DYN_LINK=1 \
+		-fPIC \
+		-shared \
+		-Wl,-soname,libboost_asio.so.1 \
+		${UNPACKDIR}/boost_asio.cpp \
+		${LDFLAGS} \
+		-o ${B}/libboost_asio.so.${PV}
+}
+
+do_install() {
+	install -d ${D}${libdir}
+	install -m 0755 ${B}/libboost_asio.so.${PV} ${D}${libdir}/
+	ln -sf libboost_asio.so.${PV} ${D}${libdir}/libboost_asio.so.1
+	ln -sf libboost_asio.so.1 ${D}${libdir}/libboost_asio.so
+}
+
+FILES:${PN} += "${libdir}/libboost_asio.so.*"
+
+BBCLASSEXTEND = "native"
meta/recipes-support/boost-asio/files/boost_asio.cpp new file +2 -0
new file mode 100644
index 0000000000..b10a8f3997
@@ -0,0 +1,2 @@
+#include <boost/asio/impl/src.hpp>
+#include <boost/asio/ssl/impl/src.hpp>
Signature · 1 line
2.43.0