[Buildroot] [PATCH 4/5] package/libshdata: new package

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Nov 3 15:50:00 UTC 2021


Hello,

On Wed,  3 Nov 2021 08:36:55 +0100
Herve Codina <herve.codina at bootlin.com> wrote:

> The libshdata library provides lock free shared-memory tools.
> 
> https://github.com/Parrot-Developers/libshdata
> 
> The provided patch was submitted upstream.
> https://github.com/Parrot-Developers/libshdata/issues/1

This should rather go in the patch itself.


> diff --git a/package/libshdata/Config.in b/package/libshdata/Config.in
> new file mode 100644
> index 0000000000..730fb34dff
> --- /dev/null
> +++ b/package/libshdata/Config.in
> @@ -0,0 +1,23 @@
> +config BR2_PACKAGE_LIBSHDATA
> +	bool "libshdata"
> +	depends on BR2_TOOLCHAIN_HAS_SYNC_4
> +	depends on BR2_TOOLCHAIN_HAS_ATOMIC # libfutils
> +	depends on BR2_INSTALL_LIBSTDCPP # libfutils
> +	depends on BR2_TOOLCHAIN_HAS_THREADS # libfutils
> +	select BR2_PACKAGE_LIBFUTILS
> +	help
> +	  This library provides lock free shared-memory tools
> +
> +	  https://github.com/Parrot-Developers/libshdata
> +
> +comment "libshdata needs a toolchain w/ C++, threads"
> +	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS

This needs to go *after* the if ... endif block, or the indentation of
the if ... endif block is broken in menuconfig. Also, you need to
account for the HAS_SYNC_4 and HAS_ATOMIC dependencies.


> +define LIBSHDATA_BUILD_CMDS
> +	$(ALCHEMY_TARGET_CONFIGURE_ENV) \
> +	$(call ALCHEMY_TARGET_CONFIGURE_SDKS, libfutils) \
> +	$(LIBSHDATA_CONF_ENV) \
> +	$(ALCHEMY_MAKE) $(LIBSHDATA_TARGETS)

Indentation.

> +endef
> +
> +define LIBSHDATA_INSTALL_STATIC_LIBS
> +	$(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata.a $(strip $(1))/usr/lib/
> +	$(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata-section-lookup.a $(strip $(1))/usr/lib/
> +endef
> +
> +define LIBSHDATA_INSTALL_HEADERS
> +	cp -Raf $(@D)/include/* $(strip $(1))/usr/include/
> +endef
> +
> +ifeq ($(BR2_STATIC_LIBS),)
> +define LIBSHDATA_INSTALL_SHARED_LIBS
> +	$(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libshdata.so* $(strip $(1))/usr/lib/

Sot here are two separate static libraries, but only one shared library ?

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com


More information about the buildroot mailing list