Ticket #32086: szip-changes.diff

File szip-changes.diff, 11.0 KB (added by ryandesign (Ryan Carsten Schmidt), 13 years ago)

changes between last version of szip 2.1 and current version

  • szip-2.1/config/cmake/ConfigureChecks.cmake

    diff -ru 2.1_3/szip-2.1/config/cmake/ConfigureChecks.cmake 2.1_4/szip-2.1/config/cmake/ConfigureChecks.cmake
    old new  
    2424  SET (HDF_AC_APPLE_UNIVERSAL_BUILD 0)
    2525ENDIF (APPLE)
    2626
    27 SET (LINUX_LFS 0)
    28 SET (HDF_EXTRA_FLAGS)
    29 IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.")
    30   # Linux Specific flags
    31   ADD_DEFINITIONS (-D_POSIX_SOURCE -D_BSD_SOURCE)
    32   OPTION (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
    33   IF (HDF_ENABLE_LARGE_FILE)
    34     SET (LARGEFILE 1)
    35     SET (HDF_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
    36     SET (CMAKE_REQUIRED_DEFINITIONS ${HDF_EXTRA_FLAGS})
    37   ENDIF (HDF_ENABLE_LARGE_FILE)
    38 ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.")
    39 IF (LINUX_LFS)
    40   SET (HDF_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
    41   SET (CMAKE_REQUIRED_DEFINITIONS ${HDF_EXTRA_FLAGS})
    42 ENDIF (LINUX_LFS)
    43 ADD_DEFINITIONS (${HDF_EXTRA_FLAGS})
    44 
    4527#-----------------------------------------------------------------------------
    4628# This MACRO checks IF the symbol exists in the library and IF it
    4729# does, it appends library to the list.
     
    6042
    6143SET (WINDOWS)
    6244IF (WIN32)
    63   IF (NOT UNIX AND NOT CYGWIN)
     45  IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
    6446    SET (WINDOWS 1)
    65   ENDIF (NOT UNIX AND NOT CYGWIN)
     47  ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
    6648ENDIF (WIN32)
    6749
    6850IF (WINDOWS)
     
    11092
    11193
    11294SET (USE_INCLUDES "")
     95IF (WINDOWS)
     96  SET (USE_INCLUDES ${USE_INCLUDES} "windows.h")
     97ENDIF (WINDOWS)
    11398#-----------------------------------------------------------------------------
    11499# Check IF header file exists and add it to the list.
    115100#-----------------------------------------------------------------------------
     
    156141CHECK_INCLUDE_FILE_CONCAT ("inttypes.h"      HAVE_INTTYPES_H)
    157142CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h"    HAVE_NETINET_IN_H)
    158143
     144IF (NOT CYGWIN)
     145  CHECK_INCLUDE_FILE_CONCAT ("winsock2.h"      H4_HAVE_WINSOCK_H)
     146ENDIF (NOT CYGWIN)
    159147
    160148# IF the c compiler found stdint, check the C++ as well. On some systems this
    161149# file will be found by C but not C++, only do this test IF the C++ compiler
     
    164152  CHECK_INCLUDE_FILE_CXX ("stdint.h" HAVE_STDINT_H_CXX)
    165153  IF (NOT HAVE_STDINT_H_CXX)
    166154    SET (HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
     155    SET (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
    167156  ENDIF (NOT HAVE_STDINT_H_CXX)
    168157ENDIF (HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
    169158
     159#-----------------------------------------------------------------------------
     160#  Check for large file support
     161#-----------------------------------------------------------------------------
     162
     163# The linux-lfs option is deprecated.
     164SET (LINUX_LFS 0)
     165
     166SET (HDF_EXTRA_FLAGS)
     167IF (NOT WINDOWS)
     168  # Linux Specific flags
     169  SET (HDF_EXTRA_FLAGS -D_POSIX_SOURCE -D_BSD_SOURCE)
     170  OPTION (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
     171  IF (HDF_ENABLE_LARGE_FILE)
     172    SET (msg "Performing TEST_LFS_WORKS")
     173    TRY_RUN (TEST_LFS_WORKS_RUN   TEST_LFS_WORKS_COMPILE
     174        ${CMAKE_BINARY_DIR}
     175        ${HDF_RESOURCES_DIR}/HDFTests.c
     176        CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS
     177        OUTPUT_VARIABLE OUTPUT
     178    )
     179    IF (TEST_LFS_WORKS_COMPILE)
     180      IF (TEST_LFS_WORKS_RUN  MATCHES 0)
     181        SET (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg})
     182    SET (LARGEFILE 1)
     183        SET (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
     184        MESSAGE (STATUS "${msg}... yes")
     185      ELSE (TEST_LFS_WORKS_RUN  MATCHES 0)
     186        SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
     187        MESSAGE (STATUS "${msg}... no")
     188        FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
     189              "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n"
     190        )
     191      ENDIF (TEST_LFS_WORKS_RUN  MATCHES 0)
     192    ELSE (TEST_LFS_WORKS_COMPILE )
     193      SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
     194      MESSAGE (STATUS "${msg}... no")
     195      FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
     196          "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n"
     197      )
     198    ENDIF (TEST_LFS_WORKS_COMPILE)
     199  ENDIF (HDF_ENABLE_LARGE_FILE)
     200  SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS})
     201ENDIF (NOT WINDOWS)
     202
     203ADD_DEFINITIONS (${HDF_EXTRA_FLAGS})
     204
    170205# For other tests to use the same libraries
    171206SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS})
    172207
     
    230265    )
    231266    IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE")
    232267      SET (HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_TIME_GETTIMEOFDAY")
     268      SET (HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_GETTIMEOFDAY")
    233269    ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE")
    234270  ENDIF ("HAVE_TIME_GETTIMEOFDAY" MATCHES "^HAVE_TIME_GETTIMEOFDAY$")
    235271
     
    242278    )
    243279    IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE")
    244280      SET (HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_SYS_TIME_GETTIMEOFDAY")
     281      SET (HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_GETTIMEOFDAY")
    245282    ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE")
    246283  ENDIF ("HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^HAVE_SYS_TIME_GETTIMEOFDAY$")
    247 ENDIF (NOT MSVC)
    248284
    249 IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT HAVE_GETTIMEOFDAY AND NOT MSVC)
    250   MESSAGE (STATUS "---------------------------------------------------------------")
    251   MESSAGE (STATUS "Function 'gettimeofday()' was not found. SZIP will use its")
    252   MESSAGE (STATUS "  own implementation.. This can happen on older versions of")
    253   MESSAGE (STATUS "  MinGW on Windows. Consider upgrading your MinGW installation")
    254   MESSAGE (STATUS "  to a newer version such as MinGW 3.12")
    255   MESSAGE (STATUS "---------------------------------------------------------------")
    256 ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT HAVE_GETTIMEOFDAY AND NOT MSVC)
     285  IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT HAVE_GETTIMEOFDAY AND NOT MSVC)
     286    MESSAGE (STATUS "---------------------------------------------------------------")
     287    MESSAGE (STATUS "Function 'gettimeofday()' was not found. SZIP will use its")
     288    MESSAGE (STATUS "  own implementation.. This can happen on older versions of")
     289    MESSAGE (STATUS "  MinGW on Windows. Consider upgrading your MinGW installation")
     290    MESSAGE (STATUS "  to a newer version such as MinGW 3.12")
     291    MESSAGE (STATUS "---------------------------------------------------------------")
     292  ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT HAVE_GETTIMEOFDAY AND NOT MSVC)
     293ENDIF (NOT MSVC)
    257294
    258295# Check for Symbols
    259296CHECK_SYMBOL_EXISTS (tzname "time.h" HAVE_DECL_TZNAME)
     
    291328      ENDIF ("${def}")
    292329    ENDFOREACH (def)
    293330
    294     IF (LINUX_LFS)
     331    IF (LARGEFILE)
    295332      SET (MACRO_CHECK_FUNCTION_DEFINITIONS
    296333          "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
    297334      )
    298     ENDIF (LINUX_LFS)
     335    ENDIF (LARGEFILE)
    299336
    300     # (STATUS "Performing ${OTHER_TEST}")
     337    #MESSAGE (STATUS "Performing ${OTHER_TEST}")
    301338    TRY_COMPILE (${OTHER_TEST}
    302339        ${CMAKE_BINARY_DIR}
    303340        ${HDF_RESOURCES_DIR}/HDFTests.c
     
    346383      CXX_HAVE_OFFSETOF
    347384  )
    348385    HDF_FUNCTION_TEST (${test})
    349     IF (NOT CYGWIN)
     386  ENDFOREACH (test)
     387    IF (NOT CYGWIN AND NOT MINGW)
    350388      HDF_FUNCTION_TEST (HAVE_TIMEZONE)
    351389#      HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS)
    352     ENDIF (NOT CYGWIN)
    353   ENDFOREACH (test)
     390    ENDIF (NOT CYGWIN AND NOT MINGW)
    354391ENDIF (NOT WINDOWS)
    355392
    356393#-----------------------------------------------------------------------------
  • szip-2.1/config/cmake/HDFTests.c

    diff -ru 2.1_3/szip-2.1/config/cmake/HDFTests.c 2.1_4/szip-2.1/config/cmake/HDFTests.c
    old new  
    217217
    218218#ifdef HAVE_TIMEZONE
    219219
     220#ifdef HAVE_SYS_TIME_H
    220221#include <sys/time.h>
     222#endif
    221223#include <time.h>
    222224SIMPLE_TEST(timezone=0);
    223225
     
    325327
    326328#endif /* DEV_T_IS_SCALAR */
    327329
    328 #if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline )
    329 #ifndef __cplusplus
    330 typedef int foo_t;
    331 static INLINE_TEST_INLINE foo_t static_foo () { return 0; }
    332 INLINE_TEST_INLINE foo_t foo () {return 0; }
    333 int main() { return 0; }
    334 #endif
    335 
    336 #endif /* INLINE_TEST */
    337 
    338330#ifdef HAVE_OFF64_T
    339331#include <sys/types.h>
    340332int main()
     
    344336}
    345337#endif
    346338
     339#ifdef TEST_LFS_WORKS
     340/* Return 0 when LFS is available and 1 otherwise.  */
     341#define _LARGEFILE_SOURCE
     342#define _LARGEFILE64_SOURCE
     343#define _LARGE_FILES
     344#define _FILE_OFFSET_BITS 64
     345#include <sys/types.h>
     346#include <sys/stat.h>
     347#include <assert.h>
     348#include <stdio.h>
     349
     350int main(int argc, char **argv)
     351{
     352  /* check that off_t can hold 2^63 - 1 and perform basic operations... */
     353#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
     354  if (OFF_T_64 % 2147483647 != 1)
     355    return 1;
     356
     357  // stat breaks on SCO OpenServer
     358  struct stat buf;
     359  stat( argv[0], &buf );
     360  if (!S_ISREG(buf.st_mode))
     361    return 2;
     362
     363  FILE *file = fopen( argv[0], "r" );
     364  off_t offset = ftello( file );
     365  fseek( file, offset, SEEK_CUR );
     366  fclose( file );
     367  return 0;
     368}
     369#endif
    347370
    348371#ifdef GETTIMEOFDAY_GIVES_TZ
    349372#ifdef HAVE_SYS_TIME_H
     
    364387}
    365388#endif
    366389
     390#ifdef LONE_COLON
     391int main(int argc, char * argv)
     392{
     393  return 0;
     394}
     395#endif
     396
     397#ifdef HAVE_GPFS
     398
     399#include <gpfs.h>
     400int main ()
     401{
     402    int fd = 0;
     403    gpfs_fcntl(fd, (void *)0);
     404}
     405
     406#endif /* HAVE_GPFS */
     407
     408#ifdef HAVE_IOEO
     409
     410#include <windows.h>
     411typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
     412int main ()
     413{
     414  PGNSI pGNSI;
     415  pGNSI = (PGNSI) GetProcAddress(
     416      GetModuleHandle(TEXT("kernel32.dll")),
     417      "InitOnceExecuteOnce");
     418  if(NULL == pGNSI)
     419    return 1;
     420  else
     421    return 0;
     422}
     423
     424#endif /* HAVE_IOEO */
     425
     426
     427#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline )
     428#ifndef __cplusplus
     429typedef int foo_t;
     430static INLINE_TEST_INLINE foo_t static_foo () { return 0; }
     431INLINE_TEST_INLINE foo_t foo () {return 0; }
     432int main() { return 0; }
     433#endif
     434
     435#endif /* INLINE_TEST */
  • szip-2.1/config/cmake/SZIPMacros.cmake

    diff -ru 2.1_3/szip-2.1/config/cmake/SZIPMacros.cmake 2.1_4/szip-2.1/config/cmake/SZIPMacros.cmake
    old new  
    33  # message (STATUS "${libname} libtype: ${libtype}")
    44  HDF_SET_LIB_OPTIONS (${libtarget} ${libname} ${libtype})
    55
    6   IF (BUILD_SHARED_LIBS)
     6  IF (${libtype} MATCHES "SHARED")
    77    IF (WIN32)
    88      SET (LIBSZIP_VERSION ${SZIP_PACKAGE_VERSION_MAJOR})
    99    ELSE (WIN32)
     
    1111    ENDIF (WIN32)
    1212    SET_TARGET_PROPERTIES (${libtarget} PROPERTIES VERSION ${LIBSZIP_VERSION})
    1313    SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${LIBSZIP_VERSION})
    14   ENDIF (BUILD_SHARED_LIBS)
     14  ENDIF (${libtype} MATCHES "SHARED")
    1515
    1616  #-- Apple Specific install_name for libraries
    1717  IF (APPLE)