summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-27 15:52:26 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-29 20:36:19 +0100
commit761b3051699bb7c9f02579a7a6139e647d422fab (patch)
tree2e3c9b6a66fc587835508dd2df7540f441fc9b62 /configure.ac
parent113b174c5807f76cb14cfed7a8f86a299393666e (diff)
Add a small version of zlib that can be built in statically
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 11 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 96419b9..f0869bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,10 @@ AC_ARG_WITH([zstd],
[AS_HELP_STRING([--with-zstd], [Build with zstd compression support])],
[], [with_zstd="check"])
+AC_ARG_WITH([builtin-zlib],
+ [AS_HELP_STRING([--with-builtin-zlib], [Use a custom, static zlib])],
+ [], [with_builtin_zlib="no"])
+
AC_ARG_WITH([selinux],
[AS_HELP_STRING([--with-selinux],
[Build with SELinux label file support])],
@@ -129,13 +133,15 @@ fi
##### search for dependencies #####
-AS_IF([test "x$with_gzip" != "xno"], [
+AS_IF([test "x$with_gzip" != "xno" -a "x$with_builtin_zlib" != "xyes"], [
PKG_CHECK_MODULES(ZLIB, [zlib], [with_gzip="yes"],
[AS_IF([test "x$with_gzip" != "xcheck"],
[AC_MSG_ERROR([cannot find zlib])],
[with_gzip="no"])])
], [])
+AS_IF([test "x$with_builtin_zlib" != "xno"], [with_gzip="yes"], [])
+
AS_IF([test "x$with_xz" != "xno"], [
PKG_CHECK_MODULES(XZ, [liblzma >= 5.0.0], [with_xz="yes"],
[AS_IF([test "x$with_xz" != "xcheck"],
@@ -204,12 +210,15 @@ 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"])
+AM_CONDITIONAL([WITH_OWN_ZLIB], [test "x$with_builtin_zlib" = "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"], [])
+AS_IF([test "x$with_gzip" = "xyes" -a "x$with_builtin_zlib" != "xyes"],
+ [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_ZSTD], [libsqfs_dep_mod="$libsqfs_dep_mod libzstd"], [])
AC_SUBST([LIBSQFS_DEP_MOD], ["$libsqfs_dep_mod"])