> Try to replace the whole use-compression block of configure.ac with > something like (untested):
Attached. Tested for zlib.h under linux. I can not move libz.so away since my system tends to crash if I do so. Bo
Index: src/lyxlex_pimpl.C =================================================================== --- src/lyxlex_pimpl.C (revision 13764) +++ src/lyxlex_pimpl.C (working copy) @@ -140,7 +140,6 @@ if (format == "gzip" || format == "zip" || format == "compress") { lyxerr[Debug::LYXLEX] << "lyxlex: compressed" << endl; -#ifdef USE_COMPRESSION // The check only outputs a debug message, because it triggers // a bug in compaq cxx 6.2, where is_open() returns 'true' for // a fresh new filebuf. (JMarc) @@ -153,9 +152,6 @@ name = filename; lineno = 0; return gz_.component<io::file_source>(1)->is_open() && is.good(); -#else - return false; -#endif } else { lyxerr[Debug::LYXLEX] << "lyxlex: UNcompressed" << endl; Index: src/buffer.C =================================================================== --- src/buffer.C (revision 13764) +++ src/buffer.C (working copy) @@ -68,12 +68,10 @@ #include "support/lyxalgo.h" #include "support/filetools.h" #include "support/fs_extras.h" -#ifdef USE_COMPRESSION # include <boost/iostreams/filtering_stream.hpp> # include <boost/iostreams/filter/gzip.hpp> # include <boost/iostreams/device/file.hpp> namespace io = boost::iostreams; -#endif #include "support/lyxlib.h" #include "support/os.h" #include "support/path.h" @@ -737,15 +735,11 @@ bool retval = false; if (params().compressed) { -#ifdef USE_COMPRESSION io::filtering_ostream ofs(io::gzip_compressor() | io::file_sink(fname)); if (!ofs) return false; retval = do_writeFile(ofs); -#else - return false; -#endif } else { ofstream ofs(fname.c_str(), ios::out|ios::trunc); if (!ofs) Index: src/lyxlex_pimpl.h =================================================================== --- src/lyxlex_pimpl.h (revision 13764) +++ src/lyxlex_pimpl.h (working copy) @@ -14,12 +14,10 @@ #include "lyxlex.h" -#ifdef USE_COMPRESSION # include <boost/iostreams/filtering_streambuf.hpp> # include <boost/iostreams/filter/gzip.hpp> # include <boost/iostreams/device/file.hpp> namespace io = boost::iostreams; -#endif #include <boost/utility.hpp> @@ -64,10 +62,8 @@ /// fb_ is only used to open files, the stream is accessed through is. std::filebuf fb_; -#ifdef USE_COMPRESSION /// gz_ is only used to open files, the stream is accessed through is. io::filtering_istreambuf gz_; -#endif /// the stream that we use. std::istream is; Index: src/tex2lyx/Makefile.am =================================================================== --- src/tex2lyx/Makefile.am (revision 13764) +++ src/tex2lyx/Makefile.am (working copy) @@ -20,9 +20,7 @@ BOOST_LIBS = $(BOOST_REGEX) $(BOOST_FILESYSTEM) $(BOOST_IOSTREAMS) -if USE_COMPRESSION COMPRESSIONLIB = -lz -endif LINKED_FILES = \ FloatList.C \ Index: configure.ac =================================================================== --- configure.ac (revision 13764) +++ configure.ac (working copy) @@ -272,26 +272,11 @@ # Check the form of mkdir() AC_FUNC_MKDIR -AC_ARG_ENABLE(compression-support, AC_HELP_STRING([--enable-compression-support],[Support for compressed files.]),[ - case "${enableval}" in - yes) use_compression=true ;; - no) use_compression=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-compression-support) ;; - esac -],[use_compression=true]) -if test $use_compression=true ; then - AC_CHECK_HEADERS(zlib.h, use_compression=true, use_compression=false) - AC_CHECK_LIB(z, gzopen,[use_compression=true;LIBS="$LIBS -lz"], use_compression=false) - if test $use_compression = true ; then - AC_DEFINE(USE_COMPRESSION, 1, [Define as 1 if you want to support compressed files.]) - lyx_flags="compression $lyx_flags" - fi -fi -AM_CONDITIONAL(USE_COMPRESSION, test x$use_compression = xtrue) -AC_MSG_CHECKING([whether to support compressed files]) -AC_MSG_RESULT($use_compression) +# check for compression support +AC_CHECK_HEADERS(zlib.h, + [AC_CHECK_LIB(z, gzopen, [LIBS="$LIBS -lz"], LYX_ERROR([zlib not found!]))], + [LYX_ERROR([zlib.h not found!])]) - dnl This is a slight hack: the tests generated by autoconf 2.52 do not dnl work correctly because of some conflict with stdlib.h with g++ 2.96 dnl We aim to remove this eventually, since we should test as much as