]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
detect blkid topology support in autoconf
authorEric Sandeen <sandeen@sandeen.net>
Wed, 6 Jan 2010 17:32:00 +0000 (18:32 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 6 Jan 2010 17:32:00 +0000 (18:32 +0100)
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>
Signed-off-by: Christoph Hellwig <hch@lst.de>
configure.in
m4/package_blkid.m4 [new file with mode: 0644]

index ad13b19fa089f9247d8e7a33af3b40e47c1ef22a..dc811e2bfd09d9e768a522f59cac95f1847f5830 100644 (file)
@@ -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]],,
@@ -99,6 +98,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 (file)
index 0000000..44ca2cc
--- /dev/null
@@ -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)
+])