summary refs log tree commit diff
path: root/nix/local.mk
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-01-05 17:48:23 +0100
committerLudovic Courtès <ludo@gnu.org>2018-01-07 23:47:22 +0100
commitf997137d0e2eba27bb1e2b282ee19ea474c41e12 (patch)
tree3a188ef54d7157cabc5c0b432e92b3bcabad03fd /nix/local.mk
parent29a686688674dc875775305312513405fa396a06 (diff)
downloadguix-f997137d0e2eba27bb1e2b282ee19ea474c41e12.tar.gz
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.
Diffstat (limited to 'nix/local.mk')
-rw-r--r--nix/local.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/nix/local.mk b/nix/local.mk
index d802da6170..4452301c63 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -132,7 +132,7 @@ guix_daemon_CPPFLAGS =				\
   -I$(top_srcdir)/%D%/libstore
 
 guix_daemon_LDADD =				\
-  libstore.a libutil.a libformat.a -lz -lbz2	\
+  libstore.a libutil.a libformat.a -lz		\
   $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
 
 guix_daemon_headers =				\
@@ -149,9 +149,15 @@ guix_register_CPPFLAGS =			\
 
 # XXX: Should we start using shared libs?
 guix_register_LDADD =				\
-  libstore.a libutil.a libformat.a -lz -lbz2	\
+  libstore.a libutil.a libformat.a -lz		\
   $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
 
+if HAVE_LIBBZ2
+
+guix_daemon_LDADD += -lbz2
+guix_register_LDADD += -lbz2
+
+endif HAVE_LIBBZ2
 
 noinst_HEADERS =						\
   $(libformat_headers) $(libutil_headers) $(libstore_headers)	\