Skip to contentSkip to conversation

boost-asio: Add recipe

PATCH Superseded Gustav Lindberg 2 participants 3 messages Aug 26 1 message not in the archive

v1 of 6 Superseded Latest is v6 →

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           |  1 +
 2 files changed, 34 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 +1 -0
new file mode 100644
index 0000000000..bf00c8ff26
@@ -0,0 +1 @@
+#include <boost/asio/impl/src.hpp>
Signature · 1 line
2.43.0
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Gustav Lindberg via lists.openembedded.org
Sent: den 26 augusti 2026 12:00
To: [email protected]
Cc: Gustav Lindberg <[email protected]>
Subject: [OE-core] [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

Remove the Change-Id.

Quoted 14 lines
---
 .../boost-asio/boost-asio_1.90.0.bb           | 33 +++++++++++++++++++
 .../boost-asio/files/boost_asio.cpp           |  1 +
 2 files changed, 34 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 +0 -0
new file mode 100644
index 0000000000..ea534ff172

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 5

Quoted 5 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +5 -0
@@ -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.

Since this is aimed for OE-Core, the "from openembedded-core" is redundant and can be removed.

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 10

Quoted 5 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +5 -0
+require recipes-support/boost/boost-${PV}.inc
+
+SRC_URI += " file://boost_asio.cpp"
+
+DEPENDS = "boost"

Move DEPENDS up to between HOMEPAGE and the require.

Quoted 8 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +8 -0
+
+do_compile() {
+       ${CXX} ${CPPFLAGS} ${CXXFLAGS} \
+               -std=c++23 \
+               -DBOOST_ASIO_DYN_LINK=1 \
+               -fPIC \
+               -shared \
+               -Wl,-soname,libboost_asio.so.1 \

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 28

Quoted 10 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +10 -0
+               ${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

This assumes the major of ${PV} is 1 and updating it will be easy to miss if the major is ever increased. There is a function that can be used to extract part(s) of the version number, e.g.:

MAJOR_VER = "${@oe.utils.trim_version("${PV}", 1)}"

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 29

Quoted 1 line
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +1 -0
+}

Use tabs to indent the shell functions above.

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 31

Quoted 2 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +2 -0
+
+FILES:${PN} += "${libdir}/libboost_asio.so.*"

This should not be needed.

Quoted 11 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +2 -0
+
+BBCLASSEXTEND = "native"
meta/recipes-support/boost-asio/files/boost_asio.cpp new file +1 -1
new file mode 100644
index 0000000000..bf00c8ff26
@@ -0,0 +1 @@
+#include <boost/asio/impl/src.hpp>
--

2.43.0

//Peter

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 13 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: den 26 augusti 2026 15:36
To: Gustav Lindberg <[email protected]>; [email protected]
Subject: Re: [OE-core] [PATCH 141/141] boost-asio: Add recipe

Quoted 7 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Gustav Lindberg via lists.openembedded.org
Sent: den 26 augusti 2026 12:00
To: [email protected]
Cc: Gustav Lindberg <[email protected]>
Subject: [OE-core] [PATCH 141/141] boost-asio: Add recipe

Quoted 11 lines
Quoted 4 lines

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

Remove the Change-Id.

Quoted 4 lines
---
 .../boost-asio/boost-asio_1.90.0.bb           | 33 +++++++++++++++++++
 .../boost-asio/files/boost_asio.cpp           |  1 +

It would probably also make more sense to put the recipe in "meta/recipes-support/boost" together with the current boost recipe, and put the .cpp file in "meta/recipes-support/boost/boost-asio".

Quoted 61 lines
Quoted 10 lines
 2 files changed, 34 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 +0 -0
new file mode 100644
index 0000000000..ea534ff172

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 5

Quoted 5 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +5 -0
@@ -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.

Since this is aimed for OE-Core, the "from openembedded-core" is redundant and can be removed.

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 10

Quoted 5 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +5 -0
+require recipes-support/boost/boost-${PV}.inc
+
+SRC_URI += " file://boost_asio.cpp"
+
+DEPENDS = "boost"

Move DEPENDS up to between HOMEPAGE and the require.

Quoted 8 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +8 -0
+
+do_compile() {
+       ${CXX} ${CPPFLAGS} ${CXXFLAGS} \
+               -std=c++23 \
+               -DBOOST_ASIO_DYN_LINK=1 \
+               -fPIC \
+               -shared \
+               -Wl,-soname,libboost_asio.so.1 \

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 28

Quoted 10 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +10 -0
+               ${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

This assumes the major of ${PV} is 1 and updating it will be easy to miss if the major is ever increased. There is a function that can be used to extract part(s) of the version number, e.g.:

MAJOR_VER = "${@oe.utils.trim_version("${PV}", 1)}"

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 29

Quoted 1 line
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +1 -0
+}

Use tabs to indent the shell functions above.

meta/recipes-support/boost-asio/boost-asio_1.90.0.bb line 31

Quoted 2 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +2 -0
+
+FILES:${PN} += "${libdir}/libboost_asio.so.*"

This should not be needed.

Quoted 13 lines
Quoted 11 lines
meta/recipes-support/boost-asio/boost-asio_1.90.0.bb new file +2 -0
+
+BBCLASSEXTEND = "native"
meta/recipes-support/boost-asio/files/boost_asio.cpp new file +1 -1
new file mode 100644
index 0000000000..bf00c8ff26
@@ -0,0 +1 @@
+#include <boost/asio/impl/src.hpp>
--

2.43.0

//Peter

//Peter