Commands like 'nvme list' require libudev but support for libudev is
decided at compile time, and in buildroot this is hard disabled.
Add a check for udev and if it is available build nvme with udev
support.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
[Thomas:
- add comment to explain the LIBUDEV variable value
- use += instead of = to assign <pkg>_MAKE_OPTS.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
NVME_LICENSE = GPLv2+
NVME_LICENSE_FILES = LICENSE
+# Yes LIBUDEV=0 means udev support enabled, LIBUDEV=1 means udev
+# support disabled.
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+NVME_DEPENDENCIES += udev
+NVME_MAKE_OPTS += LIBUDEV=0
+else
+NVME_MAKE_OPTS += LIBUDEV=1
+endif
+
# LIBUDEV=1 means that libudev is _disabled_
define NVME_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \
- LIBUDEV=1 -C $(@D)
+ $(NVME_MAKE_OPTS) -C $(@D)
endef
define NVME_INSTALL_TARGET_CMDS