[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 1/1 Hurd]hurd: Add a libstore library without libparted
From: |
Zhaoming Luo |
Subject: |
[RFC PATCH v3 1/1 Hurd]hurd: Add a libstore library without libparted |
Date: |
Sat, 11 Jan 2025 12:56:33 +0800 |
* Makefile: Add subdir libstore-noparted
* libstore-noparted/Makefile: The Makefile for the new module
* libstore/Makefile: Add conditionals so libstore-noparted can use it
---
Makefile | 1 +
libstore-noparted/Makefile | 6 ++++++
libstore/Makefile | 19 +++++++++++++++----
3 files changed, 22 insertions(+), 4 deletions(-)
create mode 100644 libstore-noparted/Makefile
diff --git a/Makefile b/Makefile
index 9d9e33c3..f8e38b71 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,7 @@ lib-subdirs = libshouldbeinlibc libihash libiohelp libports \
libbpf \
libmachdev \
libirqhelp \
+ libstore-noparted \
# Hurd programs
prog-subdirs = auth proc exec term \
diff --git a/libstore-noparted/Makefile b/libstore-noparted/Makefile
new file mode 100644
index 00000000..b04b3350
--- /dev/null
+++ b/libstore-noparted/Makefile
@@ -0,0 +1,6 @@
+EXCLUDE_PARTED := 1
+
+# Use the source files from the libstore library
+VPATH += $(top_srcdir)/libstore
+
+include ../libstore/Makefile
diff --git a/libstore/Makefile b/libstore/Makefile
index c7af958b..d0f06450 100644
--- a/libstore/Makefile
+++ b/libstore/Makefile
@@ -20,10 +20,17 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
-dir := libstore
+# EXCLUDE_PARTED is defined in the Makefile of libstore-noparted
+ifeq ($(EXCLUDE_PARTED), 1)
+ dir := libstore-noparted
+ libname := libstore-noparted
+else
+ dir := libstore
+ libname := libstore
+endif
+
makemode := library
-libname = libstore
SRCS = create.c derive.c make.c rdwr.c set.c \
enc.c encode.c decode.c clone.c argp.c kids.c flags.c \
open.c xinl.c typed.c map.c url.c unknown.c \
@@ -46,11 +53,15 @@ store-types = \
# This has to be evaluated after config.make has been included;
# as a consequence, using 'ifneq' or similar is not an option.
store-types += \
- $(and $(PARTED_LIBS),part) \
$(and $(HAVE_LIBBZ2),bunzip2) \
$(and $(HAVE_LIBZ),gunzip) \
-libstore.so-LDLIBS += $(PARTED_LIBS) -ldl
+ifeq ($(EXCLUDE_PARTED), 1)
+ libstore-noparted.so-LDLIBS += -ldl
+else
+ libstore.so-LDLIBS += $(PARTED_LIBS) -ldl
+ store-types += $(and $(PARTED_LIBS),part)
+endif
installhdrs=store.h
HURDLIBS = shouldbeinlibc
--
2.47.1