commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 01/02: Make bz2 and gz support optional


From: Samuel Thibault
Subject: [hurd] 01/02: Make bz2 and gz support optional
Date: Thu, 20 Mar 2014 09:58:14 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 7b054153eccbf0843fbbfb131855f56ea5c695e0
Author: Gabriele Giacone <address@hidden>
Date:   Thu Mar 20 10:44:20 2014 +0100

    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.
---
 config.make.in    |  6 ++++++
 configure.ac      | 23 +++++++++++++++++++----
 ext2fs/Makefile   |  2 +-
 fatfs/Makefile    |  2 +-
 isofs/Makefile    |  2 +-
 libstore/Makefile | 20 +++++++++++---------
 6 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/config.make.in b/config.make.in
index 5bfc777..c5d4e68 100644
--- a/config.make.in
+++ b/config.make.in
@@ -87,6 +87,12 @@ HAVE_DAEMON = @HAVE_DAEMON@
 libdaemon_CFLAGS = @libdaemon_CFLAGS@
 libdaemon_LIBS = @libdaemon_LIBS@
 
+# How to compile and link against libbz2.
+HAVE_LIBBZ2 = @HAVE_LIBBZ2@
+
+# How to compile and link against libz.
+HAVE_LIBZ = @HAVE_LIBZ@
+
 # How to compile and link against libblkid.
 HAVE_BLKID = @HAVE_BLKID@
 libblkid_CFLAGS = @libblkid_CFLAGS@
diff --git a/configure.ac b/configure.ac
index b6f777e..ecabfdf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,13 +211,31 @@ AS_IF([test "x$with_parted" != xno], [
 ])
 AC_SUBST([PARTED_LIBS])
 
+AC_ARG_WITH([libbz2],
+  [AS_HELP_STRING([--without-libbz2], [disable libbz2])], , [with_libbz2=yes])
+
+AS_IF([test "x$with_libbz2" != xno], [
+  AC_CHECK_LIB(bz2, BZ2_bzCompress, [HAVE_LIBBZ2=1], [true])
+])
+AC_SUBST([HAVE_LIBBZ2])
+
+AC_ARG_WITH([libz],
+  [AS_HELP_STRING([--without-libz], [disable libz])], , [with_libz=yes])
+
+AS_IF([test "x$with_libz" != xno], [
+  AC_CHECK_LIB(z, deflate, [HAVE_LIBZ=1], [true])
+])
+AC_SUBST([HAVE_LIBZ])
+
 AC_ARG_ENABLE(boot-store-types,
 [  --enable-boot-store-types=TYPES...
                          list of store types included in statically
                          linked filesystems used for booting])dnl
 if test -z "$enable_boot_store_types"; then
-  boot_store_types='device remap gunzip bunzip2'
+  boot_store_types='device remap'
   test -z "$PARTED_LIBS" || boot_store_types="$boot_store_types part"
+  test -z "$HAVE_LIBBZ2" || boot_store_types="$boot_store_types bunzip2"
+  test -z "$HAVE_LIBZ"   || boot_store_types="$boot_store_types gunzip"
 elif test "x$enable_boot_store_types" = xno; then
   AC_MSG_WARN([you probably wanted --disable-static-progs])
 else
@@ -315,9 +333,6 @@ PKG_CHECK_MODULES([libblkid], [blkid],
 AC_SUBST([libblkid_LIBS])
 AC_SUBST([libblkid_CFLAGS])
 
-AC_CHECK_LIB(bz2, BZ2_bzCompress, , AC_MSG_ERROR([libbz2 is required.]))
-AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([libz is required.]))
-
 AC_CONFIG_FILES([config.make ${makefiles}])
 AC_OUTPUT
 
diff --git a/ext2fs/Makefile b/ext2fs/Makefile
index 32e40f0..8d2e68c 100644
--- a/ext2fs/Makefile
+++ b/ext2fs/Makefile
@@ -24,7 +24,7 @@ SRCS = balloc.c dir.c ext2fs.c getblk.c hyper.c ialloc.c \
        inode.c pager.c pokel.c truncate.c storeinfo.c msg.c xinl.c
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = diskfs pager iohelp fshelp store ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread -lbz2 -lz
+OTHERLIBS = -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz)
 
 include ../Makeconf
 
diff --git a/fatfs/Makefile b/fatfs/Makefile
index 2555669..6224b64 100644
--- a/fatfs/Makefile
+++ b/fatfs/Makefile
@@ -23,7 +23,7 @@ SRCS = inode.c main.c dir.c pager.c fat.c virt-inode.c 
node-create.c
 
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = diskfs iohelp fshelp store pager ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread -lbz2 -lz
+OTHERLIBS = -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz)
 
 include ../Makeconf
 
diff --git a/isofs/Makefile b/isofs/Makefile
index 9147c12..6475c52 100644
--- a/isofs/Makefile
+++ b/isofs/Makefile
@@ -22,7 +22,7 @@ SRCS = inode.c main.c lookup.c pager.c rr.c
 
 OBJS = $(SRCS:.c=.o)
 HURDLIBS = diskfs iohelp fshelp store pager ports ihash shouldbeinlibc
-OTHERLIBS = -lpthread -lbz2 -lz
+OTHERLIBS = -lpthread $(and $(HAVE_LIBBZ2),-lbz2) $(and $(HAVE_LIBZ),-lz)
 
 include ../Makeconf
 
diff --git a/libstore/Makefile b/libstore/Makefile
index 2bb5e4b..28f5660 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
 

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]