diff -ru4NwbB libpng-1.2.39/png.h libpng-1.2.40rc01/png.h --- libpng-1.2.39/png.h 2009-08-13 06:13:21.882034954 -0500 +++ libpng-1.2.40rc01/png.h 2009-09-02 07:04:02.801282311 -0500 @@ -240,8 +240,10 @@ * 1.2.39beta01-05 13 10239 12.so.0.39[.0] * 1.2.39rc01 13 10239 12.so.0.39[.0] * 1.0.48 10 10048 10.so.0.48[.0] * 1.2.39 13 10239 12.so.0.39[.0] + * 1.2.40beta01 13 10240 12.so.0.40[.0] + * 1.2.40rc01 13 10240 12.so.0.40[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The @@ -488,13 +490,13 @@ */ #define PNG_LIBPNG_VER %VER_NUM% /* %MAJOR%.%MINOR%.%RELEASE% */ #ifndef PNG_VERSION_INFO_ONLY -/* include the compression library's header */ +/* Include the compression library's header */ #include "zlib.h" #endif -/* include all user configurable info, including optional assembler routines */ +/* Include all user configurable info, including optional assembler routines */ #include "pngconf.h" /* * Added at libpng-1.2.8 */ @@ -574,9 +576,9 @@ * the version above. */ #ifdef PNG_USE_GLOBAL_ARRAYS PNG_EXPORT_VAR (PNG_CONST char) png_libpng_ver[18]; - /* need room for 99.99.99beta99z */ + /* Need room for 99.99.99beta99z */ #else #define png_libpng_ver png_get_header_ver(NULL) #endif @@ -784,9 +786,9 @@ * functions do not make their own copies. */ typedef struct png_info_struct { - /* the following are necessary for every PNG file */ + /* The following are necessary for every PNG file */ png_uint_32 width; /* width of image in pixels (from IHDR) */ png_uint_32 height; /* height of image in pixels (from IHDR) */ png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ png_uint_32 rowbytes; /* bytes needed to hold an untransformed row */ @@ -1189,12 +1191,12 @@ #define PNG_TRANSFORM_BGR 0x0080 /* read and write */ #define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ #define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ -#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only, deprecated */ +#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only, deprecated */ /* Added to libpng-1.2.34 */ -#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800 /* WRITE only */ -#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* WRITE only */ +#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800 /* write only */ +#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ /* Flags for MNG supported features */ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 #define PNG_FLAG_MNG_FILTER_64 0x04 @@ -1433,9 +1435,9 @@ /* New member added in libpng-1.0.4 (renamed in 1.0.9) */ #if defined(PNG_MNG_FEATURES_SUPPORTED) || \ defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) -/* changed from png_byte to png_uint_32 at version 1.2.0 */ +/* Changed from png_byte to png_uint_32 at version 1.2.0 */ #ifdef PNG_1_0_X png_byte mng_features_permitted; #else png_uint_32 mng_features_permitted; @@ -2089,9 +2091,9 @@ /* Function to be called when data becomes available */ extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); -/* function that combines rows. Not very much different than the +/* Function that combines rows. Not very much different than the * png_combine_row() call. Is this even used????? */ extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr, png_bytep old_row, png_bytep new_row)); @@ -2995,9 +2997,9 @@ ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) /* Variables declared in png.c - only it needs to define PNG_NO_EXTERN */ #if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) -/* place to hold the signature string for a PNG file. */ +/* Place to hold the signature string for a PNG file. */ #ifdef PNG_USE_GLOBAL_ARRAYS PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8]; #else #endif diff -ru4NwbB libpng-1.2.39/pngset.c libpng-1.2.40rc01/pngset.c --- libpng-1.2.39/pngset.c 2009-08-13 06:13:21.982459645 -0500 +++ libpng-1.2.40rc01/pngset.c 2009-09-02 07:04:02.904804496 -0500 @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.2.39 [August 13, 2009] + * Last changed in libpng 1.2.40 [September 2, 2009] * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -1007,9 +1028,9 @@ #endif } #endif /* PNG_sPLT_SUPPORTED */ -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED void PNGAPI png_set_unknown_chunks(png_structp png_ptr, png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns) { diff -ru4NwbB libpng-1.2.39/pngwutil.c libpng-1.2.40rc01/pngwutil.c --- libpng-1.2.39/pngwutil.c 2009-08-13 06:13:22.043216676 -0500 +++ libpng-1.2.40rc01/pngwutil.c 2009-09-02 07:04:02.954646184 -0500 @@ -1,8 +1,8 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.2.39 [August 13, 2009] + * Last changed in libpng 1.2.40 [September 2, 2009] * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -2132,10 +2156,8 @@ #endif png_debug(1, "in png_write_find_filter"); - - png_debug(1, "in png_write_find_filter"); /* Find out how many bytes offset each pixel is */ bpp = (row_info->pixel_depth + 7) >> 3; prev_row = png_ptr->prev_row; diff -ru4NwbB libpng-1.2.39/scripts/CMakeLists.txt libpng-1.2.40rc01/scripts/CMakeLists.txt --- libpng-1.2.39/scripts/CMakeLists.txt 2009-08-13 06:13:23.633158596 -0500 +++ libpng-1.2.40rc01/scripts/CMakeLists.txt 2009-09-02 07:04:04.726148666 -0500 @@ -1,6 +1,6 @@ - -project(PNG) +project(PNG C) +cmake_minimum_required(VERSION 2.4.3) # Copyright (C) 2007 Glenn Randers-Pehrson # This code is released under the libpng license. @@ -12,28 +12,40 @@ set(PNGLIB_RELEASE %RELEASE%) set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) +set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) + # needed packages find_package(ZLIB REQUIRED) +include_directories(${ZLIB_INCLUDE_DIR}) + if(NOT WIN32) find_library(M_LIBRARY NAMES m PATHS /usr/lib /usr/local/lib ) if(NOT M_LIBRARY) message(STATUS "math library 'libm' not found - floating point support disabled") - endif(NOT M_LIBRARY) -else(NOT WIN32) + endif() +else() # not needed on windows set(M_LIBRARY "") -endif(NOT WIN32) - +endif() # COMMAND LINE OPTIONS -option(PNG_SHARED "Build shared lib" YES) -option(PNG_STATIC "Build static lib" YES) +if(DEFINED PNG_SHARED) + option(PNG_SHARED "Build shared lib" ${PNG_SHARED}) +else() + option(PNG_SHARED "Build shared lib" ON) +endif() +if(DEFINED PNG_STATIC) + option(PNG_STATIC "Build static lib" ${PNG_STATIC}) +else() + option(PNG_STATIC "Build static lib" ON) +endif() + if(MINGW) option(PNG_TESTS "Build pngtest" NO) else(MINGW) option(PNG_TESTS "Build pngtest" YES) @@ -37,11 +49,12 @@ option(PNG_TESTS "Build pngtest" NO) else(MINGW) option(PNG_TESTS "Build pngtest" YES) endif(MINGW) + option(PNG_NO_CONSOLE_IO "FIXME" YES) option(PNG_NO_STDIO "FIXME" YES) -option(PNG_DEBUG "Build with debug output" YES) +option(PNG_DEBUG "Build with debug output" NO) option(PNGARG "FIXME" YES) #TODO: # PNG_CONSOLE_IO_SUPPORTED @@ -56,22 +69,18 @@ else("uname_output" MATCHES "^.*i[1-9]86.*$") set(png_asm_tmp "OFF") endif("uname_output" MATCHES "^.*i[1-9]86.*$") endif(uname_executable) -else(NOT WIN32) +else() # this env var is normally only set on win64 SET(TEXT "ProgramFiles(x86)") if("$ENV{${TEXT}}" STREQUAL "") set(png_asm_tmp "ON") endif("$ENV{${TEXT}}" STREQUAL "") -endif(NOT WIN32) +endif() # SET LIBNAME -# msvc does not append 'lib' - do it here to have consistent name -if(MSVC) - set(PNG_LIB_NAME lib) -endif(MSVC) -set(PNG_LIB_NAME ${PNG_LIB_NAME}png${PNGLIB_MAJOR}${PNGLIB_MINOR}) +set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR}) # to distinguish between debug and release lib set(CMAKE_DEBUG_POSTFIX "d") @@ -103,56 +112,69 @@ if(MSVC) add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE) endif(MSVC) +if(PNG_SHARED OR NOT MSVC) + #if building msvc static this has NOT do be defined add_definitions(-DZLIB_DLL) +endif() add_definitions(-DLIBPNG_NO_MMX) add_definitions(-DPNG_NO_MMX_CODE) if(PNG_CONSOLE_IO_SUPPORTED) add_definitions(-DPNG_CONSOLE_IO_SUPPORTED) -endif(PNG_CONSOLE_IO_SUPPORTED) +endif() if(PNG_NO_CONSOLE_IO) add_definitions(-DPNG_NO_CONSOLE_IO) -endif(PNG_NO_CONSOLE_IO) +endif() if(PNG_NO_STDIO) add_definitions(-DPNG_NO_STDIO) -endif(PNG_NO_STDIO) +endif() if(PNG_DEBUG) add_definitions(-DPNG_DEBUG) -endif(PNG_DEBUG) +endif() if(NOT M_LIBRARY AND NOT WIN32) add_definitions(-DPNG_NO_FLOATING_POINT_SUPPORTED) -endif(NOT M_LIBRARY AND NOT WIN32) +endif() # NOW BUILD OUR TARGET include_directories(${PNG_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) if(PNG_SHARED) add_library(${PNG_LIB_NAME} SHARED ${libpng_sources}) + if(MSVC) + # msvc does not append 'lib' - do it here to have consistent name + set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib") + endif() target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY}) -endif(PNG_SHARED) +endif() + if(PNG_STATIC) # does not work without changing name set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static) add_library(${PNG_LIB_NAME_STATIC} STATIC ${libpng_sources}) -endif(PNG_STATIC) + if(MSVC) + # msvc does not append 'lib' - do it here to have consistent name + set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib") + endif() +endif() + if(PNG_SHARED AND WIN32) set_target_properties(${PNG_LIB_NAME} PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL) -endif(PNG_SHARED AND WIN32) +endif() -if(PNG_TESTS) +if(PNG_TESTS AND PNG_SHARED) # does not work with msvc due to png_lib_ver issue add_executable(pngtest ${pngtest_sources}) target_link_libraries(pngtest ${PNG_LIB_NAME}) # add_test(pngtest ${PNG_SOURCE_DIR}/pngtest.png) -endif(PNG_TESTS) +endif() # CREATE PKGCONFIG FILES # we use the same files like ./configure, so we have to set its vars @@ -170,32 +192,51 @@ configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in ${PNG_BINARY_DIR}/${PNGLIB_NAME}-config) # SET UP LINKS +if(PNG_SHARED) set_target_properties(${PNG_LIB_NAME} PROPERTIES # VERSION %SONUM%.${PNGLIB_RELEASE}.1.2.40rc01 VERSION %SONUM%.${PNGLIB_RELEASE}.0 SOVERSION %SONUM% CLEAN_DIRECT_OUTPUT 1) +endif() +if(PNG_STATIC) if(NOT WIN32) # that's uncool on win32 - it overwrites our static import lib... set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES OUTPUT_NAME ${PNG_LIB_NAME} CLEAN_DIRECT_OUTPUT 1) -endif(NOT WIN32) + endif() +endif() + # INSTALL -install_targets(/lib ${PNG_LIB_NAME}) +if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) + if(PNG_SHARED) + install(TARGETS ${PNG_LIB_NAME} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + endif() if(PNG_STATIC) - install_targets(/lib ${PNG_LIB_NAME_STATIC}) -endif(PNG_STATIC) + install(TARGETS ${PNG_LIB_NAME_STATIC} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + endif() +endif() + +if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) install(FILES png.h pngconf.h DESTINATION include) install(FILES png.h pngconf.h DESTINATION include/${PNGLIB_NAME}) +endif() +if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES libpng.3 libpngpf.3 DESTINATION man/man3) install(FILES png.5 DESTINATION man/man5) install(FILES ${PNG_BINARY_DIR}/libpng.pc DESTINATION lib/pkgconfig) install(FILES ${PNG_BINARY_DIR}/libpng-config DESTINATION bin) install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}.pc DESTINATION lib/pkgconfig) install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin) +endif() # what's with libpng.txt and all the extra files?