diff -ru 2.1_3/szip-2.1/config/cmake/ConfigureChecks.cmake 2.1_4/szip-2.1/config/cmake/ConfigureChecks.cmake
--- 2.1_3/szip-2.1/config/cmake/ConfigureChecks.cmake	2011-03-02 12:56:27.000000000 -0600
+++ 2.1_4/szip-2.1/config/cmake/ConfigureChecks.cmake	2011-10-18 11:43:01.000000000 -0500
@@ -24,24 +24,6 @@
   SET (HDF_AC_APPLE_UNIVERSAL_BUILD 0)
 ENDIF (APPLE)
 
-SET (LINUX_LFS 0)
-SET (HDF_EXTRA_FLAGS)
-IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.")
-  # Linux Specific flags
-  ADD_DEFINITIONS (-D_POSIX_SOURCE -D_BSD_SOURCE)
-  OPTION (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
-  IF (HDF_ENABLE_LARGE_FILE)
-    SET (LARGEFILE 1)
-    SET (HDF_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
-    SET (CMAKE_REQUIRED_DEFINITIONS ${HDF_EXTRA_FLAGS})
-  ENDIF (HDF_ENABLE_LARGE_FILE)
-ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.")
-IF (LINUX_LFS)
-  SET (HDF_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
-  SET (CMAKE_REQUIRED_DEFINITIONS ${HDF_EXTRA_FLAGS})
-ENDIF (LINUX_LFS)
-ADD_DEFINITIONS (${HDF_EXTRA_FLAGS})
-
 #-----------------------------------------------------------------------------
 # This MACRO checks IF the symbol exists in the library and IF it
 # does, it appends library to the list.
@@ -60,9 +42,9 @@
 
 SET (WINDOWS)
 IF (WIN32)
-  IF (NOT UNIX AND NOT CYGWIN)
+  IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
     SET (WINDOWS 1)
-  ENDIF (NOT UNIX AND NOT CYGWIN)
+  ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
 ENDIF (WIN32)
 
 IF (WINDOWS)
@@ -110,6 +92,9 @@
 
 
 SET (USE_INCLUDES "")
+IF (WINDOWS)
+  SET (USE_INCLUDES ${USE_INCLUDES} "windows.h")
+ENDIF (WINDOWS)
 #-----------------------------------------------------------------------------
 # Check IF header file exists and add it to the list.
 #-----------------------------------------------------------------------------
@@ -156,6 +141,9 @@
 CHECK_INCLUDE_FILE_CONCAT ("inttypes.h"      HAVE_INTTYPES_H)
 CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h"    HAVE_NETINET_IN_H)
 
+IF (NOT CYGWIN)
+  CHECK_INCLUDE_FILE_CONCAT ("winsock2.h"      H4_HAVE_WINSOCK_H)
+ENDIF (NOT CYGWIN)
 
 # IF the c compiler found stdint, check the C++ as well. On some systems this
 # file will be found by C but not C++, only do this test IF the C++ compiler
@@ -164,9 +152,56 @@
   CHECK_INCLUDE_FILE_CXX ("stdint.h" HAVE_STDINT_H_CXX)
   IF (NOT HAVE_STDINT_H_CXX)
     SET (HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
+    SET (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
   ENDIF (NOT HAVE_STDINT_H_CXX)
 ENDIF (HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
 
+#-----------------------------------------------------------------------------
+#  Check for large file support
+#-----------------------------------------------------------------------------
+
+# The linux-lfs option is deprecated.
+SET (LINUX_LFS 0)
+
+SET (HDF_EXTRA_FLAGS)
+IF (NOT WINDOWS)
+  # Linux Specific flags
+  SET (HDF_EXTRA_FLAGS -D_POSIX_SOURCE -D_BSD_SOURCE)
+  OPTION (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
+  IF (HDF_ENABLE_LARGE_FILE)
+    SET (msg "Performing TEST_LFS_WORKS")
+    TRY_RUN (TEST_LFS_WORKS_RUN   TEST_LFS_WORKS_COMPILE
+        ${CMAKE_BINARY_DIR}
+        ${HDF_RESOURCES_DIR}/HDFTests.c
+        CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS
+        OUTPUT_VARIABLE OUTPUT
+    )
+    IF (TEST_LFS_WORKS_COMPILE)
+      IF (TEST_LFS_WORKS_RUN  MATCHES 0)
+        SET (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg})
+    SET (LARGEFILE 1)
+        SET (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
+        MESSAGE (STATUS "${msg}... yes")
+      ELSE (TEST_LFS_WORKS_RUN  MATCHES 0)
+        SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
+        MESSAGE (STATUS "${msg}... no")
+        FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
+              "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n"
+        )
+      ENDIF (TEST_LFS_WORKS_RUN  MATCHES 0)
+    ELSE (TEST_LFS_WORKS_COMPILE )
+      SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
+      MESSAGE (STATUS "${msg}... no")
+      FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
+          "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n"
+      )
+    ENDIF (TEST_LFS_WORKS_COMPILE)
+  ENDIF (HDF_ENABLE_LARGE_FILE)
+  SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS})
+ENDIF (NOT WINDOWS)
+
+ADD_DEFINITIONS (${HDF_EXTRA_FLAGS})
+
 # For other tests to use the same libraries
 SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS})
 
@@ -230,6 +265,7 @@
     )
     IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE")
       SET (HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_TIME_GETTIMEOFDAY")
+      SET (HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_GETTIMEOFDAY")
     ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE")
   ENDIF ("HAVE_TIME_GETTIMEOFDAY" MATCHES "^HAVE_TIME_GETTIMEOFDAY$")
 
@@ -242,18 +278,19 @@
     )
     IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE")
       SET (HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_SYS_TIME_GETTIMEOFDAY")
+      SET (HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_GETTIMEOFDAY")
     ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE")
   ENDIF ("HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^HAVE_SYS_TIME_GETTIMEOFDAY$")
-ENDIF (NOT MSVC)
 
-IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT HAVE_GETTIMEOFDAY AND NOT MSVC)
-  MESSAGE (STATUS "---------------------------------------------------------------")
-  MESSAGE (STATUS "Function 'gettimeofday()' was not found. SZIP will use its")
-  MESSAGE (STATUS "  own implementation.. This can happen on older versions of")
-  MESSAGE (STATUS "  MinGW on Windows. Consider upgrading your MinGW installation")
-  MESSAGE (STATUS "  to a newer version such as MinGW 3.12")
-  MESSAGE (STATUS "---------------------------------------------------------------")
-ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT HAVE_GETTIMEOFDAY AND NOT MSVC)
+  IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT HAVE_GETTIMEOFDAY AND NOT MSVC)
+    MESSAGE (STATUS "---------------------------------------------------------------")
+    MESSAGE (STATUS "Function 'gettimeofday()' was not found. SZIP will use its")
+    MESSAGE (STATUS "  own implementation.. This can happen on older versions of")
+    MESSAGE (STATUS "  MinGW on Windows. Consider upgrading your MinGW installation")
+    MESSAGE (STATUS "  to a newer version such as MinGW 3.12")
+    MESSAGE (STATUS "---------------------------------------------------------------")
+  ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT HAVE_GETTIMEOFDAY AND NOT MSVC)
+ENDIF (NOT MSVC)
 
 # Check for Symbols
 CHECK_SYMBOL_EXISTS (tzname "time.h" HAVE_DECL_TZNAME)
@@ -291,13 +328,13 @@
       ENDIF ("${def}")
     ENDFOREACH (def)
 
-    IF (LINUX_LFS)
+    IF (LARGEFILE)
       SET (MACRO_CHECK_FUNCTION_DEFINITIONS
           "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
       )
-    ENDIF (LINUX_LFS)
+    ENDIF (LARGEFILE)
 
-    # (STATUS "Performing ${OTHER_TEST}")
+    #MESSAGE (STATUS "Performing ${OTHER_TEST}")
     TRY_COMPILE (${OTHER_TEST}
         ${CMAKE_BINARY_DIR}
         ${HDF_RESOURCES_DIR}/HDFTests.c
@@ -346,11 +383,11 @@
       CXX_HAVE_OFFSETOF
   )
     HDF_FUNCTION_TEST (${test})
-    IF (NOT CYGWIN)
+  ENDFOREACH (test)
+    IF (NOT CYGWIN AND NOT MINGW)
       HDF_FUNCTION_TEST (HAVE_TIMEZONE)
 #      HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS)
-    ENDIF (NOT CYGWIN)
-  ENDFOREACH (test)
+    ENDIF (NOT CYGWIN AND NOT MINGW)
 ENDIF (NOT WINDOWS)
 
 #-----------------------------------------------------------------------------
diff -ru 2.1_3/szip-2.1/config/cmake/HDFTests.c 2.1_4/szip-2.1/config/cmake/HDFTests.c
--- 2.1_3/szip-2.1/config/cmake/HDFTests.c	2010-07-14 08:43:15.000000000 -0500
+++ 2.1_4/szip-2.1/config/cmake/HDFTests.c	2011-10-18 11:43:01.000000000 -0500
@@ -217,7 +217,9 @@
 
 #ifdef HAVE_TIMEZONE
 
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 #include <time.h>
 SIMPLE_TEST(timezone=0);
 
@@ -325,16 +327,6 @@
 
 #endif /* DEV_T_IS_SCALAR */
 
-#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline )
-#ifndef __cplusplus
-typedef int foo_t;
-static INLINE_TEST_INLINE foo_t static_foo () { return 0; }
-INLINE_TEST_INLINE foo_t foo () {return 0; }
-int main() { return 0; }
-#endif
-
-#endif /* INLINE_TEST */
-
 #ifdef HAVE_OFF64_T
 #include <sys/types.h>
 int main()
@@ -344,6 +336,37 @@
 }
 #endif
 
+#ifdef TEST_LFS_WORKS
+/* Return 0 when LFS is available and 1 otherwise.  */
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
+#define _LARGE_FILES
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <assert.h>
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+  /* check that off_t can hold 2^63 - 1 and perform basic operations... */
+#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  if (OFF_T_64 % 2147483647 != 1)
+    return 1;
+
+  // stat breaks on SCO OpenServer
+  struct stat buf;
+  stat( argv[0], &buf );
+  if (!S_ISREG(buf.st_mode))
+    return 2;
+
+  FILE *file = fopen( argv[0], "r" );
+  off_t offset = ftello( file );
+  fseek( file, offset, SEEK_CUR );
+  fclose( file );
+  return 0;
+}
+#endif
 
 #ifdef GETTIMEOFDAY_GIVES_TZ
 #ifdef HAVE_SYS_TIME_H
@@ -364,3 +387,49 @@
 }
 #endif
 
+#ifdef LONE_COLON
+int main(int argc, char * argv) 
+{
+  return 0;
+}
+#endif
+
+#ifdef HAVE_GPFS
+
+#include <gpfs.h>
+int main ()
+{
+    int fd = 0; 
+    gpfs_fcntl(fd, (void *)0);
+}
+
+#endif /* HAVE_GPFS */
+
+#ifdef HAVE_IOEO
+
+#include <windows.h>
+typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
+int main ()
+{
+  PGNSI pGNSI;
+  pGNSI = (PGNSI) GetProcAddress(
+      GetModuleHandle(TEXT("kernel32.dll")), 
+      "InitOnceExecuteOnce");
+  if(NULL == pGNSI)
+    return 1;
+  else
+    return 0;
+}
+
+#endif /* HAVE_IOEO */
+
+
+#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline )
+#ifndef __cplusplus
+typedef int foo_t;
+static INLINE_TEST_INLINE foo_t static_foo () { return 0; }
+INLINE_TEST_INLINE foo_t foo () {return 0; }
+int main() { return 0; }
+#endif
+
+#endif /* INLINE_TEST */
diff -ru 2.1_3/szip-2.1/config/cmake/SZIPMacros.cmake 2.1_4/szip-2.1/config/cmake/SZIPMacros.cmake
--- 2.1_3/szip-2.1/config/cmake/SZIPMacros.cmake	2010-07-14 08:43:15.000000000 -0500
+++ 2.1_4/szip-2.1/config/cmake/SZIPMacros.cmake	2011-10-11 08:33:55.000000000 -0500
@@ -3,7 +3,7 @@
   # message (STATUS "${libname} libtype: ${libtype}")
   HDF_SET_LIB_OPTIONS (${libtarget} ${libname} ${libtype})
 
-  IF (BUILD_SHARED_LIBS)
+  IF (${libtype} MATCHES "SHARED")
     IF (WIN32)
       SET (LIBSZIP_VERSION ${SZIP_PACKAGE_VERSION_MAJOR})
     ELSE (WIN32)
@@ -11,7 +11,7 @@
     ENDIF (WIN32)
     SET_TARGET_PROPERTIES (${libtarget} PROPERTIES VERSION ${LIBSZIP_VERSION})
     SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${LIBSZIP_VERSION})
-  ENDIF (BUILD_SHARED_LIBS)
+  ENDIF (${libtype} MATCHES "SHARED")
 
   #-- Apple Specific install_name for libraries
   IF (APPLE)
