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/nix-daemon/guix-daemon.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nix/nix-daemon') diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc index a1ef90dfdc..b71b100f6c 100644 --- a/nix/nix-daemon/guix-daemon.cc +++ b/nix/nix-daemon/guix-daemon.cc @@ -206,8 +206,10 @@ parse_opt (int key, char *arg, struct argp_state *state) settings.logCompression = COMPRESSION_NONE; else if (strcmp (arg, "gzip") == 0) settings.logCompression = COMPRESSION_GZIP; +#if HAVE_BZLIB_H else if (strcmp (arg, "bzip2") == 0) settings.logCompression = COMPRESSION_BZIP2; +#endif else { fprintf (stderr, _("error: %s: unknown compression type\n"), arg); -- cgit 1.4.1