All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustav Lindberg <gustali@axis.com>
To: <openembedded-core@lists.openembedded.org>
Cc: Gustav Lindberg <gustali@axis.com>
Subject: [PATCHv5] boost-asio: Add recipe
Date: Tue, 1 Sep 2026 10:31:56 +0200	[thread overview]
Message-ID: <20260901083157.3345681-1-gustali@axis.com> (raw)

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

Signed-off-by: Gustav Lindberg <gustali@axis.com>
---
 .../boost/boost-asio/boost_asio.cpp           |  1 +
 .../boost/boost-asio_1.92.0.bb                | 33 +++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-support/boost/boost-asio/boost_asio.cpp
 create mode 100644 meta/recipes-support/boost/boost-asio_1.92.0.bb

diff --git a/meta/recipes-support/boost/boost-asio/boost_asio.cpp b/meta/recipes-support/boost/boost-asio/boost_asio.cpp
new file mode 100644
index 0000000000..bf00c8ff26
--- /dev/null
+++ b/meta/recipes-support/boost/boost-asio/boost_asio.cpp
@@ -0,0 +1 @@
+#include <boost/asio/impl/src.hpp>
diff --git a/meta/recipes-support/boost/boost-asio_1.92.0.bb b/meta/recipes-support/boost/boost-asio_1.92.0.bb
new file mode 100644
index 0000000000..e275a3b61b
--- /dev/null
+++ b/meta/recipes-support/boost/boost-asio_1.92.0.bb
@@ -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"
+
+DEPENDS = "boost"
+
+# Reuse Boost source and licensing metadata.
+require recipes-support/boost/boost-${PV}.inc
+
+SRC_URI += " file://boost_asio.cpp;subdir=${BOOST_P}"
+
+MAJOR_VER = "${@oe.utils.trim_version("${PV}", 1)}"
+
+do_compile() {
+	${CXX} ${CPPFLAGS} ${CXXFLAGS} \
+		-std=c++23 \
+		-DBOOST_ASIO_DYN_LINK=1 \
+		-fPIC \
+		-shared \
+		-Wl,-soname,libboost_asio.so.${MAJOR_VER} \
+		${S}/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.${MAJOR_VER}
+	ln -sf libboost_asio.so.${MAJOR_VER} ${D}${libdir}/libboost_asio.so
+}
+
+BBCLASSEXTEND = "native"
-- 
2.43.0



             reply	other threads:[~2026-09-01  8:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  8:31 Gustav Lindberg [this message]
2026-09-02  5:56 ` [OE-core] [PATCHv5] boost-asio: Add recipe Mathieu Dubois-Briand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260901083157.3345681-1-gustali@axis.com \
    --to=gustali@axis.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.