summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-02 18:46:50 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-03 21:45:46 +0200
commit0903622b468136ef4354f33ebb24b12df0f549bb (patch)
treefc9c2f6539d81129293c3bd889800df99b4e35e3
parent2aa2f13131663afa0d13259365f824b05e9a2f02 (diff)
Add configure switches for compressors
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--configure.ac40
1 files changed, 34 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 18a4a81..51c61a4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,16 +39,44 @@ UL_WARN_ADD([-pedantic])
AC_SUBST([WARN_CFLAGS])
+##### config options #####
+
+AC_ARG_WITH([zlib],
+ [AS_HELP_STRING([--without-zlib],
+ [Build without zlib compression support])],
+ [case "${withval}" in
+ yes) AM_CONDITIONAL([WITH_ZLIB], [true]) ;;
+ no) AM_CONDITIONAL([WITH_ZLIB], [false]) ;;
+ *) AC_MSG_ERROR([bad value ${withval} for --without-zlib]) ;;
+ esac],
+ [AM_CONDITIONAL([WITH_ZLIB], [true])])
+
+AC_ARG_WITH([lzma],
+ [AS_HELP_STRING([--without-lzma],
+ [Build without lzma compression support])],
+ [case "${withval}" in
+ yes) AM_CONDITIONAL([WITH_LZMA], [true]) ;;
+ no) AM_CONDITIONAL([WITH_LZMA], [false]) ;;
+ *) AC_MSG_ERROR([bad value ${withval} for --without-lzma]) ;;
+ esac],
+ [AM_CONDITIONAL([WITH_LZMA], [true])])
+
##### search for dependencies #####
-have_zlib="no"
-have_lzma="no"
+need_zlib="no"
+need_lzma="no"
+
+AM_COND_IF([WITH_ZLIB], [need_zlib="yes"])
+AM_COND_IF([WITH_LZMA], [need_lzma="yes"])
-PKG_CHECK_MODULES(ZLIB, [zlib], [have_zlib="yes"], [])
-PKG_CHECK_MODULES(XZ, [liblzma >= 5.0.0], [have_lzma="yes"], [])
+if test "x$need_zlib" = "xyes"; then
+ PKG_CHECK_MODULES(ZLIB, [zlib], [], [AC_MSG_ERROR([cannot find zlib])])
+fi
-AM_CONDITIONAL([WITH_ZLIB], [test "x$have_zlib" == "xyes"])
-AM_CONDITIONAL([WITH_LZMA], [test "x$have_lzma" == "xyes"])
+if test "x$need_lzma" = "xyes"; then
+ PKG_CHECK_MODULES(XZ, [liblzma >= 5.0.0], [],
+ [AC_MSG_ERROR([cannot find lzma])])
+fi
##### generate output #####