]> err.no Git - util-linux/commitdiff
blkid: add basic configure.ac stuff and blkid.pc
authorKarel Zak <kzak@redhat.com>
Wed, 27 Aug 2008 09:55:39 +0000 (11:55 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 17:02:39 +0000 (18:02 +0100)
Note, the configure.in stuff is incomplete -- but it's seem we can
remove the libbevmapper crap from blkid at all. So this code autoconf
is temporary only.

Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
libs/blkid/Makefile.am
libs/blkid/blkid.pc.in [new file with mode: 0644]

index 1f83fc7bcb93a82fc1e99a7d76a50fff1030a0ff..aa145cfc45df553d5c387b267ce6c0e14a34a8b5 100644 (file)
@@ -606,6 +606,42 @@ else
   esac
 fi
 
+# TODO remove devmapper from blkid
+#
+STATIC_BLKID_DEVMAPPER_LIBS=''
+AC_ARG_ENABLE([blkid-devmapper],
+   AS_HELP_STRING([--enable-blkid-devmapper], [build with device-mapper support]),
+   [], with_blkid-devmapper=no
+)
+if test x$with_devmapper = xno; then
+  AM_CONDITIONAL(HAVE_DEVMAPPER, false)
+  DEVMAPPER_LIBS_STATIC=''
+  DEVMAPPER_REQ=''
+  DEVMAPPER_PC_LIBS=''
+else
+  UTIL_CHECK_LIB(devmapper, dm_tree_create)
+  case $with_blkid-devmapper:$have_blkid-devmapper in
+  yes:no) AC_MSG_ERROR([devmapper selected but libdevmapper not found]);;
+  esac
+  UTIL_PKG_STATIC([DEVMAPPER_LIBS_STATIC], [devmapper])
+  DEVMAPPER_REQ="devmapper"
+  DEVMAPPER_PC_LIBS="-ldevmapper"
+
+  # work around stupid devmapper.pc bug in Debian
+  case "$DEVMAPPER_LIBS_STATIC" in
+  *pthread*)
+     ;;
+  *)
+    AC_MSG_WARN([Working around Debian bug 390243...])
+    DEVMAPPER_LIBS_STATIC="-pthread $DEVMAPPER_LIBS_STATIC"
+    ;;
+  esac
+fi
+
+AC_SUBST(DEVMAPPER_REQ)
+AC_SUBST(DEVMAPPER_PC_LIBS)
+AC_SUBST(DEVMAPPER_LIBS_STATIC)
+
 
 AC_ARG_ENABLE([schedutils],
   AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, teskset]),
@@ -715,6 +751,7 @@ include/Makefile
 lib/Makefile
 libs/Makefile
 libs/blkid/Makefile
+libs/blkid/blkid.pc
 login-utils/Makefile
 misc-utils/Makefile
 mount/Makefile
index 6702b5b3e03db59906ae91e8840ee56ae710b4c1..28558d43a39119a4527e840934b1ae53bc556063 100644 (file)
@@ -1,3 +1,7 @@
 include $(top_srcdir)/config/include-Makefile.am
 
-EXTRA_DIST = README.fsprobe
+# pkg-config stuff
+pkgconfigdir = $(usrlibexecdir)/pkgconfig
+pkgconfig_DATA = blkid.pc
+
+EXTRA_DIST = README.blkid blkid.pc blkid.pc.in
diff --git a/libs/blkid/blkid.pc.in b/libs/blkid/blkid.pc.in
new file mode 100644 (file)
index 0000000..5195539
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: blkid
+Description: Block device id library
+Version: @VERSION@
+Requires: uuid @DEVMAPPER_REQ@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lblkid
+Libs.private: @DEVMAPPER_PC_LIBS@