Ticket #32086: szip-changes.diff
File szip-changes.diff, 11.0 KB (added by ryandesign (Ryan Carsten Schmidt), 13 years ago) |
---|
-
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 24 24 SET (HDF_AC_APPLE_UNIVERSAL_BUILD 0) 25 25 ENDIF (APPLE) 26 26 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 flags31 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 45 27 #----------------------------------------------------------------------------- 46 28 # This MACRO checks IF the symbol exists in the library and IF it 47 29 # does, it appends library to the list. … … 60 42 61 43 SET (WINDOWS) 62 44 IF (WIN32) 63 IF (NOT UNIX AND NOT CYGWIN )45 IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) 64 46 SET (WINDOWS 1) 65 ENDIF (NOT UNIX AND NOT CYGWIN )47 ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) 66 48 ENDIF (WIN32) 67 49 68 50 IF (WINDOWS) … … 110 92 111 93 112 94 SET (USE_INCLUDES "") 95 IF (WINDOWS) 96 SET (USE_INCLUDES ${USE_INCLUDES} "windows.h") 97 ENDIF (WINDOWS) 113 98 #----------------------------------------------------------------------------- 114 99 # Check IF header file exists and add it to the list. 115 100 #----------------------------------------------------------------------------- … … 156 141 CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" HAVE_INTTYPES_H) 157 142 CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" HAVE_NETINET_IN_H) 158 143 144 IF (NOT CYGWIN) 145 CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H4_HAVE_WINSOCK_H) 146 ENDIF (NOT CYGWIN) 159 147 160 148 # IF the c compiler found stdint, check the C++ as well. On some systems this 161 149 # file will be found by C but not C++, only do this test IF the C++ compiler … … 164 152 CHECK_INCLUDE_FILE_CXX ("stdint.h" HAVE_STDINT_H_CXX) 165 153 IF (NOT HAVE_STDINT_H_CXX) 166 154 SET (HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") 155 SET (USE_INCLUDES ${USE_INCLUDES} "stdint.h") 167 156 ENDIF (NOT HAVE_STDINT_H_CXX) 168 157 ENDIF (HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) 169 158 159 #----------------------------------------------------------------------------- 160 # Check for large file support 161 #----------------------------------------------------------------------------- 162 163 # The linux-lfs option is deprecated. 164 SET (LINUX_LFS 0) 165 166 SET (HDF_EXTRA_FLAGS) 167 IF (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}) 201 ENDIF (NOT WINDOWS) 202 203 ADD_DEFINITIONS (${HDF_EXTRA_FLAGS}) 204 170 205 # For other tests to use the same libraries 171 206 SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) 172 207 … … 230 265 ) 231 266 IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") 232 267 SET (HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_TIME_GETTIMEOFDAY") 268 SET (HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_GETTIMEOFDAY") 233 269 ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") 234 270 ENDIF ("HAVE_TIME_GETTIMEOFDAY" MATCHES "^HAVE_TIME_GETTIMEOFDAY$") 235 271 … … 242 278 ) 243 279 IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") 244 280 SET (HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_SYS_TIME_GETTIMEOFDAY") 281 SET (HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "HAVE_GETTIMEOFDAY") 245 282 ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") 246 283 ENDIF ("HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^HAVE_SYS_TIME_GETTIMEOFDAY$") 247 ENDIF (NOT MSVC)248 284 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) 293 ENDIF (NOT MSVC) 257 294 258 295 # Check for Symbols 259 296 CHECK_SYMBOL_EXISTS (tzname "time.h" HAVE_DECL_TZNAME) … … 291 328 ENDIF ("${def}") 292 329 ENDFOREACH (def) 293 330 294 IF (L INUX_LFS)331 IF (LARGEFILE) 295 332 SET (MACRO_CHECK_FUNCTION_DEFINITIONS 296 333 "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" 297 334 ) 298 ENDIF (L INUX_LFS)335 ENDIF (LARGEFILE) 299 336 300 # (STATUS "Performing ${OTHER_TEST}")337 #MESSAGE (STATUS "Performing ${OTHER_TEST}") 301 338 TRY_COMPILE (${OTHER_TEST} 302 339 ${CMAKE_BINARY_DIR} 303 340 ${HDF_RESOURCES_DIR}/HDFTests.c … … 346 383 CXX_HAVE_OFFSETOF 347 384 ) 348 385 HDF_FUNCTION_TEST (${test}) 349 IF (NOT CYGWIN) 386 ENDFOREACH (test) 387 IF (NOT CYGWIN AND NOT MINGW) 350 388 HDF_FUNCTION_TEST (HAVE_TIMEZONE) 351 389 # HDF_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) 352 ENDIF (NOT CYGWIN) 353 ENDFOREACH (test) 390 ENDIF (NOT CYGWIN AND NOT MINGW) 354 391 ENDIF (NOT WINDOWS) 355 392 356 393 #----------------------------------------------------------------------------- -
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 217 217 218 218 #ifdef HAVE_TIMEZONE 219 219 220 #ifdef HAVE_SYS_TIME_H 220 221 #include <sys/time.h> 222 #endif 221 223 #include <time.h> 222 224 SIMPLE_TEST(timezone=0); 223 225 … … 325 327 326 328 #endif /* DEV_T_IS_SCALAR */ 327 329 328 #if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline )329 #ifndef __cplusplus330 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 #endif335 336 #endif /* INLINE_TEST */337 338 330 #ifdef HAVE_OFF64_T 339 331 #include <sys/types.h> 340 332 int main() … … 344 336 } 345 337 #endif 346 338 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 350 int 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 347 370 348 371 #ifdef GETTIMEOFDAY_GIVES_TZ 349 372 #ifdef HAVE_SYS_TIME_H … … 364 387 } 365 388 #endif 366 389 390 #ifdef LONE_COLON 391 int main(int argc, char * argv) 392 { 393 return 0; 394 } 395 #endif 396 397 #ifdef HAVE_GPFS 398 399 #include <gpfs.h> 400 int 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> 411 typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); 412 int 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 429 typedef int foo_t; 430 static INLINE_TEST_INLINE foo_t static_foo () { return 0; } 431 INLINE_TEST_INLINE foo_t foo () {return 0; } 432 int 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 3 3 # message (STATUS "${libname} libtype: ${libtype}") 4 4 HDF_SET_LIB_OPTIONS (${libtarget} ${libname} ${libtype}) 5 5 6 IF ( BUILD_SHARED_LIBS)6 IF (${libtype} MATCHES "SHARED") 7 7 IF (WIN32) 8 8 SET (LIBSZIP_VERSION ${SZIP_PACKAGE_VERSION_MAJOR}) 9 9 ELSE (WIN32) … … 11 11 ENDIF (WIN32) 12 12 SET_TARGET_PROPERTIES (${libtarget} PROPERTIES VERSION ${LIBSZIP_VERSION}) 13 13 SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${LIBSZIP_VERSION}) 14 ENDIF ( BUILD_SHARED_LIBS)14 ENDIF (${libtype} MATCHES "SHARED") 15 15 16 16 #-- Apple Specific install_name for libraries 17 17 IF (APPLE)