aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2016-03-31 14:50:16 -0700
committerBrian Behlendorf <[email protected]>2016-03-31 14:54:47 -0700
commite4023e42a8cb0d267870db82f75e23d4efb9fbd9 (patch)
treecf46b978e31316cb32bb33007a77b2855957523d
parent39fc0cb5577e409f415e25d35a452b46996c08b1 (diff)
Only build devname2devid when libudev headers are available
Accidentally introduced by commit 39fc0cb. The devname2devid utility which depends on libudev must only be built when libudev headers are available. This is accomplished through an AM_CONDITIONAL. Signed-off-by: Brian Behlendorf <[email protected]> Issue #4416
-rw-r--r--config/user-libudev.m413
-rw-r--r--tests/zfs-tests/cmd/devname2devid/Makefile.am2
2 files changed, 12 insertions, 3 deletions
diff --git a/config/user-libudev.m4 b/config/user-libudev.m4
index 143f77f76..2a8025903 100644
--- a/config/user-libudev.m4
+++ b/config/user-libudev.m4
@@ -4,10 +4,17 @@ dnl #
AC_DEFUN([ZFS_AC_CONFIG_USER_LIBUDEV], [
LIBUDEV=
- AC_CHECK_HEADER([libudev.h], [AC_SUBST([LIBUDEV], ["-ludev"])
- AC_DEFINE([HAVE_LIBUDEV], 1, [Define if you have libudev])], [])
+ AC_CHECK_HEADER([libudev.h], [
+ libudev=yes
+ AC_SUBST([LIBUDEV], ["-ludev"])
+ AC_DEFINE([HAVE_LIBUDEV], 1, [Define if you have libudev])
+ ], [
+ libudev=no
+ ])
- AC_SEARCH_LIBS(i[udev_device_get_is_initialized], [udev], [
+ AM_CONDITIONAL([WANT_DEVNAME2DEVID], [ test x$libudev = xyes ])
+ AC_SEARCH_LIBS([udev_device_get_is_initialized], [udev], [
AC_DEFINE([HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED], 1, [
Define if udev_device_get_is_initialized is available])], [])
+
])
diff --git a/tests/zfs-tests/cmd/devname2devid/Makefile.am b/tests/zfs-tests/cmd/devname2devid/Makefile.am
index 55811b7a7..a8991bb78 100644
--- a/tests/zfs-tests/cmd/devname2devid/Makefile.am
+++ b/tests/zfs-tests/cmd/devname2devid/Makefile.am
@@ -2,6 +2,8 @@ include $(top_srcdir)/config/Rules.am
pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/bin
+if WANT_DEVNAME2DEVID
pkgexec_PROGRAMS = devname2devid
devname2devid_SOURCES = devname2devid.c
devname2devid_LDADD = -ludev
+endif