提交 a710317d 编写于 作者: G Glenn Randers-Pehrson

[master] Imported from libpng-1.6.9.tar

上级 339ef1ec
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
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......@@ -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
......
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.
......
......@@ -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 */
}
}
......
......@@ -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)
......
......@@ -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
# =====================
#
......
......@@ -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 --------------------------------------------------------------
......
......@@ -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 --------------------------------------------------------------
......
......@@ -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 --------------------------------------------------------------
......
......@@ -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 --------------------------------------------------------------
......
此差异已折叠。
......@@ -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
......
......@@ -81,7 +81,7 @@ OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules -------------------------------------------------------
.c$(O):
$(CC) $(CPPFLAGS) -c $(CFLAGS) $<
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
# dependencies
......
......@@ -97,7 +97,7 @@ OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules -------------------------------------------------------
.c$(O):
$(CC) $(CPPFLAGS) -c $(CFLAGS) $<
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
# dependencies
......
......@@ -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
......
......@@ -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
/* 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"
......
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
......
.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
.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"
......
.TH PNG 5 "December 19, 2013"
.TH PNG 5 "February 6, 2014"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION
......
/* 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)
......
/* 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.
*
......
/* 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)\
......
......@@ -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();
}
......
......@@ -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,
......
/* 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
......
/* 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;
......
此差异已折叠。
/* 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;
/* 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
......
/* 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 */
/* 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)
......
/* 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 */
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
......
......@@ -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
*
......
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
......
......@@ -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 "@"
......
......@@ -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
......@@ -11,7 +11,7 @@
# Modeled after libxml-config.
version=1.6.8
version=1.6.9
prefix=""
libdir=""
libs=""
......
......@@ -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}
# 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
# 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
# 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
# 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
......
......@@ -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)
......
# 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
......@@ -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)
......
......@@ -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"
......
# 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
# 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
# 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
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -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
......
此差异已折叠。
;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
......
#!/bin/sh
exec ./pngvalid --standard --interlace
exec ./pngvalid --standard --progressive-read
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册