[MINC-development] minc-patch: fixing check for gunzip
Jason Lerch
minc-development@bic.mni.mcgill.ca
Sun, 23 Nov 2003 07:44:14 -0500
--Boundary_(ID_/01n1O6gO/22SbxG0L5CYA)
Content-type: text/plain; charset=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
Greetings folks,
here's a patch (against CVS version of minc) fixing an issue on OS X -
namely that, in order for gzipped minc files to be handled correctly,
#define unix has to be true. I've replaced that with a configure time
check for gunzip.
Thanks to Sridar for pointing this out!
Cheers,
Jason
--Boundary_(ID_/01n1O6gO/22SbxG0L5CYA)
Content-type: application/octet-stream; x-unix-mode=0644; name=jpl_gunzip.patch
Content-transfer-encoding: 7bit
Content-disposition: attachment; filename=jpl_gunzip.patch
? jpl_gunzip.patch
Index: configure.in
===================================================================
RCS file: /software/source/minc/cvsroot/minc/configure.in,v
retrieving revision 6.12
diff -u -b -B -r6.12 configure.in
--- configure.in 14 Nov 2003 05:01:51 -0000 6.12
+++ configure.in 23 Nov 2003 12:27:48 -0000
@@ -4,7 +4,7 @@
AC_CONFIG_SRCDIR([libsrc/minc.h])
AC_CONFIG_AUX_DIR(ac_config_aux)
AM_INIT_AUTOMAKE(minc, 1.2)
-AC_CONFIG_HEADERS([config.h])
+AM_CONFIG_HEADER([config.h])
AC_REVISION($Revision: 6.12 $)
@@ -35,6 +35,12 @@
dnl need ac 2.57 for this? AC_CONFIG_LIBOBJ_DIR(libsrc)
AC_REPLACE_FUNCS(strdup)
+
+dnl check for gzip
+AC_PATH_PROGS(GUNZIP, gunzip, no)
+if test "$GUNZIP" != no; then
+ AC_DEFINE(HAVE_GUNZIP, 1, [Program gunzip exists])
+fi
dnl Verify existence of mkstemp, tempnam, and tmpnam
AC_CHECK_FUNCS(mkstemp tempnam tmpnam)
Index: libsrc/netcdf_convenience.c
===================================================================
RCS file: /software/source/minc/cvsroot/minc/libsrc/netcdf_convenience.c,v
retrieving revision 6.8
diff -u -b -B -r6.8 netcdf_convenience.c
--- libsrc/netcdf_convenience.c 17 Mar 2003 16:15:33 -0000 6.8
+++ libsrc/netcdf_convenience.c 23 Nov 2003 12:27:50 -0000
@@ -189,7 +189,7 @@
#define BYTES_PER_OPEN (1024*64)
#define NUM_BUFFERS_PER_OPEN ((BYTES_PER_OPEN - 1) / sizeof(buffer) + 1)
-#ifndef unix
+#ifndef HAVE_GUNZIP
return 1;
--Boundary_(ID_/01n1O6gO/22SbxG0L5CYA)--