* [ndctl PATCH] ndctl, build: Define HAVE_UUID
@ 2018-11-28 21:42 Dan Williams
0 siblings, 0 replies; only message in thread
From: Dan Williams @ 2018-11-28 21:42 UTC (permalink / raw)
To: linux-nvdimm
Attempts to build ndctl in an epel-6 environment fail with the following
messages:
In file included from util/filter.c:24:
./daxctl/libdaxctl.h:22: error: redefinition of typedef 'uuid_t'
./ndctl/libndctl.h:26: note: previous declaration of 'uuid_t' was here
Newer compilers discard the error since it sees the types are
compatible, but the definition should be coming from uuid.h when built
with libuuid. Arrange for an AC_DEFINE for the HAVE_UUID symbol when
libuuid is detected by PKG_CHECK_MODULES.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
configure.ac | 3 ++-
daxctl/libdaxctl.h | 2 +-
ndctl/libndctl.h | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index bb6b03324ea8..de5b84cec670 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,7 +112,8 @@ AM_CONDITIONAL([ENABLE_POISON],
PKG_CHECK_MODULES([KMOD], [libkmod])
PKG_CHECK_MODULES([UDEV], [libudev])
-PKG_CHECK_MODULES([UUID], [uuid])
+PKG_CHECK_MODULES([UUID], [uuid],
+ [AC_DEFINE([HAVE_UUID], [1], [Define to 1 if using libuuid])])
PKG_CHECK_MODULES([JSON], [json-c])
AC_ARG_WITH([bash],
diff --git a/daxctl/libdaxctl.h b/daxctl/libdaxctl.h
index 21bc376ce629..1d13ea291f6f 100644
--- a/daxctl/libdaxctl.h
+++ b/daxctl/libdaxctl.h
@@ -16,7 +16,7 @@
#include <stdarg.h>
#include <unistd.h>
-#ifdef HAVE_LIBUUID
+#ifdef HAVE_UUID
#include <uuid/uuid.h>
#else
typedef unsigned char uuid_t[16];
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 62cef9e82da3..c81cc032ebae 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -20,7 +20,7 @@
#include <errno.h>
#include <limits.h>
-#ifdef HAVE_LIBUUID
+#ifdef HAVE_UUID
#include <uuid/uuid.h>
#else
typedef unsigned char uuid_t[16];
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-28 21:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28 21:42 [ndctl PATCH] ndctl, build: Define HAVE_UUID Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).