lvm2/0019-configure-autoreconf.patch

272 lines
7.9 KiB
Diff
Raw Normal View History

From f8d2dda397803b2c274da8eec78b04423c5150dd Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Mon, 9 Dec 2024 14:35:16 +0100
Subject: [PATCH 3/3] configure: autoreconf
(cherry picked from commit 928b8e9c6eaf871b3405b91c64eac5ea854f2572)
---
configure | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 191 insertions(+)
diff --git a/configure b/configure
index 5147c7910..e98f7c1f3 100755
--- a/configure
+++ b/configure
@@ -787,6 +787,8 @@ LIBSYSTEMD_LIBS
LIBSYSTEMD_CFLAGS
UDEV_LIBS
UDEV_CFLAGS
+LIBNVME_LIBS
+LIBNVME_CFLAGS
BLKID_LIBS
BLKID_CFLAGS
SYSTEMD_RUN_CMD
@@ -912,6 +914,7 @@ enable_silent_rules
enable_static_link
enable_shared
with_blkid
+with_libnvme
with_systemd
with_udev
with_user
@@ -973,6 +976,7 @@ enable_systemd_journal
enable_app_machineid
with_systemd_run
enable_blkid_wiping
+enable_nvme_wwid
enable_udev_sync
enable_udev_rules
enable_udev_rule_exec_detection
@@ -1045,6 +1049,8 @@ LIBSEAGATEILM_CFLAGS
LIBSEAGATEILM_LIBS
BLKID_CFLAGS
BLKID_LIBS
+LIBNVME_CFLAGS
+LIBNVME_LIBS
UDEV_CFLAGS
UDEV_LIBS
LIBSYSTEMD_CFLAGS
@@ -1715,6 +1721,7 @@ Optional Features:
--disable-app-machineid disable LVM system ID using app-specific machine-id
--disable-blkid_wiping disable libblkid detection of signatures when wiping
and use native code instead
+ --disable-nvme-wwid do not use libnvme to detect alternate WWIDs
--enable-udev_sync enable synchronization with udev processing
--enable-udev_rules install rule files needed for udev synchronization
--enable-udev-rule-exec-detection
@@ -1741,6 +1748,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-blkid do not build with blkid library
+ --without-libnvme do not build with libnvme library
--without-systemd do not build with systemd library
--without-udev do not build with udev library
--with-user=USER set the owner of installed files [USER=]
@@ -1880,6 +1888,10 @@ Some influential environment variables:
BLKID_CFLAGS
C compiler flags for BLKID, overriding pkg-config
BLKID_LIBS linker flags for BLKID, overriding pkg-config
+ LIBNVME_CFLAGS
+ C compiler flags for LIBNVME, overriding pkg-config
+ LIBNVME_LIBS
+ linker flags for LIBNVME, overriding pkg-config
UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
UDEV_LIBS linker flags for UDEV, overriding pkg-config
LIBSYSTEMD_CFLAGS
@@ -9128,6 +9140,16 @@ esac
fi
+# Check whether --with-libnvme was given.
+if test ${with_libnvme+y}
+then :
+ withval=$with_libnvme;
+else case e in #(
+ e) with_libnvme="yes" ;;
+esac
+fi
+
+
# Check whether --with-systemd was given.
if test ${with_systemd+y}
then :
@@ -13129,6 +13151,175 @@ printf "%s\n" "$BLKID_WIPING" >&6; }
printf "%s\n" "#define DEFAULT_USE_BLKID_WIPING $DEFAULT_USE_BLKID_WIPING" >>confdefs.h
+################################################################################
+# Check whether --enable-nvme-wwid was given.
+if test ${enable_nvme_wwid+y}
+then :
+ enableval=$enable_nvme_wwid; NVME_WWID=$enableval
+else case e in #(
+ e) if test "$with_libnvme" = "yes"
+then :
+ NVME_WWID="maybe"
+else case e in #(
+ e) NVME_WWID="no" ;;
+esac
+fi ;;
+esac
+fi
+
+
+# ATM NVME_WWID is the only user of libnvme, so skip checking for libnvme when disabled
+if test "$NVME_WWID" = "no"
+then :
+ with_libnvme="no"
+fi
+
+if test "$with_libnvme" = "yes"
+then :
+
+
+pkg_failed=no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libnvme >= 1.4" >&5
+printf %s "checking for libnvme >= 1.4... " >&6; }
+
+if test -n "$LIBNVME_CFLAGS"; then
+ pkg_cv_LIBNVME_CFLAGS="$LIBNVME_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnvme >= 1.4\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libnvme >= 1.4") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBNVME_CFLAGS=`$PKG_CONFIG --cflags "libnvme >= 1.4" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBNVME_LIBS"; then
+ pkg_cv_LIBNVME_LIBS="$LIBNVME_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnvme >= 1.4\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libnvme >= 1.4") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBNVME_LIBS=`$PKG_CONFIG --libs "libnvme >= 1.4" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBNVME_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnvme >= 1.4" 2>&1`
+ else
+ LIBNVME_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnvme >= 1.4" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBNVME_PKG_ERRORS" >&5
+
+ if test "$NVME_WWID" = "yes"
+then :
+ NVME_WWID="error"
+fi
+elif test $pkg_failed = untried; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ if test "$NVME_WWID" = "yes"
+then :
+ NVME_WWID="error"
+fi
+else
+ LIBNVME_CFLAGS=$pkg_cv_LIBNVME_CFLAGS
+ LIBNVME_LIBS=$pkg_cv_LIBNVME_LIBS
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for NVME_NIDT_CSI in libnvme.h" >&5
+printf %s "checking for NVME_NIDT_CSI in libnvme.h... " >&6; }
+if test ${ac_cv_have_libnvme_csi+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <libnvme.h>
+const int a = NVME_NIDT_CSI;
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_have_libnvme_csi="yes"
+else case e in #(
+ e) ac_cv_have_libnvme_csi="no" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_libnvme_csi" >&5
+printf "%s\n" "$ac_cv_have_libnvme_csi" >&6; }
+
+ if test "$NVME_WWID" != "no"
+then :
+
+ if test $ac_cv_have_libnvme_csi = yes
+then :
+ NVME_WWID="yes"
+
+printf "%s\n" "#define NVME_SUPPORT 1" >>confdefs.h
+
+else case e in #(
+ e) NVME_WWID="error" ;;
+esac
+fi
+fi
+
+fi
+
+else case e in #(
+ e) if test "$NVME_WWID" = "yes"
+then :
+ NVME_WWID="error"
+fi ;;
+esac
+fi
+
+if test "$NVME_WWID" = "error"
+then :
+ as_fn_error $? "--enable-nvme-wwid requires libnvme library >= 1.1. (--with-libnvme=$with_libnvme)" "$LINENO" 5
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use libnvme for alternate WWIDs" >&5
+printf %s "checking whether to use libnvme for alternate WWIDs... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NVME_WWID" >&5
+printf "%s\n" "$NVME_WWID" >&6; }
+
################################################################################
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable synchronization with udev processing" >&5
printf %s "checking whether to enable synchronization with udev processing... " >&6; }
--
2.47.1