From f997137d0e2eba27bb1e2b282ee19ea474c41e12 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 5 Jan 2018 17:48:23 +0100 Subject: daemon: Make libbz2 an optional dependency. * config-daemon.ac: Don't bail out when libbz2 is missing. Define 'HAVE_LIBBZ2' Automake conditional. * nix/libstore/build.cc: Wrap relevant bits in '#if HAVE_BZLIB_H'. * nix/libstore/globals.cc (Settings::Settings): 'logCompression' defaults to COMPRESSION_GZIP when HAVE_BZLIB_H is false. * nix/libstore/globals.hh (CompressionType): Make 'COMPRESSION_BZIP2' conditional on HAVE_BZLIB_H. * nix/local.mk (guix_register_LDADD, guix_daemon_LDADD): Add -lbz2 only when HAVE_LIBBZ2. * nix/nix-daemon/guix-daemon.cc (parse_opt): Ignore "bzip2" when not HAVE_BZLIB_H. --- nix/libstore/globals.hh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nix/libstore/globals.hh') diff --git a/nix/libstore/globals.hh b/nix/libstore/globals.hh index 81cf2f52d4..2439936959 100644 --- a/nix/libstore/globals.hh +++ b/nix/libstore/globals.hh @@ -1,5 +1,6 @@ #pragma once +#include "config.h" #include "types.hh" #include @@ -11,8 +12,10 @@ namespace nix { enum CompressionType { COMPRESSION_NONE = 0, - COMPRESSION_GZIP = 1, - COMPRESSION_BZIP2 = 2 + COMPRESSION_GZIP = 1 +#if HAVE_BZLIB_H + , COMPRESSION_BZIP2 = 2 +#endif }; struct Settings { -- cgit v1.2.3