From f411d708e7db110702db21a109c85f045070d713 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 18 Oct 2013 22:36:41 -0700 Subject: [PATCH] configure: Make zlib a required dependency (instead of optional). 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 | 4 ++-- NEWS | 4 ++++ configure.ac | 14 +++----------- src/libpspp/inflate.c | 6 +----- src/libpspp/zip-reader.c | 6 +----- src/libpspp/zip-reader.h | 4 +--- 6 files changed, 12 insertions(+), 26 deletions(-) diff --git a/INSTALL b/INSTALL index 34c0d64fff..acc4bfa0ad 100644 --- 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 6ac997c833..5b166c3ef1 100644 --- 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: diff --git a/configure.ac b/configure.ac index befff34f11..853f22bcfa 100644 --- a/configure.ac +++ b/configure.ac @@ -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( diff --git a/src/libpspp/inflate.c b/src/libpspp/inflate.c index c4ad1cffc9..afe64a6390 100644 --- a/src/libpspp/inflate.c +++ b/src/libpspp/inflate.c @@ -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 #include #include @@ -145,5 +143,3 @@ inflate_read (struct zip_member *zm, void *buf, size_t n) return -1; } - -#endif diff --git a/src/libpspp/zip-reader.c b/src/libpspp/zip-reader.c index 7c1e342aa7..34905b9fb2 100644 --- a/src/libpspp/zip-reader.c +++ b/src/libpspp/zip-reader.c @@ -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; diff --git a/src/libpspp/zip-reader.h b/src/libpspp/zip-reader.h index 966bd5990f..ccb1ef39f1 100644 --- a/src/libpspp/zip-reader.h +++ b/src/libpspp/zip-reader.h @@ -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 }; -- 2.30.2