Re: [PATCH] fix blkid.h include

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 06, 2009 at 01:35:50PM +0200, Robert Schwebel wrote:
> When building util-linux-ng-2.15, I get this:
> 
> make[3]: Entering directory
> `/ptx/work/octopus/WORK_2_B/rsc/svn/oselas/bsp/OSELAS.BSP-Pengutronix-AllYes-trunk/platform-phyCORE-PXA270.PCM990/build-target/util-linux-ng-2.15/mount'
> arm-iwmmx-linux-gnueabi-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..
> -include ../config.h -I../include -DLOCALEDIR=\"/usr/share/locale\"
> -isystem
> /home/rsc/svn/oselas/bsp/OSELAS.BSP-Pengutronix-AllYes-trunk/platform-phyCORE-PXA270.PCM990/sysroot-target/include
> -isystem
> /home/rsc/svn/oselas/bsp/OSELAS.BSP-Pengutronix-AllYes-trunk/platform-phyCORE-PXA270.PCM990/sysroot-target/usr/include
> -fsigned-char
> -I/home/rsc/svn/oselas/bsp/OSELAS.BSP-Pengutronix-AllYes-trunk/platform-phyCORE-PXA270.PCM990/sysroot-target/usr/include
> -g -O2 -MT mount-fsprobe.o -MD -MP -MF .deps/mount-fsprobe.Tpo -c -o
> mount-fsprobe.o `test -f '../lib/fsprobe.c' || echo
> './'`../lib/fsprobe.c ../lib/fsprobe.c:10:19: error: blkid.h: No
> such file or directory

 Thanks for your report. Fixed (see below).

    Karel


>From 7c950efa3438b02097d915497d67248dde709e72 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@xxxxxxxxxx>
Date: Mon, 11 May 2009 15:06:06 +0200
Subject: [PATCH] build-sys: fix blkid.h include for old e2fsprogs

   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@xxxxxxxxxxxxxx>
Signed-off-by: Karel Zak <kzak@xxxxxxxxxx>
---
 configure.ac  |   14 +++++++++++++-
 lib/fsprobe.c |    4 ++++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 46dc323..ec41ae6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/lib/fsprobe.c b/lib/fsprobe.c
index cd008cc..c5fa8c6 100644
--- a/lib/fsprobe.c
+++ b/lib/fsprobe.c
@@ -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"
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux