Control: reassign -1 src:hurd
Control: retitle -1 Disable bz2 and z support

On Wed, Mar 12, 2014 at 01:45:27PM +0100, Samuel Thibault wrote:
> Gabriele Giacone, le Wed 12 Mar 2014 13:04:43 +0100, a ?crit :
> > Attached patch adds library udeb needed by recent hurd versions.
> 
> Err, I'd rather just disable bz2 support in the d-i case: we don't need
> that support there.

Attached patch to disable both bz2 and z support.
Remember to add --without-libbz2 and --without-libz to CONFIGURE_ARGS_udeb.


--
G..e
--- 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@
--- 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
@@ -321,9 +339,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
 
--- a/ext2fs/Makefile
+++ b/ext2fs/Makefile
@@ -24,7 +24,7 @@ SRCS = balloc.c dir.c ext2fs.c getblk.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
 
--- a/fatfs/Makefile
+++ b/fatfs/Makefile
@@ -23,7 +23,7 @@ SRCS = inode.c main.c dir.c pager.c fat.
 
 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
 
--- a/isofs/Makefile
+++ b/isofs/Makefile
@@ -22,7 +22,7 @@ SRCS = inode.c main.c lookup.c pager.c r
 
 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
 
--- a/libstore/Makefile
+++ b/libstore/Makefile
@@ -28,35 +28,37 @@ SRCS = create.c derive.c make.c rdwr.c s
        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
 

Reply via email to