[Buildroot] [PATCH 1/2] e2fsprogs: factor out libuuid support

Daniel Mack daniel at caiaq.de
Tue Aug 4 08:28:22 UTC 2009


On Mon, Aug 03, 2009 at 10:48:43PM +0200, Peter Korsgaard wrote:
> >>>>> "Daniel" == Daniel Mack <daniel at caiaq.de> writes:
> 
>  Daniel> diff --git a/package/e2fsprogs/Config.in b/package/e2fsprogs/Config.in
>  Daniel> index d353fd9..398dc56 100644
>  Daniel> --- a/package/e2fsprogs/Config.in
>  Daniel> +++ b/package/e2fsprogs/Config.in
>  Daniel> @@ -1,6 +1,10 @@
>  Daniel> +config BR2_PACKAGE_LIBUUID
>  Daniel> +	bool
> 
> Why did you make this a hidden config? Couldn't we imagine someone
> wanting to use libuuid in their own programs?

I didn't image that ;) But you're right, that could help. See the new
patch below.

Thanks,
Daniel

>From 0b73affbef70924f82ec40ba2781db93202cd7f0 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel at caiaq.de>
Date: Wed, 29 Jul 2009 19:13:46 +0200
Subject: [PATCH] e2fsprogs: factor out libuuid support

Add a new target for libuuid so it can be built without e2fsprogs.

Signed-off-by: Daniel Mack <daniel at caiaq.de>
---
 package/e2fsprogs/Config.in    |    6 ++++++
 package/e2fsprogs/e2fsprogs.mk |   27 +++++++++++++++++++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/package/e2fsprogs/Config.in b/package/e2fsprogs/Config.in
index d353fd9..74da6bd 100644
--- a/package/e2fsprogs/Config.in
+++ b/package/e2fsprogs/Config.in
@@ -1,6 +1,12 @@
+config BR2_PACKAGE_LIBUUID
+	bool "libuuid"
+	help
+	  The uuid library from the e2fsprogs suite
+
 config BR2_PACKAGE_E2FSPROGS
 	bool "e2fsprogs"
 	depends on BR2_LARGEFILE
+	select BR2_PACKAGE_LIBUUID
 	help
 	  The EXT2 file system utilities and libraries
 
diff --git a/package/e2fsprogs/e2fsprogs.mk b/package/e2fsprogs/e2fsprogs.mk
index 6400bf5..fbadfb0 100644
--- a/package/e2fsprogs/e2fsprogs.mk
+++ b/package/e2fsprogs/e2fsprogs.mk
@@ -10,6 +10,9 @@ E2FSPROGS_DIR=$(BUILD_DIR)/e2fsprogs-$(E2FSPROGS_VERSION)
 E2FSPROGS_CAT:=$(ZCAT)
 E2FSPROGS_BINARY:=misc/mke2fs
 E2FSPROGS_TARGET_BINARY:=sbin/mke2fs
+LIBUUID_DIR=$(E2FSPROGS_DIR)/lib/uuid/
+LIBUUID_TARGET_DIR:=usr/lib/
+LIBUUID_TARGET_BINARY:=libuuid.so
 
 E2FSPROGS_MISC_STRIP:= \
 	badblocks blkid chattr dumpe2fs filefrag fsck logsave \
@@ -69,11 +72,17 @@ $(E2FSPROGS_DIR)/$(E2FSPROGS_BINARY): $(E2FSPROGS_DIR)/.configured
 	#$(STRIPCMD) $(E2FSPROGS_DIR)/lib/lib*.so.*.*
 	touch -c $@
 
+$(E2FSPROGS_DIR)/lib/$(LIBUUID_TARGET_BINARY): $(E2FSPROGS_DIR)/.configured
+	$(MAKE1) -C $(E2FSPROGS_DIR)/lib/uuid
+	touch -c $@
+
 $(STAGING_DIR)/$(E2FSPROGS_TARGET_BINARY): $(E2FSPROGS_DIR)/$(E2FSPROGS_BINARY)
 	$(MAKE1) PATH=$(TARGET_PATH) DESTDIR=$(STAGING_DIR) LDCONFIG=true \
 		-C $(E2FSPROGS_DIR) install
+
+$(STAGING_DIR)/lib/$(LIBUUID_TARGET_BINARY): $(E2FSPROGS_DIR)/lib/$(LIBUUID_TARGET_BINARY)
 	$(MAKE1) PATH=$(TARGET_PATH) DESTDIR=$(STAGING_DIR) LDCONFIG=true \
-		-C $(E2FSPROGS_DIR)/lib/uuid install
+		-C $(LIBUUID_DIR) install
 
 E2FSPROGS_RM$(BR2_PACKAGE_E2FSPROGS_BADBLOCKS) += ${TARGET_DIR}/sbin/badblocks
 E2FSPROGS_RM$(BR2_PACKAGE_E2FSPROGS_BLKID) += ${TARGET_DIR}/sbin/blkid
@@ -125,7 +134,15 @@ endif
 	rm -rf $(TARGET_DIR)/usr/share/doc
 	touch -c $@
 
-e2fsprogs: uclibc $(TARGET_DIR)/$(E2FSPROGS_TARGET_BINARY)
+$(TARGET_DIR)/$(LIBUUID_TARGET_DIR)/$(LIBUUID_TARGET_BINARY): $(STAGING_DIR)/lib/$(LIBUUID_TARGET_BINARY)
+	$(MAKE1) PATH=$(TARGET_PATH) DESTDIR=$(STAGING_DIR) LDCONFIG=true \
+		-C $(LIBUUID_DIR) install
+	cp -a $(STAGING_DIR)/$(LIBUUID_TARGET_DIR)/$(LIBUUID_TARGET_BINARY)* \
+		$(TARGET_DIR)/$(LIBUUID_TARGET_DIR)/
+	touch -c $@
+
+libuuid: uclibc $(TARGET_DIR)/$(LIBUUID_TARGET_DIR)/$(LIBUUID_TARGET_BINARY)
+e2fsprogs: uclibc libuuid $(TARGET_DIR)/$(E2FSPROGS_TARGET_BINARY)
 
 e2fsprogs-clean:
 	$(MAKE1) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(E2FSPROGS_DIR) uninstall
@@ -134,6 +151,8 @@ e2fsprogs-clean:
 e2fsprogs-dirclean:
 	rm -rf $(E2FSPROGS_DIR)
 
+libuuid-dirclean:: e2fsprogs-dirclean
+
 #############################################################
 #
 # Toplevel Makefile options
@@ -142,3 +161,7 @@ e2fsprogs-dirclean:
 ifeq ($(BR2_PACKAGE_E2FSPROGS),y)
 TARGETS+=e2fsprogs
 endif
+
+ifeq ($(BR2_PACKAGE_LIBUUID),y)
+TARGETS+=libuuid
+endif
-- 
1.6.3.3




More information about the buildroot mailing list