buildroot/package/ne10/ne10.mk
Thomas Petazzoni 0b764a7d1e package/ne10: install shared libraries only when built
The install to staging commands of the ne10 package are careful to
install the shared libraries only if they are built, but we forgot to
use the same care for the install to target commands, causing a build
failure on BR2_STATIC_LIBS=y configurations as no shared library was
built:

cp: cannot stat '/home/autobuild/autobuild/instance-15/output-1/build/ne10-1.2.1/modules/libNE10*.so*': No such file or directory

This commit fixes this by guarding the target installation commands to
BR2_STATIC_LIBS being empty.

The problem exists since the package was introduced in commit
318f3db0dc ("ne10: new package"), a good
10 years ago. Most likely it was not seen for many years as this
package is only available for ARM with NEON and AArch64, and we were
not testing fully static builds, except for ARMv5 that don't have
NEON. Now that we are doing more random testing, the problem started
being visible.

Fixes:

  http://autobuild.buildroot.net/results/45b2c1af052271bc2f1bb96544f138d29e4f7dfd/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2023-09-21 20:26:16 +02:00

52 lines
1.3 KiB
Makefile

################################################################################
#
# ne10
#
################################################################################
NE10_VERSION = 1.2.1
NE10_SITE = $(call github,projectNe10,Ne10,v$(NE10_VERSION))
NE10_LICENSE = BSD-3-Clause or Apache-2.0
NE10_LICENSE_FILES = doc/LICENSE
NE10_INSTALL_STAGING = YES
NE10_CONF_OPTS = \
-DGNULINUX_PLATFORM=ON \
-DNE10_BUILD_EXAMPLES=OFF \
-DNE10_BUILD_UNIT_TEST=OFF \
-DNE10_LINUX_TARGET_ARCH=$(if $(BR2_aarch64),aarch64,armv7)
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
NE10_CONF_OPTS += -DNE10_ENABLE_DSP=ON
else
NE10_CONF_OPTS += -DNE10_ENABLE_DSP=OFF
endif
ifeq ($(BR2_STATIC_LIBS),)
NE10_CONF_OPTS += \
-DNE10_BUILD_SHARED=ON
endif
# The package does not have any install target, so have to provide
# INSTALL_STAGING_CMDS and INSTALL_TARGET_CMDS.
ifeq ($(BR2_STATIC_LIBS),)
define NE10_INSTALL_STAGING_SHARED_LIB
cp -dpf $(@D)/modules/libNE10*.so* $(STAGING_DIR)/usr/lib/
endef
endif
define NE10_INSTALL_STAGING_CMDS
cp -dpf $(@D)/inc/NE10*h $(STAGING_DIR)/usr/include/
cp -dpf $(@D)/modules/libNE10.a $(STAGING_DIR)/usr/lib/
$(NE10_INSTALL_STAGING_SHARED_LIB)
endef
ifeq ($(BR2_STATIC_LIBS),)
define NE10_INSTALL_TARGET_CMDS
cp -dpf $(@D)/modules/libNE10*.so* $(TARGET_DIR)/usr/lib/
endef
endif
$(eval $(cmake-package))