From 7b054153eccbf0843fbbfb131855f56ea5c695e0 Mon Sep 17 00:00:00 2001 From: Gabriele Giacone <1o5g4r8o@gmail.com> Date: Thu, 20 Mar 2014 10:44:20 +0100 Subject: Make bz2 and gz support optional * config.make.in (HAVE_LIBBZ2, HAVE_LIBZ): New variables. * configure.ac (--without-libbz2, --without-libz): New options. * ext2fs/Makefile (OTHERLIBS): Make -lbz2 and -lz optional. * fatfs/Makefile (OTHERLIBS): Likewise. * isofs/Makefile (OTHERLIBS): Likewise. * libstore/Makefile (maybe_part): Remove variable. (store-types): Add part, bunzip2 and gunzip support conditionnally. (LDLIBS): Make -lbz2 and -lz optional. (OBJS): Add GUNZIP_OBJS and BUNZIP2_OBJS optional. --- libstore/Makefile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'libstore') diff --git a/libstore/Makefile b/libstore/Makefile index 2bb5e4b9..28f56609 100644 --- a/libstore/Makefile +++ b/libstore/Makefile @@ -28,35 +28,37 @@ SRCS = create.c derive.c make.c rdwr.c set.c \ open.c xinl.c typed.c map.c url.c unknown.c \ stripe.c $(filter-out ileave.c concat.c,$(store-types:=.c)) -# This has to be evaluated after config.make has been included; -# as a consequence, using 'ifneq' or similar is not an option. -maybe_part = $(and $(PARTED_LIBS),part) - store-types = \ - bunzip2 \ concat \ copy \ device \ file \ - gunzip \ ileave \ memobj \ module \ mvol \ nbd \ - $(maybe_part) \ remap \ task \ zero +# This has to be evaluated after config.make has been included; +# as a consequence, using 'ifneq' or similar is not an option. +store-types += \ + $(and $(PARTED_LIBS),part) \ + $(and $(HAVE_LIBBZ2),bunzip2) \ + $(and $(HAVE_LIBZ),gunzip) \ + libstore.so-LDLIBS += $(PARTED_LIBS) -ldl installhdrs=store.h HURDLIBS = shouldbeinlibc -LDLIBS += -lpthread -lbz2 -lz +LDLIBS += -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz) GUNZIP_OBJS = do-gunzip.o util.o BUNZIP2_OBJS = do-bunzip2.o -OBJS = $(SRCS:.c=.o) $(GUNZIP_OBJS) $(BUNZIP2_OBJS) +OBJS = $(SRCS:.c=.o) \ + $(and $(HAVE_LIBZ),$(GUNZIP_OBJS)) \ + $(and $(HAVE_LIBBZ2),$(BUNZIP2_OBJS)) include ../Makeconf -- cgit v1.2.3