Skip to content

Commit

Permalink
feat: add patch to provide static library 'liberofsfuse.a'
Browse files Browse the repository at this point in the history
Signed-off-by: ComixHe <[email protected]>
  • Loading branch information
ComixHe authored and Zeno-sole committed Jun 7, 2024
1 parent 0f31ab6 commit 431e082
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 3 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
erofs-utils (1.7.1-1deepin1) unstable; urgency=medium

* add patch to provide static library 'liberofsfuse.a'

-- ComixHe <[email protected]> Tue, 04 Jun 2024 14:22:42 +0800

erofs-utils (1.7.1-1) unstable; urgency=medium

* New upstream release 1.7.1.
Expand Down
1 change: 1 addition & 0 deletions debian/erofsfuse.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
usr/lib/*/liberofsfuse.a
usr/bin/erofsfuse
usr/share/man/man1/erofsfuse.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/configure.ac b/configure.ac
index a546310..0a64f27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,6 +135,12 @@ AC_ARG_ENABLE(fuse,
[AS_HELP_STRING([--enable-fuse], [enable erofsfuse @<:@default=no@:>@])],
[enable_fuse="$enableval"], [enable_fuse="no"])

+AC_ARG_ENABLE([static-fuse],
+ [AS_HELP_STRING([--enable-static-fuse],
+ [build erofsfuse as a static library @<:@default=no@:>@])],
+ [enable_static_fuse="$enableval"],
+ [enable_static_fuse="no"])
+
AC_ARG_WITH(uuid,
[AS_HELP_STRING([--without-uuid],
[Ignore presence of libuuid and disable uuid support @<:@default=enabled@:>@])])
@@ -455,6 +461,7 @@ AM_CONDITIONAL([ENABLE_LZ4HC], [test "x${have_lz4hc}" = "xyes"])
AM_CONDITIONAL([ENABLE_FUSE], [test "x${have_fuse}" = "xyes"])
AM_CONDITIONAL([ENABLE_LIBLZMA], [test "x${have_liblzma}" = "xyes"])
AM_CONDITIONAL([ENABLE_LIBDEFLATE], [test "x${have_libdeflate}" = "xyes"])
+AM_CONDITIONAL([ENABLE_STATIC_FUSE], [test "x${enable_static_fuse}" = "xyes"])

if test "x$have_uuid" = "xyes"; then
AC_DEFINE([HAVE_LIBUUID], 1, [Define to 1 if libuuid is found])
diff --git a/fuse/Makefile.am b/fuse/Makefile.am
index 50be783..5d4d3b1 100644
--- a/fuse/Makefile.am
+++ b/fuse/Makefile.am
@@ -8,3 +8,12 @@ erofsfuse_CFLAGS = -Wall -I$(top_srcdir)/include
erofsfuse_CFLAGS += -DFUSE_USE_VERSION=26 ${libfuse_CFLAGS} ${libselinux_CFLAGS}
erofsfuse_LDADD = $(top_builddir)/lib/liberofs.la ${libfuse_LIBS} ${liblz4_LIBS} \
${libselinux_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libdeflate_LIBS}
+
+if ENABLE_STATIC_FUSE
+lib_LIBRARIES = liberofsfuse.a
+liberofsfuse_a_SOURCES = main.c
+liberofsfuse_a_CFLAGS = -Wall -I$(top_srcdir)/include
+liberofsfuse_a_CFLAGS += -Dmain=erofsfuse_main -DFUSE_USE_VERSION=26 ${libfuse_CFLAGS} ${libselinux_CFLAGS}
+liberofsfuse_la_LIBADD = $(top_builddir)/lib/liberofs.la ${libfuse_LIBS} ${liblz4_LIBS} \
+ ${libselinux_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libdeflate_LIBS}
+endif
1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0001-build-support-building-static-library-liberofsfuse.patch
9 changes: 6 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COMMON_CONF_FLAGS = --with-uuid --with-selinux --enable-lzma \
ifneq ($(SKIP_FUSE2FS),)
COMMON_CONF_FLAGS += --disable-fuse
else
COMMON_CONF_FLAGS += --enable-fuse
COMMON_CONF_FLAGS += --enable-fuse --enable-static-fuse
endif

%:
Expand All @@ -29,5 +29,8 @@ override_dh_auto_configure:
${COMMON_CONF_FLAGS}

override_dh_auto_install:
find $(CURDIR) -name "*.la" -delete
dh_auto_install --
dh_auto_install
/bin/bash ./libtool --finish $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/

override_dh_missing:
dh_missing --fail-missing

0 comments on commit 431e082

Please sign in to comment.