libpng: upgrade from 1.6.2 to 1.6.17

This upgrades the customised 1.6.2 wxWidgets3.0 version to 1.6.17 from
the zip version. CMakeLists.txt and the contrib directory have been
removed.
This commit is contained in:
Jonathan Li 2015-06-29 10:32:09 +01:00
parent f1547c14e0
commit 2ab97aaa49
154 changed files with 6675 additions and 48977 deletions

View File

@ -1,5 +1,4 @@
Libpng 1.6.2 - April 25, 2013
Libpng 1.6.17 - March 26, 2015
This is a public release of libpng, intended for use in production codes.
@ -8,37 +7,61 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a
"configure" script
libpng-1.6.2.tar.xz (LZMA-compressed, recommended)
libpng-1.6.2.tar.gz
libpng-1.6.17.tar.xz (LZMA-compressed, recommended)
libpng-1.6.17.tar.gz
Source files with CRLF line endings (for Windows), without the
"configure" script
lpng162.7z (LZMA-compressed, recommended)
lpng162.zip
lpng1617.7z (LZMA-compressed, recommended)
lpng1617.zip
Other information:
libpng-1.6.2-README.txt
libpng-1.6.2-LICENSE.txt
libpng-1.6.17-README.txt
libpng-1.6.17-LICENSE.txt
libpng-1.6.17-*.asc (armored detached GPG signatures)
Changes since the last public release (1.6.1):
Changes since the last public release (1.6.16):
Updated documentation of 1.5.x to 1.6.x changes in iCCP chunk handling.
Fixed incorrect warning of excess deflate data. End condition - the
warning would be produced if the end of the deflate stream wasn't read
in the last row. The warning is harmless.
Corrected the test on user transform changes on read. It was in the
png_set of the transform function, but that doesn't matter unless the
transform function changes the rowbuf size, and that is only valid if
transform_info is called.
Corrected a misplaced closing bracket in contrib/libtests/pngvalid.c
(Flavio Medeiros).
Corrected length written to uncompressed iTXt chunks (Samuli Suominen).
Added contrib/tools/fixitxt.c, to repair the erroneous iTXt chunk length
written by libpng-1.6.0 and 1.6.1.
Disallow storing sRGB information when the sRGB is not supported.
Merge pngtest.c with libpng-1.7.0
Removed duplicate PNG_SAFE_LIMITS_SUPPORTED handling from pngconf.h
Corrected the width limit calculation in png_check_IHDR().
Removed user limits from pngfix. Also pass NULL pointers to
png_read_row to skip the unnecessary row de-interlace stuff.
Added testing of png_set_packing() to pngvalid.c
Regenerated configure scripts in the *.tar distributions with libtool-2.4.4
Implement previously untested cases of libpng transforms in pngvalid.c
Fixed byte order in 2-byte filler, in png_do_read_filler().
Made the check for out-of-range values in png_set_tRNS() detect
values that are exactly 2^bit_depth, and work on 16-bit platforms.
Merged some parts of libpng-1.6.17beta01 and libpng-1.7.0beta47.
Added #ifndef __COVERITY__ where needed in png.c, pngrutil.c and
pngset.c to avoid warnings about dead code.
Do not build png_product2() when it is unused.
Display user limits in the output from pngtest.
Eliminated the PNG_SAFE_LIMITS macro and restored the 1-million-column
and 1-million-row default limits in pnglibconf.dfa, that can be reset
by the user at build time or run time. This provides a more robust
defense against DOS and as-yet undiscovered overflows.
Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default.
Allow user to call png_get_IHDR() with NULL arguments (Reuben Hawkins).
Rebuilt configure scripts with automake-1.15 and libtool-2.4.6
Moved png_set_filter() prototype into a PNG_WRITE_SUPPORTED block
of png.h.
Avoid runtime checks when converting integer to png_byte with
Visual Studio (Sergey Kosarevsky)
Removed some comments that the configure script did not handle
properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt.
Free the unknown_chunks structure even when it contains no data.
Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
for consistency, and remove some useless tests (Alexey Petruchik).
Remove pnglibconf.h, pnglibconf.c, pnglibconf.pre, pnglibconf.dfn,
and pnglibconf.out instead of pnglibconf.* in "make clean" (Cosmin).
Fixed simplified 8-bit-linear to sRGB alpha. The calculated alpha
value was wrong. It's not clear if this affected the final stored
value; in the obvious code path the upper and lower 8-bits of the
alpha value were identical and the alpha was truncated to 8-bits
rather than dividing by 257 (John Bowler).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -1,4 +1,4 @@
#if 0
CHANGES - changes for libpng
Version 0.2
@ -2102,7 +2102,7 @@ Version 1.4.0beta24 [July 25, 2008]
png_decompress_chunk(), and remove "chunkdata" from parameter list.
Put a call to png_check_chunk_name() in png_read_chunk_header().
Revised png_check_chunk_name() to reject a name with a lowercase 3rd byte.
Removed two calls to png_check_chunk_name() occuring later in the process.
Removed two calls to png_check_chunk_name() occurring later in the process.
Define PNG_NO_ERROR_NUMBERS by default in pngconf.h
Version 1.4.0beta25 [July 30, 2008]
@ -4047,7 +4047,9 @@ Version 1.6.0beta17 [March 10, 2012]
Deflate/inflate was reworked to move common zlib calls into single
functions [rw]util.c. A new shared keyword check routine was also added
and the 'zbuf' is no longer allocated on progressive read. It is now
possible to call png_inflate() incrementally.
possible to call png_inflate() incrementally. A warning is no longer
issued if the language tag or translated keyword in the iTXt chunk
has zero length.
If benign errors are disabled use maximum window on ancilliary inflate.
This works round a bug introduced in 1.5.4 where compressed ancillary
chunks could end up with a too-small windowBits value in the deflate
@ -4343,8 +4345,9 @@ Version 1.6.0beta37 [January 10, 2013]
programs to generate and test a PNG which should have the problem.
Version 1.6.0beta39 [January 19, 2013]
Again corrected attempt at overflow detection in png_set_unknown_chunks().
Added overflow detection in png_set_sPLT() and png_set_text_2().
Again corrected attempt at overflow detection in png_set_unknown_chunks()
(CVE-2013-7353). Added overflow detection in png_set_sPLT() and
png_set_text_2() (CVE-2013-7354).
Version 1.6.0beta40 [January 20, 2013]
Use consistent handling of overflows in text, sPLT and unknown png_set_* APIs
@ -4427,7 +4430,7 @@ Version 1.6.1beta05 [March 1, 2013]
Version 1.6.1beta06 [March 4, 2013]
Better documentation of unknown handling API interactions.
Corrected Android builds and corrected libpng.vers with symbol
prefixing This adds an API to set optimization options externally,
prefixing. This adds an API to set optimization options externally,
providing an alternative and general solution for the non-portable
run-time tests used by the ARM Neon code. It also makes those tests
compile and link on Android.
@ -4485,6 +4488,7 @@ Version 1.6.2beta01 [April 14, 2013]
Corrected a misplaced closing bracket in contrib/libtests/pngvalid.c
(Flavio Medeiros).
Corrected length written to uncompressed iTXt chunks (Samuli Suominen).
Bug was introduced in libpng-1.6.0.
Version 1.6.2rc01 [April 18, 2013]
Added contrib/tools/fixitxt.c, to repair the erroneous iTXt chunk length
@ -4505,6 +4509,701 @@ Version 1.6.2rc06 [April 24, 2013]
1.6.3beta01.
Version 1.6.2 [April 25, 2013]
No changes.
Version 1.6.3beta01 [April 25, 2013]
Revised stack marking in arm/filter_neon.S and configure.ac.
Ensure that NEON filter stuff is completely disabled when switched 'off'.
Previously the ARM NEON specific files were still built if the option
was switched 'off' as opposed to being explicitly disabled.
Version 1.6.3beta02 [April 26, 2013]
Test for 'arm*' not just 'arm' in the host_cpu configure variable.
Rebuilt the configure scripts.
Version 1.6.3beta03 [April 30, 2013]
Expanded manual paragraph about writing private chunks, particularly
the need to call png_set_keep_unknown_chunks() when writing them.
Avoid dereferencing NULL pointer possibly returned from
png_create_write_struct() (Andrew Church).
Version 1.6.3beta05 [May 9, 2013]
Calculate our own zlib windowBits when decoding rather than trusting the
CMF bytes in the PNG datastream.
Added an option to force maximum window size for inflating, which was
the behavior of libpng15 and earlier.
Added png-fix-itxt and png-fix-too-far-back to the built programs and
removed warnings from the source code and timepng that are revealed as
a result.
Detect wrong libpng versions linked to png-fix-too-far-back, which currently
only works with libpng versions that can be made to reliably fail when
the deflate data contains an out-of-window reference. This means only
1.6 and later.
Fixed gnu issues: g++ needs a static_cast, gcc 4.4.7 has a broken warning
message which it is easier to work round than ignore.
Updated contrib/pngminus/pnm2png.c (Paul Stewart):
Check for EOF
Ignore "#" delimited comments in input file to pnm2png.c.
Fixed whitespace handling
Added a call to png_set_packing()
Initialize dimension values so if sscanf fails at least we have known
invalid values.
Attempt to detect configuration issues with png-fix-too-far-back, which
requires both the correct libpng and the correct zlib to function
correctly.
Check ZLIB_VERNUM for mismatches, enclose #error in quotes
Added information in the documentation about problems with and fixes for
the bad CRC and bad iTXt chunk situations.
Version 1.6.3beta06 [May 12, 2013]
Allow contrib/pngminus/pnm2png.c to compile without WRITE_INVERT and
WRITE_PACK supported (writes error message that it can't read P1 or
P4 PBM files).
Improved png-fix-too-far-back usage message, added --suffix option.
Revised contrib/pngminim/*/makefile to generate pnglibconf.h with the
right zlib header files.
Separated CPPFLAGS and CFLAGS in contrib/pngminim/*/makefile
Version 1.6.3beta07 [June 8, 2013]
Removed a redundant test in png_set_IHDR().
Added set(CMAKE_CONFIGURATION_TYPES ...) to CMakeLists.txt (Andrew Hundt)
Deleted set(CMAKE_BUILD_TYPE) block from CMakeLists.txt
Enclose the prototypes for the simplified write API in
#ifdef PNG_STDIO_SUPPORTED/#endif
Make ARM NEON support work at compile time (not just configure time).
This moves the test on __ARM_NEON__ into pngconf.h to avoid issues when
using a compiler that compiles for multiple architectures at one time.
Removed PNG_FILTER_OPTIMIZATIONS and PNG_ARM_NEON_SUPPORTED from
pnglibconf.h, allowing more of the decisions to be made internally
(pngpriv.h) during the compile. Without this, symbol prefixing is broken
under certain circumstances on ARM platforms. Now only the API parts of
the optimizations ('check' vs 'api') are exposed in the public header files
except that the new setting PNG_ARM_NEON_OPT documents how libpng makes the
decision about whether or not to use the optimizations.
Protect symbol prefixing against CC/CPPFLAGS/CFLAGS useage.
Previous iOS/Xcode fixes for the ARM NEON optimizations moved the test
on __ARM_NEON__ from configure time to compile time. This breaks symbol
prefixing because the definition of the special png_init_filter_functions
call was hidden at configure time if the relevant compiler arguments are
passed in CFLAGS as opposed to CC. This change attempts to avoid all
the confusion that would result by declaring the init function even when
it is not used, so that it will always get prefixed.
Version 1.6.3beta08 [June 18, 2013]
Revised libpng.3 so that "doclifter" can process it.
Version 1.6.3beta09 [June 27, 2013]
Revised example.c to illustrate use of PNG_DEFAULT_sRGB and PNG_GAMMA_MAC_18
as parameters for png_set_gamma(). These have been available since
libpng-1.5.4.
Renamed contrib/tools/png-fix-too-far-back.c to pngfix.c and revised it
to check all compressed chunks known to libpng.
Version 1.6.3beta10 [July 5, 2013]
Updated documentation to show default behavior of benign errors correctly.
Only compile ARM code when PNG_READ_SUPPORTED is defined.
Fixed undefined behavior in contrib/tools/pngfix.c and added new strip
option. pngfix relied on undefined behavior and even a simple change from
gcc to g++ caused it to fail. The new strip option 'unsafe' has been
implemented and is the default if --max is given. Option names have
been clarified, with --strip=transform now stripping the bKGD chunk,
which was stripped previously with --strip=unused.
Added all documented chunk types to pngpriv.h
Unified pngfix.c source with libpng17.
Version 1.6.3rc01 [July 11, 2013]
No changes.
Version 1.6.3 [July 18, 2013]
Revised manual about changes in iTXt chunk handling made in libpng-1.6.0.
Added "/* SAFE */" comments in pngrutil.c and pngrtran.c where warnings
may be erroneously issued by code-checking applications.
Version 1.6.4beta01 [August 21, 2013]
Added information about png_set_options() to the manual.
Delay calling png_init_filter_functions() until a row with nonzero filter
is found.
Version 1.6.4beta02 [August 30, 2013]
Fixed inconsistent conditional compilation of png_chunk_unknown_handling()
prototype, definition, and usage. Made it depend on
PNG_HANDLE_AS_UNKNOWN_SUPPORTED everywhere.
Version 1.6.4rc01 [September 5, 2013]
No changes.
Version 1.6.4 [September 12, 2013]
No changes.
Version 1.6.5 [September 14, 2013]
Removed two stray lines of code from arm/arm_init.c.
Version 1.6.6 [September 16, 2013]
Removed two stray lines of code from arm/arm_init.c, again.
Version 1.6.7beta01 [September 30, 2013]
Revised unknown chunk code to correct several bugs in the NO_SAVE_/NO_WRITE
combination
Allow HANDLE_AS_UNKNOWN to work when other options are configured off. Also
fixed the pngminim makefiles to work when $(MAKEFLAGS) contains stuff
which terminates the make options (as by default in recent versions of
Gentoo).
Avoid up-cast warnings in pngvalid.c. On ARM the alignment requirements of
png_modifier are greater than that of png_store and as a consequence
compilation of pngvalid.c results in a warning about increased alignment
requirements because of the bare cast to (png_modifier*). The code is safe,
because the pointer is known to point to a stack allocated png_modifier,
but this change avoids the warning.
Fixed default behavior of ARM_NEON_API. If the ARM NEON API option was
compiled without the CHECK option it defaulted to on, not off.
Check user callback behavior in pngunknown.c. Previous versions compiled
if SAVE_UNKNOWN was not available but did nothing since the callback
was never implemented.
Merged pngunknown.c with 1.7 version and back ported 1.7 improvements/fixes
Version 1.6.7beta02 [October 12, 2013]
Made changes for compatibility with automake 1.14:
1) Added the 'compile' program to the list of programs that must be cleaned
in autogen.sh
2) Added 'subdir-objects' which causes .c files in sub-directories to be
compiled such that the corresponding .o files are also in the
sub-directory. This is because automake 1.14 warns that the
current behavior of compiling to the top level directory may be removed
in the future.
3) Updated dependencies on pnglibconf.h to match the new .o locations and
added all the files in contrib/libtests and contrib/tools that depend
on pnglibconf.h
4) Added 'BUILD_SOURCES = pnglibconf.h'; this is the automake recommended
way of handling the dependencies of sources that are machine generated;
unfortunately it only works if the user does 'make all' or 'make check',
so the dependencies (3) are still required.
Cleaned up (char*) casts of zlib messages. The latest version of the Intel C
compiler complains about casting a string literal as (char*), so copied the
treatment of z_const from the library code into pngfix.c
Simplified error message code in pngunknown. The simplification has the
useful side effect of avoiding a bogus warning generated by the latest
version of the Intel C compiler (it objects to
condition ? string-literal : string-literal).
Make autogen.sh work with automake 1.13 as well as 1.14. Do this by always
removing the 1.14 'compile' script but never checking for it.
Version 1.6.7beta03 [October 19, 2013]
Added ARMv8 support (James Yu <james.yu at linaro.org>). Added file
arm/filter_neon_intrinsics.c; enable with -mfpu=neon.
Revised pngvalid to generate size images with as many filters as it can
manage, limited by the number of rows.
Cleaned up ARM NEON compilation handling. The tests are now in pngpriv.h
and detect the broken GCC compilers.
Version 1.6.7beta04 [October 26, 2013]
Allow clang derived from older GCC versions to use ARM intrinsics. This
causes all clang builds that use -mfpu=neon to use the intrinsics code,
not the assembler code. This has only been tested on iOS 7. It may be
necessary to exclude some earlier clang versions but this seems unlikely.
Changed NEON implementation selection mechanism. This allows assembler
or intrinsics to be turned on at compile time during the build by defining
PNG_ARM_NEON_IMPLEMENTATION to the correct value (2 or 1). This macro
is undefined by default and the build type is selected in pngpriv.h.
Version 1.6.7rc01 [November 2, 2013]
No changes.
Version 1.6.7rc02 [November 7, 2013]
Fixed #include in filter_neon_intrinsics.c and ctype macros. The ctype char
checking macros take an unsigned char argument, not a signed char.
Version 1.6.7 [November 14, 2013]
No changes.
Version 1.6.8beta01 [November 24, 2013]
Moved prototype for png_handle_unknown() in pngpriv.h outside of
the #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED/#endif block.
Added "-Wall" to CFLAGS in contrib/pngminim/*/makefile
Conditionally compile some unused functions reported by -Wall in
pngminim.
Fixed 'minimal' builds. Various obviously useful minimal configurations
don't build because of missing contrib/libtests test programs and
overly complex dependencies in scripts/pnglibconf.dfa. This change
adds contrib/conftest/*.dfa files that can be used in automatic build
scripts to ensure that these configurations continue to build.
Enabled WRITE_INVERT and WRITE_PACK in contrib/pngminim/encoder.
Fixed pngvalid 'fail' function declaration on the Intel C Compiler.
This reverts to the previous 'static' implementation and works round
the 'unused static function' warning by using PNG_UNUSED().
Version 1.6.8beta02 [November 30, 2013]
Removed or marked PNG_UNUSED some harmless "dead assignments" reported
by clang scan-build.
Changed tabs to 3 spaces in png_debug macros and changed '"%s"m'
to '"%s" m' to improve portability among compilers.
Changed png_free_default() to free() in pngtest.c
Version 1.6.8rc01 [December 12, 2013]
Tidied up pngfix inits and fixed pngtest no-write builds.
Version 1.6.8rc02 [December 14, 2013]
Handle zero-length PLTE chunk or NULL palette with png_error()
instead of png_chunk_report(), which by default issues a warning
rather than an error, leading to later reading from a NULL pointer
(png_ptr->palette) in png_do_expand_palette(). This is CVE-2013-6954
and VU#650142. Libpng-1.6.1 through 1.6.7 are vulnerable.
Libpng-1.6.0 and earlier do not have this bug.
Version 1.6.8 [December 19, 2013]
No changes.
Version 1.6.9beta01 [December 26, 2013]
Bookkeeping: Moved functions around (no changes). Moved transform
function definitions before the place where they are called so that
they can be made static. Move the intrapixel functions and the
grayscale palette builder out of the png?tran.c files. The latter
isn't a transform function and is no longer used internally, and the
former MNG specific functions are better placed in pngread/pngwrite.c
Made transform implementation functions static. This makes the internal
functions called by png_do_{read|write}_transformations static. On an
x86-64 DLL build (Gentoo Linux) this reduces the size of the text
segment of the DLL by 1208 bytes, about 0.6%. It also simplifies
maintenance by removing the declarations from pngpriv.h and allowing
easier changes to the internal interfaces.
Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69
in the tar distributions.
Version 1.6.9beta02 [January 1, 2014]
Added checks for libpng 1.5 to pngvalid.c. This supports the use of
this version of pngvalid in libpng 1.5
Merged with pngvalid.c from libpng-1.7 changes to create a single
pngvalid.c
Removed #error macro from contrib/tools/pngfix.c (Thomas Klausner).
Merged pngrio.c, pngtrans.c, pngwio.c, and pngerror.c with libpng-1.7.0
Merged libpng-1.7.0 changes to make no-interlace configurations work
with test programs.
Revised pngvalid.c to support libpng 1.5, which does not support the
PNG_MAXIMUM_INFLATE_WINDOW option, so #define it out when appropriate in
pngvalid.c
Allow unversioned links created on install to be disabled in configure.
In configure builds 'make install' changes/adds links like png.h
and libpng.a to point to the newly installed, versioned, files (e.g.
libpng17/png.h and libpng17.a). Three new configure options and some
rearrangement of Makefile.am allow creation of these links to be disabled.
Version 1.6.9beta03 [January 10, 2014]
Removed potentially misleading warning from png_check_IHDR().
Version 1.6.9beta04 [January 20, 2014]
Updated scripts/makefile.* to use CPPFLAGS (Cosmin).
Added clang attribute support (Cosmin).
Version 1.6.9rc01 [January 28, 2014]
No changes.
Version 1.6.9rc02 [January 30, 2014]
Quiet an uninitialized memory warning from VC2013 in png_get_png().
Version 1.6.9 [February 6, 2014]
Version 1.6.10beta01 [February 9, 2014]
Backported changes from libpng-1.7.0beta30 and beta31:
Fixed a large number of instances where PNGCBAPI was omitted from
function definitions.
Added pngimage test program for png_read_png() and png_write_png()
with two new test scripts.
Removed dependence on !PNG_READ_EXPAND_SUPPORTED for calling
png_set_packing() in png_read_png().
Fixed combination of ~alpha with shift. On read invert alpha, processing
occurred after shift processing, which causes the final values to be
outside the range that should be produced by the shift. Reversing the
order on read makes the two transforms work together correctly and mirrors
the order used on write.
Do not read invalid sBIT chunks. Previously libpng only checked sBIT
values on write, so a malicious PNG writer could therefore cause
the read code to return an invalid sBIT chunk, which might lead to
application errors or crashes. Such chunks are now skipped (with
chunk_benign_error).
Make png_read_png() and png_write_png() prototypes in png.h depend
upon PNG_READ_SUPPORTED and PNG_WRITE_SUPPORTED.
Support builds with unsupported PNG_TRANSFORM_* values. All of the
PNG_TRANSFORM_* values are always defined in png.h and, because they
are used for both read and write in some cases, it is not reliable
to #if out ones that are totally unsupported. This change adds error
detection in png_read_image() and png_write_image() to do a
png_app_error() if the app requests something that cannot be done
and it adds corresponding code to pngimage.c to handle such options
by not attempting to test them.
Version 1.6.10beta02 [February 23, 2014]
Moved redefines of png_error(), png_warning(), png_chunk_error(),
and png_chunk_warning() from pngpriv.h to png.h to make them visible
to libpng-calling applications.
Moved OS dependent code from arm/arm_init.c, to allow the included
implementation of the ARM NEON discovery function to be set at
build-time and provide sample implementations from the current code in the
contrib/arm-neon subdirectory. The __linux__ code has also been changed to
compile and link on Android by using /proc/cpuinfo, and the old linux code
is in contrib/arm-neon/linux-auxv.c. The new code avoids POSIX and Linux
dependencies apart from opening /proc/cpuinfo and is C90 compliant.
Check for info_ptr == NULL early in png_read_end() so we don't need to
run all the png_handle_*() and depend on them to return if info_ptr == NULL.
This improves the performance of png_read_end(png_ptr, NULL) and makes
it more robust against future programming errors.
Check for __has_extension before using it in pngconf.h, to
support older Clang versions (Jeremy Sequoia).
Treat CRC error handling with png_set_crc_action(), instead of with
png_set_benign_errors(), which has been the case since libpng-1.6.0beta18.
Use a user warning handler in contrib/gregbook/readpng2.c instead of default,
so warnings will be put on stderr even if libpng has CONSOLE_IO disabled.
Added png_ptr->process_mode = PNG_READ_IDAT_MODE in png_push_read_chunk
after recognizing the IDAT chunk, which avoids an infinite loop while
reading a datastream whose first IDAT chunk is of zero-length.
This fixes CERT VU#684412 and CVE-2014-0333.
Don't recognize known sRGB profiles as sRGB if they have been hacked,
but don't reject them and don't issue a copyright violation warning.
Version 1.6.10beta03 [February 25, 2014]
Moved some documentation from png.h to libpng.3 and libpng-manual.txt
Minor editing of contrib/arm-neon/README and contrib/examples/*.c
Version 1.6.10rc01 [February 27, 2014]
Fixed typos in the manual and in scripts/pnglibconf.dfa (CFLAGS -> CPPFLAGS
and PNG_USR_CONFIG -> PNG_USER_CONFIG).
Version 1.6.10rc02 [February 28, 2014]
Removed unreachable return statement after png_chunk_error()
in pngrutil.c
Version 1.6.10rc03 [March 4, 2014]
Un-deprecated png_data_freer().
Version 1.6.10 [March 6, 2014]
No changes.
Version 1.6.11beta01 [March 17, 2014]
Use "if (value != 0)" instead of "if (value)" consistently.
Changed ZlibSrcDir from 1.2.5 to 1.2.8 in projects/vstudio.
Moved configuration information from the manual to the INSTALL file.
Version 1.6.11beta02 [April 6, 2014]
Removed #if/#else/#endif from inside two pow() calls in pngvalid.c because
they were handled improperly by Portland Group's PGI-14.1 - PGI-14.3
when using its "__builtin_pow()" function.
Silence 'unused parameter' build warnings (Cosmin Truta).
$(CP) is now used alongside $(RM_F). Also, use 'copy' instead of 'cp'
where applicable, and applied other minor makefile changes (Cosmin).
Don't warn about invalid dimensions exceeding user limits (Cosmin).
Allow an easy replacement of the default pre-built configuration
header with a custom header, via the make PNGLIBCONF_H_PREBUILT
macro (Cosmin).
Version 1.6.11beta03 [April 6, 2014]
Fixed a typo in pngrutil.c, introduced in libpng-1.5.6, that interferes
with "blocky" expansion of sub-8-bit interlaced PNG files (Eric Huss).
Optionally use __builtin_bswap16() in png_do_swap().
Version 1.6.11beta04 [April 19, 2014]
Made progressive reading of interlaced images consistent with the
behavior of the sequential reader and consistent with the manual, by
moving some code out of the PNG_READ_INTERLACING_SUPPORTED blocks. The
row_callback now receives the proper pass number and unexpanded rows, when
png_combine_row() isn't built or used, and png_set_interlace_handling()
is not called.
Allow PNG_sRGB_PROFILE_CHECKING = (-1) to mean no sRGB profile checking.
Version 1.6.11beta05 [April 26, 2014]
Do not reject ICC V2 profiles that lack padding (Kai-Uwe Behrmann).
Relocated closing bracket of the sRGB profile test loop to avoid getting
"Not recognizing known sRGB profile that has been edited" warning for
ICC V2 profiles that lack the MD5 signature in the profile header.
Version 1.6.11beta06 [May 19, 2014]
Added PNG_SKIP_sRGB_CHECK_PROFILE choice for png_set_option().
Version 1.6.11rc01 [May 27, 2014]
No changes.
Version 1.6.11rc02 [June 3, 2014]
Test ZLIB_VERNUM instead of PNG_ZLIB_VERNUM in contrib/tools/pngfix.c
Version 1.6.11 [June 5, 2014]
No changes.
Version 1.6.12rc01 [June 6, 2014]
Relocated new code from 1.6.11beta06 in png.c to a point after the
declarations (Max Stepin).
Version 1.6.12rc02 [June 7, 2014]
Changed file permissions of contrib/tools/intgamma.sh,
test-driver, and compile from 0644 to 0755 (Cosmin).
Version 1.6.12rc03 [June 8, 2014]
Ensure "__has_attribute()" macro exists before trying to use it with
old clang compilers (MacPorts Ticket #43939).
Version 1.6.12 [June 12, 2014]
No changes.
Version 1.6.13beta01 [July 4, 2014]
Quieted -Wsign-compare and -Wclobber compiler warnings in
contrib/pngminus/*.c
Added "(void) png_ptr;" where needed in contrib/gregbook to quiet
compiler complaints about unused pointers.
Split a long output string in contrib/gregbook/rpng2-x.c.
Added "PNG_SET_OPTION" requirement for sRGB chunk support to pnglibconf.dfa,
Needed for write-only support (John Bowler).
Changed "if defined(__ARM_NEON__)" to
"if (defined(__ARM_NEON__) || defined(__ARM_NEON))" (James Wu).
Fixed clang no-warning builds: png_digit was defined but never used.
Version 1.6.13beta02 [July 21, 2014]
Fixed an incorrect separator ("/" should be "\") in scripts/makefile.vcwin32
(bug report from Wolfgang S. Kechel). Bug was introduced in libpng-1.6.11.
Also fixed makefile.bc32, makefile.bor, makefile.msc, makefile.intel, and
makefile.tc3 similarly.
Version 1.6.13beta03 [August 3, 2014]
Removed scripts/makefile.elf. It has not worked since libpng-1.5.0beta14
due to elimination of the PNG_FUNCTION_EXPORT and PNG_DATA_EXPORT
definitions from pngconf.h.
Ensure that CMakeLists.txt makes the target "lib" directory before making
symbolic link into it (SourceForge bug report #226 by Rolf Timmermans).
Version 1.6.13beta04 [August 8, 2014]
Added opinion that the ECCN (Export Control Classification Number) for
libpng is EAR99 to the README file.
Eliminated use of "$<" in makefile explicit rules, when copying
$PNGLIBCONF_H_PREBUILT. This does not work on some versions of make;
bug introduced in libpng version 1.6.11.
Version 1.6.13rc01 [August 14, 2014]
Made "ccopts" agree with "CFLAGS" in scripts/makefile.hp* and makefile.*sunu
Version 1.6.13 [August 21, 2014]
No changes.
Version 1.6.14beta01 [September 14, 2014]
Guard usage of png_ptr->options with #ifdef PNG_SET_OPTION_SUPPORTED.
Do not build contrib/tools/pngfix.c when PNG_SETJMP_NOT_SUPPORTED,
to allow "make" to complete without setjmp support (bug report by
Claudio Fontana)
Add "#include <setjmp.h>" to contrib/tools/pngfix.c (John Bowler)
Version 1.6.14beta02 [September 18, 2014]
Use nanosleep() instead of usleep() in contrib/gregbook/rpng2-x.c
because usleep() is deprecated.
Define usleep() in contrib/gregbook/rpng2-x.c if not already defined
in unistd.h and nanosleep() is not available; fixes error introduced
in libpng-1.6.13.
Disable floating point exception handling in pngvalid.c when
PNG_FLOATING_ARITHMETIC is not supported (bug report by "zootus
at users.sourceforge.net").
Version 1.6.14beta03 [September 19, 2014]
Define FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in pngvalid.c if not
already defined. Revert floating point exception handling in pngvalid.c
to version 1.6.14beta01 behavior.
Version 1.6.14beta04 [September 27, 2014]
Fixed incorrect handling of the iTXt compression flag in pngrutil.c
(bug report by Shunsaku Hirata). Bug was introduced in libpng-1.6.0.
Version 1.6.14beta05 [October 1, 2014]
Added "option READ_iCCP enables READ_COMPRESSED_TEXT" to pnglibconf.dfa
Version 1.6.14beta06 [October 5, 2014]
Removed unused "text_len" parameter from private function png_write_zTXt().
Conditionally compile some code in png_deflate_claim(), when
PNG_WARNINGS_SUPPORTED and PNG_ERROR_TEXT_SUPPORTED are disabled.
Replaced repeated code in pngpread.c with PNG_PUSH_SAVE_BUFFER_IF_FULL.
Added "chunk iTXt enables TEXT" and "chunk zTXt enables TEXT"
to pnglibconf.dfa.
Removed "option READ_COMPRESSED_TEXT enables READ_TEXT" from pnglibconf.dfa,
to make it possible to configure a libpng that supports iCCP but not TEXT.
Version 1.6.14beta07 [October 7, 2014]
Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from pnglibconf.dfa
Only mark text chunks as written after successfully writing them.
Version 1.6.14rc01 [October 15, 2014]
Fixed some typos in comments.
Version 1.6.14rc02 [October 17, 2014]
Changed png_convert_to_rfc_1123() to png_convert_to_rfc_1123_buffer()
in the manual, to reflect the change made in libpng-1.6.0.
Updated README file to explain that direct access to the png_struct
and info_struct members has not been permitted since libpng-1.5.0.
Version 1.6.14 [October 23, 2014]
No changes.
Version 1.6.15beta01 [October 29, 2014]
Changed "if (!x)" to "if (x == 0)" and "if (x)" to "if (x != 0)"
Simplified png_free_data().
Added missing "ptr = NULL" after some instances of png_free().
Version 1.6.15beta02 [November 1, 2014]
Changed remaining "if (!x)" to "if (x == 0)" and "if (x)" to "if (x != 0)"
Version 1.6.15beta03 [November 3, 2014]
Added PNG_USE_ARM_NEON configuration flag (Marcin Juszkiewicz).
Version 1.6.15beta04 [November 4, 2014]
Removed new PNG_USE_ARM_NEON configuration flag and made a one-line
revision to configure.ac to support ARM on aarch64 instead (John Bowler).
Version 1.6.15beta05 [November 5, 2014]
Use png_get_libpng_ver(NULL) instead of PNG_LIBPNG_VER_STRING in
example.c, pngtest.c, and applications in the contrib directory.
Avoid out-of-bounds memory access in png_user_version_check().
Simplified and future-proofed png_user_version_check().
Fixed GCC unsigned int->float warnings. Various versions of GCC
seem to generate warnings when an unsigned value is implicitly
converted to double. This is probably a GCC bug but this change
avoids the issue by explicitly converting to (int) where safe.
Free all allocated memory in pngimage. The file buffer cache was left
allocated at the end of the program, harmless but it causes memory
leak reports from clang.
Fixed array size calculations to avoid warnings. At various points
in the code the number of elements in an array is calculated using
sizeof. This generates a compile time constant of type (size_t) which
is then typically assigned to an (unsigned int) or (int). Some versions
of GCC on 64-bit systems warn about the apparent narrowing, even though
the same compiler does apparently generate the correct, in-range,
numeric constant. This adds appropriate, safe, casts to make the
warnings go away.
Version 1.6.15beta06 [November 6, 2014]
Reverted use png_get_libpng_ver(NULL) instead of PNG_LIBPNG_VER_STRING
in the manual, example.c, pngtest.c, and applications in the contrib
directory. It was incorrect advice.
Version 1.6.15beta07 [November 7, 2014]
Removed #ifdef PNG_16BIT_SUPPORTED/#endif around png_product2(); it is
needed by png_reciprocal2().
Added #ifdef PNG_16BIT_SUPPORTED/#endif around png_log16bit() and
png_do_swap().
Changed all "#endif /* PNG_FEATURE_SUPPORTED */" to "#endif /* FEATURE */"
Version 1.6.15beta08 [November 8, 2014]
More housecleaning in *.h
Version 1.6.15rc01 [November 13, 2014]
Version 1.6.15rc02 [November 14, 2014]
The macros passed in the command line to Borland make were ignored if
similarly-named macros were already defined in makefiles. This behavior
is different from POSIX make and other make programs. Surround the
macro definitions with ifndef guards (Cosmin).
Version 1.6.15rc03 [November 16, 2014]
Added "-D_CRT_SECURE_NO_WARNINGS" to CFLAGS in scripts/makefile.vcwin32.
Removed the obsolete $ARCH variable from scripts/makefile.darwin.
Version 1.6.15 [November 20, 2014]
No changes.
Version 1.6.16beta01 [December 14, 2014]
Added ".align 2" to arm/filter_neon.S to support old GAS assemblers that
don't do alignment correctly.
Revised Makefile.am and scripts/symbols.dfn to work with MinGW/MSYS
(Bob Friesenhahn).
Version 1.6.16beta02 [December 15, 2014]
Revised Makefile.am and scripts/*.dfn again to work with MinGW/MSYS;
renamed scripts/*.dfn to scripts/*.c (John Bowler).
Version 1.6.16beta03 [December 21, 2014]
Quiet a "comparison always true" warning in pngstest.c (John Bowler).
Version 1.6.16rc01 [December 21, 2014]
Restored a test on width that was removed from png.c at libpng-1.6.9
(Bug report by Alex Eubanks, CVE-2015-0973).
Version 1.6.16rc02 [December 21, 2014]
Undid the update to pngrutil.c in 1.6.16rc01.
Version 1.6.16rc03 [December 21, 2014]
Fixed an overflow in png_combine_row() with very wide interlaced images
(Bug report and fix by John Bowler, CVE-2014-9495).
Version 1.6.16 [December 22, 2014]
No changes.
Version 1.6.17beta01 [January 29, 2015]
Removed duplicate PNG_SAFE_LIMITS_SUPPORTED handling from pngconf.h
Corrected the width limit calculation in png_check_IHDR().
Removed user limits from pngfix. Also pass NULL pointers to
png_read_row to skip the unnecessary row de-interlace stuff.
Added testing of png_set_packing() to pngvalid.c
Regenerated configure scripts in the *.tar distributions with libtool-2.4.4
Implement previously untested cases of libpng transforms in pngvalid.c
Fixed byte order in 2-byte filler, in png_do_read_filler().
Made the check for out-of-range values in png_set_tRNS() detect
values that are exactly 2^bit_depth, and work on 16-bit platforms.
Merged some parts of libpng-1.6.17beta01 and libpng-1.7.0beta47.
Added #ifndef __COVERITY__ where needed in png.c, pngrutil.c and
pngset.c to avoid warnings about dead code.
Added "& 0xff" to many instances of expressions that are typecast
to (png_byte), to avoid Coverity gripes.
Version 1.6.17beta02 [February 7, 2015]
Work around one more Coverity-scan dead-code warning.
Do not build png_product2() when it is unused.
Version 1.6.17beta03 [February 17, 2015]
Display user limits in the output from pngtest.
Eliminated the PNG_SAFE_LIMITS macro and restored the 1-million-column
and 1-million-row default limits in pnglibconf.dfa, that can be reset
by the user at build time or run time. This provides a more robust
defense against DOS and as-yet undiscovered overflows.
Version 1.6.17beta04 [February 21, 2015]
Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default.
Allow user to call png_get_IHDR() with NULL arguments (Reuben Hawkins).
Rebuilt configure scripts with automake-1.15 and libtool-2.4.6
Version 1.6.17beta05 [February 25, 2015]
Restored compiling of png_reciprocal2 with PNG_NO_16BIT.
Version 1.6.17beta06 [February 27, 2015]
Moved png_set_filter() prototype into a PNG_WRITE_SUPPORTED block
of png.h.
Avoid runtime checks when converting integer to png_byte with
Visual Studio (Sergey Kosarevsky)
Version 1.6.17rc01 [March 4, 2015]
No changes.
Version 1.6.17rc02 [March 9, 2015]
Removed some comments that the configure script did not handle
properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt.
Free the unknown_chunks structure even when it contains no data.
Version 1.6.17rc03 [March 12, 2015]
Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
for consistency, and remove some useless tests (Alexey Petruchik).
Version 1.6.17rc04 [March 16, 2015]
Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of
pnglibconf.* in "make clean" (Cosmin).
Fix bug in calculation of maxbits, in png_write_sBIT, introduced
in libpng-1.6.17beta01 (John Bowler).
Version 1.6.17rc05 [March 21, 2015]
Define PNG_FILTER_* and PNG_FILTER_VALUE_* in png.h even when WRITE
is not supported (John Bowler). This fixes an error introduced in
libpng-1.6.17beta06.
Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes
the Coverity scan without them.
Version 1.6.17rc06 [March 23, 2015]
Remove pnglibconf.dfn and pnglibconf.pre with "make clean".
Reformatted some "&0xff" instances to "& 0xff".
Fixed simplified 8-bit-linear to sRGB alpha. The calculated alpha
value was wrong. It's not clear if this affected the final stored
value; in the obvious code path the upper and lower 8-bits of the
alpha value were identical and the alpha was truncated to 8-bits
rather than dividing by 257 (John Bowler).
Version 1.6.17 [March 26, 2015]
No changes.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
@ -4513,4 +5212,3 @@ to subscribe)
or to glennrp at users.sourceforge.net
Glenn R-P
#endif

View File

@ -1,13 +1,47 @@
Installing libpng
Contents
I. Simple installation
II. Rebuilding the configure scripts
III. Using scripts/makefile*
IV. Using cmake
V. Directory structure
VI. Building with project files
VII. Building with makefiles
VIII. Configuring libpng for 16-bit platforms
IX. Configuring for DOS
X. Configuring for Medium Model
XI. Prepending a prefix to exported symbols
XII. Configuring for compiler xxx:
XIII. Removing unwanted object code
XIV. Changes to the build and configuration of libpng in libpng-1.5.x
XV. Setjmp/longjmp issues
XVI. Other sources of information about libpng
I. Simple installation
On Unix/Linux and similar systems, you can simply type
./configure [--prefix=/path]
make check
make install
and ignore the rest of this document.
and ignore the rest of this document. "/path" is the path to the directory
where you want to install the libpng "lib", "include", and "bin"
subdirectories.
If you downloaded a GIT clone, you will need to run ./autogen.sh before
running ./configure, to create "configure" and "Makefile.in" which are
not included in the GIT repository.
Note that "configure" is only included in the "*.tar" distributions and not
in the "*.zip" or "*.7z" distributions. If you downloaded one of those
distributions, see "Building with project files" or "Building with makefiles",
below.
II. Rebuilding the configure scripts
If configure does not work on your system, or if you have a need to
change configure.ac or Makefile.am, and you have a reasonably
@ -24,9 +58,12 @@ aren't using any of the included pre-built scripts, you can do this:
make install
make check
III. Using scripts/makefile*
Instead, you can use one of the custom-built makefiles in the
"scripts" directory
cp scripts/pnglibconf.h.prebuilt pnglibconf.h
cp scripts/makefile.system makefile
make test
make install
@ -38,8 +75,8 @@ Or you can use one of the "projects" in the "projects" directory.
Before installing libpng, you must first install zlib, if it
is not already on your system. zlib can usually be found
wherever you got libpng. zlib can be placed in another directory,
at the same level as libpng.
wherever you got libpng; otherwise go to http://zlib.net. You can place
zlib in in the same directory as libpng or in another directory.
If your system already has a preinstalled zlib you will still need
to have access to the zlib.h and zconf.h include files that
@ -59,15 +96,23 @@ LD_LIBRARY_PATH="$ZLIBLIB:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH
If you are using one of the makefile scripts, put ZLIBLIB and ZLIBINC
in your environment and type "make ZLIBLIB=$ZLIBLIB ZLIBINC=$ZLIBINC test".
IV. Using cmake
If you want to use "cmake" (see www.cmake.org), type
cmake . -DCMAKE_INSTALL_PREFIX=/path
make
make install
As when using the simple configure method described above, "/path" points to
the installation directory where you want to put the libpng "lib", "include",
and "bin" subdirectories.
V. Directory structure
You can rename the directories that you downloaded (they
might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.7"
or "zlib127") so that you have directories called "zlib" and "libpng".
might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.8"
or "zlib128") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this:
@ -75,8 +120,7 @@ Your directory structure should look like this:
libpng (this directory)
INSTALL (this file)
README
*.h
*.c
*.h, *.c => libpng source files
CMakeLists.txt => "cmake" script
configuration files:
configure.ac, configure, Makefile.am, Makefile.in,
@ -84,15 +128,10 @@ Your directory structure should look like this:
libpng-config.in, aclocal.m4, config.h.in, config.sub,
depcomp, install-sh, mkinstalldirs, test-pngtest.sh
contrib
gregbook
libtests
pngminim
pngminus
pngsuite
visupng
arm-neon, conftest, examples, gregbook, libtests, pngminim,
pngminus, pngsuite, tools, visupng
projects
visualc71
vstudio
cbuilder5, owatcom, visualc71, vstudio, xcode
scripts
makefile.*
*.def (module definition files)
@ -100,29 +139,31 @@ Your directory structure should look like this:
pngtest.png
etc.
zlib
README
*.h
*.c
contrib
etc.
README, *.h, *.c contrib, etc.
If the line endings in the files look funny, you may wish to get the other
distribution of libpng. It is available in both tar.gz (UNIX style line
endings) and zip (DOS style line endings) formats.
VI. Building with project files
If you are building libpng with MSVC, you can enter the
libpng projects\visualc6 or visualc71 directory and follow the instructions
libpng projects\visualc71 or vstudio directory and follow the instructions
in README.txt.
Otherwise enter the zlib directory and follow the instructions in zlib/README,
then come back here and run "configure" or choose the appropriate
makefile.sys in the scripts directory.
VII. Building with makefiles
Copy the file (or files) that you need from the
scripts directory into this directory, for example
MSDOS example: copy scripts\makefile.msc makefile
UNIX example: cp scripts/makefile.std makefile
copy scripts\pnglibconf.h.prebuilt pnglibconf.h
UNIX example: cp scripts/makefile.std makefile
cp scripts/pnglibconf.h.prebuilt pnglibconf.h
Read the makefile to see if you need to change any source or
target directories to match your preferences.
@ -145,26 +186,202 @@ do that, run "make install" in the zlib directory first if necessary).
Some also allow you to run "make test-installed" after you have
run "make install".
VIII. Configuring libpng for 16-bit platforms
You will want to look into zconf.h to tell zlib (and thus libpng) that
it cannot allocate more than 64K at a time. Even if you can, the memory
won't be accessible. So limit zlib and libpng to 64K by defining MAXSEG_64K.
IX. Configuring for DOS
For DOS users who only have access to the lower 640K, you will
have to limit zlib's memory usage via a png_set_compression_mem_level()
call. See zlib.h or zconf.h in the zlib library for more information.
X. Configuring for Medium Model
Libpng's support for medium model has been tested on most of the popular
compilers. Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets
defined, and FAR gets defined to far in pngconf.h, and you should be
all set. Everything in the library (except for zlib's structure) is
expecting far data. You must use the typedefs with the p or pp on
the end for pointers (or at least look at them and be careful). Make
note that the rows of data are defined as png_bytepp, which is
an "unsigned char far * far *".
XI. Prepending a prefix to exported symbols
Starting with libpng-1.6.0, you can configure libpng (when using the
"configure" script) to prefix all exported symbols by means of the
configuration option "--with-libpng-prefix=FOO_", where FOO_ can be any
string beginning with a letter and containing only uppercase
and lowercase letters, digits, and the underscore (i.e., a C language
identifier). This creates a set of macros in pnglibconf.h, so this is
transparent to applications; their function calls get transformed by
the macros to use the modified names.
XII. Configuring for compiler xxx:
All includes for libpng are in pngconf.h. If you need to add, change
or delete an include, this is the place to do it.
The includes that are not needed outside libpng are placed in pngpriv.h,
which is only used by the routines inside libpng itself.
The files in libpng proper only include pngpriv.h and png.h, which
in turn includes pngconf.h and, as of libpng-1.5.0, pnglibconf.h.
As of libpng-1.5.0, pngpriv.h also includes three other private header
files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material
that previously appeared in the public headers.
XIII. Removing unwanted object code
There are a bunch of #define's in pngconf.h that control what parts of
libpng are compiled. All the defines end in _SUPPORTED. If you are
never going to use a capability, you can change the #define to #undef
before recompiling libpng and save yourself code and data space, or
you can turn off individual capabilities with defines that begin with
PNG_NO_.
In libpng-1.5.0 and later, the #define's are in pnglibconf.h instead.
You can also turn all of the transforms and ancillary chunk capabilities
off en masse with compiler directives that define
PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS,
or all four, along with directives to turn on any of the capabilities that
you do want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable the
extra transformations but still leave the library fully capable of reading
and writing PNG files with all known public chunks. Use of the
PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library
that is incapable of reading or writing ancillary chunks. If you are
not using the progressive reading capability, you can turn that off
with PNG_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING
capability, which you'll still have).
All the reading and writing specific code are in separate files, so the
linker should only grab the files it needs. However, if you want to
make sure, or if you are building a stand alone library, all the
reading files start with "pngr" and all the writing files start with "pngw".
The files that don't match either (like png.c, pngtrans.c, etc.)
are used for both reading and writing, and always need to be included.
The progressive reader is in pngpread.c
If you are creating or distributing a dynamically linked library (a .so
or DLL file), you should not remove or disable any parts of the library,
as this will cause applications linked with different versions of the
library to fail if they call functions not available in your library.
The size of the library itself should not be an issue, because only
those sections that are actually used will be loaded into memory.
XIV. Changes to the build and configuration of libpng in libpng-1.5.x
Details of internal changes to the library code can be found in the CHANGES
file and in the GIT repository logs. These will be of no concern to the vast
majority of library users or builders; however, the few who configure libpng
to a non-default feature set may need to change how this is done.
There should be no need for library builders to alter build scripts if
these use the distributed build support - configure or the makefiles -
however, users of the makefiles may care to update their build scripts
to build pnglibconf.h where the corresponding makefile does not do so.
Building libpng with a non-default configuration has changed completely.
The old method using pngusr.h should still work correctly even though the
way pngusr.h is used in the build has been changed; however, library
builders will probably want to examine the changes to take advantage of
new capabilities and to simplify their build system.
A. Specific changes to library configuration capabilities
The exact mechanism used to control attributes of API functions has
changed. A single set of operating system independent macro definitions
is used and operating system specific directives are defined in
pnglibconf.h
As part of this the mechanism used to choose procedure call standards on
those systems that allow a choice has been changed. At present this only
affects certain Microsoft (DOS, Windows) and IBM (OS/2) operating systems
running on Intel processors. As before, PNGAPI is defined where required
to control the exported API functions; however, two new macros, PNGCBAPI
and PNGCAPI, are used instead for callback functions (PNGCBAPI) and
(PNGCAPI) for functions that must match a C library prototype (currently
only png_longjmp_ptr, which must match the C longjmp function.) The new
approach is documented in pngconf.h
Despite these changes, libpng 1.5.0 only supports the native C function
calling standard on those platforms tested so far (__cdecl on Microsoft
Windows). This is because the support requirements for alternative
calling conventions seem to no longer exist. Developers who find it
necessary to set PNG_API_RULE to 1 should advise the mailing list
(png-mng-implement) of this and library builders who use Openwatcom and
therefore set PNG_API_RULE to 2 should also contact the mailing list.
B. Changes to the configuration mechanism
Prior to libpng-1.5.0 library builders who needed to configure libpng
had either to modify the exported pngconf.h header file to add system
specific configuration or had to write feature selection macros into
pngusr.h and cause this to be included into pngconf.h by defining
PNG_USER_CONFIG. The latter mechanism had the disadvantage that an
application built without PNG_USER_CONFIG defined would see the
unmodified, default, libpng API and thus would probably fail to link.
These mechanisms still work in the configure build and in any makefile
build that builds pnglibconf.h, although the feature selection macros
have changed somewhat as described above. In 1.5.0, however, pngusr.h is
processed only once, at the time the exported header file pnglibconf.h is
built. pngconf.h no longer includes pngusr.h; therefore, pngusr.h is ignored
after the build of pnglibconf.h and it is never included in an application
build.
The formerly used alternative of adding a list of feature macros to the
CPPFLAGS setting in the build also still works; however, the macros will be
copied to pnglibconf.h and this may produce macro redefinition warnings
when the individual C files are compiled.
All configuration now only works if pnglibconf.h is built from
scripts/pnglibconf.dfa. This requires the program awk. Brian Kernighan
(the original author of awk) maintains C source code of that awk and this
and all known later implementations (often called by subtly different
names - nawk and gawk for example) are adequate to build pnglibconf.h.
The Sun Microsystems (now Oracle) program 'awk' is an earlier version
and does not work; this may also apply to other systems that have a
functioning awk called 'nawk'.
Configuration options are now documented in scripts/pnglibconf.dfa. This
file also includes dependency information that ensures a configuration is
consistent; that is, if a feature is switched off, dependent features are
also switched off. As a recommended alternative to using feature macros in
pngusr.h a system builder may also define equivalent options in pngusr.dfa
(or, indeed, any file) and add that to the configuration by setting
DFA_XTRA to the file name. The makefiles in contrib/pngminim illustrate
how to do this, and also illustrate a case where pngusr.h is still required.
After you have built libpng, the definitions that were recorded in
pnglibconf.h are available to your application (pnglibconf.h is included
in png.h and gets installed alongside png.h and pngconf.h in your
$PREFIX/include directory). Do not edit pnglibconf.h after you have built
libpng, because than the settings would not accurately reflect the settings
that were used to build libpng.
XV. Setjmp/longjmp issues
Libpng uses setjmp()/longjmp() for error handling. Unfortunately setjmp()
is known to be not thread-safe on some platforms and we don't know of
any platform where it is guaranteed to be thread-safe. Therefore, if
your application is going to be using multiple threads, you should
configure libpng with PNG_NO_SETJMP in your pngusr.dfa file, with
-DPNG_NO_SETJMP on your compile line, or with
#undef PNG_SETJMP_SUPPORTED
in your pnglibconf.h or pngusr.h.
Starting with libpng-1.6.0, the library included a "simplified API".
This requires setjmp/longjmp, so you must either build the library
with PNG_SETJMP_SUPPORTED defined, or with PNG_SIMPLIFIED_READ_SUPPORTED
and PNG_SIMPLIFIED_WRITE_SUPPORTED undefined.
XVI. Other sources of information about libpng:
Further information can be found in the README and libpng-manual.txt
files, in the individual makefiles, in png.h, and the manual pages
libpng.3 and png.5.
Using the ./configure script -- 16 December 2002.
=================================================
The ./configure script should work compatibly with what scripts/makefile.*
did, however there are some options you might need to add to configure
explicitly, which previously was done semi-automatically (if you didn't edit
scripts/makefile.* yourself, that is)
CFLAGS="-Wall -O -funroll-loops \
-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \
--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include
You can alternatively specify --includedir=/usr/include, /usr/local/include,
/usr/include/libpng%NN%, or whatever.
If you find that the configure script is out-of-date or is not supporting
your platform properly, try running autogen.sh to regenerate "configure",
"Makefile.in", and the other configuration files. Then try configure again.

View File

@ -10,8 +10,8 @@ this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.6.2, April 25, 2013, are
Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are
libpng versions 1.2.6, August 15, 2004, through 1.6.17, March 26, 2015, are
Copyright (c) 2004, 2006-2015 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
April 25, 2013
March 26, 2015

View File

@ -1,295 +0,0 @@
# Makefile.am:
# Source file for Makefile.in (and hence Makefile)
#
PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
ACLOCAL_AMFLAGS = -I scripts
# test programs - run on make check, make distcheck
check_PROGRAMS= pngtest pngunknown pngstest pngvalid
pngtest_SOURCES = pngtest.c
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
pngvalid_SOURCES = contrib/libtests/pngvalid.c
pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
pngstest_SOURCES = contrib/libtests/pngstest.c
pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
pngunknown_SOURCES = contrib/libtests/pngunknown.c
pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
# Generally these are single line shell scripts to run a test with a particular
# set of parameters:
TESTS =\
tests/pngtest\
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
tests/pngvalid-gamma-expand16-background\
tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\
tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\
tests/pngvalid-progressive-interlace-size\
tests/pngvalid-progressive-interlace-standard\
tests/pngvalid-progressive-interlace-transform\
tests/pngvalid-progressive-standard tests/pngvalid-standard\
tests/pngstest-0g01 tests/pngstest-0g02 tests/pngstest-0g04\
tests/pngstest-0g08 tests/pngstest-0g16 tests/pngstest-2c08\
tests/pngstest-2c16 tests/pngstest-3p01 tests/pngstest-3p02\
tests/pngstest-3p04 tests/pngstest-3p08 tests/pngstest-4a08\
tests/pngstest-4a16 tests/pngstest-6a08 tests/pngstest-6a16\
tests/pngstest-error tests/pngunknown-IDAT\
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg
# These tests are expected, and required, to fail:
XFAIL_TESTS = tests/pngstest-error
# man pages
dist_man_MANS= libpng.3 libpngpf.3 png.5
# generate the -config scripts if required
binconfigs= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
EXTRA_SCRIPTS= libpng-config libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
bin_SCRIPTS= @binconfigs@
# rules to build libpng, only build the old library on request
lib_LTLIBRARIES=libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
# EXTRA_LTLIBRARIES= libpng.la
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
pngget.c pngmem.c pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c\
pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa
if PNG_ARM_NEON
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
arm/filter_neon.S
endif
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
-version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
if HAVE_LD_VERSION_SCRIPT
# Versioned symbols and restricted exports
if HAVE_SOLARIS_LD
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M -Wl,libpng.vers
else
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers
endif
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers
else
# Only restricted exports when possible
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym
endif
#distribute headers in /usr/include/libpng/*
pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
pkginclude_HEADERS= png.h pngconf.h
nodist_pkginclude_HEADERS= pnglibconf.h
# pkg-config stuff, note that libpng.pc is always required in order
# to get the correct library
pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
# Extra source distribution files, '${srcdir}' is used below to stop build files
# from those directories being included. This only works if the configure is
# not done in the source directory!
EXTRA_DIST= \
ANNOUNCE CHANGES INSTALL LICENSE README TODO \
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
$(TESTS) $(XFAIL_TESTS) tests/pngstest \
CMakeLists.txt example.c libpng-manual.txt
SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.dfn
CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
check.new pnglibconf.* pngprefix.h symbols.new pngtest-log.txt \
$(SCRIPT_CLEANFILES)
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
config.sub configure depcomp install-sh ltmain.sh missing
# PNG_COPTS give extra options for the C compiler to be used on all compilation
# steps (unless targe_CFLAGS is specified; that will take precedence over
# AM_CFLAGS)
PNG_COPTS = @PNG_COPTS@
AM_CFLAGS = ${PNG_COPTS}
# DFNCPP is normally just CPP - the C preprocessor - but on Solaris and maybe
# other operating systems (NeXT?) the C preprocessor selected by configure
# checks input tokens for validity - effectively it performs part of the ANSI-C
# parsing - and therefore fails with the .df files. configure.ac has special
# checks for this and sets DFNCPP appropriately.
DFNCPP = @DFNCPP@
SUFFIXES = .chk .dfn .out
$(PNGLIB_BASENAME).pc: libpng.pc
cp libpng.pc $@
$(PNGLIB_BASENAME)-config: libpng-config
cp libpng-config $@
scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
scripts/prefix.out: png.h pngconf.h pnglibconf.out
scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
scripts/intprefix.out: pnglibconf.h
libpng.sym: scripts/sym.out
rm -f $@
cp $? $@
libpng.vers: scripts/vers.out
rm -f $@
cp $? $@
if DO_PNG_PREFIX
# Rename functions in scripts/prefix.out with a PNG_PREFIX prefix.
# Rename macros in scripts/macro.lst from PNG_PREFIXpng_ to PNG_ (the actual
# implementation of the macro).
pnglibconf.h: pnglibconf.out scripts/prefix.out scripts/macro.lst
rm -f $@
$(AWK) 's==0 && NR>1{print prev}\
s==0{prev=$$0}\
s==1{print "#define", $$1, "@PNG_PREFIX@" $$1}\
s==2{print "#define @PNG_PREFIX@png_" $$1, "PNG_" $$1}\
END{print prev}' s=0 pnglibconf.out s=1 scripts/prefix.out\
s=2 ${srcdir}/scripts/macro.lst >pnglibconf.tf8
mv pnglibconf.tf8 $@
pngprefix.h: scripts/intprefix.out
rm -f pngprefix.tf1
$(AWK) '{print "#define", $$1, "@PNG_PREFIX@" $$1}' $? >pngprefix.tf1
mv pngprefix.tf1 $@
else
pnglibconf.h: pnglibconf.out
rm -f $@
cp $? $@
pngprefix.h: # is empty
:>$@
endif
$(srcdir)/scripts/pnglibconf.h.prebuilt:
@echo "Attempting to build $@" >&2
@echo "This is a machine generated file, but if you want to make" >&2
@echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2
@exit 1
# The following is necessary to ensure that the local pnglibconf.h is used, not
# an installed one (this can happen immediately after on a clean system if
# 'make test' is the first thing the user does.)
contrib/libtests/pngstest.o contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h
contrib/libtests/pngunknown.o: pnglibconf.h
# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
# be built with PNG_USE_READ_MACROS; this prevents the read macros from
# interfering with the symbol file format.
SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
-DPNGLIB_VERSION='@PNGLIB_VERSION@'\
-DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
-DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
if DO_PNG_PREFIX
SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@'
endif
.dfn.out:
rm -f $@ $*.c $*.tf[12]
test -d scripts || mkdir scripts || test -d scripts
echo '#include "$<"' >$*.c
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
$(CPPFLAGS) $(SYMBOL_CFLAGS) $*.c > $*.tf1
$(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2
rm -f $*.c $*.tf1
mv $*.tf2 $@
# The .dfn file for pnglibconf.h is machine generated
pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
rm -f $@ $*.tf[45]
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
${srcdir}/pngusr.dfa $(DFA_XTRA) 1>&2
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf5 $*.tf4 1>&2
rm $*.tf4
mv $*.tf5 $@
# Symbol checks (.def and .out files should match)
scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out
.out.chk:
rm -f $@ $*.new
$(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\
of="$*.new" $< >&2
mv $*.new $@
# used on demand to regenerate the standard header, CPPFLAGS should
# be empty - no non-standard defines
scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
rm -f $@ pnglibconf.tf[67]
test -z "$(CPPFLAGS)"
echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
$(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf6\
logunsupported=1 version=search ${srcdir}/pngconf.h -\
${srcdir}/scripts/pnglibconf.dfa 1>&2
$(AWK) -f ${srcdir}/scripts/options.awk out=pnglibconf.tf7\
pnglibconf.tf6 1>&2
rm pnglibconf.tf6
mv pnglibconf.tf7 $@
$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h pngprefix.h
test: check-am
# Extra checks
check: scripts/symbols.chk
# Don't distribute the generated script files
dist-hook:
cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES)
# install the .../include headers as links to the new ones
install-data-hook:
cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h
cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \
pngconf.h
cd '$(DESTDIR)$(includedir)'; $(LN_S) $(PNGLIB_BASENAME)/pnglibconf.h \
pnglibconf.h
cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc
cd '$(DESTDIR)$(pkgconfigdir)'; $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
# do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used
install-exec-hook:
cd '$(DESTDIR)$(bindir)'; rm -f libpng-config
cd '$(DESTDIR)$(bindir)';\
$(LN_S) $(PNGLIB_BASENAME)-config libpng-config
@set -x;\
cd '$(DESTDIR)$(libdir)';\
for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@\
sl dylib dll.a; do\
rm -f libpng.$$ext;\
if test -f $(PNGLIB_BASENAME).$$ext; then\
$(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
fi;\
done
uninstall-hook:
cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h
rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc'
rm -f '$(DESTDIR)$(bindir)/libpng-config'
rm -f '$(DESTDIR)$(libdir)/libpng.a'
rm -f '$(DESTDIR)$(libdir)/libpng.la'
rm -f '$(DESTDIR)$(libdir)/libpng.so'
rm -f '$(DESTDIR)$(libdir)/libpng.so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@'
rm -f '$(DESTDIR)$(libdir)/libpng.sl'
rm -f '$(DESTDIR)$(libdir)/libpng.dylib'
rm -f '$(DESTDIR)$(libdir)/libpng.dll.a'

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
README for libpng version 1.6.2 - April 25, 2013 (shared library 16.0)
README for libpng version 1.6.17 - March 26, 2015 (shared library 16.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
Libpng comes in several distribution formats. Get libpng-*.tar.gz,
libpng-*.tar.xz or libpng-*.tar.bz2 if you want UNIX-style line endings
in the text files, or lpng*.zip if you want DOS-style line endings.
Libpng comes in several distribution formats. Get libpng-*.tar.gz or
libpng-*.tar.xz or if you want UNIX-style line endings in the text files,
or lpng*.7z or lpng*.zip if you want DOS-style line endings.
Version 0.89 was the first official release of libpng. Don't let the
fact that it's the first release fool you. The libpng library has been in
@ -23,18 +23,25 @@ earlier versions if you are using a shared library. The type of the
png_uint_32, which will affect shared-library applications that use
this function.
To avoid problems with changes to the internals of png_info_struct,
To avoid problems with changes to the internals of png info_struct,
new APIs have been made available in 0.95 to avoid direct application
access to info_ptr. These functions are the png_set_<chunk> and
png_get_<chunk> functions. These functions should be used when
accessing/storing the info_struct data, rather than manipulating it
directly, to avoid such problems in the future.
It is important to note that the APIs do not make current programs
It is important to note that the APIs did not make current programs
that access the info struct directly incompatible with the new
library. However, it is strongly suggested that new programs use
the new APIs (as shown in example.c and pngtest.c), and older programs
be converted to the new format, to facilitate upgrades in the future.
library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
be a transitional release, members of the png_struct and the
info_struct can still be accessed, but the compiler will issue a
warning about deprecated usage. Since libpng-1.5.0, direct access
to these structs is not allowed, and the definitions of the structs
reside in private pngstruct.h and pnginfo.h header files that are not
accessible to applications. It is strongly suggested that new
programs use the new APIs (as shown in example.c and pngtest.c), and
older programs be converted to the new format, to facilitate upgrades
in the future.
****
Additions since 0.90 include the ability to compile libpng as a
@ -77,17 +84,21 @@ compression library that is useful for more things than just PNG files.
You can use zlib as a drop-in replacement for fread() and fwrite() if
you are so inclined.
zlib should be available at the same place that libpng is, or at.
ftp://ftp.info-zip.org/pub/infozip/zlib
zlib should be available at the same place that libpng is, or at zlib.net.
You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/documents/
This code is currently being archived at libpng.sf.net in the
[DOWNLOAD] area, and on CompuServe, Lib 20 (PNG SUPPORT)
at GO GRAPHSUP. If you can't find it in any of those places,
e-mail me, and I'll help you find it.
[DOWNLOAD] area, and at ftp://ftp.simplesystems.org. If you can't find it
in any of those places, e-mail me, and I'll help you find it.
I am not a lawyer, but I believe that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because it
is open source, publicly available software, that does not contain any
encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
If you have any code changes, requests, problems, etc., please e-mail
them to me. Also, I'd appreciate any make files or project files,
@ -123,7 +134,7 @@ and ...". If in doubt, send questions to me. I'll bounce them
to others, if necessary.
Please do not send suggestions on how to change PNG. We have
been discussing PNG for sixteen years now, and it is official and
been discussing PNG for nineteen years now, and it is official and
finished. If you have suggestions for libpng, however, I'll
gladly listen. Even if your suggestion is not used immediately,
it may be used later.
@ -167,23 +178,25 @@ Files in this distribution:
pngwrite.c => High-level write functions
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
arm => Contains optimized code for the ARM platform
contrib => Contributions
examples => Example programs
gregbook => source code for PNG reading and writing, from
Greg Roelofs' "PNG: The Definitive Guide",
O'Reilly, 1999
msvctest => Builds and runs pngtest using a MSVC workspace
pngminus => Simple pnm2png and png2pnm programs
pngsuite => Test images
visupng => Contains a MSVC workspace for VisualPng
libtests => Test programs
pngminim => Minimal decoder, encoder, and progressive decoder
programs demonstrating use of pngusr.dfa
pngminus => Simple pnm2png and png2pnm programs
pngsuite => Test images
tools => Various tools
visupng => Contains a MSVC workspace for VisualPng
projects => Contains project files and workspaces for
building a DLL
cbuilder5 => Contains a Borland workspace for building
libpng and zlib
visualc6 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
owatcom => Contains a WATCOM project for building libpng
visualc71 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
xcode => Contains an Apple xcode
vstudio => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
scripts => Directory containing scripts for building libpng:
(see scripts/README.txt for the list of scripts)

View File

@ -6,10 +6,12 @@ Better C++ wrapper/full C++ implementation?
Fix problem with C++ and EXTERN "C".
cHRM transformation.
Remove setjmp/longjmp usage in favor of returning error codes.
Palette creation.
Add "grayscale->palette" transformation and "palette->grayscale" detection.
Improved dithering.
Multi-lingual error and warning message support.
Complete sRGB transformation (presently it simply uses gamma=0.45455).
Make profile checking optional via a png_set_something() call.
Man pages for function calls.
Better documentation.
Better filter selection

File diff suppressed because it is too large Load Diff

View File

@ -1,219 +0,0 @@
/* arm_init.c - NEON optimised filter functions
*
* Copyright (c) 2013 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
* Last changed in libpng 1.5.15 [March 28, 2013]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
* called.
*/
#define _POSIX_SOURCE 1
#include "../pngpriv.h"
#ifdef PNG_ARM_NEON_SUPPORTED
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */
#include <signal.h> /* for sig_atomic_t */
#ifdef __ANDROID__
/* Linux provides access to information about CPU capabilites via
* /proc/self/auxv, however Android blocks this while still claiming to be
* Linux. The Andoid NDK, however, provides appropriate support.
*
* Documentation: http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
*/
#include <cpu-features.h>
static int
png_have_neon(png_structp png_ptr)
{
/* This is a whole lot easier than the mess below, however it is probably
* implemented as below, therefore it is better to cache the result (these
* function calls may be slow!)
*/
PNG_UNUSED(png_ptr)
return android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM &&
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
}
#elif defined(__linux__)
/* The generic __linux__ implementation requires reading /proc/self/auxv and
* looking at each element for one that records NEON capabilities.
*/
#include <unistd.h> /* for POSIX 1003.1 */
#include <errno.h> /* for EINTR */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <elf.h>
#include <asm/hwcap.h>
/* A read call may be interrupted, in which case it returns -1 and sets errno to
* EINTR if nothing was done, otherwise (if something was done) a partial read
* may result.
*/
static size_t
safe_read(png_structp png_ptr, int fd, void *buffer_in, size_t nbytes)
{
size_t ntotal = 0;
char *buffer = png_voidcast(char*, buffer_in);
while (nbytes > 0)
{
unsigned int nread;
int iread;
/* Passing nread > INT_MAX to read is implementation defined in POSIX
* 1003.1, therefore despite the unsigned argument portable code must
* limit the value to INT_MAX!
*/
if (nbytes > INT_MAX)
nread = INT_MAX;
else
nread = (unsigned int)/*SAFE*/nbytes;
iread = read(fd, buffer, nread);
if (iread == -1)
{
/* This is the devil in the details, a read can terminate early with 0
* bytes read because of EINTR, yet it still returns -1 otherwise end
* of file cannot be distinguished.
*/
if (errno != EINTR)
{
png_warning(png_ptr, "/proc read failed");
return 0; /* I.e. a permanent failure */
}
}
else if (iread < 0)
{
/* Not a valid 'read' result: */
png_warning(png_ptr, "OS /proc read bug");
return 0;
}
else if (iread > 0)
{
/* Continue reading until a permanent failure, or EOF */
buffer += iread;
nbytes -= (unsigned int)/*SAFE*/iread;
ntotal += (unsigned int)/*SAFE*/iread;
}
else
return ntotal;
}
return ntotal; /* nbytes == 0 */
}
static int
png_have_neon(png_structp png_ptr)
{
int fd = open("/proc/self/auxv", O_RDONLY);
Elf32_auxv_t aux;
/* Failsafe: failure to open means no NEON */
if (fd == -1)
{
png_warning(png_ptr, "/proc/self/auxv open failed");
return 0;
}
while (safe_read(png_ptr, fd, &aux, sizeof aux) == sizeof aux)
{
if (aux.a_type == AT_HWCAP && (aux.a_un.a_val & HWCAP_NEON) != 0)
{
close(fd);
return 1;
}
}
close(fd);
return 0;
}
#else
/* We don't know how to do a run-time check on this system */
# error "no support for run-time ARM NEON checks"
#endif /* OS checks */
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
#endif
void
png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
{
#ifdef PNG_ARM_NEON_API_SUPPORTED
switch ((pp->options >> PNG_ARM_NEON) & 3)
{
case PNG_OPTION_UNSET:
/* Allow the run-time check to execute if it has been enabled -
* thus both API and CHECK can be turned on. If it isn't supported
* this case will fall through to the 'default' below, which just
* returns.
*/
#endif /* PNG_ARM_NEON_API_SUPPORTED */
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
{
static volatile sig_atomic_t no_neon = -1; /* not checked */
if (no_neon < 0)
no_neon = !png_have_neon(pp);
if (no_neon)
return;
}
#ifdef PNG_ARM_NEON_API_SUPPORTED
break;
#endif
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifdef PNG_ARM_NEON_API_SUPPORTED
case PNG_OPTION_ON:
/* Option turned on */
break;
default: /* OFF or INVALID */
return;
}
#endif
/* IMPORTANT: any new external functions used here must be declared using
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
* 'prefix' option to configure works:
*
* ./configure --with-libpng-prefix=foobar_
*
* Verify you have got this right by running the above command, doing a build
* and examining pngprefix.h; it must contain a #define for every external
* function you add. (Notice that this happens automatically for the
* initialization function.)
*/
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon;
if (bpp == 3)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth3_neon;
}
else if (bpp == 4)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth4_neon;
}
}
#endif /* FILTER_OPTIMIZATIONS && __arm__ && __ARM_NEON__ */

View File

@ -1,235 +0,0 @@
/* filter_neon.S - NEON optimised filter functions
*
* Copyright (c) 2011 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
* Last changed in libpng 1.5.7 [December 15, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* This is required to get the symbol renames, which are #defines, and also
* includes the value of PNG_FILTER_OPTIMIZATIONS.
*/
#define PNG_VERSION_INFO_ONLY
#include "../pngpriv.h"
#if defined(PNG_FILTER_OPTIMIZATIONS) && defined(__arm__) && \
defined(__ARM_NEON__)
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
#endif
#ifdef __ELF__
# define ELF
#else
# define ELF @
#endif
.arch armv7-a
.fpu neon
.macro func name, export=0
.macro endfunc
ELF .size \name, . - \name
.endfunc
.purgem endfunc
.endm
.text
.if \export
.global \name
.endif
ELF .type \name, STT_FUNC
.func \name
\name:
.endm
func png_read_filter_row_sub4_neon, export=1
ldr r3, [r0, #4] @ rowbytes
vmov.i8 d3, #0
1:
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
vadd.u8 d0, d3, d4
vadd.u8 d1, d0, d5
vadd.u8 d2, d1, d6
vadd.u8 d3, d2, d7
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
subs r3, r3, #16
bgt 1b
bx lr
endfunc
func png_read_filter_row_sub3_neon, export=1
ldr r3, [r0, #4] @ rowbytes
vmov.i8 d3, #0
mov r0, r1
mov r2, #3
mov r12, #12
vld1.8 {q11}, [r0], r12
1:
vext.8 d5, d22, d23, #3
vadd.u8 d0, d3, d22
vext.8 d6, d22, d23, #6
vadd.u8 d1, d0, d5
vext.8 d7, d23, d23, #1
vld1.8 {q11}, [r0], r12
vst1.32 {d0[0]}, [r1,:32], r2
vadd.u8 d2, d1, d6
vst1.32 {d1[0]}, [r1], r2
vadd.u8 d3, d2, d7
vst1.32 {d2[0]}, [r1], r2
vst1.32 {d3[0]}, [r1], r2
subs r3, r3, #12
bgt 1b
bx lr
endfunc
func png_read_filter_row_up_neon, export=1
ldr r3, [r0, #4] @ rowbytes
1:
vld1.8 {q0}, [r1,:128]
vld1.8 {q1}, [r2,:128]!
vadd.u8 q0, q0, q1
vst1.8 {q0}, [r1,:128]!
subs r3, r3, #16
bgt 1b
bx lr
endfunc
func png_read_filter_row_avg4_neon, export=1
ldr r12, [r0, #4] @ rowbytes
vmov.i8 d3, #0
1:
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
vhadd.u8 d0, d3, d16
vadd.u8 d0, d0, d4
vhadd.u8 d1, d0, d17
vadd.u8 d1, d1, d5
vhadd.u8 d2, d1, d18
vadd.u8 d2, d2, d6
vhadd.u8 d3, d2, d19
vadd.u8 d3, d3, d7
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
subs r12, r12, #16
bgt 1b
bx lr
endfunc
func png_read_filter_row_avg3_neon, export=1
push {r4,lr}
ldr r12, [r0, #4] @ rowbytes
vmov.i8 d3, #0
mov r0, r1
mov r4, #3
mov lr, #12
vld1.8 {q11}, [r0], lr
1:
vld1.8 {q10}, [r2], lr
vext.8 d5, d22, d23, #3
vhadd.u8 d0, d3, d20
vext.8 d17, d20, d21, #3
vadd.u8 d0, d0, d22
vext.8 d6, d22, d23, #6
vhadd.u8 d1, d0, d17
vext.8 d18, d20, d21, #6
vadd.u8 d1, d1, d5
vext.8 d7, d23, d23, #1
vld1.8 {q11}, [r0], lr
vst1.32 {d0[0]}, [r1,:32], r4
vhadd.u8 d2, d1, d18
vst1.32 {d1[0]}, [r1], r4
vext.8 d19, d21, d21, #1
vadd.u8 d2, d2, d6
vhadd.u8 d3, d2, d19
vst1.32 {d2[0]}, [r1], r4
vadd.u8 d3, d3, d7
vst1.32 {d3[0]}, [r1], r4
subs r12, r12, #12
bgt 1b
pop {r4,pc}
endfunc
.macro paeth rx, ra, rb, rc
vaddl.u8 q12, \ra, \rb @ a + b
vaddl.u8 q15, \rc, \rc @ 2*c
vabdl.u8 q13, \rb, \rc @ pa
vabdl.u8 q14, \ra, \rc @ pb
vabd.u16 q15, q12, q15 @ pc
vcle.u16 q12, q13, q14 @ pa <= pb
vcle.u16 q13, q13, q15 @ pa <= pc
vcle.u16 q14, q14, q15 @ pb <= pc
vand q12, q12, q13 @ pa <= pb && pa <= pc
vmovn.u16 d28, q14
vmovn.u16 \rx, q12
vbsl d28, \rb, \rc
vbsl \rx, \ra, d28
.endm
func png_read_filter_row_paeth4_neon, export=1
ldr r12, [r0, #4] @ rowbytes
vmov.i8 d3, #0
vmov.i8 d20, #0
1:
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
paeth d0, d3, d16, d20
vadd.u8 d0, d0, d4
paeth d1, d0, d17, d16
vadd.u8 d1, d1, d5
paeth d2, d1, d18, d17
vadd.u8 d2, d2, d6
paeth d3, d2, d19, d18
vmov d20, d19
vadd.u8 d3, d3, d7
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
subs r12, r12, #16
bgt 1b
bx lr
endfunc
func png_read_filter_row_paeth3_neon, export=1
push {r4,lr}
ldr r12, [r0, #4] @ rowbytes
vmov.i8 d3, #0
vmov.i8 d4, #0
mov r0, r1
mov r4, #3
mov lr, #12
vld1.8 {q11}, [r0], lr
1:
vld1.8 {q10}, [r2], lr
paeth d0, d3, d20, d4
vext.8 d5, d22, d23, #3
vadd.u8 d0, d0, d22
vext.8 d17, d20, d21, #3
paeth d1, d0, d17, d20
vst1.32 {d0[0]}, [r1,:32], r4
vext.8 d6, d22, d23, #6
vadd.u8 d1, d1, d5
vext.8 d18, d20, d21, #6
paeth d2, d1, d18, d17
vext.8 d7, d23, d23, #1
vld1.8 {q11}, [r0], lr
vst1.32 {d1[0]}, [r1], r4
vadd.u8 d2, d2, d6
vext.8 d19, d21, d21, #1
paeth d3, d2, d19, d18
vst1.32 {d2[0]}, [r1], r4
vmov d4, d19
vadd.u8 d3, d3, d7
vst1.32 {d3[0]}, [r1], r4
subs r12, r12, #12
bgt 1b
pop {r4,pc}
endfunc
#endif /* FILTER_OPTIMIZATIONS && __arm__ && __ARM_NEON__ */

View File

@ -1,219 +0,0 @@
#! /bin/sh
#
# Run 'autoreconf' to build 'configure', 'Makefile.in' and other configure
# control files.
#
# The first time this is run on a GIT checkout the only files that exist are
# configure.ac and Makefile.am; all of the autotools support scripts are
# missing. They are instantiated with autoreconf --force --install.
#
# For regular ("tarball") distributions all the files should exist. We do not
# want them to be updated *under any circumstances*. It should never be
# necessary to rune autogen.sh because ./configure --enable-maintainer-mode says
# what to do if Makeile.am or configure.ac are changed.
#
# It is *probably* OK to update the files on a GIT checkout, because they have
# come from the local tools, but leave that to the user who is assumed to know
# whether it is ok or required.
#
# This script is intended to work without arguments, there are, however, hidden
# arguments for (a) use while testing the script and (b) to fix up systems that
# have been broken. If (b) is required the script prompts for the correct
# options. For this reason the options are *NOT* documented in the help; this
# is deliberate; UTSL.
#
clean=
maintainer=
while test $# -gt 0
do
case "$1" in
--maintainer)
maintainer=1;;
--clean)
clean=1;;
*)
exec >&2
echo "$0: usage: ./autogen.sh"
if test -d .git
then
echo " ./autogen.sh generates the configure script and"
echo " Makefile.in, or refreshes them after changes to Makefile.am"
echo " or configure.ac. You may prefer to just run autoreconf."
elif test -z "$maintainer"
then
echo " DO NOT RUN THIS SCRIPT."
echo " If you need to change Makefile.am or configure.ac then you"
echo " also need to run ./configure --enable-maintainer-mode and"
echo " use the appropriate autotools, *NOT* this script, to update"
echo " everything, please check the documentation of autoreconf."
echo " WARNING: libpng is intentionally generated with a known,"
echo " fixed, set of autotools. It is known *NOT* to work with"
echo " the collection of autotools distributed on highly reputable"
echo " operating systems."
echo " Remember: autotools is GNU software, you are expected to"
echo " pay for support."
else
echo " You have run autogen.sh with --maintainer enabled and you"
echo " are not using a GIT distribution, then you have given an"
echo " unrecognized argument. This is not good. --maintainer"
echo " switches off any assumptions that you might not know what"
echo " you are doing."
fi
exit 1;;
esac
shift
done
#
# First check for a set of the autotools files; if absent then this is assumed
# to be a GIT version and the local autotools must be used. If present this
# is a tarball distribution and the script should not be used. If partially
# present bad things are happening.
#
# The autotools generated files:
libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in\
config.sub configure depcomp install-sh ltmain.sh missing test-driver"
#
# These are separate because 'maintainer-clean' does not remove them.
libpng_libtool_files="scripts/libtool.m4 scripts/ltoptions.m4\
scripts/ltsugar.m4 scripts/ltversion.m4 scripts/lt~obsolete.m4"
libpng_autotools_dirs="autom4te.cache" # not required
#
# The configure generated files:
libpng_configure_files="Makefile config.h config.log config.status\
libpng-config libpng.pc libtool stamp-h1"
libpng_configure_dirs=".deps"
#
# We must remove the configure generated files as well as the autotools
# generated files if autotools are regenerated because otherwise if configure
# has been run without "--enable-maintainer-mode" make can do a partial update
# of Makefile. These functions do the two bits of cleaning.
clean_autotools(){
rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs
}
clean_configure(){
rm -rf $libpng_configure_files $libpng_configure_dirs
}
#
# Clean: remove everything (this is to help with testing)
if test -n "$clean"
then
clean_configure
if test -n "$maintainer"
then
clean_autotools
fi
exit 0
fi
#
# Validate the distribution.
libpng_autotools_file_found=
libpng_autotools_file_missing=
for file in $libpng_autotools_files
do
if test -f "$file"
then
libpng_autotools_file_found=1
else
libpng_autotools_file_missing=1
fi
done
#
# Presence of one of these does not *invalidate* missing, but absence
# invalidates found.
for file in $libpng_libtool_files
do
if test ! -f "$file"
then
libpng_autotools_file_missing=1
fi
done
#
# The cache directory doesn't matter - it will be regenerated and does not exist
# anyway in a tarball.
#
# Either everything is missing or everything is there, the --maintainer option
# just changes this so that the mode is set to generate all the files.
mode=
if test -z "$libpng_autotools_file_found" -o -n "$maintainer"
then
mode="autoreconf"
else
if test -n "$libpng_autotools_file_missing"
then
mode="broken"
else
mode="configure"
fi
fi
#
# So:
case "$mode" in
autoreconf)
# Clean in case configure files exist
clean_configure
clean_autotools
# Everything must be initialized, so use --force
if autoreconf --warnings=all --force --install
then
missing=
for file in $libpng_autotools_files
do
test -f "$file" || missing=1
done
# ignore the cache directory
test -z "$missing" || {
exec >&2
echo "autoreconf was run, but did not produce all the expected"
echo "files. It is likely that your autotools installation is"
echo "not compatible with that expected by libpng."
exit 1
}
else
exec >&2
echo "autoreconf failed: your version of autotools is incompatible"
echo "with this libpng version. Please use a distributed archive"
echo "(which includes the autotools generated files) and run configure"
echo "instead."
exit 1
fi;;
configure)
if test -d .git
then
exec >&2
echo "ERROR: running autoreconf on an initialized sytem"
echo " This is not necessary; it is only necessary to remake the"
echo " autotools generated files if Makefile.am or configure.ac"
echo " change and make does the right thing with:"
echo
echo " ./configure --enable-maintainer-mode."
echo
echo " You can run autoreconf yourself if you don't like maintainer"
echo " mode and you can also just run autoreconf -f -i to initialize"
echo " everything in the first place; this script is only for"
echo " compatiblity with prior releases."
exit 1
else
exec >&2
echo "autogen.sh is intended only to generate 'configure' on systems"
echo "that do not have it. You have a complete 'configure', if you"
echo "need to change Makefile.am or configure.ac you also need to"
echo "run configure with the --enable-maintainer-mode option."
exit 1
fi;;
broken)
exec >&2
echo "Your system has a partial set of autotools generated files."
echo "autogen.sh is unable to proceed. The full set of files is"
echo "contained in the libpng 'tar' distribution archive and you do"
echo "not need to run autogen.sh if you use it."
exit 1;;
esac

File diff suppressed because it is too large Load Diff

View File

@ -1,112 +0,0 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `feenableexcept' function. */
#undef HAVE_FEENABLEEXCEPT
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the `pow' function. */
#undef HAVE_POW
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Turn on ARM Neon optimizations at run-time */
#undef PNG_ARM_NEON_API_SUPPORTED
/* Check for ARM Neon support at run-time */
#undef PNG_ARM_NEON_CHECK_SUPPORTED
/* Enable ARM Neon optimizations */
#undef PNG_ARM_NEON_SUPPORTED
/* Disable ARM Neon optimizations */
#undef PNG_NO_ARM_NEON
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported directly. */
#undef restrict
/* Work around a bug in Sun C++: it does not support _Restrict or
__restrict__, even though the corresponding Sun C compiler ends up with
"#define restrict _Restrict" or "#define restrict __restrict__" in the
previous line. Perhaps some future version of Sun C++ will work with
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define _Restrict
# define __restrict__
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

File diff suppressed because it is too large Load Diff

15195
3rdparty/libpng/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,266 +0,0 @@
# configure.ac
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Minor upgrades (compatible ABI): increment the package version
dnl (third field in two places below) and set the PNGLIB_RELEASE
dnl variable.
dnl
dnl Major upgrades (incompatible ABI): increment the package major
dnl version (second field, or first if desired), set the minor
dnl to 0, set PNGLIB_MAJOR below *and* follow the instructions in
dnl Makefile.am to upgrade the package name.
dnl This is here to prevent earlier autoconf from being used, it
dnl should not be necessary to regenerate configure if the time
dnl stamps are correct
AC_PREREQ([2.68])
dnl Version number stuff here:
AC_INIT([libpng],[1.6.2],[png-mng-implement@lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts])
# libpng does not follow GNU file name conventions (hence 'foreign')
# color-tests requires automake 1.11 or later
# silent-rules requires automake 1.11 or later
# dist-xz requires automake 1.11 or later
# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1
# 1.13 is required for parallel tests
AM_INIT_AUTOMAKE([1.13 foreign dist-xz color-tests silent-rules])
# The following line causes --disable-maintainer-mode to be the default to
# configure, this is necessary because libpng distributions cannot rely on the
# time stamps of the autotools generated files being correct
AM_MAINTAINER_MODE
dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later
dnl version; aclocal.m4 will generate a failure if you use a prior version of
dnl automake, so the following is not necessary (and is not defined anyway):
dnl AM_PREREQ([1.11.2])
dnl stop configure from automagically running automake
PNGLIB_VERSION=1.6.2
PNGLIB_MAJOR=1
PNGLIB_MINOR=6
PNGLIB_RELEASE=2
dnl End of version number stuff
AC_CONFIG_SRCDIR([pngget.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_LANG([C])
AC_PROG_CC
AM_PROG_AS
LT_PATH_LD
AC_PROG_CPP
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl libtool/libtoolize; version 2.4.2 is the tested version, this or any
dnl compatible later version may be used
LT_INIT([win32-dll])
LT_PREREQ([2.4.2])
# Some awks crash when confronted with pnglibconf.dfa, do a test run now
# to make sure this doesn't happen
AC_MSG_CHECKING([that AWK works])
if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
${srcdir}/pngusr.dfa 1>&2
then
AC_MSG_RESULT([ok])
else
AC_MSG_FAILURE([failed], 1)
fi
# This is a remnant of the old cc -E validation, where it may have been
# necessary to use a different preprocessor for .dfn files
DFNCPP="$CPP"
AC_SUBST(DFNCPP)
# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it
# checks the compiler with a program that generates a warning), add the
# following option to deal with this
AC_ARG_VAR(PNG_COPTS,
[additional flags for the C compiler, use this for options that would]
[cause configure itself to fail])
AC_ARG_ENABLE(werror,
AS_HELP_STRING([[[--enable-werror[=OPT]]]],
[Pass -Werror or the given argument to the compiler if it is supported]),
[test "$enable_werror" = "yes" && enable_werror="-Werror"
if test "$enable_werror" != "no"; then
sav_CFLAGS="$CFLAGS"
CFLAGS="$enable_werror $CFLAGS"
AC_MSG_CHECKING([if the compiler allows $enable_werror])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([
[int main(int argc, char **argv){]
[return argv[argc-1][0];]
[}]])],
AC_MSG_RESULT(yes)
PNG_COPTS="$PNG_COPTS $enable_werror",
AC_MSG_RESULT(no))
CFLAGS="$sav_CFLAGS"
fi],)
# Checks for header files.
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_C_RESTRICT
# Checks for library functions.
AC_FUNC_STRTOD
AC_CHECK_FUNCS([memset], , AC_MSG_ERROR(memset not found in libc))
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)) )
AC_ARG_WITH(zlib-prefix,
AS_HELP_STRING([[[--with-zlib-prefix]]],
[prefix that may have been used in installed zlib]),
[ZPREFIX=${withval}],
[ZPREFIX='z_'])
AC_CHECK_LIB(z, zlibVersion, ,
AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_MSG_ERROR(zlib not installed)))
# The following is for pngvalid, to ensure it catches FP errors even on
# platforms that don't enable FP exceptions, the function appears in the math
# library (typically), it's not an error if it is not found.
AC_CHECK_LIB([m], [feenableexcept])
AC_CHECK_FUNCS([feenableexcept])
AC_MSG_CHECKING([if using Solaris linker])
SLD=`$LD --version 2>&1 | grep Solaris`
if test "$SLD"; then
have_solaris_ld=yes
AC_MSG_RESULT(yes)
else
have_solaris_ld=no
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(HAVE_SOLARIS_LD, test "$have_solaris_ld" = "yes")
AC_MSG_CHECKING([if libraries can be versioned])
# Special case for PE/COFF platforms: ld reports
# support for version-script, but doesn't actually
# DO anything with it.
case $host in
*cygwin* | *mingw32* | *interix* )
have_ld_version_script=no
AC_MSG_RESULT(no)
;;
* )
if test "$have_solaris_ld" = "yes"; then
GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'`
else
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
fi
if test "$GLD"; then
have_ld_version_script=yes
AC_MSG_RESULT(yes)
else
have_ld_version_script=no
AC_MSG_RESULT(no)
AC_MSG_WARN(*** You have not enabled versioned symbols.)
fi
;;
esac
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
if test "$have_ld_version_script" = "yes"; then
AC_MSG_CHECKING([for symbol prefix])
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
| ${CPP-${CC-gcc} -E} - 2>&1 \
| ${EGREP-grep} "^PREFIX=" \
| ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
AC_SUBST(SYMBOL_PREFIX)
AC_MSG_RESULT($SYMBOL_PREFIX)
fi
# Substitutions for .in files
AC_SUBST(PNGLIB_VERSION)
AC_SUBST(PNGLIB_MAJOR)
AC_SUBST(PNGLIB_MINOR)
AC_SUBST(PNGLIB_RELEASE)
# Additional arguments (and substitutions)
# Allow the pkg-config directory to be set
AC_ARG_WITH(pkgconfigdir,
AS_HELP_STRING([[[--with-pkgconfigdir]]],
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
[pkgconfigdir=${withval}],
[pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir])
AC_MSG_NOTICE([[pkgconfig directory is ${pkgconfigdir}]])
# Make the *-config binary config scripts optional
AC_ARG_WITH(binconfigs,
AS_HELP_STRING([[[--with-binconfigs]]],
[Generate shell libpng-config scripts as well as pkg-config data]
[@<:@default=yes@:>@]),
[if test "${withval}" = no; then
binconfigs=
AC_MSG_NOTICE([[libpng-config scripts will not be built]])
else
binconfigs='${binconfigs}'
fi],
[binconfigs='${binconfigs}'])
AC_SUBST([binconfigs])
# Support for prefixes to the API function names; this will generate defines
# at the start of the build to rename exported library functions
AC_ARG_WITH(libpng-prefix,
AS_HELP_STRING([[[--with-libpng-prefix]]],
[prefix libpng exported function (API) names with the given value]),
[if test "${withval:-no}" != "no"; then
AC_SUBST([PNG_PREFIX], [${withval}])
fi])
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
# Because GCC by default assembles code with an executable stack, even though it
# compiles C code with a non-executable stack, it is necessary to do a fixup
# here (this may by GCC specific)
# AC_SUBST([AM_CCASFLAGS], [-Wa,--noexecstack])
AC_ARG_ENABLE([arm-neon],
AS_HELP_STRING([[[--enable-arm-neon]]],
[Enable ARM NEON optimizations: =off, check, api, on:]
[off: disable the optimizations; check: use internal checking code]
[(deprecated and poorly supported); api: disable by default, enable by]
[a call to png_set_option; on: turn on unconditionally. The]
[default is 'on' if __ARM_NEON__ is defined, otherwise 'off'.]),
[case "$enableval" in
off)
AC_DEFINE([PNG_NO_ARM_NEON], [],
[Disable ARM Neon optimizations]);;
check)
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
[Check for ARM Neon support at run-time]);;
api)
AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
[Turn on ARM Neon optimizations at run-time]);;
on)
AC_DEFINE([PNG_ARM_NEON_SUPPORTED], [],
[Enable ARM Neon optimizations]);;
*)
AC_MSG_ERROR([arm-neon: option value required (off/check/api/on)]);;
esac])
AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" != "no"])
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
# Config files, substituting as above
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
AC_CONFIG_FILES([libpng-config:libpng-config.in],
[chmod +x libpng-config])
AC_OUTPUT

View File

@ -1,791 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -2,8 +2,8 @@
#if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng
* Last changed in libpng 1.6.0 [February 14, 2013]
* Maintained 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.15 [November 20, 2014]
* Maintained 1998-2014 Glenn Randers-Pehrson
* Maintained 1996, 1997 Andreas Dilger)
* Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* To the extent possible under law, the authors have waived
@ -52,7 +52,7 @@ int main(int argc, const char **argv)
image.version = PNG_IMAGE_VERSION;
/* The first argument is the file to read: */
if (png_image_begin_read_from_file(&image, argv[1]))
if (png_image_begin_read_from_file(&image, argv[1]) != 0)
{
png_bytep buffer;
@ -97,7 +97,7 @@ int main(int argc, const char **argv)
*/
if (buffer != NULL &&
png_image_finish_read(&image, NULL/*background*/, buffer,
0/*row_stride*/, NULL/*colormap*/))
0/*row_stride*/, NULL/*colormap*/) != 0)
{
/* Now write the image out to the second argument. In the write
* call 'convert_to_8bit' allows 16-bit data to be squashed down to
@ -105,7 +105,7 @@ int main(int argc, const char **argv)
* to the 8-bit format.
*/
if (png_image_write_to_file(&image, argv[2], 0/*convert_to_8bit*/,
buffer, 0/*row_stride*/, NULL/*colormap*/))
buffer, 0/*row_stride*/, NULL/*colormap*/) != 0)
{
/* The image has been written successfully. */
exit(0);
@ -188,13 +188,13 @@ int main(int argc, const char **argv)
*
* Don't repeatedly convert between the 8-bit and 16-bit forms. There is
* significant data loss when 16-bit data is converted to the 8-bit encoding and
* the current libpng implementation of convertion to 16-bit is also
* the current libpng implementation of conversion to 16-bit is also
* significantly lossy. The latter will be fixed in the future, but the former
* is unavoidable - the 8-bit format just doesn't have enough resolution.
*/
/* If your program needs more information from the PNG data it reads, or if you
* need to do more complex transformations, or minimise transformations, on the
* need to do more complex transformations, or minimize transformations, on the
* data you read, then you must use one of the several lower level libpng
* interfaces.
*
@ -405,7 +405,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
/* Expand paletted or RGB images with transparency to full alpha channels
* so the data will be available as RGBA quartets.
*/
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) != 0)
png_set_tRNS_to_alpha(png_ptr);
/* Set the background color to draw transparent and alpha images over.
@ -417,7 +417,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
png_color_16 my_background, *image_background;
if (png_get_bKGD(png_ptr, info_ptr, &image_background))
if (png_get_bKGD(png_ptr, info_ptr, &image_background) != 0)
png_set_background(png_ptr, image_background,
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
else
@ -441,9 +441,9 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
/* If we don't have another value */
else
{
screen_gamma = 2.2; /* A good guess for a PC monitor in a dimly
lit room */
screen_gamma = 1.7 or 1.0; /* A good guess for Mac systems */
screen_gamma = PNG_DEFAULT_sRGB; /* A good guess for a PC monitor
in a dimly lit room */
screen_gamma = PNG_GAMMA_MAC_18 or 1.0; /* Good guesses for Mac systems */
}
/* Tell libpng to handle the gamma conversion for you. The final call
@ -454,12 +454,12 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
int intent;
if (png_get_sRGB(png_ptr, info_ptr, &intent))
png_set_gamma(png_ptr, screen_gamma, 0.45455);
if (png_get_sRGB(png_ptr, info_ptr, &intent) != 0)
png_set_gamma(png_ptr, screen_gamma, PNG_DEFAULT_sRGB);
else
{
double image_gamma;
if (png_get_gAMA(png_ptr, info_ptr, &image_gamma))
if (png_get_gAMA(png_ptr, info_ptr, &image_gamma) != 0)
png_set_gamma(png_ptr, screen_gamma, image_gamma);
else
png_set_gamma(png_ptr, screen_gamma, 0.45455);
@ -469,7 +469,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
/* Quantize RGB files down to 8 bit palette or reduce palettes
* to the number of colors available on your screen.
*/
if (color_type & PNG_COLOR_MASK_COLOR)
if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
{
int num_palette;
png_colorp palette;
@ -484,7 +484,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
MAX_SCREEN_COLORS, NULL, 0);
}
/* This reduces the image to the palette supplied in the file */
else if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette))
else if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette) != 0)
{
png_uint_16p histogram = NULL;
@ -494,7 +494,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
max_screen_colors, histogram, 0);
}
}
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
#endif /* READ_QUANTIZE */
/* Invert monochrome files to have 0 as white and 1 as black */
png_set_invert_mono(png_ptr);
@ -503,7 +503,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
* [0,65535] to the original [0,7] or [0,31], or whatever range the
* colors were originally in:
*/
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT))
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT) != 0)
{
png_color_8p sig_bit_p;
@ -512,7 +512,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
}
/* Flip the RGB pixels to BGR (or RGBA to BGRA) */
if (color_type & PNG_COLOR_MASK_COLOR)
if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
png_set_bgr(png_ptr);
/* Swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) */
@ -532,7 +532,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
number_passes = png_set_interlace_handling(png_ptr);
#else
number_passes = 1;
#endif /* PNG_READ_INTERLACING_SUPPORTED */
#endif /* READ_INTERLACING */
/* Optional call to gamma correct and add the background to the palette
@ -744,7 +744,7 @@ row_callback(png_structp png_ptr, png_bytep new_row,
* to pass the current row as new_row, and the function will combine
* the old row and the new row.
*/
#endif /* PNG_READ_INTERLACING_SUPPORTED */
#endif /* READ_INTERLACING */
}
end_callback(png_structp png_ptr, png_infop info)
@ -932,7 +932,7 @@ void write_png(char *file_name /* , ... other image information ... */)
*/
/* Once we write out the header, the compression type on the text
* chunks gets changed to PNG_TEXT_COMPRESSION_NONE_WR or
* chunk gets changed to PNG_TEXT_COMPRESSION_NONE_WR or
* PNG_TEXT_COMPRESSION_zTXt_WR, so it doesn't get written out again
* at the end.
*/
@ -970,7 +970,7 @@ void write_png(char *file_name /* , ... other image information ... */)
png_set_packswap(png_ptr);
/* Turn on interlace handling if you are not using png_write_image() */
if (interlacing)
if (interlacing != 0)
number_passes = png_set_interlace_handling(png_ptr);
else

View File

@ -1,527 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "April 25, 2013"
.TH LIBPNGPF 3 "March 26, 2015"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.2
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.17
(private functions)
.SH SYNOPSIS
\fB#include \fI"pngpriv.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,215 +0,0 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2012-06-26.16; # UTC
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'automa4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -1,4 +1,4 @@
.TH PNG 5 "April 25, 2013"
.TH PNG 5 "March 26, 2015"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION

840
3rdparty/libpng/png.c vendored

File diff suppressed because it is too large Load Diff

266
3rdparty/libpng/png.h vendored
View File

@ -1,8 +1,9 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.6.2 - April 25, 2013
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* libpng version 1.6.17, March 26, 2015
*
* Copyright (c) 1998-2015 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.)
*
@ -11,7 +12,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.2 - April 25, 2013: Glenn
* libpng versions 0.97, January 1998, through 1.6.17, March 26, 2015: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@ -175,6 +176,46 @@
* 1.6.2beta01 16 10602 16.so.16.2[.0]
* 1.6.2rc01-06 16 10602 16.so.16.2[.0]
* 1.6.2 16 10602 16.so.16.2[.0]
* 1.6.3beta01-11 16 10603 16.so.16.3[.0]
* 1.6.3rc01 16 10603 16.so.16.3[.0]
* 1.6.3 16 10603 16.so.16.3[.0]
* 1.6.4beta01-02 16 10604 16.so.16.4[.0]
* 1.6.4rc01 16 10604 16.so.16.4[.0]
* 1.6.4 16 10604 16.so.16.4[.0]
* 1.6.5 16 10605 16.so.16.5[.0]
* 1.6.6 16 10606 16.so.16.6[.0]
* 1.6.7beta01-04 16 10607 16.so.16.7[.0]
* 1.6.7rc01-03 16 10607 16.so.16.7[.0]
* 1.6.7 16 10607 16.so.16.7[.0]
* 1.6.8beta01-02 16 10608 16.so.16.8[.0]
* 1.6.8rc01-02 16 10608 16.so.16.8[.0]
* 1.6.8 16 10608 16.so.16.8[.0]
* 1.6.9beta01-04 16 10609 16.so.16.9[.0]
* 1.6.9rc01-02 16 10609 16.so.16.9[.0]
* 1.6.9 16 10609 16.so.16.9[.0]
* 1.6.10beta01-03 16 10610 16.so.16.10[.0]
* 1.6.10rc01-03 16 10610 16.so.16.10[.0]
* 1.6.10 16 10610 16.so.16.10[.0]
* 1.6.11beta01-06 16 10611 16.so.16.11[.0]
* 1.6.11rc01-02 16 10611 16.so.16.11[.0]
* 1.6.11 16 10611 16.so.16.11[.0]
* 1.6.12rc01-03 16 10612 16.so.16.12[.0]
* 1.6.12 16 10612 16.so.16.12[.0]
* 1.6.13beta01-04 16 10613 16.so.16.13[.0]
* 1.6.13rc01-02 16 10613 16.so.16.13[.0]
* 1.6.13 16 10613 16.so.16.13[.0]
* 1.6.14beta01-07 16 10614 16.so.16.14[.0]
* 1.6.14rc01-02 16 10614 16.so.16.14[.0]
* 1.6.14 16 10614 16.so.16.14[.0]
* 1.6.15beta01-08 16 10615 16.so.16.15[.0]
* 1.6.15rc01-03 16 10615 16.so.16.15[.0]
* 1.6.15 16 10615 16.so.16.15[.0]
* 1.6.16beta01-03 16 10616 16.so.16.16[.0]
* 1.6.16rc01-02 16 10616 16.so.16.16[.0]
* 1.6.16 16 10616 16.so.16.16[.0]
* 1.6.17beta01-06 16 10617 16.so.16.17[.0]
* 1.6.17rc01-06 16 10617 16.so.16.17[.0]
* 1.6.17 16 10617 16.so.16.17[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@ -206,8 +247,8 @@
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.6.2, April 25, 2013, are
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
* libpng versions 1.2.6, August 15, 2004, through 1.6.17, March 26, 2015, are
* Copyright (c) 2004, 2006-2015 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
*
@ -318,13 +359,13 @@
* Y2K compliance in libpng:
* =========================
*
* April 25, 2013
* March 26, 2015
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.6.2 are Y2K compliant. It is my belief that
* upward through 1.6.17 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant.
*
* Libpng only has two year fields. One is a 2-byte unsigned integer
@ -377,16 +418,18 @@
/* This is not the place to learn how to use libpng. The file libpng-manual.txt
* describes how to use libpng, and the file example.c summarizes it
* with some code on which to build. This file is useful for looking
* at the actual function definitions and structure components.
* at the actual function definitions and structure components. If that
* file has been stripped from your copy of libpng, you can find it at
* <http://www.libpng.org/pub/png/libpng-manual.txt>
*
* If you just need to read a PNG file and don't want to read the documentation
* skip to the end of this file and read the section entitled 'simplified API'.
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.2"
#define PNG_LIBPNG_VER_STRING "1.6.17"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.6.2 - April 25, 2013\n"
" libpng version 1.6.17 - March 26, 2015\n"
#define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16
@ -394,7 +437,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
#define PNG_LIBPNG_VER_RELEASE 2
#define PNG_LIBPNG_VER_RELEASE 17
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
@ -425,7 +468,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
#define PNG_LIBPNG_VER 10602 /* 1.6.2 */
#define PNG_LIBPNG_VER 10617 /* 1.6.17 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@ -530,7 +573,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef char* png_libpng_version_1_6_2;
typedef char* png_libpng_version_1_6_17;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@ -712,7 +755,8 @@ typedef png_time * png_timep;
typedef const png_time * png_const_timep;
typedef png_time * * png_timepp;
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) ||\
defined(PNG_USER_CHUNKS_SUPPORTED)
/* png_unknown_chunk is a structure to hold queued chunks for which there is
* no specific support. The idea is that we can use this to queue
* up private chunks for output even though the library doesn't actually
@ -1142,7 +1186,7 @@ PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime,
/* Convert from time_t to png_time. Uses gmtime() */
PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime));
#endif /* PNG_CONVERT_tIME_SUPPORTED */
#endif /* CONVERT_tIME */
#ifdef PNG_READ_EXPAND_SUPPORTED
/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
@ -1191,9 +1235,9 @@ PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
#endif
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
/* How the alpha channel is interpreted - this affects how the color channels of
* a PNG file are returned when an alpha channel, or tRNS chunk in a palette
* file, is present.
/* How the alpha channel is interpreted - this affects how the color channels
* of a PNG file are returned to the calling application when an alpha channel,
* or a tRNS chunk in a palette file, is present.
*
* This has no effect on the way pixels are written into a PNG output
* datastream. The color samples in a PNG datastream are never premultiplied
@ -1201,33 +1245,19 @@ PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
*
* The default is to return data according to the PNG specification: the alpha
* channel is a linear measure of the contribution of the pixel to the
* corresponding composited pixel. The gamma encoded color channels must be
* scaled according to the contribution and to do this it is necessary to undo
* corresponding composited pixel, and the color channels are unassociated
* (not premultiplied). The gamma encoded color channels must be scaled
* according to the contribution and to do this it is necessary to undo
* the encoding, scale the color values, perform the composition and reencode
* the values. This is the 'PNG' mode.
*
* The alternative is to 'associate' the alpha with the color information by
* storing color channel values that have been scaled by the alpha. The
* advantage is that the color channels can be resampled (the image can be
* scaled) in this form. The disadvantage is that normal practice is to store
* linear, not (gamma) encoded, values and this requires 16-bit channels for
* still images rather than the 8-bit channels that are just about sufficient if
* gamma encoding is used. In addition all non-transparent pixel values,
* including completely opaque ones, must be gamma encoded to produce the final
* image. This is the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' mode (the
* latter being the two common names for associated alpha color channels.)
* storing color channel values that have been scaled by the alpha.
* image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes
* (the latter being the two common names for associated alpha color channels).
*
* Since it is not necessary to perform arithmetic on opaque color values so
* long as they are not to be resampled and are in the final color space it is
* possible to optimize the handling of alpha by storing the opaque pixels in
* the PNG format (adjusted for the output color space) while storing partially
* opaque pixels in the standard, linear, format. The accuracy required for
* standard alpha composition is relatively low, because the pixels are
* isolated, therefore typically the accuracy loss in storing 8-bit linear
* values is acceptable. (This is not true if the alpha channel is used to
* simulate transparency over large areas - use 16 bits or the PNG mode in
* this case!) This is the 'OPTIMIZED' mode. For this mode a pixel is
* treated as opaque only if the alpha value is equal to the maximum value.
* For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha
* value is equal to the maximum value.
*
* The final choice is to gamma encode the alpha channel as well. This is
* broken because, in practice, no implementation that uses this choice
@ -1254,68 +1284,7 @@ PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,
#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)
/* The output_gamma value is a screen gamma in libpng terminology: it expresses
* how to decode the output values, not how they are encoded. The values used
* correspond to the normal numbers used to describe the overall gamma of a
* computer display system; for example 2.2 for an sRGB conformant system. The
* values are scaled by 100000 in the _fixed version of the API (so 220000 for
* sRGB.)
*
* The inverse of the value is always used to provide a default for the PNG file
* encoding if it has no gAMA chunk and if png_set_gamma() has not been called
* to override the PNG gamma information.
*
* When the ALPHA_OPTIMIZED mode is selected the output gamma is used to encode
* opaque pixels however pixels with lower alpha values are not encoded,
* regardless of the output gamma setting.
*
* When the standard Porter Duff handling is requested with mode 1 the output
* encoding is set to be linear and the output_gamma value is only relevant
* as a default for input data that has no gamma information. The linear output
* encoding will be overridden if png_set_gamma() is called - the results may be
* highly unexpected!
*
* The following numbers are derived from the sRGB standard and the research
* behind it. sRGB is defined to be approximated by a PNG gAMA chunk value of
* 0.45455 (1/2.2) for PNG. The value implicitly includes any viewing
* correction required to take account of any differences in the color
* environment of the original scene and the intended display environment; the
* value expresses how to *decode* the image for display, not how the original
* data was *encoded*.
*
* sRGB provides a peg for the PNG standard by defining a viewing environment.
* sRGB itself, and earlier TV standards, actually use a more complex transform
* (a linear portion then a gamma 2.4 power law) than PNG can express. (PNG is
* limited to simple power laws.) By saying that an image for direct display on
* an sRGB conformant system should be stored with a gAMA chunk value of 45455
* (11.3.3.2 and 11.3.3.5 of the ISO PNG specification) the PNG specification
* makes it possible to derive values for other display systems and
* environments.
*
* The Mac value is deduced from the sRGB based on an assumption that the actual
* extra viewing correction used in early Mac display systems was implemented as
* a power 1.45 lookup table.
*
* Any system where a programmable lookup table is used or where the behavior of
* the final display device characteristics can be changed requires system
* specific code to obtain the current characteristic. However this can be
* difficult and most PNG gamma correction only requires an approximate value.
*
* By default, if png_set_alpha_mode() is not called, libpng assumes that all
* values are unencoded, linear, values and that the output device also has a
* linear characteristic. This is only very rarely correct - it is invariably
* better to call png_set_alpha_mode() with PNG_DEFAULT_sRGB than rely on the
* default if you don't know what the right answer is!
*
* The special value PNG_GAMMA_MAC_18 indicates an older Mac system (pre Mac OS
* 10.6) which used a correction table to implement a somewhat lower gamma on an
* otherwise sRGB system.
*
* Both these values are reserved (not simple gamma values) in order to allow
* more precise correction internally in the future.
*
* NOTE: the following values can be passed to either the fixed or floating
* point APIs, but the floating point API will also accept floating point
* values.
* how to decode the output values, not how they are encoded.
*/
#define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */
#define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */
@ -1423,7 +1392,7 @@ PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler,
/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */
PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr,
png_uint_32 filler, int flags));
#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */
#endif /* READ_FILLER || WRITE_FILLER */
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
/* Swap bytes in 16-bit depth files. */
@ -1613,6 +1582,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,
#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */
#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */
#ifdef PNG_WRITE_SUPPORTED
/* These functions give the user control over the scan-line filtering in
* libpng and the compression methods used by zlib. These functions are
* mainly useful for testing, as the defaults should work with most users.
@ -1626,6 +1596,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,
*/
PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method,
int filters));
#endif /* WRITE */
/* Flags for png_set_filter() to say which filters to use. The flags
* are chosen so that they don't conflict with real filter types
@ -1651,6 +1622,7 @@ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method,
#define PNG_FILTER_VALUE_PAETH 4
#define PNG_FILTER_VALUE_LAST 5
#ifdef PNG_WRITE_SUPPORTED
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */
/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_
* defines, either the default (minimum-sum-of-absolute-differences), or
@ -1687,7 +1659,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
(png_structrp png_ptr, int heuristic_method, int num_weights,
png_const_fixed_point_p filter_weights,
png_const_fixed_point_p filter_costs))
#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
#endif /* WRITE_WEIGHTED_FILTER */
/* Heuristic used for row filter selection. These defines should NOT be
* changed.
@ -1697,7 +1669,6 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */
#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */
#ifdef PNG_WRITE_SUPPORTED
/* Set the library compression level. Currently, valid values range from
* 0 - 9, corresponding directly to the zlib compression levels 0 - 9
* (0 - no compression, 9 - "maximal" compression). Note that tests have
@ -1705,6 +1676,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
* for PNG images, and do considerably fewer caclulations. In the future,
* these values may not correspond directly to the zlib compression levels.
*/
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr,
int level));
@ -1722,7 +1694,7 @@ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr,
PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr,
int method));
#endif
#endif /* WRITE_CUSTOMIZE_COMPRESSION */
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
/* Also set zlib parameters for compressing non-IDAT chunks */
@ -1743,7 +1715,8 @@ PNG_EXPORT(225, void, png_set_text_compression_window_bits,
PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr,
int method));
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
#endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */
#endif /* WRITE */
/* These next functions are called for input/output, memory, and error
* handling. They are in the file pngrio.c, pngwio.c, and pngerror.c,
@ -1854,7 +1827,7 @@ PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp));
*
* The integer return from the callback function is interpreted thus:
*
* negative: An error occured, png_chunk_error will be called.
* negative: An error occurred; png_chunk_error will be called.
* zero: The chunk was not handled, the chunk will be saved. A critical
* chunk will cause an error at this point unless it is to be saved.
* positive: The chunk was handled, libpng will ignore/discard it.
@ -1903,7 +1876,6 @@ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save));
*/
PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp));
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Function that combines rows. 'new_row' is a flag that should come from
* the callback and be non-NULL if anything needs to be done; the library
* stores its own version of the new data internally and ignores the passed
@ -1911,8 +1883,7 @@ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp));
*/
PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr,
png_bytep old_row, png_const_bytep new_row));
#endif /* PNG_READ_INTERLACING_SUPPORTED */
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
#endif /* PROGRESSIVE_READ */
PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr,
png_alloc_size_t size), PNG_ALLOCATED);
@ -1938,8 +1909,8 @@ PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,
* It is unlikely that this function works correctly as of 1.6.0 and using it
* may result either in memory leaks or double free of allocated data.
*/
PNG_EXPORTA(99, void, png_data_freer, (png_const_structrp png_ptr,
png_inforp info_ptr, int freer, png_uint_32 mask), PNG_DEPRECATED);
PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr,
png_inforp info_ptr, int freer, png_uint_32 mask));
/* Assignments for png_data_freer */
#define PNG_DESTROY_WILL_FREE_DATA 1
@ -1981,6 +1952,8 @@ PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr,
#else
/* Fatal error in PNG image of libpng - can't continue */
PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN);
# define png_error(s1,s2) png_err(s1)
# define png_chunk_error(s1,s2) png_err(s1)
#endif
#ifdef PNG_WARNINGS_SUPPORTED
@ -1991,6 +1964,9 @@ PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr,
/* Non-fatal error in libpng, chunk name is prepended to message. */
PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr,
png_const_charp warning_message));
#else
# define png_warning(s1,s2) ((void)(s1))
# define png_chunk_warning(s1,s2) ((void)(s1))
#endif
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
@ -2108,7 +2084,7 @@ PNG_EXPORT(128, png_int_32, png_get_x_offset_microns,
PNG_EXPORT(129, png_int_32, png_get_y_offset_microns,
(png_const_structrp png_ptr, png_const_inforp info_ptr));
#endif /* PNG_EASY_ACCESS_SUPPORTED */
#endif /* EASY_ACCESS */
#ifdef PNG_READ_SUPPORTED
/* Returns pointer to signature string read from PNG header */
@ -2360,7 +2336,7 @@ PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr,
PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,
png_inforp info_ptr, int unit,
png_const_charp swidth, png_const_charp sheight));
#endif /* PNG_sCAL_SUPPORTED */
#endif /* sCAL */
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
/* Provide the default handling for all unknown chunks or, optionally, for
@ -2501,11 +2477,15 @@ PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr,
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* The "params" pointer is currently not used and is for future expansion. */
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr,
int transforms, png_voidp params));
#endif
#ifdef PNG_WRITE_SUPPORTED
PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr,
int transforms, png_voidp params));
#endif
#endif
PNG_EXPORT(180, png_const_charp, png_get_copyright,
(png_const_structrp png_ptr));
@ -2584,8 +2564,8 @@ PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,
PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr,
png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
int *unit_type));
# endif /* PNG_pHYs_SUPPORTED */
#endif /* PNG_INCH_CONVERSIONS_SUPPORTED */
# endif /* pHYs */
#endif /* INCH_CONVERSIONS */
/* Added in libpng-1.4.0 */
#ifdef PNG_IO_STATE_SUPPORTED
@ -2608,7 +2588,7 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,
# define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */
# define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */
# define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */
#endif /* ?PNG_IO_STATE_SUPPORTED */
#endif /* IO_STATE */
/* Interlace support. The following macros are always defined so that if
* libpng interlace handling is turned off the macros may be used to handle
@ -2692,27 +2672,29 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,
* (png_uint_16)(alpha) \
+ (png_uint_16)(bg)*(png_uint_16)(255 \
- (png_uint_16)(alpha)) + 128); \
(composite) = (png_byte)((temp + (temp >> 8)) >> 8); }
(composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); }
# define png_composite_16(composite, fg, alpha, bg) \
{ png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \
* (png_uint_32)(alpha) \
+ (png_uint_32)(bg)*(65535 \
- (png_uint_32)(alpha)) + 32768); \
(composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }
(composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); }
#else /* Standard method using integer division */
# define png_composite(composite, fg, alpha, bg) \
(composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \
(png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \
127) / 255)
# define png_composite(composite, fg, alpha, bg) \
(composite) = \
(png_byte)(0xff & (((png_uint_16)(fg) * (png_uint_16)(alpha) + \
(png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \
127) / 255))
# define png_composite_16(composite, fg, alpha, bg) \
(composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \
(png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \
32767) / 65535)
#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */
(composite) = \
(png_uint_16)(0xffff & (((png_uint_32)(fg) * (png_uint_32)(alpha) + \
(png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \
32767) / 65535))
#endif /* READ_COMPOSITE_NODIV */
#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED
PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf));
@ -2782,6 +2764,8 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
# endif
#endif
#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
/*******************************************************************************
* SIMPLIFIED API
*******************************************************************************
@ -2853,7 +2837,7 @@ typedef struct
# define PNG_IMAGE_WARNING 1
# define PNG_IMAGE_ERROR 2
/*
* The result is a two bit code such that a value more than 1 indicates
* The result is a two-bit code such that a value more than 1 indicates
* a failure in the API just called:
*
* 0 - no warning or error
@ -3138,7 +3122,7 @@ PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image,
PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,
FILE* file));
/* The PNG header is read from the stdio FILE object. */
#endif /* PNG_STDIO_SUPPORTED */
#endif /* STDIO */
PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image,
png_const_voidp memory, png_size_t size));
@ -3183,9 +3167,10 @@ PNG_EXPORT(238, void, png_image_free, (png_imagep image));
/* Free any data allocated by libpng in image->opaque, setting the pointer to
* NULL. May be called at any time after the structure is initialized.
*/
#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */
#endif /* SIMPLIFIED_READ */
#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED
#ifdef PNG_STDIO_SUPPORTED
/* WRITE APIS
* ----------
* For write you must initialize a png_image structure to describe the image to
@ -3228,10 +3213,12 @@ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,
*
* Note that the write API does not support interlacing or sub-8-bit pixels.
*/
#endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */
#endif /* STDIO */
#endif /* SIMPLIFIED_WRITE */
/*******************************************************************************
* END OF SIMPLIFIED API
******************************************************************************/
#endif /* SIMPLIFIED_{READ|WRITE} */
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
PNG_EXPORT(242, void, png_set_check_for_invalid_index,
@ -3267,7 +3254,9 @@ PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,
#ifdef PNG_ARM_NEON_API_SUPPORTED
# define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */
#endif
#define PNG_OPTION_NEXT 2 /* Next option - numbers must be even */
#define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */
#define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */
#define PNG_OPTION_NEXT 6 /* Next option - numbers must be even */
/* Return values: NOTE: there are four values and 'off' is *not* zero */
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */
@ -3277,19 +3266,18 @@ PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,
PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,
int onoff));
#endif
#endif /* SET_OPTION */
/*******************************************************************************
* END OF HARDWARE OPTIONS
* END OF HARDWARE AND SOFTWARE OPTIONS
******************************************************************************/
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project
* defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt
/* Maintainer: Put new public prototypes here ^, in libpng.3, in project
* defs, and in scripts/symbols.def.
*/
/* The last ordinal number (this is the *last* one already used; the next
* one to use is one more than this.) Maintainer, remember to add an entry to
* scripts/symbols.def as well.
* one to use is one more than this.)
*/
#ifdef PNG_EXPORT_LAST_ORDINAL
PNG_EXPORT_LAST_ORDINAL(244);

View File

@ -1,9 +1,9 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.6.2 - April 25, 2013
* libpng version 1.6.17, March 26, 2015
*
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Copyright (c) 1998-2015 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.)
*
@ -11,9 +11,7 @@
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
*/
/* Any machine specific code is near the front of this file, so if you
* Any machine specific code is near the front of this file, so if you
* are configuring libpng for a machine, you may want to read the section
* starting here down to where it starts to typedef png_color, png_text,
* and png_info.
@ -22,26 +20,6 @@
#ifndef PNGCONF_H
#define PNGCONF_H
/* To do: Do all of this in scripts/pnglibconf.dfa */
#ifdef PNG_SAFE_LIMITS_SUPPORTED
# ifdef PNG_USER_WIDTH_MAX
# undef PNG_USER_WIDTH_MAX
# define PNG_USER_WIDTH_MAX 1000000L
# endif
# ifdef PNG_USER_HEIGHT_MAX
# undef PNG_USER_HEIGHT_MAX
# define PNG_USER_HEIGHT_MAX 1000000L
# endif
# ifdef PNG_USER_CHUNK_MALLOC_MAX
# undef PNG_USER_CHUNK_MALLOC_MAX
# define PNG_USER_CHUNK_MALLOC_MAX 4000000L
# endif
# ifdef PNG_USER_CHUNK_CACHE_MAX
# undef PNG_USER_CHUNK_CACHE_MAX
# define PNG_USER_CHUNK_CACHE_MAX 128
# endif
#endif
#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */
/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C
@ -238,6 +216,7 @@
# define PNGAPI _stdcall
# endif
# endif /* compiler/api */
/* NOTE: PNGCBAPI always defaults to PNGCAPI. */
# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
@ -360,7 +339,33 @@
* version 1.2.41. Disabling these removes the warnings but may also produce
* less efficient code.
*/
# if defined(__GNUC__)
# if defined(__clang__) && defined(__has_attribute)
/* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
# endif
# if !defined(PNG_NORETURN) && __has_attribute(__noreturn__)
# define PNG_NORETURN __attribute__((__noreturn__))
# endif
# if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__)
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
# if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__)
# define PNG_DEPRECATED __attribute__((__deprecated__))
# endif
# if !defined(PNG_PRIVATE)
# ifdef __has_extension
# if __has_extension(attribute_unavailable_with_message)
# define PNG_PRIVATE __attribute__((__unavailable__(\
"This function is not exported by libpng.")))
# endif
# endif
# endif
# ifndef PNG_RESTRICT
# define PNG_RESTRICT __restrict
# endif
# elif defined(__GNUC__)
# ifndef PNG_USE_RESULT
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
# endif
@ -383,12 +388,12 @@
__attribute__((__deprecated__))
# endif
# endif
# if ((__GNUC__ != 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))
# if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))
# ifndef PNG_RESTRICT
# define PNG_RESTRICT __restrict
# endif
# endif /* __GNUC__ == 3.0 */
# endif /* __GNUC__ >= 3 */
# endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */
# endif /* __GNUC__ >= 3 */
# elif defined(_MSC_VER) && (_MSC_VER >= 1300)
# ifndef PNG_USE_RESULT
@ -418,7 +423,7 @@
# ifndef PNG_RESTRICT
# define PNG_RESTRICT __restrict
# endif
# endif /* _MSC_VER */
# endif
#endif /* PNG_PEDANTIC_WARNINGS */
#ifndef PNG_DEPRECATED
@ -439,6 +444,7 @@
#ifndef PNG_RESTRICT
# define PNG_RESTRICT /* The C99 "restrict" feature */
#endif
#ifndef PNG_FP_EXPORT /* A floating point API. */
# ifdef PNG_FLOATING_POINT_SUPPORTED
# define PNG_FP_EXPORT(ordinal, type, name, args)\

View File

@ -1,12 +1,11 @@
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* Last changed in libpng 1.6.8 [December 19, 2013]
* Copyright (c) 1998-2013 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.)
*
* Last changed in libpng 1.5.0 [January 6, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@ -25,7 +24,7 @@
* (actually ((void)0)).
*
* level: level of detail of message, starting at 0. A level 'n'
* message is preceded by 'n' tab characters (not implemented
* message is preceded by 'n' 3-space indentations (not implemented
* on Microsoft compilers unless PNG_DEBUG_FILE is also
* defined, to allow debug DLL compilation with no standard IO).
* message: a printf(3) style text string. A trailing '\n' is added
@ -77,32 +76,29 @@
# endif /* PNG_DEBUG_FILE */
# if (PNG_DEBUG > 1)
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on
* non-ISO compilers
*/
# ifdef __STDC__
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
(num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\
} while (0)
# endif
# else /* __STDC __ */

View File

@ -1,8 +1,8 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
* Last changed in libpng 1.6.1 [March 28, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.15 [November 20, 2014]
* Copyright (c) 1998-2014 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.)
*
@ -27,7 +27,7 @@ static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr,
static void /* PRIVATE */
png_default_warning PNGARG((png_const_structrp png_ptr,
png_const_charp warning_message));
#endif /* PNG_WARNINGS_SUPPORTED */
#endif /* WARNINGS */
/* This function is called whenever there is a fatal error. This function
* should not be changed. If there is a need to handle errors differently,
@ -43,8 +43,8 @@ png_error,(png_const_structrp png_ptr, png_const_charp error_message),
char msg[16];
if (png_ptr != NULL)
{
if (png_ptr->flags&
(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
if ((png_ptr->flags &
(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0
{
if (*error_message == PNG_LITERAL_SHARP)
{
@ -54,7 +54,7 @@ png_error,(png_const_structrp png_ptr, png_const_charp error_message),
if (error_message[offset] == ' ')
break;
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0)
{
int i;
for (i = 0; i < offset - 1; i++)
@ -69,7 +69,7 @@ png_error,(png_const_structrp png_ptr, png_const_charp error_message),
else
{
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0)
{
msg[0] = '0';
msg[1] = '\0';
@ -103,7 +103,7 @@ png_err,(png_const_structrp png_ptr),PNG_NORETURN)
use the default handler, which will not return. */
png_default_error(png_ptr, "");
}
#endif /* PNG_ERROR_TEXT_SUPPORTED */
#endif /* ERROR_TEXT */
/* Utility to safely appends strings to a buffer. This never errors out so
* error checking is not required in the caller.
@ -152,7 +152,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
case PNG_NUMBER_FORMAT_fixed:
/* Needs five digits (the fraction) */
mincount = 5;
if (output || number % 10 != 0)
if (output != 0 || number % 10 != 0)
{
*--end = digits[number % 10];
output = 1;
@ -189,13 +189,13 @@ png_format_number(png_const_charp start, png_charp end, int format,
++count;
/* Float a fixed number here: */
if (format == PNG_NUMBER_FORMAT_fixed) if (count == 5) if (end > start)
if ((format == PNG_NUMBER_FORMAT_fixed) && (count == 5) && (end > start))
{
/* End of the fraction, but maybe nothing was output? In that case
* drop the decimal point. If the number is a true zero handle that
* here.
*/
if (output)
if (output != 0)
*--end = '.';
else if (number == 0) /* and !output */
*--end = '0';
@ -219,8 +219,8 @@ png_warning(png_const_structrp png_ptr, png_const_charp warning_message)
if (png_ptr != NULL)
{
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
if (png_ptr->flags&
(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
if ((png_ptr->flags &
(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0)
#endif
{
if (*warning_message == PNG_LITERAL_SHARP)
@ -355,13 +355,13 @@ png_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p,
*/
png_warning(png_ptr, msg);
}
#endif /* PNG_WARNINGS_SUPPORTED */
#endif /* WARNINGS */
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
void PNGAPI
png_benign_error(png_const_structrp png_ptr, png_const_charp error_message)
{
if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN)
if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0)
{
# ifdef PNG_READ_SUPPORTED
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
@ -382,31 +382,46 @@ png_benign_error(png_const_structrp png_ptr, png_const_charp error_message)
# endif
png_error(png_ptr, error_message);
}
# ifndef PNG_ERROR_TEXT_SUPPORTED
PNG_UNUSED(error_message)
# endif
}
void /* PRIVATE */
png_app_warning(png_const_structrp png_ptr, png_const_charp error_message)
{
if (png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN)
if ((png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN) != 0)
png_warning(png_ptr, error_message);
else
png_error(png_ptr, error_message);
# ifndef PNG_ERROR_TEXT_SUPPORTED
PNG_UNUSED(error_message)
# endif
}
void /* PRIVATE */
png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
{
if (png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN)
if ((png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN) != 0)
png_warning(png_ptr, error_message);
else
png_error(png_ptr, error_message);
# ifndef PNG_ERROR_TEXT_SUPPORTED
PNG_UNUSED(error_message)
# endif
}
#endif /* BENIGN_ERRORS */
#define PNG_MAX_ERROR_TEXT 196 /* Currently limited by profile_error in png.c */
#if defined(PNG_WARNINGS_SUPPORTED) || \
(defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED))
/* These utilities are used internally to build an error message that relates
* to the current chunk. The chunk name comes from png_ptr->chunk_name,
* this is used to prefix the message. The message is limited in length
* to 63 bytes, the name characters are output as hex digits wrapped in []
* which is used to prefix the message. The message is limited in length
* to 63 bytes. The name characters are output as hex digits wrapped in []
* if the character is invalid.
*/
#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
@ -415,8 +430,6 @@ static PNG_CONST char png_digit[16] = {
'A', 'B', 'C', 'D', 'E', 'F'
};
#define PNG_MAX_ERROR_TEXT 196 /* Currently limited be profile_error in png.c */
#if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_ERROR_TEXT_SUPPORTED)
static void /* PRIVATE */
png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp
error_message)
@ -429,7 +442,7 @@ png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp
int c = (int)(chunk_name >> ishift) & 0xff;
ishift -= 8;
if (isnonalpha(c))
if (isnonalpha(c) != 0)
{
buffer[iout++] = PNG_LITERAL_LEFT_SQUARE_BRACKET;
buffer[iout++] = png_digit[(c & 0xf0) >> 4];
@ -460,7 +473,7 @@ png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp
buffer[iout] = '\0';
}
}
#endif /* PNG_WARNINGS_SUPPORTED || PNG_ERROR_TEXT_SUPPORTED */
#endif /* WARNINGS || ERROR_TEXT */
#if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
PNG_FUNCTION(void,PNGAPI
@ -477,7 +490,7 @@ png_chunk_error,(png_const_structrp png_ptr, png_const_charp error_message),
png_error(png_ptr, msg);
}
}
#endif /* PNG_READ_SUPPORTED && PNG_ERROR_TEXT_SUPPORTED */
#endif /* READ && ERROR_TEXT */
#ifdef PNG_WARNINGS_SUPPORTED
void PNGAPI
@ -493,7 +506,7 @@ png_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message)
png_warning(png_ptr, msg);
}
}
#endif /* PNG_WARNINGS_SUPPORTED */
#endif /* WARNINGS */
#ifdef PNG_READ_SUPPORTED
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
@ -501,23 +514,31 @@ void PNGAPI
png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp
error_message)
{
if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN)
if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0)
png_chunk_warning(png_ptr, error_message);
else
png_chunk_error(png_ptr, error_message);
# ifndef PNG_ERROR_TEXT_SUPPORTED
PNG_UNUSED(error_message)
# endif
}
#endif
#endif /* PNG_READ_SUPPORTED */
#endif /* READ */
void /* PRIVATE */
png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
{
# ifndef PNG_WARNINGS_SUPPORTED
PNG_UNUSED(message)
# endif
/* This is always supported, but for just read or just write it
* unconditionally does the right thing.
*/
# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)
if (png_ptr->mode & PNG_IS_READ_STRUCT)
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)
# endif
# ifdef PNG_READ_SUPPORTED
@ -531,7 +552,7 @@ png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
# endif
# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)
else if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
else if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0)
# endif
# ifdef PNG_WRITE_SUPPORTED
@ -556,11 +577,12 @@ png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN)
char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT];
memcpy(msg, fixed_message, fixed_message_ln);
iin = 0;
if (name != NULL) while (iin < (PNG_MAX_ERROR_TEXT-1) && name[iin] != 0)
{
msg[fixed_message_ln + iin] = name[iin];
++iin;
}
if (name != NULL)
while (iin < (PNG_MAX_ERROR_TEXT-1) && name[iin] != 0)
{
msg[fixed_message_ln + iin] = name[iin];
++iin;
}
msg[fixed_message_ln + iin] = 0;
png_error(png_ptr, msg);
}
@ -736,11 +758,20 @@ PNG_FUNCTION(void,PNGAPI
png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN)
{
#ifdef PNG_SETJMP_SUPPORTED
if (png_ptr && png_ptr->longjmp_fn && png_ptr->jmp_buf_ptr)
if (png_ptr != NULL && png_ptr->longjmp_fn != NULL &&
png_ptr->jmp_buf_ptr != NULL)
png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val);
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(val)
#endif
/* Here if not setjmp support or if png_ptr is null. */
/* If control reaches this point, png_longjmp() must not return. The only
* choice is to terminate the whole process (or maybe the thread); to do
* this the ANSI-C abort() function is used unless a different method is
* implemented by overriding the default configuration setting for
* PNG_ABORT().
*/
PNG_ABORT();
}
@ -793,7 +824,7 @@ png_default_warning(png_const_structrp png_ptr, png_const_charp warning_message)
#endif
PNG_UNUSED(png_ptr) /* Make compiler happy */
}
#endif /* PNG_WARNINGS_SUPPORTED */
#endif /* WARNINGS */
/* This function is called when the application wants to use another method
* of handling errors and warnings. Note that the error function MUST NOT
@ -850,8 +881,8 @@ png_set_strip_error_numbers(png_structrp png_ptr, png_uint_32 strip_mode)
* possible to implement without setjmp support just so long as there is some
* way to handle the error return here:
*/
PNG_FUNCTION(void /* PRIVATE */,
png_safe_error,(png_structp png_nonconst_ptr, png_const_charp error_message),
PNG_FUNCTION(void /* PRIVATE */, (PNGCBAPI
png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),
PNG_NORETURN)
{
const png_const_structrp png_ptr = png_nonconst_ptr;
@ -886,7 +917,7 @@ png_safe_error,(png_structp png_nonconst_ptr, png_const_charp error_message),
}
#ifdef PNG_WARNINGS_SUPPORTED
void /* PRIVATE */
void /* PRIVATE */ PNGCBAPI
png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)
{
const png_const_structrp png_ptr = png_nonconst_ptr;
@ -913,7 +944,7 @@ png_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg)
saved_error_buf = image->opaque->error_buf;
result = setjmp(safe_jmpbuf) == 0;
if (result)
if (result != 0)
{
image->opaque->error_buf = safe_jmpbuf;
@ -923,10 +954,10 @@ png_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg)
image->opaque->error_buf = saved_error_buf;
/* And do the cleanup prior to any failure return. */
if (!result)
if (result == 0)
png_image_free(image);
return result;
}
#endif /* SIMPLIFIED READ/WRITE */
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
#endif /* SIMPLIFIED READ || SIMPLIFIED_WRITE */
#endif /* READ || WRITE */

View File

@ -1,8 +1,8 @@
/* pngget.c - retrieval of values from info struct
*
* Last changed in libpng 1.6.1 [March 28, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 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.)
*
@ -116,7 +116,8 @@ png_get_x_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
info_ptr)
{
#ifdef PNG_pHYs_SUPPORTED
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
png_debug1(1, "in %s retrieval function",
"png_get_x_pixels_per_meter");
@ -124,6 +125,9 @@ png_get_x_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)
return (info_ptr->x_pixels_per_unit);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@ -134,7 +138,8 @@ png_get_y_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
info_ptr)
{
#ifdef PNG_pHYs_SUPPORTED
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
png_debug1(1, "in %s retrieval function",
"png_get_y_pixels_per_meter");
@ -142,6 +147,9 @@ png_get_y_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)
return (info_ptr->y_pixels_per_unit);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@ -151,7 +159,8 @@ png_uint_32 PNGAPI
png_get_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_pHYs_SUPPORTED
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
png_debug1(1, "in %s retrieval function", "png_get_pixels_per_meter");
@ -159,6 +168,9 @@ png_get_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp info_ptr)
info_ptr->x_pixels_per_unit == info_ptr->y_pixels_per_unit)
return (info_ptr->x_pixels_per_unit);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@ -170,7 +182,8 @@ png_get_pixel_aspect_ratio(png_const_structrp png_ptr, png_const_inforp
info_ptr)
{
#ifdef PNG_READ_pHYs_SUPPORTED
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio");
@ -193,10 +206,11 @@ png_get_pixel_aspect_ratio_fixed(png_const_structrp png_ptr,
png_const_inforp info_ptr)
{
#ifdef PNG_READ_pHYs_SUPPORTED
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)
&& info_ptr->x_pixels_per_unit > 0 && info_ptr->y_pixels_per_unit > 0
&& info_ptr->x_pixels_per_unit <= PNG_UINT_31_MAX
&& info_ptr->y_pixels_per_unit <= PNG_UINT_31_MAX)
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0 &&
info_ptr->x_pixels_per_unit > 0 && info_ptr->y_pixels_per_unit > 0 &&
info_ptr->x_pixels_per_unit <= PNG_UINT_31_MAX &&
info_ptr->y_pixels_per_unit <= PNG_UINT_31_MAX)
{
png_fixed_point res;
@ -206,7 +220,7 @@ png_get_pixel_aspect_ratio_fixed(png_const_structrp png_ptr,
* range of 0..2^31-1; otherwise the cast might overflow.
*/
if (png_muldiv(&res, (png_int_32)info_ptr->y_pixels_per_unit, PNG_FP_1,
(png_int_32)info_ptr->x_pixels_per_unit))
(png_int_32)info_ptr->x_pixels_per_unit) != 0)
return res;
}
#else
@ -222,13 +236,17 @@ png_int_32 PNGAPI
png_get_x_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_oFFs_SUPPORTED
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_oFFs) != 0)
{
png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns");
if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER)
return (info_ptr->x_offset);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@ -238,13 +256,17 @@ png_int_32 PNGAPI
png_get_y_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_oFFs_SUPPORTED
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_oFFs) != 0)
{
png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns");
if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER)
return (info_ptr->y_offset);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@ -254,13 +276,17 @@ png_int_32 PNGAPI
png_get_x_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_oFFs_SUPPORTED
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_oFFs) != 0)
{
png_debug1(1, "in %s retrieval function", "png_get_x_offset_pixels");
if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL)
return (info_ptr->x_offset);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@ -270,13 +296,17 @@ png_int_32 PNGAPI
png_get_y_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_oFFs_SUPPORTED
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_oFFs) != 0)
{
png_debug1(1, "in %s retrieval function", "png_get_y_offset_pixels");
if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL)
return (info_ptr->y_offset);
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return (0);
@ -307,7 +337,7 @@ ppi_from_ppm(png_uint_32 ppm)
*/
png_fixed_point result;
if (ppm <= PNG_UINT_31_MAX && png_muldiv(&result, (png_int_32)ppm, 127,
5000))
5000) != 0)
return result;
/* Overflow. */
@ -393,7 +423,8 @@ png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr,
{
png_uint_32 retval = 0;
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
png_debug1(1, "in %s retrieval function", "pHYs");
@ -424,12 +455,12 @@ png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr,
return (retval);
}
#endif /* PNG_pHYs_SUPPORTED */
#endif /* PNG_INCH_CONVERSIONS_SUPPORTED */
#endif /* pHYs */
#endif /* INCH_CONVERSIONS */
/* png_get_channels really belongs in here, too, but it's been around longer */
#endif /* PNG_EASY_ACCESS_SUPPORTED */
#endif /* EASY_ACCESS */
png_byte PNGAPI
@ -457,8 +488,9 @@ png_uint_32 PNGAPI
png_get_bKGD(png_const_structrp png_ptr, png_inforp info_ptr,
png_color_16p *background)
{
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)
&& background != NULL)
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_bKGD) != 0 &&
background != NULL)
{
png_debug1(1, "in %s retrieval function", "bKGD");
@ -488,7 +520,7 @@ png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr,
* consistent.
*/
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS))
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
{
png_debug1(1, "in %s retrieval function", "cHRM");
@ -529,7 +561,7 @@ png_get_cHRM_XYZ(png_const_structrp png_ptr, png_const_inforp info_ptr,
double *blue_Z)
{
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS))
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
{
png_debug1(1, "in %s retrieval function", "cHRM_XYZ(float)");
@ -577,7 +609,7 @@ png_get_cHRM_XYZ_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
png_fixed_point *int_blue_Z)
{
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS))
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
{
png_debug1(1, "in %s retrieval function", "cHRM_XYZ");
@ -614,7 +646,7 @@ png_get_cHRM_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
png_debug1(1, "in %s retrieval function", "cHRM");
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS))
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
{
if (white_x != NULL)
*white_x = info_ptr->colorspace.end_points_xy.whitex;
@ -649,7 +681,7 @@ png_get_gAMA_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
png_debug1(1, "in %s retrieval function", "gAMA");
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 &&
file_gamma != NULL)
{
*file_gamma = info_ptr->colorspace.gamma;
@ -668,7 +700,7 @@ png_get_gAMA(png_const_structrp png_ptr, png_const_inforp info_ptr,
png_debug1(1, "in %s retrieval function", "gAMA(float)");
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 &&
file_gamma != NULL)
{
*file_gamma = png_float(png_ptr, info_ptr->colorspace.gamma,
@ -688,8 +720,8 @@ png_get_sRGB(png_const_structrp png_ptr, png_const_inforp info_ptr,
{
png_debug1(1, "in %s retrieval function", "sRGB");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)
&& file_srgb_intent != NULL)
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sRGB) != 0 && file_srgb_intent != NULL)
{
*file_srgb_intent = info_ptr->colorspace.rendering_intent;
return (PNG_INFO_sRGB);
@ -707,9 +739,10 @@ png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_debug1(1, "in %s retrieval function", "iCCP");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)
&& name != NULL && compression_type != NULL && profile != NULL &&
proflen != NULL)
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_iCCP) != 0 &&
name != NULL && compression_type != NULL && profile != NULL &&
proflen != NULL)
{
*name = info_ptr->iccp_name;
*profile = info_ptr->iccp_profile;
@ -747,8 +780,8 @@ png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_debug1(1, "in %s retrieval function", "hIST");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST)
&& hist != NULL)
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_hIST) != 0 && hist != NULL)
{
*hist = info_ptr->hist;
return (PNG_INFO_hIST);
@ -766,14 +799,20 @@ png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr,
{
png_debug1(1, "in %s retrieval function", "IHDR");
if (png_ptr == NULL || info_ptr == NULL || width == NULL ||
height == NULL || bit_depth == NULL || color_type == NULL)
if (png_ptr == NULL || info_ptr == NULL)
return (0);
*width = info_ptr->width;
*height = info_ptr->height;
*bit_depth = info_ptr->bit_depth;
*color_type = info_ptr->color_type;
if (width != NULL)
*width = info_ptr->width;
if (height != NULL)
*height = info_ptr->height;
if (bit_depth != NULL)
*bit_depth = info_ptr->bit_depth;
if (color_type != NULL)
*color_type = info_ptr->color_type;
if (compression_type != NULL)
*compression_type = info_ptr->compression_type;
@ -803,8 +842,9 @@ png_get_oFFs(png_const_structrp png_ptr, png_const_inforp info_ptr,
{
png_debug1(1, "in %s retrieval function", "oFFs");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs)
&& offset_x != NULL && offset_y != NULL && unit_type != NULL)
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_oFFs) != 0 &&
offset_x != NULL && offset_y != NULL && unit_type != NULL)
{
*offset_x = info_ptr->x_offset;
*offset_y = info_ptr->y_offset;
@ -824,8 +864,9 @@ png_get_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_debug1(1, "in %s retrieval function", "pCAL");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL)
&& purpose != NULL && X0 != NULL && X1 != NULL && type != NULL &&
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pCAL) != 0 &&
purpose != NULL && X0 != NULL && X1 != NULL && type != NULL &&
nparams != NULL && units != NULL && params != NULL)
{
*purpose = info_ptr->pcal_purpose;
@ -851,7 +892,7 @@ png_get_sCAL_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
int *unit, png_fixed_point *width, png_fixed_point *height)
{
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sCAL))
(info_ptr->valid & PNG_INFO_sCAL) != 0)
{
*unit = info_ptr->scal_unit;
/*TODO: make this work without FP support; the API is currently eliminated
@ -874,7 +915,7 @@ png_get_sCAL(png_const_structrp png_ptr, png_const_inforp info_ptr,
int *unit, double *width, double *height)
{
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sCAL))
(info_ptr->valid & PNG_INFO_sCAL) != 0)
{
*unit = info_ptr->scal_unit;
*width = atof(info_ptr->scal_s_width);
@ -890,7 +931,7 @@ png_get_sCAL_s(png_const_structrp png_ptr, png_const_inforp info_ptr,
int *unit, png_charpp width, png_charpp height)
{
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sCAL))
(info_ptr->valid & PNG_INFO_sCAL) != 0)
{
*unit = info_ptr->scal_unit;
*width = info_ptr->scal_s_width;
@ -912,7 +953,7 @@ png_get_pHYs(png_const_structrp png_ptr, png_const_inforp info_ptr,
png_debug1(1, "in %s retrieval function", "pHYs");
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs))
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
if (res_x != NULL)
{
@ -943,8 +984,8 @@ png_get_PLTE(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_debug1(1, "in %s retrieval function", "PLTE");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE)
&& palette != NULL)
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_PLTE) != 0 && palette != NULL)
{
*palette = info_ptr->palette;
*num_palette = info_ptr->num_palette;
@ -962,8 +1003,8 @@ png_get_sBIT(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_debug1(1, "in %s retrieval function", "sBIT");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT)
&& sig_bit != NULL)
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sBIT) != 0 && sig_bit != NULL)
{
*sig_bit = &(info_ptr->sig_bit);
return (PNG_INFO_sBIT);
@ -1006,8 +1047,8 @@ png_get_tIME(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_debug1(1, "in %s retrieval function", "tIME");
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME)
&& mod_time != NULL)
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_tIME) != 0 && mod_time != NULL)
{
*mod_time = &(info_ptr->mod_time);
return (PNG_INFO_tIME);
@ -1023,7 +1064,8 @@ png_get_tRNS(png_const_structrp png_ptr, png_inforp info_ptr,
png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)
{
png_uint_32 retval = 0;
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_tRNS) != 0)
{
png_debug1(1, "in %s retrieval function", "tRNS");
@ -1099,21 +1141,21 @@ png_get_compression_buffer_size(png_const_structrp png_ptr)
if (png_ptr == NULL)
return 0;
# ifdef PNG_WRITE_SUPPORTED
if (png_ptr->mode & PNG_IS_READ_STRUCT)
# endif
#ifdef PNG_WRITE_SUPPORTED
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)
#endif
{
# ifdef PNG_SEQUENTIAL_READ_SUPPORTED
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
return png_ptr->IDAT_read_size;
# else
#else
return PNG_IDAT_READ_SIZE;
# endif
#endif
}
# ifdef PNG_WRITE_SUPPORTED
#ifdef PNG_WRITE_SUPPORTED
else
return png_ptr->zbuffer_size;
# endif
#endif
}
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
@ -1144,7 +1186,7 @@ png_get_chunk_malloc_max (png_const_structrp png_ptr)
{
return (png_ptr ? png_ptr->user_chunk_malloc_max : 0);
}
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
#endif /* SET_USER_LIMITS */
/* These functions were added to libpng 1.4.0 */
#ifdef PNG_IO_STATE_SUPPORTED
@ -1159,7 +1201,7 @@ png_get_io_chunk_type (png_const_structrp png_ptr)
{
return png_ptr->chunk_name;
}
#endif /* ?PNG_IO_STATE_SUPPORTED */
#endif /* IO_STATE */
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
# ifdef PNG_GET_PALETTE_MAX_SUPPORTED
@ -1174,4 +1216,4 @@ png_get_palette_max(png_const_structp png_ptr, png_const_infop info_ptr)
# endif
#endif
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
#endif /* READ || WRITE */

View File

@ -1,12 +1,11 @@
/* pnginfo.h - header file for PNG reference library
*
* Last changed in libpng 1.6.1 [March 28, 2013]
* Copyright (c) 1998-2013 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.)
*
* Last changed in libpng 1.6.1 [March 28, 2013]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@ -121,7 +120,7 @@ struct png_info_def
int num_text; /* number of comments read or comments to write */
int max_text; /* current size of text array */
png_textp text; /* array of comments read or comments to write */
#endif /* PNG_TEXT_SUPPORTED */
#endif /* TEXT */
#ifdef PNG_tIME_SUPPORTED
/* The tIME chunk holds the last time the displayed image data was

View File

@ -1,453 +0,0 @@
/* pnglibconf.h - library build configuration */
/* libpng version 1.6.2 - April 25, 2013 */
/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
/* For conditions of distribution and use, see the disclaimer */
/* and license in png.h */
/* pnglibconf.h */
/* Machine generated file: DO NOT EDIT */
/* Derived from: scripts/pnglibconf.dfa */
#ifndef PNGLCONF_H
#define PNGLCONF_H
/* options */
#define PNG_16BIT_SUPPORTED
#define PNG_ALIGNED_MEMORY_SUPPORTED
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
/*#undef PNG_ARM_NEON_SUPPORTED*/
#define PNG_BENIGN_ERRORS_SUPPORTED
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_COLORSPACE_SUPPORTED
#define PNG_CONSOLE_IO_SUPPORTED
#define PNG_CONVERT_tIME_SUPPORTED
#define PNG_EASY_ACCESS_SUPPORTED
/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
#define PNG_ERROR_TEXT_SUPPORTED
#define PNG_FIXED_POINT_SUPPORTED
#define PNG_FLOATING_ARITHMETIC_SUPPORTED
#define PNG_FLOATING_POINT_SUPPORTED
#define PNG_FORMAT_AFIRST_SUPPORTED
#define PNG_FORMAT_BGR_SUPPORTED
#define PNG_GAMMA_SUPPORTED
#define PNG_GET_PALETTE_MAX_SUPPORTED
#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
#define PNG_INCH_CONVERSIONS_SUPPORTED
#define PNG_INFO_IMAGE_SUPPORTED
#define PNG_IO_STATE_SUPPORTED
#define PNG_MNG_FEATURES_SUPPORTED
#define PNG_POINTER_INDEXING_SUPPORTED
#define PNG_PROGRESSIVE_READ_SUPPORTED
#define PNG_READ_16BIT_SUPPORTED
#define PNG_READ_ALPHA_MODE_SUPPORTED
#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_READ_BACKGROUND_SUPPORTED
#define PNG_READ_BGR_SUPPORTED
#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
#define PNG_READ_COMPRESSED_TEXT_SUPPORTED
#define PNG_READ_EXPAND_16_SUPPORTED
#define PNG_READ_EXPAND_SUPPORTED
#define PNG_READ_FILLER_SUPPORTED
#define PNG_READ_GAMMA_SUPPORTED
#define PNG_READ_GET_PALETTE_MAX_SUPPORTED
#define PNG_READ_GRAY_TO_RGB_SUPPORTED
#define PNG_READ_INTERLACING_SUPPORTED
#define PNG_READ_INT_FUNCTIONS_SUPPORTED
#define PNG_READ_INVERT_ALPHA_SUPPORTED
#define PNG_READ_INVERT_SUPPORTED
#define PNG_READ_OPT_PLTE_SUPPORTED
#define PNG_READ_PACKSWAP_SUPPORTED
#define PNG_READ_PACK_SUPPORTED
#define PNG_READ_QUANTIZE_SUPPORTED
#define PNG_READ_RGB_TO_GRAY_SUPPORTED
#define PNG_READ_SCALE_16_TO_8_SUPPORTED
#define PNG_READ_SHIFT_SUPPORTED
#define PNG_READ_STRIP_16_TO_8_SUPPORTED
#define PNG_READ_STRIP_ALPHA_SUPPORTED
#define PNG_READ_SUPPORTED
#define PNG_READ_SWAP_ALPHA_SUPPORTED
#define PNG_READ_SWAP_SUPPORTED
#define PNG_READ_TEXT_SUPPORTED
#define PNG_READ_TRANSFORMS_SUPPORTED
#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_READ_USER_CHUNKS_SUPPORTED
#define PNG_READ_USER_TRANSFORM_SUPPORTED
#define PNG_READ_bKGD_SUPPORTED
#define PNG_READ_cHRM_SUPPORTED
#define PNG_READ_gAMA_SUPPORTED
#define PNG_READ_hIST_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED
#define PNG_READ_iTXt_SUPPORTED
#define PNG_READ_oFFs_SUPPORTED
#define PNG_READ_pCAL_SUPPORTED
#define PNG_READ_pHYs_SUPPORTED
#define PNG_READ_sBIT_SUPPORTED
#define PNG_READ_sCAL_SUPPORTED
#define PNG_READ_sPLT_SUPPORTED
#define PNG_READ_sRGB_SUPPORTED
#define PNG_READ_tEXt_SUPPORTED
#define PNG_READ_tIME_SUPPORTED
#define PNG_READ_tRNS_SUPPORTED
#define PNG_READ_zTXt_SUPPORTED
/*#undef PNG_SAFE_LIMITS_SUPPORTED*/
#define PNG_SAVE_INT_32_SUPPORTED
#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_SEQUENTIAL_READ_SUPPORTED
#define PNG_SETJMP_SUPPORTED
#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
/*#undef PNG_SET_OPTION_SUPPORTED*/
#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_SET_USER_LIMITS_SUPPORTED
#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED
#define PNG_SIMPLIFIED_READ_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_SUPPORTED
#define PNG_STDIO_SUPPORTED
#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_TEXT_SUPPORTED
#define PNG_TIME_RFC1123_SUPPORTED
#define PNG_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_USER_CHUNKS_SUPPORTED
#define PNG_USER_LIMITS_SUPPORTED
#define PNG_USER_MEM_SUPPORTED
#define PNG_USER_TRANSFORM_INFO_SUPPORTED
#define PNG_USER_TRANSFORM_PTR_SUPPORTED
#define PNG_WARNINGS_SUPPORTED
#define PNG_WRITE_16BIT_SUPPORTED
#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_WRITE_BGR_SUPPORTED
#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
#define PNG_WRITE_FILLER_SUPPORTED
#define PNG_WRITE_FILTER_SUPPORTED
#define PNG_WRITE_FLUSH_SUPPORTED
#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED
#define PNG_WRITE_INTERLACING_SUPPORTED
#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
#define PNG_WRITE_INVERT_SUPPORTED
#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
#define PNG_WRITE_PACKSWAP_SUPPORTED
#define PNG_WRITE_PACK_SUPPORTED
#define PNG_WRITE_SHIFT_SUPPORTED
#define PNG_WRITE_SUPPORTED
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
#define PNG_WRITE_SWAP_SUPPORTED
#define PNG_WRITE_TEXT_SUPPORTED
#define PNG_WRITE_TRANSFORMS_SUPPORTED
#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_WRITE_USER_TRANSFORM_SUPPORTED
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_bKGD_SUPPORTED
#define PNG_WRITE_cHRM_SUPPORTED
#define PNG_WRITE_gAMA_SUPPORTED
#define PNG_WRITE_hIST_SUPPORTED
#define PNG_WRITE_iCCP_SUPPORTED
#define PNG_WRITE_iTXt_SUPPORTED
#define PNG_WRITE_oFFs_SUPPORTED
#define PNG_WRITE_pCAL_SUPPORTED
#define PNG_WRITE_pHYs_SUPPORTED
#define PNG_WRITE_sBIT_SUPPORTED
#define PNG_WRITE_sCAL_SUPPORTED
#define PNG_WRITE_sPLT_SUPPORTED
#define PNG_WRITE_sRGB_SUPPORTED
#define PNG_WRITE_tEXt_SUPPORTED
#define PNG_WRITE_tIME_SUPPORTED
#define PNG_WRITE_tRNS_SUPPORTED
#define PNG_WRITE_zTXt_SUPPORTED
#define PNG_bKGD_SUPPORTED
#define PNG_cHRM_SUPPORTED
#define PNG_gAMA_SUPPORTED
#define PNG_hIST_SUPPORTED
#define PNG_iCCP_SUPPORTED
#define PNG_iTXt_SUPPORTED
#define PNG_oFFs_SUPPORTED
#define PNG_pCAL_SUPPORTED
#define PNG_pHYs_SUPPORTED
#define PNG_sBIT_SUPPORTED
#define PNG_sCAL_SUPPORTED
#define PNG_sPLT_SUPPORTED
#define PNG_sRGB_SUPPORTED
#define PNG_tEXt_SUPPORTED
#define PNG_tIME_SUPPORTED
#define PNG_tRNS_SUPPORTED
#define PNG_zTXt_SUPPORTED
/* end of options */
/* settings */
#define PNG_API_RULE 0
#define PNG_CALLOC_SUPPORTED
#define PNG_COST_SHIFT 3
#define PNG_DEFAULT_READ_MACROS 1
#define PNG_GAMMA_THRESHOLD_FIXED 5000
#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
#define PNG_INFLATE_BUF_SIZE 1024
#define PNG_MAX_GAMMA_8 11
#define PNG_PREFIX wx_
#define PNG_QUANTIZE_BLUE_BITS 5
#define PNG_QUANTIZE_GREEN_BITS 5
#define PNG_QUANTIZE_RED_BITS 5
#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)
#define PNG_TEXT_Z_DEFAULT_STRATEGY 0
#define PNG_WEIGHT_SHIFT 8
#define PNG_ZBUF_SIZE 8192
#define PNG_Z_DEFAULT_COMPRESSION (-1)
#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0
#define PNG_Z_DEFAULT_STRATEGY 1
#define PNG_sCAL_PRECISION 5
#define PNG_sRGB_PROFILE_CHECKS 2
/* end of settings */
#define png_access_version_number wx_png_access_version_number
#define png_benign_error wx_png_benign_error
#define png_build_grayscale_palette wx_png_build_grayscale_palette
#define png_calloc wx_png_calloc
#define png_chunk_benign_error wx_png_chunk_benign_error
#define png_chunk_error wx_png_chunk_error
#define png_chunk_warning wx_png_chunk_warning
#define png_convert_from_struct_tm wx_png_convert_from_struct_tm
#define png_convert_from_time_t wx_png_convert_from_time_t
#define png_convert_to_rfc1123 wx_png_convert_to_rfc1123
#define png_convert_to_rfc1123_buffer wx_png_convert_to_rfc1123_buffer
#define png_create_info_struct wx_png_create_info_struct
#define png_create_read_struct wx_png_create_read_struct
#define png_create_read_struct_2 wx_png_create_read_struct_2
#define png_create_write_struct wx_png_create_write_struct
#define png_create_write_struct_2 wx_png_create_write_struct_2
#define png_data_freer wx_png_data_freer
#define png_destroy_info_struct wx_png_destroy_info_struct
#define png_destroy_read_struct wx_png_destroy_read_struct
#define png_destroy_write_struct wx_png_destroy_write_struct
#define png_error wx_png_error
#define png_free wx_png_free
#define png_free_data wx_png_free_data
#define png_free_default wx_png_free_default
#define png_get_IHDR wx_png_get_IHDR
#define png_get_PLTE wx_png_get_PLTE
#define png_get_bKGD wx_png_get_bKGD
#define png_get_bit_depth wx_png_get_bit_depth
#define png_get_cHRM wx_png_get_cHRM
#define png_get_cHRM_XYZ wx_png_get_cHRM_XYZ
#define png_get_cHRM_XYZ_fixed wx_png_get_cHRM_XYZ_fixed
#define png_get_cHRM_fixed wx_png_get_cHRM_fixed
#define png_get_channels wx_png_get_channels
#define png_get_chunk_cache_max wx_png_get_chunk_cache_max
#define png_get_chunk_malloc_max wx_png_get_chunk_malloc_max
#define png_get_color_type wx_png_get_color_type
#define png_get_compression_buffer_size wx_png_get_compression_buffer_size
#define png_get_compression_type wx_png_get_compression_type
#define png_get_copyright wx_png_get_copyright
#define png_get_current_pass_number wx_png_get_current_pass_number
#define png_get_current_row_number wx_png_get_current_row_number
#define png_get_error_ptr wx_png_get_error_ptr
#define png_get_filter_type wx_png_get_filter_type
#define png_get_gAMA wx_png_get_gAMA
#define png_get_gAMA_fixed wx_png_get_gAMA_fixed
#define png_get_hIST wx_png_get_hIST
#define png_get_header_ver wx_png_get_header_ver
#define png_get_header_version wx_png_get_header_version
#define png_get_iCCP wx_png_get_iCCP
#define png_get_image_height wx_png_get_image_height
#define png_get_image_width wx_png_get_image_width
#define png_get_int_32 wx_png_get_int_32
#define png_get_interlace_type wx_png_get_interlace_type
#define png_get_io_chunk_type wx_png_get_io_chunk_type
#define png_get_io_ptr wx_png_get_io_ptr
#define png_get_io_state wx_png_get_io_state
#define png_get_libpng_ver wx_png_get_libpng_ver
#define png_get_mem_ptr wx_png_get_mem_ptr
#define png_get_oFFs wx_png_get_oFFs
#define png_get_pCAL wx_png_get_pCAL
#define png_get_pHYs wx_png_get_pHYs
#define png_get_pHYs_dpi wx_png_get_pHYs_dpi
#define png_get_palette_max wx_png_get_palette_max
#define png_get_pixel_aspect_ratio wx_png_get_pixel_aspect_ratio
#define png_get_pixel_aspect_ratio_fixed wx_png_get_pixel_aspect_ratio_fixed
#define png_get_pixels_per_inch wx_png_get_pixels_per_inch
#define png_get_pixels_per_meter wx_png_get_pixels_per_meter
#define png_get_progressive_ptr wx_png_get_progressive_ptr
#define png_get_rgb_to_gray_status wx_png_get_rgb_to_gray_status
#define png_get_rowbytes wx_png_get_rowbytes
#define png_get_rows wx_png_get_rows
#define png_get_sBIT wx_png_get_sBIT
#define png_get_sCAL wx_png_get_sCAL
#define png_get_sCAL_fixed wx_png_get_sCAL_fixed
#define png_get_sCAL_s wx_png_get_sCAL_s
#define png_get_sPLT wx_png_get_sPLT
#define png_get_sRGB wx_png_get_sRGB
#define png_get_signature wx_png_get_signature
#define png_get_tIME wx_png_get_tIME
#define png_get_tRNS wx_png_get_tRNS
#define png_get_text wx_png_get_text
#define png_get_uint_16 wx_png_get_uint_16
#define png_get_uint_31 wx_png_get_uint_31
#define png_get_uint_32 wx_png_get_uint_32
#define png_get_unknown_chunks wx_png_get_unknown_chunks
#define png_get_user_chunk_ptr wx_png_get_user_chunk_ptr
#define png_get_user_height_max wx_png_get_user_height_max
#define png_get_user_transform_ptr wx_png_get_user_transform_ptr
#define png_get_user_width_max wx_png_get_user_width_max
#define png_get_valid wx_png_get_valid
#define png_get_x_offset_inches wx_png_get_x_offset_inches
#define png_get_x_offset_inches_fixed wx_png_get_x_offset_inches_fixed
#define png_get_x_offset_microns wx_png_get_x_offset_microns
#define png_get_x_offset_pixels wx_png_get_x_offset_pixels
#define png_get_x_pixels_per_inch wx_png_get_x_pixels_per_inch
#define png_get_x_pixels_per_meter wx_png_get_x_pixels_per_meter
#define png_get_y_offset_inches wx_png_get_y_offset_inches
#define png_get_y_offset_inches_fixed wx_png_get_y_offset_inches_fixed
#define png_get_y_offset_microns wx_png_get_y_offset_microns
#define png_get_y_offset_pixels wx_png_get_y_offset_pixels
#define png_get_y_pixels_per_inch wx_png_get_y_pixels_per_inch
#define png_get_y_pixels_per_meter wx_png_get_y_pixels_per_meter
#define png_handle_as_unknown wx_png_handle_as_unknown
#define png_image_begin_read_from_file wx_png_image_begin_read_from_file
#define png_image_begin_read_from_memory wx_png_image_begin_read_from_memory
#define png_image_begin_read_from_stdio wx_png_image_begin_read_from_stdio
#define png_image_finish_read wx_png_image_finish_read
#define png_image_free wx_png_image_free
#define png_image_write_to_file wx_png_image_write_to_file
#define png_image_write_to_stdio wx_png_image_write_to_stdio
#define png_info_init_3 wx_png_info_init_3
#define png_init_io wx_png_init_io
#define png_longjmp wx_png_longjmp
#define png_malloc wx_png_malloc
#define png_malloc_default wx_png_malloc_default
#define png_malloc_warn wx_png_malloc_warn
#define png_permit_mng_features wx_png_permit_mng_features
#define png_process_data wx_png_process_data
#define png_process_data_pause wx_png_process_data_pause
#define png_process_data_skip wx_png_process_data_skip
#define png_progressive_combine_row wx_png_progressive_combine_row
#define png_read_end wx_png_read_end
#define png_read_image wx_png_read_image
#define png_read_info wx_png_read_info
#define png_read_png wx_png_read_png
#define png_read_row wx_png_read_row
#define png_read_rows wx_png_read_rows
#define png_read_update_info wx_png_read_update_info
#define png_reset_zstream wx_png_reset_zstream
#define png_save_int_32 wx_png_save_int_32
#define png_save_uint_16 wx_png_save_uint_16
#define png_save_uint_32 wx_png_save_uint_32
#define png_set_IHDR wx_png_set_IHDR
#define png_set_PLTE wx_png_set_PLTE
#define png_set_add_alpha wx_png_set_add_alpha
#define png_set_alpha_mode wx_png_set_alpha_mode
#define png_set_alpha_mode_fixed wx_png_set_alpha_mode_fixed
#define png_set_bKGD wx_png_set_bKGD
#define png_set_background wx_png_set_background
#define png_set_background_fixed wx_png_set_background_fixed
#define png_set_benign_errors wx_png_set_benign_errors
#define png_set_bgr wx_png_set_bgr
#define png_set_cHRM wx_png_set_cHRM
#define png_set_cHRM_XYZ wx_png_set_cHRM_XYZ
#define png_set_cHRM_XYZ_fixed wx_png_set_cHRM_XYZ_fixed
#define png_set_cHRM_fixed wx_png_set_cHRM_fixed
#define png_set_check_for_invalid_index wx_png_set_check_for_invalid_index
#define png_set_chunk_cache_max wx_png_set_chunk_cache_max
#define png_set_chunk_malloc_max wx_png_set_chunk_malloc_max
#define png_set_compression_buffer_size wx_png_set_compression_buffer_size
#define png_set_compression_level wx_png_set_compression_level
#define png_set_compression_mem_level wx_png_set_compression_mem_level
#define png_set_compression_method wx_png_set_compression_method
#define png_set_compression_strategy wx_png_set_compression_strategy
#define png_set_compression_window_bits wx_png_set_compression_window_bits
#define png_set_crc_action wx_png_set_crc_action
#define png_set_error_fn wx_png_set_error_fn
#define png_set_expand wx_png_set_expand
#define png_set_expand_16 wx_png_set_expand_16
#define png_set_expand_gray_1_2_4_to_8 wx_png_set_expand_gray_1_2_4_to_8
#define png_set_filler wx_png_set_filler
#define png_set_filter wx_png_set_filter
#define png_set_filter_heuristics wx_png_set_filter_heuristics
#define png_set_filter_heuristics_fixed wx_png_set_filter_heuristics_fixed
#define png_set_flush wx_png_set_flush
#define png_set_gAMA wx_png_set_gAMA
#define png_set_gAMA_fixed wx_png_set_gAMA_fixed
#define png_set_gamma wx_png_set_gamma
#define png_set_gamma_fixed wx_png_set_gamma_fixed
#define png_set_gray_to_rgb wx_png_set_gray_to_rgb
#define png_set_hIST wx_png_set_hIST
#define png_set_iCCP wx_png_set_iCCP
#define png_set_interlace_handling wx_png_set_interlace_handling
#define png_set_invalid wx_png_set_invalid
#define png_set_invert_alpha wx_png_set_invert_alpha
#define png_set_invert_mono wx_png_set_invert_mono
#define png_set_keep_unknown_chunks wx_png_set_keep_unknown_chunks
#define png_set_longjmp_fn wx_png_set_longjmp_fn
#define png_set_mem_fn wx_png_set_mem_fn
#define png_set_oFFs wx_png_set_oFFs
#define png_set_pCAL wx_png_set_pCAL
#define png_set_pHYs wx_png_set_pHYs
#define png_set_packing wx_png_set_packing
#define png_set_packswap wx_png_set_packswap
#define png_set_palette_to_rgb wx_png_set_palette_to_rgb
#define png_set_progressive_read_fn wx_png_set_progressive_read_fn
#define png_set_quantize wx_png_set_quantize
#define png_set_read_fn wx_png_set_read_fn
#define png_set_read_status_fn wx_png_set_read_status_fn
#define png_set_read_user_chunk_fn wx_png_set_read_user_chunk_fn
#define png_set_read_user_transform_fn wx_png_set_read_user_transform_fn
#define png_set_rgb_to_gray wx_png_set_rgb_to_gray
#define png_set_rgb_to_gray_fixed wx_png_set_rgb_to_gray_fixed
#define png_set_rows wx_png_set_rows
#define png_set_sBIT wx_png_set_sBIT
#define png_set_sCAL wx_png_set_sCAL
#define png_set_sCAL_fixed wx_png_set_sCAL_fixed
#define png_set_sCAL_s wx_png_set_sCAL_s
#define png_set_sPLT wx_png_set_sPLT
#define png_set_sRGB wx_png_set_sRGB
#define png_set_sRGB_gAMA_and_cHRM wx_png_set_sRGB_gAMA_and_cHRM
#define png_set_scale_16 wx_png_set_scale_16
#define png_set_shift wx_png_set_shift
#define png_set_sig_bytes wx_png_set_sig_bytes
#define png_set_strip_16 wx_png_set_strip_16
#define png_set_strip_alpha wx_png_set_strip_alpha
#define png_set_swap wx_png_set_swap
#define png_set_swap_alpha wx_png_set_swap_alpha
#define png_set_tIME wx_png_set_tIME
#define png_set_tRNS wx_png_set_tRNS
#define png_set_tRNS_to_alpha wx_png_set_tRNS_to_alpha
#define png_set_text wx_png_set_text
#define png_set_text_compression_level wx_png_set_text_compression_level
#define png_set_text_compression_mem_level wx_png_set_text_compression_mem_level
#define png_set_text_compression_method wx_png_set_text_compression_method
#define png_set_text_compression_strategy wx_png_set_text_compression_strategy
#define png_set_text_compression_window_bits wx_png_set_text_compression_window_bits
#define png_set_unknown_chunk_location wx_png_set_unknown_chunk_location
#define png_set_unknown_chunks wx_png_set_unknown_chunks
#define png_set_user_limits wx_png_set_user_limits
#define png_set_user_transform_info wx_png_set_user_transform_info
#define png_set_write_fn wx_png_set_write_fn
#define png_set_write_status_fn wx_png_set_write_status_fn
#define png_set_write_user_transform_fn wx_png_set_write_user_transform_fn
#define png_sig_cmp wx_png_sig_cmp
#define png_start_read_image wx_png_start_read_image
#define png_warning wx_png_warning
#define png_write_chunk wx_png_write_chunk
#define png_write_chunk_data wx_png_write_chunk_data
#define png_write_chunk_end wx_png_write_chunk_end
#define png_write_chunk_start wx_png_write_chunk_start
#define png_write_end wx_png_write_end
#define png_write_flush wx_png_write_flush
#define png_write_image wx_png_write_image
#define png_write_info wx_png_write_info
#define png_write_info_before_PLTE wx_png_write_info_before_PLTE
#define png_write_png wx_png_write_png
#define png_write_row wx_png_write_row
#define png_write_rows wx_png_write_rows
#define png_write_sig wx_png_write_sig
#define wx_png_get_uint_32(buf) PNG_get_uint_32(buf)
#define wx_png_get_uint_16(buf) PNG_get_uint_16(buf)
#define wx_png_get_int_32(buf) PNG_get_int_32(buf)
#endif /* PNGLCONF_H */

View File

@ -1,8 +1,8 @@
/* pngmem.c - stub functions for memory allocation
*
* Last changed in libpng 1.6.0 [February 14, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.15 [November 20, 2014]
* Copyright (c) 1998-2014 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.)
*
@ -41,7 +41,7 @@ png_destroy_png_struct(png_structrp png_ptr)
}
/* Allocate memory. For reasonable files, size should never exceed
* 64K. However, zlib may allocate more then 64K if you don't tell
* 64K. However, zlib may allocate more than 64K if you don't tell
* it not to. See zconf.h and png.h for more information. zlib does
* need to allocate exactly 64K, so whatever you call here must
* have the ability to do that.
@ -73,9 +73,10 @@ png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),
* to implement a user memory handler. This checks to be sure it isn't
* called with big numbers.
*/
#ifdef PNG_USER_MEM_SUPPORTED
#ifndef PNG_USER_MEM_SUPPORTED
PNG_UNUSED(png_ptr)
#endif
if (size > 0 && size <= PNG_SIZE_MAX
# ifdef PNG_MAX_MALLOC_64K
&& size <= 65536U
@ -95,6 +96,8 @@ png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),
return NULL;
}
#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\
defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED)
/* This is really here only to work round a spurious warning in GCC 4.6 and 4.7
* that arises because of the checks in png_realloc_array that are repeated in
* png_malloc_array.
@ -156,6 +159,7 @@ png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array,
return NULL; /* error */
}
#endif /* TEXT || sPLT || STORE_UNKNOWN_CHUNKS */
/* Various functions that have different error handling are derived from this.
* png_malloc always exists, but if PNG_USER_MEM_SUPPORTED is defined a separate
@ -195,7 +199,7 @@ png_malloc_default,(png_const_structrp png_ptr, png_alloc_size_t size),
return ret;
}
#endif /* PNG_USER_MEM_SUPPORTED */
#endif /* USER_MEM */
/* This function was added at libpng version 1.2.3. The png_malloc_warn()
* function will issue a png_warning and return NULL instead of issuing a
@ -240,7 +244,7 @@ png_free_default,(png_const_structrp png_ptr, png_voidp ptr),PNG_DEPRECATED)
{
if (png_ptr == NULL || ptr == NULL)
return;
#endif /* PNG_USER_MEM_SUPPORTED */
#endif /* USER_MEM */
free(ptr);
}
@ -273,5 +277,5 @@ png_get_mem_ptr(png_const_structrp png_ptr)
return png_ptr->mem_ptr;
}
#endif /* PNG_USER_MEM_SUPPORTED */
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
#endif /* USER_MEM */
#endif /* READ || WRITE */

View File

@ -1,8 +1,8 @@
/* pngpread.c - read a png file in push mode
*
* Last changed in libpng 1.6.0 [February 14, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 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.)
*
@ -26,6 +26,13 @@
#define PNG_READ_iTXt_MODE 7
#define PNG_ERROR_MODE 8
#define PNG_PUSH_SAVE_BUFFER_IF_FULL \
if (png_ptr->push_length + 4 > png_ptr->buffer_size) \
{ png_push_save_buffer(png_ptr); return; }
#define PNG_PUSH_SAVE_BUFFER_IF_LT(N) \
if (png_ptr->buffer_size < N) \
{ png_push_save_buffer(png_ptr); return; }
void PNGAPI
png_process_data(png_structrp png_ptr, png_inforp info_ptr,
png_bytep buffer, png_size_t buffer_size)
@ -46,10 +53,10 @@ png_process_data_pause(png_structrp png_ptr, int save)
{
if (png_ptr != NULL)
{
/* It's easiest for the caller if we do the save, then the caller doesn't
/* It's easiest for the caller if we do the save; then the caller doesn't
* have to supply the same data again:
*/
if (save)
if (save != 0)
png_push_save_buffer(png_ptr);
else
{
@ -151,7 +158,7 @@ png_process_some_data(png_structrp png_ptr, png_inforp info_ptr)
void /* PRIVATE */
png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr)
{
png_size_t num_checked = png_ptr->sig_bytes,
png_size_t num_checked = png_ptr->sig_bytes, /* SAFE, does not exceed 8 */
num_to_check = 8 - num_checked;
if (png_ptr->buffer_size < num_to_check)
@ -189,23 +196,18 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
int keep; /* unknown handling method */
#endif
/* First we make sure we have enough data for the 4 byte chunk name
* and the 4 byte chunk length before proceeding with decoding the
/* First we make sure we have enough data for the 4-byte chunk name
* and the 4-byte chunk length before proceeding with decoding the
* chunk data. To fully decode each of these chunks, we also make
* sure we have enough data in the buffer for the 4 byte CRC at the
* sure we have enough data in the buffer for the 4-byte CRC at the
* end of every chunk (except IDAT, which is handled separately).
*/
if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0)
{
png_byte chunk_length[4];
png_byte chunk_tag[4];
if (png_ptr->buffer_size < 8)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_LT(8)
png_push_fill_buffer(png_ptr, chunk_length, 4);
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
png_reset_crc(png_ptr);
@ -219,27 +221,28 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
if (chunk_name == png_IDAT)
{
if (png_ptr->mode & PNG_AFTER_IDAT)
if ((png_ptr->mode & PNG_AFTER_IDAT) != 0)
png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
/* If we reach an IDAT chunk, this means we have read all of the
* header chunks, and we can start reading the image (or if this
* is called after the image has been read - we have an error).
*/
if (!(png_ptr->mode & PNG_HAVE_IHDR))
if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
png_error(png_ptr, "Missing IHDR before IDAT");
else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
!(png_ptr->mode & PNG_HAVE_PLTE))
(png_ptr->mode & PNG_HAVE_PLTE) == 0)
png_error(png_ptr, "Missing PLTE before IDAT");
png_ptr->mode |= PNG_HAVE_IDAT;
png_ptr->process_mode = PNG_READ_IDAT_MODE;
if (!(png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
if ((png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) == 0)
if (png_ptr->push_length == 0)
return;
if (png_ptr->mode & PNG_AFTER_IDAT)
if ((png_ptr->mode & PNG_AFTER_IDAT) != 0)
png_benign_error(png_ptr, "Too many IDATs found");
}
@ -248,23 +251,13 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
if (png_ptr->push_length != 13)
png_error(png_ptr, "Invalid IHDR length");
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length);
}
else if (chunk_name == png_IEND)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length);
png_ptr->process_mode = PNG_READ_DONE_MODE;
@ -274,26 +267,17 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, keep);
if (chunk_name == png_PLTE)
png_ptr->mode |= PNG_HAVE_PLTE;
}
#endif
else if (chunk_name == png_PLTE)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
}
@ -312,12 +296,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_gAMA_SUPPORTED
else if (png_ptr->chunk_name == png_gAMA)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length);
}
@ -325,12 +304,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_sBIT_SUPPORTED
else if (png_ptr->chunk_name == png_sBIT)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length);
}
@ -338,12 +312,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_cHRM_SUPPORTED
else if (png_ptr->chunk_name == png_cHRM)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
}
@ -351,12 +320,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_sRGB_SUPPORTED
else if (chunk_name == png_sRGB)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length);
}
@ -364,12 +328,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_iCCP_SUPPORTED
else if (png_ptr->chunk_name == png_iCCP)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length);
}
@ -377,12 +336,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_sPLT_SUPPORTED
else if (chunk_name == png_sPLT)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length);
}
@ -390,12 +344,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_tRNS_SUPPORTED
else if (chunk_name == png_tRNS)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length);
}
@ -403,12 +352,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_bKGD_SUPPORTED
else if (chunk_name == png_bKGD)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length);
}
@ -416,12 +360,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_hIST_SUPPORTED
else if (chunk_name == png_hIST)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length);
}
@ -429,12 +368,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_pHYs_SUPPORTED
else if (chunk_name == png_pHYs)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length);
}
@ -442,12 +376,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_oFFs_SUPPORTED
else if (chunk_name == png_oFFs)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length);
}
#endif
@ -455,12 +384,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_pCAL_SUPPORTED
else if (chunk_name == png_pCAL)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length);
}
@ -468,12 +392,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_sCAL_SUPPORTED
else if (chunk_name == png_sCAL)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length);
}
@ -481,12 +400,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_tIME_SUPPORTED
else if (chunk_name == png_tIME)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length);
}
@ -494,12 +408,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_tEXt_SUPPORTED
else if (chunk_name == png_tEXt)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
}
@ -507,12 +416,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_zTXt_SUPPORTED
else if (chunk_name == png_zTXt)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
}
@ -520,23 +424,14 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_iTXt_SUPPORTED
else if (chunk_name == png_iTXt)
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
}
#endif
else
{
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length,
PNG_HANDLE_CHUNK_AS_DEFAULT);
}
@ -554,7 +449,7 @@ png_push_crc_skip(png_structrp png_ptr, png_uint_32 skip)
void /* PRIVATE */
png_push_crc_finish(png_structrp png_ptr)
{
if (png_ptr->skip_length && png_ptr->save_buffer_size)
if (png_ptr->skip_length != 0 && png_ptr->save_buffer_size != 0)
{
png_size_t save_size = png_ptr->save_buffer_size;
png_uint_32 skip_length = png_ptr->skip_length;
@ -578,7 +473,7 @@ png_push_crc_finish(png_structrp png_ptr)
png_ptr->save_buffer_size -= save_size;
png_ptr->save_buffer_ptr += save_size;
}
if (png_ptr->skip_length && png_ptr->current_buffer_size)
if (png_ptr->skip_length != 0 && png_ptr->current_buffer_size != 0)
{
png_size_t save_size = png_ptr->current_buffer_size;
png_uint_32 skip_length = png_ptr->skip_length;
@ -599,14 +494,9 @@ png_push_crc_finish(png_structrp png_ptr)
png_ptr->current_buffer_size -= save_size;
png_ptr->current_buffer_ptr += save_size;
}
if (!png_ptr->skip_length)
if (png_ptr->skip_length == 0)
{
if (png_ptr->buffer_size < 4)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_LT(4)
png_crc_finish(png_ptr, 0);
png_ptr->process_mode = PNG_READ_CHUNK_MODE;
}
@ -621,7 +511,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
return;
ptr = buffer;
if (png_ptr->save_buffer_size)
if (png_ptr->save_buffer_size != 0)
{
png_size_t save_size;
@ -638,7 +528,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
png_ptr->save_buffer_size -= save_size;
png_ptr->save_buffer_ptr += save_size;
}
if (length && png_ptr->current_buffer_size)
if (length != 0 && png_ptr->current_buffer_size != 0)
{
png_size_t save_size;
@ -658,7 +548,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
void /* PRIVATE */
png_push_save_buffer(png_structrp png_ptr)
{
if (png_ptr->save_buffer_size)
if (png_ptr->save_buffer_size != 0)
{
if (png_ptr->save_buffer_ptr != png_ptr->save_buffer)
{
@ -694,11 +584,13 @@ png_push_save_buffer(png_structrp png_ptr)
if (png_ptr->save_buffer == NULL)
{
png_free(png_ptr, old_buffer);
old_buffer = NULL;
png_error(png_ptr, "Insufficient memory for save_buffer");
}
memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
png_free(png_ptr, old_buffer);
old_buffer = NULL;
png_ptr->save_buffer_max = new_max;
}
if (png_ptr->current_buffer_size)
@ -725,18 +617,13 @@ png_push_restore_buffer(png_structrp png_ptr, png_bytep buffer,
void /* PRIVATE */
png_push_read_IDAT(png_structrp png_ptr)
{
if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0)
{
png_byte chunk_length[4];
png_byte chunk_tag[4];
/* TODO: this code can be commoned up with the same code in push_read */
if (png_ptr->buffer_size < 8)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_LT(8)
png_push_fill_buffer(png_ptr, chunk_length, 4);
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
png_reset_crc(png_ptr);
@ -748,7 +635,7 @@ png_push_read_IDAT(png_structrp png_ptr)
{
png_ptr->process_mode = PNG_READ_CHUNK_MODE;
if (!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED))
if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0)
png_error(png_ptr, "Not enough compressed data");
return;
@ -757,7 +644,7 @@ png_push_read_IDAT(png_structrp png_ptr)
png_ptr->idat_size = png_ptr->push_length;
}
if (png_ptr->idat_size && png_ptr->save_buffer_size)
if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0)
{
png_size_t save_size = png_ptr->save_buffer_size;
png_uint_32 idat_size = png_ptr->idat_size;
@ -784,7 +671,7 @@ png_push_read_IDAT(png_structrp png_ptr)
png_ptr->save_buffer_ptr += save_size;
}
if (png_ptr->idat_size && png_ptr->current_buffer_size)
if (png_ptr->idat_size != 0 && png_ptr->current_buffer_size != 0)
{
png_size_t save_size = png_ptr->current_buffer_size;
png_uint_32 idat_size = png_ptr->idat_size;
@ -809,14 +696,9 @@ png_push_read_IDAT(png_structrp png_ptr)
png_ptr->current_buffer_size -= save_size;
png_ptr->current_buffer_ptr += save_size;
}
if (!png_ptr->idat_size)
if (png_ptr->idat_size == 0)
{
if (png_ptr->buffer_size < 4)
{
png_push_save_buffer(png_ptr);
return;
}
PNG_PUSH_SAVE_BUFFER_IF_LT(4)
png_crc_finish(png_ptr, 0);
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
png_ptr->mode |= PNG_AFTER_IDAT;
@ -844,7 +726,7 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
* or the stream marked as finished.
*/
while (png_ptr->zstream.avail_in > 0 &&
!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED))
(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0)
{
int ret;
@ -961,7 +843,7 @@ png_push_process_row(png_structrp png_ptr)
memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1);
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
if (png_ptr->transformations)
if (png_ptr->transformations != 0)
png_do_read_transformations(png_ptr, &row_info);
#endif
@ -978,15 +860,16 @@ png_push_process_row(png_structrp png_ptr)
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Blow up interlaced rows to full size */
if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
/* Expand interlaced rows to full size */
if (png_ptr->interlaced != 0 &&
(png_ptr->transformations & PNG_INTERLACE) != 0)
{
if (png_ptr->pass < 6)
png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass,
png_ptr->transformations);
switch (png_ptr->pass)
{
switch (png_ptr->pass)
{
case 0:
{
int i;
@ -1189,7 +1072,7 @@ png_read_push_finish_row(png_structrp png_ptr)
return;
#ifdef PNG_READ_INTERLACING_SUPPORTED
if (png_ptr->interlaced)
if (png_ptr->interlaced != 0)
{
png_ptr->row_number = 0;
memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
@ -1213,7 +1096,7 @@ png_read_push_finish_row(png_structrp png_ptr)
png_pass_start[png_ptr->pass]) /
png_pass_inc[png_ptr->pass];
if (png_ptr->transformations & PNG_INTERLACE)
if ((png_ptr->transformations & PNG_INTERLACE) != 0)
break;
png_ptr->num_rows = (png_ptr->height +
@ -1223,7 +1106,7 @@ png_read_push_finish_row(png_structrp png_ptr)
} while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0);
}
#endif /* PNG_READ_INTERLACING_SUPPORTED */
#endif /* READ_INTERLACING */
}
void /* PRIVATE */
@ -1261,9 +1144,9 @@ png_progressive_combine_row(png_const_structrp png_ptr, png_bytep old_row,
* it must be png_ptr->row_buf+1
*/
if (new_row != NULL)
png_combine_row(png_ptr, old_row, 1/*display*/);
png_combine_row(png_ptr, old_row, 1/*blocky display*/);
}
#endif /* PNG_READ_INTERLACING_SUPPORTED */
#endif /* READ_INTERLACING */
void PNGAPI
png_set_progressive_read_fn(png_structrp png_ptr, png_voidp progressive_ptr,
@ -1288,4 +1171,4 @@ png_get_progressive_ptr(png_const_structrp png_ptr)
return png_ptr->io_ptr;
}
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
#endif /* PROGRESSIVE_READ */

View File

@ -1,188 +0,0 @@
#define png_sRGB_table wx_png_sRGB_table
#define png_sRGB_base wx_png_sRGB_base
#define png_sRGB_delta wx_png_sRGB_delta
#define png_zstream_error wx_png_zstream_error
#define png_free_buffer_list wx_png_free_buffer_list
#define png_fixed wx_png_fixed
#define png_user_version_check wx_png_user_version_check
#define png_malloc_base wx_png_malloc_base
#define png_malloc_array wx_png_malloc_array
#define png_realloc_array wx_png_realloc_array
#define png_create_png_struct wx_png_create_png_struct
#define png_destroy_png_struct wx_png_destroy_png_struct
#define png_free_jmpbuf wx_png_free_jmpbuf
#define png_zalloc wx_png_zalloc
#define png_zfree wx_png_zfree
#define png_default_read_data wx_png_default_read_data
#define png_push_fill_buffer wx_png_push_fill_buffer
#define png_default_write_data wx_png_default_write_data
#define png_default_flush wx_png_default_flush
#define png_reset_crc wx_png_reset_crc
#define png_write_data wx_png_write_data
#define png_read_sig wx_png_read_sig
#define png_read_chunk_header wx_png_read_chunk_header
#define png_read_data wx_png_read_data
#define png_crc_read wx_png_crc_read
#define png_crc_finish wx_png_crc_finish
#define png_crc_error wx_png_crc_error
#define png_calculate_crc wx_png_calculate_crc
#define png_flush wx_png_flush
#define png_write_IHDR wx_png_write_IHDR
#define png_write_PLTE wx_png_write_PLTE
#define png_compress_IDAT wx_png_compress_IDAT
#define png_write_IEND wx_png_write_IEND
#define png_write_gAMA_fixed wx_png_write_gAMA_fixed
#define png_write_sBIT wx_png_write_sBIT
#define png_write_cHRM_fixed wx_png_write_cHRM_fixed
#define png_write_sRGB wx_png_write_sRGB
#define png_write_iCCP wx_png_write_iCCP
#define png_write_sPLT wx_png_write_sPLT
#define png_write_tRNS wx_png_write_tRNS
#define png_write_bKGD wx_png_write_bKGD
#define png_write_hIST wx_png_write_hIST
#define png_write_tEXt wx_png_write_tEXt
#define png_write_zTXt wx_png_write_zTXt
#define png_write_iTXt wx_png_write_iTXt
#define png_set_text_2 wx_png_set_text_2
#define png_write_oFFs wx_png_write_oFFs
#define png_write_pCAL wx_png_write_pCAL
#define png_write_pHYs wx_png_write_pHYs
#define png_write_tIME wx_png_write_tIME
#define png_write_sCAL_s wx_png_write_sCAL_s
#define png_write_finish_row wx_png_write_finish_row
#define png_write_start_row wx_png_write_start_row
#define png_combine_row wx_png_combine_row
#define png_do_read_interlace wx_png_do_read_interlace
#define png_do_write_interlace wx_png_do_write_interlace
#define png_read_filter_row wx_png_read_filter_row
#define png_read_filter_row_up_neon wx_png_read_filter_row_up_neon
#define png_read_filter_row_sub3_neon wx_png_read_filter_row_sub3_neon
#define png_read_filter_row_sub4_neon wx_png_read_filter_row_sub4_neon
#define png_read_filter_row_avg3_neon wx_png_read_filter_row_avg3_neon
#define png_read_filter_row_avg4_neon wx_png_read_filter_row_avg4_neon
#define png_read_filter_row_paeth3_neon wx_png_read_filter_row_paeth3_neon
#define png_read_filter_row_paeth4_neon wx_png_read_filter_row_paeth4_neon
#define png_write_find_filter wx_png_write_find_filter
#define png_read_IDAT_data wx_png_read_IDAT_data
#define png_read_finish_IDAT wx_png_read_finish_IDAT
#define png_read_finish_row wx_png_read_finish_row
#define png_read_start_row wx_png_read_start_row
#define png_read_transform_info wx_png_read_transform_info
#define png_do_read_filler wx_png_do_read_filler
#define png_do_read_swap_alpha wx_png_do_read_swap_alpha
#define png_do_write_swap_alpha wx_png_do_write_swap_alpha
#define png_do_read_invert_alpha wx_png_do_read_invert_alpha
#define png_do_write_invert_alpha wx_png_do_write_invert_alpha
#define png_do_strip_channel wx_png_do_strip_channel
#define png_do_swap wx_png_do_swap
#define png_do_packswap wx_png_do_packswap
#define png_do_rgb_to_gray wx_png_do_rgb_to_gray
#define png_do_gray_to_rgb wx_png_do_gray_to_rgb
#define png_do_unpack wx_png_do_unpack
#define png_do_unshift wx_png_do_unshift
#define png_do_invert wx_png_do_invert
#define png_do_scale_16_to_8 wx_png_do_scale_16_to_8
#define png_do_chop wx_png_do_chop
#define png_do_quantize wx_png_do_quantize
#define png_do_bgr wx_png_do_bgr
#define png_do_pack wx_png_do_pack
#define png_do_shift wx_png_do_shift
#define png_do_compose wx_png_do_compose
#define png_do_gamma wx_png_do_gamma
#define png_do_encode_alpha wx_png_do_encode_alpha
#define png_do_expand_palette wx_png_do_expand_palette
#define png_do_expand wx_png_do_expand
#define png_do_expand_16 wx_png_do_expand_16
#define png_handle_IHDR wx_png_handle_IHDR
#define png_handle_PLTE wx_png_handle_PLTE
#define png_handle_IEND wx_png_handle_IEND
#define png_handle_bKGD wx_png_handle_bKGD
#define png_handle_cHRM wx_png_handle_cHRM
#define png_handle_gAMA wx_png_handle_gAMA
#define png_handle_hIST wx_png_handle_hIST
#define png_handle_iCCP wx_png_handle_iCCP
#define png_handle_iTXt wx_png_handle_iTXt
#define png_handle_oFFs wx_png_handle_oFFs
#define png_handle_pCAL wx_png_handle_pCAL
#define png_handle_pHYs wx_png_handle_pHYs
#define png_handle_sBIT wx_png_handle_sBIT
#define png_handle_sCAL wx_png_handle_sCAL
#define png_handle_sPLT wx_png_handle_sPLT
#define png_handle_sRGB wx_png_handle_sRGB
#define png_handle_tEXt wx_png_handle_tEXt
#define png_handle_tIME wx_png_handle_tIME
#define png_handle_tRNS wx_png_handle_tRNS
#define png_handle_zTXt wx_png_handle_zTXt
#define png_check_chunk_name wx_png_check_chunk_name
#define png_handle_unknown wx_png_handle_unknown
#define png_chunk_unknown_handling wx_png_chunk_unknown_handling
#define png_do_read_transformations wx_png_do_read_transformations
#define png_do_write_transformations wx_png_do_write_transformations
#define png_init_read_transformations wx_png_init_read_transformations
#define png_push_read_chunk wx_png_push_read_chunk
#define png_push_read_sig wx_png_push_read_sig
#define png_push_check_crc wx_png_push_check_crc
#define png_push_crc_skip wx_png_push_crc_skip
#define png_push_crc_finish wx_png_push_crc_finish
#define png_push_save_buffer wx_png_push_save_buffer
#define png_push_restore_buffer wx_png_push_restore_buffer
#define png_push_read_IDAT wx_png_push_read_IDAT
#define png_process_IDAT_data wx_png_process_IDAT_data
#define png_push_process_row wx_png_push_process_row
#define png_push_handle_unknown wx_png_push_handle_unknown
#define png_push_have_info wx_png_push_have_info
#define png_push_have_end wx_png_push_have_end
#define png_push_have_row wx_png_push_have_row
#define png_push_read_end wx_png_push_read_end
#define png_process_some_data wx_png_process_some_data
#define png_read_push_finish_row wx_png_read_push_finish_row
#define png_push_handle_tEXt wx_png_push_handle_tEXt
#define png_push_read_tEXt wx_png_push_read_tEXt
#define png_push_handle_zTXt wx_png_push_handle_zTXt
#define png_push_read_zTXt wx_png_push_read_zTXt
#define png_push_handle_iTXt wx_png_push_handle_iTXt
#define png_push_read_iTXt wx_png_push_read_iTXt
#define png_do_read_intrapixel wx_png_do_read_intrapixel
#define png_do_write_intrapixel wx_png_do_write_intrapixel
#define png_colorspace_set_gamma wx_png_colorspace_set_gamma
#define png_colorspace_sync_info wx_png_colorspace_sync_info
#define png_colorspace_sync wx_png_colorspace_sync
#define png_colorspace_set_chromaticities wx_png_colorspace_set_chromaticities
#define png_colorspace_set_endpoints wx_png_colorspace_set_endpoints
#define png_colorspace_set_sRGB wx_png_colorspace_set_sRGB
#define png_colorspace_set_ICC wx_png_colorspace_set_ICC
#define png_icc_check_length wx_png_icc_check_length
#define png_icc_check_header wx_png_icc_check_header
#define png_icc_check_tag_table wx_png_icc_check_tag_table
#define png_icc_set_sRGB wx_png_icc_set_sRGB
#define png_colorspace_set_rgb_coefficients wx_png_colorspace_set_rgb_coefficients
#define png_check_IHDR wx_png_check_IHDR
#define png_do_check_palette_indexes wx_png_do_check_palette_indexes
#define png_fixed_error wx_png_fixed_error
#define png_safecat wx_png_safecat
#define png_format_number wx_png_format_number
#define png_warning_parameter wx_png_warning_parameter
#define png_warning_parameter_unsigned wx_png_warning_parameter_unsigned
#define png_warning_parameter_signed wx_png_warning_parameter_signed
#define png_formatted_warning wx_png_formatted_warning
#define png_app_warning wx_png_app_warning
#define png_app_error wx_png_app_error
#define png_chunk_report wx_png_chunk_report
#define png_ascii_from_fp wx_png_ascii_from_fp
#define png_ascii_from_fixed wx_png_ascii_from_fixed
#define png_check_fp_number wx_png_check_fp_number
#define png_check_fp_string wx_png_check_fp_string
#define png_muldiv wx_png_muldiv
#define png_muldiv_warn wx_png_muldiv_warn
#define png_reciprocal wx_png_reciprocal
#define png_reciprocal2 wx_png_reciprocal2
#define png_gamma_significant wx_png_gamma_significant
#define png_gamma_correct wx_png_gamma_correct
#define png_gamma_16bit_correct wx_png_gamma_16bit_correct
#define png_gamma_8bit_correct wx_png_gamma_8bit_correct
#define png_destroy_gamma_table wx_png_destroy_gamma_table
#define png_build_gamma_table wx_png_build_gamma_table
#define png_safe_error wx_png_safe_error
#define png_safe_warning wx_png_safe_warning
#define png_safe_execute wx_png_safe_execute
#define png_image_error wx_png_image_error

View File

@ -1,12 +1,11 @@
/* pngpriv.h - private declarations for use inside libpng
*
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 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.)
*
* Last changed in libpng 1.6.2 [April 25, 2013]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@ -87,6 +86,98 @@
# endif
#endif
/* Compile time options.
* =====================
* In a multi-arch build the compiler may compile the code several times for the
* same object module, producing different binaries for different architectures.
* When this happens configure-time setting of the target host options cannot be
* done and this interferes with the handling of the ARM NEON optimizations, and
* possibly other similar optimizations. Put additional tests here; in general
* this is needed when the same option can be changed at both compile time and
* run time depending on the target OS (i.e. iOS vs Android.)
*
* NOTE: symbol prefixing does not pass $(CFLAGS) to the preprocessor, because
* this is not possible with certain compilers (Oracle SUN OS CC), as a result
* it is necessary to ensure that all extern functions that *might* be used
* regardless of $(CFLAGS) get declared in this file. The test on __ARM_NEON__
* below is one example of this behavior because it is controlled by the
* presence or not of -mfpu=neon on the GCC command line, it is possible to do
* this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely
* do this.
*/
#ifndef PNG_ARM_NEON_OPT
/* ARM NEON optimizations are being controlled by the compiler settings,
* typically the target FPU. If the FPU has been set to NEON (-mfpu=neon
* with GCC) then the compiler will define __ARM_NEON__ and we can rely
* unconditionally on NEON instructions not crashing, otherwise we must
* disable use of NEON instructions.
*
* NOTE: at present these optimizations depend on 'ALIGNED_MEMORY', so they
* can only be turned on automatically if that is supported too. If
* PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail
* to compile with an appropriate #error if ALIGNED_MEMORY has been turned
* off.
*
* Note that gcc-4.9 defines __ARM_NEON instead of __ARM_NEON__, so we
* check both variants.
*/
# if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \
defined(PNG_ALIGNED_MEMORY_SUPPORTED)
# define PNG_ARM_NEON_OPT 2
# else
# define PNG_ARM_NEON_OPT 0
# endif
#endif
#if PNG_ARM_NEON_OPT > 0
/* NEON optimizations are to be at least considered by libpng, so enable the
* callbacks to do this.
*/
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon
/* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used
* if possible - if __ARM_NEON__ is set and the compiler version is not known
* to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can
* be:
*
* 1 The intrinsics code (the default with __ARM_NEON__)
* 2 The hand coded assembler (the default without __ARM_NEON__)
*
* It is possible to set PNG_ARM_NEON_IMPLEMENTATION in CPPFLAGS, however
* this is *NOT* supported and may cease to work even after a minor revision
* to libpng. It *is* valid to do this for testing purposes, e.g. speed
* testing or a new compiler, but the results should be communicated to the
* libpng implementation list for incorporation in the next minor release.
*/
# ifndef PNG_ARM_NEON_IMPLEMENTATION
# if defined(__ARM_NEON__) || defined(__ARM_NEON)
# if defined(__clang__)
/* At present it is unknown by the libpng developers which versions
* of clang support the intrinsics, however some or perhaps all
* versions do not work with the assembler so this may be
* irrelevant, so just use the default (do nothing here.)
*/
# elif defined(__GNUC__)
/* GCC 4.5.4 NEON support is known to be broken. 4.6.3 is known to
* work, so if this *is* GCC, or G++, look for a version >4.5
*/
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
# define PNG_ARM_NEON_IMPLEMENTATION 2
# endif /* no GNUC support */
# endif /* __GNUC__ */
# else /* !defined __ARM_NEON__ */
/* The 'intrinsics' code simply won't compile without this -mfpu=neon:
*/
# define PNG_ARM_NEON_IMPLEMENTATION 2
# endif /* __ARM_NEON__ */
# endif /* !PNG_ARM_NEON_IMPLEMENTATION */
# ifndef PNG_ARM_NEON_IMPLEMENTATION
/* Use the intrinsics code by default. */
# define PNG_ARM_NEON_IMPLEMENTATION 1
# endif
#endif /* PNG_ARM_NEON_OPT > 0 */
/* Is this a build of a DLL where compilation of the object modules requires
* different preprocessor settings to those required for a simple library? If
* so PNG_BUILD_DLL must be set.
@ -165,6 +256,11 @@
extern PNG_FUNCTION(type, name, args, PNG_EMPTY attributes)
#endif
#ifndef PNG_INTERNAL_CALLBACK
# define PNG_INTERNAL_CALLBACK(type, name, args, attributes)\
extern PNG_FUNCTION(type, (PNGCBAPI name), args, PNG_EMPTY attributes)
#endif
/* If floating or fixed point APIs are disabled they may still be compiled
* internally. To handle this make sure they are declared as the appropriate
* internal extern function (otherwise the symbol prefixing stuff won't work and
@ -202,46 +298,9 @@
/* SECURITY and SAFETY:
*
* By default libpng is built without any internal limits on image size,
* individual heap (png_malloc) allocations or the total amount of memory used.
* If PNG_SAFE_LIMITS_SUPPORTED is defined, however, the limits below are used
* (unless individually overridden). These limits are believed to be fairly
* safe, but builders of secure systems should verify the values against the
* real system capabilities.
*/
#ifdef PNG_SAFE_LIMITS_SUPPORTED
/* 'safe' limits */
# ifndef PNG_USER_WIDTH_MAX
# define PNG_USER_WIDTH_MAX 1000000
# endif
# ifndef PNG_USER_HEIGHT_MAX
# define PNG_USER_HEIGHT_MAX 1000000
# endif
# ifndef PNG_USER_CHUNK_CACHE_MAX
# define PNG_USER_CHUNK_CACHE_MAX 128
# endif
# ifndef PNG_USER_CHUNK_MALLOC_MAX
# define PNG_USER_CHUNK_MALLOC_MAX 8000000
# endif
#else
/* values for no limits */
# ifndef PNG_USER_WIDTH_MAX
# define PNG_USER_WIDTH_MAX 0x7fffffff
# endif
# ifndef PNG_USER_HEIGHT_MAX
# define PNG_USER_HEIGHT_MAX 0x7fffffff
# endif
# ifndef PNG_USER_CHUNK_CACHE_MAX
# define PNG_USER_CHUNK_CACHE_MAX 0
# endif
# ifndef PNG_USER_CHUNK_MALLOC_MAX
# define PNG_USER_CHUNK_MALLOC_MAX 0
# endif
#endif
/* Moved to pngpriv.h at libpng-1.5.0 */
/* NOTE: some of these may have been used in external applications as
* these definitions were exposed in pngconf.h prior to 1.5.
* libpng is built with support for internal limits on image dimensions and
* memory usage. These are documented in scripts/pnglibconf.dfa of the
* source and recorded in the machine generated header file pnglibconf.h.
*/
/* If you are running on a machine where you cannot allocate more
@ -284,8 +343,6 @@
#ifdef PNG_WARNINGS_SUPPORTED
# define PNG_WARNING_PARAMETERS(p) png_warning_parameters p;
#else
# define png_warning(s1,s2) ((void)(s1))
# define png_chunk_warning(s1,s2) ((void)(s1))
# define png_warning_parameter(p,number,string) ((void)0)
# define png_warning_parameter_unsigned(p,number,format,value) ((void)0)
# define png_warning_parameter_signed(p,number,format,value) ((void)0)
@ -293,8 +350,6 @@
# define PNG_WARNING_PARAMETERS(p)
#endif
#ifndef PNG_ERROR_TEXT_SUPPORTED
# define png_error(s1,s2) png_err(s1)
# define png_chunk_error(s1,s2) png_err(s1)
# define png_fixed_error(s1,s2) png_err(s1)
#endif
@ -342,8 +397,8 @@
*/
# include <float.h>
# if ( ( (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
defined(THINK_C) || defined(TARGET_OS_MAC) ) && !wxOSX_USE_IPHONE ) || defined(__SC__)
# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
/* We need to check that <math.h> hasn't already been included earlier
* as it seems it doesn't agree with <fp.h>, yet we should really use
* <fp.h> if possible.
@ -488,13 +543,13 @@
#define PNG_RGB_TO_GRAY_WARN 0x400000
#define PNG_RGB_TO_GRAY 0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */
#define PNG_ENCODE_ALPHA 0x800000 /* Added to libpng-1.5.4 */
#define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */
#define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */
#define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */
/* 0x8000000 unused */
/* 0x10000000 unused */
/* 0x20000000 unused */
/* 0x40000000 unused */
#define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */
#define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */
#define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */
/* 0x8000000 unused */
/* 0x10000000 unused */
/* 0x20000000 unused */
/* 0x40000000 unused */
/* Flags for png_create_struct */
#define PNG_STRUCT_PNG 0x0001
#define PNG_STRUCT_INFO 0x0002
@ -629,45 +684,74 @@
* architectures where (int) is only 16 bits.
*/
#define PNG_32b(b,s) ((png_uint_32)(b) << (s))
#define PNG_CHUNK(b1,b2,b3,b4) \
#define PNG_U32(b1,b2,b3,b4) \
(PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0))
#define png_IHDR PNG_CHUNK( 73, 72, 68, 82)
#define png_IDAT PNG_CHUNK( 73, 68, 65, 84)
#define png_IEND PNG_CHUNK( 73, 69, 78, 68)
#define png_PLTE PNG_CHUNK( 80, 76, 84, 69)
#define png_bKGD PNG_CHUNK( 98, 75, 71, 68)
#define png_cHRM PNG_CHUNK( 99, 72, 82, 77)
#define png_gAMA PNG_CHUNK(103, 65, 77, 65)
#define png_hIST PNG_CHUNK(104, 73, 83, 84)
#define png_iCCP PNG_CHUNK(105, 67, 67, 80)
#define png_iTXt PNG_CHUNK(105, 84, 88, 116)
#define png_oFFs PNG_CHUNK(111, 70, 70, 115)
#define png_pCAL PNG_CHUNK(112, 67, 65, 76)
#define png_sCAL PNG_CHUNK(115, 67, 65, 76)
#define png_pHYs PNG_CHUNK(112, 72, 89, 115)
#define png_sBIT PNG_CHUNK(115, 66, 73, 84)
#define png_sPLT PNG_CHUNK(115, 80, 76, 84)
#define png_sRGB PNG_CHUNK(115, 82, 71, 66)
#define png_sTER PNG_CHUNK(115, 84, 69, 82)
#define png_tEXt PNG_CHUNK(116, 69, 88, 116)
#define png_tIME PNG_CHUNK(116, 73, 77, 69)
#define png_tRNS PNG_CHUNK(116, 82, 78, 83)
#define png_zTXt PNG_CHUNK(122, 84, 88, 116)
/* Constants for known chunk types.
*
* MAINTAINERS: If you need to add a chunk, define the name here.
* For historical reasons these constants have the form png_<name>; i.e.
* the prefix is lower case. Please use decimal values as the parameters to
* match the ISO PNG specification and to avoid relying on the C locale
* interpretation of character values. Please keep the list sorted.
*
* Notice that PNG_U32 is used to define a 32-bit value for the 4 byte chunk
* type. In fact the specification does not express chunk types this way,
* however using a 32-bit value means that the chunk type can be read from the
* stream using exactly the same code as used for a 32-bit unsigned value and
* can be examined far more efficiently (using one arithmetic compare).
*
* Prior to 1.5.6 the chunk type constants were expressed as C strings. The
* libpng API still uses strings for 'unknown' chunks and a macro,
* PNG_STRING_FROM_CHUNK, allows a string to be generated if required. Notice
* that for portable code numeric values must still be used; the string "IHDR"
* is not portable and neither is PNG_U32('I', 'H', 'D', 'R').
*
* In 1.7.0 the definitions will be made public in png.h to avoid having to
* duplicate the same definitions in application code.
*/
#define png_IDAT PNG_U32( 73, 68, 65, 84)
#define png_IEND PNG_U32( 73, 69, 78, 68)
#define png_IHDR PNG_U32( 73, 72, 68, 82)
#define png_PLTE PNG_U32( 80, 76, 84, 69)
#define png_bKGD PNG_U32( 98, 75, 71, 68)
#define png_cHRM PNG_U32( 99, 72, 82, 77)
#define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */
#define png_gAMA PNG_U32(103, 65, 77, 65)
#define png_gIFg PNG_U32(103, 73, 70, 103)
#define png_gIFt PNG_U32(103, 73, 70, 116) /* deprecated */
#define png_gIFx PNG_U32(103, 73, 70, 120)
#define png_hIST PNG_U32(104, 73, 83, 84)
#define png_iCCP PNG_U32(105, 67, 67, 80)
#define png_iTXt PNG_U32(105, 84, 88, 116)
#define png_oFFs PNG_U32(111, 70, 70, 115)
#define png_pCAL PNG_U32(112, 67, 65, 76)
#define png_pHYs PNG_U32(112, 72, 89, 115)
#define png_sBIT PNG_U32(115, 66, 73, 84)
#define png_sCAL PNG_U32(115, 67, 65, 76)
#define png_sPLT PNG_U32(115, 80, 76, 84)
#define png_sRGB PNG_U32(115, 82, 71, 66)
#define png_sTER PNG_U32(115, 84, 69, 82)
#define png_tEXt PNG_U32(116, 69, 88, 116)
#define png_tIME PNG_U32(116, 73, 77, 69)
#define png_tRNS PNG_U32(116, 82, 78, 83)
#define png_zTXt PNG_U32(122, 84, 88, 116)
/* The following will work on (signed char*) strings, whereas the get_uint_32
* macro will fail on top-bit-set values because of the sign extension.
*/
#define PNG_CHUNK_FROM_STRING(s)\
PNG_CHUNK(0xff&(s)[0], 0xff&(s)[1], 0xff&(s)[2], 0xff&(s)[3])
PNG_U32(0xff & (s)[0], 0xff & (s)[1], 0xff & (s)[2], 0xff & (s)[3])
/* This uses (char), not (png_byte) to avoid warnings on systems where (char) is
* signed and the argument is a (char[]) This macro will fail miserably on
* systems where (char) is more than 8 bits.
*/
#define PNG_STRING_FROM_CHUNK(s,c)\
(void)(((char*)(s))[0]=(char)((c)>>24), ((char*)(s))[1]=(char)((c)>>16),\
((char*)(s))[2]=(char)((c)>>8), ((char*)(s))[3]=(char)((c)))
(void)(((char*)(s))[0]=(char)(((c)>>24) & 0xff), \
((char*)(s))[1]=(char)(((c)>>16) & 0xff),\
((char*)(s))[2]=(char)(((c)>>8) & 0xff), \
((char*)(s))[3]=(char)((c & 0xff)))
/* Do the same but terminate with a null character. */
#define PNG_CSTRING_FROM_CHUNK(s,c)\
@ -693,6 +777,24 @@
#include "pngstruct.h"
#include "pnginfo.h"
/* Validate the include paths - the include path used to generate pnglibconf.h
* must match that used in the build, or we must be using pnglibconf.h.prebuilt:
*/
#if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM
# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
"-I (include path) error: see the notes in pngpriv.h"
/* This means that when pnglibconf.h was built the copy of zlib.h that it
* used is not the same as the one being used here. Because the build of
* libpng makes decisions to use inflateInit2 and inflateReset2 based on the
* zlib version number and because this affects handling of certain broken
* PNG files the -I directives must match.
*
* The most likely explanation is that you passed a -I in CFLAGS. This will
* not work; all the preprocessor directories and in particular all the -I
* directives must be in CPPFLAGS.
*/
#endif
/* This is used for 16 bit gamma tables -- only the top level pointers are
* const; this could be changed:
*/
@ -711,12 +813,13 @@ PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]);
PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]);
PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]);
#define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\
((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8))
#define PNG_sRGB_FROM_LINEAR(linear) \
((png_byte)(0xff & ((png_sRGB_base[(linear)>>15] \
+ ((((linear) & 0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8)))
/* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB
* encoded value with maximum error 0.646365. Note that the input is not a
* 16-bit value; it has been multiplied by 255! */
#endif /* PNG_SIMPLIFIED_READ/WRITE */
#endif /* SIMPLIFIED_READ/WRITE */
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
@ -771,7 +874,7 @@ PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_base,(png_const_structrp png_ptr,
#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\
defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED)
/* Internal array allocator, outputs no error or warning messages on failure,
* just returns NULL.
* just returns NULL.
*/
PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_array,(png_const_structrp png_ptr,
int nelements, size_t element_size),PNG_ALLOCATED);
@ -951,7 +1054,7 @@ PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr,
#ifdef PNG_WRITE_zTXt_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp
key, png_const_charp text, png_size_t text_len, int compression),PNG_EMPTY);
key, png_const_charp text, int compression),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_iTXt_SUPPORTED
@ -1090,7 +1193,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_finish_IDAT,(png_structrp png_ptr),
PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr),
PNG_EMPTY);
/* Finish a row while reading, dealing with interlacing passes, etc. */
#endif
#endif /* SEQUENTIAL_READ */
/* Initialize the row buffers, etc. */
PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY);
@ -1101,32 +1204,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr,
png_inforp info_ptr),PNG_EMPTY);
#endif
/* These are the functions that do the transformations */
#ifdef PNG_READ_FILLER_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_read_filler,(png_row_infop row_info,
png_bytep row, png_uint_32 filler, png_uint_32 flags),PNG_EMPTY);
#endif
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_read_swap_alpha,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_write_swap_alpha,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_read_invert_alpha,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_write_invert_alpha,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
/* Shared transform functions, defined in pngtran.c */
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info,
@ -1146,96 +1224,16 @@ PNG_INTERNAL_FUNCTION(void,png_do_packswap,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
PNG_INTERNAL_FUNCTION(int,png_do_rgb_to_gray,(png_structrp png_ptr,
png_row_infop row_info, png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_gray_to_rgb,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_READ_PACK_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_unpack,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_READ_SHIFT_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_unshift,(png_row_infop row_info,
png_bytep row, png_const_color_8p sig_bits),PNG_EMPTY);
#endif
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_scale_16_to_8,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_chop,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_READ_QUANTIZE_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_quantize,(png_row_infop row_info,
png_bytep row, png_const_bytep palette_lookup,
png_const_bytep quantize_lookup),PNG_EMPTY);
# ifdef PNG_CORRECT_PALETTE_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_correct_palette,(png_structrp png_ptr,
png_colorp palette, int num_palette),PNG_EMPTY);
# endif
#endif
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_PACK_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_pack,(png_row_infop row_info,
png_bytep row, png_uint_32 bit_depth),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_SHIFT_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_shift,(png_row_infop row_info,
png_bytep row, png_const_color_8p bit_depth),PNG_EMPTY);
#endif
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
PNG_INTERNAL_FUNCTION(void,png_do_compose,(png_row_infop row_info,
png_bytep row, png_structrp png_ptr),PNG_EMPTY);
#endif
#ifdef PNG_READ_GAMMA_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_gamma,(png_row_infop row_info,
png_bytep row, png_structrp png_ptr),PNG_EMPTY);
#endif
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_encode_alpha,(png_row_infop row_info,
png_bytep row, png_structrp png_ptr),PNG_EMPTY);
#endif
#ifdef PNG_READ_EXPAND_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_expand_palette,(png_row_infop row_info,
png_bytep row, png_const_colorp palette, png_const_bytep trans,
int num_trans),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_do_expand,(png_row_infop row_info,
png_bytep row, png_const_color_16p trans_color),PNG_EMPTY);
#endif
#ifdef PNG_READ_EXPAND_16_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_expand_16,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
/* The following decodes the appropriate chunks, and does error correction,
* then calls the appropriate callback for the chunk if it is valid.
*/
@ -1271,7 +1269,7 @@ PNG_INTERNAL_FUNCTION(void,png_handle_hIST,(png_structrp png_ptr,
#ifdef PNG_READ_iCCP_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_handle_iCCP,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
#endif /* PNG_READ_iCCP_SUPPORTED */
#endif /* READ_iCCP */
#ifdef PNG_READ_iTXt_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_handle_iTXt,(png_structrp png_ptr,
@ -1306,7 +1304,7 @@ PNG_INTERNAL_FUNCTION(void,png_handle_sCAL,(png_structrp png_ptr,
#ifdef PNG_READ_sPLT_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_handle_sPLT,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
#endif /* PNG_READ_sPLT_SUPPORTED */
#endif /* READ_sPLT */
#ifdef PNG_READ_sRGB_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_handle_sRGB,(png_structrp png_ptr,
@ -1336,7 +1334,6 @@ PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr,
PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr,
png_uint_32 chunk_name),PNG_EMPTY);
#ifdef PNG_READ_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
/* This is the function that gets called for unknown chunks. The 'keep'
@ -1345,16 +1342,14 @@ PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
* just skips the chunk or errors out if it is critical.
*/
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\
defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
PNG_INTERNAL_FUNCTION(int,png_chunk_unknown_handling,
(png_const_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY);
/* Exactly as the API png_handle_as_unknown() except that the argument is a
* 32-bit chunk name, not a string.
*/
#endif
#endif /* PNG_READ_UNKNOWN_CHUNKS_SUPPORTED */
#endif /* PNG_READ_SUPPORTED */
#endif /* READ_UNKNOWN_CHUNKS || HANDLE_AS_UNKNOWN */
/* Handle the transformations for reading and writing */
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
@ -1423,14 +1418,7 @@ PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr,
png_inforp info_ptr),PNG_EMPTY);
# endif
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
#ifdef PNG_MNG_FEATURES_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_do_read_intrapixel,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_do_write_intrapixel,(png_row_infop row_info,
png_bytep row),PNG_EMPTY);
#endif
#endif /* PROGRESSIVE_READ */
/* Added at libpng version 1.6.0 */
#ifdef PNG_GAMMA_SUPPORTED
@ -1773,7 +1761,7 @@ PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string,
png_size_t size),PNG_EMPTY);
#endif /* pCAL || sCAL */
#if defined(PNG_READ_GAMMA_SUPPORTED) ||\
#if defined(PNG_GAMMA_SUPPORTED) ||\
defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED)
/* Added at libpng version 1.5.0 */
/* This is a utility to provide a*times/div (rounded) and indicate
@ -1864,11 +1852,11 @@ typedef struct png_control
* errors that might occur. Returns true on success, false on failure (either
* of the function or as a result of a png_error.)
*/
PNG_INTERNAL_FUNCTION(void,png_safe_error,(png_structp png_ptr,
PNG_INTERNAL_CALLBACK(void,png_safe_error,(png_structp png_ptr,
png_const_charp error_message),PNG_NORETURN);
#ifdef PNG_WARNINGS_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_safe_warning,(png_structp png_ptr,
PNG_INTERNAL_CALLBACK(void,png_safe_warning,(png_structp png_ptr,
png_const_charp warning_message),PNG_EMPTY);
#else
# define png_safe_warning 0/*dummy argument*/
@ -1890,14 +1878,22 @@ PNG_INTERNAL_FUNCTION(void, png_image_free, (png_imagep image), PNG_EMPTY);
#endif /* SIMPLIFIED READ/WRITE */
/* These are initialization functions for hardware specific PNG filter
* optimizations; list these here then select the appropriate one at compile
* time using the macro PNG_FILTER_OPTIMIZATIONS. If the macro is not defined
* the generic code is used.
*/
#ifdef PNG_FILTER_OPTIMIZATIONS
PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr,
unsigned int bpp), PNG_EMPTY);
/* This is the initialization function for hardware specific optimizations,
* one implementation (for ARM NEON machines) is contained in
* arm/filter_neon.c. It need not be defined - the generic code will be used
* if not.
unsigned int bpp), PNG_EMPTY);
/* Just declare the optimization that will be used */
#else
/* List *all* the possible optimizations here - this branch is required if
* the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in
* CFLAGS in place of CPPFLAGS *and* uses symbol prefixing.
*/
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
/* Maintainer: Put new private prototypes here ^ */

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* pngrio.c - functions for data input
*
* Last changed in libpng 1.6.0 [February 14, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 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.)
*
@ -26,7 +26,7 @@
* reads from a file pointer. Note that this routine sometimes gets called
* with very small lengths, so you should implement some kind of simple
* buffering if you are using unbuffered reads. This should never be asked
* to read more then 64K on a 16 bit machine.
* to read more than 64K on a 16 bit machine.
*/
void /* PRIVATE */
png_read_data(png_structrp png_ptr, png_bytep data, png_size_t length)
@ -102,6 +102,7 @@ png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
png_ptr->read_data_fn = read_data_fn;
#endif
#ifdef PNG_WRITE_SUPPORTED
/* It is an error to write to a read device */
if (png_ptr->write_data_fn != NULL)
{
@ -110,9 +111,10 @@ png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
"Can't set both read_data_fn and write_data_fn in the"
" same structure");
}
#endif
#ifdef PNG_WRITE_FLUSH_SUPPORTED
png_ptr->output_flush_fn = NULL;
#endif
}
#endif /* PNG_READ_SUPPORTED */
#endif /* READ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* pngset.c - storage of image information into info struct
*
* Last changed in libpng 1.6.2 [April 25, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 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.)
*
@ -59,7 +59,7 @@ png_set_cHRM_fixed(png_const_structrp png_ptr, png_inforp info_ptr,
xy.whitey = white_y;
if (png_colorspace_set_chromaticities(png_ptr, &info_ptr->colorspace, &xy,
2/* override with app values*/))
2/* override with app values*/) != 0)
info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
png_colorspace_sync_info(png_ptr, info_ptr);
@ -90,7 +90,8 @@ png_set_cHRM_XYZ_fixed(png_const_structrp png_ptr, png_inforp info_ptr,
XYZ.blue_Y = int_blue_Y;
XYZ.blue_Z = int_blue_Z;
if (png_colorspace_set_endpoints(png_ptr, &info_ptr->colorspace, &XYZ, 2))
if (png_colorspace_set_endpoints(png_ptr, &info_ptr->colorspace,
&XYZ, 2) != 0)
info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
png_colorspace_sync_info(png_ptr, info_ptr);
@ -129,9 +130,9 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
png_fixed(png_ptr, blue_Y, "cHRM Red Y"),
png_fixed(png_ptr, blue_Z, "cHRM Red Z"));
}
# endif /* PNG_FLOATING_POINT_SUPPORTED */
# endif /* FLOATING_POINT */
#endif /* PNG_cHRM_SUPPORTED */
#endif /* cHRM */
#ifdef PNG_gAMA_SUPPORTED
void PNGFAPI
@ -189,6 +190,7 @@ png_set_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->hist == NULL)
{
png_warning(png_ptr, "Insufficient memory for hIST chunk data");
return;
}
@ -227,27 +229,18 @@ png_set_IHDR(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
info_ptr->channels = 1;
else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
else if ((info_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0)
info_ptr->channels = 3;
else
info_ptr->channels = 1;
if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
if ((info_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0)
info_ptr->channels++;
info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth);
/* Check for potential overflow */
if (width >
(PNG_UINT_32_MAX >> 3) /* 8-byte RRGGBBAA pixels */
- 48 /* bigrowbuf hack */
- 1 /* filter byte */
- 7*8 /* rounding of width to multiple of 8 pixels */
- 8) /* extra max_pixel_depth pad */
info_ptr->rowbytes = 0;
else
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
}
#ifdef PNG_oFFs_SUPPORTED
@ -279,7 +272,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
png_debug1(1, "in %s storage function", "pCAL");
if (png_ptr == NULL || info_ptr == NULL || purpose == NULL || units == NULL
|| (nparams > 0 && params == NULL))
|| (nparams > 0 && params == NULL))
return;
length = strlen(purpose) + 1;
@ -297,16 +290,19 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
/* Validate params[nparams] */
for (i=0; i<nparams; ++i)
{
if (params[i] == NULL ||
!png_check_fp_string(params[i], strlen(params[i])))
!png_check_fp_string(params[i], strlen(params[i])))
png_error(png_ptr, "Invalid format for pCAL parameter");
}
info_ptr->pcal_purpose = png_voidcast(png_charp,
png_malloc_warn(png_ptr, length));
png_malloc_warn(png_ptr, length));
if (info_ptr->pcal_purpose == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL purpose");
return;
}
@ -328,6 +324,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->pcal_units == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL units");
return;
}
@ -339,6 +336,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->pcal_params == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL params");
return;
}
@ -355,6 +353,7 @@ png_set_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->pcal_params[i] == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL parameter");
return;
}
@ -404,6 +403,7 @@ png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr,
if (info_ptr->scal_s_width == NULL)
{
png_warning(png_ptr, "Memory allocation failed while processing sCAL");
return;
}
@ -422,6 +422,7 @@ png_set_sCAL_s(png_const_structrp png_ptr, png_inforp info_ptr,
info_ptr->scal_s_width = NULL;
png_warning(png_ptr, "Memory allocation failed while processing sCAL");
return;
}
@ -525,6 +526,7 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr,
else
{
png_warning(png_ptr, "Invalid palette length");
return;
}
}
@ -536,8 +538,7 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr,
# endif
))
{
png_chunk_report(png_ptr, "Invalid palette", PNG_CHUNK_ERROR);
return;
png_error(png_ptr, "Invalid palette");
}
/* It may not actually be necessary to set png_ptr->palette here;
@ -603,7 +604,8 @@ png_set_sRGB_gAMA_and_cHRM(png_const_structrp png_ptr, png_inforp info_ptr,
if (png_ptr == NULL || info_ptr == NULL)
return;
if (png_colorspace_set_sRGB(png_ptr, &info_ptr->colorspace, srgb_intent))
if (png_colorspace_set_sRGB(png_ptr, &info_ptr->colorspace,
srgb_intent) != 0)
{
/* This causes the gAMA and cHRM to be written too */
info_ptr->colorspace.flags |=
@ -646,7 +648,7 @@ png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
png_colorspace_sync_info(png_ptr, info_ptr);
/* Don't do any of the copying if the profile was bad, or inconsistent. */
if (!result)
if (result == 0)
return;
/* But do write the gAMA and cHRM chunks from the profile. */
@ -660,6 +662,7 @@ png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
if (new_iccp_name == NULL)
{
png_benign_error(png_ptr, "Insufficient memory to process iCCP chunk");
return;
}
@ -670,8 +673,10 @@ png_set_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
if (new_iccp_profile == NULL)
{
png_free(png_ptr, new_iccp_name);
new_iccp_name = NULL;
png_benign_error(png_ptr,
"Insufficient memory to process iCCP profile");
return;
}
@ -695,7 +700,7 @@ png_set_text(png_const_structrp png_ptr, png_inforp info_ptr,
int ret;
ret = png_set_text_2(png_ptr, info_ptr, text_ptr, num_text);
if (ret)
if (ret != 0)
png_error(png_ptr, "Insufficient memory to store text");
}
@ -735,7 +740,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
else
max_text = INT_MAX;
/* Now allocate a new array and copy the old members in, this does all
/* Now allocate a new array and copy the old members in; this does all
* the overflow checks.
*/
new_text = png_voidcast(png_textp,png_realloc_array(png_ptr,
@ -747,6 +752,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_chunk_report(png_ptr, "too many text chunks",
PNG_CHUNK_WRITE_ERROR);
return 1;
}
@ -802,7 +808,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
else
lang_key_len = 0;
}
# else /* PNG_iTXt_SUPPORTED */
# else /* iTXt */
{
png_chunk_report(png_ptr, "iTXt chunk not supported",
PNG_CHUNK_WRITE_ERROR);
@ -835,6 +841,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_chunk_report(png_ptr, "text chunk: out of memory",
PNG_CHUNK_WRITE_ERROR);
return 1;
}
@ -864,7 +871,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
textp->text = textp->key + key_len + 1;
}
if (text_length)
if (text_length != 0)
memcpy(textp->text, text_ptr[i].text, text_length);
*(textp->text + text_length) = '\0';
@ -899,7 +906,7 @@ png_set_tIME(png_const_structrp png_ptr, png_inforp info_ptr,
png_debug1(1, "in %s storage function", "tIME");
if (png_ptr == NULL || info_ptr == NULL || mod_time == NULL ||
(png_ptr->mode & PNG_WROTE_tIME))
(png_ptr->mode & PNG_WROTE_tIME) != 0)
return;
if (mod_time->month == 0 || mod_time->month > 12 ||
@ -908,6 +915,7 @@ png_set_tIME(png_const_structrp png_ptr, png_inforp info_ptr,
mod_time->second > 60)
{
png_warning(png_ptr, "Ignoring invalid time value");
return;
}
@ -924,6 +932,7 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr,
png_debug1(1, "in %s storage function", "tRNS");
if (png_ptr == NULL || info_ptr == NULL)
return;
if (trans_alpha != NULL)
@ -949,16 +958,21 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr,
if (trans_color != NULL)
{
int sample_max = (1 << info_ptr->bit_depth);
#ifdef PNG_WARNINGS_SUPPORTED
if (info_ptr->bit_depth < 16)
{
int sample_max = (1 << info_ptr->bit_depth) - 1;
if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
trans_color->gray > sample_max) ||
(info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
(trans_color->red > sample_max ||
trans_color->green > sample_max ||
trans_color->blue > sample_max)))
png_warning(png_ptr,
"tRNS chunk has out-of-range samples for bit_depth");
if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
trans_color->gray > sample_max) ||
(info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
(trans_color->red > sample_max ||
trans_color->green > sample_max ||
trans_color->blue > sample_max)))
png_warning(png_ptr,
"tRNS chunk has out-of-range samples for bit_depth");
}
#endif
info_ptr->trans_color = *trans_color;
@ -1005,6 +1019,7 @@ png_set_sPLT(png_const_structrp png_ptr,
{
/* Out of memory or too many chunks */
png_chunk_report(png_ptr, "too many sPLT chunks", PNG_CHUNK_WRITE_ERROR);
return;
}
@ -1029,8 +1044,8 @@ png_set_sPLT(png_const_structrp png_ptr,
np->depth = entries->depth;
/* In the even of out-of-memory just return - there's no point keeping on
* trying to add sPLT chunks.
/* In the event of out-of-memory just return - there's no point keeping
* on trying to add sPLT chunks.
*/
length = strlen(entries->name) + 1;
np->name = png_voidcast(png_charp, png_malloc_base(png_ptr, length));
@ -1041,8 +1056,8 @@ png_set_sPLT(png_const_structrp png_ptr,
memcpy(np->name, entries->name, length);
/* IMPORTANT: we have memory now that won't get freed if something else
* goes wrong, this code must free it. png_malloc_array produces no
* warnings, use a png_chunk_report (below) if there is an error.
* goes wrong; this code must free it. png_malloc_array produces no
* warnings; use a png_chunk_report (below) if there is an error.
*/
np->entries = png_voidcast(png_sPLT_entryp, png_malloc_array(png_ptr,
entries->nentries, sizeof (png_sPLT_entry)));
@ -1050,6 +1065,7 @@ png_set_sPLT(png_const_structrp png_ptr,
if (np->entries == NULL)
{
png_free(png_ptr, np->name);
np->name = NULL;
break;
}
@ -1072,7 +1088,7 @@ png_set_sPLT(png_const_structrp png_ptr,
if (nentries > 0)
png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR);
}
#endif /* PNG_sPLT_SUPPORTED */
#endif /* sPLT */
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
static png_byte
@ -1081,10 +1097,10 @@ check_location(png_const_structrp png_ptr, int location)
location &= (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT);
/* New in 1.6.0; copy the location and check it. This is an API
* change, previously the app had to use the
* change; previously the app had to use the
* png_set_unknown_chunk_location API below for each chunk.
*/
if (location == 0 && !(png_ptr->mode & PNG_IS_READ_STRUCT))
if (location == 0 && (png_ptr->mode & PNG_IS_READ_STRUCT) == 0)
{
/* Write struct, so unknown chunks come from the app */
png_app_warning(png_ptr,
@ -1119,7 +1135,7 @@ png_set_unknown_chunks(png_const_structrp png_ptr,
png_unknown_chunkp np;
if (png_ptr == NULL || info_ptr == NULL || num_unknowns <= 0 ||
unknowns == NULL)
unknowns == NULL)
return;
/* Check for the failure cases where support has been disabled at compile
@ -1130,17 +1146,19 @@ png_set_unknown_chunks(png_const_structrp png_ptr,
*/
# if !defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) && \
defined(PNG_READ_SUPPORTED)
if (png_ptr->mode & PNG_IS_READ_STRUCT)
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)
{
png_app_error(png_ptr, "no unknown chunk support on read");
return;
}
# endif
# if !defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) && \
defined(PNG_WRITE_SUPPORTED)
if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0)
{
png_app_error(png_ptr, "no unknown chunk support on write");
return;
}
# endif
@ -1158,6 +1176,7 @@ png_set_unknown_chunks(png_const_structrp png_ptr,
{
png_chunk_report(png_ptr, "too many unknown chunks",
PNG_CHUNK_WRITE_ERROR);
return;
}
@ -1224,7 +1243,7 @@ png_set_unknown_chunk_location(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_app_error(png_ptr, "invalid unknown chunk location");
/* Fake out the pre 1.6.0 behavior: */
if ((location & PNG_HAVE_IDAT)) /* undocumented! */
if ((location & PNG_HAVE_IDAT) != 0) /* undocumented! */
location = PNG_AFTER_IDAT;
else
@ -1235,8 +1254,7 @@ png_set_unknown_chunk_location(png_const_structrp png_ptr, png_inforp info_ptr,
check_location(png_ptr, location);
}
}
#endif
#endif /* STORE_UNKNOWN_CHUNKS */
#ifdef PNG_MNG_FEATURES_SUPPORTED
png_uint_32 PNGAPI
@ -1262,10 +1280,14 @@ add_one_chunk(png_bytep list, unsigned int count, png_const_bytep add, int keep)
/* Utility function: update the 'keep' state of a chunk if it is already in
* the list, otherwise add it to the list.
*/
for (i=0; i<count; ++i, list += 5) if (memcmp(list, add, 4) == 0)
for (i=0; i<count; ++i, list += 5)
{
list[4] = (png_byte)keep;
return count;
if (memcmp(list, add, 4) == 0)
{
list[4] = (png_byte)keep;
return count;
}
}
if (keep != PNG_HANDLE_CHUNK_AS_DEFAULT)
@ -1291,6 +1313,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
if (keep < 0 || keep >= PNG_HANDLE_CHUNK_LAST)
{
png_app_error(png_ptr, "png_set_keep_unknown_chunks: invalid keep");
return;
}
@ -1329,7 +1352,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
};
chunk_list = chunks_to_ignore;
num_chunks = (sizeof chunks_to_ignore)/5;
num_chunks = (unsigned int)/*SAFE*/(sizeof chunks_to_ignore)/5U;
}
else /* num_chunks_in > 0 */
@ -1340,6 +1363,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
* which can be switched off.
*/
png_app_error(png_ptr, "png_set_keep_unknown_chunks: no chunk list");
return;
}
@ -1355,6 +1379,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
if (num_chunks + old_num_chunks > UINT_MAX/5)
{
png_app_error(png_ptr, "png_set_keep_unknown_chunks: too many chunks");
return;
}
@ -1362,7 +1387,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
* required because add_one_chunk above doesn't extend the list if the 'keep'
* parameter is the default.
*/
if (keep)
if (keep != 0)
{
new_list = png_voidcast(png_bytep, png_malloc(png_ptr,
5 * (num_chunks + old_num_chunks)));
@ -1389,12 +1414,15 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
unsigned int i;
for (i=0; i<num_chunks; ++i)
{
old_num_chunks = add_one_chunk(new_list, old_num_chunks,
chunk_list+5*i, keep);
}
/* Now remove any spurious 'default' entries. */
num_chunks = 0;
for (i=0, inlist=outlist=new_list; i<old_num_chunks; ++i, inlist += 5)
{
if (inlist[4])
{
if (outlist != inlist)
@ -1402,6 +1430,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep,
outlist += 5;
++num_chunks;
}
}
/* This means the application has removed all the specialized handling. */
if (num_chunks == 0)
@ -1453,12 +1482,13 @@ png_set_rows(png_const_structrp png_ptr, png_inforp info_ptr,
if (png_ptr == NULL || info_ptr == NULL)
return;
if (info_ptr->row_pointers && (info_ptr->row_pointers != row_pointers))
if (info_ptr->row_pointers != NULL &&
(info_ptr->row_pointers != row_pointers))
png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0);
info_ptr->row_pointers = row_pointers;
if (row_pointers)
if (row_pointers != NULL)
info_ptr->valid |= PNG_INFO_IDAT;
}
#endif
@ -1473,7 +1503,7 @@ png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
png_error(png_ptr, "invalid compression buffer size");
# ifdef PNG_SEQUENTIAL_READ_SUPPORTED
if (png_ptr->mode & PNG_IS_READ_STRUCT)
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)
{
png_ptr->IDAT_read_size = (png_uint_32)size; /* checked above */
return;
@ -1481,29 +1511,33 @@ png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
# endif
# ifdef PNG_WRITE_SUPPORTED
if (!(png_ptr->mode & PNG_IS_READ_STRUCT))
if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0)
{
if (png_ptr->zowner != 0)
{
png_warning(png_ptr,
"Compression buffer size cannot be changed because it is in use");
return;
}
#ifndef __COVERITY__
if (size > ZLIB_IO_MAX)
{
png_warning(png_ptr,
"Compression buffer size limited to system maximum");
size = ZLIB_IO_MAX; /* must fit */
}
#endif
else if (size < 6)
if (size < 6)
{
/* Deflate will potentially go into an infinite loop on a SYNC_FLUSH
* if this is permitted.
*/
png_warning(png_ptr,
"Compression buffer size cannot be reduced below 6");
return;
}
@ -1519,7 +1553,7 @@ png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
void PNGAPI
png_set_invalid(png_const_structrp png_ptr, png_inforp info_ptr, int mask)
{
if (png_ptr && info_ptr)
if (png_ptr != NULL && info_ptr != NULL)
info_ptr->valid &= ~mask;
}
@ -1545,8 +1579,8 @@ png_set_user_limits (png_structrp png_ptr, png_uint_32 user_width_max,
void PNGAPI
png_set_chunk_cache_max (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)
{
if (png_ptr)
png_ptr->user_chunk_cache_max = user_chunk_cache_max;
if (png_ptr != NULL)
png_ptr->user_chunk_cache_max = user_chunk_cache_max;
}
/* This function was added to libpng 1.4.1 */
@ -1554,10 +1588,10 @@ void PNGAPI
png_set_chunk_malloc_max (png_structrp png_ptr,
png_alloc_size_t user_chunk_malloc_max)
{
if (png_ptr)
if (png_ptr != NULL)
png_ptr->user_chunk_malloc_max = user_chunk_malloc_max;
}
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
#endif /* ?SET_USER_LIMITS */
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
@ -1572,7 +1606,7 @@ png_set_benign_errors(png_structrp png_ptr, int allowed)
* is the default behavior if png_set_benign_errors() is not called).
*/
if (allowed)
if (allowed != 0)
png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN |
PNG_FLAG_APP_WARNINGS_WARN | PNG_FLAG_APP_ERRORS_WARN;
@ -1580,14 +1614,14 @@ png_set_benign_errors(png_structrp png_ptr, int allowed)
png_ptr->flags &= ~(PNG_FLAG_BENIGN_ERRORS_WARN |
PNG_FLAG_APP_WARNINGS_WARN | PNG_FLAG_APP_ERRORS_WARN);
}
#endif /* PNG_BENIGN_ERRORS_SUPPORTED */
#endif /* BENIGN_ERRORS */
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
/* Whether to report invalid palette index; added at libng-1.5.10.
* It is possible for an indexed (color-type==3) PNG file to contain
* pixels with invalid (out-of-range) indexes if the PLTE chunk has
* fewer entries than the image's bit-depth would allow. We recover
* from this gracefully by filling any incomplete palette with zeroes
* from this gracefully by filling any incomplete palette with zeros
* (opaque black). By default, when this occurs libpng will issue
* a benign error. This API can be used to override that behavior.
*/
@ -1603,4 +1637,4 @@ png_set_check_for_invalid_index(png_structrp png_ptr, int allowed)
png_ptr->num_palette_max = -1;
}
#endif
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
#endif /* READ || WRITE */

View File

@ -1,12 +1,11 @@
/* pngstruct.h - header file for PNG reference library
*
* Last changed in libpng 1.6.1 [March 28, 2013]
* Copyright (c) 1998-2013 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.)
*
* Last changed in libpng 1.6.1 [March 28, 2013]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
@ -101,7 +100,7 @@ typedef struct png_XYZ
#endif /* COLORSPACE */
#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
/* A colorspace is all the above plus, potentially, profile information,
/* A colorspace is all the above plus, potentially, profile information;
* however at present libpng does not use the profile internally so it is only
* stored in the png_info struct (if iCCP is supported.) The rendering intent
* is retained here and is checked.
@ -274,7 +273,7 @@ struct png_struct_def
#ifdef PNG_READ_GAMMA_SUPPORTED
png_color_16 background_1; /* background normalized to gamma 1.0 */
#endif
#endif /* PNG_bKGD_SUPPORTED */
#endif /* bKGD */
#ifdef PNG_WRITE_FLUSH_SUPPORTED
png_flush_ptr output_flush_fn; /* Function for flushing output */
@ -331,7 +330,7 @@ struct png_struct_def
int process_mode; /* what push library is currently doing */
int cur_palette; /* current push library palette index */
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
#endif /* PROGRESSIVE_READ */
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
/* For the Borland special 64K segment handler */

View File

@ -1,8 +1,8 @@
/* pngtest.c - a simple test program to test libpng
*
* Last changed in libpng 1.6.2 [April 25, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 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.)
*
@ -45,6 +45,11 @@
/* Known chunks that exist in pngtest.png must be supported or pngtest will fail
* simply as a result of re-ordering them. This may be fixed in 1.7
*
* pngtest allocates a single row buffer for each row and overwrites it,
* therefore if the write side doesn't support the writing of interlaced images
* nothing can be done for an interlaced image (and the code below will fail
* horribly trying to write extra data after writing garbage).
*/
#if defined PNG_READ_SUPPORTED && /* else nothing can be done */\
defined PNG_READ_bKGD_SUPPORTED &&\
@ -58,9 +63,15 @@
defined PNG_READ_sRGB_SUPPORTED &&\
defined PNG_READ_tEXt_SUPPORTED &&\
defined PNG_READ_tIME_SUPPORTED &&\
defined PNG_READ_zTXt_SUPPORTED
defined PNG_READ_zTXt_SUPPORTED &&\
defined PNG_WRITE_INTERLACING_SUPPORTED
#ifdef PNG_ZLIB_HEADER
# include PNG_ZLIB_HEADER /* defined by pnglibconf.h from 1.7 */
#else
# include "zlib.h"
#endif
#include "zlib.h"
/* Copied from pngpriv.h but only used in error messages below. */
#ifndef PNG_ZBUF_SIZE
# define PNG_ZBUF_SIZE 8192
@ -116,10 +127,6 @@ static int unsupported_chunks = 0; /* chunk unsupported by libpng in input */
static int error_count = 0; /* count calls to png_error */
static int warning_count = 0; /* count calls to png_warning */
#ifdef __TURBOC__
#include <mem.h>
#endif
/* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */
#ifndef png_jmpbuf
# define png_jmpbuf(png_ptr) png_ptr->jmpbuf
@ -276,7 +283,8 @@ count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
png_uint_32 n, nstop;
int channel;
int color_channels = row_info->channels;
if (row_info->color_type > 3)color_channels--;
if (row_info->color_type > 3)
color_channels--;
for (n = 0, nstop=row_info->width; n<nstop; n++)
{
@ -303,7 +311,7 @@ count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
}
}
}
#endif /* PNG_WRITE_USER_TRANSFORM_SUPPORTED */
#endif /* WRITE_USER_TRANSFORM */
#ifndef PNG_STDIO_SUPPORTED
/* START of code to validate stdio-free compilation */
@ -352,7 +360,7 @@ pngtest_check_io_state(png_structp png_ptr, png_size_t data_length,
default:
err = 1; /* uninitialized */
}
if (err)
if (err != 0)
png_error(png_ptr, "Bad I/O state or buffer size");
}
#endif
@ -412,7 +420,7 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
pngtest_check_io_state(png_ptr, length, PNG_IO_WRITING);
#endif
}
#endif /* !PNG_STDIO_SUPPORTED */
#endif /* !STDIO */
/* This function is called when there is a warning, but the library thinks
* it can continue anyway. Replacement functions don't have to do anything
@ -461,7 +469,7 @@ pngtest_error(png_structp png_ptr, png_const_charp message)
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
/* Allocate memory. For reasonable files, size should never exceed
* 64K. However, zlib may allocate more then 64K if you don't tell
* 64K. However, zlib may allocate more than 64K if you don't tell
* it not to. See zconf.h and png.h for more information. zlib does
* need to allocate exactly 64K, so whatever you call here must
* have the ability to do that.
@ -533,7 +541,7 @@ PNGCBAPI png_debug_malloc(png_structp png_ptr, png_alloc_size_t size)
/* Make sure the caller isn't assuming zeroed memory. */
memset(pinfo->pointer, 0xdd, pinfo->size);
if (verbose)
if (verbose != 0)
printf("png_malloc %lu bytes at %p\n", (unsigned long)size,
pinfo->pointer);
@ -573,14 +581,15 @@ png_debug_free(png_structp png_ptr, png_voidp ptr)
/* We must free the list element too, but first kill
the memory that is to be freed. */
memset(ptr, 0x55, pinfo->size);
png_free_default(png_ptr, pinfo);
if (pinfo != NULL)
free(pinfo);
pinfo = NULL;
break;
}
if (pinfo->next == NULL)
{
fprintf(STDERR, "Pointer %x not found\n", (unsigned int)ptr);
fprintf(STDERR, "Pointer %p not found\n", ptr);
break;
}
@ -589,13 +598,14 @@ png_debug_free(png_structp png_ptr, png_voidp ptr)
}
/* Finally free the data. */
if (verbose)
if (verbose != 0)
printf("Freeing %p\n", ptr);
png_free_default(png_ptr, ptr);
if (ptr != NULL)
free(ptr);
ptr = NULL;
}
#endif /* PNG_USER_MEM_SUPPORTED && PNG_DEBUG */
#endif /* USER_MEM && DEBUG */
/* END of code to test memory allocation/deallocation */
@ -634,16 +644,16 @@ set_location(png_structp png_ptr, struct user_chunk_data *data, int what)
{
int location;
if ((data->location[0] & what) || (data->location[1] & what))
if ((data->location[0] & what) != 0 || (data->location[1] & what) != 0)
return 0; /* already have one of these */
/* Find where we are (the code below zeros info_ptr to indicate that the
/* Find where we are (the code below zeroes info_ptr to indicate that the
* chunks before the first IDAT have been read.)
*/
if (data->info_ptr == NULL) /* after IDAT */
location = what | after_IDAT;
else if (png_get_valid(png_ptr, data->info_ptr, PNG_INFO_PLTE))
else if (png_get_valid(png_ptr, data->info_ptr, PNG_INFO_PLTE) != 0)
location = what | before_IDAT;
else
@ -658,8 +668,8 @@ set_location(png_structp png_ptr, struct user_chunk_data *data, int what)
return 1; /* handled */
}
static int PNGCBAPI read_user_chunk_callback(png_struct *png_ptr,
png_unknown_chunkp chunk)
static int PNGCBAPI
read_user_chunk_callback(png_struct *png_ptr, png_unknown_chunkp chunk)
{
struct user_chunk_data *my_user_chunk_data =
(struct user_chunk_data*)png_get_user_chunk_ptr(png_ptr);
@ -690,7 +700,7 @@ static int PNGCBAPI read_user_chunk_callback(png_struct *png_ptr,
if (chunk->data[0] != 0 && chunk->data[0] != 1)
return (-1); /* Invalid mode */
if (set_location(png_ptr, my_user_chunk_data, have_sTER))
if (set_location(png_ptr, my_user_chunk_data, have_sTER) != 0)
{
my_user_chunk_data->sTER_mode=chunk->data[0];
return (1);
@ -709,7 +719,7 @@ static int PNGCBAPI read_user_chunk_callback(png_struct *png_ptr,
if (chunk->size != 9)
return (-1); /* Error return */
if (!set_location(png_ptr, my_user_chunk_data, have_vpAg))
if (set_location(png_ptr, my_user_chunk_data, have_vpAg) == 0)
return (0); /* duplicate vpAg */
my_user_chunk_data->vpAg_width = png_get_uint_31(png_ptr, chunk->data);
@ -723,22 +733,22 @@ static int PNGCBAPI read_user_chunk_callback(png_struct *png_ptr,
static void
write_sTER_chunk(png_structp write_ptr)
{
png_byte png_sTER[5] = {115, 84, 69, 82, '\0'};
png_byte sTER[5] = {115, 84, 69, 82, '\0'};
if (verbose)
if (verbose != 0)
fprintf(STDERR, "\n stereo mode = %d\n", user_chunk_data.sTER_mode);
png_write_chunk(write_ptr, png_sTER, &user_chunk_data.sTER_mode, 1);
png_write_chunk(write_ptr, sTER, &user_chunk_data.sTER_mode, 1);
}
static void
write_vpAg_chunk(png_structp write_ptr)
{
png_byte png_vpAg[5] = {118, 112, 65, 103, '\0'};
png_byte vpAg[5] = {118, 112, 65, 103, '\0'};
png_byte vpag_chunk_data[9];
if (verbose)
if (verbose != 0)
fprintf(STDERR, " vpAg = %lu x %lu, units = %d\n",
(unsigned long)user_chunk_data.vpAg_width,
(unsigned long)user_chunk_data.vpAg_height,
@ -747,7 +757,7 @@ write_vpAg_chunk(png_structp write_ptr)
png_save_uint_32(vpag_chunk_data, user_chunk_data.vpAg_width);
png_save_uint_32(vpag_chunk_data + 4, user_chunk_data.vpAg_height);
vpag_chunk_data[8] = user_chunk_data.vpAg_units;
png_write_chunk(write_ptr, png_vpAg, vpag_chunk_data, 9);
png_write_chunk(write_ptr, vpAg, vpag_chunk_data, 9);
}
static void
@ -770,8 +780,8 @@ write_chunks(png_structp write_ptr, int location)
write_vpAg_chunk(write_ptr);
}
}
#endif /* PNG_WRITE_SUPPORTED */
#else /* !PNG_READ_USER_CHUNKS_SUPPORTED */
#endif /* WRITE */
#else /* !READ_USER_CHUNKS */
# define write_chunks(pp,loc) ((void)0)
#endif
/* END of code to demonstrate user chunk support */
@ -828,6 +838,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_structp write_ptr;
png_infop write_info_ptr;
png_infop write_end_info_ptr;
int interlace_preserved = 1;
#else
png_structp write_ptr = NULL;
png_infop write_info_ptr = NULL;
@ -836,7 +847,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_bytep row_buf;
png_uint_32 y;
png_uint_32 width, height;
int num_pass, pass;
int num_pass = 1, pass;
int bit_depth, color_type;
row_buf = NULL;
@ -928,7 +939,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
#endif
if (strict)
if (strict != 0)
{
/* Treat png_benign_error() as errors on read */
png_set_benign_errors(read_ptr, 0);
@ -944,7 +955,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
*/
}
else if (relaxed)
else if (relaxed != 0)
{
/* Allow application (pngtest) errors and warnings to pass */
png_set_benign_errors(read_ptr, 1);
@ -1039,13 +1050,29 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
int interlace_type, compression_type, filter_type;
if (png_get_IHDR(read_ptr, read_info_ptr, &width, &height, &bit_depth,
&color_type, &interlace_type, &compression_type, &filter_type))
&color_type, &interlace_type, &compression_type, &filter_type) != 0)
{
png_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth,
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
color_type, interlace_type, compression_type, filter_type);
#else
color_type, PNG_INTERLACE_NONE, compression_type, filter_type);
#ifndef PNG_READ_INTERLACING_SUPPORTED
/* num_pass will not be set below, set it here if the image is
* interlaced: what happens is that write interlacing is *not* turned
* on an the partial interlaced rows are written directly.
*/
switch (interlace_type)
{
case PNG_INTERLACE_NONE:
num_pass = 1;
break;
case PNG_INTERLACE_ADAM7:
num_pass = 7;
break;
default:
png_error(read_ptr, "invalid interlace type");
/*NOT REACHED*/
}
#endif
}
}
@ -1056,7 +1083,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
blue_y;
if (png_get_cHRM_fixed(read_ptr, read_info_ptr, &white_x, &white_y,
&red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y))
&red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y) != 0)
{
png_set_cHRM_fixed(write_ptr, write_info_ptr, white_x, white_y, red_x,
red_y, green_x, green_y, blue_x, blue_y);
@ -1067,7 +1094,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
{
png_fixed_point gamma;
if (png_get_gAMA_fixed(read_ptr, read_info_ptr, &gamma))
if (png_get_gAMA_fixed(read_ptr, read_info_ptr, &gamma) != 0)
png_set_gAMA_fixed(write_ptr, write_info_ptr, gamma);
}
#endif
@ -1079,7 +1106,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
blue_y;
if (png_get_cHRM(read_ptr, read_info_ptr, &white_x, &white_y, &red_x,
&red_y, &green_x, &green_y, &blue_x, &blue_y))
&red_y, &green_x, &green_y, &blue_x, &blue_y) != 0)
{
png_set_cHRM(write_ptr, write_info_ptr, white_x, white_y, red_x,
red_y, green_x, green_y, blue_x, blue_y);
@ -1090,7 +1117,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
{
double gamma;
if (png_get_gAMA(read_ptr, read_info_ptr, &gamma))
if (png_get_gAMA(read_ptr, read_info_ptr, &gamma) != 0)
png_set_gAMA(write_ptr, write_info_ptr, gamma);
}
#endif
@ -1104,7 +1131,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
int compression_type;
if (png_get_iCCP(read_ptr, read_info_ptr, &name, &compression_type,
&profile, &proflen))
&profile, &proflen) != 0)
{
png_set_iCCP(write_ptr, write_info_ptr, name, compression_type,
profile, proflen);
@ -1115,7 +1142,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
{
int intent;
if (png_get_sRGB(read_ptr, read_info_ptr, &intent))
if (png_get_sRGB(read_ptr, read_info_ptr, &intent) != 0)
png_set_sRGB(write_ptr, write_info_ptr, intent);
}
#endif
@ -1123,14 +1150,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_colorp palette;
int num_palette;
if (png_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette))
if (png_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette) != 0)
png_set_PLTE(write_ptr, write_info_ptr, palette, num_palette);
}
#ifdef PNG_bKGD_SUPPORTED
{
png_color_16p background;
if (png_get_bKGD(read_ptr, read_info_ptr, &background))
if (png_get_bKGD(read_ptr, read_info_ptr, &background) != 0)
{
png_set_bKGD(write_ptr, write_info_ptr, background);
}
@ -1140,7 +1167,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
{
png_uint_16p hist;
if (png_get_hIST(read_ptr, read_info_ptr, &hist))
if (png_get_hIST(read_ptr, read_info_ptr, &hist) != 0)
png_set_hIST(write_ptr, write_info_ptr, hist);
}
#endif
@ -1150,7 +1177,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
int unit_type;
if (png_get_oFFs(read_ptr, read_info_ptr, &offset_x, &offset_y,
&unit_type))
&unit_type) != 0)
{
png_set_oFFs(write_ptr, write_info_ptr, offset_x, offset_y, unit_type);
}
@ -1164,7 +1191,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
int type, nparams;
if (png_get_pCAL(read_ptr, read_info_ptr, &purpose, &X0, &X1, &type,
&nparams, &units, &params))
&nparams, &units, &params) != 0)
{
png_set_pCAL(write_ptr, write_info_ptr, purpose, X0, X1, type,
nparams, units, params);
@ -1176,7 +1203,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_uint_32 res_x, res_y;
int unit_type;
if (png_get_pHYs(read_ptr, read_info_ptr, &res_x, &res_y, &unit_type))
if (png_get_pHYs(read_ptr, read_info_ptr, &res_x, &res_y,
&unit_type) != 0)
png_set_pHYs(write_ptr, write_info_ptr, res_x, res_y, unit_type);
}
#endif
@ -1184,7 +1212,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
{
png_color_8p sig_bit;
if (png_get_sBIT(read_ptr, read_info_ptr, &sig_bit))
if (png_get_sBIT(read_ptr, read_info_ptr, &sig_bit) != 0)
png_set_sBIT(write_ptr, write_info_ptr, sig_bit);
}
#endif
@ -1196,7 +1224,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
double scal_width, scal_height;
if (png_get_sCAL(read_ptr, read_info_ptr, &unit, &scal_width,
&scal_height))
&scal_height) != 0)
{
png_set_sCAL(write_ptr, write_info_ptr, unit, scal_width, scal_height);
}
@ -1208,7 +1236,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_charp scal_width, scal_height;
if (png_get_sCAL_s(read_ptr, read_info_ptr, &unit, &scal_width,
&scal_height))
&scal_height) != 0)
{
png_set_sCAL_s(write_ptr, write_info_ptr, unit, scal_width,
scal_height);
@ -1228,7 +1256,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
pngtest_check_text_support(read_ptr, text_ptr, num_text);
if (verbose)
if (verbose != 0)
{
int i;
@ -1248,11 +1276,11 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
{
png_timep mod_time;
if (png_get_tIME(read_ptr, read_info_ptr, &mod_time))
if (png_get_tIME(read_ptr, read_info_ptr, &mod_time) != 0)
{
png_set_tIME(write_ptr, write_info_ptr, mod_time);
#ifdef PNG_TIME_RFC1123_SUPPORTED
if (png_convert_to_rfc1123_buffer(tIME_string, mod_time))
if (png_convert_to_rfc1123_buffer(tIME_string, mod_time) != 0)
tIME_string[(sizeof tIME_string) - 1] = '\0';
else
@ -1262,7 +1290,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
}
tIME_chunk_present++;
#endif /* PNG_TIME_RFC1123_SUPPORTED */
#endif /* TIME_RFC1123 */
}
}
#endif
@ -1273,7 +1301,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_color_16p trans_color;
if (png_get_tRNS(read_ptr, read_info_ptr, &trans_alpha, &num_trans,
&trans_color))
&trans_color) != 0)
{
int sample_max = (1 << bit_depth);
/* libpng doesn't reject a tRNS chunk with out-of-range samples */
@ -1294,7 +1322,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
int num_unknowns = png_get_unknown_chunks(read_ptr, read_info_ptr,
&unknowns);
if (num_unknowns)
if (num_unknowns != 0)
{
png_set_unknown_chunks(write_ptr, write_info_ptr, unknowns,
num_unknowns);
@ -1338,14 +1366,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif /* SINGLE_ROWBUF_ALLOC */
pngtest_debug("Writing row data");
#if defined(PNG_READ_INTERLACING_SUPPORTED) || \
defined(PNG_WRITE_INTERLACING_SUPPORTED)
#ifdef PNG_READ_INTERLACING_SUPPORTED
num_pass = png_set_interlace_handling(read_ptr);
# ifdef PNG_WRITE_SUPPORTED
png_set_interlace_handling(write_ptr);
# endif
#else
num_pass = 1;
if (png_set_interlace_handling(write_ptr) != num_pass)
png_error(write_ptr, "png_set_interlace_handling: inconsistent num_pass");
#endif
#ifdef PNGTEST_TIMING
@ -1360,11 +1384,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
{
#ifndef SINGLE_ROWBUF_ALLOC
pngtest_debug2("Allocating row buffer (pass %d, y = %u)...", pass, y);
row_buf = (png_bytep)png_malloc(read_ptr,
png_get_rowbytes(read_ptr, read_info_ptr));
pngtest_debug2("\t0x%08lx (%u bytes)", (unsigned long)row_buf,
png_get_rowbytes(read_ptr, read_info_ptr));
pngtest_debug2("\t0x%08lx (%lu bytes)", (unsigned long)row_buf,
(unsigned long)png_get_rowbytes(read_ptr, read_info_ptr));
#endif /* !SINGLE_ROWBUF_ALLOC */
png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1);
@ -1381,7 +1406,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
t_encode += (t_stop - t_start);
t_start = t_stop;
#endif
#endif /* PNG_WRITE_SUPPORTED */
#endif /* WRITE */
#ifndef SINGLE_ROWBUF_ALLOC
pngtest_debug2("Freeing row buffer (pass %d, y = %u)", pass, y);
@ -1391,11 +1416,13 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
}
}
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
png_free_data(read_ptr, read_info_ptr, PNG_FREE_UNKN, -1);
#endif
#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1);
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
# ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
png_free_data(read_ptr, read_info_ptr, PNG_FREE_UNKN, -1);
# endif
# ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1);
# endif
#endif
pngtest_debug("Reading and writing end_info data");
@ -1412,7 +1439,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
pngtest_check_text_support(read_ptr, text_ptr, num_text);
if (verbose)
if (verbose != 0)
{
int i;
@ -1432,11 +1459,11 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
{
png_timep mod_time;
if (png_get_tIME(read_ptr, end_info_ptr, &mod_time))
if (png_get_tIME(read_ptr, end_info_ptr, &mod_time) != 0)
{
png_set_tIME(write_ptr, write_end_info_ptr, mod_time);
#ifdef PNG_TIME_RFC1123_SUPPORTED
if (png_convert_to_rfc1123_buffer(tIME_string, mod_time))
if (png_convert_to_rfc1123_buffer(tIME_string, mod_time) != 0)
tIME_string[(sizeof tIME_string) - 1] = '\0';
else
@ -1446,7 +1473,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
}
tIME_chunk_present++;
#endif /* PNG_TIME_RFC1123_SUPPORTED */
#endif /* TIME_RFC1123 */
}
}
#endif
@ -1456,7 +1483,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
int num_unknowns = png_get_unknown_chunks(read_ptr, end_info_ptr,
&unknowns);
if (num_unknowns)
if (num_unknowns != 0)
{
png_set_unknown_chunks(write_ptr, write_end_info_ptr, unknowns,
num_unknowns);
@ -1497,7 +1524,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
#ifdef PNG_EASY_ACCESS_SUPPORTED
if (verbose)
if (verbose != 0)
{
png_uint_32 iwidth, iheight;
iwidth = png_get_image_width(write_ptr, write_info_ptr);
@ -1575,15 +1602,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
}
#ifdef PNG_WRITE_SUPPORTED /* else nothing was written */
if (interlace_preserved != 0) /* else the files will be changed */
{
int wrote_question = 0;
for (;;)
{
static int wrote_question = 0;
png_size_t num_in, num_out;
char inbuf[256], outbuf[256];
num_in = fread(inbuf, 1, sizeof inbuf, fpin);
num_out = fread(outbuf, 1, sizeof outbuf, fpout);
@ -1615,7 +1641,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
return (0);
}
if (!num_in)
if (num_in == 0)
break;
if (memcmp(inbuf, outbuf, num_in))
@ -1652,7 +1678,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
}
}
}
#endif /* PNG_WRITE_SUPPORTED */
#endif /* WRITE */
FCLOSE(fpin);
FCLOSE(fpout);
@ -1675,6 +1701,8 @@ main(int argc, char *argv[])
int multiple = 0;
int ierror = 0;
png_structp dummy_ptr;
fprintf(STDERR, "\n Testing libpng version %s\n", PNG_LIBPNG_VER_STRING);
fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION);
fprintf(STDERR, "%s", png_get_copyright(NULL));
@ -1757,10 +1785,11 @@ main(int argc, char *argv[])
}
}
if (!multiple && argc == 3 + verbose)
if (multiple == 0 && argc == 3 + verbose)
outname = argv[2 + verbose];
if ((!multiple && argc > 3 + verbose) || (multiple && argc < 2))
if ((multiple == 0 && argc > 3 + verbose) ||
(multiple != 0 && argc < 2))
{
fprintf(STDERR,
"usage: %s [infile.png] [outfile.png]\n\t%s -m {infile.png}\n",
@ -1772,7 +1801,7 @@ main(int argc, char *argv[])
exit(1);
}
if (multiple)
if (multiple != 0)
{
int i;
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
@ -1782,6 +1811,9 @@ main(int argc, char *argv[])
{
int kerror;
fprintf(STDERR, "\n Testing %s:", argv[i]);
#if PNG_DEBUG > 0
fprintf(STDERR, "\n");
#endif
kerror = test_one_file(argv[i], outname);
if (kerror == 0)
{
@ -1796,7 +1828,7 @@ main(int argc, char *argv[])
#endif
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
for (k = 0; k<256; k++)
if (filters_used[k])
if (filters_used[k] != 0)
fprintf(STDERR, " Filter %d was used %lu times\n",
k, (unsigned long)filters_used[k]);
#endif
@ -1805,7 +1837,7 @@ main(int argc, char *argv[])
fprintf(STDERR, " tIME = %s\n", tIME_string);
tIME_chunk_present = 0;
#endif /* PNG_TIME_RFC1123_SUPPORTED */
#endif /* TIME_RFC1123 */
}
else
@ -1827,9 +1859,9 @@ main(int argc, char *argv[])
while (pinfo != NULL)
{
fprintf(STDERR, " %lu bytes at %x\n",
fprintf(STDERR, " %lu bytes at %p\n",
(unsigned long)pinfo->size,
(unsigned int)pinfo->pointer);
pinfo->pointer);
pinfo = pinfo->next;
}
}
@ -1863,7 +1895,12 @@ main(int argc, char *argv[])
status_dots_requested = 0;
if (i == 0 || verbose == 1 || ierror != 0)
{
fprintf(STDERR, "\n Testing %s:", inname);
#if PNG_DEBUG > 0
fprintf(STDERR, "\n");
#endif
}
kerror = test_one_file(inname, outname);
@ -1882,21 +1919,26 @@ main(int argc, char *argv[])
#endif
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
for (k = 0; k<256; k++)
if (filters_used[k])
if (filters_used[k] != 0)
fprintf(STDERR, " Filter %d was used %lu times\n",
k, (unsigned long)filters_used[k]);
#endif
#ifdef PNG_TIME_RFC1123_SUPPORTED
if (tIME_chunk_present != 0)
fprintf(STDERR, " tIME = %s\n", tIME_string);
#endif /* PNG_TIME_RFC1123_SUPPORTED */
#endif /* TIME_RFC1123 */
}
}
else
{
if (verbose == 0 && i != 2)
{
fprintf(STDERR, "\n Testing %s:", inname);
#if PNG_DEBUG > 0
fprintf(STDERR, "\n");
#endif
}
fprintf(STDERR, " FAIL\n");
ierror += kerror;
@ -1915,8 +1957,8 @@ main(int argc, char *argv[])
while (pinfo != NULL)
{
fprintf(STDERR, " %lu bytes at %x\n",
(unsigned long)pinfo->size, (unsigned int)pinfo->pointer);
fprintf(STDERR, " %lu bytes at %p\n",
(unsigned long)pinfo->size, pinfo->pointer);
pinfo = pinfo->next;
}
}
@ -1954,6 +1996,24 @@ main(int argc, char *argv[])
else
fprintf(STDERR, " libpng FAILS test\n");
dummy_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
fprintf(STDERR, " Default limits:\n");
fprintf(STDERR, " width_max = %lu\n",
(unsigned long) png_get_user_width_max(dummy_ptr));
fprintf(STDERR, " height_max = %lu\n",
(unsigned long) png_get_user_height_max(dummy_ptr));
if (png_get_chunk_cache_max(dummy_ptr) == 0)
fprintf(STDERR, " cache_max = unlimited\n");
else
fprintf(STDERR, " cache_max = %lu\n",
(unsigned long) png_get_chunk_cache_max(dummy_ptr));
if (png_get_chunk_malloc_max(dummy_ptr) == 0)
fprintf(STDERR, " malloc_max = unlimited\n");
else
fprintf(STDERR, " malloc_max = %lu\n",
(unsigned long) png_get_chunk_malloc_max(dummy_ptr));
png_destroy_read_struct(&dummy_ptr, NULL, NULL);
return (int)(ierror != 0);
}
#else
@ -1963,9 +2023,9 @@ main(void)
fprintf(STDERR,
" test ignored because libpng was not built with read support\n");
/* And skip this test */
return 77;
return PNG_LIBPNG_VER < 10600 ? 0 : 77;
}
#endif
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_2 Your_png_h_is_not_version_1_6_2;
typedef png_libpng_version_1_6_17 Your_png_h_is_not_version_1_6_17;

View File

@ -1,8 +1,8 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
* Last changed in libpng 1.6.2 [April 25, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 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.)
*
@ -57,7 +57,9 @@ png_set_packing(png_structrp png_ptr)
if (png_ptr->bit_depth < 8)
{
png_ptr->transformations |= PNG_PACK;
png_ptr->usr_bit_depth = 8;
# ifdef PNG_WRITE_SUPPORTED
png_ptr->usr_bit_depth = 8;
# endif
}
}
#endif
@ -98,7 +100,7 @@ png_set_interlace_handling(png_structrp png_ptr)
{
png_debug(1, "in png_set_interlace handling");
if (png_ptr && png_ptr->interlaced)
if (png_ptr != 0 && png_ptr->interlaced != 0)
{
png_ptr->transformations |= PNG_INTERLACE;
return (7);
@ -125,7 +127,7 @@ png_set_filler(png_structrp png_ptr, png_uint_32 filler, int filler_loc)
/* In libpng 1.6 it is possible to determine whether this is a read or write
* operation and therefore to do more checking here for a valid call.
*/
if (png_ptr->mode & PNG_IS_READ_STRUCT)
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)
{
# ifdef PNG_READ_FILLER_SUPPORTED
/* On read png_set_filler is always valid, regardless of the base PNG
@ -208,7 +210,7 @@ png_set_add_alpha(png_structrp png_ptr, png_uint_32 filler, int filler_loc)
png_set_filler(png_ptr, filler, filler_loc);
/* The above may fail to do anything. */
if (png_ptr->transformations & PNG_FILLER)
if ((png_ptr->transformations & PNG_FILLER) != 0)
png_ptr->transformations |= PNG_ADD_ALPHA;
}
@ -325,9 +327,16 @@ png_do_swap(png_row_infop row_info, png_bytep row)
for (i = 0; i < istop; i++, rp += 2)
{
#ifdef PNG_BUILTIN_BSWAP16_SUPPORTED
/* Feature added to libpng-1.6.11 for testing purposes, not
* enabled by default.
*/
*(png_uint_16*)rp = __builtin_bswap16(*(png_uint_16*)rp);
#else
png_byte t = *rp;
*rp = *(rp + 1);
*(rp + 1) = t;
#endif
}
}
}
@ -469,7 +478,7 @@ png_do_packswap(png_row_infop row_info, png_bytep row)
*rp = table[*rp];
}
}
#endif /* PNG_READ_PACKSWAP_SUPPORTED or PNG_WRITE_PACKSWAP_SUPPORTED */
#endif /* PACKSWAP || WRITE_PACKSWAP */
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
@ -501,7 +510,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
{
if (row_info->bit_depth == 8)
{
if (at_start) /* Skip initial filler */
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channel and, for sp, the filler */
sp += 2, ++dp;
@ -515,7 +524,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
else if (row_info->bit_depth == 16)
{
if (at_start) /* Skip initial filler */
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channel and, for sp, the filler */
sp += 4, dp += 2;
@ -541,7 +550,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
{
if (row_info->bit_depth == 8)
{
if (at_start) /* Skip initial filler */
if (at_start != 0) /* Skip initial filler */
++sp;
else /* Skip initial channels and, for sp, the filler */
sp += 4, dp += 3;
@ -555,7 +564,7 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
else if (row_info->bit_depth == 16)
{
if (at_start) /* Skip initial filler */
if (at_start != 0) /* Skip initial filler */
sp += 2;
else /* Skip initial channels and, for sp, the filler */
sp += 8, dp += 6;
@ -596,7 +605,7 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
{
png_debug(1, "in png_do_bgr");
if ((row_info->color_type & PNG_COLOR_MASK_COLOR))
if ((row_info->color_type & PNG_COLOR_MASK_COLOR) != 0)
{
png_uint_32 row_width = row_info->width;
if (row_info->bit_depth == 8)
@ -666,7 +675,7 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
#endif
}
}
#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */
#endif /* READ_BGR || WRITE_BGR */
#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
@ -769,7 +778,7 @@ png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
}
}
}
#endif /* PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED */
#endif /* CHECK_FOR_INVALID_INDEX */
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
@ -819,7 +828,7 @@ png_get_user_transform_ptr(png_const_structrp png_ptr)
png_uint_32 PNGAPI
png_get_current_row_number(png_const_structrp png_ptr)
{
/* See the comments in png.h - this is the sub-image row when reading and
/* See the comments in png.h - this is the sub-image row when reading an
* interlaced image.
*/
if (png_ptr != NULL)
@ -835,7 +844,6 @@ png_get_current_pass_number(png_const_structrp png_ptr)
return png_ptr->pass;
return 8; /* invalid */
}
#endif /* PNG_USER_TRANSFORM_INFO_SUPPORTED */
#endif /* PNG_READ_USER_TRANSFORM_SUPPORTED ||
PNG_WRITE_USER_TRANSFORM_SUPPORTED */
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
#endif /* USER_TRANSFORM_INFO */
#endif /* READ_USER_TRANSFORM || WRITE_USER_TRANSFORM */
#endif /* READ || WRITE */

View File

@ -1,14 +0,0 @@
# pngusr.dfa
#
# Build time configuration of libpng
#
# Enter build configuration options in this file
#
# Security settings: by default these limits are unset, you can change them
# here by entering the appropriate values as #defines preceded by '@' (to cause,
# them to be passed through to the build of pnglibconf.h), for example:
#
# @# define PNG_USER_WIDTH_MAX 1000000
# @# define PNG_USER_HEIGHT_MAX 1000000
# @# define PNG_USER_CHUNK_CACHE_MAX 128
# @# define PNG_USER_CHUNK_MALLOC_MAX 8000000

View File

@ -1,8 +1,8 @@
/* pngwio.c - functions for data output
*
* Last changed in libpng 1.6.0 [February 14, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.15 [November 20, 2014]
* Copyright (c) 1998-2014 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.)
*
@ -149,8 +149,11 @@ png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
# else
png_ptr->output_flush_fn = output_flush_fn;
# endif
#endif /* PNG_WRITE_FLUSH_SUPPORTED */
#else
PNG_UNUSED(output_flush_fn)
#endif /* WRITE_FLUSH */
#ifdef PNG_READ_SUPPORTED
/* It is an error to read while writing a png file */
if (png_ptr->read_data_fn != NULL)
{
@ -160,5 +163,6 @@ png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
"Can't set both read_data_fn and write_data_fn in the"
" same structure");
}
#endif
}
#endif /* PNG_WRITE_SUPPORTED */
#endif /* WRITE */

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* pngwtran.c - transforms the data in a row for PNG writers
*
* Last changed in libpng 1.6.0 [February 14, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 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.)
*
@ -14,90 +14,14 @@
#include "pngpriv.h"
#ifdef PNG_WRITE_SUPPORTED
#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
/* Transform the data according to the user's wishes. The order of
* transformations is significant.
*/
void /* PRIVATE */
png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
{
png_debug(1, "in png_do_write_transformations");
if (png_ptr == NULL)
return;
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
if (png_ptr->transformations & PNG_USER_TRANSFORM)
if (png_ptr->write_user_transform_fn != NULL)
(*(png_ptr->write_user_transform_fn)) /* User write transform
function */
(png_ptr, /* png_ptr */
row_info, /* row_info: */
/* png_uint_32 width; width of row */
/* png_size_t rowbytes; number of bytes in row */
/* png_byte color_type; color type of pixels */
/* png_byte bit_depth; bit depth of samples */
/* png_byte channels; number of channels (1-4) */
/* png_byte pixel_depth; bits per pixel (depth*channels) */
png_ptr->row_buf + 1); /* start of pixel data for row */
#endif
#ifdef PNG_WRITE_FILLER_SUPPORTED
if (png_ptr->transformations & PNG_FILLER)
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
!(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
#endif
#ifdef PNG_WRITE_PACKSWAP_SUPPORTED
if (png_ptr->transformations & PNG_PACKSWAP)
png_do_packswap(row_info, png_ptr->row_buf + 1);
#endif
#ifdef PNG_WRITE_PACK_SUPPORTED
if (png_ptr->transformations & PNG_PACK)
png_do_pack(row_info, png_ptr->row_buf + 1,
(png_uint_32)png_ptr->bit_depth);
#endif
#ifdef PNG_WRITE_SWAP_SUPPORTED
if (png_ptr->transformations & PNG_SWAP_BYTES)
png_do_swap(row_info, png_ptr->row_buf + 1);
#endif
#ifdef PNG_WRITE_SHIFT_SUPPORTED
if (png_ptr->transformations & PNG_SHIFT)
png_do_shift(row_info, png_ptr->row_buf + 1,
&(png_ptr->shift));
#endif
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
if (png_ptr->transformations & PNG_SWAP_ALPHA)
png_do_write_swap_alpha(row_info, png_ptr->row_buf + 1);
#endif
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
if (png_ptr->transformations & PNG_INVERT_ALPHA)
png_do_write_invert_alpha(row_info, png_ptr->row_buf + 1);
#endif
#ifdef PNG_WRITE_BGR_SUPPORTED
if (png_ptr->transformations & PNG_BGR)
png_do_bgr(row_info, png_ptr->row_buf + 1);
#endif
#ifdef PNG_WRITE_INVERT_SUPPORTED
if (png_ptr->transformations & PNG_INVERT_MONO)
png_do_invert(row_info, png_ptr->row_buf + 1);
#endif
}
#ifdef PNG_WRITE_PACK_SUPPORTED
/* Pack pixels into bytes. Pass the true bit depth in bit_depth. The
* row_info bit depth should be 8 (one pixel per byte). The channels
* should be 1 (this only happens on grayscale and paletted images).
*/
void /* PRIVATE */
static void
png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
{
png_debug(1, "in png_do_pack");
@ -242,7 +166,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
* would pass 3 as bit_depth, and this routine would translate the
* data to 0 to 15.
*/
void /* PRIVATE */
static void
png_do_shift(png_row_infop row_info, png_bytep row,
png_const_color_8p bit_depth)
{
@ -253,7 +177,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
int shift_start[4], shift_dec[4];
int channels = 0;
if (row_info->color_type & PNG_COLOR_MASK_COLOR)
if ((row_info->color_type & PNG_COLOR_MASK_COLOR) != 0)
{
shift_start[channels] = row_info->bit_depth - bit_depth->red;
shift_dec[channels] = bit_depth->red;
@ -275,7 +199,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
channels++;
}
if (row_info->color_type & PNG_COLOR_MASK_ALPHA)
if ((row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0)
{
shift_start[channels] = row_info->bit_depth - bit_depth->alpha;
shift_dec[channels] = bit_depth->alpha;
@ -381,7 +305,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
#endif
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
void /* PRIVATE */
static void
png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
{
png_debug(1, "in png_do_write_swap_alpha");
@ -429,7 +353,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = save[1];
}
}
#endif /* PNG_WRITE_16BIT_SUPPORTED */
#endif /* WRITE_16BIT */
}
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
@ -468,14 +392,14 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = save[1];
}
}
#endif /* PNG_WRITE_16BIT_SUPPORTED */
#endif /* WRITE_16BIT */
}
}
}
#endif
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
void /* PRIVATE */
static void
png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
{
png_debug(1, "in png_do_write_invert_alpha");
@ -525,7 +449,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = (png_byte)(255 - *(sp++));
}
}
#endif /* PNG_WRITE_16BIT_SUPPORTED */
#endif /* WRITE_16BIT */
}
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
@ -563,75 +487,88 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = (png_byte)(255 - *(sp++));
}
}
#endif /* PNG_WRITE_16BIT_SUPPORTED */
#endif /* WRITE_16BIT */
}
}
}
#endif
#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
#ifdef PNG_MNG_FEATURES_SUPPORTED
/* Undoes intrapixel differencing */
/* Transform the data according to the user's wishes. The order of
* transformations is significant.
*/
void /* PRIVATE */
png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
{
png_debug(1, "in png_do_write_intrapixel");
png_debug(1, "in png_do_write_transformations");
if ((row_info->color_type & PNG_COLOR_MASK_COLOR))
{
int bytes_per_pixel;
png_uint_32 row_width = row_info->width;
if (row_info->bit_depth == 8)
{
png_bytep rp;
png_uint_32 i;
if (png_ptr == NULL)
return;
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
bytes_per_pixel = 3;
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
if ((png_ptr->transformations & PNG_USER_TRANSFORM) != 0)
if (png_ptr->write_user_transform_fn != NULL)
(*(png_ptr->write_user_transform_fn)) /* User write transform
function */
(png_ptr, /* png_ptr */
row_info, /* row_info: */
/* png_uint_32 width; width of row */
/* png_size_t rowbytes; number of bytes in row */
/* png_byte color_type; color type of pixels */
/* png_byte bit_depth; bit depth of samples */
/* png_byte channels; number of channels (1-4) */
/* png_byte pixel_depth; bits per pixel (depth*channels) */
png_ptr->row_buf + 1); /* start of pixel data for row */
#endif
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
bytes_per_pixel = 4;
#ifdef PNG_WRITE_FILLER_SUPPORTED
if ((png_ptr->transformations & PNG_FILLER) != 0)
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
!(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
#endif
else
return;
#ifdef PNG_WRITE_PACKSWAP_SUPPORTED
if ((png_ptr->transformations & PNG_PACKSWAP) != 0)
png_do_packswap(row_info, png_ptr->row_buf + 1);
#endif
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
{
*(rp) = (png_byte)((*rp - *(rp + 1)) & 0xff);
*(rp + 2) = (png_byte)((*(rp + 2) - *(rp + 1)) & 0xff);
}
}
#ifdef PNG_WRITE_PACK_SUPPORTED
if ((png_ptr->transformations & PNG_PACK) != 0)
png_do_pack(row_info, png_ptr->row_buf + 1,
(png_uint_32)png_ptr->bit_depth);
#endif
#ifdef PNG_WRITE_16BIT_SUPPORTED
else if (row_info->bit_depth == 16)
{
png_bytep rp;
png_uint_32 i;
#ifdef PNG_WRITE_SWAP_SUPPORTED
# ifdef PNG_16BIT_SUPPORTED
if ((png_ptr->transformations & PNG_SWAP_BYTES) != 0)
png_do_swap(row_info, png_ptr->row_buf + 1);
# endif
#endif
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
bytes_per_pixel = 6;
#ifdef PNG_WRITE_SHIFT_SUPPORTED
if ((png_ptr->transformations & PNG_SHIFT) != 0)
png_do_shift(row_info, png_ptr->row_buf + 1,
&(png_ptr->shift));
#endif
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
bytes_per_pixel = 8;
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
if ((png_ptr->transformations & PNG_SWAP_ALPHA) != 0)
png_do_write_swap_alpha(row_info, png_ptr->row_buf + 1);
#endif
else
return;
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
png_do_write_invert_alpha(row_info, png_ptr->row_buf + 1);
#endif
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
{
png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1);
png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3);
png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5);
png_uint_32 red = (png_uint_32)((s0 - s1) & 0xffffL);
png_uint_32 blue = (png_uint_32)((s2 - s1) & 0xffffL);
*(rp ) = (png_byte)((red >> 8) & 0xff);
*(rp + 1) = (png_byte)(red & 0xff);
*(rp + 4) = (png_byte)((blue >> 8) & 0xff);
*(rp + 5) = (png_byte)(blue & 0xff);
}
}
#endif /* PNG_WRITE_16BIT_SUPPORTED */
}
#ifdef PNG_WRITE_BGR_SUPPORTED
if ((png_ptr->transformations & PNG_BGR) != 0)
png_do_bgr(row_info, png_ptr->row_buf + 1);
#endif
#ifdef PNG_WRITE_INVERT_SUPPORTED
if ((png_ptr->transformations & PNG_INVERT_MONO) != 0)
png_do_invert(row_info, png_ptr->row_buf + 1);
#endif
}
#endif /* PNG_MNG_FEATURES_SUPPORTED */
#endif /* PNG_WRITE_SUPPORTED */
#endif /* WRITE_TRANSFORMS */
#endif /* WRITE */

View File

@ -1,8 +1,8 @@
/* pngwutil.c - utilities to write a PNG file
*
* Last changed in libpng 1.6.2 [April 25, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* Last changed in libpng 1.6.17 [March 26, 2015]
* Copyright (c) 1998-2015 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.)
*
@ -23,10 +23,10 @@
void PNGAPI
png_save_uint_32(png_bytep buf, png_uint_32 i)
{
buf[0] = (png_byte)((i >> 24) & 0xff);
buf[1] = (png_byte)((i >> 16) & 0xff);
buf[2] = (png_byte)((i >> 8) & 0xff);
buf[3] = (png_byte)(i & 0xff);
buf[0] = (png_byte)(i >> 24);
buf[1] = (png_byte)(i >> 16);
buf[2] = (png_byte)(i >> 8);
buf[3] = (png_byte)(i );
}
/* Place a 16-bit number into a buffer in PNG byte order.
@ -36,8 +36,8 @@ png_save_uint_32(png_bytep buf, png_uint_32 i)
void PNGAPI
png_save_uint_16(png_bytep buf, unsigned int i)
{
buf[0] = (png_byte)((i >> 8) & 0xff);
buf[1] = (png_byte)(i & 0xff);
buf[0] = (png_byte)(i >> 8);
buf[1] = (png_byte)(i );
}
#endif
@ -136,7 +136,7 @@ png_write_chunk_data(png_structrp png_ptr, png_const_bytep data,
png_write_data(png_ptr, data, length);
/* Update the CRC after writing the data,
* in case that the user I/O routine alters it.
* in case the user I/O routine alters it.
*/
png_calculate_crc(png_ptr, data, length);
}
@ -181,7 +181,7 @@ png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name,
/* On 64 bit architectures 'length' may not fit in a png_uint_32. */
if (length > PNG_UINT_31_MAX)
png_error(png_ptr, "length exceeds PNG maxima");
png_error(png_ptr, "length exceeds PNG maximum");
png_write_chunk_header(png_ptr, chunk_name, (png_uint_32)length);
png_write_chunk_data(png_ptr, data, length);
@ -204,14 +204,14 @@ png_write_chunk(png_structrp png_ptr, png_const_bytep chunk_string,
static png_alloc_size_t
png_image_size(png_structrp png_ptr)
{
/* Only return sizes up to the maximum of a png_uint_32, do this by limiting
/* Only return sizes up to the maximum of a png_uint_32; do this by limiting
* the width and height used to 15 bits.
*/
png_uint_32 h = png_ptr->height;
if (png_ptr->rowbytes < 32768 && h < 32768)
{
if (png_ptr->interlaced)
if (png_ptr->interlaced != 0)
{
/* Interlacing makes the image larger because of the replication of
* both the filter byte and the padding to a byte boundary.
@ -286,9 +286,7 @@ optimize_cmf(png_bytep data, png_alloc_size_t data_size)
}
}
}
#else
# define optimize_cmf(dp,dl) ((void)0)
#endif /* PNG_WRITE_OPTIMIZE_CMF_SUPPORTED */
#endif /* WRITE_OPTIMIZE_CMF */
/* Initialize the compressor for the appropriate type of compression. */
static int
@ -297,6 +295,7 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
{
if (png_ptr->zowner != 0)
{
#if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_ERROR_TEXT_SUPPORTED)
char msg[64];
PNG_STRING_FROM_CHUNK(msg, owner);
@ -308,7 +307,8 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
* are minimal.
*/
(void)png_safecat(msg, (sizeof msg), 10, " using zstream");
# if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC
#endif
#if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC
png_warning(png_ptr, msg);
/* Attempt sane error recovery */
@ -319,9 +319,9 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
}
png_ptr->zowner = 0;
# else
#else
png_error(png_ptr, msg);
# endif
#endif
}
{
@ -334,7 +334,7 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
if (owner == png_IDAT)
{
if (png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY)
if ((png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY) != 0)
strategy = png_ptr->zlib_strategy;
else if (png_ptr->do_filter != PNG_FILTER_NONE)
@ -346,20 +346,20 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
else
{
# ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
level = png_ptr->zlib_text_level;
method = png_ptr->zlib_text_method;
windowBits = png_ptr->zlib_text_window_bits;
memLevel = png_ptr->zlib_text_mem_level;
strategy = png_ptr->zlib_text_strategy;
# else
#else
/* If customization is not supported the values all come from the
* IDAT values except for the strategy, which is fixed to the
* default. (This is the pre-1.6.0 behavior too, although it was
* implemented in a very different way.)
*/
strategy = Z_DEFAULT_STRATEGY;
# endif
#endif
}
/* Adjust 'windowBits' down if larger than 'data_size'; to stop this
@ -386,7 +386,7 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
}
/* Check against the previous initialized values, if any. */
if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) &&
if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0 &&
(png_ptr->zlib_set_level != level ||
png_ptr->zlib_set_method != method ||
png_ptr->zlib_set_window_bits != windowBits ||
@ -410,7 +410,7 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
/* Now initialize if required, setting the new parameters, otherwise just
* to a simple reset to the previous parameters.
*/
if (png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED)
if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0)
ret = deflateReset(&png_ptr->zstream);
else
@ -492,7 +492,7 @@ png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name,
int ret;
/* To find the length of the output it is necessary to first compress the
* input, the result is buffered rather than using the two-pass algorithm
* input. The result is buffered rather than using the two-pass algorithm
* that is used on the inflate side; deflate is assumed to be slower and a
* PNG writer is assumed to have more memory available than a PNG reader.
*
@ -589,7 +589,7 @@ png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name,
}
while (ret == Z_OK);
/* There may be some space left in the last output buffer, this needs to
/* There may be some space left in the last output buffer. This needs to
* be subtracted from output_len.
*/
output_len -= png_ptr->zstream.avail_out;
@ -612,14 +612,15 @@ png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name,
/* Reset zlib for another zTXt/iTXt or image data */
png_ptr->zowner = 0;
/* The only success case is Z_STREAM_END, input_len must be 0, if not this
/* The only success case is Z_STREAM_END, input_len must be 0; if not this
* is an internal error.
*/
if (ret == Z_STREAM_END && input_len == 0)
{
#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
/* Fix up the deflate header, if required */
optimize_cmf(comp->output, comp->input_len);
#endif
/* But Z_OK is returned, not Z_STREAM_END; this allows the claim
* function above to return Z_STREAM_END on an error (though it never
* does in the current versions of zlib.)
@ -662,7 +663,7 @@ png_write_compressed_data_out(png_structrp png_ptr, compression_state *comp)
if (output_len > 0)
png_error(png_ptr, "error writing ancillary chunked compressed data");
}
#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
#endif /* WRITE_COMPRESSED_TEXT */
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
@ -694,12 +695,12 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
while (*key && key_len < 79)
{
png_byte ch = (png_byte)(0xff & *key++);
png_byte ch = (png_byte)*key++;
if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/))
*new_key++ = ch, ++key_len, space = 0;
else if (!space)
else if (space == 0)
{
/* A space or an invalid character when one wasn't seen immediately
* before; output just a space.
@ -711,14 +712,14 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
bad_character = ch;
}
else if (!bad_character)
else if (bad_character == 0)
bad_character = ch; /* just skip it, record the first error */
}
if (key_len > 0 && space) /* trailing space */
if (key_len > 0 && space != 0) /* trailing space */
{
--key_len, --new_key;
if (!bad_character)
if (bad_character == 0)
bad_character = 32;
}
@ -728,11 +729,12 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
if (key_len == 0)
return 0;
#ifdef PNG_WARNINGS_SUPPORTED
/* Try to only output one warning per keyword: */
if (*key) /* keyword too long */
if (*key != 0) /* keyword too long */
png_warning(png_ptr, "keyword truncated");
else if (bad_character)
else if (bad_character != 0)
{
PNG_WARNING_PARAMETERS(p)
@ -741,10 +743,11 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
png_formatted_warning(png_ptr, p, "keyword \"@1\": bad character '0x@2'");
}
#endif /* WARNINGS */
return key_len;
}
#endif
#endif /* WRITE_TEXT || WRITE_pCAL || WRITE_iCCP || WRITE_sPLT */
/* Write the IHDR chunk, and update the png_struct with the necessary
* information. Note that the rest of this code depends upon this
@ -845,8 +848,8 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
*/
if (
#ifdef PNG_MNG_FEATURES_SUPPORTED
!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) &&
!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) != 0 &&
((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) == 0) &&
(color_type == PNG_COLOR_TYPE_RGB ||
color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
(filter_type == PNG_INTRAPIXEL_DIFFERENCING)) &&
@ -868,7 +871,7 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
interlace_type=PNG_INTERLACE_NONE;
#endif
/* Save the relevent information */
/* Save the relevant information */
png_ptr->bit_depth = (png_byte)bit_depth;
png_ptr->color_type = (png_byte)color_type;
png_ptr->interlaced = (png_byte)interlace_type;
@ -898,7 +901,7 @@ png_write_IHDR(png_structrp png_ptr, png_uint_32 width, png_uint_32 height,
/* Write the chunk */
png_write_complete_chunk(png_ptr, png_IHDR, buf, (png_size_t)13);
if (!(png_ptr->do_filter))
if ((png_ptr->do_filter) == PNG_NO_FILTERS)
{
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE ||
png_ptr->bit_depth < 8)
@ -927,7 +930,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
if ((
#ifdef PNG_MNG_FEATURES_SUPPORTED
!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) == 0 &&
#endif
num_pal == 0) || num_pal > 256)
{
@ -943,7 +946,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
}
}
if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR))
if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0)
{
png_warning(png_ptr,
"Ignoring request to write a PLTE chunk in grayscale PNG");
@ -998,7 +1001,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
* Z_FINISH: this is the end of the input, do a Z_FINISH and clean up
*
* The routine manages the acquire and release of the png_ptr->zstream by
* checking and (at the end) clearing png_ptr->zowner, it does some sanity
* checking and (at the end) clearing png_ptr->zowner; it does some sanity
* checks on the 'mode' flags while doing this.
*/
void /* PRIVATE */
@ -1058,7 +1061,7 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
input_len += png_ptr->zstream.avail_in;
png_ptr->zstream.avail_in = 0;
/* OUTPUT: write complete IDAT chunks when avail_out drops to zero, note
/* OUTPUT: write complete IDAT chunks when avail_out drops to zero. Note
* that these two zstream fields are preserved across the calls, therefore
* there is no need to set these up on entry to the loop.
*/
@ -1070,11 +1073,11 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
/* Write an IDAT containing the data then reset the buffer. The
* first IDAT may need deflate header optimization.
*/
# ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
if (!(png_ptr->mode & PNG_HAVE_IDAT) &&
png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)
#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
if ((png_ptr->mode & PNG_HAVE_IDAT) == 0 &&
png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)
optimize_cmf(data, png_image_size(png_ptr));
# endif
#endif
png_write_complete_chunk(png_ptr, png_IDAT, data, size);
png_ptr->mode |= PNG_HAVE_IDAT;
@ -1090,7 +1093,7 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
continue;
}
/* The order of these checks doesn't matter much; it just effect which
/* The order of these checks doesn't matter much; it just affects which
* possible error might be detected if multiple things go wrong at once.
*/
if (ret == Z_OK) /* most likely return code! */
@ -1116,11 +1119,11 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
png_bytep data = png_ptr->zbuffer_list->output;
uInt size = png_ptr->zbuffer_size - png_ptr->zstream.avail_out;
# ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
if (!(png_ptr->mode & PNG_HAVE_IDAT) &&
png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)
optimize_cmf(data, png_image_size(png_ptr));
# endif
#ifdef PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
if ((png_ptr->mode & PNG_HAVE_IDAT) == 0 &&
png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)
optimize_cmf(data, png_image_size(png_ptr));
#endif
png_write_complete_chunk(png_ptr, png_IDAT, data, size);
png_ptr->zstream.avail_out = 0;
@ -1193,6 +1196,7 @@ png_write_iCCP(png_structrp png_ptr, png_const_charp name,
png_uint_32 profile_len;
png_byte new_name[81]; /* 1 byte for the compression byte */
compression_state comp;
png_uint_32 temp;
png_debug(1, "in png_write_iCCP");
@ -1207,7 +1211,8 @@ png_write_iCCP(png_structrp png_ptr, png_const_charp name,
if (profile_len < 132)
png_error(png_ptr, "ICC profile too short");
if (profile_len & 0x03)
temp = (png_uint_32) (*(profile+8));
if (temp > 3 && (profile_len & 0x03))
png_error(png_ptr, "ICC profile length invalid (not a multiple of 4)");
{
@ -1339,7 +1344,7 @@ png_write_sBIT(png_structrp png_ptr, png_const_color_8p sbit, int color_type)
png_debug(1, "in png_write_sBIT");
/* Make sure we don't depend upon the order of PNG_COLOR_8 */
if (color_type & PNG_COLOR_MASK_COLOR)
if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
{
png_byte maxbits;
@ -1372,7 +1377,7 @@ png_write_sBIT(png_structrp png_ptr, png_const_color_8p sbit, int color_type)
size = 1;
}
if (color_type & PNG_COLOR_MASK_ALPHA)
if ((color_type & PNG_COLOR_MASK_ALPHA) != 0)
{
if (sbit->alpha == 0 || sbit->alpha > png_ptr->usr_bit_depth)
{
@ -1459,9 +1464,9 @@ png_write_tRNS(png_structrp png_ptr, png_const_bytep trans_alpha,
png_save_uint_16(buf + 2, tran->green);
png_save_uint_16(buf + 4, tran->blue);
#ifdef PNG_WRITE_16BIT_SUPPORTED
if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))
if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]) != 0)
#else
if (buf[0] | buf[2] | buf[4])
if ((buf[0] | buf[2] | buf[4]) != 0)
#endif
{
png_app_warning(png_ptr,
@ -1492,8 +1497,8 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
{
if (
#ifdef PNG_MNG_FEATURES_SUPPORTED
(png_ptr->num_palette ||
(!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) &&
(png_ptr->num_palette != 0 ||
(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) == 0) &&
#endif
back->index >= png_ptr->num_palette)
{
@ -1505,15 +1510,15 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type)
png_write_complete_chunk(png_ptr, png_bKGD, buf, (png_size_t)1);
}
else if (color_type & PNG_COLOR_MASK_COLOR)
else if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
{
png_save_uint_16(buf, back->red);
png_save_uint_16(buf + 2, back->green);
png_save_uint_16(buf + 4, back->blue);
#ifdef PNG_WRITE_16BIT_SUPPORTED
if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))
if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]) != 0)
#else
if (buf[0] | buf[2] | buf[4])
if ((buf[0] | buf[2] | buf[4]) != 0)
#endif
{
png_warning(png_ptr,
@ -1608,7 +1613,7 @@ png_write_tEXt(png_structrp png_ptr, png_const_charp key, png_const_charp text,
*/
png_write_chunk_data(png_ptr, new_key, key_len + 1);
if (text_len)
if (text_len != 0)
png_write_chunk_data(png_ptr, (png_const_bytep)text, text_len);
png_write_chunk_end(png_ptr);
@ -1619,14 +1624,13 @@ png_write_tEXt(png_structrp png_ptr, png_const_charp key, png_const_charp text,
/* Write a compressed text chunk */
void /* PRIVATE */
png_write_zTXt(png_structrp png_ptr, png_const_charp key, png_const_charp text,
png_size_t text_len, int compression)
int compression)
{
png_uint_32 key_len;
png_byte new_key[81];
compression_state comp;
png_debug(1, "in png_write_zTXt");
PNG_UNUSED(text_len) /* Always use strlen */
if (compression == PNG_TEXT_COMPRESSION_NONE)
{
@ -1734,7 +1738,7 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
png_text_compress_init(&comp, (png_const_bytep)text, strlen(text));
if (compression)
if (compression != 0)
{
if (png_text_compress(png_ptr, png_iTXt, &comp, prefix_len) != Z_OK)
png_error(png_ptr, png_ptr->zstream.msg);
@ -1757,11 +1761,11 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
png_write_chunk_data(png_ptr, (png_const_bytep)lang_key, lang_key_len);
if (compression)
if (compression != 0)
png_write_compressed_data_out(png_ptr, &comp);
else
png_write_chunk_data(png_ptr, (png_const_bytep)text, comp.input_len);
png_write_chunk_data(png_ptr, (png_const_bytep)text, comp.output_len);
png_write_chunk_end(png_ptr);
}
@ -1981,12 +1985,13 @@ png_write_start_row(png_structrp png_ptr)
}
/* We only need to keep the previous row if we are using one of these. */
if (png_ptr->do_filter & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH))
if ((png_ptr->do_filter &
(PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH)) != 0)
{
/* Set up previous row buffer */
png_ptr->prev_row = (png_bytep)png_calloc(png_ptr, buf_size);
if (png_ptr->do_filter & PNG_FILTER_UP)
if ((png_ptr->do_filter & PNG_FILTER_UP) != 0)
{
png_ptr->up_row = (png_bytep)png_malloc(png_ptr,
png_ptr->rowbytes + 1);
@ -1994,7 +1999,7 @@ png_write_start_row(png_structrp png_ptr)
png_ptr->up_row[0] = PNG_FILTER_VALUE_UP;
}
if (png_ptr->do_filter & PNG_FILTER_AVG)
if ((png_ptr->do_filter & PNG_FILTER_AVG) != 0)
{
png_ptr->avg_row = (png_bytep)png_malloc(png_ptr,
png_ptr->rowbytes + 1);
@ -2002,7 +2007,7 @@ png_write_start_row(png_structrp png_ptr)
png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG;
}
if (png_ptr->do_filter & PNG_FILTER_PAETH)
if ((png_ptr->do_filter & PNG_FILTER_PAETH) != 0)
{
png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr,
png_ptr->rowbytes + 1);
@ -2010,13 +2015,13 @@ png_write_start_row(png_structrp png_ptr)
png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH;
}
}
#endif /* PNG_WRITE_FILTER_SUPPORTED */
#endif /* WRITE_FILTER */
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
/* If interlaced, we need to set up width and height of pass */
if (png_ptr->interlaced)
if (png_ptr->interlaced != 0)
{
if (!(png_ptr->transformations & PNG_INTERLACE))
if ((png_ptr->transformations & PNG_INTERLACE) == 0)
{
png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 -
png_pass_ystart[0]) / png_pass_yinc[0];
@ -2071,10 +2076,10 @@ png_write_finish_row(png_structrp png_ptr)
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
/* If interlaced, go to next pass */
if (png_ptr->interlaced)
if (png_ptr->interlaced != 0)
{
png_ptr->row_number = 0;
if (png_ptr->transformations & PNG_INTERLACE)
if ((png_ptr->transformations & PNG_INTERLACE) != 0)
{
png_ptr->pass++;
}
@ -2099,7 +2104,7 @@ png_write_finish_row(png_structrp png_ptr)
png_pass_ystart[png_ptr->pass]) /
png_pass_yinc[png_ptr->pass];
if (png_ptr->transformations & PNG_INTERLACE)
if ((png_ptr->transformations & PNG_INTERLACE) != 0)
break;
} while (png_ptr->usr_width == 0 || png_ptr->num_rows == 0);
@ -2309,7 +2314,8 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
* been specified by the application, and then writes the row out with the
* chosen filter.
*/
static void png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
static void /* PRIVATE */
png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
png_size_t row_bytes);
#define PNG_MAXSUM (((png_uint_32)(-1)) >> 1)
@ -2377,7 +2383,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
/* We don't need to test the 'no filter' case if this is the only filter
* that has been chosen, as it doesn't actually do anything to the data.
*/
if ((filter_to_do & PNG_FILTER_NONE) && filter_to_do != PNG_FILTER_NONE)
if ((filter_to_do & PNG_FILTER_NONE) != 0 && filter_to_do != PNG_FILTER_NONE)
{
png_bytep rp;
png_uint_32 sum = 0;
@ -2447,13 +2453,13 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
for (lp = row_buf + 1; i < row_bytes;
i++, rp++, lp++, dp++)
{
*dp = (png_byte)(((int)*rp - (int)*lp) & 0xff);
*dp = (png_byte)((int)*rp - (int)*lp);
}
best_row = png_ptr->sub_row;
}
else if (filter_to_do & PNG_FILTER_SUB)
else if ((filter_to_do & PNG_FILTER_SUB) != 0)
{
png_bytep rp, dp, lp;
png_uint_32 sum = 0, lmins = mins;
@ -2509,7 +2515,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
for (lp = row_buf + 1; i < row_bytes;
i++, rp++, lp++, dp++)
{
v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff);
v = *dp = (png_byte)((int)*rp - (int)*lp);
sum += (v < 128) ? v : 256 - v;
@ -2568,13 +2574,13 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
pp = prev_row + 1; i < row_bytes;
i++, rp++, pp++, dp++)
{
*dp = (png_byte)(((int)*rp - (int)*pp) & 0xff);
*dp = (png_byte)((int)*rp - (int)*pp);
}
best_row = png_ptr->up_row;
}
else if (filter_to_do & PNG_FILTER_UP)
else if ((filter_to_do & PNG_FILTER_UP) != 0)
{
png_bytep rp, dp, pp;
png_uint_32 sum = 0, lmins = mins;
@ -2619,7 +2625,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1,
pp = prev_row + 1; i < row_bytes; i++)
{
v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff);
v = *dp++ = (png_byte)((int)*rp++ - (int)*pp++);
sum += (v < 128) ? v : 256 - v;
@ -2677,18 +2683,18 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1,
pp = prev_row + 1; i < bpp; i++)
{
*dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff);
*dp++ = (png_byte)((int)*rp++ - ((int)*pp++ / 2));
}
for (lp = row_buf + 1; i < row_bytes; i++)
{
*dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2))
& 0xff);
*dp++ =
(png_byte)((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2));
}
best_row = png_ptr->avg_row;
}
else if (filter_to_do & PNG_FILTER_AVG)
else if ((filter_to_do & PNG_FILTER_AVG) != 0)
{
png_bytep rp, dp, pp, lp;
png_uint_32 sum = 0, lmins = mins;
@ -2732,7 +2738,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1,
pp = prev_row + 1; i < bpp; i++)
{
v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff);
v = *dp++ = (png_byte)((int)*rp++ - ((int)*pp++ / 2));
sum += (v < 128) ? v : 256 - v;
}
@ -2740,7 +2746,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
for (lp = row_buf + 1; i < row_bytes; i++)
{
v = *dp++ =
(png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff);
(png_byte)(((int)*rp++ - ((int)*pp++ + (int)*lp++) / 2));
sum += (v < 128) ? v : 256 - v;
@ -2790,7 +2796,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
}
/* Paeth filter */
if (filter_to_do == PNG_FILTER_PAETH)
if ((filter_to_do == PNG_FILTER_PAETH) != 0)
{
png_bytep rp, dp, pp, cp, lp;
png_size_t i;
@ -2798,7 +2804,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1,
pp = prev_row + 1; i < bpp; i++)
{
*dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff);
*dp++ = (png_byte)((int)*rp++ - (int)*pp++);
}
for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++)
@ -2824,12 +2830,12 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c;
*dp++ = (png_byte)(((int)*rp++ - p) & 0xff);
*dp++ = (png_byte)((int)*rp++ - p);
}
best_row = png_ptr->paeth_row;
}
else if (filter_to_do & PNG_FILTER_PAETH)
else if ((filter_to_do & PNG_FILTER_PAETH) != 0)
{
png_bytep rp, dp, pp, cp, lp;
png_uint_32 sum = 0, lmins = mins;
@ -2873,7 +2879,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1,
pp = prev_row + 1; i < bpp; i++)
{
v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff);
v = *dp++ = (png_byte)((int)*rp++ - (int)*pp++);
sum += (v < 128) ? v : 256 - v;
}
@ -2899,7 +2905,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
pc = (p + pc) < 0 ? -(p + pc) : p + pc;
#endif
p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c;
#else /* PNG_SLOW_PAETH */
#else /* SLOW_PAETH */
p = a + b - c;
pa = abs(p - a);
pb = abs(p - b);
@ -2913,9 +2919,9 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
else
p = c;
#endif /* PNG_SLOW_PAETH */
#endif /* SLOW_PAETH */
v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff);
v = *dp++ = (png_byte)((int)*rp++ - p);
sum += (v < 128) ? v : 256 - v;
@ -2962,7 +2968,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
best_row = png_ptr->paeth_row;
}
}
#endif /* PNG_WRITE_FILTER_SUPPORTED */
#endif /* WRITE_FILTER */
/* Do the actual writing of the filtered row data from the chosen filter. */
png_write_filtered_row(png_ptr, best_row, row_info->rowbytes+1);
@ -2982,7 +2988,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
png_ptr->prev_filters[j] = best_row[0];
}
#endif
#endif /* PNG_WRITE_FILTER_SUPPORTED */
#endif /* WRITE_FILTER */
}
@ -2997,6 +3003,7 @@ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
png_compress_IDAT(png_ptr, filtered_row, full_row_length, Z_NO_FLUSH);
#ifdef PNG_WRITE_FILTER_SUPPORTED
/* Swap the current and previous rows */
if (png_ptr->prev_row != NULL)
{
@ -3006,6 +3013,7 @@ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
png_ptr->prev_row = png_ptr->row_buf;
png_ptr->row_buf = tptr;
}
#endif /* WRITE_FILTER */
/* Finish row - updates counters and flushes zlib if last row */
png_write_finish_row(png_ptr);
@ -3018,6 +3026,6 @@ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
{
png_write_flush(png_ptr);
}
#endif
#endif /* WRITE_FLUSH */
}
#endif /* PNG_WRITE_SUPPORTED */
#endif /* WRITE */

View File

@ -1,7 +1,7 @@
VisualStudio instructions
libpng version 1.6.2 - April 25, 2013
libpng version 1.6.17 - March 26, 2015
Copyright (c) 1998-2010 Glenn Randers-Pehrson

View File

@ -2,7 +2,7 @@
<!--
* zlib.props - location of zlib source
*
* libpng version 1.6.2 - April 25, 2013
* libpng version 1.6.17 - March 26, 2015
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
*
@ -24,7 +24,7 @@
source.
If you use a relative directory name (as below) then it must be
relative to the project directories; these are one level deepers than
relative to the project directories; these are one level deeper than
the directories containing this file.
If the version of zlib you use does not match that used when the
@ -32,7 +32,7 @@
versions do not match. The zlib version used in this build is recorded
below:
-->
<ZLibSrcDir>..\..\..\..\zlib-1.2.5</ZLibSrcDir>
<ZLibSrcDir>..\..\..\..\zlib-1.2.8</ZLibSrcDir>
<!-- The following line allows compilation for an ARM target with Visual
Studio 2012. Notice that this is not supported by the Visual Studio

View File

@ -1,9 +1,9 @@
Makefiles for libpng version 1.6.2 - April 25, 2013
Makefiles for libpng version 1.6.17 - March 26, 2015
pnglibconf.h.prebuilt => Stores configuration settings
makefile.linux => Linux/ELF makefile
(gcc, creates libpng16.so.16.1.6.2)
(gcc, creates libpng16.so.16.1.6.17)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from
@ -19,8 +19,6 @@ pnglibconf.h.prebuilt => Stores configuration settings
makefile.darwin => Darwin makefile, can use on MacosX
makefile.dec => DEC Alpha UNIX makefile
makefile.dj2 => DJGPP 2 makefile
makefile.elf => Linux/ELF makefile symbol versioning,
(gcc, creates libpng16.so.16.1.6.2)
makefile.freebsd => FreeBSD makefile
makefile.gcc => Generic gcc makefile
makefile.hpgcc => HPUX makefile using gcc
@ -35,12 +33,12 @@ pnglibconf.h.prebuilt => Stores configuration settings
makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.sggcc => Silicon Graphics (gcc,
creates libpng16.so.16.1.6.2)
creates libpng16.so.16.1.6.17)
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng16.so.16.1.6.2)
creates libpng16.so.16.1.6.17)
makefile.so9 => Solaris 9 makefile (gcc,
creates libpng16.so.16.1.6.2)
creates libpng16.so.16.1.6.17)
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.sunos => Sun makefile
makefile.32sunu => Sun Ultra 32-bit makefile

View File

@ -1,137 +0,0 @@
#!/bin/sh
#
# Check the format of the source files in the current directory - checks for a
# line length of 80 characters max and no tab characters.
#
# Optionally arguments are files or directories to check.
#
# -v: output the long lines (makes fixing them easier)
# -e: spawn an editor for each file that needs a change ($EDITOR must be
# defined). When using -e the script MUST be run from an interactive
# command line.
verbose=
edit=
vers=
test "$1" = "-v" && {
shift
verbose=yes
}
test "$1" = "-e" && {
shift
if test -n "$EDITOR"
then
edit=yes
# Copy the standard streams for the editor
exec 3>&0 4>&1 5>&2
else
echo "chkfmt -e: EDITOR must be defined" >&2
exit 1
fi
}
# Function to edit a single file - if the file isn't changed ask the user
# whether or not to continue. This stuff only works if the script is run from
# the command line (otherwise, don't specify -e or you will be sorry).
doed(){
cp "$file" "$file".orig
"$EDITOR" "$file" 0>&3 1>&4 2>&5 3>&- 4>&- 5>&- || exit 1
if cmp -s "$file".orig "$file"
then
rm "$file".orig
echo -n "$file: file not changed, type anything to continue: " >&5
read ans 0>&3
test -n "$ans" || return 1
fi
return 0
}
# In beta versions the version string which appears in files can be a little
# long and cause spuriously overlong lines. To avoid this subtitute the version
# string with a 'standard' version a.b.cc before checking for long lines.
if test -r png.h
then
vers="`sed -n -e \
's/^#define PNG_LIBPNG_VER_STRING .\([0-9]\.[0-9]\.[0-9][0-9a-z]*\).$/\1/p' \
png.h`"
echo "chkfmt: checking version $vers"
fi
if test -z "$vers"
then
echo "chkfmt: png.h not found, ignoring version number" >&2
fi
test -n "$1" || set -- .
find "$@" \( -type d \( -name '.git' -o -name '.libs' -o -name 'projects' \) \
-prune \) -o \( -type f \
! -name '*.[oa]' ! -name '*.l[oa]' ! -name '*.png' ! -name '*.out' \
! -name '*.jpg' ! -name '*.patch' ! -name '*.obj' ! -name '*.exe' \
! -name '*.com' ! -name '*.tar.*' ! -name '*.zip' ! -name '*.ico' \
! -name '*.res' ! -name '*.rc' ! -name '*.mms' ! -name '*.rej' \
! -name '*.dsp' ! -name '*.orig' ! -name '*.dfn' ! -name '*.swp' \
! -name '~*' ! -name '*.3' \
! -name 'missing' ! -name 'mkinstalldirs' ! -name 'depcomp' \
! -name 'aclocal.m4' ! -name 'install-sh' ! -name 'Makefile.in' \
! -name 'ltmain.sh' ! -name 'config*' -print \) | {
st=0
while read file
do
case "$file" in
*.mak|*[Mm]akefile.*|*[Mm]akefile)
# Makefiles require tabs, dependency lines can be this long.
check_tabs=
line_length=100;;
*.awk)
# Includes literal tabs
check_tabs=
# The following is arbitrary
line_length=132;;
*contrib/*/*.[ch])
check_tabs=yes
line_length=96;;
*)
check_tabs=yes
line_length=80;;
esac
# Note that vers can only contain 0-9, . and a-z
if test -n "$vers"
then
sed -e "s/$vers/a.b.cc/g" "$file" >"$file".$$
else
cp "$file" "$file".$$
fi
splt="`fold -$line_length "$file".$$ | diff -c "$file".$$ -`"
rm "$file".$$
if test -n "$splt"
then
echo "$file: lines too long"
st=1
if test -n "$EDITOR" -a -n "$edit"
then
doed "$file" || exit 1
elif test -n "$verbose"
then
echo "$splt"
fi
fi
if test -n "$check_tabs"
then
tab="`tr -c -d '\t' <"$file"`"
if test -n "$tab"
then
echo "$file: file contains tab characters"
st=1
if test -n "$EDITOR" -a -n "$edit"
then
doed "$file" || exit 1
elif test -n "$verbose"
then
echo "$splt"
fi
fi
fi
done
exit $st
}

View File

@ -1,7 +1,7 @@
/* def.dfn - define format of libpng.def
/* def.c - define format of libpng.def
*
* Last changed in libpng version 1.5.7 [December 15, 2011]
* Copyright (c) 2010-2011 Glenn Randers-Pehrson
* Last changed in libpng version 1.6.16 [December 22, 2014]
* Copyright (c) 2011-2014 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@ -21,7 +21,7 @@ PNG_DFN "OS2 DESCRIPTION "PNG image compression library""
PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE"
PNG_DFN ""
PNG_DFN "EXPORTS"
PNG_DFN ";Version 1.6.2"
PNG_DFN ";Version 1.6.17"
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_DFN "@" SYMBOL_PREFIX "@@" name "@"

View File

@ -33,20 +33,20 @@ clean :
# Other dependencies.
png.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngpread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngset.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngget.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngrtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngrutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngerror.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngmem.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngrio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngwio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngtrans.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngwrite.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngwtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
pngwutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h, pnginfo.h, pngdebug.h
png.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngpread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngset.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngget.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngread.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngrtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngrutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngerror.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngmem.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngrio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngwio.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngtrans.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngwrite.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngwtran.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngwutil.obj : png.h, pngconf.h, pnglibconf.h, pngpriv.h, pngstruct.h,pnginfo.h, pngdebug.h
pngtest.obj : png.h, pngconf.h
pngtest.obj : png.h, pngconf.h, pnglibconf.h

View File

@ -1,203 +1,203 @@
#!/bin/awk -f
# scripts/dfn.awk - process a .dfn file
#
# last changed in libpng version 1.5.14 - February 4, 2013
#
# Copyright (c) 2013-2013 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# The output of this script is written to the file given by
# the variable 'out', which should be set on the command line.
# Error messages are printed to stdout and if any are printed
# the script will exit with error code 1.
BEGIN{
out="/dev/null" # as a flag
out_count=0 # count of output lines
err=0 # set if an error occured
sort=0 # sort the output
array[""]=""
}
# The output file must be specified before any input:
NR==1 && out == "/dev/null" {
print "out=output.file must be given on the command line"
# but continue without setting the error code, this allows the
# script to be checked easily
}
# Output can be sorted; two lines are recognized
$1 == "PNG_DFN_START_SORT"{
sort=0+$2
next
}
$1 ~ /^PNG_DFN_END_SORT/{
# Do a very simple, slow, sort; notice that blank lines won't be
# output by this
for (entry in array) {
while (array[entry] != "") {
key = entry
value = array[key]
array[key] = ""
for (alt in array) {
if (array[alt] != "" && alt < key) {
array[key] = value
value = array[alt]
key = alt
array[alt] = ""
}
}
print value >out
}
}
sort=0
next
}
/^[^"]*PNG_DFN *".*"[^"]*$/{
# A definition line, apparently correctly formated, extract the
# definition then replace any doubled "" that remain with a single
# double quote. Notice that the original doubled double quotes
# may have been split by tokenization
#
# Sometimes GCC splits the PNG_DFN lines, we know this has happened
# if the quotes aren't closed and must read another line. In this
# case it is essential to reject lines that start '#' because those
# are introduced #line directives.
orig=$0
line=$0
lineno=FNR
if (lineno == "") lineno=NR
if (sub(/^[^"]*PNG_DFN *"/,"",line) != 1) {
print "line", lineno ": processing failed:"
print orig
err=1
next
} else {
++out_count
}
# Now examine quotes within the value:
#
# @" - delete this and any following spaces
# "@ - delete this and any preceding spaces
# @' - replace this by a double quote
#
# This allows macro substitution by the C compiler thus:
#
# #define first_name John
# #define last_name Smith
#
# PNG_DFN"#define name @'@" first_name "@ @" last_name "@@'"
#
# Might get C preprocessed to:
#
# PNG_DFN "#define foo @'@" John "@ @" Smith "@@'"
#
# Which this script reduces to:
#
# #define name "John Smith"
#
while (1) {
# While there is an @" remove it and the next "@
if (line ~ /@"/) {
if (line ~ /@".*"@/) {
# Do this special case first to avoid swallowing extra spaces
# before or after the @ stuff:
if (!sub(/@" *"@/, "", line)) {
# Ok, do it in pieces - there has to be a non-space between the
# two. NOTE: really weird things happen if a leading @" is
# lost - the code will error out below (I believe).
if (!sub(/@" */, "", line) || !sub(/ *"@/, "", line)) {
print "line", lineno, ": internal error:", orig
exit 1
}
}
}
# There is no matching "@. Assume a split line
else while (1) {
if (getline nextline) {
# If the line starts with '#' it is a preprocesor line directive
# from cc -E, skip it:
if (nextline !~ /^#/) {
line = line " " nextline
break
}
} else {
# This is end-of-input - probably a missig "@ on the first line:
print "line", lineno ": unbalanced @\" ... \"@ pair"
err=1
next
}
}
# Keep going until all the @" have gone
continue
}
# Attempt to remove a trailing " (not preceded by '@') - if this can
# be done stop now, if not assume a split line again
if (sub(/"[^"]*$/, "", line))
break
# Read another line
while (1) {
if (getline nextline) {
if (nextline !~ /^#/) {
line = line " " nextline
# Go back to stripping @" "@ pairs
break
}
} else {
print "line", lineno ": unterminated PNG_DFN string"
err=1
next
}
}
}
# Put any needed double quotes in (at the end, because these would otherwise
# interfere with the processing above.)
gsub(/@'/,"\"", line)
# Remove any trailing spaces (not really required, but for
# editorial consistency
sub(/ *$/, "", line)
# Remove trailing CR
sub(/ $/, "", line)
if (sort) {
if (split(line, parts) < sort) {
print "line", lineno ": missing sort field:", line
err=1
} else
array[parts[sort]] = line
}
else
print line >out
next
}
/PNG_DFN/{
print "line", NR, "incorrectly formated PNG_DFN line:"
print $0
err = 1
}
END{
if (out_count > 0 || err > 0)
exit err
print "no definition lines found"
exit 1
}
#!/bin/awk -f
# scripts/dfn.awk - process a .dfn file
#
# last changed in libpng version 1.5.19 - August 21, 2014
#
# Copyright (c) 2013-2014 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# The output of this script is written to the file given by
# the variable 'out', which should be set on the command line.
# Error messages are printed to stdout and if any are printed
# the script will exit with error code 1.
BEGIN{
out="/dev/null" # as a flag
out_count=0 # count of output lines
err=0 # set if an error occurred
sort=0 # sort the output
array[""]=""
}
# The output file must be specified before any input:
NR==1 && out == "/dev/null" {
print "out=output.file must be given on the command line"
# but continue without setting the error code; this allows the
# script to be checked easily
}
# Output can be sorted; two lines are recognized
$1 == "PNG_DFN_START_SORT"{
sort=0+$2
next
}
$1 ~ /^PNG_DFN_END_SORT/{
# Do a very simple, slow, sort; notice that blank lines won't be
# output by this
for (entry in array) {
while (array[entry] != "") {
key = entry
value = array[key]
array[key] = ""
for (alt in array) {
if (array[alt] != "" && alt < key) {
array[key] = value
value = array[alt]
key = alt
array[alt] = ""
}
}
print value >out
}
}
sort=0
next
}
/^[^"]*PNG_DFN *".*"[^"]*$/{
# A definition line, apparently correctly formatted; extract the
# definition then replace any doubled "" that remain with a single
# double quote. Notice that the original doubled double quotes
# may have been split by tokenization
#
# Sometimes GCC splits the PNG_DFN lines; we know this has happened
# if the quotes aren't closed and must read another line. In this
# case it is essential to reject lines that start with '#' because those
# are introduced #line directives.
orig=$0
line=$0
lineno=FNR
if (lineno == "") lineno=NR
if (sub(/^[^"]*PNG_DFN *"/,"",line) != 1) {
print "line", lineno ": processing failed:"
print orig
err=1
next
} else {
++out_count
}
# Now examine quotes within the value:
#
# @" - delete this and any following spaces
# "@ - delete this and any preceding spaces
# @' - replace this by a double quote
#
# This allows macro substitution by the C compiler thus:
#
# #define first_name John
# #define last_name Smith
#
# PNG_DFN"#define name @'@" first_name "@ @" last_name "@@'"
#
# Might get C preprocessed to:
#
# PNG_DFN "#define foo @'@" John "@ @" Smith "@@'"
#
# Which this script reduces to:
#
# #define name "John Smith"
#
while (1) {
# While there is an @" remove it and the next "@
if (line ~ /@"/) {
if (line ~ /@".*"@/) {
# Do this special case first to avoid swallowing extra spaces
# before or after the @ stuff:
if (!sub(/@" *"@/, "", line)) {
# Ok, do it in pieces - there has to be a non-space between the
# two. NOTE: really weird things happen if a leading @" is
# lost - the code will error out below (I believe).
if (!sub(/@" */, "", line) || !sub(/ *"@/, "", line)) {
print "line", lineno, ": internal error:", orig
exit 1
}
}
}
# There is no matching "@. Assume a split line
else while (1) {
if (getline nextline) {
# If the line starts with '#' it is a preprocesor line directive
# from cc -E; skip it:
if (nextline !~ /^#/) {
line = line " " nextline
break
}
} else {
# This is end-of-input - probably a missing "@ on the first line:
print "line", lineno ": unbalanced @\" ... \"@ pair"
err=1
next
}
}
# Keep going until all the @" have gone
continue
}
# Attempt to remove a trailing " (not preceded by '@') - if this can
# be done, stop now; if not assume a split line again
if (sub(/"[^"]*$/, "", line))
break
# Read another line
while (1) {
if (getline nextline) {
if (nextline !~ /^#/) {
line = line " " nextline
# Go back to stripping @" "@ pairs
break
}
} else {
print "line", lineno ": unterminated PNG_DFN string"
err=1
next
}
}
}
# Put any needed double quotes in (at the end, because these would otherwise
# interfere with the processing above.)
gsub(/@'/,"\"", line)
# Remove any trailing spaces (not really required, but for
# editorial consistency
sub(/ *$/, "", line)
# Remove trailing CR
sub(/ $/, "", line)
if (sort) {
if (split(line, parts) < sort) {
print "line", lineno ": missing sort field:", line
err=1
} else
array[parts[sort]] = line
}
else
print line >out
next
}
/PNG_DFN/{
print "line", NR, "incorrectly formatted PNG_DFN line:"
print $0
err = 1
}
END{
if (out_count > 0 || err > 0)
exit err
print "no definition lines found"
exit 1
}

View File

@ -1,8 +1,8 @@
/* intprefix.dfn - generate an unprefixed internal symbol list
/* intprefix.c - generate an unprefixed internal symbol list
*
* Last changed in libpng version 1.6.0 [January 30, 2012]
* Copyright (c) 2012 Glenn Randers-Pehrson
* Last changed in libpng version 1.6.16 [December 22, 2014]
* Copyright (c) 2013-2014 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@ -15,5 +15,8 @@
#define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\
PNG_DFN "@" name "@"
#define PNG_INTERNAL_CALLBACK(type, name, args, attributes)\
PNG_DFN "@" name "@"
#define PNGPREFIX_H /* self generation */
#include "../pngpriv.h"

View File

@ -11,7 +11,7 @@
# Modeled after libxml-config.
version=1.6.2
version=1.6.17
prefix=""
libdir=""
libs=""

View File

@ -5,6 +5,6 @@ includedir=@includedir@/libpng16
Name: libpng
Description: Loads and saves PNG files
Version: 1.6.2
Version: 1.6.17
Libs: -L${libdir} -lpng16
Cflags: -I${includedir}

File diff suppressed because it is too large Load Diff

View File

@ -1,384 +0,0 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for lt_pkg in $withval; do
IFS="$lt_save_ifs"
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

View File

@ -1,123 +0,0 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

View File

@ -1,23 +0,0 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# serial 3337 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.2])
m4_define([LT_PACKAGE_REVISION], [1.3337])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.2'
macro_revision='1.3337'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

View File

@ -1,98 +0,0 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

View File

@ -1,6 +1,6 @@
# makefile for libpng on Solaris 2.x with cc
# Contributed by William L. Sebok, based on makefile.linux
# Copyright (C) 2002, 2006, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@ -45,8 +45,8 @@ ZLIBINC=/usr/include
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \
# $(WARNMORE) -g -DPNG_DEBUG=5
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g
LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
INCPATH=$(prefix)/include
@ -77,8 +77,11 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
@ -104,8 +107,8 @@ libpng-config:
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo R_opts=\"-R$(LIBPATH)\"; \
echo ccopts=\"-xtarget=ultra\"; \
echo ldopts=\"-xtarget=ultra\"; \
echo ccopts=\"-fast -xtarget=ultra\"; \
echo ldopts=\"-fast -xtarget=ultra\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
@ -196,7 +199,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) $(SUN_CC_FLAGS) -I$(DI) -I$(ZLIBINC) \
$(CC) $(SUN_CC_FLAGS) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtestd -L$(DL) -R$(DL) `$(BINPATH)/$(LIBNAME)-config --ldflags` \
$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
@ -205,7 +208,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(SUN_CC_FLAGS) -I$(ZLIBINC) \
$(CC) $(SUN_CC_FLAGS) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
@ -222,20 +225,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,6 +1,6 @@
# makefile for libpng on Solaris 2.x with cc
# Contributed by William L. Sebok, based on makefile.linux
# Copyright (C) 2002, 2006, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@ -45,8 +45,8 @@ ZLIBINC=/usr/include
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \
# $(WARNMORE) -g -DPNG_DEBUG=5
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS= $(SUN_CC_FLAGS) # $(WARNMORE) -g
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
INCPATH=$(prefix)/include
@ -77,8 +77,11 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
@ -104,8 +107,8 @@ libpng-config:
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo R_opts=\"-R$(LIBPATH)\"; \
echo ccopts=\"-xtarget=ultra -xarch=v9\"; \
echo ldopts=\"-xtarget=ultra -xarch=v9\"; \
echo ccopts=\"-fast -xtarget=ultra -xarch=v9\"; \
echo ldopts=\"-fast -xtarget=ultra -xarch=v9\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
@ -196,7 +199,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) $(SUN_CC_FLAGS) -I$(DI) -I$(ZLIBINC) \
$(CC) $(SUN_CC_FLAGS) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtestd -L$(DL) -R$(DL) `$(BINPATH)/$(LIBNAME)-config --ldflags` \
$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
@ -205,7 +208,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(SUN_CC_FLAGS) -I$(ZLIBINC) \
$(CC) $(SUN_CC_FLAGS) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB)
@ -222,20 +225,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng using gcc (generic, static library)
# Copyright (C) 2002, 2006-2009 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006-2009, 2014 Glenn Randers-Pehrson
# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
@ -21,7 +21,7 @@ RANLIB = ranlib
RM_F = rm -f
LN_SF = ln -f -s
LIBNAME=libpng16
LIBNAME = libpng16
PNGMAJ = 16
prefix=/usr/local
@ -41,42 +41,37 @@ DESTDIR=
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
CDEBUG = -g -DPNG_DEBUG=5
LDDEBUG =
CRELEASE = -O2
LDRELEASE = -s
WARNMORE=-W -Wall
CFLAGS = -I$(ZLIBINC) $(WARNMORE) $(CRELEASE)
LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm $(LDRELEASE)
# File extensions
O=.o
A=.a
E=
WARNMORE =
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm
# Variables
OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
# Targets
all: $(LIBNAME)$(A) pngtest$(E)
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: $(LIBNAME).a pngtest$(E)
include scripts/pnglibconf.mak
REMOVE = $(RM_F)
DFNFLAGS = $(DEFS) $(CPPFLAGS)
$(LIBNAME)$(A): $(OBJS)
$(LIBNAME).a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
test: pngtest$(E)
./pngtest$(E)
pngtest$(E): pngtest$(O) $(LIBNAME)$(A)
$(LD) -o $@ pngtest$(O) $(LDFLAGS)
pngtest$(E): pngtest.o $(LIBNAME).a
$(LD) -o $@ pngtest.o $(LDFLAGS)
install: $(LIBNAME)$(A)
install: $(LIBNAME).a
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
@ -92,30 +87,30 @@ install: $(LIBNAME)$(A)
$(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) -r $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
-@$(RM_F) $(DL)/$(LIBNAME)$(A)
-@$(RM_F) $(DL)/libpng$(A)
cp $(LIBNAME)$(A) $(DL)/$(LIBNAME)$(A)
chmod 644 $(DL)/$(LIBNAME)$(A)
(cd $(DL); $(LN_SF) $(LIBNAME)$(A) libpng$(A))
-@$(RM_F) $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
cp $(LIBNAME).a $(DL)/$(LIBNAME).a
chmod 644 $(DL)/$(LIBNAME).a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
(cd $(DI); $(LN_SF) libpng/* .;)
clean:
$(RM_F) *.o $(LIBNAME)$(A) pngtest pngout.png pnglibconf.h
$(RM_F) *.o $(LIBNAME).a pngtest pngout.png pnglibconf.h
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest$(O): png.h pngconf.h pnglibconf.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -24,13 +24,15 @@ LDLIBS= libpng.lib libgz.lib LIB:scm.lib LIB:sc.lib Lib:amiga.lib
LN= slink
# file deletion command
RM= delete quiet
# file copy command?
CP= copy
# library (.lib) file creation command
AR= oml
# make directory command
MKDIR= makedir
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -43,8 +45,8 @@ $(AR) libpng.lib r $(OBJS)
$(OBJS): pngpriv.h png.h pngconf.h pnglibconf.h pnginfo.h pngstruct.h pngdebug.h
pnglibconf.h: scripts/pnglibconf.h.prebuilt
$(CP) scripts/pnglibconf.h.prebuilt pnglibconf.h
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
COPY $(PNGLIBCONF_H_PREBUILT) TO pnglibconf.h
pngtest: pngtest.o libpng.lib
$(LN) <WITH <

View File

@ -1,5 +1,5 @@
# makefile for libpng
# Copyright (C) 2002 Glenn Randers-Pehrson
# Copyright (C) 2002, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@ -9,9 +9,10 @@
# Modified for LC56/ATARI assumes libz.lib is in same dir and uses default
# rules for library management
#
CFLAGS=-I..\zlib -O
CPPFLAGS = -I..\zlib
CFLAGS = -O
LBR = png.lib
LDFLAGS=-lpng -lz -lm
LDFLAGS = -L. -L..\zlib -lpng -lz -lm
# where make install puts libpng.a and png.h
prefix=/usr/local
@ -28,6 +29,10 @@ LIBPATH=$(prefix)/lib
# you execute make install.
DESTDIR=
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\
$(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\
$(LBR)(pngread.o) $(LBR)(pngerror.o) $(LBR)(pngwrite.o)\
@ -36,12 +41,15 @@ OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\
all: $(LBR) pngtest.ttp
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
$(LBR): $(OBJS)
$(OBJS): pngpriv.h png.h pngconf.h pnglibconf.h pnginfo.h pngstruct.h pngdebug.h
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt pnglibconf.h
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
cp $(PNGLIBCONF_H_PREBUILT) $@
pngtest.ttp: pngtest.o $(LBR)
$(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o

View File

@ -11,10 +11,11 @@
## Where zlib.h, zconf.h and zlib.lib are
ZLIB_DIR=..\zlib
## Compiler, linker and lib stuff
## Compiler, linker, librarian and other tools
CC=bcc32
LD=bcc32
LIB=tlib
CP=copy
# -3 = 386, -4 = 486, -5 = Pentium etc.
!ifndef TARGET_CPU
@ -43,11 +44,18 @@ LDEBUG=$(LDEBUG) -N
# -d merge duplicate strings
# -k- turn off standard stack frame
# -w display all warnings
CFLAGS=-I$(ZLIB_DIR) -O2 -d -k- -w $(TARGET_CPU) $(CDEBUG)
CPPFLAGS=-I$(ZLIB_DIR)
CFLAGS=-O2 -d -k- -w $(TARGET_CPU) $(CDEBUG)
# -M generate map file
LDFLAGS=-L$(ZLIB_DIR) -M $(LDEBUG)
# Pre-built configuration
# See scripts\pnglibconf.mak for more options
!ifndef PNGLIBCONF_H_PREBUILT
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
!endif
## Variables
OBJS = \
png.obj \
@ -89,10 +97,11 @@ LIBNAME=libpng.lib
# Braces let make "batch" calls to the compiler,
# 2 calls instead of 12; space is important.
.c.obj:
$(CC) $(CFLAGS) -c {$*.c }
$(CC) $(CPPFLAGS) $(CFLAGS) -c {$*.c }
.c.exe:
$(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib.lib $(NOEHLIB)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $*.c \
$(LIBNAME) zlib.lib $(NOEHLIB)
.obj.exe:
$(LD) $(LDFLAGS) $*.obj $(LIBNAME) zlib.lib $(NOEHLIB)
@ -109,26 +118,24 @@ test: pngtest.exe
## Minor Targets
# see scripts\pnglibconf.mak for how to make this file
# with different options
pnglibconf.h: scripts\pnglibconf.h.prebuilt
copy scripts\pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.obj: pngtest.c png.h pngconf.h pnglibconf.h
$(LIBNAME): $(OBJS)

View File

@ -1,6 +1,6 @@
# makefile for libpng on BeOS x86 ELF with gcc
# modified from makefile.linux by Sander Stoks
# Copyright (C) 2002, 2006, 2008, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1999 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
#
@ -24,6 +24,7 @@ AR_RC=ar rc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
# Where the zlib library and include files are located
@ -40,8 +41,8 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
# On BeOS, -O1 is actually better than -O3. This is a known bug but it's
# still here in R4.5
CFLAGS=-I$(ZLIBINC) -W -Wall -O1 -funroll-loops \
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-W -Wall -O1 -funroll-loops $(ALIGN) # $(WARNMORE) -g
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz
@ -68,6 +69,10 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -76,11 +81,13 @@ OBJSDLL = $(OBJS)
.SUFFIXES: .c .o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
# try include scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -176,14 +183,14 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CFLAGS) \
$(CC) -I$(DI) $(CPPFLAGS) $(CFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) -Wl,-rpath $(ZLIBLIB):$(DL) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
$(CC) $(CFLAGS) \
$(CC) $(CPPFLAGS) $(CFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -196,20 +203,20 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -12,10 +12,11 @@
## Where zlib.h, zconf.h and zlib_MODEL.lib are
ZLIB_DIR=..\zlib
## Compiler, linker and lib stuff
## Compiler, linker, librarian and other tools
CC=bcc
LD=bcc
LIB=tlib
CP=copy
!ifndef MODEL
MODEL=l
@ -51,11 +52,18 @@ LDEBUG=$(LDEBUG) -N
# -w set all warnings on
# -O2 optimize for speed
# -Z global optimization
CFLAGS=-O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG)
CPPFLAGS=-I$(ZLIB_DIR)
CFLAGS=-O2 -Z -X- -w -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG)
# -M generate map file
LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG)
# Pre-built configuration
# See scripts\pnglibconf.mak for more options
!ifndef PNGLIBCONF_H_PREBUILT
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
!endif
## Variables
OBJS = \
@ -99,18 +107,19 @@ LIBNAME=libpng$(MODEL).lib
# Braces let make "batch" calls to the compiler,
# 2 calls instead of 12; space is important.
.c.obj:
$(CC) $(CFLAGS) -c {$*.c }
$(CC) $(CPPFLAGS) $(CFLAGS) -c {$*.c }
.c.exe:
$(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $*.c \
$(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
## Major targets
all: libpng pngtest
# try !inlude scripts\pnglibconf.mak for more options
pnglibconf.h: scripts\pnglibconf.h.prebuilt
copy scripts\pnglibconf.h.prebuilt $@
# try !include scripts\pnglibconf.mak for more options
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng: $(LIBNAME)
@ -121,21 +130,21 @@ test: pngtest$(MODEL).exe
## Minor Targets
png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(LIBNAME): $(OBJS)
-del $(LIBNAME)

View File

@ -23,14 +23,14 @@
VERMAJ = 1
VERMIN = 6
VERMIC = 2
VERMIC = 17
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
NAME = libpng
PACKAGE = $(NAME)-$(VER)
BIN = libpng16-0.dll
LIB = libpng16.a libpng16.dll.a libpng.a libpng.dll.a
INCLUDE = png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
INCLUDE = png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
PC = libpng16.pc libpng.pc
MANIFESTVERBIN = "Libpng-$(VER): Binary files"

View File

@ -1,5 +1,5 @@
# makefile for libpng on Darwin / Mac OS X
# Copyright (C) 2002, 2004, 2006, 2008, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2002, 2004, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 2001 Christoph Pfisterer
# derived from makefile.linux:
# Copyright (C) 1998, 1999 Greg Roelofs
@ -34,12 +34,13 @@ AR_RC=ar rc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
ARCH=-arch ppc -arch i386 -arch x86_64
# CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops
CFLAGS=-I$(ZLIBINC) -W -Wall -O -funroll-loops $(ARCH)
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz $(ARCH)
CPPFLAGS=-I$(ZLIBINC)
# CFLAGS=-W -Wall -O3 -funroll-loops
CFLAGS=-W -Wall -O -funroll-loops
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
@ -61,6 +62,10 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -69,14 +74,16 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) -fno-common -o $@ $*.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fno-common -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -105,7 +112,7 @@ $(LIBSOMAJ): $(OBJSDLL)
$(CC) -dynamiclib \
-install_name $(LIBPATH)/$(LIBSOMAJ) \
-current_version 16 -compatibility_version 16 \
$(ARCH) -o $(LIBSOMAJ) \
-o $(LIBSOMAJ) \
$(OBJSDLL) -L$(ZLIBLIB) -lz
pngtest: pngtest.o $(LIBSO)
@ -176,14 +183,14 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
$(CC) $(CFLAGS) \
$(CC) $(CPPFLAGS) $(CFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -199,20 +206,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng on DEC Alpha Unix
# Copyright (C) 2000-2002, 2006, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2000-2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@ -22,6 +22,7 @@ CC=cc
MKDIR_P=mkdir
LN_SF=ln -f -s
RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
# where make install puts libpng.a and png.h
@ -53,18 +54,25 @@ DM=$(DESTDIR)$(MANPATH)
ZLIBLIB=../zlib
ZLIBINC=../zlib
CFLAGS=-std -w1 -I$(ZLIBINC) -O # -g -DPNG_DEBUG=1
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-std -w1 -O # -g
LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: $(LIBSO) libpng.a pngtest libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -161,7 +169,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -w1 -I$(DI) -I$(ZLIBINC) \
$(CC) -w1 -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -170,33 +178,33 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) -w1 -I$(ZLIBINC) \
$(CC) -w1 $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) -R$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean:
/bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \
$(RM_F) *.o libpng.a pngtest pngtesti pngout.png \
libpng-config $(LIBSO) $(LIBSOMAJ)* \
libpng.pc pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# DJGPP (DOS gcc) makefile for libpng
# Copyright (C) 2002, 2006, 2009-2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006, 2009-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@ -13,20 +13,30 @@ INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
CC=gcc
CFLAGS=-I../zlib -O -DPNG_NO_SNPRINTF
CPPFLAGS=-I../zlib -DPNG_NO_SNPRINTF
CFLAGS=-O
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
RANLIB=ranlib
CP=cp
RM_F=rm -f
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o pngwtran.o \
pngmem.o pngerror.o pngpread.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: libpng.a pngtest
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
ar rc $@ $(OBJS)
@ -39,24 +49,24 @@ pngtest: pngtest.o libpng.a
test: pngtest
./pngtest
clean:
rm -f *.o libpng.a pngtest pngout.png pnglibconf.h
$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,263 +0,0 @@
# makefile for libpng.a and libpng16.so on Linux ELF with gcc
# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2011 Greg Roelofs
# and Glenn Randers-Pehrson
# Copyright (C) 1996, 1997 Andreas Dilger
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# Modified for Debian by Junichi Uekawa and Josselin Mouette
# Major modifications are:
# * link libpng explicitly with libz and libm
# * $(OLDSO).16 is a symlink rather than a different library
# * versioned symbols
# Library name:
LIBNAME = libpng16
PNGMAJ = 16
# Shared library names:
LIBSO=$(LIBNAME).so
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
LIBSOREL=$(LIBSOMAJ).$(RELEASE)
OLDSO=libpng.so
OLDSOMAJ=libpng.so.16
# Utilities:
AR_RC=ar rc
CC=gcc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=ranlib
RM_F=/bin/rm -f
# where "make install" puts libpng16.a, libpng16.so*,
# libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h
# Prefix must be a full pathname.
prefix=/usr/local
exec_prefix=$(prefix)
# Where the zlib library and include files are located.
ZLIBLIB=/usr/local/lib
ZLIBINC=/usr/local/include
# ZLIBLIB=../zlib
# ZLIBINC=../zlib
ALIGN=
# for i386:
#ALIGN=-malign-loops=2 -malign-functions=2
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
CFLAGS=-W -Wall -D_REENTRANT -O2 \
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
LDFLAGS=-L. -lpng16
LDFLAGS_A=libpng.a -lz -lm
LIBADDFLAGS=-lz -lm
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
# override DESTDIR= on the make install command line to easily support
# installing into a temporary location. Example:
#
# make install DESTDIR=/tmp/build/libpng
#
# If you're going to install into a temporary location
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
# you execute make install.
DESTDIR=
DB=$(DESTDIR)$(BINPATH)
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.pic.o:
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
libpng.pc:
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
-e s!@exec_prefix@!$(exec_prefix)! \
-e s!@libdir@!$(LIBPATH)! \
-e s!@includedir@!$(INCPATH)! \
-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
libpng.syms: png.h pngconf.h pnglibconf.h
$(CC) $(CFLAGS) -E -DPNG_BUILDSYMS -DPNG_INTERNAL png.h |\
awk -F '[\t [\\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG16_%s {global:\n",PNGMAJ)}\
{ for (i=1;i+2<=NF;++i)\
if ($$(i)=="PNG_FUNCTION_EXPORT" && $$(i+2)=="END")\
print $$(i+1) ";";\
for (i=1;i+1<=NF;++i)\
if ($$(i)=="PNG_DATA_EXPORT")\
print $$(i+1) ";";}\
END{print "local: *; };"}' >$@.new
$(RM_F) $@
mv $@.new $@
libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo L_opts=\"\"; \
echo R_opts=\"\"; \
echo libs=\"-lpng16\"; \
echo all_libs=\"-lpng16 $(LIBADDFLAGS)\"; \
cat scripts/libpng-config-body.in ) > libpng-config
chmod +x libpng-config
$(LIBSO): $(LIBSOMAJ)
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
$(LIBSOMAJ): $(OBJSDLL) libpng.syms
$(CC) -shared -Wl,-soname,$(LIBSOMAJ) \
-Wl,-version-script,libpng.syms \
-o $(LIBSOMAJ) \
$(OBJSDLL)
pngtest: pngtest.o $(LIBSO)
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
pngtest-static: pngtest.o libpng.a
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
test: pngtest pngtest-static
@echo ""
@echo " Running pngtest dynamically linked with $(LIBSO):"
@echo ""
LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" ./pngtest
@echo ""
@echo " Running pngtest statically linked with libpng.a:"
@echo ""
./pngtest-static
install-headers: png.h pngconf.h pnglibconf.h
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
-@$(RM_F) $(DI)/libpng
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
install-static: install-headers libpng.a
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
cp libpng.a $(DL)/$(LIBNAME).a
chmod 644 $(DL)/$(LIBNAME).a
-@$(RM_F) $(DL)/libpng.a
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
install-shared: install-headers $(LIBSOMAJ) libpng.pc
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
-@$(RM_F) $(DL)/$(LIBSO)
-@$(RM_F) $(DL)/$(LIBSOREL)
-@$(RM_F) $(DL)/$(OLDSO)
cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
chmod 755 $(DL)/$(LIBSOREL)
(cd $(DL); \
$(LN_SF) $(LIBSOREL) $(LIBSO); \
$(LN_SF) $(LIBSO) $(OLDSO))
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
install-man: libpng.3 libpngpf.3 png.5
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
-@$(RM_F) $(DM)/man3/libpng.3
-@$(RM_F) $(DM)/man3/libpngpf.3
cp libpng.3 $(DM)/man3
cp libpngpf.3 $(DM)/man3
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
-@$(RM_F) $(DM)/man5/png.5
cp png.5 $(DM)/man5
install-config: libpng-config
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
-@$(RM_F) $(DB)/libpng-config
-@$(RM_F) $(DB)/$(LIBNAME)-config
cp libpng-config $(DB)/$(LIBNAME)-config
chmod 755 $(DB)/$(LIBNAME)-config
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
install: install-static install-shared install-man install-config
# If you installed in $(DESTDIR), test-installed won't work until you
# move the library to its final location. Use test-dd to test it
# before then.
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
$(CC) -I$(ZLIBINC) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtesti pngtest.png
clean:
$(RM_F) *.o libpng.a libpng.syms pngtest pngout.png libpng-config \
$(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
libpng.pc pnglibconf.h
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
writelock:
chmod a-w *.[ch35] $(DOCS) scripts/*
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,4 +1,5 @@
# makefile for libpng under FreeBSD
# Copyright (C) 2014 Glenn Randers-Pehrson and Andrey A. Chernov
# Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov
#
# This code is released under the libpng license.
@ -12,12 +13,12 @@ LIB= png
SHLIB_MAJOR= ${SHLIB_VER}
SHLIB_MINOR= 0
NO_PROFILE= YES
NO_OBJ= YES
NO_OBJ= YES
# where make install puts libpng.a and png.h
DESTDIR= ${PREFIX}
LIBDIR= /lib
INCS= png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
INCS= png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
INCSDIR= /include/libpng
INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
MAN= libpng.3 libpngpf.3 png.5
@ -30,17 +31,25 @@ SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
ZLIBLIB= /usr/lib
ZLIBINC= /usr/include
LDADD+= -lm -lz
#LDADD+= -lm -lz -lssp_nonshared # for OSVERSION < 800000 ?
LDADD+= -lm -lz
#LDADD+= -lm -lz -lssp_nonshared # for OSVERSION < 800000 ?
DPADD+= ${LIBM} ${LIBZ}
DPADD+= ${LIBM} ${LIBZ}
CFLAGS+= -I. -I${ZLIBINC}
CPPFLAGS+= -I. -I${ZLIBINC}
CFLAGS+= -W -Wall
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
pngtest: pngtest.o libpng.a
${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -L${ZLIBLIB} \
-lpng ${LDADD}
@ -50,9 +59,8 @@ CLEANFILES= pngtest pngtest.o pngout.png
test: pngtest
./pngtest
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
cp $(PNGLIBCONF_H_PREBUILT) $@
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
writelock:

View File

@ -1,5 +1,5 @@
# makefile for libpng using gcc (generic, static library)
# Copyright (C) 2008 Glenn Randers-Pehrson
# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@ -16,72 +16,72 @@ CC = gcc
LD = $(CC)
AR_RC = ar rcs
RANLIB = ranlib
CP = cp
RM_F = rm -f
CDEBUG = -g -DPNG_DEBUG=5
LDDEBUG =
CRELEASE = -O2
LDRELEASE = -s
#CFLAGS = -W -Wall $(CDEBUG)
CFLAGS = -W -Wall $(CRELEASE)
#LDFLAGS = $(LDDEBUG)
LDFLAGS = $(LDRELEASE)
WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
LDFLAGS =
LIBS = -lz -lm
# File extensions
O=.o
A=.a
EXE=
EXEEXT =
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
# Variables
OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
# Targets
all: static
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
.c$(O):
$(CC) -c $(CFLAGS) -I$(ZLIBINC) $<
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
static: libpng$(A) pngtest$(EXE)
static: libpng.a pngtest$(EXEEXT)
shared:
@echo This is a generic makefile that cannot create shared libraries.
@echo Please use a configuration that is specific to your platform.
@false
libpng$(A): $(OBJS)
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
test: pngtest$(EXE)
./pngtest$(EXE)
test: pngtest$(EXEEXT)
./pngtest$(EXEEXT)
pngtest$(EXE): pngtest$(O) libpng$(A)
$(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest$(O) libpng$(A) $(LIBS)
pngtest$(EXEEXT): pngtest.o libpng.a
$(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS)
clean:
$(RM_F) *$(O) libpng$(A) pngtest$(EXE) pngout.png pnglibconf.h
$(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest$(O): png.h pngconf.h pnglibconf.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
# Copyright (C) 1999-2002, 2006, 2009, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 1999-2002, 2006, 2009, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42
# contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
#
@ -34,13 +34,14 @@ CC=cc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
CFLAGS=-I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64 \
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +Z -DHAVE_UNISTD_H -DUSE_MMAP
CPPFLAGS=-I$(ZLIBINC) \
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_UNISTD_H -DUSE_MMAP
CFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
# Caution: be sure you have built zlib with the same CFLAGS.
CCFLAGS=-I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64 \
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +Z -DHAVE_UNISTD_H -DUSE_MMAP
CCFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
@ -67,6 +68,10 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -75,14 +80,16 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) +z -o $@ $*.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -99,7 +106,7 @@ libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
echo ccopts=\"-O -Ae -Wl,+vnocompatwarnings +DD64 +Z\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
@ -179,7 +186,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) $(CCFLAGS) \
$(CC) -I$(DI) $(CPPFLAGS) $(CCFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -188,7 +195,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CCFLAGS) \
$(CC) $(CPPFLAGS) $(CCFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -205,20 +212,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng on HP-UX using GCC with the HP ANSI/C linker.
# Copyright (C) 2002, 2006-2008, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006-2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 2001, Laurent faillie
# Copyright (C) 1998, 1999 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@ -25,6 +25,7 @@ AR_RC=ar rc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
# where "make install" puts libpng.a, $(OLDSO)*, png.h, pngconf.h
@ -53,8 +54,8 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE \
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-W -Wall -O3 -funroll-loops $(ALIGN) # $(WARNMORE) -g
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
@ -86,8 +87,11 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
@ -185,7 +189,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) -Wl,-rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -194,7 +198,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) -I$(ZLIBINC) \
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -211,20 +215,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
# Copyright (C) 1999-2002, 2006, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 1999-2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42
# contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
#
@ -14,7 +14,8 @@ ZLIBINC=/opt/zlib/include
# Note that if you plan to build a libpng shared library, zlib must also
# be a shared library, which zlib's configure does not do. After running
# zlib's configure, edit the appropriate lines of makefile to read:
# CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \
# CPPFLAGS=-DHAVE_UNISTD -DUSE_MAP
# CFLAGS=-O1 -fPIC
# LDSHARED=ld -b
# SHAREDLIB=libz.sl
@ -44,9 +45,10 @@ LIBPATH=$(exec_prefix)/lib
MANPATH=$(prefix)/man
BINPATH=$(exec_prefix)/bin
CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
CPPFLAGS=-I$(ZLIBINC)
CFLAGS=-O -Ae +DA1.1 +DS2.0
# Caution: be sure you have built zlib with the same CFLAGS.
CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
CCFLAGS=-O -Ae +DA1.1 +DS2.0
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
# override DESTDIR= on the make install command line to easily support
@ -64,6 +66,10 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -72,14 +78,16 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) +z -o $@ $*.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -96,7 +104,7 @@ libpng-config:
( cat scripts/libpng-config-head.in; \
echo prefix=\"$(prefix)\"; \
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
echo ccopts=\"-O -Ae +DA1.1 +DS2.0\"; \
echo L_opts=\"-L$(LIBPATH)\"; \
echo libs=\"-lpng16 -lz -lm\"; \
cat scripts/libpng-config-body.in ) > libpng-config
@ -176,7 +184,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) $(CCFLAGS) \
$(CC) -I$(DI) $(CPPFLAGS) $(CCFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -185,7 +193,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) $(CCFLAGS) \
$(CC) $(CPPFLAGS) $(CCFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -202,20 +210,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,6 +1,6 @@
# Makefile for libpng (static)
# IBM C version 3.x for Win32 and OS/2
# Copyright (C) 2006 Glenn Randers-Pehrson
# Copyright (C) 2006, 2014 Glenn Randers-Pehrson
# Copyright (C) 2000 Cosmin Truta
#
# This code is released under the libpng license.
@ -21,11 +21,17 @@ ZLIBLIB = ../zlib
CC = icc
LD = ilink
AR = ilib
CP = copy
RM = del
CFLAGS = -I$(ZLIBINC) -Mc -O2 -W3
CPPFLAGS = -I$(ZLIBINC)
CFLAGS = -Mc -O2 -W3
LDFLAGS =
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
# File extensions
O=.obj
A=.lib
@ -39,11 +45,13 @@ OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
LIBS = libpng$(A) $(ZLIBLIB)/zlib$(A)
# Targets
.c$(O):
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
all: libpng$(A) pngtest$(E)
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng$(A): $(OBJS)
$(AR) -out:$@ $(OBJS)
@ -63,20 +71,20 @@ clean:
$(RM) pngtest$(E)
$(RM) pngout.png
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest$(O): png.h pngconf.h pnglibconf.h

View File

@ -1,7 +1,7 @@
# Makefile for libpng
# Microsoft Visual C++ with Intel C/C++ Compiler 4.0 and later
# Copyright (C) 2006 Glenn Randers-Pehrson
# Copyright (C) 2006, 2014 Glenn Randers-Pehrson
# Copyright (C) 2000, Pawel Mrochen, based on makefile.msc which is
# copyright 1995 Guy Eric Schalnat, Group 42, Inc.
#
@ -32,9 +32,15 @@ CALLING=r # __fastcall
# --------------------------------------------------------------------------
CC=icl -c
CFLAGS=-O2 -G$(CPU)$(CALLING) -Qip -Qunroll4 -I$(ZLIBINC) -nologo
CPPFLAGS=-I$(ZLIBINC)
CFLAGS=-O2 -G$(CPU)$(CALLING) -Qip -Qunroll4 -nologo
LD=link
LDFLAGS=/SUBSYSTEM:CONSOLE /NOLOGO
CP=cp
# Pre-built configuration
# See scripts\pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
O=.obj
@ -44,54 +50,53 @@ pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
all: test
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
libpng.lib: $(OBJS)
if exist libpng.lib del libpng.lib
@ -101,7 +106,7 @@ pngtest.exe: pngtest.obj libpng.lib
$(LD) $(LDFLAGS) /OUT:pngtest.exe pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib
pngtest$(O): png.h pngconf.h pnglibconf.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)
$(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
test: pngtest.exe
pngtest.exe

View File

@ -1,5 +1,5 @@
# makefile for libpng
# Copyright (C) 2002, 2006, 2009 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006, 2009, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@ -26,14 +26,22 @@ LIBPATH=$(prefix)/lib
# you execute make install.
DESTDIR=
CC=cc
CFLAGS=-I../zlib -O
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
CC = cc
CPPFLAGS = -I../zlib
CFLAGS = -O
LDFLAGS = -L. -L../zlib/ -lpng -lz -lm
# flags for ansi2knr
ANSI2KNRFLAGS=
RANLIB=ranlib
#RANLIB=echo
RANLIB = ranlib
#RANLIB = echo
CP = cp
RM_F = rm -f
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
@ -41,19 +49,18 @@ OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
all: ansi2knr libpng.a pngtest
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
# general rule to allow ansi2knr to work
.c.o:
./ansi2knr $*.c T$*.c
$(CC) $(CFLAGS) -c T$*.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c T$*.c
rm -f T$*.c $*.o
mv T$*.o $*.o
ansi2knr: ansi2knr.c
$(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
libpng.a: ansi2knr $(OBJS)
ar rc $@ $(OBJS)
@ -82,7 +89,7 @@ install: libpng.a png.h pngconf.h pnglibconf.h
chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
clean:
rm -f *.o libpng.a pngtest pngout.png ansi2knr pnglibconf.h
$(RM_F) *.o libpng.a pngtest pngout.png ansi2knr pnglibconf.h
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
writelock:
@ -90,20 +97,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng.a and libpng16.so on Linux ELF with gcc
# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2011 Greg Roelofs and
# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and
# Glenn Randers-Pehrson
# Copyright (C) 1996, 1997 Andreas Dilger
#
@ -10,7 +10,7 @@
# Library name:
LIBNAME = libpng16
PNGMAJ = 16
RELEASE = 2
RELEASE = 17
# Shared library names:
LIBSO=$(LIBNAME).so
@ -24,6 +24,7 @@ CC=gcc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=ranlib
CP=cp
RM_F=/bin/rm -f
# where "make install" puts libpng16.a, libpng16.so*,
@ -48,7 +49,8 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops \
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS= -W -Wall -O3 -funroll-loops \
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
@ -74,6 +76,10 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -82,14 +88,16 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -196,14 +204,14 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
$(CC) -I$(ZLIBINC) \
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -220,20 +228,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng
# Copyright (C) Glenn Randers-Pehrson
# Copyright (C) 1998-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@ -22,22 +22,31 @@ LIBPATH=$(prefix)/lib
DESTDIR=
CC=cc
CFLAGS=-I../zlib -O -systype sysv -DSYSV -w -Dmips
CPPFLAGS=-I../zlib -DSYSV -Dmips
CFLAGS=-O -systype sysv -w
#CFLAGS=-O
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
#RANLIB=ranlib
RANLIB=echo
CP=cp
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: libpng.a pngtest
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
ar rc $@ $(OBJS)
@ -75,20 +84,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,6 +1,6 @@
# makefile for libpng
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# Copyright (C) 2006, 2009 Glenn Randers-Pehrson
# Copyright (C) 2006, 2009, 2014 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@ -10,13 +10,19 @@
# -------- Microsoft C 5.1 and later, does not use assembler code --------
MODEL=L
CFLAGS=-Oait -Gs -nologo -W3 -A$(MODEL) -I..\zlib
CPPFLAGS=-I..\zlib
CFLAGS=-Oait -Gs -nologo -W3 -A$(MODEL)
#-Ox generates bad code with MSC 5.1
CC=cl
LD=link
LDFLAGS=/e/st:0x1500/noe
CP=copy
O=.obj
# Pre-built configuration
# See scripts\pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
#uncomment next to put error messages in a file
ERRFILE= >> pngerrs
@ -27,54 +33,53 @@ OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
all: libpng.lib
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3)
del libpng.lib
@ -83,7 +88,7 @@ libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3)
lib libpng $(OBJS3);
pngtest$(O): png.h pngconf.h pnglibconf.h
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
$(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngtest.exe: pngtest.obj libpng.lib
$(LD) $(LDFLAGS) pngtest.obj,,,libpng.lib ..\zlib\zlib.lib ;

View File

@ -2,7 +2,7 @@
# Copyright (C) 2012 Glenn Randers-Pehrson and Christopher M. Wheeler
#
# Portions taken from makefile.linux:
# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2011 Greg Roelofs and
# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and
# Glenn Randers-Pehrson
# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 1996, 1997 Andreas Dilger
@ -18,7 +18,7 @@ exec_prefix=$(prefix)
# Library name:
LIBNAME = libpng16
PNGMAJ = 16
RELEASE = 2
RELEASE = 17
# Shared library names:
LIBSO=$(LIBNAME).dll
@ -37,6 +37,7 @@ CC = gcc
LD = $(CC)
AR_RC = ar rcs
RANLIB = ranlib
CP = cp
RM_F = rm -rf
MKDIR_P=mkdir -p
LN_SF=ln -sf
@ -44,20 +45,13 @@ LN_SF=ln -sf
#ARCH = -march=pentium3
#ARCH = -march=i686
ARCH =
CDEBUG = -g -DPNG_DEBUG=5
LDDEBUG =
CRELEASE = -O2
LDRELEASE = -s
#CFLAGS = -W -Wall $(CDEBUG)
CFLAGS = -W -Wall $(CRELEASE) $(ARCH)
#LDFLAGS = $(LDDEBUG)
LDFLAGS = $(LDRELEASE)
CPPFLAGS = # -DPNG_DEBUG=5
CFLAGS = -W -Wall -O2 $(ARCH) # -g
LDFLAGS =
LIBS = -lz -lm
# File extensions
O=.o
A=.a
EXE=.exe
EXEEXT=.exe
INCPATH=$(prefix)/include
LIBPATH=$(exec_prefix)/lib
@ -80,22 +74,25 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
# Variables
OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
# Targets
all: static shared
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
.c$(O):
$(CC) -c $(CFLAGS) -I$(ZLIBINC) $<
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
static: libpng$(A) pngtest$(EXE)
static: libpng.a pngtest$(EXEEXT)
shared: $(LIBSOMAJ)
$(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSO)
@ -106,7 +103,7 @@ $(LIBSO): $(LIBSOMAJ)
$(LIBSOMAJ):
$(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOMAJ)
libpng$(A): $(OBJS)
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
@ -175,30 +172,30 @@ install-config: libpng-config
install: install-static install-shared install-man install-config
test: pngtest$(EXE)
./pngtest$(EXE)
test: pngtest$(EXEEXT)
./pngtest$(EXEEXT)
pngtest$(EXE): pngtest$(O) libpng$(A)
$(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest$(O) libpng$(A) $(LIBS)
pngtest$(EXEEXT): pngtest.o libpng.a
$(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS)
clean:
$(RM_F) *$(O) libpng$(A) pngtest$(EXE) pngout.png pnglibconf.h $(LIBSO) \
$(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h $(LIBSO) \
$(LIBSOMAJ) libpng-config
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest$(O): png.h pngconf.h pnglibconf.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -2,7 +2,7 @@
# make obj && make depend && make && make test
# make includes && make install
# Copyright (C) 2002 Patrick R.L. Welche
# Copyright (C) 2007, 2009 Glenn Randers-Pehrson
# Copyright (C) 2007, 2009, 2014 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng16
LIB= png16
SHLIB_MAJOR= 0
SHLIB_MINOR= 1.6.2
SHLIB_MINOR= 1.6.17
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c
@ -26,6 +26,10 @@ MAN= libpng.3 libpngpf.3 png.5
CPPFLAGS+=-I${.CURDIR}
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
# We should be able to do something like this instead of the manual
# uncommenting, but it core dumps for me at the moment:
# .if ${MACHINE_ARCH} == "i386"
@ -34,9 +38,11 @@ CPPFLAGS+=-I${.CURDIR}
CLEANFILES+=pngtest.o pngtest pnglibconf.h
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
cp $(PNGLIBCONF_H_PREBUILT) $@
pngtest.o: pngtest.c
${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}

View File

@ -2,7 +2,7 @@
# make obj && make depend && make && make test
# make includes && make install
# Copyright (C) 2002 Patrick R.L. Welche
# Copyright (C) 2007-2009 Glenn Randers-Pehrson
# Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include
LIB= png
SHLIB_MAJOR= 16
SHLIB_MINOR= 1.6.2
SHLIB_MINOR= 1.6.17
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c
@ -26,6 +26,10 @@ MAN= libpng.3 libpngpf.3 png.5
CPPFLAGS+=-I${.CURDIR}
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
# We should be able to do something like this instead of the manual
# uncommenting, but it core dumps for me at the moment:
# .if ${MACHINE_ARCH} == "i386"
@ -34,9 +38,11 @@ CPPFLAGS+=-I${.CURDIR}
CLEANFILES+=pngtest.o pngtest pnglibconf.h
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
cp $(PNGLIBCONF_H_PREBUILT) $@
pngtest.o: pngtest.c
${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET}

View File

@ -1,6 +1,6 @@
# makefile for libpng
# Copyright (C) 2007-2009, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# Copyright (C) 2007-2009 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib
MANDIR= ${PREFIX}/man/cat
SHLIB_MAJOR= 16
SHLIB_MINOR= 1.6.2
SHLIB_MINOR= 1.6.17
LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
@ -28,12 +28,18 @@ NOPROFILE= Yes
CLEANFILES+= pngtest.o pngtest pnglibconf.h
MAN= libpng.3 libpngpf.3 png.5
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
libpng-manual.txt
DOCS= ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
libpng-manual.txt
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT= scripts/pnglibconf.h.prebuilt
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
cp $(PNGLIBCONF_H_PREBUILT) $@
pngtest.o: pngtest.c
${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}

View File

@ -1,7 +1,7 @@
# makefile for SCO OSr5 ELF and Unixware 7 with Native cc
# Contributed by Mike Hopkirk (hops@sco.com) modified from Makefile.lnx
# force ELF build dynamic linking, SONAME setting in lib and RPATH in app
# Copyright (C) 2002, 2006, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
#
@ -25,6 +25,7 @@ AR_RC=ar rc
MKDIR_P=mkdir
LN_SF=ln -f -s
RANLIB=echo
CP=cp
RM_F=/bin/rm -f
# where make install puts libpng.a, $(OLDSO)*, and png.h
@ -37,7 +38,8 @@ exec_prefix=$(prefix)
ZLIBLIB=../zlib
ZLIBINC=../zlib
CFLAGS= -dy -belf -I$(ZLIBINC) -O3
CPPFLAGS=-I$(ZLIBINC)
CFLAGS= -dy -belf -O3
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
INCPATH=$(prefix)/include
@ -60,6 +62,10 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -68,14 +74,16 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -175,14 +183,14 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) $(CFLAGS) \
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
./pngtestd pngtest.png
test-installed:
$(CC) $(CFLAGS) \
$(CC) $(CPPFLAGS) $(CFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
@ -199,20 +207,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
# Copyright (C) 2001-2002, 2006, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2001-2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@ -22,6 +22,7 @@ CC=gcc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=echo
CP=cp
RM_F=/bin/rm -f
# Where make install puts libpng.a, libpng16.so, and libpng16/png.h
@ -42,8 +43,9 @@ ZLIBINC=../zlib
# See "man abi". zlib must be built with the same ABI.
ABI=
WARNMORE= # -g -DPNG_DEBUG=5
CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE) -fPIC -mabi=n32
WARNMORE=
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=$(ABI) -O $(WARNMORE) -fPIC -mabi=n32 # -g
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
-set_version sgi$(PNGMAJ).0
@ -70,15 +72,21 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: libpng.a pngtest shared libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -182,7 +190,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-rpath $(ZLIBLIB):$(DL) \
@ -192,7 +200,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) -I$(ZLIBINC) \
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-rpath $(ZLIBLIB):`$(BINPATH)/$(LIBNAME)-config --libdir` \
@ -209,20 +217,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
# Copyright (C) 2001-2002, 2006, 2007, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2001-2002, 2006, 2007, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@ -22,6 +22,7 @@ CC=cc
MKDIR_P=mkdir -p
LN_SF=ln -sf
RANLIB=echo
CP=cp
RM_F=/bin/rm -f
# Where make install puts libpng.a, libpng16.so, and libpng16/png.h
@ -44,8 +45,9 @@ ABI=
WARNMORE=-fullwarn
# Note: -KPIC is the default anyhow
#CFLAGS= $(ABI) -I$(ZLIBINC) -O $(WARNMORE) -KPIC # -g -DPNG_DEBUG=5
CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE)
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
#CFLAGS= $(ABI) -O $(WARNMORE) -KPIC # -g
CFLAGS=$(ABI) -O $(WARNMORE)
LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng16 -lz -lm
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
@ -73,15 +75,21 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
all: libpng.a pngtest shared libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -182,7 +190,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-rpath $(ZLIBLIB):$(DL) \
@ -192,7 +200,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) -I$(ZLIBINC) \
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(ZLIBLIB) \
-rpath $(ZLIBLIB):`$(BINPATH)/$(LIBNAME)-config --libdir` \
@ -210,20 +218,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,7 +1,7 @@
# makefile for libpng on Solaris 9 (beta) with Forte cc
# Updated by Chad Schrock for Solaris 9
# Contributed by William L. Sebok, based on makefile.linux
# Copyright (C) 2002, 2006, 2008, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998-2001 Greg Roelofs
# Copyright (C) 1996-1997 Andreas Dilger
#
@ -26,6 +26,7 @@ AR_RC=ar rc
MKDIR_P=mkdir -p
LN_SF=ln -f -s
RANLIB=echo
CP=cp
RM_F=/bin/rm -f
# Where make install puts libpng.a, $(OLDSO)*, and png.h
@ -46,8 +47,9 @@ ZLIBINC=/usr/include
#WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
#CFLAGS=-I$(ZLIBINC) -W -Wall -O3 $(WARNMORE) -g -DPNG_DEBUG=5 -DPNG_NO_MMX_CODE
CFLAGS=-I$(ZLIBINC) -O3 -DPNG_NO_MMX_CODE
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
#CFLAGS=-W -Wall -O3 $(WARNMORE) -g
CFLAGS=-O3
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
INCPATH=$(prefix)/include
@ -70,6 +72,10 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -78,14 +84,16 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -194,7 +202,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
@ -203,7 +211,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) -I$(ZLIBINC) \
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(ZLIBLIB) -R$(ZLIBLIB)
@ -220,20 +228,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng on Solaris 2.x with gcc
# Copyright (C) 2004, 2006-2008, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2004, 2006-2008, 2010-2014 Glenn Randers-Pehrson
# Contributed by William L. Sebok, based on makefile.linux
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@ -24,6 +24,7 @@ CC=gcc
MKDIR_P=mkdir -p
LN_SF=ln -f -s
RANLIB=echo
CP=cp
RM_F=/bin/rm -f
# Where make install puts libpng.a, libpng16.so*, and png.h
@ -42,7 +43,8 @@ ZLIBINC=/usr/local/include
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
CFLAGS=-I$(ZLIBINC) -W -Wall -O \
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS= -W -Wall -O \
# $(WARNMORE) -g -DPNG_DEBUG=5
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
@ -66,6 +68,10 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -74,14 +80,16 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -191,7 +199,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
@ -200,7 +208,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) -I$(ZLIBINC) \
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(ZLIBLIB) -R$(ZLIBLIB)
@ -217,20 +225,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

View File

@ -1,5 +1,5 @@
# makefile for libpng on Solaris 2.x with gcc
# Copyright (C) 2004, 2006-2008, 2010-2011 Glenn Randers-Pehrson
# Copyright (C) 2004, 2006-2008, 2010-2014 Glenn Randers-Pehrson
# Contributed by William L. Sebok, based on makefile.linux
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@ -24,6 +24,7 @@ CC=gcc
MKDIR_P=mkdir -p
LN_SF=ln -f -s
RANLIB=echo
CP=cp
RM_F=/bin/rm -f
# Where make install puts libpng.a, libpng16.so*, and png.h
@ -42,8 +43,8 @@ ZLIBINC=/usr/local/include
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
CFLAGS=-I$(ZLIBINC) -W -Wall -O \
# $(WARNMORE) -g -DPNG_DEBUG=5
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-W -Wall -O # $(WARNMORE) -g
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
INCPATH=$(prefix)/include
@ -66,6 +67,10 @@ DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
@ -74,14 +79,16 @@ OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.c.pic.o:
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
@ -191,7 +198,7 @@ install: install-static install-shared install-man install-config
test-dd:
echo
echo Testing installed dynamic shared library in $(DL).
$(CC) -I$(DI) -I$(ZLIBINC) \
$(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL)
@ -200,7 +207,7 @@ test-dd:
test-installed:
echo
echo Testing installed dynamic shared library.
$(CC) -I$(ZLIBINC) \
$(CC) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags` \
-L$(ZLIBLIB) -R$(ZLIBLIB)
@ -217,20 +224,20 @@ writelock:
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
pngtest.o: png.h pngconf.h pnglibconf.h

Some files were not shown because too many files have changed in this diff Show More