]> err.no Git - util-linux/commitdiff
build-sys: fix blkid.h include for old e2fsprogs
authorKarel Zak <kzak@redhat.com>
Mon, 11 May 2009 13:06:06 +0000 (15:06 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 27 May 2009 08:26:11 +0000 (10:26 +0200)
   When building util-linux-ng-2.15, I get this:
   ../lib/fsprobe.c:10:19: error: blkid.h: No such file or directory

Unfortunately, the blkid.pc uses -I${includedir}/blkidi since
e2fsprogs v1.41.2. The old versions use -I${includedir} only.

Reported-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
lib/fsprobe.c

index 46dc3235a7b11c15ed7ed237d16348a546048541..ec41ae609da966b433160c354a4480d2ee655b20 100644 (file)
@@ -180,7 +180,19 @@ have_volume_id=no
 
 if test "x$with_fsprobe" = xblkid; then
   PKG_CHECK_MODULES(BLKID, blkid, [have_blkid=yes], [])
-  AC_CHECK_LIB(blkid, blkid_evaluate_tag, [have_blkid_evaluate=yes], [])
+  if test "x$have_blkid" = xyes; then
+    old_CFLAGS="$CFLAGS"
+    old_CPPFLAGS="$CPPFLAGS"
+    old_LDFLAGS="$LDFLAGS"
+    CFLAGS="$CFLAGS $BLKID_CFLAGS"
+    CPPFLAGS="$CPPFLAGS $BLKID_CFLAGS"
+    LDFLAGS="$LDFLAGS $BLKID_LIBS"
+    AC_CHECK_HEADERS([blkid.h blkid/blkid.h], [break], [])
+    AC_CHECK_FUNC(blkid_evaluate_tag, [have_blkid_evaluate=yes], [])
+    CFLAGS="$old_CFLAGS"
+    CPPFLAGS="$old_CPPFLAGS"
+    LDFLAGS="$old_LDFLAGS"
+  fi
 elif test "x$with_fsprobe" = xvolume_id; then
   PKG_CHECK_MODULES(VOLUME_ID, volume_id, [have_volume_id=yes], [])
 elif test "x$with_fsprobe" = xbuiltin; then
index cd008cc35ebfa98f1f079f77573cba6a996cdb83..c5fa8c63b99317f595685ead802367db05b8656f 100644 (file)
@@ -7,7 +7,11 @@
 #include <sys/types.h>
 #include <stdlib.h>
 
+#ifdef HAVE_BLKID_BLKID_H
+#include <blkid/blkid.h>
+#else
 #include <blkid.h>
+#endif
 
 #include "blkdev.h"
 #include "canonicalize.h"