linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH] ndctl, build: Define HAVE_UUID
Date: Wed, 28 Nov 2018 13:42:12 -0800	[thread overview]
Message-ID: <154344133285.1069420.11463868512402749463.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)

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

                 reply	other threads:[~2018-11-28 21:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=154344133285.1069420.11463868512402749463.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).