nvme: add optional udev support
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 19 Apr 2016 01:54:24 +0000 (11:54 +1000)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 19 Apr 2016 07:33:18 +0000 (09:33 +0200)
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>
package/nvme/nvme.mk

index 7c4bd8eb072ca8b47fd862d2750a23de56ca2d59..b745025fdf49490f64de1d638ca71d068ff8e650 100755 (executable)
@@ -9,10 +9,19 @@ NVME_SITE = $(call github,linux-nvme,nvme-cli,$(NVME_VERSION))
 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