diff options
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | mkfs/Makefile.am | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 5145971..0f40a84 100644 --- a/configure.ac +++ b/configure.ac @@ -188,7 +188,6 @@ test -z $LZ4_LIBS && LZ4_LIBS='-llz4' if test "x$enable_lz4" = "xyes"; then test -z "${with_lz4_incdir}" || LZ4_CFLAGS="-I$with_lz4_incdir $LZ4_CFLAGS" - test -z "${with_lz4_libdir}" || LZ4_LIBS="-L$with_lz4_libdir $LZ4_LIBS" saved_CPPFLAGS=${CPPFLAGS} CPPFLAGS="${LZ4_CFLAGS} ${CPPFLAGS}" @@ -196,6 +195,7 @@ if test "x$enable_lz4" = "xyes"; then AC_CHECK_HEADERS([lz4.h],[have_lz4h="yes"], []) if test "x${have_lz4h}" = "xyes" ; then + saved_LIBS="$LIBS" saved_LDFLAGS=${LDFLAGS} test -z "${with_lz4_libdir}" || LDFLAGS="-L$with_lz4_libdir ${LDFLAGS}" AC_CHECK_LIB(lz4, LZ4_compress_destSize, [ @@ -210,6 +210,7 @@ if test "x$enable_lz4" = "xyes"; then ]) ], [AC_MSG_ERROR([Cannot find proper lz4 version (>= 1.8.0)])]) LDFLAGS=${saved_LDFLAGS} + LIBS="${saved_LIBS}" fi CPPFLAGS=${saved_CPPFLAGS} fi @@ -234,11 +235,11 @@ if test "x${have_lz4}" = "xyes"; then fi if test "x${lz4_force_static}" = "xyes"; then - LDFLAGS="-all-static ${LDFLAGS}" + LZ4_LIBS="-Wl,-Bstatic -Wl,-whole-archive -Xlinker ${LZ4_LIBS} -Wl,-no-whole-archive -Wl,-Bdynamic" + test -z "${with_lz4_libdir}" || LZ4_LIBS="-L${with_lz4_libdir} $LZ4_LIBS" else - test -z "${with_lz4_libdir}" || LZ4_LIBS="-R ${with_lz4_libdir} $LZ4_LIBS" + test -z "${with_lz4_libdir}" || LZ4_LIBS="-R${with_lz4_libdir} $LZ4_LIBS" fi - LIBS="$LZ4_LIBS $LIBS" fi AC_CONFIG_FILES([Makefile diff --git a/mkfs/Makefile.am b/mkfs/Makefile.am index 97ba148..ecc468c 100644 --- a/mkfs/Makefile.am +++ b/mkfs/Makefile.am @@ -6,5 +6,5 @@ bin_PROGRAMS = mkfs.erofs AM_CPPFLAGS = ${libuuid_CFLAGS} ${libselinux_CFLAGS} mkfs_erofs_SOURCES = main.c mkfs_erofs_CFLAGS = -Wall -Werror -I$(top_srcdir)/include -mkfs_erofs_LDADD = $(top_builddir)/lib/liberofs.la ${libuuid_LIBS} ${libselinux_LIBS} +mkfs_erofs_LDADD = ${libuuid_LIBS} $(top_builddir)/lib/liberofs.la ${libselinux_LIBS} ${LZ4_LIBS} |