summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 12 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index e885348..96419b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,10 @@ AC_ARG_WITH([lz4],
[AS_HELP_STRING([--with-lz4], [Build with lz4 compression support])],
[], [with_lz4="check"])
+AC_ARG_WITH([builtin-lz4],
+ [AS_HELP_STRING([--with-builtin-lz4], [Use a custom, static liblz4])],
+ [], [with_builtin_lz4="no"])
+
AC_ARG_WITH([zstd],
[AS_HELP_STRING([--with-zstd], [Build with zstd compression support])],
[], [with_zstd="check"])
@@ -139,13 +143,15 @@ AS_IF([test "x$with_xz" != "xno"], [
[with_xz="no"])])
], [])
-AS_IF([test "x$with_lz4" != "xno"], [
+AS_IF([test "x$with_lz4" != "xno" -a "x$with_builtin_lz4" != "xyes"], [
PKG_CHECK_MODULES(LZ4, [liblz4], [with_lz4="yes"],
[AS_IF([test "x$with_lz4" = "xyes"],
[AC_MSG_ERROR([cannot find liblz4])],
[with_lz4="no"])])
], [])
+AS_IF([test "x$with_builtin_lz4" != "xno"], [with_lz4="yes"], [])
+
AS_IF([test "x$with_zstd" != "xno"], [
PKG_CHECK_MODULES(ZSTD, [libzstd], [with_zstd="yes"],
[AS_IF([test "x$with_zstd" = "xyes"],
@@ -197,10 +203,14 @@ AM_CONDITIONAL([WITH_LZO], [test "x$with_lzo" = "xyes"])
AM_CONDITIONAL([WITH_SELINUX], [test "x$with_selinux" = "xyes"])
AM_CONDITIONAL([HAVE_PTHREAD], [test "x$with_pthread" = "xyes"])
+AM_CONDITIONAL([WITH_OWN_LZ4], [test "x$with_builtin_lz4" = "xyes"])
+
libsqfs_dep_mod=""
+AS_IF([test "x$with_lz4" = "xyes" -a "x$with_builtin_lz4" != "xyes"],
+ [libsqfs_dep_mod="$libsqfs_dep_mod liblz4"], [])
+
AM_COND_IF([WITH_GZIP], [libsqfs_dep_mod="$libsqfs_dep_mod zlib"], [])
AM_COND_IF([WITH_XZ], [libsqfs_dep_mod="$libsqfs_dep_mod liblzma >= 5.0.0"], [])
-AM_COND_IF([WITH_LZ4], [libsqfs_dep_mod="$libsqfs_dep_mod liblz4"], [])
AM_COND_IF([WITH_ZSTD], [libsqfs_dep_mod="$libsqfs_dep_mod libzstd"], [])
AC_SUBST([LIBSQFS_DEP_MOD], ["$libsqfs_dep_mod"])