configure: Make zlib a required dependency (instead of optional).
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 19 Oct 2013 05:36:41 +0000 (22:36 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 23 Oct 2013 05:56:56 +0000 (22:56 -0700)
It would be nice to support zlib compression for system files everywhere,
not just on some systems, so to do that we need to require zlib.

INSTALL
NEWS
configure.ac
src/libpspp/inflate.c
src/libpspp/zip-reader.c
src/libpspp/zip-reader.h

diff --git a/INSTALL b/INSTALL
index 34c0d64fff6e9d7838a3855f702439ac8bb8788a..acc4bfa0ad49379e78321a89938007c14149a3ad 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -61,6 +61,8 @@ The following packages are required to install PSPP:
       GNU libc includes an integrated libintl, so there is no need to
       separately install libintl on a GNU/Linux system.
 
+    * zlib (http://www.zlib.net/).
+
 The following packages are required to enable PSPP's graphing
 features.  If you cannot arrange to install them, you must run
 `configure' with --without-cairo (in which case you will get no graphing
@@ -89,8 +91,6 @@ The following packages are optional:
 Installing the following packages will allow your PSPP program to read
 Gnumeric files.
 
-    * zlib (http://www.zlib.net/).
-
     * libxml2 (http://xmlsoft.org/).  
 
 Installing the following packages will allow your PSPP program to write
diff --git a/NEWS b/NEWS
index 6ac997c8331c7857b5816466e8856a40b4ba0e53..5b166c3ef13b26a05a80d32c3a35f5d9dcd04cc1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,10 @@ Changes since 0.8.1:
    way.  To fix the problem, read the system file with this version of
    PSPP and then save a new copy of it.)
 
+ * Build changes:
+
+   - zlib is now a required dependency.  (Previously it was optional.)
+
 Changes from 0.8.0 to 0.8.1:
 
  * New commands:
index befff34f11efe7b0658a39132f1ebc81e7fcc55c..853f22bcfa840644dbfac2388d3a8ebae2f574f9 100644 (file)
@@ -176,16 +176,8 @@ PKG_CHECK_MODULES(
    PSPP_OPTIONAL_PREREQ([libxml2])])
 
 dnl Check for zlib.
-AC_SEARCH_LIBS(
-  [gzopen], [z],
-  [HAVE_ZLIB=yes],
-  [HAVE_ZLIB=no
-   PSPP_OPTIONAL_PREREQ([zlib])])
-AC_CHECK_HEADERS(
-  [zlib.h], 
-  [],
-  [HAVE_ZLIB=no
-   PSPP_OPTIONAL_PREREQ([zlib])])
+AC_SEARCH_LIBS([gzopen], [z], [], [PSPP_REQUIRED_PREREQ([zlib])])
+AC_CHECK_HEADERS([zlib.h], [], [PSPP_REQUIRED_PREREQ([zlib])])
 
 dnl Avoid interference between zlib's crc32() function and gnulib's
 dnl crc32() function, which have different signatures.  PSPP calls
@@ -200,7 +192,7 @@ AC_DEFINE(
   [Avoid making zlib call gnulib's crc32() instead of its own.])
 
 dnl Gnumeric and OpenDocument (read) support requires libxml2 and zlib.
-if test $HAVE_LIBXML2 = yes && test $HAVE_ZLIB = yes; then
+if test $HAVE_LIBXML2 = yes; then
   GNM_READ_SUPPORT=yes
   ODF_READ_SUPPORT=yes
   AC_DEFINE(
index c4ad1cffc9022afb14ed8749d339dfcb66e909b6..afe64a63906b76f6af30e988e2244f4fdd47e8ad 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011, 2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -19,8 +19,6 @@
 
 #include "inflate.h"
 
-#if HAVE_ZLIB_H
-
 #include <xalloc.h>
 #include <zlib.h>
 #include <stdio.h>
@@ -145,5 +143,3 @@ inflate_read (struct zip_member *zm, void *buf, size_t n)
 
   return -1;
 }
-
-#endif
index 7c1e342aa76e51bb513afa1e72cf01d9bf41e7d0..34905b9fb2cc2e9ab40ee0e0932c8127d4013a7e 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011, 2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -65,9 +65,7 @@ stored_finish (struct zip_member *zm UNUSED)
 static struct decompressor decompressors[n_COMPRESSION] = 
   {
     {stored_init, stored_read, stored_finish},
-#if HAVE_ZLIB_H
     {inflate_init, inflate_read, inflate_finish}
-#endif
   };
 
 static enum compression
@@ -79,11 +77,9 @@ comp_code (struct zip_member *zm, uint16_t c)
     case 0:
       which = COMPRESSION_STORED;
       break;
-#if HAVE_ZLIB_H
     case 8:
       which = COMPRESSION_INFLATE;
       break;
-#endif
     default:
       ds_put_format (zm->errs, _("Unsupported compression type (%d)"), c);
       which = n_COMPRESSION;
index 966bd5990f25adf1cc37c0879fad05aba3038b4e..ccb1ef39f1bd25d3e5cf9b34f2135e9675d20387 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011, 2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -26,9 +26,7 @@ struct string;
 enum compression
   {
     COMPRESSION_STORED = 0,
-#if HAVE_ZLIB_H
     COMPRESSION_INFLATE,
-#endif
     n_COMPRESSION
   };