package/lvm2: add static build support

Add static build support for device mapper

Lvm2 standard install still requires dynamic library

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
Andreas Mohr
2026-05-23 15:19:03 +00:00
committed by Arnout Vandecappelle
parent 6547d32302
commit 85eb42f33d
2 changed files with 15 additions and 3 deletions

View File

@@ -2,7 +2,6 @@ config BR2_PACKAGE_LVM2
bool "lvm2 & device mapper"
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_MMU # needs fork()
depends on !BR2_STATIC_LIBS # It fails to build statically
help
This is LVM2, the rewrite of The Linux Logical Volume Manager.
LVM supports enterprise level volume management of disk and
@@ -26,13 +25,17 @@ if BR2_PACKAGE_LVM2
config BR2_PACKAGE_LVM2_STANDARD_INSTALL
bool "standard install instead of only dmsetup"
default y
depends on !BR2_STATIC_LIBS
select BR2_PACKAGE_LIBAIO
help
Install the standard suite of lvm2 programs. When this option
is not set, only dmsetup is installed.
comment "lvm2 standard install needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS
endif
comment "lvm2 needs a toolchain w/ threads, dynamic library"
comment "lvm2 needs a toolchain w/ threads"
depends on BR2_USE_MMU
depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
depends on !BR2_TOOLCHAIN_HAS_THREADS

View File

@@ -48,6 +48,15 @@ else
LVM2_CONF_OPTS += --disable-selinux
endif
ifeq ($(BR2_STATIC_LIBS),y)
# configure: error: --enable-cmdlib requires dynamic linking.
LVM2_CONF_OPTS += --disable-cmdlib
# configure: error: --enable-dmeventd requires --enable-cmdlib to be used as well
LVM2_CONF_OPTS += --disable-dmeventd
# install static version of the devmapper library
LVM2_CONF_OPTS += --enable-static_link
endif
ifeq ($(BR2_PACKAGE_LVM2_STANDARD_INSTALL),y)
LVM2_DEPENDENCIES += libaio
LVM2_INSTALL_STAGING_OPTS += install