From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x Date: Fri, 14 Sep 2012 10:05:34 +0100 Message-ID: <1347613534.24226.167.camel@zakaz.uk.xensource.com> References: <20120905030239.GJ8912@reaktio.net> <1346846602-1109-1-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1346846602-1109-1-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: > CentOS 5.x forked e2fs ext4 support into a different package called > e4fs, and so headers and library names changed from ext2fs to ext4fs. > Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > ext2fs to build libfsimage. This patch assumes that if the ext4fs > library is present it should always be used instead of ext2fs. > > This patch includes a rework of the ext2fs check, a new ext4fs check > and a minor modification in libfsimage to use the correct library. > > Signed-off-by: Roger Pau Monne > --- > Please re-run autogen.sh after applying Done & acked + applied. Thanks. > diff --git a/tools/libfsimage/ext2fs-lib/Makefile b/tools/libfsimage/ext2fs-lib/Makefile > index 142207f..671fbff 100644 > --- a/tools/libfsimage/ext2fs-lib/Makefile > +++ b/tools/libfsimage/ext2fs-lib/Makefile > @@ -4,7 +4,10 @@ LIB_SRCS-y = ext2fs-lib.c > > FS = ext2fs-lib > > -FS_LIBDEPS = -lext2fs > +FS_LIBDEPS = $(EXTFS_LIBS) > + > +# Include configure output (config.h) to headers search path > +CFLAGS += -I$(XEN_ROOT)/tools Is there any way to move config.h from tools to under tools/include somewhere? > > .PHONY: all > all: fs-all > diff --git a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c > index 36a27dc..ed47146 100644 > --- a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c > +++ b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c > @@ -21,8 +21,11 @@ > * Use is subject to license terms. > */ > > +/* Include output from configure */ > +#include > + > #include > -#include > +#include INCLUDE_EXTFS_H > #include > #include > > diff --git a/tools/m4/extfs.m4 b/tools/m4/extfs.m4 > new file mode 100644 > index 0000000..7309da9 > --- /dev/null > +++ b/tools/m4/extfs.m4 > @@ -0,0 +1,20 @@ > +AC_DEFUN([AX_CHECK_EXTFS], [ > +AC_CHECK_HEADER([ext2fs/ext2fs.h], [ > +AC_CHECK_LIB([ext2fs], [ext2fs_open2], [ > + AC_DEFINE([INCLUDE_EXTFS_H], [], > + [Define extfs header to use]) > + EXTFS_LIBS="-lext2fs" > +]) > +]) > +dnl This is a temporary hack for CentOS 5.x, which split the ext4 support > +dnl of ext2fs in a different package. Once CentOS 5.x is no longer supported > +dnl we can remove this. > +AC_CHECK_HEADER([ext4fs/ext2fs.h], [ > +AC_CHECK_LIB([ext4fs], [ext2fs_open2], [ > + AC_DEFINE([INCLUDE_EXTFS_H], [], > + [Define extfs header to use]) > + EXTFS_LIBS="-lext4fs" > +]) > +]) > +AC_SUBST(EXTFS_LIBS) > +])