Index: /trunk/FACT++/configure
===================================================================
--- /trunk/FACT++/configure	(revision 11614)
+++ /trunk/FACT++/configure	(revision 11615)
@@ -751,4 +751,6 @@
 IS_FALSE_FALSE
 IS_FALSE_TRUE
+HAS_ZLIB_FALSE
+HAS_ZLIB_TRUE
 HAS_FITS_FALSE
 HAS_FITS_TRUE
@@ -1031,4 +1033,7 @@
 with_motif_includes
 with_motif_libraries
+with_zlib
+with_zlib_include
+with_zlib_libdir
 with_cfitsio
 with_cfitsio_include
@@ -1735,4 +1740,8 @@
   --with-motif-includes=DIR    Motif include files are in DIR
   --with-motif-libraries=DIR   Motif libraries are in DIR
+  --with-zlib=DIR	root directory of zlib installation
+  --with-zlib-include=DIR        specify exact include dir for zlib headers (e.g. zlib.h)
+  --with-zlib-libdir=DIR        specify exact library dir for zlib library (e.g. libz)
+  --without-zlib        disables zlib usage completely
   --with-cfitsio=DIR	root directory of cfitsio installation
   --with-cfitsio-include=DIR        specify exact include dir for cfitsio headers (e.g. fitsio.h)
@@ -4795,11 +4804,11 @@
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:4797: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:4806: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4800: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:4809: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4803: output\"" >&5)
+  (eval echo "\"\$as_me:4812: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
@@ -6006,5 +6015,5 @@
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6008 "configure"' > conftest.$ac_ext
+  echo '#line 6017 "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7667,9 +7676,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7669: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7678: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7673: \$? = $ac_status" >&5
+   echo "$as_me:7682: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -8006,9 +8015,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8008: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8017: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8012: \$? = $ac_status" >&5
+   echo "$as_me:8021: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -8111,9 +8120,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8113: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8122: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8117: \$? = $ac_status" >&5
+   echo "$as_me:8126: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -8166,9 +8175,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8168: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8177: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8172: \$? = $ac_status" >&5
+   echo "$as_me:8181: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -10550,5 +10559,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10552 "configure"
+#line 10561 "configure"
 #include "confdefs.h"
 
@@ -10646,5 +10655,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10648 "configure"
+#line 10657 "configure"
 #include "confdefs.h"
 
@@ -12602,9 +12611,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12604: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12613: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:12608: \$? = $ac_status" >&5
+   echo "$as_me:12617: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -12701,9 +12710,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12703: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12712: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12707: \$? = $ac_status" >&5
+   echo "$as_me:12716: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -12753,9 +12762,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12755: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12764: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12759: \$? = $ac_status" >&5
+   echo "$as_me:12768: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -18214,4 +18223,123 @@
 fi
 
+# Check for zlib and exit with error if not found (defines HAVE_LIBZ)
+
+
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+  withval=$with_zlib; with_zlib=$withval
+if test "${with_zlib}" != yes; then
+	zlib_include="$withval/include"
+	zlib_libdir="$withval/lib"
+fi
+
+fi
+
+
+
+# Check whether --with-zlib-include was given.
+if test "${with_zlib_include+set}" = set; then :
+  withval=$with_zlib_include; zlib_include="$withval"
+fi
+
+
+
+# Check whether --with-zlib-libdir was given.
+if test "${with_zlib_libdir+set}" = set; then :
+  withval=$with_zlib_libdir; zlib_libdir="$withval"
+fi
+
+
+if test "${with_zlib}" != no ; then
+	OLD_LIBS=$LIBS
+	OLD_LDFLAGS=$LDFLAGS
+	OLD_CFLAGS=$CFLAGS
+	OLD_CPPFLAGS=$CPPFLAGS
+
+	if test "${zlib_libdir}" ; then
+		LDFLAGS="$LDFLAGS -L${zlib_libdir}"
+	fi
+	if test "${zlib_include}" ; then
+		CPPFLAGS="$CPPFLAGS -I${zlib_include}"
+		CFLAGS="$CFLAGS -I${zlib_include}"
+	fi
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5
+$as_echo_n "checking for inflateEnd in -lz... " >&6; }
+if test "${ac_cv_lib_z_inflateEnd+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inflateEnd ();
+int
+main ()
+{
+return inflateEnd ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_inflateEnd=yes
+else
+  ac_cv_lib_z_inflateEnd=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5
+$as_echo "$ac_cv_lib_z_inflateEnd" >&6; }
+if test "x$ac_cv_lib_z_inflateEnd" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+else
+  no_good=yes
+fi
+
+	ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = x""yes; then :
+
+else
+  no_good=yes
+fi
+
+
+	if test "$no_good" = yes; then
+		HAVE_ZLIB=no
+
+		LIBS=$OLD_LIBS
+		LDFLAGS=$OLD_LDFLAGS
+		CPPFLAGS=$OLD_CPPFLAGS
+		CFLAGS=$OLD_CFLAGS
+	else
+		HAVE_ZLIB=yes
+
+		$as_echo "#define HAVE_PKG_zlib 1" >>confdefs.h
+
+	fi
+
+fi
+
+
+
+#AC_CHECK_FILE(gui/RawEventsViewer(izstream.h, [action.if-yes], [action-if-no])
+#AC_CHECK_FILE(gui/RawEventsViewer(fits.h    , [action.if-yes], [action-if-no])
+
 # Needed to compile FACT++
 
@@ -21686,5 +21814,5 @@
 
 		cat > conftest.$ac_ext <<EOF
-#line 21688 "configure"
+#line 21816 "configure"
 #include "confdefs.h"
 #include <qglobal.h>
@@ -22387,4 +22515,12 @@
 fi
 
+ if test "$HAVE_ZLIB" = yes; then
+  HAS_ZLIB_TRUE=
+  HAS_ZLIB_FALSE='#'
+else
+  HAS_ZLIB_TRUE='#'
+  HAS_ZLIB_FALSE=
+fi
+
 
  if test "x" = "y"; then
@@ -22411,4 +22547,8 @@
 if test "$ROOTEXEC" != no; then
   $as_echo "#define HAVE_ROOT 1" >>confdefs.h
+
+fi
+if test "$HAVE_ZLIB" = yes; then
+  $as_echo "#define HAVE_ZLIB 1" >>confdefs.h
 
 fi
@@ -22722,4 +22862,8 @@
 if test -z "${HAS_FITS_TRUE}" && test -z "${HAS_FITS_FALSE}"; then
   as_fn_error $? "conditional \"HAS_FITS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAS_ZLIB_TRUE}" && test -z "${HAS_ZLIB_FALSE}"; then
+  as_fn_error $? "conditional \"HAS_ZLIB\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
@@ -25112,4 +25256,6 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
 $as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}:  zlib                   / 'zlib.h'          found: $HAVE_ZLIB" >&5
+$as_echo "$as_me:  zlib                   / 'zlib.h'          found: $HAVE_ZLIB" >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}:  cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO" >&5
 $as_echo "$as_me:  cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO" >&6;}
@@ -25272,4 +25418,11 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
 $as_echo "$as_me: " >&6;}
+if test "$HAVE_ZLIB" = yes; then
+  :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  zlib not found. Support for reading zipped files disabled!" >&5
+$as_echo "$as_me: WARNING:  zlib not found. Support for reading zipped files disabled!" >&2;}
+
+fi
 if test "$lt_cv_libxp" = "yes"; then
   :
Index: /trunk/FACT++/configure.ac
===================================================================
--- /trunk/FACT++/configure.ac	(revision 11614)
+++ /trunk/FACT++/configure.ac	(revision 11615)
@@ -106,4 +106,11 @@
    AC_MSG_WARN([ Motif/lesstif not found!])
 )
+
+# Check for zlib and exit with error if not found (defines HAVE_LIBZ)
+AC_CHECK_PACKAGE(zlib, inflateEnd, z, zlib.h,
+		 HAVE_ZLIB=yes, HAVE_ZLIB=no)
+
+#AC_CHECK_FILE(gui/RawEventsViewer(izstream.h, [action.if-yes], [action-if-no])
+#AC_CHECK_FILE(gui/RawEventsViewer(fits.h    , [action.if-yes], [action-if-no])
 
 # Needed to compile FACT++
@@ -282,4 +289,5 @@
 AM_CONDITIONAL(HAS_CCFITS,    [test "$HAVE_CCFITS" = yes])
 AM_CONDITIONAL(HAS_FITS,      [test "$HAVE_CFITSIO" = yes -a "$HAVE_CCFITS" = yes])
+AM_CONDITIONAL(HAS_ZLIB,      [test "$HAVE_ZLIB" = yes])
 
 AM_CONDITIONAL(IS_FALSE,      [test "x" = "y"])
@@ -288,4 +296,5 @@
 AM_COND_IF(HAS_FITS, [AC_DEFINE(HAVE_FITS)], )
 AM_COND_IF(HAS_ROOT, [AC_DEFINE(HAVE_ROOT)], )
+AM_COND_IF(HAS_ZLIB, [AC_DEFINE(HAVE_ZLIB)], )
 
 ##########################################################################
@@ -335,4 +344,5 @@
 AC_MSG_NOTICE(--------------------------------------------------------------------)
 AC_MSG_NOTICE()
+AC_MSG_NOTICE([ zlib                   / 'zlib.h'          found: $HAVE_ZLIB])
 AC_MSG_NOTICE([ cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO])
 AC_MSG_NOTICE([ CCfits                 / 'CCfits/CCfits'   found: $HAVE_CCFITS])
@@ -416,4 +426,7 @@
 AC_MSG_NOTICE(--------------------------------------------------------------------)
 AC_MSG_NOTICE()
+AM_COND_IF(HAS_ZLIB,, 
+      AC_MSG_WARN([ zlib not found. Support for reading zipped files disabled!])
+)
 AM_COND_IF(HAS_LIBXP,, 
       AC_MSG_WARN([ Motif/lesstif not found. The dim gui did will not be built!])
