diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-10-14 22:57:55 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-10-14 23:16:50 -0400 |
commit | 1a2a0ac53bbe724caf41c2bcf22ab9ea32b63d4e (patch) | |
tree | 2156a6d1dd9c0790929f6b734d1c407950959372 | |
parent | 5146f9f065dbc06b849f92fa00d8d57bd0096e12 (diff) |
build-sys: enable lz4 by default if available
--enable-lz4 can be used to force lz4 requirement,
--disable-lz4 can be used to skip lz4 support even if available.
Also, make surrounding checks for bzip2, xz, and zlib similar in structure.
This fixes the check for requested but missing bzip2.
-rw-r--r-- | configure.ac | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac index 1739fe75cf..92aa1f787d 100644 --- a/configure.ac +++ b/configure.ac @@ -520,25 +520,27 @@ AC_SUBST(CERTIFICATEROOT) # ------------------------------------------------------------------------------ have_xz=no AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support])) -if test "x$enable_xz" != "xno"; then +AS_IF([test "x$enable_xz" != "xno"], [ PKG_CHECK_MODULES(XZ, [ liblzma ], - [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no) - if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then - AC_MSG_ERROR([*** XZ support requested but libraries not found]) - fi -fi + [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) + have_xz=yes], + have_xz=no) + AS_IF([test "x$have_xz" = xno -a "x$enable_xz" = xyes], + [AC_MSG_ERROR([*** XZ support requested but libraries not found])]) +]) AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"]) # ------------------------------------------------------------------------------ have_zlib=no AC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib], [Disable optional ZLIB support])) -if test "x$enable_zlib" != "xno"; then +AS_IF([test "x$enable_zlib" != "xno"], [ PKG_CHECK_MODULES(ZLIB, [ zlib ], - [AC_DEFINE(HAVE_ZLIB, 1, [Define if ZLIB is available]) have_zlib=yes], have_zlib=no) - if test "x$have_zlib" = xno -a "x$enable_zlib" = xyes; then - AC_MSG_ERROR([*** ZLIB support requested but libraries not found]) - fi -fi + [AC_DEFINE(HAVE_ZLIB, 1, [Define if ZLIB is available]) + have_zlib=yes], + have_zlib=no) + AS_IF([test "x$have_zlib" = xno -a "x$enable_zlib" = xyes], + [AC_MSG_ERROR([*** ZLIB support requested but libraries not found])]) +]) AM_CONDITIONAL(HAVE_ZLIB, [test "$have_zlib" = "yes"]) # ------------------------------------------------------------------------------ @@ -546,20 +548,24 @@ have_bzip2=no AC_ARG_ENABLE(bzip2, AS_HELP_STRING([--enable-bzip2], [Disable optional BZIP2 support])) AS_IF([test "x$enable_bzip2" != "xno"], [ AC_CHECK_HEADERS(bzlib.h, - [AC_DEFINE(HAVE_BZIP2, 1, [Define in BZIP2 is available]) + [AC_DEFINE(HAVE_BZIP2, 1, [Define if BZIP2 is available]) have_bzip2=yes], - [AS_IF([test "x$have_bzip2" = xyes], [AC_MSG_ERROR([*** BZIP2 support requested but headers not found])]) - ]) + [AS_IF([test "x$enable_bzip2" = xyes], + [AC_MSG_ERROR([*** BZIP2 support requested but headers not found])])] + ) ]) AM_CONDITIONAL(HAVE_BZIP2, [test "$have_bzip2" = "yes"]) # ------------------------------------------------------------------------------ have_lz4=no -AC_ARG_ENABLE(lz4, AS_HELP_STRING([--enable-lz4], [Enable optional LZ4 support])) -AS_IF([test "x$enable_lz4" = "xyes"], [ +AC_ARG_ENABLE(lz4, AS_HELP_STRING([--disable-lz4], [Disable optional LZ4 support])) +AS_IF([test "x$enable_lz4" != "xno"], [ PKG_CHECK_MODULES(LZ4, [ liblz4 >= 125 ], - [AC_DEFINE(HAVE_LZ4, 1, [Define in LZ4 is available]) have_lz4=yes], - [AC_MSG_ERROR([*** LZ4 support requested but libraries not found])]) + [AC_DEFINE(HAVE_LZ4, 1, [Define in LZ4 is available]) + have_lz4=yes], + have_lz4=no) + AS_IF([test "x$have_lz4" = xno -a "x$enable_lz4" = xyes], + [AC_MSG_ERROR([*** LZ4 support requested but libraries not found])]) ]) AM_CONDITIONAL(HAVE_LZ4, [test "$have_lz4" = "yes"]) |