From 19459d56f493b380e2df30e06822cc7b01183186 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Fri, 14 Sep 2012 10:02:47 +0100 Subject: libfsimage: add ext4 support for CentOS 5.x 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 Acked-by: Ian Campbell Committed-by: Ian Campbell --- tools/libfsimage/Makefile | 2 +- tools/libfsimage/ext2fs-lib/Makefile | 5 ++++- tools/libfsimage/ext2fs-lib/ext2fs-lib.c | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'tools/libfsimage') diff --git a/tools/libfsimage/Makefile b/tools/libfsimage/Makefile index 5a506f3325..69fd18a820 100644 --- a/tools/libfsimage/Makefile +++ b/tools/libfsimage/Makefile @@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y = common ufs reiserfs iso9660 fat zfs SUBDIRS-$(CONFIG_X86) += xfs -ifeq ($(CONFIG_EXT2FS), y) +ifneq ($(EXTFS_LIBS), ) SUBDIRS-y += ext2fs-lib else SUBDIRS-y += ext2fs diff --git a/tools/libfsimage/ext2fs-lib/Makefile b/tools/libfsimage/ext2fs-lib/Makefile index 142207f63b..671fbffd73 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 .PHONY: all all: fs-all diff --git a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c index 36a27dc028..ed471465f9 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 -- cgit v1.2.3