summaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
authorGabriele Giacone <1o5g4r8o@gmail.com>2014-03-20 10:44:20 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-03-20 10:44:20 +0100
commit7b054153eccbf0843fbbfb131855f56ea5c695e0 (patch)
tree42980519516696dd3d38d6bb0948403117581d86 /libstore
parent2294f2fdffcf724cc28653976b8029351e41fd77 (diff)
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.
Diffstat (limited to 'libstore')
-rw-r--r--libstore/Makefile20
1 files changed, 11 insertions, 9 deletions
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