public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: util-linux-ng@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH] xfsprogs: allow using libblkid instead of libdisk
Date: Wed, 07 Oct 2009 13:52:47 -0500	[thread overview]
Message-ID: <4ACCE37F.4070006@sandeen.net> (raw)
In-Reply-To: <20091006185252.GA10250@infradead.org>

Christoph Hellwig wrote:
> Add a new --enable-blkid switch to use libblkid from util-linux to detect
> the device geometry and check for existing partitions or filesystem on a
> device.  Note that this requires the latest blkid from util-linux-ng git
> for the topology calls, odler ones won't work.  If I had a little more
> autoconf fu we might be able to detect a too early one, but right now it
> just fails if it's too old and --enable-blkid is specified.

Here's some autoconf fu to check for blkid topo support; this changes it to
default to using blkid, optionally disable-able, and disables it automatically
if the topo stuff isn't found (I think ;)

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

diff --git a/configure.in b/configure.in
index 78ac522..f75fad1 100644
--- a/configure.in
+++ b/configure.in
@@ -35,11 +35,10 @@ AC_ARG_ENABLE(termcap,
 	test $enable_termcap = yes && libtermcap="-ltermcap",)
 AC_SUBST(libtermcap)
 
+# AC_HAVE_BLKID_TOPO below wil find the library & check for topo support
 AC_ARG_ENABLE(blkid,
-[ --enable-blkid=[yes/no] Enable block device id library [default=no]],
-	test $enable_blkid = yes && libblkid="-lblkid",)
-AC_SUBST(libblkid)
-AC_SUBST(enable_blkid)
+[ --enable-blkid=[yes/no] Enable block device id library [default=yes]],,
+	enable_blkid=yes)
 
 AC_ARG_ENABLE(lib64,
 [ --enable-lib64=[yes/no] Enable lib64 support [default=yes]],,
@@ -96,6 +95,7 @@ AC_HAVE_SENDFILE
 AC_HAVE_GETMNTENT
 AC_HAVE_GETMNTINFO
 AC_HAVE_FALLOCATE
+AC_HAVE_BLKID_TOPO($enable_blkid)
 
 AC_TYPE_PSINT
 AC_TYPE_PSUNSIGNED
diff --git a/m4/package_blkid.m4 b/m4/package_blkid.m4
new file mode 100644
index 0000000..44ca2cc
--- /dev/null
+++ b/m4/package_blkid.m4
@@ -0,0 +1,20 @@
+#
+# See if blkid has the topology bits
+#
+
+AC_DEFUN([AC_HAVE_BLKID_TOPO],
+[
+  enable_blkid="$1"
+  if test "$enable_blkid" = "yes"; then
+    AC_SEARCH_LIBS([blkid_probe_all], [blkid])
+    AC_CHECK_FUNCS(blkid_probe_get_topology)
+    if test $ac_cv_func_blkid_probe_get_topology = yes; then
+      libblkid="-lblkid"
+    else
+      libblkd=""
+      enable_blkid="no"
+      AC_SUBST(enable_blkid)
+    fi
+  fi
+  AC_SUBST(libblkid)
+])

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2009-10-07 18:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-06 18:52 [PATCH] xfsprogs: allow using libblkid instead of libdisk Christoph Hellwig
2009-10-07 18:52 ` Eric Sandeen [this message]
2009-10-07 20:14   ` Christoph Hellwig

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=4ACCE37F.4070006@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=hch@infradead.org \
    --cc=util-linux-ng@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /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