]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - configure.ac
Restore support for bzip2 files
[thirdparty/sarg.git] / configure.ac
index 1edb8a44d0f7abaaebfbd87f5b838c53d49c72cb..8c76b700410cc93920e919c3805a7d93cd33b130 100644 (file)
@@ -189,6 +189,30 @@ AS_IF([test "x$with_zlib" != "xno" ],
        zlib_status="disabled"
 ])
 
+# Build with bzlib
+AC_ARG_WITH([bzlib],
+       AS_HELP_STRING([--with-bzlib],[Compile with support to decompress bz2 files]),
+       [],[with_bzlib=check])
+AS_IF([test "x$with_bzlib" != "xno" ],
+[
+       AC_CHECK_HEADERS(bzlib.h)
+       AS_IF([test "x$ac_cv_header_bzlib_h" = "xyes"],
+       [
+               AC_CHECK_LIB([bz2],[BZ2_bzReadOpen],
+               [
+                       LIBS="-lbz2 ${LIBS}"
+                       HAVE_BZLIB_LIB="yes"
+               ],[
+                       HAVE_BZLIB_LIB=""
+               ])
+               AS_IF([test "x$HAVE_BZLIB_LIB" != "xyes"],[AC_MSG_ERROR([bzlib was not found])])
+       ],[
+               bzlib_status="not found"
+       ])
+],[
+       bzlib_status="disabled"
+])
+
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_STRUCT_TM
@@ -441,3 +465,9 @@ AS_IF([test "x$zlib_status" = "xdisabled"],[
 ],[test "x$zlib_status" = "xnot found"],[
        AC_MSG_NOTICE([zlib.h was not found so it won't be possible to process gzipped files])
 ])
+
+AS_IF([test "x$bzlib_status" = "xdisabled"],[
+       AC_MSG_NOTICE([Not building with bzlib as requested on the configuration command line])
+],[test "x$bzlib_status" = "xnot found"],[
+       AC_MSG_NOTICE([bzlib.h was not found so it won't be possible to process bzipped files])
+])