summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2014-02-05 22:28:57 -0600
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2014-02-05 22:34:07 -0600
commita710317d2f9cb1e154861c000ee1cc1c70794a85 (patch)
tree4106e9e42a8a6a897714826d2e2db6ff1b39edff
parent339ef1ec97f54a97a589946933f1cc6b0993fe21 (diff)
downloadlibpng-a710317d2f9cb1e154861c000ee1cc1c70794a85.tar.gz
[master] Imported from libpng-1.6.9.tar
-rw-r--r--ANNOUNCE78
-rw-r--r--CHANGES53
-rw-r--r--CMakeLists.txt4
-rw-r--r--LICENSE6
-rw-r--r--Makefile.am101
-rw-r--r--README4
-rw-r--r--arm/arm_init.c2
-rw-r--r--arm/filter_neon_intrinsics.c2
-rw-r--r--configure.ac45
-rw-r--r--contrib/gregbook/Makefile.mingw327
-rw-r--r--contrib/gregbook/Makefile.sgi5
-rw-r--r--contrib/gregbook/Makefile.unx5
-rw-r--r--contrib/gregbook/Makefile.w325
-rw-r--r--contrib/libtests/pngvalid.c601
-rw-r--r--contrib/pngminim/decoder/makefile2
-rw-r--r--contrib/pngminim/encoder/makefile2
-rw-r--r--contrib/pngminim/preader/makefile2
-rw-r--r--contrib/pngminus/makefile.std7
-rw-r--r--contrib/pngminus/makefile.tc38
-rw-r--r--contrib/tools/pngfix.c5
-rw-r--r--libpng-manual.txt31
-rw-r--r--libpng.344
-rw-r--r--libpngpf.34
-rw-r--r--png.52
-rw-r--r--png.c79
-rw-r--r--png.h23
-rw-r--r--pngconf.h37
-rw-r--r--pngerror.c7
-rw-r--r--pngpriv.h120
-rw-r--r--pngread.c83
-rw-r--r--pngrio.c6
-rw-r--r--pngrtran.c724
-rw-r--r--pngtest.c71
-rw-r--r--pngtrans.c8
-rw-r--r--pngwio.c6
-rw-r--r--pngwrite.c69
-rw-r--r--pngwtran.c203
-rw-r--r--projects/vstudio/readme.txt2
-rw-r--r--projects/vstudio/zlib.props2
-rw-r--r--scripts/README.txt12
-rw-r--r--scripts/def.dfn2
-rw-r--r--scripts/descrip.mms34
-rwxr-xr-xscripts/libpng-config-head.in2
-rw-r--r--scripts/libpng.pc.in2
-rw-r--r--scripts/makefile.32sunu45
-rw-r--r--scripts/makefile.64sunu45
-rw-r--r--scripts/makefile.aix87
-rw-r--r--scripts/makefile.atari10
-rw-r--r--scripts/makefile.bc3238
-rw-r--r--scripts/makefile.beos43
-rw-r--r--scripts/makefile.bor38
-rw-r--r--scripts/makefile.cegcc4
-rw-r--r--scripts/makefile.darwin46
-rw-r--r--scripts/makefile.dec42
-rw-r--r--scripts/makefile.dj238
-rw-r--r--scripts/makefile.elf45
-rw-r--r--scripts/makefile.freebsd15
-rw-r--r--scripts/makefile.gcc80
-rw-r--r--scripts/makefile.hp6449
-rw-r--r--scripts/makefile.hpgcc45
-rw-r--r--scripts/makefile.hpux49
-rw-r--r--scripts/makefile.ibmc38
-rw-r--r--scripts/makefile.intel67
-rw-r--r--scripts/makefile.knr47
-rw-r--r--scripts/makefile.linux44
-rw-r--r--scripts/makefile.mips38
-rw-r--r--scripts/makefile.msc67
-rw-r--r--scripts/makefile.msys77
-rw-r--r--scripts/makefile.ne12bsd7
-rw-r--r--scripts/makefile.netbsd7
-rw-r--r--scripts/makefile.openbsd11
-rw-r--r--scripts/makefile.sco44
-rw-r--r--scripts/makefile.sggcc44
-rw-r--r--scripts/makefile.sgi44
-rw-r--r--scripts/makefile.so946
-rw-r--r--scripts/makefile.solaris44
-rw-r--r--scripts/makefile.solaris-x8643
-rw-r--r--scripts/makefile.std52
-rw-r--r--scripts/makefile.sunos38
-rw-r--r--scripts/makefile.tc368
-rw-r--r--scripts/makefile.vcwin3267
-rw-r--r--scripts/makevms.com30
-rwxr-xr-xscripts/pnglibconf.dfa1
-rw-r--r--scripts/pnglibconf.h.prebuilt4
-rw-r--r--scripts/symbols.def2
-rwxr-xr-xtests/pngvalid-progressive-standard2
86 files changed, 2319 insertions, 1849 deletions
diff --git a/ANNOUNCE b/ANNOUNCE
index d5e79ef1a..ecc043db1 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
-Libpng 1.6.8 - December 19, 2013
+Libpng 1.6.9 - February 6, 2014
This is a public release of libpng, intended for use in production codes.
@@ -8,50 +8,56 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a
"configure" script
- libpng-1.6.8.tar.xz (LZMA-compressed, recommended)
- libpng-1.6.8.tar.gz
+ libpng-1.6.9.tar.xz (LZMA-compressed, recommended)
+ libpng-1.6.9.tar.gz
Source files with CRLF line endings (for Windows), without the
"configure" script
- lpng168.7z (LZMA-compressed, recommended)
- lpng168.zip
+ lpng169.7z (LZMA-compressed, recommended)
+ lpng169.zip
Other information:
- libpng-1.6.8-README.txt
- libpng-1.6.8-LICENSE.txt
+ libpng-1.6.9-README.txt
+ libpng-1.6.9-LICENSE.txt
Gnupg/*.asc (PGP armored detached signatures)
-Changes since the last public release (1.6.7):
- Changed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpread.c to
- #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED to be consistent with
- what is in pngpriv.h.
- 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().
- 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
- Tidied up pngfix inits and fixed pngtest no-write builds.
- 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.
+Changes since the last public release (1.6.8):
+ Bookkeeping: Moved functions around (no changes). Moved transform
+ function definitions before the place where they are called so that
+ they can be masde 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.
+ 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.
+ Removed potentially misleading warning from png_check_IHDR().
+ Updated scripts/makefile.* to use CPPFLAGS (Cosmin).
+ Added clang attribute support (Cosmin).
+ Quiet an uninitialized memory warning from VC2013 in png_get_png().
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/CHANGES b/CHANGES
index 4913e25d0..99c954d2f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4745,9 +4745,60 @@ Version 1.6.8rc02 [December 14, 2013]
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.
+ 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 masde 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]
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac628bdc1..ce5ca6986 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,7 @@ enable_testing()
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 6)
-set(PNGLIB_RELEASE 8)
+set(PNGLIB_RELEASE 9)
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
@@ -252,7 +252,7 @@ endif(NOT WIN32 OR CYGWIN OR MINGW)
# SET UP LINKS
if(PNG_SHARED)
set_target_properties(${PNG_LIB_NAME} PROPERTIES
-# VERSION 16.${PNGLIB_RELEASE}.1.6.8
+# VERSION 16.${PNGLIB_RELEASE}.1.6.9
VERSION 16.${PNGLIB_RELEASE}.0
SOVERSION 16
CLEAN_DIRECT_OUTPUT 1)
diff --git a/LICENSE b/LICENSE
index ad4493b74..cfab9c639 100644
--- a/LICENSE
+++ b/LICENSE
@@ -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.8, December 19, 2013, are
-Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
+libpng versions 1.2.6, August 15, 2004, through 1.6.9, February 6, 2014, are
+Copyright (c) 2004, 2006-2014 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
-December 19, 2013
+February 6, 2014
diff --git a/Makefile.am b/Makefile.am
index 5ac0423e1..e69519d71 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -81,7 +81,7 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.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\
+libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
arm/filter_neon.S arm/filter_neon_intrinsics.c
endif
@@ -287,43 +287,74 @@ check: scripts/symbols.chk
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
+# Make links between installed files with release-specific names and the generic
+# file names. If this install rule is run the generic names will be deleted and
+# recreated - this has obvious issues for systems with multiple installations.
+
+install-header-links:
+ @set -ex; cd '$(DESTDIR)$(includedir)'; for f in $(HEADERS); do \
+ rm -f "$$f"; $(LN_S) "$(PNGLIB_BASENAME)/$$f" "$$f"; done
+
+uninstall-header-links:
+ cd '$(DESTDIR)$(includedir)'; rm -f $(HEADERS)
-uninstall-hook:
- cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h
+install-libpng-pc:
+ @set -ex; cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc; \
+ $(LN_S) '$(PNGLIB_BASENAME).pc' libpng.pc
+
+uninstall-libpng-pc:
rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc'
+
+# EXT_LIST is a list of the possibly library directory extensions, this exists
+# because we can't find a good way of discovering the file extensions that are
+# actually installed on a given system, so instead we check for every extension
+# we have seen.
+
+EXT_LIST = a dll.a so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ la sl dylib
+
+install-library-links:
+ @set -x; cd '$(DESTDIR)$(libdir)';\
+ for ext in $(EXT_LIST); do\
+ rm -f "libpng.$$ext";\
+ if test -f "$(PNGLIB_BASENAME).$$ext"; then\
+ $(LN_S) "$(PNGLIB_BASENAME).$$ext" "libpng.$$ext" || exit 1;\
+ fi;\
+ done
+
+uninstall-library-links:
+ @set -x; cd '$(DESTDIR)$(libdir)'; for ext in $(EXT_LIST); do\
+ rm -f "libpng.$$ext"; done
+
+install-libpng-config:
+ @set -ex; cd '$(DESTDIR)$(bindir)'; rm -f libpng-config; \
+ $(LN_S) '$(PNGLIB_BASENAME)-config' libpng-config
+
+uninstall-libpng-config:
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'
+
+if DO_INSTALL_LINKS
+# If --enable-unversioned-links is specified the header and lib file links
+# will be automatically made on a 'make install':
+
+install-data-hook: install-header-links
+uninstall-hook: uninstall-header-links
+install-exec-hook: install-library-links
+uninstall-hook: uninstall-library-links
+endif
+
+if DO_INSTALL_LIBPNG_PC
+# Likewise, --install-pc causes libpng.pc to be constructed:
+
+install-data-hook: install-libpng-pc
+uninstall-hook: uninstall-libpng-pc
+endif
+
+if DO_INSTALL_LIBPNG_CONFIG
+# And --install-config:
+
+install-exec-hook: install-libpng-config
+uninstall-hook: uninstall-libpng-config
+endif
# The following addition ensures that 'make all' always builds the test programs
# too. It used to, but some change either in libpng or configure stopped this
diff --git a/README b/README
index 840d6c3e0..1aefa24de 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-README for libpng version 1.6.8 - December 19, 2013 (shared library 16.0)
+README for libpng version 1.6.9 - February 6, 2014 (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.
@@ -121,7 +121,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 eighteen 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.
diff --git a/arm/arm_init.c b/arm/arm_init.c
index 098771781..271c6121d 100644
--- a/arm/arm_init.c
+++ b/arm/arm_init.c
@@ -90,7 +90,7 @@ safe_read(png_structp png_ptr, int fd, void *buffer_in, size_t nbytes)
if (errno != EINTR)
{
png_warning(png_ptr, "/proc read failed");
- return 0; /* I.e. a permanent failure */
+ return 0; /* I.e., a permanent failure */
}
}
diff --git a/arm/filter_neon_intrinsics.c b/arm/filter_neon_intrinsics.c
index 99e0a2cfa..e7a09f436 100644
--- a/arm/filter_neon_intrinsics.c
+++ b/arm/filter_neon_intrinsics.c
@@ -21,7 +21,7 @@
/* libpng row pointers are not necessarily aligned to any particular boundary,
* however this code will only work with appropriate alignment. arm/arm_init.c
- * checks for this (and will not compile unless it is done), this code uses
+ * checks for this (and will not compile unless it is done). This code uses
* variants of png_aligncast to avoid compiler warnings.
*/
#define png_ptr(type,pointer) png_aligncast(type *,pointer)
diff --git a/configure.ac b/configure.ac
index a458bbdf9..8061aba60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@ AC_PREREQ([2.68])
dnl Version number stuff here:
-AC_INIT([libpng],[1.6.8],[png-mng-implement@lists.sourceforge.net])
+AC_INIT([libpng],[1.6.9],[png-mng-implement@lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts])
# libpng does not follow GNU file name conventions (hence 'foreign')
@@ -39,10 +39,10 @@ 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.8
+PNGLIB_VERSION=1.6.9
PNGLIB_MAJOR=1
PNGLIB_MINOR=6
-PNGLIB_RELEASE=8
+PNGLIB_RELEASE=9
dnl End of version number stuff
@@ -226,6 +226,45 @@ AC_ARG_WITH(libpng-prefix,
fi])
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
+# Control over what links are made for installed files. Versioned files are
+# always installed, when the following options are turned on corresponding
+# unversioned links are also created (normally as symbolic links):
+AC_ARG_ENABLE([unversioned-links],
+ AS_HELP_STRING([[[--enable-unversioned-links]]],
+ [Installed libpng header files are placed in a versioned subdirectory]
+ [and installed libpng library (including DLL) files are versioned.]
+ [If this option is enabled unversioned links will be created pointing to]
+ [the corresponding installed files. If you use libpng.pc or]
+ [libpng-config for all builds you do not need these links, but if you]
+ [compile programs directly they will typically #include <png.h> and]
+ [link with -lpng; in that case you need the links.]
+ [The links can be installed manually using 'make install-header-links']
+ [and 'make install-library-links' and can be removed using the]
+ [corresponding uninstall- targets. If you do enable this option every]
+ [libpng 'make install' will recreate the links to point to the just]
+ [installed version of libpng. The default is to create the links;]
+ [use --disable-unversioned-links to change this]))
+
+# The AM_CONDITIONAL test is written so that the default is enabled;
+# --disable-unversioned-links must be given to turn the option off.
+AM_CONDITIONAL([DO_INSTALL_LINKS],[test "$enable_unversioned_links" != "no"])
+
+AC_ARG_ENABLE([unversioned-libpng-pc],
+ AS_HELP_STRING([[[--enable-unversioned-libpng-pc]]],
+ [Install the configuration file 'libpng.pc' as a link to the versioned]
+ [version. This is done by default - use --disable-unversioned-libpng-pc]
+ [to change this.]))
+AM_CONDITIONAL([DO_INSTALL_LIBPNG_PC],
+ [test "$enable_unversioned_libpng_pc" != "no"])
+
+AC_ARG_ENABLE([unversioned-libpng-config],
+ AS_HELP_STRING([[[--enable-unversioned-libpng-config]]],
+ [Install the configuration file 'libpng-config' as a link to the]
+ [versioned version. This is done by default - use]
+ [--disable-unversioned-libpng-config to change this.]))
+AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
+ [test "$enable_unversioned_libpng_config" != "no"])
+
# HOST SPECIFIC OPTIONS
# =====================
#
diff --git a/contrib/gregbook/Makefile.mingw32 b/contrib/gregbook/Makefile.mingw32
index e70a59aef..3a3ff607e 100644
--- a/contrib/gregbook/Makefile.mingw32
+++ b/contrib/gregbook/Makefile.mingw32
@@ -47,7 +47,8 @@ CC = gcc
#CC = i386-mingw32msvc-gcc # e.g., Linux -> Win32 cross-compilation
LD = $(CC)
RM = rm -f
-CFLAGS = -O -Wall $(INCS) $(MINGW_CCFLAGS)
+CPPFLAGS = $(INCS)
+CFLAGS = -O -Wall $(MINGW_CCFLAGS)
# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
# [-ansi, -pedantic and -W can also be used]
LDFLAGS = $(MINGW_LDFLAGS)
@@ -85,10 +86,10 @@ EXES = $(STATIC_EXES) $(DYNAMIC_EXES)
# implicit make rules -------------------------------------------------------
.c$(O):
- $(CC) -c $(CFLAGS) $<
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
%.pic$(O): %.c
- $(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $<
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -DPNG_BUILD_DLL -o $@ $<
# dependencies --------------------------------------------------------------
diff --git a/contrib/gregbook/Makefile.sgi b/contrib/gregbook/Makefile.sgi
index 6c3bdf191..94d61b465 100644
--- a/contrib/gregbook/Makefile.sgi
+++ b/contrib/gregbook/Makefile.sgi
@@ -53,7 +53,8 @@ CC = cc
LD = cc
RM = rm -f
# ABI must be the same as that used to build libpng.
-ABI=
+ABI =
+CPPFLAGS =
CFLAGS = $(ABI) -O -fullwarn $(INCS)
LDFLAGS = $(ABI)
O = .o
@@ -73,7 +74,7 @@ EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
# implicit make rules -------------------------------------------------------
.c$(O):
- $(CC) -c $(CFLAGS) $<
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
# dependencies --------------------------------------------------------------
diff --git a/contrib/gregbook/Makefile.unx b/contrib/gregbook/Makefile.unx
index d5e4f355a..c8cadf87b 100644
--- a/contrib/gregbook/Makefile.unx
+++ b/contrib/gregbook/Makefile.unx
@@ -64,7 +64,8 @@ WLIBSs = $(PNGLIBs) $(ZLIBs)
CC = gcc
LD = gcc
RM = rm -f
-CFLAGS = -O -Wall $(INCS) -DFEATURE_LOOP
+CPPFLAGS = $(INCS) -DFEATURE_LOOP
+CFLAGS = -O -Wall
# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
# [-ansi, -pedantic and -W can also be used]
LDFLAGS =
@@ -92,7 +93,7 @@ EXES = $(STATIC_EXES) $(DYNAMIC_EXES)
# implicit make rules -------------------------------------------------------
.c$(O):
- $(CC) -c $(CFLAGS) $<
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
# dependencies --------------------------------------------------------------
diff --git a/contrib/gregbook/Makefile.w32 b/contrib/gregbook/Makefile.w32
index 41cfb231a..ab7dcf7ca 100644
--- a/contrib/gregbook/Makefile.w32
+++ b/contrib/gregbook/Makefile.w32
@@ -53,7 +53,8 @@ WLIBS = $(PNGLIB) $(ZLIB)
CC = cl
LD = link
RM = del
-CFLAGS = -nologo -O -W3 $(INCS) $(cvars)
+CPPFLAGS = $(INCS)
+CFLAGS = -nologo -O -W3 $(cvars)
# [note that -W3 is an MSVC-specific compilation flag ("all warnings on")]
# [see %devstudio%\vc\include\win32.mak for cvars macro definition]
O = .obj
@@ -76,7 +77,7 @@ EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
# implicit make rules -------------------------------------------------------
.c$(O):
- $(CC) -c $(CFLAGS) $<
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
# dependencies --------------------------------------------------------------
diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c
index 4146c8480..7347c1b5d 100644
--- a/contrib/libtests/pngvalid.c
+++ b/contrib/libtests/pngvalid.c
@@ -1,8 +1,8 @@
/* pngvalid.c - validate libpng by constructing then reading png files.
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
- * Copyright (c) 2013 Glenn Randers-Pehrson
+ * Last changed in libpng 1.5.18 [February 6, 2014]
+ * Copyright (c) 2014 Glenn Randers-Pehrson
* Written by John Cunningham Bowler
*
* This code is released under the libpng license.
@@ -43,6 +43,21 @@
# include "../../png.h"
#endif
+#ifdef PNG_ZLIB_HEADER
+# include PNG_ZLIB_HEADER
+#else
+# include <zlib.h> /* For crc32 */
+#endif
+
+/* 1.6.1 added support for the configure test harness, which uses 77 to indicate
+ * a skipped test, in earlier versions we need to succeed on a skipped test, so:
+ */
+#if PNG_LIBPNG_VER < 10601
+# define SKIP 0
+#else
+# define SKIP 77
+#endif
+
/* pngvalid requires write support and one of the fixed or floating point APIs.
*/
#if defined(PNG_WRITE_SUPPORTED) &&\
@@ -91,8 +106,6 @@ typedef png_byte *png_const_bytep;
# define png_const_structp png_structp
#endif
-#include <zlib.h> /* For crc32 */
-
#include <float.h> /* For floating point constants */
#include <stdlib.h> /* For malloc */
#include <string.h> /* For memcpy, memset */
@@ -352,11 +365,16 @@ standard_name_from_id(char *buffer, size_t bufsize, size_t pos, png_uint_32 id)
static int
next_format(png_bytep colour_type, png_bytep bit_depth,
- unsigned int* palette_number)
+ unsigned int* palette_number, int no_low_depth_gray)
{
if (*bit_depth == 0)
{
- *colour_type = 0, *bit_depth = 1, *palette_number = 0;
+ *colour_type = 0;
+ if (no_low_depth_gray)
+ *bit_depth = 8;
+ else
+ *bit_depth = 1;
+ *palette_number = 0;
return 1;
}
@@ -1874,6 +1892,7 @@ typedef struct png_modifier
double maxout16; /* Maximum output value error */
double maxabs16; /* Absolute sample error 0..1 */
double maxcalc16;/* Absolute sample error 0..1 */
+ double maxcalcG; /* Absolute sample error 0..1 */
double maxpc16; /* Percentage sample error 0..100% */
/* This is set by transforms that need to allow a higher limit, it is an
@@ -1913,10 +1932,15 @@ typedef struct png_modifier
/* Run the odd-sized image and interlace read/write tests? */
unsigned int test_size :1;
- /* Run tests on reading with a combiniation of transforms, */
+ /* Run tests on reading with a combination of transforms, */
unsigned int test_transform :1;
- /* When to use the use_input_precision option: */
+ /* When to use the use_input_precision option, this controls the gamma
+ * validation code checks. If set any value that is within the transformed
+ * range input-.5 to input+.5 will be accepted, otherwise the value must be
+ * within the normal limits. It should not be necessary to set this; the
+ * result should always be exact within the permitted error limits.
+ */
unsigned int use_input_precision :1;
unsigned int use_input_precision_sbit :1;
unsigned int use_input_precision_16to8 :1;
@@ -1926,8 +1950,8 @@ typedef struct png_modifier
*/
unsigned int calculations_use_input_precision :1;
- /* If set assume that the calculations are done in 16 bits even if both input
- * and output are 8 bit or less.
+ /* If set assume that the calculations are done in 16 bits even if the sample
+ * depth is 8 bits.
*/
unsigned int assume_16_bit_calculations :1;
@@ -1982,6 +2006,7 @@ modifier_init(png_modifier *pm)
pm->test_uses_encoding = 0;
pm->maxout8 = pm->maxpc8 = pm->maxabs8 = pm->maxcalc8 = 0;
pm->maxout16 = pm->maxpc16 = pm->maxabs16 = pm->maxcalc16 = 0;
+ pm->maxcalcG = 0;
pm->limit = 4E-3;
pm->log8 = pm->log16 = 0; /* Means 'off' */
pm->error_gray_2 = pm->error_gray_4 = pm->error_gray_8 = 0;
@@ -1996,6 +2021,7 @@ modifier_init(png_modifier *pm)
pm->use_input_precision_sbit = 0;
pm->use_input_precision_16to8 = 0;
pm->calculations_use_input_precision = 0;
+ pm->assume_16_bit_calculations = 0;
pm->test_gamma_threshold = 0;
pm->test_gamma_transform = 0;
pm->test_gamma_sbit = 0;
@@ -2010,8 +2036,16 @@ modifier_init(png_modifier *pm)
}
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
+
+/* This controls use of checks that explicitly know how libpng digitizes the
+ * samples in calculations; setting this circumvents simple error limit checking
+ * in the rgb_to_gray check, replacing it with an exact copy of the libpng 1.5
+ * algorithm.
+ */
+#define DIGITIZE PNG_LIBPNG_VER < 10700
+
/* If pm->calculations_use_input_precision is set then operations will happen
- * with only 8 bit precision unless both the input and output bit depth are 16.
+ * with the precision of the input, not the precision of the output depth.
*
* If pm->assume_16_bit_calculations is set then even 8 bit calculations use 16
* bit precision. This only affects those of the following limits that pertain
@@ -2019,8 +2053,8 @@ modifier_init(png_modifier *pm)
* called directly.
*/
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
-static double digitize(PNG_CONST png_modifier *pm, double value,
- int sample_depth, int do_round)
+#if DIGITIZE
+static double digitize(double value, int depth, int do_round)
{
/* 'value' is in the range 0 to 1, the result is the same value rounded to a
* multiple of the digitization factor - 8 or 16 bits depending on both the
@@ -2028,14 +2062,14 @@ static double digitize(PNG_CONST png_modifier *pm, double value,
* rounding and 'do_round' should be 1, if it is 0 the digitized value will
* be truncated.
*/
- PNG_CONST unsigned int digitization_factor =
- (pm->assume_16_bit_calculations || sample_depth == 16) ? 65535 : 255;
+ PNG_CONST unsigned int digitization_factor = (1U << depth) -1;
/* Limiting the range is done as a convenience to the caller - it's easier to
* do it once here than every time at the call site.
*/
if (value <= 0)
value = 0;
+
else if (value >= 1)
value = 1;
@@ -2044,31 +2078,30 @@ static double digitize(PNG_CONST png_modifier *pm, double value,
return floor(value)/digitization_factor;
}
#endif
+#endif /* RGB_TO_GRAY */
-#if defined(PNG_READ_GAMMA_SUPPORTED) ||\
- defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
+#ifdef PNG_READ_GAMMA_SUPPORTED
static double abserr(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
{
/* Absolute error permitted in linear values - affected by the bit depth of
* the calculations.
*/
- if (pm->assume_16_bit_calculations || (out_depth == 16 && (in_depth == 16 ||
- !pm->calculations_use_input_precision)))
+ if (pm->assume_16_bit_calculations ||
+ (pm->calculations_use_input_precision ? in_depth : out_depth) == 16)
return pm->maxabs16;
else
return pm->maxabs8;
}
-#endif
-#ifdef PNG_READ_GAMMA_SUPPORTED
static double calcerr(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
{
/* Error in the linear composition arithmetic - only relevant when
* composition actually happens (0 < alpha < 1).
*/
- if (pm->assume_16_bit_calculations || (out_depth == 16 && (in_depth == 16 ||
- !pm->calculations_use_input_precision)))
+ if ((pm->calculations_use_input_precision ? in_depth : out_depth) == 16)
return pm->maxcalc16;
+ else if (pm->assume_16_bit_calculations)
+ return pm->maxcalcG;
else
return pm->maxcalc8;
}
@@ -2078,8 +2111,8 @@ static double pcerr(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
/* Percentage error permitted in the linear values. Note that the specified
* value is a percentage but this routine returns a simple number.
*/
- if (pm->assume_16_bit_calculations || (out_depth == 16 && (in_depth == 16 ||
- !pm->calculations_use_input_precision)))
+ if (pm->assume_16_bit_calculations ||
+ (pm->calculations_use_input_precision ? in_depth : out_depth) == 16)
return pm->maxpc16 * .01;
else
return pm->maxpc8 * .01;
@@ -2111,8 +2144,7 @@ static double outerr(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
if (out_depth == 4)
return .90644-.5;
- if (out_depth == 16 && (in_depth == 16 ||
- !pm->calculations_use_input_precision))
+ if ((pm->calculations_use_input_precision ? in_depth : out_depth) == 16)
return pm->maxout16;
/* This is the case where the value was calculated at 8-bit precision then
@@ -2145,8 +2177,7 @@ static double outlog(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
return pm->log8;
}
- if (out_depth == 16 && (in_depth == 16 ||
- !pm->calculations_use_input_precision))
+ if ((pm->calculations_use_input_precision ? in_depth : out_depth) == 16)
{
if (pm->log16 == 0)
return 65536;
@@ -2171,8 +2202,8 @@ static double outlog(PNG_CONST png_modifier *pm, int in_depth, int out_depth)
static int output_quantization_factor(PNG_CONST png_modifier *pm, int in_depth,
int out_depth)
{
- if (out_depth == 16 && in_depth != 16
- && pm->calculations_use_input_precision)
+ if (out_depth == 16 && in_depth != 16 &&
+ pm->calculations_use_input_precision)
return 257;
else
return 1;
@@ -3379,10 +3410,28 @@ transform_row(png_const_structp pp, png_byte buffer[TRANSFORM_ROWMAX],
#define DEPTH(bd) ((png_byte)(1U << (bd)))
/* This is just a helper for compiling on minimal systems with no write
- * interlacing support.
+ * interlacing support. If there is no write interlacing we can't generate test
+ * cases with interlace:
*/
-#ifndef PNG_WRITE_INTERLACING_SUPPORTED
+#ifdef PNG_WRITE_INTERLACING_SUPPORTED
+# define INTERLACE_LAST PNG_INTERLACE_LAST
+# define check_interlace_type(type) ((void)(type))
+#else
+# define INTERLACE_LAST (PNG_INTERLACE_NONE+1)
# define png_set_interlace_handling(a) (1)
+
+static void
+check_interlace_type(int PNG_CONST interlace_type)
+{
+ if (interlace_type != PNG_INTERLACE_NONE)
+ {
+ /* This is an internal error - --interlace tests should be skipped, not
+ * attempted.
+ */
+ fprintf(stderr, "pngvalid: no interlace support\n");
+ exit(99);
+ }
+}
#endif
/* Make a standardized image given a an image colour type, bit depth and
@@ -3398,6 +3447,8 @@ make_transform_image(png_store* PNG_CONST ps, png_byte PNG_CONST colour_type,
{
context(ps, fault);
+ check_interlace_type(interlace_type);
+
Try
{
png_infop pi;
@@ -3534,16 +3585,12 @@ make_transform_images(png_store *ps)
/* Use next_format to enumerate all the combinations we test, including
* generating multiple low bit depth palette images.
*/
- while (next_format(&colour_type, &bit_depth, &palette_number))
+ while (next_format(&colour_type, &bit_depth, &palette_number, 0))
{
int interlace_type;
-# ifdef PNG_WRITE_INTERLACING_SUPPORTED
- for (interlace_type = PNG_INTERLACE_NONE;
- interlace_type < PNG_INTERLACE_LAST; ++interlace_type)
-# else
- interlace_type = PNG_INTERLACE_NONE;
-# endif
+ for (interlace_type = PNG_INTERLACE_NONE;
+ interlace_type < INTERLACE_LAST; ++interlace_type)
{
char name[FILE_NAME_SIZE];
@@ -3633,6 +3680,12 @@ make_size_image(png_store* PNG_CONST ps, png_byte PNG_CONST colour_type,
{
context(ps, fault);
+ /* At present libpng does not support the write of an interlaced image unless
+ * PNG_WRITE_INTERLACING_SUPPORTED, even with do_interlace so the code here
+ * does the pixel interlace itself, so:
+ */
+ check_interlace_type(interlace_type);
+
Try
{
png_infop pi;
@@ -3842,9 +3895,9 @@ make_size(png_store* PNG_CONST ps, png_byte PNG_CONST colour_type, int bdlo,
# ifdef PNG_WRITE_INTERLACING_SUPPORTED
make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_ADAM7,
width, height, 0);
-# endif
make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_ADAM7,
width, height, 1);
+# endif
}
}
}
@@ -3935,6 +3988,8 @@ make_error(png_store* volatile psIn, png_byte PNG_CONST colour_type,
context(ps, fault);
+ check_interlace_type(interlace_type);
+
Try
{
png_structp pp;
@@ -4037,12 +4092,8 @@ make_errors(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type,
{
int interlace_type;
-# ifdef PNG_WRITE_INTERLACING_SUPPORTED
- for (interlace_type = PNG_INTERLACE_NONE;
- interlace_type < PNG_INTERLACE_LAST; ++interlace_type)
-# else
- interlace_type = PNG_INTERLACE_NONE;
-# endif
+ for (interlace_type = PNG_INTERLACE_NONE;
+ interlace_type < INTERLACE_LAST; ++interlace_type)
{
unsigned int test;
char name[FILE_NAME_SIZE];
@@ -4240,6 +4291,7 @@ standard_display_init(standard_display *dp, png_store* ps, png_uint_32 id,
dp->red_sBIT = dp->blue_sBIT = dp->green_sBIT = dp->alpha_sBIT =
dp->bit_depth;
dp->interlace_type = INTERLACE_FROM_ID(id);
+ check_interlace_type(dp->interlace_type);
dp->id = id;
/* All the rest are filled in after the read_info: */
dp->w = 0;
@@ -4849,7 +4901,7 @@ standard_check_text(png_const_structp pp, png_const_textp tp,
static void
standard_text_validate(standard_display *dp, png_const_structp pp,
- png_infop pi)
+ png_infop pi, int check_end)
{
png_textp tp = NULL;
png_uint_32 num_text = png_get_text(pp, pi, &tp, NULL);
@@ -4857,7 +4909,13 @@ standard_text_validate(standard_display *dp, png_const_structp pp,
if (num_text == 2 && tp != NULL)
{
standard_check_text(pp, tp, "image name", dp->ps->current->name);
- standard_check_text(pp, tp+1, "end marker", "end");
+
+ /* This exists because prior to 1.5.18 the progressive reader left the
+ * png_struct z_stream unreset at the end of the image, so subsequent
+ * attempts to use it simply returns Z_STREAM_END.
+ */
+ if (check_end)
+ standard_check_text(pp, tp+1, "end marker", "end");
}
else
@@ -4870,7 +4928,7 @@ standard_text_validate(standard_display *dp, png_const_structp pp,
}
}
#else
-# define standard_text_validate(dp,pp,pi) ((void)0)
+# define standard_text_validate(dp,pp,pi,check_end) ((void)0)
#endif
static void
@@ -4960,7 +5018,8 @@ standard_end(png_structp ppIn, png_infop pi)
/* Validate the image - progressive reading only produces one variant for
* interlaced images.
*/
- standard_text_validate(dp, pp, pi);
+ standard_text_validate(dp, pp, pi,
+ PNG_LIBPNG_VER >= 10518/*check_end: see comments above*/);
standard_image_validate(dp, pp, 0, -1);
}
@@ -5031,7 +5090,7 @@ standard_test(png_store* PNG_CONST psIn, png_uint_32 PNG_CONST id,
*/
if (!d.speed)
{
- standard_text_validate(&d, pp, pi);
+ standard_text_validate(&d, pp, pi, 1/*check_end*/);
standard_image_validate(&d, pp, 0, 1);
}
else
@@ -5062,7 +5121,7 @@ test_standard(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type,
int interlace_type;
for (interlace_type = PNG_INTERLACE_NONE;
- interlace_type < PNG_INTERLACE_LAST; ++interlace_type)
+ interlace_type < INTERLACE_LAST; ++interlace_type)
{
standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
interlace_type, 0, 0, 0), 0/*do_interlace*/, pm->use_update_info);
@@ -5137,6 +5196,7 @@ test_size(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type,
if (fail(pm))
return 0;
+# ifdef PNG_WRITE_INTERLACING_SUPPORTED
standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
PNG_INTERLACE_ADAM7, w, h, 0), 0/*do_interlace*/,
pm->use_update_info);
@@ -5150,6 +5210,7 @@ test_size(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type,
if (fail(pm))
return 0;
+# endif
/* Now validate the interlaced read side - do_interlace true,
* in the progressive case this does actually make a difference
@@ -5162,12 +5223,14 @@ test_size(png_modifier* PNG_CONST pm, png_byte PNG_CONST colour_type,
if (fail(pm))
return 0;
+# ifdef PNG_WRITE_INTERLACING_SUPPORTED
standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
PNG_INTERLACE_ADAM7, w, h, 0), 1/*do_interlace*/,
pm->use_update_info);
if (fail(pm))
return 0;
+# endif
}
}
@@ -5879,12 +5942,9 @@ transform_image_validate(transform_display *dp, png_const_structp pp,
memset(out_palette, 0x5e, sizeof out_palette);
- /* assume-8-bit-calculations means assume that if the input has 8 bit
- * (or less) samples and the output has 16 bit samples the calculations
- * will be done with 8 bit precision, not 16.
- *
- * TODO: fix this in libpng; png_set_expand_16 should cause 16 bit
- * calculations to be used throughout.
+ /* use-input-precision means assume that if the input has 8 bit (or less)
+ * samples and the output has 16 bit samples the calculations will be done
+ * with 8 bit precision, not 16.
*/
if (in_ct == PNG_COLOR_TYPE_PALETTE || in_bd < 16)
in_sample_depth = 8;
@@ -5895,7 +5955,8 @@ transform_image_validate(transform_display *dp, png_const_structp pp,
!dp->pm->calculations_use_input_precision)
digitization_error = .5;
- /* Else errors are at 8 bit precision, scale .5 in 8 bits to the 16 bits:
+ /* Else calculations are at 8 bit precision, and the output actually
+ * consists of scaled 8-bit values, so scale .5 in 8 bits to the 16 bits:
*/
else
digitization_error = .5 * 257;
@@ -6711,10 +6772,23 @@ image_transform_png_set_rgb_to_gray_ini(PNG_CONST image_transform *this,
{
if (that->this.bit_depth == 16 || pm->assume_16_bit_calculations)
{
- /* The 16 bit case ends up producing a maximum error of about
- * +/-5 in 65535, allow for +/-8 with the given gamma.
+ /* The computations have the form:
+ *
+ * r * rc + g * gc + b * bc
+ *
+ * Each component of which is +/-1/65535 from the gamma_to_1 table
+ * lookup, resulting in a base error of +/-6. The gamma_from_1
+ * conversion adds another +/-2 in the 16-bit case and
+ * +/-(1<<(15-PNG_MAX_GAMMA_8)) in the 8-bit case.
*/
- that->pm->limit += pow(8./65535, data.gamma);
+ that->pm->limit += pow(
+# if PNG_MAX_GAMMA_8 < 14
+ (that->this.bit_depth == 16 ? 8. :
+ 6. + (1<<(15-PNG_MAX_GAMMA_8)))
+# else
+ 8.
+# endif
+ /65535, data.gamma);
}
else
@@ -6722,8 +6796,23 @@ image_transform_png_set_rgb_to_gray_ini(PNG_CONST image_transform *this,
/* Rounding to 8 bits in the linear space causes massive errors which
* will trigger the error check in transform_range_check. Fix that
* here by taking the gamma encoding into account.
+ *
+ * When DIGITIZE is set because a pre-1.7 version of libpng is being
+ * tested allow a bigger slack.
+ *
+ * NOTE: this magic number was determined by experiment to be 1.1 (when
+ * using fixed point arithmetic). There's no great merit to the value
+ * below, however it only affects the limit used for checking for
+ * internal calculation errors, not the actual limit imposed by
+ * pngvalid on the output errors.
*/
- that->pm->limit += pow(1./255, data.gamma);
+ that->pm->limit += pow(
+# if DIGITIZE
+ 1.1
+# else
+ 1.
+# endif
+ /255, data.gamma);
}
}
@@ -6732,7 +6821,7 @@ image_transform_png_set_rgb_to_gray_ini(PNG_CONST image_transform *this,
/* With no gamma correction a large error comes from the truncation of the
* calculation in the 8 bit case, allow for that here.
*/
- if (that->this.bit_depth != 16)
+ if (that->this.bit_depth != 16 && !pm->assume_16_bit_calculations)
that->pm->limit += 4E-3;
}
}
@@ -6877,9 +6966,14 @@ image_transform_png_set_rgb_to_gray_mod(PNG_CONST image_transform *this,
image_pixel_convert_PLTE(that);
/* Image now has RGB channels... */
+# if DIGITIZE
{
PNG_CONST png_modifier *pm = display->pm;
- PNG_CONST unsigned int sample_depth = that->sample_depth;
+ const unsigned int sample_depth = that->sample_depth;
+ const unsigned int calc_depth = (pm->assume_16_bit_calculations ? 16 :
+ sample_depth);
+ const unsigned int gamma_depth = (sample_depth == 16 ? 16 :
+ (pm->assume_16_bit_calculations ? PNG_MAX_GAMMA_8 : sample_depth));
int isgray;
double r, g, b;
double rlo, rhi, glo, ghi, blo, bhi, graylo, grayhi;
@@ -6895,28 +6989,28 @@ image_transform_png_set_rgb_to_gray_mod(PNG_CONST image_transform *this,
*/
r = rlo = rhi = that->redf;
rlo -= that->rede;
- rlo = digitize(pm, rlo, sample_depth, 1/*round*/);
+ rlo = digitize(rlo, calc_depth, 1/*round*/);
rhi += that->rede;
- rhi = digitize(pm, rhi, sample_depth, 1/*round*/);
+ rhi = digitize(rhi, calc_depth, 1/*round*/);
g = glo = ghi = that->greenf;
glo -= that->greene;
- glo = digitize(pm, glo, sample_depth, 1/*round*/);
+ glo = digitize(glo, calc_depth, 1/*round*/);
ghi += that->greene;
- ghi = digitize(pm, ghi, sample_depth, 1/*round*/);
+ ghi = digitize(ghi, calc_depth, 1/*round*/);
b = blo = bhi = that->bluef;
blo -= that->bluee;
- blo = digitize(pm, blo, sample_depth, 1/*round*/);
+ blo = digitize(blo, calc_depth, 1/*round*/);
bhi += that->greene;
- bhi = digitize(pm, bhi, sample_depth, 1/*round*/);
+ bhi = digitize(bhi, calc_depth, 1/*round*/);
isgray = r==g && g==b;
if (data.gamma != 1)
{
PNG_CONST double power = 1/data.gamma;
- PNG_CONST double abse = abserr(pm, sample_depth, sample_depth);
+ PNG_CONST double abse = calc_depth == 16 ? .5/65535 : .5/255;
/* 'abse' is the absolute error permitted in linear calculations. It
* is used here to capture the error permitted in the handling
@@ -6925,16 +7019,16 @@ image_transform_png_set_rgb_to_gray_mod(PNG_CONST image_transform *this,
* where the real errors are introduced.
*/
r = pow(r, power);
- rlo = digitize(pm, pow(rlo, power)-abse, sample_depth, 1);
- rhi = digitize(pm, pow(rhi, power)+abse, sample_depth, 1);
+ rlo = digitize(pow(rlo, power)-abse, calc_depth, 1);
+ rhi = digitize(pow(rhi, power)+abse, calc_depth, 1);
g = pow(g, power);
- glo = digitize(pm, pow(glo, power)-abse, sample_depth, 1);
- ghi = digitize(pm, pow(ghi, power)+abse, sample_depth, 1);
+ glo = digitize(pow(glo, power)-abse, calc_depth, 1);
+ ghi = digitize(pow(ghi, power)+abse, calc_depth, 1);
b = pow(b, power);
- blo = digitize(pm, pow(blo, power)-abse, sample_depth, 1);
- bhi = digitize(pm, pow(bhi, power)+abse, sample_depth, 1);
+ blo = digitize(pow(blo, power)-abse, calc_depth, 1);
+ bhi = digitize(pow(bhi, power)+abse, calc_depth, 1);
}
/* Now calculate the actual gray values. Although the error in the
@@ -6951,18 +7045,18 @@ image_transform_png_set_rgb_to_gray_mod(PNG_CONST image_transform *this,
b * data.blue_coefficient;
{
- PNG_CONST int do_round = data.gamma != 1 || sample_depth == 16;
+ PNG_CONST int do_round = data.gamma != 1 || calc_depth == 16;
PNG_CONST double ce = 1. / 32768;
- graylo = digitize(pm, rlo * (data.red_coefficient-ce) +
+ graylo = digitize(rlo * (data.red_coefficient-ce) +
glo * (data.green_coefficient-ce) +
- blo * (data.blue_coefficient-ce), sample_depth, do_round);
+ blo * (data.blue_coefficient-ce), gamma_depth, do_round);
if (graylo <= 0)
graylo = 0;
- grayhi = digitize(pm, rhi * (data.red_coefficient+ce) +
+ grayhi = digitize(rhi * (data.red_coefficient+ce) +
ghi * (data.green_coefficient+ce) +
- bhi * (data.blue_coefficient+ce), sample_depth, do_round);
+ bhi * (data.blue_coefficient+ce), gamma_depth, do_round);
if (grayhi >= 1)
grayhi = 1;
}
@@ -6973,8 +7067,8 @@ image_transform_png_set_rgb_to_gray_mod(PNG_CONST image_transform *this,
PNG_CONST double power = data.gamma;
gray = pow(gray, power);
- graylo = digitize(pm, pow(graylo, power), sample_depth, 1);
- grayhi = digitize(pm, pow(grayhi, power), sample_depth, 1);
+ graylo = digitize(pow(graylo, power), sample_depth, 1);
+ grayhi = digitize(pow(grayhi, power), sample_depth, 1);
}
/* Now the error can be calculated.
@@ -6992,7 +7086,115 @@ image_transform_png_set_rgb_to_gray_mod(PNG_CONST image_transform *this,
err = fabs(graylo-gray);
/* Check that this worked: */
- if (err > display->pm->limit)
+ if (err > pm->limit)
+ {
+ size_t pos = 0;
+ char buffer[128];
+
+ pos = safecat(buffer, sizeof buffer, pos, "rgb_to_gray error ");
+ pos = safecatd(buffer, sizeof buffer, pos, err, 6);
+ pos = safecat(buffer, sizeof buffer, pos, " exceeds limit ");
+ pos = safecatd(buffer, sizeof buffer, pos, pm->limit, 6);
+ png_error(pp, buffer);
+ }
+ }
+ }
+# else /* DIGITIZE */
+ {
+ double r = that->redf;
+ double re = that->rede;
+ double g = that->greenf;
+ double ge = that->greene;
+ double b = that->bluef;
+ double be = that->bluee;
+
+ /* The true gray case involves no math. */
+ if (r == g && r == b)
+ {
+ gray = r;
+ err = re;
+ if (err < ge) err = ge;
+ if (err < be) err = be;
+ }
+
+ else if (data.gamma == 1)
+ {
+ /* There is no need to do the conversions to and from linear space,
+ * so the calculation should be a lot more accurate. There is a
+ * built in 1/32768 error in the coefficients because they only have
+ * 15 bits and are adjusted to make sure they add up to 32768, so
+ * the result may have an additional error up to 1/32768. (Note
+ * that adding the 1/32768 here avoids needing to increase the
+ * global error limits to take this into account.)
+ */
+ gray = r * data.red_coefficient + g * data.green_coefficient +
+ b * data.blue_coefficient;
+ err = re * data.red_coefficient + ge * data.green_coefficient +
+ be * data.blue_coefficient + 1./32768 + gray * 5 * DBL_EPSILON;
+ }
+
+ else
+ {
+ /* The calculation happens in linear space, and this produces much
+ * wider errors in the encoded space. These are handled here by
+ * factoring the errors in to the calculation. There are two table
+ * lookups in the calculation and each introduces a quantization
+ * error defined by the table size.
+ */
+ PNG_CONST png_modifier *pm = display->pm;
+ double in_qe = (that->sample_depth > 8 ? .5/65535 : .5/255);
+ double out_qe = (that->sample_depth > 8 ? .5/65535 :
+ (pm->assume_16_bit_calculations ? .5/(1<<PNG_MAX_GAMMA_8) :
+ .5/255));
+ double rhi, ghi, bhi, grayhi;
+ double g1 = 1/data.gamma;
+
+ rhi = r + re + in_qe; if (rhi > 1) rhi = 1;
+ r -= re + in_qe; if (r < 0) r = 0;
+ ghi = g + ge + in_qe; if (ghi > 1) ghi = 1;
+ g -= ge + in_qe; if (g < 0) g = 0;
+ bhi = b + be + in_qe; if (bhi > 1) bhi = 1;
+ b -= be + in_qe; if (b < 0) b = 0;
+
+ r = pow(r, g1)*(1-DBL_EPSILON); rhi = pow(rhi, g1)*(1+DBL_EPSILON);
+ g = pow(g, g1)*(1-DBL_EPSILON); ghi = pow(ghi, g1)*(1+DBL_EPSILON);
+ b = pow(b, g1)*(1-DBL_EPSILON); bhi = pow(bhi, g1)*(1+DBL_EPSILON);
+
+ /* Work out the lower and upper bounds for the gray value in the
+ * encoded space, then work out an average and error. Remove the
+ * previously added input quantization error at this point.
+ */
+ gray = r * data.red_coefficient + g * data.green_coefficient +
+ b * data.blue_coefficient - 1./32768 - out_qe;
+ if (gray <= 0)
+ gray = 0;
+ else
+ {
+ gray *= (1 - 6 * DBL_EPSILON);
+ gray = pow(gray, data.gamma) * (1-DBL_EPSILON);
+ }
+
+ grayhi = rhi * data.red_coefficient + ghi * data.green_coefficient +
+ bhi * data.blue_coefficient + 1./32768 + out_qe;
+ grayhi *= (1 + 6 * DBL_EPSILON);
+ if (grayhi >= 1)
+ grayhi = 1;
+ else
+ grayhi = pow(grayhi, data.gamma) * (1+DBL_EPSILON);
+
+ err = (grayhi - gray) / 2;
+ gray = (grayhi + gray) / 2;
+
+ if (err <= in_qe)
+ err = gray * DBL_EPSILON;
+
+ else
+ err -= in_qe;
+
+ /* Validate that the error is within limits (this has caused
+ * problems before, it's much easier to detect them here.)
+ */
+ if (err > pm->limit)
{
size_t pos = 0;
char buffer[128];
@@ -7000,12 +7202,12 @@ image_transform_png_set_rgb_to_gray_mod(PNG_CONST image_transform *this,
pos = safecat(buffer, sizeof buffer, pos, "rgb_to_gray error ");
pos = safecatd(buffer, sizeof buffer, pos, err, 6);
pos = safecat(buffer, sizeof buffer, pos, " exceeds limit ");
- pos = safecatd(buffer, sizeof buffer, pos,
- display->pm->limit, 6);
+ pos = safecatd(buffer, sizeof buffer, pos, pm->limit, 6);
png_error(pp, buffer);
}
}
}
+# endif /* !DIGITIZE */
that->bluef = that->greenf = that->redf = gray;
that->bluee = that->greene = that->rede = err;
@@ -7054,7 +7256,7 @@ IT(rgb_to_gray);
* int background_gamma_code, int need_expand,
* png_fixed_point background_gamma)
*
- * As with rgb_to_gray this ignores the gamma (at present.)
+ * This ignores the gamma (at present.)
*/
#define data ITDATA(background)
static image_pixel data;
@@ -7065,6 +7267,7 @@ image_transform_png_set_background_set(PNG_CONST image_transform *this,
{
png_byte colour_type, bit_depth;
png_byte random_bytes[8]; /* 8 bytes - 64 bits - the biggest pixel */
+ int expand;
png_color_16 back;
/* We need a background colour, because we don't know exactly what transforms
@@ -7082,10 +7285,14 @@ image_transform_png_set_background_set(PNG_CONST image_transform *this,
{
colour_type = PNG_COLOR_TYPE_RGB;
bit_depth = 8;
+ expand = 0; /* passing in an RGB not a pixel index */
}
else
+ {
bit_depth = that->this.bit_depth;
+ expand = 1;
+ }
image_pixel_init(&data, random_bytes, colour_type,
bit_depth, 0/*x*/, 0/*unused: palette*/);
@@ -7106,11 +7313,9 @@ image_transform_png_set_background_set(PNG_CONST image_transform *this,
back.gray = (png_uint_16)data.red;
# ifdef PNG_FLOATING_POINT_SUPPORTED
- png_set_background(pp, &back, PNG_BACKGROUND_GAMMA_FILE, 1/*need expand*/,
- 0);
+ png_set_background(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0);
# else
- png_set_background_fixed(pp, &back, PNG_BACKGROUND_GAMMA_FILE,
- 1/*need expand*/, 0);
+ png_set_background_fixed(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0);
# endif
this->next->set(this->next, that, pp, pi);
@@ -7442,7 +7647,7 @@ perform_transform_test(png_modifier *pm)
png_byte bit_depth = 0;
unsigned int palette_number = 0;
- while (next_format(&colour_type, &bit_depth, &palette_number))
+ while (next_format(&colour_type, &bit_depth, &palette_number, 0))
{
png_uint_32 counter = 0;
size_t base_pos;
@@ -8127,14 +8332,25 @@ gamma_component_validate(PNG_CONST char *name, PNG_CONST validate_info *vi,
* passed. Don't do these additional tests here - just log the
* original [es_lo..es_hi] values.
*/
- if (pass == 0 && vi->use_input_precision)
+ if (pass == 0 && vi->use_input_precision && vi->dp->sbit)
{
/* Ok, something is wrong - this actually happens in current libpng
* 16-to-8 processing. Assume that the input value (id, adjusted
* for sbit) can be anywhere between value-.5 and value+.5 - quite a
* large range if sbit is low.
+ *
+ * NOTE: at present because the libpng gamma table stuff has been
+ * changed to use a rounding algorithm to correct errors in 8-bit
+ * calculations the precise sbit calculation (a shift) has been
+ * lost. This can result in up to a +/-1 error in the presence of
+ * an sbit less than the bit depth.
*/
- double tmp = (isbit - .5)/sbit_max;
+# if PNG_LIBPNG_VER < 10700
+# define SBIT_ERROR .5
+# else
+# define SBIT_ERROR 1.
+# endif
+ double tmp = (isbit - SBIT_ERROR)/sbit_max;
if (tmp <= 0)
tmp = 0;
@@ -8153,10 +8369,10 @@ gamma_component_validate(PNG_CONST char *name, PNG_CONST validate_info *vi,
if (is_lo < 0)
is_lo = 0;
- tmp = (isbit + .5)/sbit_max;
+ tmp = (isbit + SBIT_ERROR)/sbit_max;
- if (tmp <= 0)
- tmp = 0;
+ if (tmp >= 1)
+ tmp = 1;
else if (alpha >= 0 && vi->file_inverse > 0 && tmp < 1)
tmp = pow(tmp, vi->file_inverse);
@@ -8473,7 +8689,7 @@ gamma_image_validate(gamma_display *dp, png_const_structp pp,
* Because there is limited precision in the input it is arguable that
* an acceptable result is any valid result from input-.5 to input+.5.
* The basic tests below do not do this, however if 'use_input_precision'
- * is set a subsequent test is performed below.
+ * is set a subsequent test is performed above.
*/
PNG_CONST unsigned int samples_per_pixel = (out_ct & 2U) ? 3U : 1U;
int processing;
@@ -8815,7 +9031,7 @@ perform_gamma_threshold_tests(png_modifier *pm)
* fact this test is somewhat excessive since libpng doesn't make this
* decision based on colour type or bit depth!
*/
- while (next_format(&colour_type, &bit_depth, &palette_number))
+ while (next_format(&colour_type, &bit_depth, &palette_number, 1/*gamma*/))
if (palette_number == 0)
{
double test_gamma = 1.0;
@@ -8876,7 +9092,7 @@ static void perform_gamma_transform_tests(png_modifier *pm)
png_byte bit_depth = 0;
unsigned int palette_number = 0;
- while (next_format(&colour_type, &bit_depth, &palette_number))
+ while (next_format(&colour_type, &bit_depth, &palette_number, 1/*gamma*/))
{
unsigned int i, j;
@@ -8906,7 +9122,7 @@ static void perform_gamma_sbit_tests(png_modifier *pm)
png_byte colour_type = 0, bit_depth = 0;
unsigned int npalette = 0;
- while (next_format(&colour_type, &bit_depth, &npalette))
+ while (next_format(&colour_type, &bit_depth, &npalette, 1/*gamma*/))
if ((colour_type & PNG_COLOR_MASK_ALPHA) == 0 &&
((colour_type == 3 && sbit < 8) ||
(colour_type != 3 && sbit < bit_depth)))
@@ -8941,6 +9157,7 @@ static void perform_gamma_scale16_tests(png_modifier *pm)
# ifndef PNG_MAX_GAMMA_8
# define PNG_MAX_GAMMA_8 11
# endif
+# define SBIT_16_TO_8 PNG_MAX_GAMMA_8
/* Include the alpha cases here. Note that sbit matches the internal value
* used by the library - otherwise we will get spurious errors from the
* internal sbit style approximation.
@@ -8958,28 +9175,28 @@ static void perform_gamma_scale16_tests(png_modifier *pm)
fabs(pm->gammas[j]/pm->gammas[i]-1) >= PNG_GAMMA_THRESHOLD)
{
gamma_transform_test(pm, 0, 16, 0, pm->interlace_type,
- 1/pm->gammas[i], pm->gammas[j], PNG_MAX_GAMMA_8,
+ 1/pm->gammas[i], pm->gammas[j], SBIT_16_TO_8,
pm->use_input_precision_16to8, 1 /*scale16*/);
if (fail(pm))
return;
gamma_transform_test(pm, 2, 16, 0, pm->interlace_type,
- 1/pm->gammas[i], pm->gammas[j], PNG_MAX_GAMMA_8,
+ 1/pm->gammas[i], pm->gammas[j], SBIT_16_TO_8,
pm->use_input_precision_16to8, 1 /*scale16*/);
if (fail(pm))
return;
gamma_transform_test(pm, 4, 16, 0, pm->interlace_type,
- 1/pm->gammas[i], pm->gammas[j], PNG_MAX_GAMMA_8,
+ 1/pm->gammas[i], pm->gammas[j], SBIT_16_TO_8,
pm->use_input_precision_16to8, 1 /*scale16*/);
if (fail(pm))
return;
gamma_transform_test(pm, 6, 16, 0, pm->interlace_type,
- 1/pm->gammas[i], pm->gammas[j], PNG_MAX_GAMMA_8,
+ 1/pm->gammas[i], pm->gammas[j], SBIT_16_TO_8,
pm->use_input_precision_16to8, 1 /*scale16*/);
if (fail(pm))
@@ -9061,6 +9278,28 @@ static void gamma_composition_test(png_modifier *pm,
r = random_32();
background.blue = (png_uint_16)r;
background.gray = (png_uint_16)(r >> 16);
+
+ /* In earlier libpng versions, those where DIGITIZE is set, any background
+ * gamma correction in the expand16 case was done using 8-bit gamma
+ * correction tables, resulting in larger errors. To cope with those
+ * cases use a 16-bit background value which will handle this gamma
+ * correction.
+ */
+# if DIGITIZE
+ if (expand_16 && (do_background == PNG_BACKGROUND_GAMMA_UNIQUE ||
+ do_background == PNG_BACKGROUND_GAMMA_FILE) &&
+ fabs(bg*screen_gamma-1) > PNG_GAMMA_THRESHOLD)
+ {
+ /* The background values will be looked up in an 8-bit table to do
+ * the gamma correction, so only select values which are an exact
+ * match for the 8-bit table entries:
+ */
+ background.red = (png_uint_16)((background.red >> 8) * 257);
+ background.green = (png_uint_16)((background.green >> 8) * 257);
+ background.blue = (png_uint_16)((background.blue >> 8) * 257);
+ background.gray = (png_uint_16)((background.gray >> 8) * 257);
+ }
+# endif
}
else /* 8 bit colors */
@@ -9125,7 +9364,7 @@ perform_gamma_composition_tests(png_modifier *pm, int do_background,
/* Skip the non-alpha cases - there is no setting of a transparency colour at
* present.
*/
- while (next_format(&colour_type, &bit_depth, &palette_number))
+ while (next_format(&colour_type, &bit_depth, &palette_number, 1/*gamma*/))
if ((colour_type & PNG_COLOR_MASK_ALPHA) != 0)
{
unsigned int i, j;
@@ -9147,31 +9386,46 @@ perform_gamma_composition_tests(png_modifier *pm, int do_background,
static void
init_gamma_errors(png_modifier *pm)
{
- pm->error_gray_2 = pm->error_gray_4 = pm->error_gray_8 = 0;
- pm->error_color_8 = 0;
- pm->error_indexed = 0;
- pm->error_gray_16 = pm->error_color_16 = 0;
+ /* Use -1 to catch tests that were not actually run */
+ pm->error_gray_2 = pm->error_gray_4 = pm->error_gray_8 = -1.;
+ pm->error_color_8 = -1.;
+ pm->error_indexed = -1.;
+ pm->error_gray_16 = pm->error_color_16 = -1.;
}
static void
-summarize_gamma_errors(png_modifier *pm, png_const_charp who, int low_bit_depth)
+print_one(const char *leader, double err)
{
+ if (err != -1.)
+ printf(" %s %.5f\n", leader, err);
+}
+
+static void
+summarize_gamma_errors(png_modifier *pm, png_const_charp who, int low_bit_depth,
+ int indexed)
+{
+ fflush(stderr);
+
if (who)
- printf("Gamma correction with %s:\n", who);
+ printf("\nGamma correction with %s:\n", who);
+
+ else
+ printf("\nBasic gamma correction:\n");
if (low_bit_depth)
{
- printf(" 2 bit gray: %.5f\n", pm->error_gray_2);
- printf(" 4 bit gray: %.5f\n", pm->error_gray_4);
- printf(" 8 bit gray: %.5f\n", pm->error_gray_8);
- printf(" 8 bit color: %.5f\n", pm->error_color_8);
- printf(" indexed: %.5f\n", pm->error_indexed);
+ print_one(" 2 bit gray: ", pm->error_gray_2);
+ print_one(" 4 bit gray: ", pm->error_gray_4);
+ print_one(" 8 bit gray: ", pm->error_gray_8);
+ print_one(" 8 bit color:", pm->error_color_8);
+ if (indexed)
+ print_one(" indexed: ", pm->error_indexed);
}
-#ifdef DO_16BIT
- printf(" 16 bit gray: %.5f\n", pm->error_gray_16);
- printf(" 16 bit color: %.5f\n", pm->error_color_16);
-#endif
+ print_one("16 bit gray: ", pm->error_gray_16);
+ print_one("16 bit color:", pm->error_color_16);
+
+ fflush(stdout);
}
static void
@@ -9197,18 +9451,9 @@ perform_gamma_test(png_modifier *pm, int summary)
/* Now some real transforms. */
if (pm->test_gamma_transform)
{
- init_gamma_errors(pm);
- /*TODO: remove this. Necessary because the current libpng
- * implementation works in 8 bits:
- */
- if (pm->test_gamma_expand16)
- pm->calculations_use_input_precision = 1;
- perform_gamma_transform_tests(pm);
- if (!calculations_use_input_precision)
- pm->calculations_use_input_precision = 0;
-
if (summary)
{
+ fflush(stderr);
printf("Gamma correction error summary\n\n");
printf("The printed value is the maximum error in the pixel values\n");
printf("calculated by the libpng gamma correction code. The error\n");
@@ -9220,10 +9465,25 @@ perform_gamma_test(png_modifier *pm, int summary)
printf("less than 1 for formats with fewer than 8 bits and a small\n");
printf("number (typically less than 5) for the 16 bit formats.\n");
printf("For performance reasons the value for 16 bit formats\n");
- printf("increases when the image file includes an sBIT chunk.\n\n");
-
- summarize_gamma_errors(pm, 0/*who*/, 1);
+ printf("increases when the image file includes an sBIT chunk.\n");
+ fflush(stdout);
}
+
+ init_gamma_errors(pm);
+ /*TODO: remove this. Necessary because the current libpng
+ * implementation works in 8 bits:
+ */
+ if (pm->test_gamma_expand16)
+ pm->calculations_use_input_precision = 1;
+ perform_gamma_transform_tests(pm);
+ if (!calculations_use_input_precision)
+ pm->calculations_use_input_precision = 0;
+
+ if (summary)
+ summarize_gamma_errors(pm, 0/*who*/, 1/*low bit depth*/, 1/*indexed*/);
+
+ if (fail(pm))
+ return;
}
/* The sbit tests produce much larger errors: */
@@ -9233,7 +9493,10 @@ perform_gamma_test(png_modifier *pm, int summary)
perform_gamma_sbit_tests(pm);
if (summary)
- summarize_gamma_errors(pm, "sBIT", pm->sbitlow < 8U);
+ summarize_gamma_errors(pm, "sBIT", pm->sbitlow < 8U, 1/*indexed*/);
+
+ if (fail(pm))
+ return;
}
#ifdef DO_16BIT /* Should be READ_16BIT_SUPPORTED */
@@ -9245,10 +9508,15 @@ perform_gamma_test(png_modifier *pm, int summary)
if (summary)
{
- printf("Gamma correction with 16 to 8 bit reduction:\n");
+ fflush(stderr);
+ printf("\nGamma correction with 16 to 8 bit reduction:\n");
printf(" 16 bit gray: %.5f\n", pm->error_gray_16);
printf(" 16 bit color: %.5f\n", pm->error_color_16);
+ fflush(stdout);
}
+
+ if (fail(pm))
+ return;
}
#endif
@@ -9272,7 +9540,10 @@ perform_gamma_test(png_modifier *pm, int summary)
pm->maxout8 = maxout8;
if (summary)
- summarize_gamma_errors(pm, "background", 1);
+ summarize_gamma_errors(pm, "background", 1, 0/*indexed*/);
+
+ if (fail(pm))
+ return;
}
#endif
@@ -9297,7 +9568,10 @@ perform_gamma_test(png_modifier *pm, int summary)
pm->calculations_use_input_precision = 0;
if (summary)
- summarize_gamma_errors(pm, "alpha mode", 1);
+ summarize_gamma_errors(pm, "alpha mode", 1, 0/*indexed*/);
+
+ if (fail(pm))
+ return;
}
#endif
}
@@ -9805,6 +10079,19 @@ int main(int argc, char **argv)
/* Default to error on warning: */
pm.this.treat_warnings_as_errors = 1;
+ /* Default assume_16_bit_calculations appropriately; this tells the checking
+ * code that 16-bit arithmetic is used for 8-bit samples when it would make a
+ * difference.
+ */
+ pm.assume_16_bit_calculations = PNG_LIBPNG_VER >= 10700;
+
+ /* Currently 16 bit expansion happens at the end of the pipeline, so the
+ * calculations are done in the input bit depth not the output.
+ *
+ * TODO: fix this
+ */
+ pm.calculations_use_input_precision = 1U;
+
/* Store the test gammas */
pm.gammas = gammas;
pm.ngammas = (sizeof gammas) / (sizeof gammas[0]);
@@ -9815,13 +10102,16 @@ int main(int argc, char **argv)
pm.nencodings = (sizeof test_encodings) / (sizeof test_encodings[0]);
pm.sbitlow = 8U; /* because libpng doesn't do sBIT below 8! */
+
/* The following allows results to pass if they correspond to anything in the
* transformed range [input-.5,input+.5]; this is is required because of the
- * way libpng treates the 16_TO_8 flag when building the gamma tables.
+ * way libpng treates the 16_TO_8 flag when building the gamma tables in
+ * releases up to 1.6.0.
*
* TODO: review this
*/
pm.use_input_precision_16to8 = 1U;
+ pm.use_input_precision_sbit = 1U; /* because libpng now rounds sBIT */
/* Some default values (set the behavior for 'make check' here).
* These values simply control the maximum error permitted in the gamma
@@ -9832,11 +10122,12 @@ int main(int argc, char **argv)
*/
pm.maxout8 = .1; /* Arithmetic error in *encoded* value */
pm.maxabs8 = .00005; /* 1/20000 */
- pm.maxcalc8 = .004; /* +/-1 in 8 bits for compose errors */
+ pm.maxcalc8 = 1./255; /* +/-1 in 8 bits for compose errors */
pm.maxpc8 = .499; /* I.e., .499% fractional error */
pm.maxout16 = .499; /* Error in *encoded* value */
pm.maxabs16 = .00005;/* 1/20000 */
- pm.maxcalc16 =.000015;/* +/-1 in 16 bits for compose errors */
+ pm.maxcalc16 =1./65535;/* +/-1 in 16 bits for compose errors */
+ pm.maxcalcG = 1./((1<<PNG_MAX_GAMMA_8)-1);
/* NOTE: this is a reasonable perceptual limit. We assume that humans can
* perceive light level differences of 1% over a 100:1 range, so we need to
@@ -9980,16 +10271,26 @@ int main(int argc, char **argv)
++pm.use_update_info; /* Can call multiple times */
else if (strcmp(*argv, "--interlace") == 0)
- pm.interlace_type = PNG_INTERLACE_ADAM7;
+ {
+# ifdef PNG_WRITE_INTERLACING_SUPPORTED
+ pm.interlace_type = PNG_INTERLACE_ADAM7;
+# else
+ fprintf(stderr, "pngvalid: no write interlace support\n");
+ return SKIP;
+# endif
+ }
else if (strcmp(*argv, "--use-input-precision") == 0)
- pm.use_input_precision = 1;
+ pm.use_input_precision = 1U;
+
+ else if (strcmp(*argv, "--use-calculation-precision") == 0)
+ pm.use_input_precision = 0;
else if (strcmp(*argv, "--calculations-use-input-precision") == 0)
- pm.calculations_use_input_precision = 1;
+ pm.calculations_use_input_precision = 1U;
else if (strcmp(*argv, "--assume-16-bit-calculations") == 0)
- pm.assume_16_bit_calculations = 1;
+ pm.assume_16_bit_calculations = 1U;
else if (strcmp(*argv, "--calculations-follow-bit-depth") == 0)
pm.calculations_use_input_precision =
@@ -10060,10 +10361,12 @@ int main(int argc, char **argv)
else
#endif
+#ifdef PNG_MAXIMUM_INFLATE_WINDOW
if (strncmp(arg, "max-inflate-window:", 19) == 0)
option = PNG_MAXIMUM_INFLATE_WINDOW, arg += 19;
else
+#endif
{
fprintf(stderr, "pngvalid: %s: %s: unknown option\n", *argv, arg);
exit(99);
@@ -10276,6 +10579,6 @@ int main(void)
fprintf(stderr,
"pngvalid: no low level write support in libpng, all tests skipped\n");
/* So the test is skipped: */
- return 77;
+ return SKIP;
}
#endif
diff --git a/contrib/pngminim/decoder/makefile b/contrib/pngminim/decoder/makefile
index 23e8e5b85..4acf3c177 100644
--- a/contrib/pngminim/decoder/makefile
+++ b/contrib/pngminim/decoder/makefile
@@ -82,7 +82,7 @@ OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# note: dependencies do not work on implicit rule lines
.c$(O):
- $(CC) $(CPPFLAGS) -c $(CFLAGS) $<
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
# dependencies
diff --git a/contrib/pngminim/encoder/makefile b/contrib/pngminim/encoder/makefile
index ce67a9623..41b205c28 100644
--- a/contrib/pngminim/encoder/makefile
+++ b/contrib/pngminim/encoder/makefile
@@ -81,7 +81,7 @@ OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules -------------------------------------------------------
.c$(O):
- $(CC) $(CPPFLAGS) -c $(CFLAGS) $<
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
# dependencies
diff --git a/contrib/pngminim/preader/makefile b/contrib/pngminim/preader/makefile
index c6855e8ff..b62519911 100644
--- a/contrib/pngminim/preader/makefile
+++ b/contrib/pngminim/preader/makefile
@@ -97,7 +97,7 @@ OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules -------------------------------------------------------
.c$(O):
- $(CC) $(CPPFLAGS) -c $(CFLAGS) $<
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
# dependencies
diff --git a/contrib/pngminus/makefile.std b/contrib/pngminus/makefile.std
index 30317b77d..14e25cd64 100644
--- a/contrib/pngminus/makefile.std
+++ b/contrib/pngminus/makefile.std
@@ -23,7 +23,8 @@ ZINC = -I../../../zlib
ZLIB = -L../../../zlib -lz
ZLIBS = ../../../zlib/libz.a
-CFLAGS=$(PNGINC) $(ZINC)
+CPPFLAGS=$(PNGINC) $(ZINC)
+CFLAGS=
LDLIBS=$(PNGLIB) $(ZLIB)
LDLIBSS=$(PNGLIBS) $(ZLIBS)
C=.c
@@ -37,7 +38,7 @@ E=
all: png2pnm$(E) pnm2png$(E) png2pnm-static$(E) pnm2png-static$(E)
png2pnm$(O): png2pnm$(C)
- $(CC) -c $(CFLAGS) png2pnm$(C)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) png2pnm$(C)
png2pnm$(E): png2pnm$(O)
$(LD) $(LDFLAGS) -o png2pnm$(E) png2pnm$(O) $(LDLIBS) -lm
@@ -46,7 +47,7 @@ png2pnm-static$(E): png2pnm$(O)
$(LD) $(LDFLAGS) -o png2pnm-static$(E) png2pnm$(O) $(LDLIBSS) -lm
pnm2png$(O): pnm2png$(C)
- $(CC) -c $(CFLAGS) pnm2png$(C)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) pnm2png$(C)
pnm2png$(E): pnm2png$(O)
$(LD) $(LDFLAGS) -o pnm2png$(E) pnm2png$(O) $(LDLIBS) -lm
diff --git a/contrib/pngminus/makefile.tc3 b/contrib/pngminus/makefile.tc3
index 404f18d5b..6a2f4b985 100644
--- a/contrib/pngminus/makefile.tc3
+++ b/contrib/pngminus/makefile.tc3
@@ -7,7 +7,8 @@ LB=tlib
RM=del
CP=copy
MODEL=l
-CCFLAGS=-O -m$(MODEL) -I..\libpng -I..\zlib
+CPPFLAGS=-I..\libpng -I..\zlib
+CFLAGS=-O -m$(MODEL)
LDFLAGS=-m$(MODEL) -L..\libpng -L..\zlib
C=.c
O=.obj
@@ -19,13 +20,13 @@ E=.exe
all: png2pnm$(E) pnm2png$(E)
png2pnm$(O): png2pnm$(C)
- $(CC) -c $(CCFLAGS) png2pnm$(C)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) png2pnm$(C)
png2pnm$(E): png2pnm$(O)
$(LD) $(LDFLAGS) png2pnm$(O) libpng$(L) zlib$(L)
pnm2png$(O): pnm2png$(C)
- $(CC) -c $(CCFLAGS) pnm2png$(C)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) pnm2png$(C)
pnm2png$(E): pnm2png$(O)
$(LD) $(LDFLAGS) pnm2png$(O) libpng$(L) zlib$(L)
@@ -35,4 +36,3 @@ clean:
$(RM) *$(E)
# End of makefile for png2pnm / pnm2png
-
diff --git a/contrib/tools/pngfix.c b/contrib/tools/pngfix.c
index 245adb6f2..08b23e73b 100644
--- a/contrib/tools/pngfix.c
+++ b/contrib/tools/pngfix.c
@@ -1,8 +1,8 @@
/* pngfix.c
*
- * Copyright (c) 2013 John Cunningham Bowler
+ * Copyright (c) 2014 John Cunningham Bowler
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
+ * Last changed in libpng 1.6.9 [February 6, 2014]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -32,7 +32,6 @@
# define FIX_GCC volatile
#else
# define FIX_GCC
-# error not tested
#endif
#define PROGRAM_NAME "pngfix"
diff --git a/libpng-manual.txt b/libpng-manual.txt
index ac0ff1b49..c854b4c68 100644
--- a/libpng-manual.txt
+++ b/libpng-manual.txt
@@ -1,9 +1,9 @@
libpng-manual.txt - A description on how to use and modify libpng
- libpng version 1.6.8 - December 19, 2013
+ libpng version 1.6.9 - February 6, 2014
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
- Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ Copyright (c) 1998-2014 Glenn Randers-Pehrson
This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer
@@ -11,9 +11,9 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
- libpng versions 0.97, January 1998, through 1.6.8 - December 19, 2013
+ libpng versions 0.97, January 1998, through 1.6.9 - February 6, 2014
Updated and distributed by Glenn Randers-Pehrson
- Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ Copyright (c) 1998-2014 Glenn Randers-Pehrson
libpng 1.0 beta 6 version 0.96 May 28, 1997
Updated and distributed by Andreas Dilger
@@ -4393,6 +4393,9 @@ png_set_error_fn(), which is essentially the same function, but with a new
name to force compilation errors with applications that try to use the old
method.
+Support for the sCAL, iCCP, iTXt, and sPLT chunks was added at libpng-1.0.6;
+however, iTXt support was not enabled by default.
+
Starting with version 1.0.7, you can find out which version of the library
you are using at run-time:
@@ -4621,6 +4624,7 @@ XI. Changes to Libpng from version 1.4.x to 1.5.x
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
function) incorrectly returned a value of type png_uint_32.
+The incorrect macro was removed from libpng-1.4.5.
Checking for invalid palette index on write was added at libpng
1.5.10. If a pixel contains an invalid (out-of-range) index libpng issues
@@ -4725,7 +4729,10 @@ and the accuracy of PNG fixed point values is insufficient for
representation of these values. Consequently a "string" API
(png_get_sCAL_s and png_set_sCAL_s) is the only reliable way of reading
arbitrary sCAL chunks in the absence of either the floating point API or
-internal floating point calculations.
+internal floating point calculations. Starting with libpng-1.5.0, both
+of these functions are present when PNG_sCAL_SUPPORTED is defined. Prior
+to libpng-1.5.0, their presence also depended upon PNG_FIXED_POINT_SUPPORTED
+being defined and PNG_FLOATING_POINT_SUPPORTED not being defined.
Applications no longer need to include the optional distribution header
file pngusr.h or define the corresponding macros during application
@@ -4745,11 +4752,6 @@ reset by pngusr.h or by explicit settings on the compiler command line.
These settings may produce compiler warnings or errors in 1.5.0 because
of macro redefinition.
-From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
-function) incorrectly returned a value of type png_uint_32. libpng 1.5.0
-is consistent with the implementation in 1.4.5 and 1.2.x (where the macro
-did not exist.)
-
Applications can now choose whether to use these macros or to call the
corresponding function by defining PNG_USE_READ_MACROS or
PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
@@ -4767,7 +4769,10 @@ option was off by default, and slightly inaccurate scaling occurred.
This option can no longer be turned off, and the choice of accurate
or inaccurate 16-to-8 scaling is by using the new png_set_scale_16_to_8()
API for accurate scaling or the old png_set_strip_16_to_8() API for simple
-chopping.
+chopping. In libpng-1.5.4, the PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
+macro became PNG_READ_SCALE_16_TO_8_SUPPORTED, and the PNG_READ_16_TO_8
+macro became PNG_READ_STRIP_16_TO_8_SUPPORTED, to enable the two
+png_set_*_16_to_8() functions separately.
Prior to libpng-1.5.4, the png_set_user_limits() function could only be
used to reduce the width and height limits from the value of
@@ -5233,13 +5238,13 @@ Other rules can be inferred by inspecting the libpng source.
XVI. Y2K Compliance in libpng
-December 19, 2013
+February 6, 2014
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.8 are Y2K compliant. It is my belief that earlier
+upward through 1.6.9 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
diff --git a/libpng.3 b/libpng.3
index da9c93087..f80ca41da 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1,6 +1,6 @@
-.TH LIBPNG 3 "December 19, 2013"
+.TH LIBPNG 3 "February 6, 2014"
.SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.8
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.9
.SH SYNOPSIS
\fB
#include <png.h>\fP
@@ -504,10 +504,10 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
.SH LIBPNG.TXT
libpng-manual.txt - A description on how to use and modify libpng
- libpng version 1.6.8 - December 19, 2013
+ libpng version 1.6.9 - February 6, 2014
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
- Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ Copyright (c) 1998-2014 Glenn Randers-Pehrson
This document is released under the libpng license.
For conditions of distribution and use, see the disclaimer
@@ -515,9 +515,9 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
- libpng versions 0.97, January 1998, through 1.6.8 - December 19, 2013
+ libpng versions 0.97, January 1998, through 1.6.9 - February 6, 2014
Updated and distributed by Glenn Randers-Pehrson
- Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ Copyright (c) 1998-2014 Glenn Randers-Pehrson
libpng 1.0 beta 6 version 0.96 May 28, 1997
Updated and distributed by Andreas Dilger
@@ -4898,6 +4898,9 @@ png_set_error_fn(), which is essentially the same function, but with a new
name to force compilation errors with applications that try to use the old
method.
+Support for the sCAL, iCCP, iTXt, and sPLT chunks was added at libpng-1.0.6;
+however, iTXt support was not enabled by default.
+
Starting with version 1.0.7, you can find out which version of the library
you are using at run-time:
@@ -5126,6 +5129,7 @@ We removed the trailing '.' from the warning and error messages.
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
function) incorrectly returned a value of type png_uint_32.
+The incorrect macro was removed from libpng-1.4.5.
Checking for invalid palette index on write was added at libpng
1.5.10. If a pixel contains an invalid (out-of-range) index libpng issues
@@ -5230,7 +5234,10 @@ and the accuracy of PNG fixed point values is insufficient for
representation of these values. Consequently a "string" API
(png_get_sCAL_s and png_set_sCAL_s) is the only reliable way of reading
arbitrary sCAL chunks in the absence of either the floating point API or
-internal floating point calculations.
+internal floating point calculations. Starting with libpng-1.5.0, both
+of these functions are present when PNG_sCAL_SUPPORTED is defined. Prior
+to libpng-1.5.0, their presence also depended upon PNG_FIXED_POINT_SUPPORTED
+being defined and PNG_FLOATING_POINT_SUPPORTED not being defined.
Applications no longer need to include the optional distribution header
file pngusr.h or define the corresponding macros during application
@@ -5250,11 +5257,6 @@ reset by pngusr.h or by explicit settings on the compiler command line.
These settings may produce compiler warnings or errors in 1.5.0 because
of macro redefinition.
-From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
-function) incorrectly returned a value of type png_uint_32. libpng 1.5.0
-is consistent with the implementation in 1.4.5 and 1.2.x (where the macro
-did not exist.)
-
Applications can now choose whether to use these macros or to call the
corresponding function by defining PNG_USE_READ_MACROS or
PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
@@ -5272,7 +5274,10 @@ option was off by default, and slightly inaccurate scaling occurred.
This option can no longer be turned off, and the choice of accurate
or inaccurate 16-to-8 scaling is by using the new png_set_scale_16_to_8()
API for accurate scaling or the old png_set_strip_16_to_8() API for simple
-chopping.
+chopping. In libpng-1.5.4, the PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
+macro became PNG_READ_SCALE_16_TO_8_SUPPORTED, and the PNG_READ_16_TO_8
+macro became PNG_READ_STRIP_16_TO_8_SUPPORTED, to enable the two
+png_set_*_16_to_8() functions separately.
Prior to libpng-1.5.4, the png_set_user_limits() function could only be
used to reduce the width and height limits from the value of
@@ -5738,13 +5743,13 @@ Other rules can be inferred by inspecting the libpng source.
.SH XVI. Y2K Compliance in libpng
-December 19, 2013
+February 6, 2014
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.8 are Y2K compliant. It is my belief that earlier
+upward through 1.6.9 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
@@ -5972,6 +5977,9 @@ the first widely used release:
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]
Henceforth the source version will match the shared-library minor
and patch numbers; the shared-library major version number will be
@@ -6028,7 +6036,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
-Libpng version 1.6.8 - December 19, 2013:
+Libpng version 1.6.9 - February 6, 2014:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
@@ -6051,7 +6059,7 @@ this sentence.
This code is released under the libpng license.
-libpng versions 1.2.6, August 15, 2004, through 1.6.8, December 19, 2013, are
+libpng versions 1.2.6, August 15, 2004, through 1.6.9, February 6, 2014, are
Copyright (c) 2004,2006-2007 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
@@ -6150,7 +6158,7 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
-December 19, 2013
+February 6, 2014
.\" end of man page
diff --git a/libpngpf.3 b/libpngpf.3
index 38e82d94e..ef0fb869b 100644
--- a/libpngpf.3
+++ b/libpngpf.3
@@ -1,6 +1,6 @@
-.TH LIBPNGPF 3 "December 19, 2013"
+.TH LIBPNGPF 3 "February 6, 2014"
.SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.8
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.9
(private functions)
.SH SYNOPSIS
\fB#include \fI"pngpriv.h"
diff --git a/png.5 b/png.5
index c43a02ddc..096ccc221 100644
--- a/png.5
+++ b/png.5
@@ -1,4 +1,4 @@
-.TH PNG 5 "December 19, 2013"
+.TH PNG 5 "February 6, 2014"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION
diff --git a/png.c b/png.c
index d77197a07..3db9ad41e 100644
--- a/png.c
+++ b/png.c
@@ -1,8 +1,8 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
- * Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.9 [February 6, 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.)
*
@@ -14,7 +14,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_8 Your_png_h_is_not_version_1_6_8;
+typedef png_libpng_version_1_6_9 Your_png_h_is_not_version_1_6_9;
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -773,14 +773,14 @@ png_get_copyright(png_const_structrp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
- "libpng version 1.6.8 - December 19, 2013" PNG_STRING_NEWLINE \
- "Copyright (c) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
+ "libpng version 1.6.9 - February 6, 2014" PNG_STRING_NEWLINE \
+ "Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
- return "libpng version 1.6.8 - December 19, 2013\
- Copyright (c) 1998-2013 Glenn Randers-Pehrson\
+ return "libpng version 1.6.9 - February 6, 2014\
+ Copyright (c) 1998-2014 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
# endif
@@ -826,6 +826,63 @@ png_get_header_version(png_const_structrp png_ptr)
#endif
}
+#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
+/* NOTE: this routine is not used internally! */
+/* Build a grayscale palette. Palette is assumed to be 1 << bit_depth
+ * large of png_color. This lets grayscale images be treated as
+ * paletted. Most useful for gamma correction and simplification
+ * of code. This API is not used internally.
+ */
+void PNGAPI
+png_build_grayscale_palette(int bit_depth, png_colorp palette)
+{
+ int num_palette;
+ int color_inc;
+ int i;
+ int v;
+
+ png_debug(1, "in png_do_build_grayscale_palette");
+
+ if (palette == NULL)
+ return;
+
+ switch (bit_depth)
+ {
+ case 1:
+ num_palette = 2;
+ color_inc = 0xff;
+ break;
+
+ case 2:
+ num_palette = 4;
+ color_inc = 0x55;
+ break;
+
+ case 4:
+ num_palette = 16;
+ color_inc = 0x11;
+ break;
+
+ case 8:
+ num_palette = 256;
+ color_inc = 1;
+ break;
+
+ default:
+ num_palette = 0;
+ color_inc = 0;
+ break;
+ }
+
+ for (i = 0, v = 0; i < num_palette; i++, v += color_inc)
+ {
+ palette[i].red = (png_byte)v;
+ palette[i].green = (png_byte)v;
+ palette[i].blue = (png_byte)v;
+ }
+}
+#endif
+
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
int PNGAPI
png_handle_as_unknown(png_const_structrp png_ptr, png_const_bytep chunk_name)
@@ -2416,14 +2473,6 @@ png_check_IHDR(png_const_structrp png_ptr,
error = 1;
}
- if (width > (PNG_UINT_32_MAX
- >> 3) /* 8-byte RGBA pixels */
- - 48 /* bigrowbuf hack */
- - 1 /* filter byte */
- - 7*8 /* rounding of width to multiple of 8 pixels */
- - 8) /* extra max_pixel_depth pad */
- png_warning(png_ptr, "Width is too large for libpng to process pixels");
-
/* Check other values */
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
bit_depth != 8 && bit_depth != 16)
diff --git a/png.h b/png.h
index 00eddac0e..b572dc732 100644
--- a/png.h
+++ b/png.h
@@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.6.8 - December 19, 2013
+ * libpng version 1.6.9 - February 6, 2014
* 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.)
@@ -11,7 +11,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.8 - December 19, 2013: Glenn
+ * libpng versions 0.97, January 1998, through 1.6.9 - February 6, 2014: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -189,6 +189,9 @@
* 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]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@@ -220,7 +223,7 @@
*
* This code is released under the libpng license.
*
- * libpng versions 1.2.6, August 15, 2004, through 1.6.8, December 19, 2013, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.6.9, February 6, 2014, are
* Copyright (c) 2004, 2006-2013 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:
@@ -332,13 +335,13 @@
* Y2K compliance in libpng:
* =========================
*
- * December 19, 2013
+ * February 6, 2014
*
* 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.8 are Y2K compliant. It is my belief that
+ * upward through 1.6.9 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
@@ -398,9 +401,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.8"
+#define PNG_LIBPNG_VER_STRING "1.6.9"
#define PNG_HEADER_VERSION_STRING \
- " libpng version 1.6.8 - December 19, 2013\n"
+ " libpng version 1.6.9 - February 6, 2014\n"
#define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16
@@ -408,7 +411,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 8
+#define PNG_LIBPNG_VER_RELEASE 9
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
@@ -439,7 +442,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 10608 /* 1.6.8 */
+#define PNG_LIBPNG_VER 10609 /* 1.6.9 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -544,7 +547,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_8;
+typedef char* png_libpng_version_1_6_9;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
diff --git a/pngconf.h b/pngconf.h
index 587d0edc9..7ce5c65a0 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
- * libpng version 1.6.8 - December 19, 2013
+ * libpng version 1.6.9 - February 6, 2014
*
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -361,7 +361,31 @@
* version 1.2.41. Disabling these removes the warnings but may also produce
* less efficient code.
*/
-# if defined(__GNUC__)
+# if defined(__clang__)
+ /* 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)
+# if __has_extension(attribute_unavailable_with_message)
+# define PNG_PRIVATE __attribute__((__unavailable__(\
+ "This function is not exported by libpng.")))
+# 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
@@ -384,12 +408,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
@@ -419,7 +443,7 @@
# ifndef PNG_RESTRICT
# define PNG_RESTRICT __restrict
# endif
-# endif /* _MSC_VER */
+# endif
#endif /* PNG_PEDANTIC_WARNINGS */
#ifndef PNG_DEPRECATED
@@ -440,6 +464,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)\
diff --git a/pngerror.c b/pngerror.c
index b46d28f19..3faf27319 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -761,7 +761,12 @@ png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN)
png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, 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();
}
diff --git a/pngpriv.h b/pngpriv.h
index eb792fc90..a9aa1a2de 100644
--- a/pngpriv.h
+++ b/pngpriv.h
@@ -2,11 +2,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
+ * 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.)
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
+ * Last changed in libpng 1.6.9 [February 6, 2014]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -135,7 +135,7 @@
/* 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 control by PNG_ARM_NEON_IMPLEMENTATION which can
+ * to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can
* be:
*
* 1 The intrinsics code (the default with __ARM_NEON__)
@@ -1235,32 +1235,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,
@@ -1280,96 +1255,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.
*/
@@ -1556,13 +1451,6 @@ PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr,
#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
-
/* Added at libpng version 1.6.0 */
#ifdef PNG_GAMMA_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr,
diff --git a/pngread.c b/pngread.c
index 4bd8c7c93..9ff639de2 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1,8 +1,8 @@
/* pngread.c - read a PNG file
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
- * Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.9 [February 6, 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.)
*
@@ -305,6 +305,72 @@ png_start_read_image(png_structrp png_ptr)
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+#ifdef PNG_MNG_FEATURES_SUPPORTED
+/* Undoes intrapixel differencing,
+ * NOTE: this is apparently only supported in the 'sequential' reader.
+ */
+static void
+png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
+{
+ png_debug(1, "in png_do_read_intrapixel");
+
+ 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 (row_info->color_type == PNG_COLOR_TYPE_RGB)
+ bytes_per_pixel = 3;
+
+ else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ bytes_per_pixel = 4;
+
+ else
+ return;
+
+ for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
+ {
+ *(rp) = (png_byte)((256 + *rp + *(rp + 1)) & 0xff);
+ *(rp+2) = (png_byte)((256 + *(rp + 2) + *(rp + 1)) & 0xff);
+ }
+ }
+ else if (row_info->bit_depth == 16)
+ {
+ png_bytep rp;
+ png_uint_32 i;
+
+ if (row_info->color_type == PNG_COLOR_TYPE_RGB)
+ bytes_per_pixel = 6;
+
+ else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ bytes_per_pixel = 8;
+
+ else
+ return;
+
+ 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 = (s0 + s1 + 65536) & 0xffff;
+ png_uint_32 blue = (s2 + s1 + 65536) & 0xffff;
+ *(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_MNG_FEATURES_SUPPORTED */
+
void PNGAPI
png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
{
@@ -489,7 +555,6 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
}
#endif
-
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
if (png_ptr->transformations)
png_do_read_transformations(png_ptr, &row_info);
@@ -1004,7 +1069,7 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr,
if (transforms & PNG_TRANSFORM_EXPAND)
if ((png_ptr->bit_depth < 8) ||
(png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ||
- (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)))
+ (info_ptr->valid & PNG_INFO_tRNS))
png_set_expand(png_ptr);
#endif
@@ -1023,14 +1088,8 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr,
* [0,65535] to the original [0,7] or [0,31], or whatever range the
* colors were originally in:
*/
- if ((transforms & PNG_TRANSFORM_SHIFT)
- && png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT))
- {
- png_color_8p sig_bit;
-
- png_get_sBIT(png_ptr, info_ptr, &sig_bit);
- png_set_shift(png_ptr, sig_bit);
- }
+ if ((transforms & PNG_TRANSFORM_SHIFT) && (info_ptr->valid & PNG_INFO_sBIT))
+ png_set_shift(png_ptr, &info_ptr->sig_bit);
#endif
#ifdef PNG_READ_BGR_SUPPORTED
diff --git a/pngrio.c b/pngrio.c
index d7864407b..d75ac5b4d 100644
--- a/pngrio.c
+++ b/pngrio.c
@@ -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.9 [February 6, 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.)
*
@@ -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,6 +111,7 @@ 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;
diff --git a/pngrtran.c b/pngrtran.c
index d67e25d9d..f0c016478 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1,8 +1,8 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
- * Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.9 [February 6, 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.)
*
@@ -1134,7 +1134,7 @@ png_init_palette_transformations(png_structrp png_ptr)
if (!input_has_alpha)
{
/* Any alpha means background and associative alpha processing is
- * required, however if the alpha is 0 or 1 throughout OPTIIMIZE_ALPHA
+ * required, however if the alpha is 0 or 1 throughout OPTIMIZE_ALPHA
* and ENCODE_ALPHA are irrelevant.
*/
png_ptr->transformations &= ~PNG_ENCODE_ALPHA;
@@ -1199,7 +1199,7 @@ png_init_rgb_transformations(png_structrp png_ptr)
if (!input_has_alpha)
{
/* Any alpha means background and associative alpha processing is
- * required, however if the alpha is 0 or 1 throughout OPTIIMIZE_ALPHA
+ * required, however if the alpha is 0 or 1 throughout OPTIMIZE_ALPHA
* and ENCODE_ALPHA are irrelevant.
*/
# ifdef PNG_READ_ALPHA_MODE_SUPPORTED
@@ -2123,303 +2123,6 @@ defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
#endif
}
-/* Transform the row. The order of transformations is significant,
- * and is very touchy. If you add a transformation, take care to
- * decide how it fits in with the other transformations here.
- */
-void /* PRIVATE */
-png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
-{
- png_debug(1, "in png_do_read_transformations");
-
- if (png_ptr->row_buf == NULL)
- {
- /* Prior to 1.5.4 this output row/pass where the NULL pointer is, but this
- * error is incredibly rare and incredibly easy to debug without this
- * information.
- */
- png_error(png_ptr, "NULL row buffer");
- }
-
- /* The following is debugging; prior to 1.5.4 the code was never compiled in;
- * in 1.5.4 PNG_FLAG_DETECT_UNINITIALIZED was added and the macro
- * PNG_WARN_UNINITIALIZED_ROW removed. In 1.6 the new flag is set only for
- * all transformations, however in practice the ROW_INIT always gets done on
- * demand, if necessary.
- */
- if ((png_ptr->flags & PNG_FLAG_DETECT_UNINITIALIZED) != 0 &&
- !(png_ptr->flags & PNG_FLAG_ROW_INIT))
- {
- /* Application has failed to call either png_read_start_image() or
- * png_read_update_info() after setting transforms that expand pixels.
- * This check added to libpng-1.2.19 (but not enabled until 1.5.4).
- */
- png_error(png_ptr, "Uninitialized row");
- }
-
-#ifdef PNG_READ_EXPAND_SUPPORTED
- if (png_ptr->transformations & PNG_EXPAND)
- {
- if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
- {
- png_do_expand_palette(row_info, png_ptr->row_buf + 1,
- png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
- }
-
- else
- {
- if (png_ptr->num_trans &&
- (png_ptr->transformations & PNG_EXPAND_tRNS))
- png_do_expand(row_info, png_ptr->row_buf + 1,
- &(png_ptr->trans_color));
-
- else
- png_do_expand(row_info, png_ptr->row_buf + 1,
- NULL);
- }
- }
-#endif
-
-#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
- if ((png_ptr->transformations & PNG_STRIP_ALPHA) &&
- !(png_ptr->transformations & PNG_COMPOSE) &&
- (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
- row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
- png_do_strip_channel(row_info, png_ptr->row_buf + 1,
- 0 /* at_start == false, because SWAP_ALPHA happens later */);
-#endif
-
-#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
- if (png_ptr->transformations & PNG_RGB_TO_GRAY)
- {
- int rgb_error =
- png_do_rgb_to_gray(png_ptr, row_info,
- png_ptr->row_buf + 1);
-
- if (rgb_error)
- {
- png_ptr->rgb_to_gray_status=1;
- if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
- PNG_RGB_TO_GRAY_WARN)
- png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel");
-
- if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
- PNG_RGB_TO_GRAY_ERR)
- png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel");
- }
- }
-#endif
-
-/* From Andreas Dilger e-mail to png-implement, 26 March 1998:
- *
- * In most cases, the "simple transparency" should be done prior to doing
- * gray-to-RGB, or you will have to test 3x as many bytes to check if a
- * pixel is transparent. You would also need to make sure that the
- * transparency information is upgraded to RGB.
- *
- * To summarize, the current flow is:
- * - Gray + simple transparency -> compare 1 or 2 gray bytes and composite
- * with background "in place" if transparent,
- * convert to RGB if necessary
- * - Gray + alpha -> composite with gray background and remove alpha bytes,
- * convert to RGB if necessary
- *
- * To support RGB backgrounds for gray images we need:
- * - Gray + simple transparency -> convert to RGB + simple transparency,
- * compare 3 or 6 bytes and composite with
- * background "in place" if transparent
- * (3x compare/pixel compared to doing
- * composite with gray bkgrnd)
- * - Gray + alpha -> convert to RGB + alpha, composite with background and
- * remove alpha bytes (3x float
- * operations/pixel compared with composite
- * on gray background)
- *
- * Greg's change will do this. The reason it wasn't done before is for
- * performance, as this increases the per-pixel operations. If we would check
- * in advance if the background was gray or RGB, and position the gray-to-RGB
- * transform appropriately, then it would save a lot of work/time.
- */
-
-#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
- /* If gray -> RGB, do so now only if background is non-gray; else do later
- * for performance reasons
- */
- if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
- !(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
- png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
-#endif
-
-#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
- defined(PNG_READ_ALPHA_MODE_SUPPORTED)
- if (png_ptr->transformations & PNG_COMPOSE)
- png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr);
-#endif
-
-#ifdef PNG_READ_GAMMA_SUPPORTED
- if ((png_ptr->transformations & PNG_GAMMA) &&
-#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
- /* Because RGB_TO_GRAY does the gamma transform. */
- !(png_ptr->transformations & PNG_RGB_TO_GRAY) &&
-#endif
-#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
- defined(PNG_READ_ALPHA_MODE_SUPPORTED)
- /* Because PNG_COMPOSE does the gamma transform if there is something to
- * do (if there is an alpha channel or transparency.)
- */
- !((png_ptr->transformations & PNG_COMPOSE) &&
- ((png_ptr->num_trans != 0) ||
- (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) &&
-#endif
- /* Because png_init_read_transformations transforms the palette, unless
- * RGB_TO_GRAY will do the transform.
- */
- (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE))
- png_do_gamma(row_info, png_ptr->row_buf + 1, png_ptr);
-#endif
-
-#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
- if ((png_ptr->transformations & PNG_STRIP_ALPHA) &&
- (png_ptr->transformations & PNG_COMPOSE) &&
- (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
- row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
- png_do_strip_channel(row_info, png_ptr->row_buf + 1,
- 0 /* at_start == false, because SWAP_ALPHA happens later */);
-#endif
-
-#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
- if ((png_ptr->transformations & PNG_ENCODE_ALPHA) &&
- (row_info->color_type & PNG_COLOR_MASK_ALPHA))
- png_do_encode_alpha(row_info, png_ptr->row_buf + 1, png_ptr);
-#endif
-
-#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
- if (png_ptr->transformations & PNG_SCALE_16_TO_8)
- png_do_scale_16_to_8(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
- /* There is no harm in doing both of these because only one has any effect,
- * by putting the 'scale' option first if the app asks for scale (either by
- * calling the API or in a TRANSFORM flag) this is what happens.
- */
- if (png_ptr->transformations & PNG_16_TO_8)
- png_do_chop(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_QUANTIZE_SUPPORTED
- if (png_ptr->transformations & PNG_QUANTIZE)
- {
- png_do_quantize(row_info, png_ptr->row_buf + 1,
- png_ptr->palette_lookup, png_ptr->quantize_index);
-
- if (row_info->rowbytes == 0)
- png_error(png_ptr, "png_do_quantize returned rowbytes=0");
- }
-#endif /* PNG_READ_QUANTIZE_SUPPORTED */
-
-#ifdef PNG_READ_EXPAND_16_SUPPORTED
- /* Do the expansion now, after all the arithmetic has been done. Notice
- * that previous transformations can handle the PNG_EXPAND_16 flag if this
- * is efficient (particularly true in the case of gamma correction, where
- * better accuracy results faster!)
- */
- if (png_ptr->transformations & PNG_EXPAND_16)
- png_do_expand_16(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
- /* NOTE: moved here in 1.5.4 (from much later in this list.) */
- if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
- (png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
- png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_INVERT_SUPPORTED
- if (png_ptr->transformations & PNG_INVERT_MONO)
- png_do_invert(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_SHIFT_SUPPORTED
- if (png_ptr->transformations & PNG_SHIFT)
- png_do_unshift(row_info, png_ptr->row_buf + 1,
- &(png_ptr->shift));
-#endif
-
-#ifdef PNG_READ_PACK_SUPPORTED
- if (png_ptr->transformations & PNG_PACK)
- png_do_unpack(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
- /* Added at libpng-1.5.10 */
- if (row_info->color_type == PNG_COLOR_TYPE_PALETTE &&
- png_ptr->num_palette_max >= 0)
- png_do_check_palette_indexes(png_ptr, row_info);
-#endif
-
-#ifdef PNG_READ_BGR_SUPPORTED
- if (png_ptr->transformations & PNG_BGR)
- png_do_bgr(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_PACKSWAP_SUPPORTED
- if (png_ptr->transformations & PNG_PACKSWAP)
- png_do_packswap(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_FILLER_SUPPORTED
- if (png_ptr->transformations & PNG_FILLER)
- png_do_read_filler(row_info, png_ptr->row_buf + 1,
- (png_uint_32)png_ptr->filler, png_ptr->flags);
-#endif
-
-#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
- if (png_ptr->transformations & PNG_INVERT_ALPHA)
- png_do_read_invert_alpha(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
- if (png_ptr->transformations & PNG_SWAP_ALPHA)
- png_do_read_swap_alpha(row_info, png_ptr->row_buf + 1);
-#endif
-
-#ifdef PNG_READ_16BIT_SUPPORTED
-#ifdef PNG_READ_SWAP_SUPPORTED
- if (png_ptr->transformations & PNG_SWAP_BYTES)
- png_do_swap(row_info, png_ptr->row_buf + 1);
-#endif
-#endif
-
-#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
- if (png_ptr->transformations & PNG_USER_TRANSFORM)
- {
- if (png_ptr->read_user_transform_fn != NULL)
- (*(png_ptr->read_user_transform_fn)) /* User read 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 */
-#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
- if (png_ptr->user_transform_depth)
- row_info->bit_depth = png_ptr->user_transform_depth;
-
- if (png_ptr->user_transform_channels)
- row_info->channels = png_ptr->user_transform_channels;
-#endif
- row_info->pixel_depth = (png_byte)(row_info->bit_depth *
- row_info->channels);
-
- row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_info->width);
- }
-#endif
-}
-
#ifdef PNG_READ_PACK_SUPPORTED
/* Unpack pixels of 1, 2, or 4 bits per pixel into 1 byte per pixel,
* without changing the actual values. Thus, if you had a row with
@@ -2427,7 +2130,7 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
* the numbers 0 or 1. If you would rather they contain 0 and 255, use
* png_do_shift() after this.
*/
-void /* PRIVATE */
+static void
png_do_unpack(png_row_infop row_info, png_bytep row)
{
png_debug(1, "in png_do_unpack");
@@ -2525,7 +2228,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
* a row of bit depth 8, but only 5 are significant, this will shift
* the values back to 0 through 31.
*/
-void /* PRIVATE */
+static void
png_do_unshift(png_row_infop row_info, png_bytep row,
png_const_color_8p sig_bits)
{
@@ -2664,7 +2367,7 @@ png_do_unshift(png_row_infop row_info, png_bytep row,
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
/* Scale rows of bit depth 16 down to 8 accurately */
-void /* PRIVATE */
+static void
png_do_scale_16_to_8(png_row_infop row_info, png_bytep row)
{
png_debug(1, "in png_do_scale_16_to_8");
@@ -2722,7 +2425,7 @@ png_do_scale_16_to_8(png_row_infop row_info, png_bytep row)
#endif
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
-void /* PRIVATE */
+static void
/* Simply discard the low byte. This was the default behavior prior
* to libpng-1.5.4.
*/
@@ -2750,7 +2453,7 @@ png_do_chop(png_row_infop row_info, png_bytep row)
#endif
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
-void /* PRIVATE */
+static void
png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
{
png_debug(1, "in png_do_read_swap_alpha");
@@ -2847,7 +2550,7 @@ png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
#endif
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
-void /* PRIVATE */
+static void
png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
{
png_uint_32 row_width;
@@ -2949,7 +2652,7 @@ png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
#ifdef PNG_READ_FILLER_SUPPORTED
/* Add filler channel if we have RGB color */
-void /* PRIVATE */
+static void
png_do_read_filler(png_row_infop row_info, png_bytep row,
png_uint_32 filler, png_uint_32 flags)
{
@@ -3136,7 +2839,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
/* Expand grayscale files to RGB, with or without alpha */
-void /* PRIVATE */
+static void
png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
{
png_uint_32 i;
@@ -3275,7 +2978,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
* calculated to make the sum 32768. This will result in different rounding
* to that used above.
*/
-int /* PRIVATE */
+static int
png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
{
@@ -3469,73 +3172,14 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
return rgb_error;
}
#endif
-#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
-
-#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
-/* Build a grayscale palette. Palette is assumed to be 1 << bit_depth
- * large of png_color. This lets grayscale images be treated as
- * paletted. Most useful for gamma correction and simplification
- * of code. This API is not used internally.
- */
-void PNGAPI
-png_build_grayscale_palette(int bit_depth, png_colorp palette)
-{
- int num_palette;
- int color_inc;
- int i;
- int v;
-
- png_debug(1, "in png_do_build_grayscale_palette");
-
- if (palette == NULL)
- return;
-
- switch (bit_depth)
- {
- case 1:
- num_palette = 2;
- color_inc = 0xff;
- break;
-
- case 2:
- num_palette = 4;
- color_inc = 0x55;
- break;
-
- case 4:
- num_palette = 16;
- color_inc = 0x11;
- break;
-
- case 8:
- num_palette = 256;
- color_inc = 1;
- break;
-
- default:
- num_palette = 0;
- color_inc = 0;
- break;
- }
-
- for (i = 0, v = 0; i < num_palette; i++, v += color_inc)
- {
- palette[i].red = (png_byte)v;
- palette[i].green = (png_byte)v;
- palette[i].blue = (png_byte)v;
- }
-}
-#endif
-
-#ifdef PNG_READ_TRANSFORMS_SUPPORTED
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
/* Replace any alpha or transparency with the supplied background color.
* "background" is already in the screen gamma, while "background_1" is
* at a gamma of 1.0. Paletted files have already been taken care of.
*/
-void /* PRIVATE */
+static void
png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
{
#ifdef PNG_READ_GAMMA_SUPPORTED
@@ -4275,7 +3919,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
* is 16, use gamma_16_table and gamma_shift. Build these with
* build_gamma_table().
*/
-void /* PRIVATE */
+static void
png_do_gamma(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
{
png_const_bytep gamma_table = png_ptr->gamma_table;
@@ -4476,7 +4120,7 @@ png_do_gamma(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
* linear.) Called only with color types that have an alpha channel. Needs the
* from_1 tables.
*/
-void /* PRIVATE */
+static void
png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
{
png_uint_32 row_width = row_info->width;
@@ -4542,7 +4186,7 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
/* Expands a palette row to an RGB or RGBA row depending
* upon whether you supply trans and num_trans.
*/
-void /* PRIVATE */
+static void
png_do_expand_palette(png_row_infop row_info, png_bytep row,
png_const_colorp palette, png_const_bytep trans_alpha, int num_trans)
{
@@ -4695,7 +4339,7 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
/* If the bit depth < 8, it is expanded to 8. Also, if the already
* expanded transparency value is supplied, an alpha channel is built.
*/
-void /* PRIVATE */
+static void
png_do_expand(png_row_infop row_info, png_bytep row,
png_const_color_16p trans_color)
{
@@ -4925,7 +4569,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
/* If the bit depth is 8 and the color type is not a palette type expand the
* whole row to 16 bits. Has no effect otherwise.
*/
-void /* PRIVATE */
+static void
png_do_expand_16(png_row_infop row_info, png_bytep row)
{
if (row_info->bit_depth == 8 &&
@@ -4953,7 +4597,7 @@ png_do_expand_16(png_row_infop row_info, png_bytep row)
#endif
#ifdef PNG_READ_QUANTIZE_SUPPORTED
-void /* PRIVATE */
+static void
png_do_quantize(png_row_infop row_info, png_bytep row,
png_const_bytep palette_lookup, png_const_bytep quantize_lookup)
{
@@ -5045,69 +4689,303 @@ png_do_quantize(png_row_infop row_info, png_bytep row,
}
}
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
-#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
-#ifdef PNG_MNG_FEATURES_SUPPORTED
-/* Undoes intrapixel differencing */
+/* Transform the row. The order of transformations is significant,
+ * and is very touchy. If you add a transformation, take care to
+ * decide how it fits in with the other transformations here.
+ */
void /* PRIVATE */
-png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
+png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
{
- png_debug(1, "in png_do_read_intrapixel");
+ png_debug(1, "in png_do_read_transformations");
- if (
- (row_info->color_type & PNG_COLOR_MASK_COLOR))
+ if (png_ptr->row_buf == NULL)
{
- int bytes_per_pixel;
- png_uint_32 row_width = row_info->width;
+ /* Prior to 1.5.4 this output row/pass where the NULL pointer is, but this
+ * error is incredibly rare and incredibly easy to debug without this
+ * information.
+ */
+ png_error(png_ptr, "NULL row buffer");
+ }
- if (row_info->bit_depth == 8)
- {
- png_bytep rp;
- png_uint_32 i;
+ /* The following is debugging; prior to 1.5.4 the code was never compiled in;
+ * in 1.5.4 PNG_FLAG_DETECT_UNINITIALIZED was added and the macro
+ * PNG_WARN_UNINITIALIZED_ROW removed. In 1.6 the new flag is set only for
+ * all transformations, however in practice the ROW_INIT always gets done on
+ * demand, if necessary.
+ */
+ if ((png_ptr->flags & PNG_FLAG_DETECT_UNINITIALIZED) != 0 &&
+ !(png_ptr->flags & PNG_FLAG_ROW_INIT))
+ {
+ /* Application has failed to call either png_read_start_image() or
+ * png_read_update_info() after setting transforms that expand pixels.
+ * This check added to libpng-1.2.19 (but not enabled until 1.5.4).
+ */
+ png_error(png_ptr, "Uninitialized row");
+ }
- if (row_info->color_type == PNG_COLOR_TYPE_RGB)
- bytes_per_pixel = 3;
+#ifdef PNG_READ_EXPAND_SUPPORTED
+ if (png_ptr->transformations & PNG_EXPAND)
+ {
+ if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
+ {
+ png_do_expand_palette(row_info, png_ptr->row_buf + 1,
+ png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
+ }
- else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
- bytes_per_pixel = 4;
+ else
+ {
+ if (png_ptr->num_trans &&
+ (png_ptr->transformations & PNG_EXPAND_tRNS))
+ png_do_expand(row_info, png_ptr->row_buf + 1,
+ &(png_ptr->trans_color));
else
- return;
-
- for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
- {
- *(rp) = (png_byte)((256 + *rp + *(rp + 1)) & 0xff);
- *(rp+2) = (png_byte)((256 + *(rp + 2) + *(rp + 1)) & 0xff);
- }
+ png_do_expand(row_info, png_ptr->row_buf + 1,
+ NULL);
}
- else if (row_info->bit_depth == 16)
- {
- png_bytep rp;
- png_uint_32 i;
+ }
+#endif
- if (row_info->color_type == PNG_COLOR_TYPE_RGB)
- bytes_per_pixel = 6;
+#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
+ if ((png_ptr->transformations & PNG_STRIP_ALPHA) &&
+ !(png_ptr->transformations & PNG_COMPOSE) &&
+ (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
+ row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
+ png_do_strip_channel(row_info, png_ptr->row_buf + 1,
+ 0 /* at_start == false, because SWAP_ALPHA happens later */);
+#endif
- else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
- bytes_per_pixel = 8;
+#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+ if (png_ptr->transformations & PNG_RGB_TO_GRAY)
+ {
+ int rgb_error =
+ png_do_rgb_to_gray(png_ptr, row_info,
+ png_ptr->row_buf + 1);
- else
- return;
+ if (rgb_error)
+ {
+ png_ptr->rgb_to_gray_status=1;
+ if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
+ PNG_RGB_TO_GRAY_WARN)
+ png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel");
- 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 = (s0 + s1 + 65536) & 0xffff;
- png_uint_32 blue = (s2 + s1 + 65536) & 0xffff;
- *(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);
- }
+ if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
+ PNG_RGB_TO_GRAY_ERR)
+ png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel");
}
}
+#endif
+
+/* From Andreas Dilger e-mail to png-implement, 26 March 1998:
+ *
+ * In most cases, the "simple transparency" should be done prior to doing
+ * gray-to-RGB, or you will have to test 3x as many bytes to check if a
+ * pixel is transparent. You would also need to make sure that the
+ * transparency information is upgraded to RGB.
+ *
+ * To summarize, the current flow is:
+ * - Gray + simple transparency -> compare 1 or 2 gray bytes and composite
+ * with background "in place" if transparent,
+ * convert to RGB if necessary
+ * - Gray + alpha -> composite with gray background and remove alpha bytes,
+ * convert to RGB if necessary
+ *
+ * To support RGB backgrounds for gray images we need:
+ * - Gray + simple transparency -> convert to RGB + simple transparency,
+ * compare 3 or 6 bytes and composite with
+ * background "in place" if transparent
+ * (3x compare/pixel compared to doing
+ * composite with gray bkgrnd)
+ * - Gray + alpha -> convert to RGB + alpha, composite with background and
+ * remove alpha bytes (3x float
+ * operations/pixel compared with composite
+ * on gray background)
+ *
+ * Greg's change will do this. The reason it wasn't done before is for
+ * performance, as this increases the per-pixel operations. If we would check
+ * in advance if the background was gray or RGB, and position the gray-to-RGB
+ * transform appropriately, then it would save a lot of work/time.
+ */
+
+#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
+ /* If gray -> RGB, do so now only if background is non-gray; else do later
+ * for performance reasons
+ */
+ if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
+ !(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
+ png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
+#endif
+
+#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
+ defined(PNG_READ_ALPHA_MODE_SUPPORTED)
+ if (png_ptr->transformations & PNG_COMPOSE)
+ png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr);
+#endif
+
+#ifdef PNG_READ_GAMMA_SUPPORTED
+ if ((png_ptr->transformations & PNG_GAMMA) &&
+#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+ /* Because RGB_TO_GRAY does the gamma transform. */
+ !(png_ptr->transformations & PNG_RGB_TO_GRAY) &&
+#endif
+#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
+ defined(PNG_READ_ALPHA_MODE_SUPPORTED)
+ /* Because PNG_COMPOSE does the gamma transform if there is something to
+ * do (if there is an alpha channel or transparency.)
+ */
+ !((png_ptr->transformations & PNG_COMPOSE) &&
+ ((png_ptr->num_trans != 0) ||
+ (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) &&
+#endif
+ /* Because png_init_read_transformations transforms the palette, unless
+ * RGB_TO_GRAY will do the transform.
+ */
+ (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE))
+ png_do_gamma(row_info, png_ptr->row_buf + 1, png_ptr);
+#endif
+
+#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
+ if ((png_ptr->transformations & PNG_STRIP_ALPHA) &&
+ (png_ptr->transformations & PNG_COMPOSE) &&
+ (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
+ row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
+ png_do_strip_channel(row_info, png_ptr->row_buf + 1,
+ 0 /* at_start == false, because SWAP_ALPHA happens later */);
+#endif
+
+#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
+ if ((png_ptr->transformations & PNG_ENCODE_ALPHA) &&
+ (row_info->color_type & PNG_COLOR_MASK_ALPHA))
+ png_do_encode_alpha(row_info, png_ptr->row_buf + 1, png_ptr);
+#endif
+
+#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
+ if (png_ptr->transformations & PNG_SCALE_16_TO_8)
+ png_do_scale_16_to_8(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
+ /* There is no harm in doing both of these because only one has any effect,
+ * by putting the 'scale' option first if the app asks for scale (either by
+ * calling the API or in a TRANSFORM flag) this is what happens.
+ */
+ if (png_ptr->transformations & PNG_16_TO_8)
+ png_do_chop(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_QUANTIZE_SUPPORTED
+ if (png_ptr->transformations & PNG_QUANTIZE)
+ {
+ png_do_quantize(row_info, png_ptr->row_buf + 1,
+ png_ptr->palette_lookup, png_ptr->quantize_index);
+
+ if (row_info->rowbytes == 0)
+ png_error(png_ptr, "png_do_quantize returned rowbytes=0");
+ }
+#endif /* PNG_READ_QUANTIZE_SUPPORTED */
+
+#ifdef PNG_READ_EXPAND_16_SUPPORTED
+ /* Do the expansion now, after all the arithmetic has been done. Notice
+ * that previous transformations can handle the PNG_EXPAND_16 flag if this
+ * is efficient (particularly true in the case of gamma correction, where
+ * better accuracy results faster!)
+ */
+ if (png_ptr->transformations & PNG_EXPAND_16)
+ png_do_expand_16(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
+ /* NOTE: moved here in 1.5.4 (from much later in this list.) */
+ if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
+ (png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
+ png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_INVERT_SUPPORTED
+ if (png_ptr->transformations & PNG_INVERT_MONO)
+ png_do_invert(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_SHIFT_SUPPORTED
+ if (png_ptr->transformations & PNG_SHIFT)
+ png_do_unshift(row_info, png_ptr->row_buf + 1,
+ &(png_ptr->shift));
+#endif
+
+#ifdef PNG_READ_PACK_SUPPORTED
+ if (png_ptr->transformations & PNG_PACK)
+ png_do_unpack(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
+ /* Added at libpng-1.5.10 */
+ if (row_info->color_type == PNG_COLOR_TYPE_PALETTE &&
+ png_ptr->num_palette_max >= 0)
+ png_do_check_palette_indexes(png_ptr, row_info);
+#endif
+
+#ifdef PNG_READ_BGR_SUPPORTED
+ if (png_ptr->transformations & PNG_BGR)
+ png_do_bgr(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_PACKSWAP_SUPPORTED
+ if (png_ptr->transformations & PNG_PACKSWAP)
+ png_do_packswap(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_FILLER_SUPPORTED
+ if (png_ptr->transformations & PNG_FILLER)
+ png_do_read_filler(row_info, png_ptr->row_buf + 1,
+ (png_uint_32)png_ptr->filler, png_ptr->flags);
+#endif
+
+#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
+ if (png_ptr->transformations & PNG_INVERT_ALPHA)
+ png_do_read_invert_alpha(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
+ if (png_ptr->transformations & PNG_SWAP_ALPHA)
+ png_do_read_swap_alpha(row_info, png_ptr->row_buf + 1);
+#endif
+
+#ifdef PNG_READ_16BIT_SUPPORTED
+#ifdef PNG_READ_SWAP_SUPPORTED
+ if (png_ptr->transformations & PNG_SWAP_BYTES)
+ png_do_swap(row_info, png_ptr->row_buf + 1);
+#endif
+#endif
+
+#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
+ if (png_ptr->transformations & PNG_USER_TRANSFORM)
+ {
+ if (png_ptr->read_user_transform_fn != NULL)
+ (*(png_ptr->read_user_transform_fn)) /* User read 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 */
+#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
+ if (png_ptr->user_transform_depth)
+ row_info->bit_depth = png_ptr->user_transform_depth;
+
+ if (png_ptr->user_transform_channels)
+ row_info->channels = png_ptr->user_transform_channels;
+#endif
+ row_info->pixel_depth = (png_byte)(row_info->bit_depth *
+ row_info->channels);
+
+ row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_info->width);
+ }
+#endif
}
-#endif /* PNG_MNG_FEATURES_SUPPORTED */
+
+#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
#endif /* PNG_READ_SUPPORTED */
diff --git a/pngtest.c b/pngtest.c
index b37b35856..2c69f33e6 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1,8 +1,8 @@
/* pngtest.c - a simple test program to test libpng
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
- * Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.9 [February 6, 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.)
*
@@ -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
@@ -725,18 +732,18 @@ 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)
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];
@@ -749,7 +756,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
@@ -830,6 +837,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;
@@ -838,7 +846,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;
@@ -1044,10 +1052,26 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
&color_type, &interlace_type, &compression_type, &filter_type))
{
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
}
}
@@ -1340,14 +1364,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
@@ -1579,6 +1599,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
}
#ifdef PNG_WRITE_SUPPORTED /* else nothing was written */
+ if (interlace_preserved) /* else the files will be changed */
{
for (;;)
{
@@ -1965,9 +1986,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_8 Your_png_h_is_not_version_1_6_8;
+typedef png_libpng_version_1_6_9 Your_png_h_is_not_version_1_6_9;
diff --git a/pngtrans.c b/pngtrans.c
index 8f8bc5d9e..94f18df27 100644
--- a/pngtrans.c
+++ b/pngtrans.c
@@ -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.9 [February 6, 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.)
*
@@ -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
diff --git a/pngwio.c b/pngwio.c
index 4581b0802..1b525f948 100644
--- a/pngwio.c
+++ b/pngwio.c
@@ -1,8 +1,8 @@
/* pngwio.c - functions for data output
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
- * Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.9 [February 6, 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.)
*
@@ -153,6 +153,7 @@ png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
PNG_UNUSED(output_flush_fn)
#endif /* PNG_WRITE_FLUSH_SUPPORTED */
+#ifdef PNG_READ_SUPPORTED
/* It is an error to read while writing a png file */
if (png_ptr->read_data_fn != NULL)
{
@@ -162,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 */
diff --git a/pngwrite.c b/pngwrite.c
index 8f6df68b2..c3cb6070d 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -1,8 +1,8 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Last changed in libpng 1.6.8 [December 19, 2013]
- * Copyright (c) 1998-2013 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.9 [February 6, 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.)
*
@@ -607,6 +607,71 @@ png_write_image(png_structrp png_ptr, png_bytepp image)
}
}
+#ifdef PNG_MNG_FEATURES_SUPPORTED
+/* Performs intrapixel differencing */
+static void
+png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
+{
+ png_debug(1, "in png_do_write_intrapixel");
+
+ 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 (row_info->color_type == PNG_COLOR_TYPE_RGB)
+ bytes_per_pixel = 3;
+
+ else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ bytes_per_pixel = 4;
+
+ else
+ return;
+
+ 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_16BIT_SUPPORTED
+ else if (row_info->bit_depth == 16)
+ {
+ png_bytep rp;
+ png_uint_32 i;
+
+ if (row_info->color_type == PNG_COLOR_TYPE_RGB)
+ bytes_per_pixel = 6;
+
+ else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+ bytes_per_pixel = 8;
+
+ else
+ return;
+
+ 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 */
+ }
+}
+#endif /* PNG_MNG_FEATURES_SUPPORTED */
+
/* Called by user to write a row of image data */
void PNGAPI
png_write_row(png_structrp png_ptr, png_const_bytep row)
diff --git a/pngwtran.c b/pngwtran.c
index 98703f8c8..215bd68a9 100644
--- a/pngwtran.c
+++ b/pngwtran.c
@@ -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.9 [February 6, 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.)
*
@@ -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)
{
@@ -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");
@@ -475,7 +399,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
#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");
@@ -568,70 +492,81 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
}
}
#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)
+ 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)
+ 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)
+ 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)
+ 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
+ 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
- if (row_info->color_type == PNG_COLOR_TYPE_RGB)
- bytes_per_pixel = 6;
+#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
- else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
- bytes_per_pixel = 8;
+#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
- else
- return;
+#ifdef PNG_WRITE_BGR_SUPPORTED
+ if (png_ptr->transformations & PNG_BGR)
+ png_do_bgr(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_INVERT_SUPPORTED
+ if (png_ptr->transformations & PNG_INVERT_MONO)
+ png_do_invert(row_info, png_ptr->row_buf + 1);
+#endif
}
-#endif /* PNG_MNG_FEATURES_SUPPORTED */
+#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
#endif /* PNG_WRITE_SUPPORTED */
diff --git a/projects/vstudio/readme.txt b/projects/vstudio/readme.txt
index 70ffa51c4..d88d98c38 100644
--- a/projects/vstudio/readme.txt
+++ b/projects/vstudio/readme.txt
@@ -1,7 +1,7 @@
VisualStudio instructions
-libpng version 1.6.8 - December 19, 2013
+libpng version 1.6.9 - February 6, 2014
Copyright (c) 1998-2010 Glenn Randers-Pehrson
diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props
index c540c9501..9d894dd1a 100644
--- a/projects/vstudio/zlib.props
+++ b/projects/vstudio/zlib.props
@@ -2,7 +2,7 @@
<!--
* zlib.props - location of zlib source
*
- * libpng version 1.6.8 - December 19, 2013
+ * libpng version 1.6.9 - February 6, 2014
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
*
diff --git a/scripts/README.txt b/scripts/README.txt
index 1f5a9616f..f0b726788 100644
--- a/scripts/README.txt
+++ b/scripts/README.txt
@@ -1,9 +1,9 @@
-Makefiles for libpng version 1.6.8 - December 19, 2013
+Makefiles for libpng version 1.6.9 - February 6, 2014
pnglibconf.h.prebuilt => Stores configuration settings
makefile.linux => Linux/ELF makefile
- (gcc, creates libpng16.so.16.1.6.8)
+ (gcc, creates libpng16.so.16.1.6.9)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from
@@ -20,7 +20,7 @@ pnglibconf.h.prebuilt => Stores configuration settings
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.8)
+ (gcc, creates libpng16.so.16.1.6.9)
makefile.freebsd => FreeBSD makefile
makefile.gcc => Generic gcc makefile
makefile.hpgcc => HPUX makefile using gcc
@@ -35,12 +35,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.8)
+ creates libpng16.so.16.1.6.9)
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.solaris => Solaris 2.X makefile (gcc,
- creates libpng16.so.16.1.6.8)
+ creates libpng16.so.16.1.6.9)
makefile.so9 => Solaris 9 makefile (gcc,
- creates libpng16.so.16.1.6.8)
+ creates libpng16.so.16.1.6.9)
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.sunos => Sun makefile
makefile.32sunu => Sun Ultra 32-bit makefile
diff --git a/scripts/def.dfn b/scripts/def.dfn
index 7bd88d419..40f765430 100644
--- a/scripts/def.dfn
+++ b/scripts/def.dfn
@@ -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.8"
+PNG_DFN ";Version 1.6.9"
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_DFN "@" SYMBOL_PREFIX "@@" name "@"
diff --git a/scripts/descrip.mms b/scripts/descrip.mms
index eb9a80713..463c4251e 100644
--- a/scripts/descrip.mms
+++ b/scripts/descrip.mms
@@ -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
-
-pngtest.obj : png.h, pngconf.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, pnglibconf.h
diff --git a/scripts/libpng-config-head.in b/scripts/libpng-config-head.in
index 0b3cf6871..51b861e63 100755
--- a/scripts/libpng-config-head.in
+++ b/scripts/libpng-config-head.in
@@ -11,7 +11,7 @@
# Modeled after libxml-config.
-version=1.6.8
+version=1.6.9
prefix=""
libdir=""
libs=""
diff --git a/scripts/libpng.pc.in b/scripts/libpng.pc.in
index aa59c1864..9395df482 100644
--- a/scripts/libpng.pc.in
+++ b/scripts/libpng.pc.in
@@ -5,6 +5,6 @@ includedir=@includedir@/libpng16
Name: libpng
Description: Loads and saves PNG files
-Version: 1.6.8
+Version: 1.6.9
Libs: -L${libdir} -lpng16
Cflags: -I${includedir}
diff --git a/scripts/makefile.32sunu b/scripts/makefile.32sunu
index 6eef5b7b4..c6e7fed0a 100644
--- a/scripts/makefile.32sunu
+++ b/scripts/makefile.32sunu
@@ -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
@@ -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
diff --git a/scripts/makefile.64sunu b/scripts/makefile.64sunu
index 1aaf69625..618629009 100644
--- a/scripts/makefile.64sunu
+++ b/scripts/makefile.64sunu
@@ -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
@@ -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
diff --git a/scripts/makefile.aix b/scripts/makefile.aix
index ae89cd441..5f62d50af 100644
--- a/scripts/makefile.aix
+++ b/scripts/makefile.aix
@@ -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
-
-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
+ $(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
+
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.atari b/scripts/makefile.atari
index 1aeb7d5b7..051d3036e 100644
--- a/scripts/makefile.atari
+++ b/scripts/makefile.atari
@@ -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
@@ -36,6 +37,9 @@ 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
diff --git a/scripts/makefile.bc32 b/scripts/makefile.bc32
index b58c571ae..c2a912211 100644
--- a/scripts/makefile.bc32
+++ b/scripts/makefile.bc32
@@ -43,7 +43,8 @@ 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)
@@ -89,10 +90,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)
@@ -114,21 +116,21 @@ test: pngtest.exe
pnglibconf.h: scripts\pnglibconf.h.prebuilt
copy scripts\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)
diff --git a/scripts/makefile.beos b/scripts/makefile.beos
index 9bf0c0765..f897d1144 100644
--- a/scripts/makefile.beos
+++ b/scripts/makefile.beos
@@ -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
#
@@ -40,8 +40,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
@@ -76,6 +76,9 @@ 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
@@ -176,14 +179,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 +199,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
diff --git a/scripts/makefile.bor b/scripts/makefile.bor
index e3b36a51e..a032510d4 100644
--- a/scripts/makefile.bor
+++ b/scripts/makefile.bor
@@ -51,7 +51,8 @@ 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)
@@ -99,10 +100,11 @@ 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
@@ -121,21 +123,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)
diff --git a/scripts/makefile.cegcc b/scripts/makefile.cegcc
index 61bc1c785..f2179b76f 100644
--- a/scripts/makefile.cegcc
+++ b/scripts/makefile.cegcc
@@ -23,14 +23,14 @@
VERMAJ = 1
VERMIN = 6
-VERMIC = 8
+VERMIC = 9
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"
diff --git a/scripts/makefile.darwin b/scripts/makefile.darwin
index 814fef502..7c38c2652 100644
--- a/scripts/makefile.darwin
+++ b/scripts/makefile.darwin
@@ -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
@@ -37,8 +37,9 @@ RANLIB=ranlib
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)
+CPPFLAGS=-I$(ZLIBINC)
+# CFLAGS=-W -Wall -O3 -funroll-loops
+CFLAGS=-W -Wall -O -funroll-loops $(ARCH)
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz $(ARCH)
INCPATH=$(prefix)/include
@@ -69,8 +70,11 @@ 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
@@ -176,14 +180,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 +203,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
diff --git a/scripts/makefile.dec b/scripts/makefile.dec
index 79e372474..1ba9efbad 100644
--- a/scripts/makefile.dec
+++ b/scripts/makefile.dec
@@ -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.
@@ -53,13 +53,17 @@ 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
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
@@ -161,7 +165,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,7 +174,7 @@ 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`
@@ -183,20 +187,20 @@ clean:
# 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
diff --git a/scripts/makefile.dj2 b/scripts/makefile.dj2
index ad117bc5e..a43f34a14 100644
--- a/scripts/makefile.dj2
+++ b/scripts/makefile.dj2
@@ -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,7 +13,8 @@ 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
@@ -22,6 +23,9 @@ 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
@@ -43,20 +47,20 @@ clean:
# 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
diff --git a/scripts/makefile.elf b/scripts/makefile.elf
index 15a8ee67b..6da6d4ae3 100644
--- a/scripts/makefile.elf
+++ b/scripts/makefile.elf
@@ -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
+# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs
# and Glenn Randers-Pehrson
# Copyright (C) 1996, 1997 Andreas Dilger
#
@@ -54,8 +54,8 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
# 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
+CPPFLAGS=-D_REENTRANT # -DPNG_DEBUG=5
+CFLAGS=-W -Wall -O2 $(ALIGN) # $(WARNMORE) -g
LDFLAGS=-L. -lpng16
LDFLAGS_A=libpng.a -lz -lm
@@ -90,6 +90,9 @@ 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
@@ -111,7 +114,7 @@ libpng.pc:
-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 |\
+ $(CC) $(CPPFLAGS) $(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")\
@@ -220,14 +223,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`
@@ -244,20 +247,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
diff --git a/scripts/makefile.freebsd b/scripts/makefile.freebsd
index 0ddf4ae4a..03a15df6c 100644
--- a/scripts/makefile.freebsd
+++ b/scripts/makefile.freebsd
@@ -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.
@@ -17,7 +18,7 @@ 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,21 @@ 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
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}
diff --git a/scripts/makefile.gcc b/scripts/makefile.gcc
index 78faa63b2..a592294fc 100644
--- a/scripts/makefile.gcc
+++ b/scripts/makefile.gcc
@@ -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.
#
@@ -18,25 +18,21 @@ AR_RC = ar rcs
RANLIB = ranlib
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 =
# 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
@@ -45,43 +41,43 @@ all: static
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/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
-
-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
+ $(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
+
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.hp64 b/scripts/makefile.hp64
index bf5196247..6c15a0bde 100644
--- a/scripts/makefile.hp64
+++ b/scripts/makefile.hp64
@@ -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
#
@@ -36,11 +36,11 @@ LN_SF=ln -sf
RANLIB=ranlib
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
@@ -75,8 +75,11 @@ 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
@@ -179,7 +182,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 +191,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 +208,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
diff --git a/scripts/makefile.hpgcc b/scripts/makefile.hpgcc
index bf44d2262..67d8f42a6 100644
--- a/scripts/makefile.hpgcc
+++ b/scripts/makefile.hpgcc
@@ -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
@@ -53,8 +53,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 +86,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 +188,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 +197,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 +214,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
diff --git a/scripts/makefile.hpux b/scripts/makefile.hpux
index 1c2970b7f..bef2e2397 100644
--- a/scripts/makefile.hpux
+++ b/scripts/makefile.hpux
@@ -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
@@ -72,8 +74,11 @@ 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
@@ -176,7 +181,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 +190,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 +207,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
diff --git a/scripts/makefile.ibmc b/scripts/makefile.ibmc
index a19090dfe..861a55157 100644
--- a/scripts/makefile.ibmc
+++ b/scripts/makefile.ibmc
@@ -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.
@@ -23,7 +23,8 @@ LD = ilink
AR = ilib
RM = del
-CFLAGS = -I$(ZLIBINC) -Mc -O2 -W3
+CPPFLAGS = -I$(ZLIBINC)
+CFLAGS = -Mc -O2 -W3
LDFLAGS =
# File extensions
@@ -39,6 +40,9 @@ 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
@@ -63,20 +67,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
diff --git a/scripts/makefile.intel b/scripts/makefile.intel
index 3a45014cf..1abfc6ed6 100644
--- a/scripts/makefile.intel
+++ b/scripts/makefile.intel
@@ -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,7 +32,8 @@ 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
@@ -48,50 +49,50 @@ all: test
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/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 +102,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
diff --git a/scripts/makefile.knr b/scripts/makefile.knr
index e2d2d4e59..720921517 100644
--- a/scripts/makefile.knr
+++ b/scripts/makefile.knr
@@ -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,15 @@ 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
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
@@ -48,12 +49,12 @@ pnglibconf.h: scripts/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)
@@ -90,20 +91,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
diff --git a/scripts/makefile.linux b/scripts/makefile.linux
index 87ae0e5e9..57272498f 100644
--- a/scripts/makefile.linux
+++ b/scripts/makefile.linux
@@ -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 = 8
+RELEASE = 9
# Shared library names:
LIBSO=$(LIBNAME).so
@@ -48,7 +48,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
@@ -82,6 +83,9 @@ 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
@@ -196,14 +200,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 +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
diff --git a/scripts/makefile.mips b/scripts/makefile.mips
index d6a5cc31b..a0df0018a 100644
--- a/scripts/makefile.mips
+++ b/scripts/makefile.mips
@@ -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,7 +22,8 @@ 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
@@ -33,6 +34,9 @@ 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
@@ -75,20 +79,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
diff --git a/scripts/makefile.msc b/scripts/makefile.msc
index e3ad73e75..905ed72c5 100644
--- a/scripts/makefile.msc
+++ b/scripts/makefile.msc
@@ -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,7 +10,8 @@
# -------- 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
@@ -31,50 +32,50 @@ all: libpng.lib
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/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 +84,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 ;
diff --git a/scripts/makefile.msys b/scripts/makefile.msys
index 98e2677ba..0a5727f14 100644
--- a/scripts/makefile.msys
+++ b/scripts/makefile.msys
@@ -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 = 8
+RELEASE = 9
# Shared library names:
LIBSO=$(LIBNAME).dll
@@ -44,20 +44,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
@@ -81,9 +74,9 @@ DL=$(DESTDIR)$(LIBPATH)
DM=$(DESTDIR)$(MANPATH)
# 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
@@ -92,10 +85,10 @@ all: static shared
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/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 +99,7 @@ $(LIBSO): $(LIBSOMAJ)
$(LIBSOMAJ):
$(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOMAJ)
-libpng$(A): $(OBJS)
+libpng.a: $(OBJS)
$(AR_RC) $@ $(OBJS)
$(RANLIB) $@
@@ -175,30 +168,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
-
-pngtest$(O): png.h pngconf.h 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
+
+pngtest.o: png.h pngconf.h pnglibconf.h
diff --git a/scripts/makefile.ne12bsd b/scripts/makefile.ne12bsd
index baea7b6b2..649acdde4 100644
--- a/scripts/makefile.ne12bsd
+++ b/scripts/makefile.ne12bsd
@@ -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.8
+SHLIB_MINOR= 1.6.9
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
@@ -34,6 +34,9 @@ CPPFLAGS+=-I${.CURDIR}
CLEANFILES+=pngtest.o pngtest pnglibconf.h
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
diff --git a/scripts/makefile.netbsd b/scripts/makefile.netbsd
index f07d9c55e..a16dae816 100644
--- a/scripts/makefile.netbsd
+++ b/scripts/makefile.netbsd
@@ -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.8
+SHLIB_MINOR= 1.6.9
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
@@ -34,6 +34,9 @@ CPPFLAGS+=-I${.CURDIR}
CLEANFILES+=pngtest.o pngtest pnglibconf.h
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
cp scripts/pnglibconf.h.prebuilt $@
diff --git a/scripts/makefile.openbsd b/scripts/makefile.openbsd
index e7fdf0208..69b1ecc50 100644
--- a/scripts/makefile.openbsd
+++ b/scripts/makefile.openbsd
@@ -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.8
+SHLIB_MINOR= 1.6.9
LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
@@ -28,8 +28,11 @@ 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
+
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
# see scripts/pnglibconf.mak for more options
pnglibconf.h: scripts/pnglibconf.h.prebuilt
diff --git a/scripts/makefile.sco b/scripts/makefile.sco
index c5f254f6e..a8de13f09 100644
--- a/scripts/makefile.sco
+++ b/scripts/makefile.sco
@@ -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
#
@@ -37,7 +37,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
@@ -68,8 +69,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
@@ -175,14 +179,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 +203,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
diff --git a/scripts/makefile.sggcc b/scripts/makefile.sggcc
index 7c427bea6..a2c203e3e 100644
--- a/scripts/makefile.sggcc
+++ b/scripts/makefile.sggcc
@@ -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.
@@ -42,8 +42,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
@@ -74,6 +75,9 @@ 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
@@ -182,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) \
+ $(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-rpath $(ZLIBLIB):$(DL) \
@@ -192,7 +196,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 +213,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
diff --git a/scripts/makefile.sgi b/scripts/makefile.sgi
index f40461e33..96c61b089 100644
--- a/scripts/makefile.sgi
+++ b/scripts/makefile.sgi
@@ -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.
@@ -44,8 +44,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) \
@@ -77,6 +78,9 @@ 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
@@ -182,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) \
+ $(CC) -I$(DI) $(CPPFLAGS) \
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
-L$(DL) -L$(ZLIBLIB) \
-rpath $(ZLIBLIB):$(DL) \
@@ -192,7 +196,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 +214,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
diff --git a/scripts/makefile.so9 b/scripts/makefile.so9
index a7773d183..67821f8a9 100644
--- a/scripts/makefile.so9
+++ b/scripts/makefile.so9
@@ -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
#
@@ -46,8 +46,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
@@ -78,8 +79,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
@@ -194,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)
@@ -203,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)
@@ -220,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
diff --git a/scripts/makefile.solaris b/scripts/makefile.solaris
index be423a184..813219966 100644
--- a/scripts/makefile.solaris
+++ b/scripts/makefile.solaris
@@ -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
@@ -42,7 +42,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
@@ -74,8 +75,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
@@ -191,7 +195,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 +204,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 +221,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
diff --git a/scripts/makefile.solaris-x86 b/scripts/makefile.solaris-x86
index d41e659c5..8d2414852 100644
--- a/scripts/makefile.solaris-x86
+++ b/scripts/makefile.solaris-x86
@@ -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
@@ -42,8 +42,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
@@ -74,6 +74,9 @@ 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
@@ -191,7 +194,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 +203,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 +220,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
diff --git a/scripts/makefile.std b/scripts/makefile.std
index 419eeedf2..30a21e23f 100644
--- a/scripts/makefile.std
+++ b/scripts/makefile.std
@@ -1,5 +1,5 @@
# makefile for libpng
-# Copyright (C) 2002, 2006 Glenn Randers-Pehrson
+# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@@ -27,12 +27,12 @@ DESTDIR=
ZLIBLIB=../zlib
ZLIBINC=../zlib
-CC=cc
-AR_RC=ar rc
-MKDIR_P=mkdir
-LN_SF=ln -sf
-RANLIB=ranlib
-RM_F=rm -f
+CC = cc
+AR_RC = ar rc
+MKDIR_P = mkdir
+LN_SF = ln -sf
+RANLIB = ranlib
+RM_F = rm -f
AWK = awk
SED = sed
CPP = $(CC) -E
@@ -40,13 +40,17 @@ ECHO = echo
DFNFLAGS = # DFNFLAGS contains -D options to use in the libpng build
DFA_EXTRA = # extra files that can be used to control configuration
-CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
-LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
+CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
+CFLAGS = -O # -g
+LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm
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
# The standard pnglibconf.h exists as scripts/pnglibconf.h.prebuilt,
@@ -105,20 +109,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
diff --git a/scripts/makefile.sunos b/scripts/makefile.sunos
index c1d016505..bc5f9267b 100644
--- a/scripts/makefile.sunos
+++ b/scripts/makefile.sunos
@@ -1,5 +1,5 @@
# makefile for libpng
-# Copyright (C) 2002, 2006 Glenn Randers-Pehrson
+# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.
@@ -39,13 +39,17 @@ LN_SF=ln -f -s
RANLIB=ranlib
RM_F=/bin/rm -f
-CFLAGS=-I$(ZLIBINC) -O # $(WARNMORE) -DPNG_DEBUG=5
+CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
+CFLAGS=-O # $(WARNMORE)
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
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
@@ -88,20 +92,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
diff --git a/scripts/makefile.tc3 b/scripts/makefile.tc3
index a046bf6ab..62279b76b 100644
--- a/scripts/makefile.tc3
+++ b/scripts/makefile.tc3
@@ -3,11 +3,11 @@
# To use, do "make -fmakefile.tc3"
-# ----- Turbo C 3.00 (can be modified to work with earlier versions) -----
+# ----- Turbo C++ 3.0 -----
MODEL=l
-CFLAGS=-O2 -Z -m$(MODEL) -I..\zlib
-#CFLAGS=-D_NO_PROTO -O2 -Z -m$(MODEL) -I..\zlib # Turbo C older than 3.00
+CPPFLAGS=-I..\zlib
+CFLAGS=-O2 -Z -m$(MODEL)
CC=tcc
LD=tcc
LIB=tlib
@@ -34,53 +34,53 @@ pngtest: pngtest$(E)
test: pngtest$(E)
pngtest$(E)
-png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
pngtest$(O): png.h pngconf.h pnglibconf.h
- $(CC) -c $(CFLAGS) $*.c
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
-pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
- $(CC) -c $(CFLAGS) $*.c
+pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c
libpng$(MODEL).lib: $(OBJS1) $(OBJS2) $(OBJS3)
$(LIB) libpng$(MODEL) +$(OBJSL1)
diff --git a/scripts/makefile.vcwin32 b/scripts/makefile.vcwin32
index 3ca7a0114..b26c4acc7 100644
--- a/scripts/makefile.vcwin32
+++ b/scripts/makefile.vcwin32
@@ -1,6 +1,6 @@
# makefile for libpng
# Copyright (C) 1998 Tim Wegner
-# Copyright (C) 2006,2009,2011 Glenn Randers-Pehrson
+# Copyright (C) 2006,2009,2011,2014 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -15,7 +15,8 @@
CC = cl
LD = link
AR = lib
-CFLAGS = -nologo -D_CRT_SECURE_NO_DEPRECATE -MD -O2 -W3 -I..\zlib
+CPPFLAGS = -I..\zlib
+CFLAGS = -nologo -D_CRT_SECURE_NO_DEPRECATE -MD -O2 -W3
LDFLAGS = -nologo
ARFLAGS = -nologo
RM = del
@@ -39,57 +40,57 @@ all: libpng.lib
pnglibconf.h: scripts\pnglibconf.h.prebuilt
copy scripts\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: $(OBJS)
-$(RM) $@
$(AR) $(ARFLAGS) -out:$@ $(OBJS) $(ERRFILE)
pngtest$(O): png.h pngconf.h pnglibconf.h
- $(CC) -c $(CFLAGS) $*.c $(ERRFILE)
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
pngtest.exe: pngtest$(O) libpng.lib
$(LD) $(LDFLAGS) -out:$@ pngtest$(O) libpng.lib ..\zlib\zlib.lib $(ERRFILE)
diff --git a/scripts/makevms.com b/scripts/makevms.com
index 692855357..f6c326103 100644
--- a/scripts/makevms.com
+++ b/scripts/makevms.com
@@ -54,35 +54,35 @@ $ if make.eqs.""
$ then
$ dele pngtest.obj;*
$ CALL MAKE png.OBJ "cc ''CCOPT' png" -
- png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngset.OBJ "cc ''CCOPT' pngset" -
- pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngget.OBJ "cc ''CCOPT' pngget" -
- pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngread.OBJ "cc ''CCOPT' pngread" -
- pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" -
- pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngrtran.OBJ "cc ''CCOPT' pngrtran" -
- pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngrutil.OBJ "cc ''CCOPT' pngrutil" -
- pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngerror.OBJ "cc ''CCOPT' pngerror" -
- pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngmem.OBJ "cc ''CCOPT' pngmem" -
- pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngrio.OBJ "cc ''CCOPT' pngrio" -
- pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngwio.OBJ "cc ''CCOPT' pngwio" -
- pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngtrans.OBJ "cc ''CCOPT' pngtrans" -
- pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngwrite.OBJ "cc ''CCOPT' pngwrite" -
- pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngwtran.OBJ "cc ''CCOPT' pngwtran" -
- pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ CALL MAKE pngwutil.OBJ "cc ''CCOPT' pngwutil" -
- pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+ pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$ write sys$output "Building Libpng ..."
$ CALL MAKE libpng.OLB "lib/crea libpng.olb *.obj" *.OBJ
$ write sys$output "Building pngtest..."
diff --git a/scripts/pnglibconf.dfa b/scripts/pnglibconf.dfa
index 0e98058fa..b173bb19c 100755
--- a/scripts/pnglibconf.dfa
+++ b/scripts/pnglibconf.dfa
@@ -480,6 +480,7 @@ option INCH_CONVERSIONS
= INCH_CONVERSIONS INCH_CONVERSIONS
# API to build a grayscale palette
+# NOTE: this is not used internally by libpng at present.
option BUILD_GRAYSCALE_PALETTE
diff --git a/scripts/pnglibconf.h.prebuilt b/scripts/pnglibconf.h.prebuilt
index cb0f133c4..8ad56dbb5 100644
--- a/scripts/pnglibconf.h.prebuilt
+++ b/scripts/pnglibconf.h.prebuilt
@@ -1,8 +1,8 @@
-/* libpng 1.6.8 STANDARD API DEFINITION */
+/* libpng 1.6.9 STANDARD API DEFINITION */
/* pnglibconf.h - library build configuration */
-/* Libpng version 1.6.8 - December 19, 2013 */
+/* Libpng version 1.6.9 - February 6, 2014 */
/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */
diff --git a/scripts/symbols.def b/scripts/symbols.def
index b0a7a2703..61e47698b 100644
--- a/scripts/symbols.def
+++ b/scripts/symbols.def
@@ -1,4 +1,4 @@
-;Version 1.6.8
+;Version 1.6.9
;--------------------------------------------------------------
; LIBPNG symbol list as a Win32 DEF file
; Contains all the symbols that can be exported from libpng
diff --git a/tests/pngvalid-progressive-standard b/tests/pngvalid-progressive-standard
index 20ecd1583..aa1b4b4db 100755
--- a/tests/pngvalid-progressive-standard
+++ b/tests/pngvalid-progressive-standard
@@ -1,2 +1,2 @@
#!/bin/sh
-exec ./pngvalid --standard --interlace
+exec ./pngvalid --standard --progressive-read