[PATCH v2] build: support building static library liberofsfuse

Gao Xiang hsiangkao at linux.alibaba.com
Tue Jun 11 19:23:06 AEST 2024


Hi,

On 2024/6/6 15:39, ComixHe wrote:
> add new option '--enable-static-fuse' so that we
> could import erofsfuse as a static library directly
> into other projects
> 
> Signed-off-by: ComixHe <heyuming at deepin.org>

...

> +
> +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 ${libfuse2_CFLAGS} ${libfuse3_CFLAGS} ${libselinux_CFLAGS}
> +liberofsfuse_la_LIBADD  = $(top_builddir)/lib/liberofs.la ${libfuse2_LIBS} ${libfuse3_LIBS} ${liblz4_LIBS} \
> +	${libselinux_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libdeflate_LIBS} ${libzstd_LIBS}

I guess this line should be the following:

-liberofsfuse_la_LIBADD  = $(top_builddir)/lib/liberofs.la ${libfuse2_LIBS} ${libfuse3_LIBS} ${liblz4_LIBS} \
-       ${libselinux_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libdeflate_LIBS} ${libzstd_LIBS} ${libqpl_LIBS}
+liberofsfuse_a_LIBADD  = $(top_builddir)/lib/liberofs.la

Since we may not have all dependent libraries, so it's up to users to use liberofsfuse.a and
link static (or dynamic) dependencies themselves.

I will update this patch manually.

Thanks,
Gao Xiang

> +endif


More information about the Linux-erofs mailing list