From 9c676e4e2cb01a7e90e690519d1148a52adc4052 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 30 Apr 2025 10:14:39 +0200 Subject: [PATCH] build-from-source: enable nbft support only if the library is available libnvme >= 1.5 is available only since RHEL 9.4. Disable nbft support at build time otherwise. --- contrib/rh-bkr/build-from-source.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/rh-bkr/build-from-source.sh b/contrib/rh-bkr/build-from-source.sh index e0b788e739..29c0012798 100755 --- a/contrib/rh-bkr/build-from-source.sh +++ b/contrib/rh-bkr/build-from-source.sh @@ -100,6 +100,13 @@ if [[ "$INSTALL_DEPENDENCIES" == yes ]]; then -y fi +# libnvme >= 1.5 is available in RHEL 9.4+, disable when missing +if pkgconf 'libnvme >= 1.5'; then + _WITH_NBFT="true" +else + _WITH_NBFT="false" +fi + if [[ "$DO_TEST_BUILD" == yes ]]; then # for the tests, let's pre-load some modules: $SUDO modprobe ip_gre || true @@ -214,7 +221,8 @@ if [[ "$DO_TEST_BUILD" == yes ]]; then -Dconfig_dhcp_default=internal \ -Dconfig_dns_rc_manager_default=auto \ -Diptables=/usr/sbin/iptables \ - -Dnft=/usr/bin/nft + -Dnft=/usr/bin/nft \ + -Dnbft=${_WITH_NBFT} ninja -C ./build ninja test -C ./build