mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
9 Commits
v1.2.2
...
v1.2.4beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1e8c8694d | ||
|
|
07748d1b2c | ||
|
|
cfbed9bdf2 | ||
|
|
22f28966c4 | ||
|
|
837a3d1745 | ||
|
|
704228f7e7 | ||
|
|
299d73503c | ||
|
|
25d8224d15 | ||
|
|
03008a08d1 |
59
ANNOUNCE
59
ANNOUNCE
@@ -1,49 +1,24 @@
|
|||||||
|
|
||||||
Libpng 1.2.2 - April 15, 2002
|
Libpng 1.2.4beta2 - June 20, 2002
|
||||||
|
|
||||||
This is a public release of libpng, intended for use in production codes.
|
This is not intended to be a public release. It will be replaced
|
||||||
|
within a few weeks by a public version or by another test version.
|
||||||
|
|
||||||
Changes since the last public release (1.2.1):
|
Changes since the last public release (1.2.3):
|
||||||
|
|
||||||
Fixed a bug with reading the length of iCCP profiles (Larry Reeves).
|
version 1.2.4beta1 [May 24, 2002]
|
||||||
Revised makefile.linux, makefile.gcmmx, and others to generate
|
Added libpng.pc and libpng-config to "all:" target in 16 makefiles.
|
||||||
libpng.a, libpngNN.so, libpng.so.NN, and libpngNN/png.h
|
Fixed bug in 16 makefiles: $(DESTDIR)/$(LIBPATH) to $(DESTDIR)$(LIBPATH)
|
||||||
Revised makefile.darwin to remove "-undefined suppress" option.
|
Added missing "\" before closing double quote in makefile.gcmmx.
|
||||||
Added checks for gamma and chromaticity values over 21474.83, which exceed
|
Plugged various memory leaks; added png_malloc_warn() and png_set_text_2()
|
||||||
the limit for PNG unsigned 32-bit integers when encoded.
|
functions.
|
||||||
Revised calls to png_create_read_struct() and png_create_write_struct()
|
version 1.2.4beta2 [June 20, 2002]
|
||||||
for simpler debugging.
|
Plugged memory leak of png_ptr->current_text (Matt Holgate).
|
||||||
Revised png_zalloc() so zlib handles errors (uses PNG_FLAG_MALLOC_NULL_MEM_OK)
|
Check for buffer overflow before reading CRC in pngpread.c (Warwick Allison)
|
||||||
Check chunk_length and idat_size for invalid (over PNG_MAX_UINT) lengths.
|
Added -soname to the loader flags in makefile.dec, makefile.sgi, and
|
||||||
Check for invalid image dimensions in png_get_IHDR.
|
makefile.sggcc.
|
||||||
Added install-shared and install-static targets to all makefiles that make
|
Added "test-installed" targets to makefile.linux, makefile.gcmmx,
|
||||||
shared libraries.
|
makefile.sgi, and makefile.sggcc.
|
||||||
Always do gamma compensation when image is partially transparent.
|
|
||||||
Modified shared-library makefiles to install pkgconfig/libpngNN.pc.
|
|
||||||
Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown
|
|
||||||
Removed unused png_write_destroy_info prototype from png.h
|
|
||||||
Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case
|
|
||||||
Stopped a double free of palette, hist, and trans when not using free_me.
|
|
||||||
Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64.
|
|
||||||
Compute background.gray and background_1.gray even when color_type is RGB
|
|
||||||
in case image gets reduced to gray later (Jason Summers).
|
|
||||||
Added PNG_1_0_X macro which can be used to build a 1.0.x-compatible library.
|
|
||||||
Added missing PNGAPI to several function definitions.
|
|
||||||
Check for invalid bit_depth or color_type in png_get_IHDR(), and
|
|
||||||
check for missing PLTE or IHDR in png_push_read_chunk() (Matthias Clasen).
|
|
||||||
Revised iTXt support to accept NULL for lang and lang_key.
|
|
||||||
Compute gamma for color components of background even when color_type is gray.
|
|
||||||
Revised makefiles to put png.h and pngconf.h only in $prefix/include/libpngNN
|
|
||||||
Revised makefiles to make symlink to libpng.so.NN in addition to libpngNN.so
|
|
||||||
Prevent png_zalloc() from trying to memset memory that it failed to acquire.
|
|
||||||
Add typecasts of PNG_MAX_UINT in pngset_cHRM_fixed() (Matt Holgate).
|
|
||||||
Ensure that the right function (user or default) is used to free the
|
|
||||||
png_struct after an error in png_create_read_struct_2().
|
|
||||||
Save the ebx register in pnggccrd.c (Sami Farin)
|
|
||||||
Add "mem_ptr = png_ptr->mem_ptr" in png_destroy_write_struct() (Paul Gardner).
|
|
||||||
Updated makefiles to put headers in include/libpng and remove old include/*.h.
|
|
||||||
Revised description of png_set_filter() in libpng.3/libpng.txt.
|
|
||||||
Revised makefile.netbsd and added makefile.neNNbsd and makefile.freebsd
|
|
||||||
|
|
||||||
Send comments/corrections/commendations to
|
Send comments/corrections/commendations to
|
||||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||||
|
|||||||
72
CHANGES
72
CHANGES
@@ -1008,7 +1008,6 @@ version 1.2.1rc1 [November 24, 2001]
|
|||||||
Updated various makefiles so "make clean" does not remove previous major
|
Updated various makefiles so "make clean" does not remove previous major
|
||||||
version of the shared library.
|
version of the shared library.
|
||||||
version 1.2.1rc2 [December 4, 2001]
|
version 1.2.1rc2 [December 4, 2001]
|
||||||
Added a pop/push operation to pngvcrd.c, to preserve Eflag.
|
|
||||||
Always allocate 256-entry internal palette, hist, and trans arrays, to
|
Always allocate 256-entry internal palette, hist, and trans arrays, to
|
||||||
avoid out-of-bounds memory reference caused by invalid PNG datastreams.
|
avoid out-of-bounds memory reference caused by invalid PNG datastreams.
|
||||||
Added a check for prefix_length > data_length in iCCP chunk handler.
|
Added a check for prefix_length > data_length in iCCP chunk handler.
|
||||||
@@ -1066,8 +1065,79 @@ version 1.0.13rc1 [April 7, 2002]
|
|||||||
Add "mem_ptr = png_ptr->mem_ptr" in png_destroy_write_struct() (Paul Gardner).
|
Add "mem_ptr = png_ptr->mem_ptr" in png_destroy_write_struct() (Paul Gardner).
|
||||||
Updated makefiles to put headers in include/libpng and remove old include/*.h.
|
Updated makefiles to put headers in include/libpng and remove old include/*.h.
|
||||||
version 1.2.2 [April 15, 2002]
|
version 1.2.2 [April 15, 2002]
|
||||||
|
version 1.0.13 [April 15, 2002]
|
||||||
Revised description of png_set_filter() in libpng.3/libpng.txt.
|
Revised description of png_set_filter() in libpng.3/libpng.txt.
|
||||||
Revised makefile.netbsd and added makefile.neNNbsd and makefile.freebsd
|
Revised makefile.netbsd and added makefile.neNNbsd and makefile.freebsd
|
||||||
|
version 1.0.13patch01 [April 17, 2002]
|
||||||
|
version 1.2.2patch01 [April 17, 2002]
|
||||||
|
Changed ${PNGMAJ}.${PNGVER} bug to ${PNGVER} in makefile.sgi and makefile.sggcc
|
||||||
|
Fixed VER -> PNGVER typo in makefile.macosx and added install-static to install
|
||||||
|
Added install: target to makefile.32sunu and makefile.64sunu
|
||||||
|
version 1.0.13patch03 [April 18, 2002]
|
||||||
|
version 1.2.2patch03 [April 18, 2002]
|
||||||
|
Revised 15 makefiles to link libpng.a to libpngNN.a and the include libpng
|
||||||
|
subdirectory to libpngNN subdirectory without the full pathname.
|
||||||
|
Moved generation of libpng.pc from "install" to "all" in 15 makefiles.
|
||||||
|
version 1.2.3rc1 [April 28, 2002]
|
||||||
|
Added install-man target to 15 makefiles (Dimitri Papadopolous-Orfanos).
|
||||||
|
Added $(DESTDIR) feature to 24 makefiles (Tim Mooney)
|
||||||
|
Fixed bug with $prefix, should be $(prefix) in makefile.hpux.
|
||||||
|
Updated cygwin-specific portion of pngconf.h and revised makefile.cygwin
|
||||||
|
Added a link from libpngNN.pc to libpng.pc in 15 makefiles.
|
||||||
|
Added links from include/libpngNN/*.h to include/*.h in 24 makefiles.
|
||||||
|
Revised makefile.darwin to make relative links without full pathname.
|
||||||
|
Added setjmp() at the end of png_create_*_struct_2() in case user forgets
|
||||||
|
to put one in their application.
|
||||||
|
Restored png_zalloc() and png_zfree() prototypes to version 1.2.1 and
|
||||||
|
removed them from module definition files.
|
||||||
|
version 1.2.3rc2 [May 1, 2002]
|
||||||
|
Fixed bug in reporting number of channels in pngget.c and pngset.c,
|
||||||
|
that was introduced in version 1.2.2beta5.
|
||||||
|
Exported png_zalloc(), png_zfree(), png_default_read(), png_default_write(),
|
||||||
|
png_default_flush(), and png_push_fill_buffer() and included them in
|
||||||
|
module definition files.
|
||||||
|
Added "libpng.pc" dependency to the "install-shared" target in 15 makefiles.
|
||||||
|
version 1.2.3rc3 [May 1, 2002]
|
||||||
|
Revised prototype for png_default_flush()
|
||||||
|
Remove old libpng.pc and libpngNN.pc before installing new ones.
|
||||||
|
version 1.2.3rc4 [May 2, 2002]
|
||||||
|
Typos in *.def files (png_default_read|write -> png_default_read|write_data)
|
||||||
|
In makefiles, changed rm libpng.NN.pc to rm libpngNN.pc
|
||||||
|
Added libpng-config and libpngNN-config and modified makefiles to install them.
|
||||||
|
Changed $(MANPATH) to $(DESTDIR)$(MANPATH) in makefiles
|
||||||
|
Added "Win32 DLL VB" configuration to projects/msvc/libpng.dsp
|
||||||
|
version 1.2.3rc5 [May 11, 2002]
|
||||||
|
Changed "error" and "message" in prototypes to "error_message" and
|
||||||
|
"warning_message" to avoid namespace conflict.
|
||||||
|
Revised 15 makefiles to build libpng-config from libpng-config-*.in
|
||||||
|
Once more restored png_zalloc and png_zfree to regular nonexported form.
|
||||||
|
Restored png_default_read|write_data, png_default_flush, png_read_fill_buffer
|
||||||
|
to nonexported form, but with PNGAPI, and removed them from module def files.
|
||||||
|
version 1.2.3rc6 [May 14, 2002]
|
||||||
|
Removed "PNGAPI" from png_zalloc() and png_zfree() in png.c
|
||||||
|
Changed "Gz" to "Gd" in projects/msvc/libpng.dsp and zlib.dsp.
|
||||||
|
Removed leftover libpng-config "sed" script from four makefiles.
|
||||||
|
Revised libpng-config creating script in 16 makefiles.
|
||||||
|
version 1.2.3 [May 22, 2002]
|
||||||
|
Revised libpng-config target in makefile.cygwin.
|
||||||
|
Removed description of png_set_mem_fn() from documentation.
|
||||||
|
Revised makefile.freebsd.
|
||||||
|
Minor cosmetic changes to 15 makefiles, e.g., $(DI) = $(DESTDIR)/$(INCDIR).
|
||||||
|
Revised projects/msvc/README.txt
|
||||||
|
Changed -lpng to -lpngNN in LDFLAGS in several makefiles.
|
||||||
|
version 1.2.4beta1 [May 24, 2002]
|
||||||
|
Added libpng.pc and libpng-config to "all:" target in 16 makefiles.
|
||||||
|
Fixed bug in 16 makefiles: $(DESTDIR)/$(LIBPATH) to $(DESTDIR)$(LIBPATH)
|
||||||
|
Added missing "\" before closing double quote in makefile.gcmmx.
|
||||||
|
Plugged various memory leaks; added png_malloc_warn() and png_set_text_2()
|
||||||
|
functions.
|
||||||
|
version 1.2.4beta2 [June 20, 2002]
|
||||||
|
Plugged memory leak of png_ptr->current_text (Matt Holgate).
|
||||||
|
Check for buffer overflow before reading CRC in pngpread.c (Warwick Allison)
|
||||||
|
Added -soname to the loader flags in makefile.dec, makefile.sgi, and
|
||||||
|
makefile.sggcc.
|
||||||
|
Added "test-installed" targets to makefile.linux, makefile.gcmmx,
|
||||||
|
makefile.sgi, and makefile.sggcc.
|
||||||
|
|
||||||
Send comments/corrections/commendations to
|
Send comments/corrections/commendations to
|
||||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||||
|
|||||||
41
INSTALL
41
INSTALL
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Installing libpng version 1.2.2 - April 15, 2002
|
Installing libpng version 1.2.4beta2 - June 20, 2002
|
||||||
|
|
||||||
Before installing libpng, you must first install zlib. zlib
|
Before installing libpng, you must first install zlib. zlib
|
||||||
can usually be found wherever you got libpng. zlib can be
|
can usually be found wherever you got libpng. zlib can be
|
||||||
@@ -10,8 +10,8 @@ zlib.h and zconf.h include files that correspond to the
|
|||||||
version of zlib that's installed.
|
version of zlib that's installed.
|
||||||
|
|
||||||
You can rename the directories that you downloaded (they
|
You can rename the directories that you downloaded (they
|
||||||
might be called "libpng-1.2.2" or "lpng109" and "zlib-1.1.3"
|
might be called "libpng-1.2.4beta2" or "lpng109" and "zlib-1.1.4"
|
||||||
or "zlib113") so that you have directories called "zlib" and "libpng".
|
or "zlib114") so that you have directories called "zlib" and "libpng".
|
||||||
|
|
||||||
Your directory structure should look like this:
|
Your directory structure should look like this:
|
||||||
|
|
||||||
@@ -35,6 +35,10 @@ Your directory structure should look like this:
|
|||||||
wince.txt
|
wince.txt
|
||||||
scripts
|
scripts
|
||||||
makefile.*
|
makefile.*
|
||||||
|
libpng*.in
|
||||||
|
mangle
|
||||||
|
makefile.*
|
||||||
|
mangle.in
|
||||||
pngtest.png
|
pngtest.png
|
||||||
etc.
|
etc.
|
||||||
zlib
|
zlib
|
||||||
@@ -64,8 +68,8 @@ The files that are presently available in the scripts directory
|
|||||||
include
|
include
|
||||||
|
|
||||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||||
makefile.linux => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.2)
|
makefile.linux => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.4beta2)
|
||||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.2,
|
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.4beta2,
|
||||||
uses assembler code tuned for Intel MMX platform)
|
uses assembler code tuned for Intel MMX platform)
|
||||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||||
@@ -75,6 +79,7 @@ include
|
|||||||
makefile.cygwin => Cygwin/gcc makefile
|
makefile.cygwin => Cygwin/gcc makefile
|
||||||
makefile.darwin => Darwin makefile
|
makefile.darwin => Darwin makefile
|
||||||
makefile.dec => DEC Alpha UNIX makefile
|
makefile.dec => DEC Alpha UNIX makefile
|
||||||
|
makefile.hpgcc => FreeBSD makefile
|
||||||
makefile.hpgcc => HPUX makefile using gcc
|
makefile.hpgcc => HPUX makefile using gcc
|
||||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||||
@@ -82,13 +87,13 @@ include
|
|||||||
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
|
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
|
||||||
makefile.macosx => MACOS X Makefile
|
makefile.macosx => MACOS X Makefile
|
||||||
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so.
|
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so.
|
||||||
makefile.ne12bsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng0.so
|
makefile.ne0bsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng0.so
|
||||||
makefile.openbsd => OpenBSD makefile
|
makefile.openbsd => OpenBSD makefile
|
||||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng12.so.0.1.2.2)
|
makefile.sggcc => Silicon Graphics (gcc, creates libpng12.so.0.1.2.4beta2)
|
||||||
makefile.sunos => Sun makefile
|
makefile.sunos => Sun makefile
|
||||||
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng12.so.0.1.2.2)
|
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng12.so.0.1.2.4beta2)
|
||||||
makefile.so9 => Solaris 9 makefile (gcc, creates libpng12.so.0.1.2.2)
|
makefile.so9 => Solaris 9 makefile (gcc, creates libpng12.so.0.1.2.4beta2)
|
||||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||||
@@ -141,6 +146,24 @@ your output with the result shown in contrib/pngsuite/README.
|
|||||||
Most of the makefiles will allow you to run "make install" to
|
Most of the makefiles will allow you to run "make install" to
|
||||||
put the library in its final resting place (if you want to
|
put the library in its final resting place (if you want to
|
||||||
do that, run "make install" in the zlib directory first if necessary).
|
do that, run "make install" in the zlib directory first if necessary).
|
||||||
|
Some also allow you to run "make test-installed" after you have
|
||||||
|
run "make install". This will build and run executables called "pngtesti"
|
||||||
|
and "mangle/pngtestm".
|
||||||
|
|
||||||
|
The files that are presently available in the mangle directory include the
|
||||||
|
following. The makefiles are automatically run by the corresponding makefiles
|
||||||
|
in the scripts directory when you run "make", "make install", or
|
||||||
|
"make test-installed".
|
||||||
|
|
||||||
|
mangle.in => Function-decoration macros added to png.h by the
|
||||||
|
makefiles.
|
||||||
|
makefile.linux => Linux/ELF makefile
|
||||||
|
(gcc, creates libpng12m.so.0.1.2.4beta2)
|
||||||
|
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
||||||
|
libpng12.so.0m.1.2.4beta2, uses assembler code
|
||||||
|
tuned for Intel MMX platform)
|
||||||
|
makefile.sgi => Silicon Graphics (cc, creates libpng12m.so)
|
||||||
|
makefile.sggcc => Silicon Graphics (gcc, creates libpng12m.so)
|
||||||
|
|
||||||
Further information can be found in the README and libpng.txt
|
Further information can be found in the README and libpng.txt
|
||||||
files, in the individual makefiles, in png.h, in the README files in
|
files, in the individual makefiles, in png.h, in the README files in
|
||||||
|
|||||||
15
KNOWNBUG
15
KNOWNBUG
@@ -1,9 +1,18 @@
|
|||||||
|
|
||||||
Known bugs in libpng version 1.2.2
|
Known bugs in libpng version 1.2.4beta2
|
||||||
|
|
||||||
1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
|
1. May 28, 2002: Makefile.so9 has bugs. The last line under the
|
||||||
|
install-headers target should be
|
||||||
|
|
||||||
|
(cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
|
||||||
|
|
||||||
|
and the last line under the install-static target should be
|
||||||
|
|
||||||
|
|
||||||
|
2. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
|
||||||
reading interlaced PNG files, when assembler code is enabled.
|
reading interlaced PNG files, when assembler code is enabled.
|
||||||
|
|
||||||
STATUS: Under investigation. The change to pnggccrd.c in libpng-1.2.1
|
STATUS: Under investigation. The change to pnggccrd.c in libpng-1.2.1
|
||||||
fixed a problem under FreeBSD but not the problem with NetBSD.
|
fixed a problem under FreeBSD but not the problem with NetBSD, which
|
||||||
|
still fails as of libpng-1.2.2rc1.
|
||||||
|
|
||||||
|
|||||||
4
LICENSE
4
LICENSE
@@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
|||||||
If you modify libpng you may insert additional notices immediately following
|
If you modify libpng you may insert additional notices immediately following
|
||||||
this sentence.
|
this sentence.
|
||||||
|
|
||||||
libpng versions 1.0.7, July 1, 2000, through 1.2.2, April 15, 2002, are
|
libpng versions 1.0.7, July 1, 2000, through 1.2.4beta2, June 20, 2002, are
|
||||||
Copyright (c) 2000-2002 Glenn Randers-Pehrson
|
Copyright (c) 2000-2002 Glenn Randers-Pehrson
|
||||||
and are distributed according to the same disclaimer and license as libpng-1.0.6
|
and are distributed according to the same disclaimer and license as libpng-1.0.6
|
||||||
with the following individuals added to the list of Contributing Authors
|
with the following individuals added to the list of Contributing Authors
|
||||||
@@ -99,4 +99,4 @@ certification mark of the Open Source Initiative.
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
randeg@alum.rpi.edu
|
randeg@alum.rpi.edu
|
||||||
April 15, 2002
|
June 20, 2002
|
||||||
|
|||||||
25
README
25
README
@@ -1,4 +1,4 @@
|
|||||||
README for libpng 1.2.2 - April 15, 2002 (shared library 2.1)
|
README for libpng 1.2.4beta2 - June 20, 2002 (shared library 12.0)
|
||||||
See the note about version numbers near the top of png.h
|
See the note about version numbers near the top of png.h
|
||||||
|
|
||||||
See INSTALL for instructions on how to install libpng.
|
See INSTALL for instructions on how to install libpng.
|
||||||
@@ -187,9 +187,9 @@ Files in this distribution:
|
|||||||
descrip.mms => VMS makefile for MMS or MMK
|
descrip.mms => VMS makefile for MMS or MMK
|
||||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||||
makefile.linux => Linux/ELF makefile
|
makefile.linux => Linux/ELF makefile
|
||||||
(gcc, creates libpng12.so.0.1.2.2)
|
(gcc, creates libpng12.so.0.1.2.4beta2)
|
||||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
||||||
libpng12.so.0.1.2.2, uses assembler code
|
libpng12.so.0.1.2.4beta2, uses assembler code
|
||||||
tuned for Intel MMX platform)
|
tuned for Intel MMX platform)
|
||||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||||
@@ -199,6 +199,7 @@ Files in this distribution:
|
|||||||
makefile.cygwin => Cygwin/gcc makefile
|
makefile.cygwin => Cygwin/gcc makefile
|
||||||
makefile.darwin => Darwin makefile
|
makefile.darwin => Darwin makefile
|
||||||
makefile.dec => DEC Alpha UNIX makefile
|
makefile.dec => DEC Alpha UNIX makefile
|
||||||
|
makefile.freebsd => FreeBSD makefile
|
||||||
makefile.hpgcc => HPUX makefile using gcc
|
makefile.hpgcc => HPUX makefile using gcc
|
||||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||||
@@ -206,15 +207,15 @@ Files in this distribution:
|
|||||||
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
||||||
makefile.macosx => MACOS X Makefile
|
makefile.macosx => MACOS X Makefile
|
||||||
makefile.netbsd => NetBSD/cc makefile, PNGGCCRD, makes libpng.so.
|
makefile.netbsd => NetBSD/cc makefile, PNGGCCRD, makes libpng.so.
|
||||||
makefile.ne12bsd => NetBSD/cc makefile, PNGGCCRD, makes libpng0.so
|
makefile.ne0bsd => NetBSD/cc makefile, PNGGCCRD, makes libpng0.so
|
||||||
makefile.openbsd => OpenBSD makefile
|
makefile.openbsd => OpenBSD makefile
|
||||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng12.so.0.1.2.2)
|
makefile.sggcc => Silicon Graphics (gcc, creates libpng12.so.0.1.2.4beta2)
|
||||||
makefile.sunos => Sun makefile
|
makefile.sunos => Sun makefile
|
||||||
makefile.solaris => Solaris 2.X makefile
|
makefile.solaris => Solaris 2.X makefile
|
||||||
(gcc, creates libpng12.so.0.1.2.2)
|
(gcc, creates libpng12.so.0.1.2.4beta2)
|
||||||
makefile.so9 => Solaris 9 makefile
|
makefile.so9 => Solaris 9 makefile
|
||||||
(gcc, creates libpng12.so.0.1.2.2)
|
(gcc, creates libpng12.so.0.1.2.4beta2)
|
||||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||||
@@ -243,6 +244,16 @@ Files in this distribution:
|
|||||||
makevms.com => VMS build script
|
makevms.com => VMS build script
|
||||||
pngdef.pas => Defines for a png32bd.dll with Borland C++ 4.5
|
pngdef.pas => Defines for a png32bd.dll with Borland C++ 4.5
|
||||||
SCOPTIONS.ppc => Used with smakefile.ppc
|
SCOPTIONS.ppc => Used with smakefile.ppc
|
||||||
|
mangle => Directory containing scripts to build libpng12m.so:
|
||||||
|
mangle.in => Function-decoration macros added to png.h by the
|
||||||
|
makefiles.
|
||||||
|
makefile.linux => Linux/ELF makefile
|
||||||
|
(gcc, creates libpng12m.so.0.1.2.4beta2)
|
||||||
|
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
||||||
|
libpng12.so.0m.1.2.4beta2, uses assembler code
|
||||||
|
tuned for Intel MMX platform)
|
||||||
|
makefile.sgi => Silicon Graphics (cc, creates libpng12m.so)
|
||||||
|
makefile.sggcc => Silicon Graphics (gcc, creates libpng12m.so)
|
||||||
|
|
||||||
Good luck, and happy coding.
|
Good luck, and happy coding.
|
||||||
|
|
||||||
|
|||||||
4
Y2KINFO
4
Y2KINFO
@@ -1,13 +1,13 @@
|
|||||||
Y2K compliance in libpng:
|
Y2K compliance in libpng:
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
April 15, 2002
|
June 20, 2002
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.2.2 are Y2K compliant. It is my belief that earlier
|
upward through 1.2.4beta2 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has three year fields. One is a 2-byte unsigned integer
|
Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||||
|
|||||||
2
configure
vendored
2
configure
vendored
@@ -1,5 +1,5 @@
|
|||||||
echo "
|
echo "
|
||||||
There is no \"configure\" script for Libpng-1.2.2. Instead, please
|
There is no \"configure\" script for Libpng-1.2.4beta2. Instead, please
|
||||||
copy the appropriate makefile for your system from the \"scripts\"
|
copy the appropriate makefile for your system from the \"scripts\"
|
||||||
directory. Read the INSTALL file for more details.
|
directory. Read the INSTALL file for more details.
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll\libpng12.lib /nologo /subsystem:console /machine:I386
|
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll\libpng13.lib /nologo /subsystem:console /machine:I386
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\dll
|
OutDir=.\dll
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
@@ -84,7 +84,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbg\libpng12d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbg\libpng13d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\dll_dbg
|
OutDir=.\dll_dbg
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
@@ -114,7 +114,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_asm\libpng12a.lib /nologo /subsystem:console /machine:I386
|
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_asm\libpng13a.lib /nologo /subsystem:console /machine:I386
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\dll_asm
|
OutDir=.\dll_asm
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
@@ -144,7 +144,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbga\libpng12b.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD LINK32 ..\..\projects\msvc\win32\libpng\dll_dbga\libpng13b.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\dll_dbga
|
OutDir=.\dll_dbga
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
|
|
||||||
pngsuite
|
|
||||||
--------
|
|
||||||
(c) Willem van Schaik, 1999
|
|
||||||
|
|
||||||
Permission to use, copy, and distribute these images for any purpose and
|
|
||||||
without fee is hereby granted.
|
|
||||||
|
|
||||||
These 15 images are part of the much larger PngSuite test-set of
|
|
||||||
images, available for developers of PNG supporting software. The
|
|
||||||
complete set, available at http:/www.schaik.com/pngsuite/, contains
|
|
||||||
a variety of images to test interlacing, gamma settings, ancillary
|
|
||||||
chunks, etc.
|
|
||||||
|
|
||||||
The images in this directory represent the basic PNG color-types:
|
|
||||||
grayscale (1-16 bit deep), full color (8 or 16 bit), paletted
|
|
||||||
(1-8 bit) and grayscale or color images with alpha channel. You
|
|
||||||
can use them to test the proper functioning of PNG software.
|
|
||||||
|
|
||||||
filename depth type
|
|
||||||
------------ ------ --------------
|
|
||||||
basn0g01.png 1-bit grayscale
|
|
||||||
basn0g02.png 2-bit grayscale
|
|
||||||
basn0g04.png 4-bit grayscale
|
|
||||||
basn0g08.png 8-bit grayscale
|
|
||||||
basn0g16.png 16-bit grayscale
|
|
||||||
basn2c08.png 8-bit truecolor
|
|
||||||
basn2c16.png 16-bit truecolor
|
|
||||||
basn3p01.png 1-bit paletted
|
|
||||||
basn3p02.png 2-bit paletted
|
|
||||||
basn3p04.png 4-bit paletted
|
|
||||||
basn3p08.png 8-bit paletted
|
|
||||||
basn4a08.png 8-bit gray with alpha
|
|
||||||
basn4a16.png 16-bit gray with alpha
|
|
||||||
basn6a08.png 8-bit RGBA
|
|
||||||
basn6a16.png 16-bit RGBA
|
|
||||||
|
|
||||||
Here is the correct result of typing "pngtest -m *.png" in
|
|
||||||
this directory:
|
|
||||||
|
|
||||||
Testing basn0g01.png: PASS (524 zero samples)
|
|
||||||
Filter 0 was used 32 times
|
|
||||||
Testing basn0g02.png: PASS (448 zero samples)
|
|
||||||
Filter 0 was used 32 times
|
|
||||||
Testing basn0g04.png: PASS (520 zero samples)
|
|
||||||
Filter 0 was used 32 times
|
|
||||||
Testing basn0g08.png: PASS (3 zero samples)
|
|
||||||
Filter 1 was used 9 times
|
|
||||||
Filter 4 was used 23 times
|
|
||||||
Testing basn0g16.png: PASS (1 zero samples)
|
|
||||||
Filter 1 was used 1 times
|
|
||||||
Filter 2 was used 31 times
|
|
||||||
Testing basn2c08.png: PASS (6 zero samples)
|
|
||||||
Filter 1 was used 5 times
|
|
||||||
Filter 4 was used 27 times
|
|
||||||
Testing basn2c16.png: PASS (592 zero samples)
|
|
||||||
Filter 1 was used 1 times
|
|
||||||
Filter 4 was used 31 times
|
|
||||||
Testing basn3p01.png: PASS (512 zero samples)
|
|
||||||
Filter 0 was used 32 times
|
|
||||||
Testing basn3p02.png: PASS (448 zero samples)
|
|
||||||
Filter 0 was used 32 times
|
|
||||||
Testing basn3p04.png: PASS (544 zero samples)
|
|
||||||
Filter 0 was used 32 times
|
|
||||||
Testing basn3p08.png: PASS (4 zero samples)
|
|
||||||
Filter 0 was used 32 times
|
|
||||||
Testing basn4a08.png: PASS (32 zero samples)
|
|
||||||
Filter 1 was used 1 times
|
|
||||||
Filter 4 was used 31 times
|
|
||||||
Testing basn4a16.png: PASS (64 zero samples)
|
|
||||||
Filter 0 was used 1 times
|
|
||||||
Filter 1 was used 2 times
|
|
||||||
Filter 2 was used 1 times
|
|
||||||
Filter 4 was used 28 times
|
|
||||||
Testing basn6a08.png: PASS (160 zero samples)
|
|
||||||
Filter 1 was used 1 times
|
|
||||||
Filter 4 was used 31 times
|
|
||||||
Testing basn6a16.png: PASS (1072 zero samples)
|
|
||||||
Filter 1 was used 4 times
|
|
||||||
Filter 4 was used 28 times
|
|
||||||
libpng passes test
|
|
||||||
|
|
||||||
Willem van Schaik
|
|
||||||
<willem@schaik.com>
|
|
||||||
October 1999
|
|
||||||
@@ -59,8 +59,8 @@ BSC32=bscmake.exe
|
|||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 libpng12.lib zlibd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"libpng" /libpath:"zlib"
|
# ADD BASE LINK32 libpng13.lib zlibd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"libpng" /libpath:"zlib"
|
||||||
# ADD LINK32 libpng12.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\dll"
|
# ADD LINK32 libpng13.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\dll"
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\dll
|
OutDir=.\dll
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
@@ -92,9 +92,9 @@ BSC32=bscmake.exe
|
|||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 libpng12.lib zlibd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"libpng" /libpath:"zlib"
|
# ADD BASE LINK32 libpng13.lib zlibd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"libpng" /libpath:"zlib"
|
||||||
# SUBTRACT BASE LINK32 /nodefaultlib
|
# SUBTRACT BASE LINK32 /nodefaultlib
|
||||||
# ADD LINK32 libpng12d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\dll_dbg"
|
# ADD LINK32 libpng13d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\dll_dbg"
|
||||||
# SUBTRACT LINK32 /nodefaultlib
|
# SUBTRACT LINK32 /nodefaultlib
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\dll_dbg
|
OutDir=.\dll_dbg
|
||||||
@@ -128,7 +128,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 libpng12.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\dll"
|
# ADD BASE LINK32 libpng13.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\dll"
|
||||||
# ADD LINK32 libpng.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\lib"
|
# ADD LINK32 libpng.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\projects\msvc\win32\libpng\lib"
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\lib
|
OutDir=.\lib
|
||||||
@@ -161,7 +161,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 libpng12d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\dll_dbg"
|
# ADD BASE LINK32 libpng13d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\dll_dbg"
|
||||||
# SUBTRACT BASE LINK32 /nodefaultlib
|
# SUBTRACT BASE LINK32 /nodefaultlib
|
||||||
# ADD LINK32 libpng.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\lib_dbg"
|
# ADD LINK32 libpng.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /pdbtype:sept /libpath:"..\..\projects\msvc\win32\libpng\lib_dbg"
|
||||||
# SUBTRACT LINK32 /nodefaultlib
|
# SUBTRACT LINK32 /nodefaultlib
|
||||||
|
|||||||
10
example.c
10
example.c
@@ -169,11 +169,11 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
|||||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
||||||
&interlace_type, int_p_NULL, int_p_NULL);
|
&interlace_type, int_p_NULL, int_p_NULL);
|
||||||
|
|
||||||
/**** Set up the data transformations you want. Note that these are all
|
/* Set up the data transformations you want. Note that these are all
|
||||||
**** optional. Only call them if you want/need them. Many of the
|
* optional. Only call them if you want/need them. Many of the
|
||||||
**** transformations only work on specific types of images, and many
|
* transformations only work on specific types of images, and many
|
||||||
**** are mutually exclusive.
|
* are mutually exclusive.
|
||||||
****/
|
*/
|
||||||
|
|
||||||
/* tell libpng to strip 16 bit/color files down to 8 bits/color */
|
/* tell libpng to strip 16 bit/color files down to 8 bits/color */
|
||||||
png_set_strip_16(png_ptr);
|
png_set_strip_16(png_ptr);
|
||||||
|
|||||||
46
libpng.3
46
libpng.3
@@ -1,6 +1,6 @@
|
|||||||
.TH LIBPNG 3 "April 15, 2002"
|
.TH LIBPNG 3 "June 20, 2002"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.4beta2
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
@@ -342,6 +342,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2
|
|||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
|
\fBpng_voidp png_malloc_warn (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoidp png_memcpy (png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_size_t \fIsize\fP\fB);\fP
|
\fBvoidp png_memcpy (png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_size_t \fIsize\fP\fB);\fP
|
||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
@@ -776,14 +780,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2
|
|||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
|
|
||||||
|
|
||||||
\fI\fB
|
|
||||||
|
|
||||||
\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
|
|
||||||
|
|
||||||
\fI\fB
|
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The
|
The
|
||||||
.I libpng
|
.I libpng
|
||||||
@@ -795,7 +791,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
|||||||
.SH LIBPNG.TXT
|
.SH LIBPNG.TXT
|
||||||
libpng.txt - A description on how to use and modify libpng
|
libpng.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.2.2 - April 15, 2002
|
libpng version 1.2.4beta2 - June 20, 2002
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<randeg@alum.rpi.edu>
|
<randeg@alum.rpi.edu>
|
||||||
Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
@@ -3096,18 +3092,17 @@ goes through callbacks that are user-settable. The default routines are
|
|||||||
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
||||||
these functions, call the appropriate png_set_*_fn() function.
|
these functions, call the appropriate png_set_*_fn() function.
|
||||||
|
|
||||||
Memory allocation is done through the functions png_malloc(), png_zalloc(),
|
Memory allocation is done through the functions png_malloc()
|
||||||
and png_free(). These currently just call the standard C functions. If
|
and png_free(). These currently just call the standard C functions. If
|
||||||
your pointers can't access more then 64K at a time, you will want to set
|
your pointers can't access more then 64K at a time, you will want to set
|
||||||
MAXSEG_64K in zlib.h. Since it is unlikely that the method of handling
|
MAXSEG_64K in zlib.h. Since it is unlikely that the method of handling
|
||||||
memory allocation on a platform will change between applications, these
|
memory allocation on a platform will change between applications, these
|
||||||
functions must be modified in the library at compile time. If you prefer
|
functions must be modified in the library at compile time. If you prefer
|
||||||
to use a different method of allocating and freeing data, you can use
|
to use a different method of allocating and freeing data, you can use
|
||||||
|
png_create_read_struct_2() or png_create_write_struct_2() to register
|
||||||
|
your own functions as described above.
|
||||||
|
|
||||||
png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr,
|
These functions also provide a void pointer that can be retrieved via
|
||||||
png_malloc_ptr malloc_fn, png_free_ptr free_fn)
|
|
||||||
|
|
||||||
This function also provides a void pointer that can be retrieved via
|
|
||||||
|
|
||||||
mem_ptr=png_get_mem_ptr(png_ptr);
|
mem_ptr=png_get_mem_ptr(png_ptr);
|
||||||
|
|
||||||
@@ -3117,7 +3112,7 @@ Your replacement memory functions must have prototypes as follows:
|
|||||||
png_size_t size);
|
png_size_t size);
|
||||||
void free_fn(png_structp png_ptr, png_voidp ptr);
|
void free_fn(png_structp png_ptr, png_voidp ptr);
|
||||||
|
|
||||||
Your malloc_fn() can return NULL in case of failure. The png_malloc()
|
Your malloc_fn() should return NULL in case of failure. The png_malloc()
|
||||||
function will call png_error() if it receives a NULL from the system
|
function will call png_error() if it receives a NULL from the system
|
||||||
memory allocator or from your replacement malloc_fn().
|
memory allocator or from your replacement malloc_fn().
|
||||||
|
|
||||||
@@ -3143,9 +3138,9 @@ png_get_io_ptr(). For example:
|
|||||||
The replacement I/O functions must have prototypes as follows:
|
The replacement I/O functions must have prototypes as follows:
|
||||||
|
|
||||||
void user_read_data(png_structp png_ptr,
|
void user_read_data(png_structp png_ptr,
|
||||||
png_bytep data, png_uint_32 length);
|
png_bytep data, png_size_t length);
|
||||||
void user_write_data(png_structp png_ptr,
|
void user_write_data(png_structp png_ptr,
|
||||||
png_bytep data, png_uint_32 length);
|
png_bytep data, png_size_t length);
|
||||||
void user_flush_data(png_structp png_ptr);
|
void user_flush_data(png_structp png_ptr);
|
||||||
|
|
||||||
Supplying NULL for the read, write, or flush functions sets them back
|
Supplying NULL for the read, write, or flush functions sets them back
|
||||||
@@ -3646,13 +3641,13 @@ application:
|
|||||||
|
|
||||||
.SH IX. Y2K Compliance in libpng
|
.SH IX. Y2K Compliance in libpng
|
||||||
|
|
||||||
April 15, 2002
|
June 20, 2002
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.2.2 are Y2K compliant. It is my belief that earlier
|
upward through 1.2.4beta2 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||||
@@ -3781,6 +3776,9 @@ the first widely used release:
|
|||||||
1.2.2rc1 12 10202 12.so.0.1.2.2rc1
|
1.2.2rc1 12 10202 12.so.0.1.2.2rc1
|
||||||
1.0.13 10 10013 10.so.0.1.0.13
|
1.0.13 10 10013 10.so.0.1.0.13
|
||||||
1.2.2 12 10202 12.so.0.1.2.2
|
1.2.2 12 10202 12.so.0.1.2.2
|
||||||
|
1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6
|
||||||
|
1.2.3 12 10203 12.so.0.1.2.3
|
||||||
|
1.2.4beta1-2 13 10204 12.so.0.1.2.4beta1-2
|
||||||
|
|
||||||
Henceforth the source version will match the shared-library minor
|
Henceforth the source version will match the shared-library minor
|
||||||
and patch numbers; the shared-library major version number will be
|
and patch numbers; the shared-library major version number will be
|
||||||
@@ -3838,7 +3836,7 @@ possible without all of you.
|
|||||||
|
|
||||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||||
|
|
||||||
Libpng version 1.2.2 - April 15, 2002:
|
Libpng version 1.2.4beta2 - June 20, 2002:
|
||||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||||
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
|
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
|
||||||
|
|
||||||
@@ -3855,7 +3853,7 @@ included in the libpng distribution, the latter shall prevail.)
|
|||||||
If you modify libpng you may insert additional notices immediately following
|
If you modify libpng you may insert additional notices immediately following
|
||||||
this sentence.
|
this sentence.
|
||||||
|
|
||||||
libpng versions 1.0.7, July 1, 2000, through 1.2.2, April 15, 2002, are
|
libpng versions 1.0.7, July 1, 2000, through 1.2.4beta2, June 20, 2002, are
|
||||||
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
|
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
|
||||||
distributed according to the same disclaimer and license as libpng-1.0.6
|
distributed according to the same disclaimer and license as libpng-1.0.6
|
||||||
with the following individuals added to the list of Contributing Authors
|
with the following individuals added to the list of Contributing Authors
|
||||||
@@ -3947,7 +3945,7 @@ certification mark of the Open Source Initiative.
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
randeg@alum.rpi.edu
|
randeg@alum.rpi.edu
|
||||||
April 15, 2002
|
June 20, 2002
|
||||||
|
|
||||||
.\" end of man page
|
.\" end of man page
|
||||||
|
|
||||||
|
|||||||
21
libpng.txt
21
libpng.txt
@@ -1,6 +1,6 @@
|
|||||||
libpng.txt - A description on how to use and modify libpng
|
libpng.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.2.2 - April 15, 2002
|
libpng version 1.2.4beta2 - June 20, 2002
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<randeg@alum.rpi.edu>
|
<randeg@alum.rpi.edu>
|
||||||
Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
@@ -2301,18 +2301,17 @@ goes through callbacks that are user-settable. The default routines are
|
|||||||
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
||||||
these functions, call the appropriate png_set_*_fn() function.
|
these functions, call the appropriate png_set_*_fn() function.
|
||||||
|
|
||||||
Memory allocation is done through the functions png_malloc(), png_zalloc(),
|
Memory allocation is done through the functions png_malloc()
|
||||||
and png_free(). These currently just call the standard C functions. If
|
and png_free(). These currently just call the standard C functions. If
|
||||||
your pointers can't access more then 64K at a time, you will want to set
|
your pointers can't access more then 64K at a time, you will want to set
|
||||||
MAXSEG_64K in zlib.h. Since it is unlikely that the method of handling
|
MAXSEG_64K in zlib.h. Since it is unlikely that the method of handling
|
||||||
memory allocation on a platform will change between applications, these
|
memory allocation on a platform will change between applications, these
|
||||||
functions must be modified in the library at compile time. If you prefer
|
functions must be modified in the library at compile time. If you prefer
|
||||||
to use a different method of allocating and freeing data, you can use
|
to use a different method of allocating and freeing data, you can use
|
||||||
|
png_create_read_struct_2() or png_create_write_struct_2() to register
|
||||||
|
your own functions as described above.
|
||||||
|
|
||||||
png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr,
|
These functions also provide a void pointer that can be retrieved via
|
||||||
png_malloc_ptr malloc_fn, png_free_ptr free_fn)
|
|
||||||
|
|
||||||
This function also provides a void pointer that can be retrieved via
|
|
||||||
|
|
||||||
mem_ptr=png_get_mem_ptr(png_ptr);
|
mem_ptr=png_get_mem_ptr(png_ptr);
|
||||||
|
|
||||||
@@ -2322,7 +2321,7 @@ Your replacement memory functions must have prototypes as follows:
|
|||||||
png_size_t size);
|
png_size_t size);
|
||||||
void free_fn(png_structp png_ptr, png_voidp ptr);
|
void free_fn(png_structp png_ptr, png_voidp ptr);
|
||||||
|
|
||||||
Your malloc_fn() can return NULL in case of failure. The png_malloc()
|
Your malloc_fn() should return NULL in case of failure. The png_malloc()
|
||||||
function will call png_error() if it receives a NULL from the system
|
function will call png_error() if it receives a NULL from the system
|
||||||
memory allocator or from your replacement malloc_fn().
|
memory allocator or from your replacement malloc_fn().
|
||||||
|
|
||||||
@@ -2348,9 +2347,9 @@ png_get_io_ptr(). For example:
|
|||||||
The replacement I/O functions must have prototypes as follows:
|
The replacement I/O functions must have prototypes as follows:
|
||||||
|
|
||||||
void user_read_data(png_structp png_ptr,
|
void user_read_data(png_structp png_ptr,
|
||||||
png_bytep data, png_uint_32 length);
|
png_bytep data, png_size_t length);
|
||||||
void user_write_data(png_structp png_ptr,
|
void user_write_data(png_structp png_ptr,
|
||||||
png_bytep data, png_uint_32 length);
|
png_bytep data, png_size_t length);
|
||||||
void user_flush_data(png_structp png_ptr);
|
void user_flush_data(png_structp png_ptr);
|
||||||
|
|
||||||
Supplying NULL for the read, write, or flush functions sets them back
|
Supplying NULL for the read, write, or flush functions sets them back
|
||||||
@@ -2851,13 +2850,13 @@ application:
|
|||||||
|
|
||||||
IX. Y2K Compliance in libpng
|
IX. Y2K Compliance in libpng
|
||||||
|
|
||||||
April 15, 2002
|
June 20, 2002
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.2.2 are Y2K compliant. It is my belief that earlier
|
upward through 1.2.4beta2 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||||
|
|||||||
14
libpngpf.3
14
libpngpf.3
@@ -1,6 +1,6 @@
|
|||||||
.TH LIBPNGPF 3 "April 15, 2002"
|
.TH LIBPNGPF 3 "June 20, 2002"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.4beta2
|
||||||
(private functions)
|
(private functions)
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fB#include <png.h>\fP
|
\fB#include <png.h>\fP
|
||||||
@@ -411,7 +411,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2
|
|||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIvalues\fP\fB, int \fIcolor_type\fP\fB);\fP
|
\fBint png_set_text_2 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text)\fP\fB);\fP
|
||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
@@ -531,6 +531,14 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2
|
|||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
|
\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The functions listed above are used privately by libpng
|
The functions listed above are used privately by libpng
|
||||||
and are not recommended for use by applications. They are
|
and are not recommended for use by applications. They are
|
||||||
|
|||||||
4
png.5
4
png.5
@@ -1,4 +1,4 @@
|
|||||||
.TH PNG 5 "April 15, 2002"
|
.TH PNG 5 "June 20, 2002"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
png \- Portable Network Graphics (PNG) format
|
png \- Portable Network Graphics (PNG) format
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
@@ -53,7 +53,7 @@ Thomas Boutell and others (png-list@ccrc.wustl.edu).
|
|||||||
The PNG-1.2 specification is copyright (c) 1999 Glenn Randers-Pehrson.
|
The PNG-1.2 specification is copyright (c) 1999 Glenn Randers-Pehrson.
|
||||||
See the specification for conditions of use and distribution.
|
See the specification for conditions of use and distribution.
|
||||||
.LP
|
.LP
|
||||||
The PNG-1.0 specification is copyright (c) 1996 Massachussets Institute of
|
The PNG-1.0 specification is copyright (c) 1996 Massachusetts Institute of
|
||||||
Technology. See the specification for conditions of use and distribution.
|
Technology. See the specification for conditions of use and distribution.
|
||||||
.LP
|
.LP
|
||||||
.\" end of man page
|
.\" end of man page
|
||||||
|
|||||||
18
png.c
18
png.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* png.c - location for general purpose libpng functions
|
/* png.c - location for general purpose libpng functions
|
||||||
*
|
*
|
||||||
* libpng version 1.2.2 - April 15, 2002
|
* libpng version 1.2.4beta2 - June 20, 2002
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@@ -13,14 +13,14 @@
|
|||||||
#include "png.h"
|
#include "png.h"
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef version_1_2_2 Your_png_h_is_not_version_1_2_2;
|
typedef version_1_2_4beta2 Your_png_h_is_not_version_1_2_4beta2;
|
||||||
|
|
||||||
/* Version information for C files. This had better match the version
|
/* Version information for C files. This had better match the version
|
||||||
* string defined in png.h. */
|
* string defined in png.h. */
|
||||||
|
|
||||||
#ifdef PNG_USE_GLOBAL_ARRAYS
|
#ifdef PNG_USE_GLOBAL_ARRAYS
|
||||||
/* png_libpng_ver was changed to a function in version 1.0.5c */
|
/* png_libpng_ver was changed to a function in version 1.0.5c */
|
||||||
const char png_libpng_ver[18] = "1.2.2";
|
const char png_libpng_ver[18] = "1.2.4beta2";
|
||||||
|
|
||||||
/* png_sig was changed to a function in version 1.0.5c */
|
/* png_sig was changed to a function in version 1.0.5c */
|
||||||
/* Place to hold the signature string for a PNG file. */
|
/* Place to hold the signature string for a PNG file. */
|
||||||
@@ -135,7 +135,7 @@ png_check_sig(png_bytep sig, int num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Function to allocate memory for zlib and clear it to 0. */
|
/* Function to allocate memory for zlib and clear it to 0. */
|
||||||
voidpf PNGAPI
|
voidpf /* private */
|
||||||
png_zalloc(voidpf png_ptr, uInt items, uInt size)
|
png_zalloc(voidpf png_ptr, uInt items, uInt size)
|
||||||
{
|
{
|
||||||
png_uint_32 num_bytes = (png_uint_32)items * size;
|
png_uint_32 num_bytes = (png_uint_32)items * size;
|
||||||
@@ -166,7 +166,7 @@ png_zalloc(voidpf png_ptr, uInt items, uInt size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* function to free memory for zlib */
|
/* function to free memory for zlib */
|
||||||
void PNGAPI
|
void /* private */
|
||||||
png_zfree(voidpf png_ptr, voidpf ptr)
|
png_zfree(voidpf png_ptr, voidpf ptr)
|
||||||
{
|
{
|
||||||
png_free((png_structp)png_ptr, (png_voidp)ptr);
|
png_free((png_structp)png_ptr, (png_voidp)ptr);
|
||||||
@@ -663,7 +663,7 @@ png_charp PNGAPI
|
|||||||
png_get_copyright(png_structp png_ptr)
|
png_get_copyright(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */
|
if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */
|
||||||
return ((png_charp) "\n libpng version 1.2.2 - April 15, 2002\n\
|
return ((png_charp) "\n libpng version 1.2.4beta2 - June 20, 2002\n\
|
||||||
Copyright (c) 1998-2002 Glenn Randers-Pehrson\n\
|
Copyright (c) 1998-2002 Glenn Randers-Pehrson\n\
|
||||||
Copyright (c) 1996-1997 Andreas Dilger\n\
|
Copyright (c) 1996-1997 Andreas Dilger\n\
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
||||||
@@ -681,8 +681,8 @@ png_get_libpng_ver(png_structp png_ptr)
|
|||||||
{
|
{
|
||||||
/* Version of *.c files used when building libpng */
|
/* Version of *.c files used when building libpng */
|
||||||
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
|
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
|
||||||
return((png_charp) "1.2.2");
|
return((png_charp) "1.2.4beta2");
|
||||||
return((png_charp) "1.2.2");
|
return((png_charp) "1.2.4beta2");
|
||||||
}
|
}
|
||||||
|
|
||||||
png_charp PNGAPI
|
png_charp PNGAPI
|
||||||
@@ -732,7 +732,7 @@ png_uint_32 PNGAPI
|
|||||||
png_access_version_number(void)
|
png_access_version_number(void)
|
||||||
{
|
{
|
||||||
/* Version of *.c files used when building libpng */
|
/* Version of *.c files used when building libpng */
|
||||||
return((png_uint_32) 10202L);
|
return((png_uint_32) 10204L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
115
png.h
115
png.h
@@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* png.h - header file for PNG reference library
|
||||||
*
|
*
|
||||||
* libpng version 1.2.2 - April 15, 2002
|
* libpng version 1.2.4beta2 - June 20, 2002
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@@ -9,7 +8,7 @@
|
|||||||
* Authors and maintainers:
|
* Authors and maintainers:
|
||||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
* 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.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||||
* libpng versions 0.97, January 1998, through 1.2.2 - April 15, 2002: Glenn
|
* libpng versions 0.97, January 1998, through 1.2.4beta2 - June 20, 2002: Glenn
|
||||||
* See also "Contributing Authors", below.
|
* See also "Contributing Authors", below.
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
@@ -87,6 +86,9 @@
|
|||||||
* 1.2.2rc1 12 10202 12.so.0.1.2.2rc1
|
* 1.2.2rc1 12 10202 12.so.0.1.2.2rc1
|
||||||
* 1.0.13 10 10013 10.so.0.1.0.13
|
* 1.0.13 10 10013 10.so.0.1.0.13
|
||||||
* 1.2.2 12 10202 12.so.0.1.2.2
|
* 1.2.2 12 10202 12.so.0.1.2.2
|
||||||
|
* 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6
|
||||||
|
* 1.2.3 12 10203 12.so.0.1.2.3
|
||||||
|
* 1.2.4beta1-2 13 10204 12.so.0.1.2.4beta1-2
|
||||||
*
|
*
|
||||||
* Henceforth the source version will match the shared-library major
|
* Henceforth the source version will match the shared-library major
|
||||||
* and minor numbers; the shared-library major version number will be
|
* and minor numbers; the shared-library major version number will be
|
||||||
@@ -116,8 +118,8 @@
|
|||||||
* If you modify libpng you may insert additional notices immediately following
|
* If you modify libpng you may insert additional notices immediately following
|
||||||
* this sentence.
|
* this sentence.
|
||||||
*
|
*
|
||||||
* libpng versions 1.0.7, July 1, 2000, through 1.2.2, April 15, 2002, are
|
* libpng versions 1.0.7, July 1, 2000, through 1.2.4beta2, June 20, 2002, are
|
||||||
* Copyright (c) 2000-2001 Glenn Randers-Pehrson, and are
|
* Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
|
||||||
* distributed according to the same disclaimer and license as libpng-1.0.6
|
* distributed according to the same disclaimer and license as libpng-1.0.6
|
||||||
* with the following individuals added to the list of Contributing Authors
|
* with the following individuals added to the list of Contributing Authors
|
||||||
*
|
*
|
||||||
@@ -221,13 +223,13 @@
|
|||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* April 15, 2002
|
* June 20, 2002
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
*
|
*
|
||||||
* This is your unofficial assurance that libpng from version 0.71 and
|
* This is your unofficial assurance that libpng from version 0.71 and
|
||||||
* upward through 1.2.2 are Y2K compliant. It is my belief that earlier
|
* upward through 1.2.4beta2 are Y2K compliant. It is my belief that earlier
|
||||||
* versions were also Y2K compliant.
|
* versions were also Y2K compliant.
|
||||||
*
|
*
|
||||||
* Libpng only has three year fields. One is a 2-byte unsigned integer
|
* Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||||
@@ -283,7 +285,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Version information for png.h - this should match the version in png.c */
|
/* Version information for png.h - this should match the version in png.c */
|
||||||
#define PNG_LIBPNG_VER_STRING "1.2.2"
|
#define PNG_LIBPNG_VER_STRING "1.2.4beta2"
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_SONUM 0
|
#define PNG_LIBPNG_VER_SONUM 0
|
||||||
#define PNG_LIBPNG_VER_DLLNUM %DLLNUM%
|
#define PNG_LIBPNG_VER_DLLNUM %DLLNUM%
|
||||||
@@ -291,11 +293,11 @@
|
|||||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||||
#define PNG_LIBPNG_VER_MAJOR 1
|
#define PNG_LIBPNG_VER_MAJOR 1
|
||||||
#define PNG_LIBPNG_VER_MINOR 2
|
#define PNG_LIBPNG_VER_MINOR 2
|
||||||
#define PNG_LIBPNG_VER_RELEASE 2
|
#define PNG_LIBPNG_VER_RELEASE 4
|
||||||
/* This should match the numeric part of the final component of
|
/* This should match the numeric part of the final component of
|
||||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_BUILD 0
|
#define PNG_LIBPNG_VER_BUILD 2
|
||||||
|
|
||||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||||
#define PNG_LIBPNG_BUILD_BETA 2
|
#define PNG_LIBPNG_BUILD_BETA 2
|
||||||
@@ -303,14 +305,14 @@
|
|||||||
#define PNG_LIBPNG_BUILD_STABLE 4
|
#define PNG_LIBPNG_BUILD_STABLE 4
|
||||||
#define PNG_LIBPNG_BUILD_TYPEMASK 7
|
#define PNG_LIBPNG_BUILD_TYPEMASK 7
|
||||||
#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */
|
#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */
|
||||||
#define PNG_LIBPNG_BUILD_TYPE 4
|
#define PNG_LIBPNG_BUILD_TYPE 2
|
||||||
|
|
||||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||||
* We must not include leading zeros.
|
* We must not include leading zeros.
|
||||||
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
|
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
|
||||||
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
* 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 */
|
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */
|
||||||
#define PNG_LIBPNG_VER 10202 /* 1.2.2 */
|
#define PNG_LIBPNG_VER 10204 /* 1.2.4 */
|
||||||
|
|
||||||
#ifndef PNG_VERSION_INFO_ONLY
|
#ifndef PNG_VERSION_INFO_ONLY
|
||||||
|
|
||||||
@@ -372,7 +374,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#ifdef PNG_USE_GLOBAL_ARRAYS
|
#ifdef PNG_USE_GLOBAL_ARRAYS
|
||||||
PNG_EXPORT_VAR (const char) png_libpng_ver[18];
|
PNG_EXPORT_VAR (const char) png_libpng_ver[18];
|
||||||
/* need room for 99.99.99beta99z*/
|
/* need room for 99.99.99beta99z */
|
||||||
#else
|
#else
|
||||||
#define png_libpng_ver png_get_header_ver(NULL)
|
#define png_libpng_ver png_get_header_ver(NULL)
|
||||||
#endif
|
#endif
|
||||||
@@ -598,7 +600,7 @@ typedef struct png_info_struct
|
|||||||
png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
|
png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
|
||||||
|
|
||||||
/* The following is informational only on read, and not used on writes. */
|
/* The following is informational only on read, and not used on writes. */
|
||||||
png_byte channels; /* number of data channels per pixel (1, 2, 3, 4)*/
|
png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */
|
||||||
png_byte pixel_depth; /* number of bits per pixel */
|
png_byte pixel_depth; /* number of bits per pixel */
|
||||||
png_byte spare_byte; /* to align the data, and for future use */
|
png_byte spare_byte; /* to align the data, and for future use */
|
||||||
png_byte signature[8]; /* magic bytes read by libpng from start of file */
|
png_byte signature[8]; /* magic bytes read by libpng from start of file */
|
||||||
@@ -888,7 +890,7 @@ typedef png_info FAR * FAR * png_infopp;
|
|||||||
#define PNG_KEYWORD_MAX_LENGTH 79
|
#define PNG_KEYWORD_MAX_LENGTH 79
|
||||||
|
|
||||||
/* Maximum number of entries in PLTE/sPLT/tRNS arrays */
|
/* Maximum number of entries in PLTE/sPLT/tRNS arrays */
|
||||||
#define PNG_MAX_PALETTE_LENGTH 256
|
#define PNG_MAX_PALETTE_LENGTH 256
|
||||||
|
|
||||||
/* These determine if an ancillary chunk's data has been successfully read
|
/* These determine if an ancillary chunk's data has been successfully read
|
||||||
* from the PNG header, or if the application has filled in the corresponding
|
* from the PNG header, or if the application has filled in the corresponding
|
||||||
@@ -1007,7 +1009,7 @@ struct png_struct_def
|
|||||||
png_voidp error_ptr; /* user supplied struct for error functions */
|
png_voidp error_ptr; /* user supplied struct for error functions */
|
||||||
png_rw_ptr write_data_fn; /* function for writing output data */
|
png_rw_ptr write_data_fn; /* function for writing output data */
|
||||||
png_rw_ptr read_data_fn; /* function for reading input data */
|
png_rw_ptr read_data_fn; /* function for reading input data */
|
||||||
png_voidp io_ptr; /* ptr to application struct for I/O functions*/
|
png_voidp io_ptr; /* ptr to application struct for I/O functions */
|
||||||
|
|
||||||
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
|
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
|
||||||
png_user_transform_ptr read_user_transform_fn; /* user read transform */
|
png_user_transform_ptr read_user_transform_fn; /* user read transform */
|
||||||
@@ -1259,13 +1261,22 @@ struct png_struct_def
|
|||||||
|
|
||||||
png_bytep big_row_buf; /* buffer to save current (unfiltered) row */
|
png_bytep big_row_buf; /* buffer to save current (unfiltered) row */
|
||||||
|
|
||||||
|
#if defined(PNG_READ_DITHER_SUPPORTED)
|
||||||
|
/* The following three members were added at version 1.2.4 */
|
||||||
|
png_bytep dither_sort; /* working sort array */
|
||||||
|
png_bytep index_to_palette; /* where the original index currently is */
|
||||||
|
/* in the palette */
|
||||||
|
png_bytep palette_to_index; /* which original index points to this */
|
||||||
|
/* palette color */
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* This prevents a compiler error in png.c if png.c and png.h are both at
|
/* This prevents a compiler error in png.c if png.c and png.h are both at
|
||||||
version 1.2.2
|
version 1.2.4beta2
|
||||||
*/
|
*/
|
||||||
typedef png_structp version_1_2_2;
|
typedef png_structp version_1_2_4beta2;
|
||||||
|
|
||||||
typedef png_struct FAR * FAR * png_structpp;
|
typedef png_struct FAR * FAR * png_structpp;
|
||||||
|
|
||||||
@@ -1349,6 +1360,7 @@ extern PNG_EXPORT(png_infop,png_create_info_struct)
|
|||||||
|
|
||||||
/* Initialize the info structure (old interface - DEPRECATED) */
|
/* Initialize the info structure (old interface - DEPRECATED) */
|
||||||
extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr));
|
extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr));
|
||||||
|
#undef png_info_init
|
||||||
#define png_info_init(info_ptr) png_info_init_3(&info_ptr, sizeof(png_info));
|
#define png_info_init(info_ptr) png_info_init_3(&info_ptr, sizeof(png_info));
|
||||||
extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
|
extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
|
||||||
png_size_t png_info_struct_size));
|
png_size_t png_info_struct_size));
|
||||||
@@ -1524,11 +1536,11 @@ extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr));
|
|||||||
extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
|
||||||
png_infop info_ptr));
|
png_infop info_ptr));
|
||||||
|
|
||||||
/* read a one or more rows of image data.*/
|
/* read a one or more rows of image data. */
|
||||||
extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
|
||||||
png_bytepp row, png_bytepp display_row, png_uint_32 num_rows));
|
png_bytepp row, png_bytepp display_row, png_uint_32 num_rows));
|
||||||
|
|
||||||
/* read a row of data.*/
|
/* read a row of data. */
|
||||||
extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
|
||||||
png_bytep row,
|
png_bytep row,
|
||||||
png_bytep display_row));
|
png_bytep display_row));
|
||||||
@@ -1814,16 +1826,13 @@ extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr,
|
|||||||
extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
|
||||||
png_uint_32 size));
|
png_uint_32 size));
|
||||||
|
|
||||||
|
/* Added at libpng version 1.2.4 */
|
||||||
|
extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr,
|
||||||
|
png_uint_32 size));
|
||||||
|
|
||||||
/* frees a pointer allocated by png_malloc() */
|
/* frees a pointer allocated by png_malloc() */
|
||||||
extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
|
extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
|
||||||
|
|
||||||
/* Function to allocate memory for zlib. */
|
|
||||||
extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items,
|
|
||||||
uInt size));
|
|
||||||
|
|
||||||
/* Function to free memory for zlib */
|
|
||||||
extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr));
|
|
||||||
|
|
||||||
/* Free data that was allocated internally */
|
/* Free data that was allocated internally */
|
||||||
extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
|
||||||
png_infop info_ptr, png_uint_32 free_me, int num));
|
png_infop info_ptr, png_uint_32 free_me, int num));
|
||||||
@@ -1872,19 +1881,19 @@ extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
|
|||||||
|
|
||||||
/* Fatal error in PNG image of libpng - can't continue */
|
/* Fatal error in PNG image of libpng - can't continue */
|
||||||
extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr,
|
||||||
png_const_charp error));
|
png_const_charp error_message));
|
||||||
|
|
||||||
/* The same, but the chunk name is prepended to the error string. */
|
/* The same, but the chunk name is prepended to the error string. */
|
||||||
extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr,
|
||||||
png_const_charp error));
|
png_const_charp error_message));
|
||||||
|
|
||||||
/* Non-fatal error in libpng. Can continue, but may have a problem. */
|
/* Non-fatal error in libpng. Can continue, but may have a problem. */
|
||||||
extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr,
|
||||||
png_const_charp message));
|
png_const_charp warning_message));
|
||||||
|
|
||||||
/* Non-fatal error in libpng, chunk name is prepended to message. */
|
/* Non-fatal error in libpng, chunk name is prepended to message. */
|
||||||
extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr,
|
extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr,
|
||||||
png_const_charp message));
|
png_const_charp warning_message));
|
||||||
|
|
||||||
/* The png_set_<chunk> functions are for storing values in the png_info_struct.
|
/* The png_set_<chunk> functions are for storing values in the png_info_struct.
|
||||||
* Similarly, the png_get_<chunk> calls are used to read values from the
|
* Similarly, the png_get_<chunk> calls are used to read values from the
|
||||||
@@ -2319,15 +2328,15 @@ extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
|
|||||||
|
|
||||||
/* Added to version 1.2.0 */
|
/* Added to version 1.2.0 */
|
||||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||||
#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */
|
#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */
|
||||||
#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */
|
#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */
|
||||||
#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04
|
#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04
|
||||||
#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08
|
#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08
|
||||||
#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10
|
#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10
|
||||||
#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20
|
#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20
|
||||||
#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40
|
#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40
|
||||||
#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80
|
#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80
|
||||||
#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */
|
#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */
|
||||||
|
|
||||||
#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
|
#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
|
||||||
| PNG_ASM_FLAG_MMX_READ_INTERLACE \
|
| PNG_ASM_FLAG_MMX_READ_INTERLACE \
|
||||||
@@ -2394,7 +2403,7 @@ extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
|
|||||||
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
|
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
|
||||||
|
|
||||||
#define PNG_HEADER_VERSION_STRING \
|
#define PNG_HEADER_VERSION_STRING \
|
||||||
" libpng version 1.2.2 - April 15, 2002 (header)\n"
|
" libpng version 1.2.4beta2 - June 20, 2002 (header)\n"
|
||||||
|
|
||||||
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
||||||
/* With these routines we avoid an integer divide, which will be slower on
|
/* With these routines we avoid an integer divide, which will be slower on
|
||||||
@@ -2628,6 +2637,7 @@ PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf));
|
|||||||
* (old interface - DEPRECATED - use png_create_read_struct instead).
|
* (old interface - DEPRECATED - use png_create_read_struct instead).
|
||||||
*/
|
*/
|
||||||
extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
|
extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
|
||||||
|
#undef png_read_init
|
||||||
#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \
|
#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \
|
||||||
PNG_LIBPNG_VER_STRING, sizeof(png_struct));
|
PNG_LIBPNG_VER_STRING, sizeof(png_struct));
|
||||||
extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr,
|
extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr,
|
||||||
@@ -2640,6 +2650,7 @@ extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr,
|
|||||||
* (old interface - DEPRECATED - use png_create_write_struct instead).
|
* (old interface - DEPRECATED - use png_create_write_struct instead).
|
||||||
*/
|
*/
|
||||||
extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
|
extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
|
||||||
|
#undef png_write_init
|
||||||
#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \
|
#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \
|
||||||
PNG_LIBPNG_VER_STRING, sizeof(png_struct));
|
PNG_LIBPNG_VER_STRING, sizeof(png_struct));
|
||||||
extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr,
|
extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr,
|
||||||
@@ -2663,6 +2674,32 @@ PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
|
|||||||
PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
|
PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
|
||||||
png_infop info_ptr));
|
png_infop info_ptr));
|
||||||
|
|
||||||
|
/* Function to allocate memory for zlib. */
|
||||||
|
PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size));
|
||||||
|
|
||||||
|
/* Function to free memory for zlib */
|
||||||
|
PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
|
||||||
|
|
||||||
|
/* Next four functions are used internally as callbacks. PNGAPI is required
|
||||||
|
* but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */
|
||||||
|
|
||||||
|
PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr,
|
||||||
|
png_bytep data, png_size_t length));
|
||||||
|
|
||||||
|
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
||||||
|
PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr,
|
||||||
|
png_bytep buffer, png_size_t length));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr,
|
||||||
|
png_bytep data, png_size_t length));
|
||||||
|
|
||||||
|
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
|
||||||
|
#if !defined(PNG_NO_STDIO)
|
||||||
|
PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr));
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Reset the CRC variable */
|
/* Reset the CRC variable */
|
||||||
PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
|
PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
|
||||||
|
|
||||||
@@ -2703,6 +2740,7 @@ PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr,
|
|||||||
PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
|
PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Place a 32-bit number into a buffer in PNG byte order (big-endian).
|
/* Place a 32-bit number into a buffer in PNG byte order (big-endian).
|
||||||
* The only currently known PNG chunks that use signed numbers are
|
* The only currently known PNG chunks that use signed numbers are
|
||||||
* the ancillary extension chunks, oFFs and pCAL.
|
* the ancillary extension chunks, oFFs and pCAL.
|
||||||
@@ -2825,6 +2863,11 @@ PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
|
|||||||
png_charp text));
|
png_charp text));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(PNG_TEXT_SUPPORTED) /* Added at version 1.2.4 */
|
||||||
|
PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr,
|
||||||
|
png_infop info_ptr, png_textp text_ptr, int num_text));
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_WRITE_oFFs_SUPPORTED)
|
#if defined(PNG_WRITE_oFFs_SUPPORTED)
|
||||||
PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
|
PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
|
||||||
png_int_32 x_offset, png_int_32 y_offset, int unit_type));
|
png_int_32 x_offset, png_int_32 y_offset, int unit_type));
|
||||||
@@ -3146,8 +3189,6 @@ PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
|
|||||||
PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
|
PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
|
||||||
png_uint_32 length));
|
png_uint_32 length));
|
||||||
PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
|
PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
|
||||||
PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr,
|
|
||||||
png_bytep buffer, png_size_t length));
|
|
||||||
PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
|
PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
|
||||||
PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
|
PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
|
||||||
png_bytep buffer, png_size_t buffer_length));
|
png_bytep buffer, png_size_t buffer_length));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* pngasmrd.h - assembler version of utilities to read a PNG file
|
/* pngasmrd.h - assembler version of utilities to read a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 2002 Glenn Randers-Pehrson
|
* Copyright (c) 2002 Glenn Randers-Pehrson
|
||||||
*
|
*
|
||||||
|
|||||||
53
pngconf.h
53
pngconf.h
@@ -1,6 +1,6 @@
|
|||||||
/* pngconf.h - machine configurable file for libpng
|
/* pngconf.h - machine configurable file for libpng
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -78,12 +78,12 @@
|
|||||||
* (no define) -- building static library, or building an
|
* (no define) -- building static library, or building an
|
||||||
* application and linking to the static lib
|
* application and linking to the static lib
|
||||||
* 'Cygwin' defines/defaults:
|
* 'Cygwin' defines/defaults:
|
||||||
* PNG_BUILD_DLL -- building the dll
|
* PNG_BUILD_DLL -- (ignored) building the dll
|
||||||
* (no define) -- building an application, linking to the dll
|
* (no define) -- (ignored) building an application, linking to the dll
|
||||||
* PNG_STATIC -- building the static lib, or building an application
|
* PNG_STATIC -- (ignored) building the static lib, or building an
|
||||||
* that links to the static lib.
|
* application that links to the static lib.
|
||||||
* ALL_STATIC -- building various static libs, or building an application
|
* ALL_STATIC -- (ignored) building various static libs, or building an
|
||||||
* that links to the static libs.
|
* application that links to the static libs.
|
||||||
* Thus,
|
* Thus,
|
||||||
* a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
|
* a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
|
||||||
* this bit of #ifdefs will define the 'correct' config variables based on
|
* this bit of #ifdefs will define the 'correct' config variables based on
|
||||||
@@ -94,7 +94,15 @@
|
|||||||
* ALL_STATIC (since we can't #undef something outside our namespace)
|
* ALL_STATIC (since we can't #undef something outside our namespace)
|
||||||
* PNG_BUILD_DLL
|
* PNG_BUILD_DLL
|
||||||
* PNG_STATIC
|
* PNG_STATIC
|
||||||
* (nothing) == PNG_USE_DLL
|
* (nothing) == PNG_USE_DLL
|
||||||
|
*
|
||||||
|
* CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
|
||||||
|
* of auto-import in binutils, we no longer need to worry about
|
||||||
|
* __declspec(dllexport) / __declspec(dllimport) and friends. Therefore,
|
||||||
|
* we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
|
||||||
|
* to __declspec() stuff. However, we DO need to worry about
|
||||||
|
* PNG_BUILD_DLL and PNG_STATIC because those change some defaults
|
||||||
|
* such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
|
||||||
*/
|
*/
|
||||||
#if defined(__CYGWIN__)
|
#if defined(__CYGWIN__)
|
||||||
# if defined(ALL_STATIC)
|
# if defined(ALL_STATIC)
|
||||||
@@ -1149,10 +1157,23 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__CYGWIN__)
|
||||||
|
# undef PNGAPI
|
||||||
|
# define PNGAPI __cdecl
|
||||||
|
# undef PNG_IMPEXP
|
||||||
|
# define PNG_IMPEXP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
|
||||||
|
* you may get warnings regarding the linkage of png_zalloc and png_zfree.
|
||||||
|
* Don't ignore those warnings; you must also reset the default calling
|
||||||
|
* convention in your compiler to match your PNGAPI, and you must build
|
||||||
|
* zlib and your applications the same way you build libpng.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef PNGAPI
|
#ifndef PNGAPI
|
||||||
|
|
||||||
#if defined(__MINGW32__) || defined(__CYGWIN__) && !defined(PNG_MODULEDEF)
|
#if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
|
||||||
# ifndef PNG_NO_MODULEDEF
|
# ifndef PNG_NO_MODULEDEF
|
||||||
# define PNG_NO_MODULEDEF
|
# define PNG_NO_MODULEDEF
|
||||||
# endif
|
# endif
|
||||||
@@ -1164,8 +1185,7 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
|
|
||||||
#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
|
#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
|
||||||
(( defined(_Windows) || defined(_WINDOWS) || \
|
(( defined(_Windows) || defined(_WINDOWS) || \
|
||||||
defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
|
defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
|
||||||
) && !defined(__CYGWIN__))
|
|
||||||
|
|
||||||
# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
|
# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
|
||||||
# define PNGAPI __cdecl
|
# define PNGAPI __cdecl
|
||||||
@@ -1192,8 +1212,8 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
# if defined(PNG_BUILD_DLL)
|
# if defined(PNG_BUILD_DLL)
|
||||||
# define PNG_IMPEXP __export
|
# define PNG_IMPEXP __export
|
||||||
# else
|
# else
|
||||||
# define PNG_IMPEXP /*__import*/ /* doesn't exist AFAIK in
|
# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
|
||||||
VC++*/
|
VC++ */
|
||||||
# endif /* Exists in Borland C++ for
|
# endif /* Exists in Borland C++ for
|
||||||
C++ classes (== huge) */
|
C++ classes (== huge) */
|
||||||
# endif
|
# endif
|
||||||
@@ -1208,12 +1228,6 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
# endif
|
# endif
|
||||||
# endif /* PNG_IMPEXP */
|
# endif /* PNG_IMPEXP */
|
||||||
#else /* !(DLL || non-cygwin WINDOWS) */
|
#else /* !(DLL || non-cygwin WINDOWS) */
|
||||||
# if defined(__CYGWIN__) && !defined(PNG_DLL)
|
|
||||||
# if !defined(PNG_IMPEXP)
|
|
||||||
# define PNG_IMPEXP
|
|
||||||
# endif
|
|
||||||
# define PNGAPI __cdecl
|
|
||||||
# else
|
|
||||||
# if (defined(__IBMC__) || defined(IBMCPP__)) && defined(__OS2__)
|
# if (defined(__IBMC__) || defined(IBMCPP__)) && defined(__OS2__)
|
||||||
# define PNGAPI _System
|
# define PNGAPI _System
|
||||||
# define PNG_IMPEXP
|
# define PNG_IMPEXP
|
||||||
@@ -1224,7 +1238,6 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
# define PNG_IMPEXP
|
# define PNG_IMPEXP
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
82
pngerror.c
82
pngerror.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngerror.c - stub functions for i/o and memory allocation
|
/* pngerror.c - stub functions for i/o and memory allocation
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
static void /* PRIVATE */
|
static void /* PRIVATE */
|
||||||
png_default_error PNGARG((png_structp png_ptr,
|
png_default_error PNGARG((png_structp png_ptr,
|
||||||
png_const_charp message));
|
png_const_charp error_message));
|
||||||
static void /* PRIVATE */
|
static void /* PRIVATE */
|
||||||
png_default_warning PNGARG((png_structp png_ptr,
|
png_default_warning PNGARG((png_structp png_ptr,
|
||||||
png_const_charp message));
|
png_const_charp warning_message));
|
||||||
|
|
||||||
/* This function is called whenever there is a fatal error. This function
|
/* This function is called whenever there is a fatal error. This function
|
||||||
* should not be changed. If there is a need to handle errors differently,
|
* should not be changed. If there is a need to handle errors differently,
|
||||||
@@ -29,28 +29,28 @@ png_default_warning PNGARG((png_structp png_ptr,
|
|||||||
* to replace the error function at run-time.
|
* to replace the error function at run-time.
|
||||||
*/
|
*/
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_error(png_structp png_ptr, png_const_charp message)
|
png_error(png_structp png_ptr, png_const_charp error_message)
|
||||||
{
|
{
|
||||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||||
char msg[16];
|
char msg[16];
|
||||||
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
|
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
|
||||||
{
|
{
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
if (*message == '#')
|
if (*error_message == '#')
|
||||||
{
|
{
|
||||||
for (offset=1; offset<15; offset++)
|
for (offset=1; offset<15; offset++)
|
||||||
if (*(message+offset) == ' ')
|
if (*(error_message+offset) == ' ')
|
||||||
break;
|
break;
|
||||||
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
|
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<offset-1; i++)
|
for (i=0; i<offset-1; i++)
|
||||||
msg[i]=message[i+1];
|
msg[i]=error_message[i+1];
|
||||||
msg[i]='\0';
|
msg[i]='\0';
|
||||||
message=msg;
|
error_message=msg;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
message+=offset;
|
error_message+=offset;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -58,17 +58,17 @@ png_error(png_structp png_ptr, png_const_charp message)
|
|||||||
{
|
{
|
||||||
msg[0]='0';
|
msg[0]='0';
|
||||||
msg[1]='\0';
|
msg[1]='\0';
|
||||||
message=msg;
|
error_message=msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (png_ptr->error_fn != NULL)
|
if (png_ptr->error_fn != NULL)
|
||||||
(*(png_ptr->error_fn))(png_ptr, message);
|
(*(png_ptr->error_fn))(png_ptr, error_message);
|
||||||
|
|
||||||
/* if the following returns or doesn't exist, use the default function,
|
/* if the following returns or doesn't exist, use the default function,
|
||||||
which will not return */
|
which will not return */
|
||||||
png_default_error(png_ptr, message);
|
png_default_error(png_ptr, error_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function is called whenever there is a non-fatal error. This function
|
/* This function is called whenever there is a non-fatal error. This function
|
||||||
@@ -77,24 +77,25 @@ png_error(png_structp png_ptr, png_const_charp message)
|
|||||||
* png_set_error_fn() to replace the warning function at run-time.
|
* png_set_error_fn() to replace the warning function at run-time.
|
||||||
*/
|
*/
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_warning(png_structp png_ptr, png_const_charp message)
|
png_warning(png_structp png_ptr, png_const_charp warning_message)
|
||||||
{
|
{
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||||
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
|
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (*message == '#')
|
if (*warning_message == '#')
|
||||||
{
|
{
|
||||||
for (offset=1; offset<15; offset++)
|
for (offset=1; offset<15; offset++)
|
||||||
if (*(message+offset) == ' ')
|
if (*(warning_message+offset) == ' ')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (png_ptr->warning_fn != NULL)
|
if (png_ptr->warning_fn != NULL)
|
||||||
(*(png_ptr->warning_fn))(png_ptr, (png_const_charp)(message+offset));
|
(*(png_ptr->warning_fn))(png_ptr,
|
||||||
|
(png_const_charp)(warning_message+offset));
|
||||||
else
|
else
|
||||||
png_default_warning(png_ptr, (png_const_charp)(message+offset));
|
png_default_warning(png_ptr, (png_const_charp)(warning_message+offset));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* These utilities are used internally to build an error message that relates
|
/* These utilities are used internally to build an error message that relates
|
||||||
@@ -110,7 +111,7 @@ static PNG_CONST char png_digit[16] = {
|
|||||||
|
|
||||||
static void /* PRIVATE */
|
static void /* PRIVATE */
|
||||||
png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
|
png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
|
||||||
message)
|
error_message)
|
||||||
{
|
{
|
||||||
int iout = 0, iin = 0;
|
int iout = 0, iin = 0;
|
||||||
|
|
||||||
@@ -130,30 +131,30 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message == NULL)
|
if (error_message == NULL)
|
||||||
buffer[iout] = 0;
|
buffer[iout] = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buffer[iout++] = ':';
|
buffer[iout++] = ':';
|
||||||
buffer[iout++] = ' ';
|
buffer[iout++] = ' ';
|
||||||
png_memcpy(buffer+iout, message, 64);
|
png_memcpy(buffer+iout, error_message, 64);
|
||||||
buffer[iout+63] = 0;
|
buffer[iout+63] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_chunk_error(png_structp png_ptr, png_const_charp message)
|
png_chunk_error(png_structp png_ptr, png_const_charp error_message)
|
||||||
{
|
{
|
||||||
char msg[18+64];
|
char msg[18+64];
|
||||||
png_format_buffer(png_ptr, msg, message);
|
png_format_buffer(png_ptr, msg, error_message);
|
||||||
png_error(png_ptr, msg);
|
png_error(png_ptr, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_chunk_warning(png_structp png_ptr, png_const_charp message)
|
png_chunk_warning(png_structp png_ptr, png_const_charp warning_message)
|
||||||
{
|
{
|
||||||
char msg[18+64];
|
char msg[18+64];
|
||||||
png_format_buffer(png_ptr, msg, message);
|
png_format_buffer(png_ptr, msg, warning_message);
|
||||||
png_warning(png_ptr, msg);
|
png_warning(png_ptr, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,33 +164,34 @@ png_chunk_warning(png_structp png_ptr, png_const_charp message)
|
|||||||
* error function pointer in png_set_error_fn().
|
* error function pointer in png_set_error_fn().
|
||||||
*/
|
*/
|
||||||
static void /* PRIVATE */
|
static void /* PRIVATE */
|
||||||
png_default_error(png_structp png_ptr, png_const_charp message)
|
png_default_error(png_structp png_ptr, png_const_charp error_message)
|
||||||
{
|
{
|
||||||
#ifndef PNG_NO_CONSOLE_IO
|
#ifndef PNG_NO_CONSOLE_IO
|
||||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||||
if (*message == '#')
|
if (*error_message == '#')
|
||||||
{
|
{
|
||||||
int offset;
|
int offset;
|
||||||
char error_number[16];
|
char error_number[16];
|
||||||
for (offset=0; offset<15; offset++)
|
for (offset=0; offset<15; offset++)
|
||||||
{
|
{
|
||||||
error_number[offset] = *(message+offset+1);
|
error_number[offset] = *(error_message+offset+1);
|
||||||
if (*(message+offset) == ' ')
|
if (*(error_message+offset) == ' ')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if((offset > 1) && (offset < 15))
|
if((offset > 1) && (offset < 15))
|
||||||
{
|
{
|
||||||
error_number[offset-1]='\0';
|
error_number[offset-1]='\0';
|
||||||
fprintf(stderr, "libpng error no. %s: %s\n", error_number, message+offset);
|
fprintf(stderr, "libpng error no. %s: %s\n", error_number,
|
||||||
|
error_message+offset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fprintf(stderr, "libpng error: %s, offset=%d\n", message,offset);
|
fprintf(stderr, "libpng error: %s, offset=%d\n", error_message,offset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "libpng error: %s\n", message);
|
fprintf(stderr, "libpng error: %s\n", error_message);
|
||||||
#else
|
#else
|
||||||
if (message)
|
if (error_message)
|
||||||
/* make compiler happy */ ;
|
/* make compiler happy */ ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -216,34 +218,34 @@ png_default_error(png_structp png_ptr, png_const_charp message)
|
|||||||
* not used, but it is passed in case it may be useful.
|
* not used, but it is passed in case it may be useful.
|
||||||
*/
|
*/
|
||||||
static void /* PRIVATE */
|
static void /* PRIVATE */
|
||||||
png_default_warning(png_structp png_ptr, png_const_charp message)
|
png_default_warning(png_structp png_ptr, png_const_charp warning_message)
|
||||||
{
|
{
|
||||||
#ifndef PNG_NO_CONSOLE_IO
|
#ifndef PNG_NO_CONSOLE_IO
|
||||||
# ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
# ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||||
if (*message == '#')
|
if (*warning_message == '#')
|
||||||
{
|
{
|
||||||
int offset;
|
int offset;
|
||||||
char warning_number[16];
|
char warning_number[16];
|
||||||
for (offset=0; offset<15; offset++)
|
for (offset=0; offset<15; offset++)
|
||||||
{
|
{
|
||||||
warning_number[offset]=*(message+offset+1);
|
warning_number[offset]=*(warning_message+offset+1);
|
||||||
if (*(message+offset) == ' ')
|
if (*(warning_message+offset) == ' ')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if((offset > 1) && (offset < 15))
|
if((offset > 1) && (offset < 15))
|
||||||
{
|
{
|
||||||
warning_number[offset-1]='\0';
|
warning_number[offset-1]='\0';
|
||||||
fprintf(stderr, "libpng warning no. %s: %s\n", warning_number,
|
fprintf(stderr, "libpng warning no. %s: %s\n", warning_number,
|
||||||
message+offset);
|
warning_message+offset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fprintf(stderr, "libpng warning: %s\n", message);
|
fprintf(stderr, "libpng warning: %s\n", warning_message);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
# endif
|
# endif
|
||||||
fprintf(stderr, "libpng warning: %s\n", message);
|
fprintf(stderr, "libpng warning: %s\n", warning_message);
|
||||||
#else
|
#else
|
||||||
if (message)
|
if (warning_message)
|
||||||
/* appease compiler */ ;
|
/* appease compiler */ ;
|
||||||
#endif
|
#endif
|
||||||
if (png_ptr)
|
if (png_ptr)
|
||||||
|
|||||||
10
pnggccrd.c
10
pnggccrd.c
@@ -6,7 +6,7 @@
|
|||||||
* and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
|
* and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
|
||||||
* for Intel's performance analysis of the MMX vs. non-MMX code.
|
* for Intel's performance analysis of the MMX vs. non-MMX code.
|
||||||
*
|
*
|
||||||
* libpng version 1.2.2 - April 15, 2002
|
* libpng version 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* Copyright (c) 1998, Intel Corporation
|
* Copyright (c) 1998, Intel Corporation
|
||||||
@@ -338,7 +338,7 @@ static unsigned long long _const6 = 0x00000000000000FFLL;
|
|||||||
static png_uint_32 _FullLength;
|
static png_uint_32 _FullLength;
|
||||||
static png_uint_32 _MMXLength;
|
static png_uint_32 _MMXLength;
|
||||||
static int _dif;
|
static int _dif;
|
||||||
static int _patemp; // temp variables for Paeth routine
|
static int _patemp; // temp variables for Paeth routine
|
||||||
static int _pbtemp;
|
static int _pbtemp;
|
||||||
static int _pctemp;
|
static int _pctemp;
|
||||||
#endif
|
#endif
|
||||||
@@ -386,9 +386,9 @@ static int _mmx_supported = 2;
|
|||||||
#if defined(PNG_HAVE_ASSEMBLER_COMBINE_ROW)
|
#if defined(PNG_HAVE_ASSEMBLER_COMBINE_ROW)
|
||||||
|
|
||||||
#define BPP2 2
|
#define BPP2 2
|
||||||
#define BPP3 3 /* bytes per pixel (a.k.a. pixel_bytes) */
|
#define BPP3 3 /* bytes per pixel (a.k.a. pixel_bytes) */
|
||||||
#define BPP4 4
|
#define BPP4 4
|
||||||
#define BPP6 6 /* (defined only to help avoid cut-and-paste errors) */
|
#define BPP6 6 /* (defined only to help avoid cut-and-paste errors) */
|
||||||
#define BPP8 8
|
#define BPP8 8
|
||||||
|
|
||||||
/* Combines the row recently read in with the previous row.
|
/* Combines the row recently read in with the previous row.
|
||||||
@@ -4825,7 +4825,7 @@ png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: // bpp greater than 8 bytes GRR BOGUS
|
default: // bpp greater than 8 bytes GRR BOGUS
|
||||||
{
|
{
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movl _dif, %%edx \n\t"
|
"movl _dif, %%edx \n\t"
|
||||||
|
|||||||
8
pngget.c
8
pngget.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngget.c - retrieval of values from info struct
|
/* pngget.c - retrieval of values from info struct
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -560,7 +560,9 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
|
|||||||
*interlace_type = info_ptr->interlace_type;
|
*interlace_type = info_ptr->interlace_type;
|
||||||
|
|
||||||
/* check for potential overflow of rowbytes */
|
/* check for potential overflow of rowbytes */
|
||||||
if (*color_type & PNG_COLOR_MASK_COLOR)
|
if (*color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
|
channels = 1;
|
||||||
|
else if (*color_type & PNG_COLOR_MASK_COLOR)
|
||||||
channels = 3;
|
channels = 3;
|
||||||
else
|
else
|
||||||
channels = 1;
|
channels = 1;
|
||||||
@@ -835,7 +837,7 @@ png_get_compression_buffer_size(png_structp png_ptr)
|
|||||||
|
|
||||||
#ifndef PNG_1_0_X
|
#ifndef PNG_1_0_X
|
||||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||||
/* this function was added to libpng 1.2.0 and should exist by default*/
|
/* this function was added to libpng 1.2.0 and should exist by default */
|
||||||
png_uint_32 PNGAPI
|
png_uint_32 PNGAPI
|
||||||
png_get_asm_flags (png_structp png_ptr)
|
png_get_asm_flags (png_structp png_ptr)
|
||||||
{
|
{
|
||||||
|
|||||||
31
pngmem.c
31
pngmem.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngmem.c - stub functions for memory allocation
|
/* pngmem.c - stub functions for memory allocation
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -110,12 +110,12 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
|
|||||||
* result, we would be truncating potentially larger memory requests
|
* result, we would be truncating potentially larger memory requests
|
||||||
* (which should cause a fatal error) and introducing major problems.
|
* (which should cause a fatal error) and introducing major problems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
png_voidp PNGAPI
|
png_voidp PNGAPI
|
||||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||||
{
|
{
|
||||||
#ifndef PNG_USER_MEM_SUPPORTED
|
|
||||||
png_voidp ret;
|
png_voidp ret;
|
||||||
#endif
|
|
||||||
if (png_ptr == NULL || size == 0)
|
if (png_ptr == NULL || size == 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ png_free_default(png_structp png_ptr, png_voidp ptr)
|
|||||||
|
|
||||||
/* Allocate memory for a png_struct or a png_info. The malloc and
|
/* Allocate memory for a png_struct or a png_info. The malloc and
|
||||||
memset can be replaced by a single call to calloc() if this is thought
|
memset can be replaced by a single call to calloc() if this is thought
|
||||||
to improve performance noticably.*/
|
to improve performance noticably. */
|
||||||
png_voidp /* PRIVATE */
|
png_voidp /* PRIVATE */
|
||||||
png_create_struct(int type)
|
png_create_struct(int type)
|
||||||
{
|
{
|
||||||
@@ -316,7 +316,7 @@ png_create_struct(int type)
|
|||||||
|
|
||||||
/* Allocate memory for a png_struct or a png_info. The malloc and
|
/* Allocate memory for a png_struct or a png_info. The malloc and
|
||||||
memset can be replaced by a single call to calloc() if this is thought
|
memset can be replaced by a single call to calloc() if this is thought
|
||||||
to improve performance noticably.*/
|
to improve performance noticably. */
|
||||||
png_voidp /* PRIVATE */
|
png_voidp /* PRIVATE */
|
||||||
png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
|
png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
|
||||||
{
|
{
|
||||||
@@ -399,7 +399,6 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Allocate memory. For reasonable files, size should never exceed
|
/* Allocate memory. For reasonable files, size should never exceed
|
||||||
64K. However, zlib may allocate more then 64K if you don't tell
|
64K. However, zlib may allocate more then 64K if you don't tell
|
||||||
it not to. See zconf.h and png.h for more information. zlib does
|
it not to. See zconf.h and png.h for more information. zlib does
|
||||||
@@ -410,13 +409,14 @@ png_voidp PNGAPI
|
|||||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||||
{
|
{
|
||||||
png_voidp ret;
|
png_voidp ret;
|
||||||
|
|
||||||
if (png_ptr == NULL || size == 0)
|
if (png_ptr == NULL || size == 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
#ifdef PNG_USER_MEM_SUPPORTED
|
#ifdef PNG_USER_MEM_SUPPORTED
|
||||||
if(png_ptr->malloc_fn != NULL)
|
if(png_ptr->malloc_fn != NULL)
|
||||||
{
|
{
|
||||||
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, size));
|
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size));
|
||||||
if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||||
png_error(png_ptr, "Out of Memory!");
|
png_error(png_ptr, "Out of Memory!");
|
||||||
return (ret);
|
return (ret);
|
||||||
@@ -424,6 +424,7 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
|
|||||||
else
|
else
|
||||||
return (png_malloc_default(png_ptr, size));
|
return (png_malloc_default(png_ptr, size));
|
||||||
}
|
}
|
||||||
|
|
||||||
png_voidp PNGAPI
|
png_voidp PNGAPI
|
||||||
png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||||
{
|
{
|
||||||
@@ -493,6 +494,22 @@ png_free_default(png_structp png_ptr, png_voidp ptr)
|
|||||||
|
|
||||||
#endif /* Not Borland DOS special memory handler */
|
#endif /* Not Borland DOS special memory handler */
|
||||||
|
|
||||||
|
/* This function was added at libpng version 1.3.0. The png_malloc_warn()
|
||||||
|
* function will issue a png_warning and return NULL instead of issuing a
|
||||||
|
* png_error, if it fails to allocate the requested memory.
|
||||||
|
*/
|
||||||
|
png_voidp PNGAPI
|
||||||
|
png_malloc_warn(png_structp png_ptr, png_uint_32 size)
|
||||||
|
{
|
||||||
|
png_voidp ptr;
|
||||||
|
png_uint_32 save_flags=png_ptr->flags;
|
||||||
|
|
||||||
|
png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
|
||||||
|
ptr = (png_voidp)png_malloc((png_structp)png_ptr, size);
|
||||||
|
png_ptr->flags=save_flags;
|
||||||
|
return(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
png_voidp PNGAPI
|
png_voidp PNGAPI
|
||||||
png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2,
|
png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2,
|
||||||
png_uint_32 length)
|
png_uint_32 length)
|
||||||
|
|||||||
87
pngpread.c
87
pngpread.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngpread.c - read a png file in push mode
|
/* pngpread.c - read a png file in push mode
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -221,7 +221,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4))
|
else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4))
|
||||||
@@ -231,7 +230,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
else if (!png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4))
|
else if (!png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4))
|
||||||
@@ -243,7 +241,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||||
png_error(png_ptr, "Missing IHDR before IDAT");
|
png_error(png_ptr, "Missing IHDR before IDAT");
|
||||||
else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
|
else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
|
||||||
!(png_ptr->mode & PNG_HAVE_PLTE))
|
!(png_ptr->mode & PNG_HAVE_PLTE))
|
||||||
png_error(png_ptr, "Missing PLTE before IDAT");
|
png_error(png_ptr, "Missing PLTE before IDAT");
|
||||||
|
|
||||||
if (png_ptr->mode & PNG_HAVE_IDAT)
|
if (png_ptr->mode & PNG_HAVE_IDAT)
|
||||||
@@ -270,8 +268,8 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
|
|
||||||
png_ptr->process_mode = PNG_READ_DONE_MODE;
|
png_ptr->process_mode = PNG_READ_DONE_MODE;
|
||||||
png_push_have_end(png_ptr, info_ptr);
|
png_push_have_end(png_ptr, info_ptr);
|
||||||
}
|
}
|
||||||
@@ -283,7 +281,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -295,7 +292,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -307,7 +303,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -319,7 +314,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -331,7 +325,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -343,7 +336,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -355,7 +347,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -367,7 +358,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -379,7 +369,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -391,7 +380,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -403,7 +391,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -415,7 +402,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -427,7 +413,6 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -439,30 +424,49 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length);
|
png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(PNG_READ_tEXt_SUPPORTED)
|
#if defined(PNG_READ_tEXt_SUPPORTED)
|
||||||
else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4))
|
else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4))
|
||||||
{
|
{
|
||||||
|
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||||
|
{
|
||||||
|
png_push_save_buffer(png_ptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
png_push_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
|
png_push_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(PNG_READ_zTXt_SUPPORTED)
|
#if defined(PNG_READ_zTXt_SUPPORTED)
|
||||||
else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4))
|
else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4))
|
||||||
{
|
{
|
||||||
|
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||||
|
{
|
||||||
|
png_push_save_buffer(png_ptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
png_push_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
|
png_push_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(PNG_READ_iTXt_SUPPORTED)
|
#if defined(PNG_READ_iTXt_SUPPORTED)
|
||||||
else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4))
|
else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4))
|
||||||
{
|
{
|
||||||
|
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||||
|
{
|
||||||
|
png_push_save_buffer(png_ptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
|
png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||||
|
{
|
||||||
|
png_push_save_buffer(png_ptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
png_push_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
|
png_push_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,7 +528,7 @@ png_push_crc_finish(png_structp png_ptr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void /* PRIVATE */
|
void PNGAPI
|
||||||
png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
|
png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
|
||||||
{
|
{
|
||||||
png_bytep ptr;
|
png_bytep ptr;
|
||||||
@@ -802,13 +806,13 @@ png_push_process_row(png_structp png_ptr)
|
|||||||
png_read_push_finish_row(png_ptr);
|
png_read_push_finish_row(png_ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (png_ptr->pass == 4 && png_ptr->height <= 4)
|
if (png_ptr->pass == 4 && png_ptr->height <= 4)
|
||||||
{
|
{
|
||||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||||
{
|
{
|
||||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||||
png_read_push_finish_row(png_ptr);
|
png_read_push_finish_row(png_ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (png_ptr->pass == 6 && png_ptr->height <= 4)
|
if (png_ptr->pass == 6 && png_ptr->height <= 4)
|
||||||
{
|
{
|
||||||
@@ -1051,6 +1055,7 @@ png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_textp text_ptr;
|
png_textp text_ptr;
|
||||||
png_charp text;
|
png_charp text;
|
||||||
png_charp key;
|
png_charp key;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (png_ptr->buffer_size < 4)
|
if (png_ptr->buffer_size < 4)
|
||||||
{
|
{
|
||||||
@@ -1066,7 +1071,6 @@ png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
key = png_ptr->current_text;
|
key = png_ptr->current_text;
|
||||||
png_ptr->current_text = 0;
|
|
||||||
|
|
||||||
for (text = key; *text; text++)
|
for (text = key; *text; text++)
|
||||||
/* empty loop */ ;
|
/* empty loop */ ;
|
||||||
@@ -1083,10 +1087,14 @@ png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
#endif
|
#endif
|
||||||
text_ptr->text = text;
|
text_ptr->text = text;
|
||||||
|
|
||||||
png_set_text(png_ptr, info_ptr, text_ptr, 1);
|
ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
|
||||||
|
|
||||||
png_free(png_ptr, key);
|
png_free(png_ptr, key);
|
||||||
png_free(png_ptr, text_ptr);
|
png_free(png_ptr, text_ptr);
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
png_warning(png_ptr, "Insufficient memory to store text chunk.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1157,7 +1165,6 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_crc_finish(png_ptr);
|
png_push_crc_finish(png_ptr);
|
||||||
|
|
||||||
key = png_ptr->current_text;
|
key = png_ptr->current_text;
|
||||||
png_ptr->current_text = 0;
|
|
||||||
|
|
||||||
for (text = key; *text; text++)
|
for (text = key; *text; text++)
|
||||||
/* empty loop */ ;
|
/* empty loop */ ;
|
||||||
@@ -1165,6 +1172,7 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
/* zTXt can't have zero text */
|
/* zTXt can't have zero text */
|
||||||
if (text == key + png_ptr->current_text_size)
|
if (text == key + png_ptr->current_text_size)
|
||||||
{
|
{
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
png_free(png_ptr, key);
|
png_free(png_ptr, key);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1173,6 +1181,7 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
|
|
||||||
if (*text != PNG_TEXT_COMPRESSION_zTXt) /* check compression byte */
|
if (*text != PNG_TEXT_COMPRESSION_zTXt) /* check compression byte */
|
||||||
{
|
{
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
png_free(png_ptr, key);
|
png_free(png_ptr, key);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1197,6 +1206,7 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
{
|
{
|
||||||
inflateReset(&png_ptr->zstream);
|
inflateReset(&png_ptr->zstream);
|
||||||
png_ptr->zstream.avail_in = 0;
|
png_ptr->zstream.avail_in = 0;
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
png_free(png_ptr, key);
|
png_free(png_ptr, key);
|
||||||
png_free(png_ptr, text);
|
png_free(png_ptr, text);
|
||||||
return;
|
return;
|
||||||
@@ -1250,11 +1260,13 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
|
|
||||||
if (ret != Z_STREAM_END)
|
if (ret != Z_STREAM_END)
|
||||||
{
|
{
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
png_free(png_ptr, key);
|
png_free(png_ptr, key);
|
||||||
png_free(png_ptr, text);
|
png_free(png_ptr, text);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
png_free(png_ptr, key);
|
png_free(png_ptr, key);
|
||||||
key = text;
|
key = text;
|
||||||
text += key_size;
|
text += key_size;
|
||||||
@@ -1268,10 +1280,13 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
#endif
|
#endif
|
||||||
text_ptr->text = text;
|
text_ptr->text = text;
|
||||||
|
|
||||||
png_set_text(png_ptr, info_ptr, text_ptr, 1);
|
ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
|
||||||
|
|
||||||
png_free(png_ptr, key);
|
png_free(png_ptr, key);
|
||||||
png_free(png_ptr, text_ptr);
|
png_free(png_ptr, text_ptr);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
png_warning(png_ptr, "Insufficient memory to store text chunk.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1332,6 +1347,7 @@ png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_charp lang;
|
png_charp lang;
|
||||||
png_charp lang_key;
|
png_charp lang_key;
|
||||||
png_charp text;
|
png_charp text;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (png_ptr->buffer_size < 4)
|
if (png_ptr->buffer_size < 4)
|
||||||
{
|
{
|
||||||
@@ -1347,7 +1363,6 @@ png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
key = png_ptr->current_text;
|
key = png_ptr->current_text;
|
||||||
png_ptr->current_text = 0;
|
|
||||||
|
|
||||||
for (lang = key; *lang; lang++)
|
for (lang = key; *lang; lang++)
|
||||||
/* empty loop */ ;
|
/* empty loop */ ;
|
||||||
@@ -1377,9 +1392,13 @@ png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr)
|
|||||||
text_ptr->text_length = 0;
|
text_ptr->text_length = 0;
|
||||||
text_ptr->itxt_length = png_strlen(text);
|
text_ptr->itxt_length = png_strlen(text);
|
||||||
|
|
||||||
png_set_text(png_ptr, info_ptr, text_ptr, 1);
|
ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
|
||||||
|
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
|
|
||||||
png_free(png_ptr, text_ptr);
|
png_free(png_ptr, text_ptr);
|
||||||
|
if (ret)
|
||||||
|
png_warning(png_ptr, "Insufficient memory to store iTXt chunk.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1497,7 +1516,7 @@ png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr,
|
|||||||
png_ptr->row_fn = row_fn;
|
png_ptr->row_fn = row_fn;
|
||||||
png_ptr->end_fn = end_fn;
|
png_ptr->end_fn = end_fn;
|
||||||
|
|
||||||
png_set_read_fn(png_ptr, progressive_ptr, (png_rw_ptr)png_push_fill_buffer);
|
png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
png_voidp PNGAPI
|
png_voidp PNGAPI
|
||||||
|
|||||||
29
pngread.c
29
pngread.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngread.c - read a PNG file
|
/* pngread.c - read a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -70,8 +70,7 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
png_ptr->zbuf=NULL;
|
png_ptr->zbuf=NULL;
|
||||||
#ifdef PNG_USER_MEM_SUPPORTED
|
#ifdef PNG_USER_MEM_SUPPORTED
|
||||||
png_destroy_struct_2((png_voidp)png_ptr,
|
png_destroy_struct_2((png_voidp)png_ptr,
|
||||||
(png_free_ptr)free_fn,
|
(png_free_ptr)free_fn, (png_voidp)mem_ptr);
|
||||||
(png_voidp)mem_ptr);
|
|
||||||
#else
|
#else
|
||||||
png_destroy_struct((png_voidp)png_ptr);
|
png_destroy_struct((png_voidp)png_ptr);
|
||||||
#endif
|
#endif
|
||||||
@@ -148,6 +147,19 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
|
|
||||||
png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL);
|
png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL);
|
||||||
|
|
||||||
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
|
/* Applications that neglect to set up their own setjmp() and then encounter
|
||||||
|
a png_error() will longjmp here. Since the jmpbuf is then meaningless we
|
||||||
|
abort instead of returning. */
|
||||||
|
#ifdef USE_FAR_KEYWORD
|
||||||
|
if (setjmp(jmpbuf))
|
||||||
|
PNG_ABORT();
|
||||||
|
png_memcpy(png_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf));
|
||||||
|
#else
|
||||||
|
if (setjmp(png_ptr->jmpbuf))
|
||||||
|
PNG_ABORT();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
return (png_ptr);
|
return (png_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +174,6 @@ png_read_init(png_structp png_ptr)
|
|||||||
png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
|
png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef png_read_init_2
|
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
||||||
png_size_t png_struct_size, png_size_t png_info_size)
|
png_size_t png_struct_size, png_size_t png_info_size)
|
||||||
@@ -782,7 +793,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
* not called png_set_interlace_handling(), the display_row buffer will
|
* not called png_set_interlace_handling(), the display_row buffer will
|
||||||
* be ignored, so pass NULL to it.
|
* be ignored, so pass NULL to it.
|
||||||
*
|
*
|
||||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.2
|
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.4beta2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
@@ -831,7 +842,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
|
|||||||
* only call this function once. If you desire to have an image for
|
* only call this function once. If you desire to have an image for
|
||||||
* each pass of a interlaced image, use png_read_rows() instead.
|
* each pass of a interlaced image, use png_read_rows() instead.
|
||||||
*
|
*
|
||||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.2
|
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.4beta2
|
||||||
*/
|
*/
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_read_image(png_structp png_ptr, png_bytepp image)
|
png_read_image(png_structp png_ptr, png_bytepp image)
|
||||||
@@ -1237,6 +1248,12 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
|
|||||||
png_free(png_ptr, png_ptr->save_buffer);
|
png_free(png_ptr, png_ptr->save_buffer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
||||||
|
#ifdef PNG_TEXT_SUPPORTED
|
||||||
|
png_free(png_ptr, png_ptr->current_text);
|
||||||
|
#endif /* PNG_TEXT_SUPPORTED */
|
||||||
|
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
||||||
|
|
||||||
/* Save the important info out of the png_struct, in case it is
|
/* Save the important info out of the png_struct, in case it is
|
||||||
* being used again.
|
* being used again.
|
||||||
*/
|
*/
|
||||||
|
|||||||
6
pngrio.c
6
pngrio.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngrio.c - functions for data input
|
/* pngrio.c - functions for data input
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -39,7 +39,7 @@ png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
|||||||
read_data function and use it at run time with png_set_read_fn(), rather
|
read_data function and use it at run time with png_set_read_fn(), rather
|
||||||
than changing the library. */
|
than changing the library. */
|
||||||
#ifndef USE_FAR_KEYWORD
|
#ifndef USE_FAR_KEYWORD
|
||||||
static void /* PRIVATE */
|
void PNGAPI
|
||||||
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||||
{
|
{
|
||||||
png_size_t check;
|
png_size_t check;
|
||||||
@@ -140,7 +140,7 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
|
|||||||
if (read_data_fn != NULL)
|
if (read_data_fn != NULL)
|
||||||
png_ptr->read_data_fn = read_data_fn;
|
png_ptr->read_data_fn = read_data_fn;
|
||||||
else
|
else
|
||||||
png_ptr->read_data_fn = (png_rw_ptr)png_default_read_data;
|
png_ptr->read_data_fn = png_default_read_data;
|
||||||
#else
|
#else
|
||||||
png_ptr->read_data_fn = read_data_fn;
|
png_ptr->read_data_fn = read_data_fn;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
93
pngrtran.c
93
pngrtran.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -167,15 +167,14 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
Perhaps not the best solution, but good enough. */
|
Perhaps not the best solution, but good enough. */
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
png_bytep sort;
|
|
||||||
|
|
||||||
/* initialize an array to sort colors */
|
/* initialize an array to sort colors */
|
||||||
sort = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_palette
|
png_ptr->dither_sort = (png_bytep)png_malloc(png_ptr,
|
||||||
* sizeof (png_byte)));
|
(png_uint_32)(num_palette * sizeof (png_byte)));
|
||||||
|
|
||||||
/* initialize the sort array */
|
/* initialize the dither_sort array */
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
sort[i] = (png_byte)i;
|
png_ptr->dither_sort[i] = (png_byte)i;
|
||||||
|
|
||||||
/* Find the least used palette entries by starting a
|
/* Find the least used palette entries by starting a
|
||||||
bubble sort, and running it until we have sorted
|
bubble sort, and running it until we have sorted
|
||||||
@@ -191,13 +190,14 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
done = 1;
|
done = 1;
|
||||||
for (j = 0; j < i; j++)
|
for (j = 0; j < i; j++)
|
||||||
{
|
{
|
||||||
if (histogram[sort[j]] < histogram[sort[j + 1]])
|
if (histogram[png_ptr->dither_sort[j]]
|
||||||
|
< histogram[png_ptr->dither_sort[j + 1]])
|
||||||
{
|
{
|
||||||
png_byte t;
|
png_byte t;
|
||||||
|
|
||||||
t = sort[j];
|
t = png_ptr->dither_sort[j];
|
||||||
sort[j] = sort[j + 1];
|
png_ptr->dither_sort[j] = png_ptr->dither_sort[j + 1];
|
||||||
sort[j + 1] = t;
|
png_ptr->dither_sort[j + 1] = t;
|
||||||
done = 0;
|
done = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -214,11 +214,11 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
move the others */
|
move the others */
|
||||||
for (i = 0; i < maximum_colors; i++)
|
for (i = 0; i < maximum_colors; i++)
|
||||||
{
|
{
|
||||||
if ((int)sort[i] >= maximum_colors)
|
if ((int)png_ptr->dither_sort[i] >= maximum_colors)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
j--;
|
j--;
|
||||||
while ((int)sort[j] >= maximum_colors);
|
while ((int)png_ptr->dither_sort[j] >= maximum_colors);
|
||||||
palette[i] = palette[j];
|
palette[i] = palette[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -232,13 +232,13 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
for (i = 0; i < maximum_colors; i++)
|
for (i = 0; i < maximum_colors; i++)
|
||||||
{
|
{
|
||||||
/* only move the colors we need to */
|
/* only move the colors we need to */
|
||||||
if ((int)sort[i] >= maximum_colors)
|
if ((int)png_ptr->dither_sort[i] >= maximum_colors)
|
||||||
{
|
{
|
||||||
png_color tmp_color;
|
png_color tmp_color;
|
||||||
|
|
||||||
do
|
do
|
||||||
j--;
|
j--;
|
||||||
while ((int)sort[j] >= maximum_colors);
|
while ((int)png_ptr->dither_sort[j] >= maximum_colors);
|
||||||
|
|
||||||
tmp_color = palette[j];
|
tmp_color = palette[j];
|
||||||
palette[j] = palette[i];
|
palette[j] = palette[i];
|
||||||
@@ -276,7 +276,8 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
png_free(png_ptr, sort);
|
png_free(png_ptr, png_ptr->dither_sort);
|
||||||
|
png_ptr->dither_sort=NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -291,23 +292,22 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
int i;
|
int i;
|
||||||
int max_d;
|
int max_d;
|
||||||
int num_new_palette;
|
int num_new_palette;
|
||||||
|
png_dsortp t;
|
||||||
png_dsortpp hash;
|
png_dsortpp hash;
|
||||||
png_bytep index_to_palette;
|
|
||||||
/* where the original index currently is in the palette */
|
t=NULL;
|
||||||
png_bytep palette_to_index;
|
|
||||||
/* which original index points to this palette color */
|
|
||||||
|
|
||||||
/* initialize palette index arrays */
|
/* initialize palette index arrays */
|
||||||
index_to_palette = (png_bytep)png_malloc(png_ptr,
|
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * sizeof (png_byte)));
|
(png_uint_32)(num_palette * sizeof (png_byte)));
|
||||||
palette_to_index = (png_bytep)png_malloc(png_ptr,
|
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * sizeof (png_byte)));
|
(png_uint_32)(num_palette * sizeof (png_byte)));
|
||||||
|
|
||||||
/* initialize the sort array */
|
/* initialize the sort array */
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
{
|
{
|
||||||
index_to_palette[i] = (png_byte)i;
|
png_ptr->index_to_palette[i] = (png_byte)i;
|
||||||
palette_to_index[i] = (png_byte)i;
|
png_ptr->palette_to_index[i] = (png_byte)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 *
|
hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 *
|
||||||
@@ -342,18 +342,22 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
|
|
||||||
if (d <= max_d)
|
if (d <= max_d)
|
||||||
{
|
{
|
||||||
png_dsortp t;
|
|
||||||
|
|
||||||
t = (png_dsortp)png_malloc(png_ptr, (png_uint_32)(sizeof
|
t = (png_dsortp)png_malloc_warn(png_ptr,
|
||||||
(png_dsort)));
|
(png_uint_32)(sizeof(png_dsort)));
|
||||||
|
if (t == NULL)
|
||||||
|
break;
|
||||||
t->next = hash[d];
|
t->next = hash[d];
|
||||||
t->left = (png_byte)i;
|
t->left = (png_byte)i;
|
||||||
t->right = (png_byte)j;
|
t->right = (png_byte)j;
|
||||||
hash[d] = t;
|
hash[d] = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (t == NULL)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (t != NULL)
|
||||||
for (i = 0; i <= max_d; i++)
|
for (i = 0; i <= max_d; i++)
|
||||||
{
|
{
|
||||||
if (hash[i] != NULL)
|
if (hash[i] != NULL)
|
||||||
@@ -362,8 +366,10 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
|
|
||||||
for (p = hash[i]; p; p = p->next)
|
for (p = hash[i]; p; p = p->next)
|
||||||
{
|
{
|
||||||
if ((int)index_to_palette[p->left] < num_new_palette &&
|
if ((int)png_ptr->index_to_palette[p->left]
|
||||||
(int)index_to_palette[p->right] < num_new_palette)
|
< num_new_palette &&
|
||||||
|
(int)png_ptr->index_to_palette[p->right]
|
||||||
|
< num_new_palette)
|
||||||
{
|
{
|
||||||
int j, next_j;
|
int j, next_j;
|
||||||
|
|
||||||
@@ -379,7 +385,8 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
}
|
}
|
||||||
|
|
||||||
num_new_palette--;
|
num_new_palette--;
|
||||||
palette[index_to_palette[j]] = palette[num_new_palette];
|
palette[png_ptr->index_to_palette[j]]
|
||||||
|
= palette[num_new_palette];
|
||||||
if (!full_dither)
|
if (!full_dither)
|
||||||
{
|
{
|
||||||
int k;
|
int k;
|
||||||
@@ -387,23 +394,23 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
for (k = 0; k < num_palette; k++)
|
for (k = 0; k < num_palette; k++)
|
||||||
{
|
{
|
||||||
if (png_ptr->dither_index[k] ==
|
if (png_ptr->dither_index[k] ==
|
||||||
index_to_palette[j])
|
png_ptr->index_to_palette[j])
|
||||||
png_ptr->dither_index[k] =
|
png_ptr->dither_index[k] =
|
||||||
index_to_palette[next_j];
|
png_ptr->index_to_palette[next_j];
|
||||||
if ((int)png_ptr->dither_index[k] ==
|
if ((int)png_ptr->dither_index[k] ==
|
||||||
num_new_palette)
|
num_new_palette)
|
||||||
png_ptr->dither_index[k] =
|
png_ptr->dither_index[k] =
|
||||||
index_to_palette[j];
|
png_ptr->index_to_palette[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
index_to_palette[palette_to_index[num_new_palette]] =
|
png_ptr->index_to_palette[png_ptr->palette_to_index
|
||||||
index_to_palette[j];
|
[num_new_palette]] = png_ptr->index_to_palette[j];
|
||||||
palette_to_index[index_to_palette[j]] =
|
png_ptr->palette_to_index[png_ptr->index_to_palette[j]]
|
||||||
palette_to_index[num_new_palette];
|
= png_ptr->palette_to_index[num_new_palette];
|
||||||
|
|
||||||
index_to_palette[j] = (png_byte)num_new_palette;
|
png_ptr->index_to_palette[j] = (png_byte)num_new_palette;
|
||||||
palette_to_index[num_new_palette] = (png_byte)j;
|
png_ptr->palette_to_index[num_new_palette] = (png_byte)j;
|
||||||
}
|
}
|
||||||
if (num_new_palette <= maximum_colors)
|
if (num_new_palette <= maximum_colors)
|
||||||
break;
|
break;
|
||||||
@@ -420,8 +427,6 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
png_dsortp p = hash[i];
|
png_dsortp p = hash[i];
|
||||||
while (p)
|
while (p)
|
||||||
{
|
{
|
||||||
png_dsortp t;
|
|
||||||
|
|
||||||
t = p->next;
|
t = p->next;
|
||||||
png_free(png_ptr, p);
|
png_free(png_ptr, p);
|
||||||
p = t;
|
p = t;
|
||||||
@@ -432,8 +437,10 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
max_d += 96;
|
max_d += 96;
|
||||||
}
|
}
|
||||||
png_free(png_ptr, hash);
|
png_free(png_ptr, hash);
|
||||||
png_free(png_ptr, palette_to_index);
|
png_free(png_ptr, png_ptr->palette_to_index);
|
||||||
png_free(png_ptr, index_to_palette);
|
png_free(png_ptr, png_ptr->index_to_palette);
|
||||||
|
png_ptr->palette_to_index=NULL;
|
||||||
|
png_ptr->index_to_palette=NULL;
|
||||||
}
|
}
|
||||||
num_palette = maximum_colors;
|
num_palette = maximum_colors;
|
||||||
}
|
}
|
||||||
@@ -872,7 +879,7 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN)*/
|
/* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */
|
||||||
else
|
else
|
||||||
/* color_type != PNG_COLOR_TYPE_PALETTE */
|
/* color_type != PNG_COLOR_TYPE_PALETTE */
|
||||||
{
|
{
|
||||||
|
|||||||
137
pngrutil.c
137
pngrutil.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngrutil.c - utilities to read a PNG file
|
/* pngrutil.c - utilities to read a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -200,7 +200,12 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
|||||||
if (text == NULL)
|
if (text == NULL)
|
||||||
{
|
{
|
||||||
text_size = prefix_size + sizeof(msg) + 1;
|
text_size = prefix_size + sizeof(msg) + 1;
|
||||||
text = (png_charp)png_malloc(png_ptr, text_size);
|
text = (png_charp)png_malloc_warn(png_ptr, text_size);
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
png_free(png_ptr,chunkdata);
|
||||||
|
png_error(png_ptr,"Not enough memory to decompress chunk");
|
||||||
|
}
|
||||||
png_memcpy(text, chunkdata, prefix_size);
|
png_memcpy(text, chunkdata, prefix_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +223,12 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
|||||||
{
|
{
|
||||||
text_size = prefix_size +
|
text_size = prefix_size +
|
||||||
png_ptr->zbuf_size - png_ptr->zstream.avail_out;
|
png_ptr->zbuf_size - png_ptr->zstream.avail_out;
|
||||||
text = (png_charp)png_malloc(png_ptr, text_size + 1);
|
text = (png_charp)png_malloc_warn(png_ptr, text_size + 1);
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
png_free(png_ptr,chunkdata);
|
||||||
|
png_error(png_ptr,"Not enough memory to decompress chunk.");
|
||||||
|
}
|
||||||
png_memcpy(text + prefix_size, png_ptr->zbuf,
|
png_memcpy(text + prefix_size, png_ptr->zbuf,
|
||||||
text_size - prefix_size);
|
text_size - prefix_size);
|
||||||
png_memcpy(text, chunkdata, prefix_size);
|
png_memcpy(text, chunkdata, prefix_size);
|
||||||
@@ -229,8 +239,15 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
|||||||
png_charp tmp;
|
png_charp tmp;
|
||||||
|
|
||||||
tmp = text;
|
tmp = text;
|
||||||
text = (png_charp)png_malloc(png_ptr, (png_uint_32)(text_size +
|
text = (png_charp)png_malloc_warn(png_ptr,
|
||||||
|
(png_uint_32)(text_size +
|
||||||
png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1));
|
png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1));
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, tmp);
|
||||||
|
png_free(png_ptr, chunkdata);
|
||||||
|
png_error(png_ptr,"Not enough memory to decompress chunk..");
|
||||||
|
}
|
||||||
png_memcpy(text, tmp, text_size);
|
png_memcpy(text, tmp, text_size);
|
||||||
png_free(png_ptr, tmp);
|
png_free(png_ptr, tmp);
|
||||||
png_memcpy(text + text_size, png_ptr->zbuf,
|
png_memcpy(text + text_size, png_ptr->zbuf,
|
||||||
@@ -269,7 +286,12 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
|||||||
text_size=prefix_size;
|
text_size=prefix_size;
|
||||||
if (text == NULL)
|
if (text == NULL)
|
||||||
{
|
{
|
||||||
text = (png_charp)png_malloc(png_ptr, text_size+1);
|
text = (png_charp)png_malloc_warn(png_ptr, text_size+1);
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, chunkdata);
|
||||||
|
png_error(png_ptr,"Not enough memory for text.");
|
||||||
|
}
|
||||||
png_memcpy(text, chunkdata, prefix_size);
|
png_memcpy(text, chunkdata, prefix_size);
|
||||||
}
|
}
|
||||||
*(text + text_size) = 0x00;
|
*(text + text_size) = 0x00;
|
||||||
@@ -1193,7 +1215,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||||
{
|
{
|
||||||
png_byte readbuf[PNG_MAX_PALETTE_LENGTH];
|
png_byte readbuf[PNG_MAX_PALETTE_LENGTH];
|
||||||
|
|
||||||
png_debug(1, "in png_handle_tRNS\n");
|
png_debug(1, "in png_handle_tRNS\n");
|
||||||
|
|
||||||
@@ -1376,7 +1398,7 @@ void /* PRIVATE */
|
|||||||
png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||||
{
|
{
|
||||||
int num, i;
|
int num, i;
|
||||||
png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH];
|
png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH];
|
||||||
|
|
||||||
png_debug(1, "in png_handle_hIST\n");
|
png_debug(1, "in png_handle_hIST\n");
|
||||||
|
|
||||||
@@ -1542,7 +1564,12 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)\n",
|
png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)\n",
|
||||||
length + 1);
|
length + 1);
|
||||||
purpose = (png_charp)png_malloc(png_ptr, length + 1);
|
purpose = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||||
|
if (purpose == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "No memory for pCAL purpose.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
slength = (png_size_t)length;
|
slength = (png_size_t)length;
|
||||||
png_crc_read(png_ptr, (png_bytep)purpose, slength);
|
png_crc_read(png_ptr, (png_bytep)purpose, slength);
|
||||||
|
|
||||||
@@ -1597,8 +1624,14 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
/* Empty loop to move past the units string. */ ;
|
/* Empty loop to move past the units string. */ ;
|
||||||
|
|
||||||
png_debug(3, "Allocating pCAL parameters array\n");
|
png_debug(3, "Allocating pCAL parameters array\n");
|
||||||
params = (png_charpp)png_malloc(png_ptr, (png_uint_32)(nparams
|
params = (png_charpp)png_malloc_warn(png_ptr, (png_uint_32)(nparams
|
||||||
*sizeof(png_charp))) ;
|
*sizeof(png_charp))) ;
|
||||||
|
if (params == NULL)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, purpose);
|
||||||
|
png_warning(png_ptr, "No memory for pCAL params.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get pointers to the start of each parameter string. */
|
/* Get pointers to the start of each parameter string. */
|
||||||
for (i = 0; i < (int)nparams; i++)
|
for (i = 0; i < (int)nparams; i++)
|
||||||
@@ -1662,7 +1695,12 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)\n",
|
png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)\n",
|
||||||
length + 1);
|
length + 1);
|
||||||
buffer = (png_charp)png_malloc(png_ptr, length + 1);
|
buffer = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||||
|
if (buffer == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Out of memory while processing sCAL chunk");
|
||||||
|
return;
|
||||||
|
}
|
||||||
slength = (png_size_t)length;
|
slength = (png_size_t)length;
|
||||||
png_crc_read(png_ptr, (png_bytep)buffer, slength);
|
png_crc_read(png_ptr, (png_bytep)buffer, slength);
|
||||||
|
|
||||||
@@ -1685,7 +1723,12 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||||
swidth = (png_charp)png_malloc(png_ptr, png_strlen(ep) + 1);
|
swidth = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1);
|
||||||
|
if (swidth == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Out of memory while processing sCAL chunk width");
|
||||||
|
return;
|
||||||
|
}
|
||||||
png_memcpy(swidth, ep, (png_size_t)png_strlen(ep));
|
png_memcpy(swidth, ep, (png_size_t)png_strlen(ep));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -1703,7 +1746,12 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||||
sheight = (png_charp)png_malloc(png_ptr, png_strlen(ep) + 1);
|
sheight = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1);
|
||||||
|
if (swidth == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Out of memory while processing sCAL chunk height");
|
||||||
|
return;
|
||||||
|
}
|
||||||
png_memcpy(sheight, ep, (png_size_t)png_strlen(ep));
|
png_memcpy(sheight, ep, (png_size_t)png_strlen(ep));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -1793,6 +1841,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
png_charp text;
|
png_charp text;
|
||||||
png_uint_32 skip = 0;
|
png_uint_32 skip = 0;
|
||||||
png_size_t slength;
|
png_size_t slength;
|
||||||
|
int ret;
|
||||||
|
|
||||||
png_debug(1, "in png_handle_tEXt\n");
|
png_debug(1, "in png_handle_tEXt\n");
|
||||||
|
|
||||||
@@ -1811,7 +1860,12 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
key = (png_charp)png_malloc(png_ptr, length + 1);
|
key = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||||
|
if (key == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "No memory to process text chunk.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
slength = (png_size_t)length;
|
slength = (png_size_t)length;
|
||||||
png_crc_read(png_ptr, (png_bytep)key, slength);
|
png_crc_read(png_ptr, (png_bytep)key, slength);
|
||||||
|
|
||||||
@@ -1829,7 +1883,13 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (text != key + slength)
|
if (text != key + slength)
|
||||||
text++;
|
text++;
|
||||||
|
|
||||||
text_ptr = (png_textp)png_malloc(png_ptr, (png_uint_32)sizeof(png_text));
|
text_ptr = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)sizeof(png_text));
|
||||||
|
if (text_ptr == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Not enough memory to process text chunk.");
|
||||||
|
png_free(png_ptr, key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
text_ptr->compression = PNG_TEXT_COMPRESSION_NONE;
|
text_ptr->compression = PNG_TEXT_COMPRESSION_NONE;
|
||||||
text_ptr->key = key;
|
text_ptr->key = key;
|
||||||
#ifdef PNG_iTXt_SUPPORTED
|
#ifdef PNG_iTXt_SUPPORTED
|
||||||
@@ -1840,10 +1900,12 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
text_ptr->text = text;
|
text_ptr->text = text;
|
||||||
text_ptr->text_length = png_strlen(text);
|
text_ptr->text_length = png_strlen(text);
|
||||||
|
|
||||||
png_set_text(png_ptr, info_ptr, text_ptr, 1);
|
ret=png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
|
||||||
|
|
||||||
png_free(png_ptr, key);
|
png_free(png_ptr, key);
|
||||||
png_free(png_ptr, text_ptr);
|
png_free(png_ptr, text_ptr);
|
||||||
|
if (ret)
|
||||||
|
png_warning(png_ptr, "Insufficient memory to process text chunk.");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1856,6 +1918,7 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
png_charp chunkdata;
|
png_charp chunkdata;
|
||||||
png_charp text;
|
png_charp text;
|
||||||
int comp_type;
|
int comp_type;
|
||||||
|
int ret;
|
||||||
png_size_t slength, prefix_len, data_len;
|
png_size_t slength, prefix_len, data_len;
|
||||||
|
|
||||||
png_debug(1, "in png_handle_zTXt\n");
|
png_debug(1, "in png_handle_zTXt\n");
|
||||||
@@ -1876,8 +1939,13 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
chunkdata = (png_charp)png_malloc(png_ptr, length + 1);
|
chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||||
slength = (png_size_t)length;
|
if (chunkdata == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr,"Out of memory processing zTXt chunk.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
slength = (png_size_t)length;
|
||||||
png_crc_read(png_ptr, (png_bytep)chunkdata, slength);
|
png_crc_read(png_ptr, (png_bytep)chunkdata, slength);
|
||||||
if (png_crc_finish(png_ptr, 0))
|
if (png_crc_finish(png_ptr, 0))
|
||||||
{
|
{
|
||||||
@@ -1911,7 +1979,13 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
chunkdata = (png_charp)png_decompress_chunk(png_ptr, comp_type, chunkdata,
|
chunkdata = (png_charp)png_decompress_chunk(png_ptr, comp_type, chunkdata,
|
||||||
(png_size_t)length, prefix_len, &data_len);
|
(png_size_t)length, prefix_len, &data_len);
|
||||||
|
|
||||||
text_ptr = (png_textp)png_malloc(png_ptr, (png_uint_32)sizeof(png_text));
|
text_ptr = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)sizeof(png_text));
|
||||||
|
if (text_ptr == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr,"Not enough memory to process zTXt chunk.");
|
||||||
|
png_free(png_ptr, chunkdata);
|
||||||
|
return;
|
||||||
|
}
|
||||||
text_ptr->compression = comp_type;
|
text_ptr->compression = comp_type;
|
||||||
text_ptr->key = chunkdata;
|
text_ptr->key = chunkdata;
|
||||||
#ifdef PNG_iTXt_SUPPORTED
|
#ifdef PNG_iTXt_SUPPORTED
|
||||||
@@ -1922,10 +1996,12 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
text_ptr->text = chunkdata + prefix_len;
|
text_ptr->text = chunkdata + prefix_len;
|
||||||
text_ptr->text_length = data_len;
|
text_ptr->text_length = data_len;
|
||||||
|
|
||||||
png_set_text(png_ptr, info_ptr, text_ptr, 1);
|
ret=png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
|
||||||
|
|
||||||
png_free(png_ptr, text_ptr);
|
png_free(png_ptr, text_ptr);
|
||||||
png_free(png_ptr, chunkdata);
|
png_free(png_ptr, chunkdata);
|
||||||
|
if (ret)
|
||||||
|
png_error(png_ptr, "Insufficient memory to store zTXt chunk.");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1939,6 +2015,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
png_charp key, lang, text, lang_key;
|
png_charp key, lang, text, lang_key;
|
||||||
int comp_flag;
|
int comp_flag;
|
||||||
int comp_type = 0;
|
int comp_type = 0;
|
||||||
|
int ret;
|
||||||
png_size_t slength, prefix_len, data_len;
|
png_size_t slength, prefix_len, data_len;
|
||||||
|
|
||||||
png_debug(1, "in png_handle_iTXt\n");
|
png_debug(1, "in png_handle_iTXt\n");
|
||||||
@@ -1960,7 +2037,12 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
chunkdata = (png_charp)png_malloc(png_ptr, length + 1);
|
chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||||
|
if (chunkdata == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "No memory to process iTXt chunk.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
slength = (png_size_t)length;
|
slength = (png_size_t)length;
|
||||||
png_crc_read(png_ptr, (png_bytep)chunkdata, slength);
|
png_crc_read(png_ptr, (png_bytep)chunkdata, slength);
|
||||||
if (png_crc_finish(png_ptr, 0))
|
if (png_crc_finish(png_ptr, 0))
|
||||||
@@ -2006,7 +2088,13 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
(size_t)length, prefix_len, &data_len);
|
(size_t)length, prefix_len, &data_len);
|
||||||
else
|
else
|
||||||
data_len=png_strlen(chunkdata + prefix_len);
|
data_len=png_strlen(chunkdata + prefix_len);
|
||||||
text_ptr = (png_textp)png_malloc(png_ptr, (png_uint_32)sizeof(png_text));
|
text_ptr = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)sizeof(png_text));
|
||||||
|
if (text_ptr == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr,"Not enough memory to process iTXt chunk.");
|
||||||
|
png_free(png_ptr, chunkdata);
|
||||||
|
return;
|
||||||
|
}
|
||||||
text_ptr->compression = (int)comp_flag + 1;
|
text_ptr->compression = (int)comp_flag + 1;
|
||||||
text_ptr->lang_key = chunkdata+(lang_key-key);
|
text_ptr->lang_key = chunkdata+(lang_key-key);
|
||||||
text_ptr->lang = chunkdata+(lang-key);
|
text_ptr->lang = chunkdata+(lang-key);
|
||||||
@@ -2015,10 +2103,12 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
text_ptr->key = chunkdata;
|
text_ptr->key = chunkdata;
|
||||||
text_ptr->text = chunkdata + prefix_len;
|
text_ptr->text = chunkdata + prefix_len;
|
||||||
|
|
||||||
png_set_text(png_ptr, info_ptr, text_ptr, 1);
|
ret=png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
|
||||||
|
|
||||||
png_free(png_ptr, text_ptr);
|
png_free(png_ptr, text_ptr);
|
||||||
png_free(png_ptr, chunkdata);
|
png_free(png_ptr, chunkdata);
|
||||||
|
if (ret)
|
||||||
|
png_error(png_ptr, "Insufficient memory to store iTXt chunk.");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2084,7 +2174,10 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (!(png_ptr->chunk_name[0] & 0x20))
|
if (!(png_ptr->chunk_name[0] & 0x20))
|
||||||
if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) !=
|
if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) !=
|
||||||
HANDLE_CHUNK_ALWAYS)
|
HANDLE_CHUNK_ALWAYS)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, chunk.data);
|
||||||
png_chunk_error(png_ptr, "unknown critical chunk");
|
png_chunk_error(png_ptr, "unknown critical chunk");
|
||||||
|
}
|
||||||
png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1);
|
png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
110
pngset.c
110
pngset.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngset.c - storage of image information into info struct
|
/* pngset.c - storage of image information into info struct
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -200,7 +200,7 @@ png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
|
|||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
|
png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
png_debug1(1, "in %s storage function\n", "hIST");
|
png_debug1(1, "in %s storage function\n", "hIST");
|
||||||
if (png_ptr == NULL || info_ptr == NULL)
|
if (png_ptr == NULL || info_ptr == NULL)
|
||||||
@@ -216,8 +216,13 @@ png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
|
|||||||
png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
|
png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
|
||||||
#endif
|
#endif
|
||||||
/* Changed from info->num_palette to 256 in version 1.2.1 */
|
/* Changed from info->num_palette to 256 in version 1.2.1 */
|
||||||
png_ptr->hist = (png_uint_16p)png_malloc(png_ptr,
|
png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr,
|
||||||
(png_uint_32)(256 * sizeof (png_uint_16)));
|
(png_uint_32)(256 * sizeof (png_uint_16)));
|
||||||
|
if (png_ptr->hist == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Insufficient memory for hIST chunk data.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < info_ptr->num_palette; i++)
|
for (i = 0; i < info_ptr->num_palette; i++)
|
||||||
png_ptr->hist[i] = hist[i];
|
png_ptr->hist[i] = hist[i];
|
||||||
@@ -305,7 +310,9 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
|
|||||||
info_ptr->compression_type = (png_byte)compression_type;
|
info_ptr->compression_type = (png_byte)compression_type;
|
||||||
info_ptr->filter_type = (png_byte)filter_type;
|
info_ptr->filter_type = (png_byte)filter_type;
|
||||||
info_ptr->interlace_type = (png_byte)interlace_type;
|
info_ptr->interlace_type = (png_byte)interlace_type;
|
||||||
if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
|
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
|
info_ptr->channels = 1;
|
||||||
|
else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
|
||||||
info_ptr->channels = 3;
|
info_ptr->channels = 3;
|
||||||
else
|
else
|
||||||
info_ptr->channels = 1;
|
info_ptr->channels = 1;
|
||||||
@@ -356,7 +363,12 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
|||||||
|
|
||||||
length = png_strlen(purpose) + 1;
|
length = png_strlen(purpose) + 1;
|
||||||
png_debug1(3, "allocating purpose for info (%lu bytes)\n", length);
|
png_debug1(3, "allocating purpose for info (%lu bytes)\n", length);
|
||||||
info_ptr->pcal_purpose = (png_charp)png_malloc(png_ptr, length);
|
info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length);
|
||||||
|
if (info_ptr->pcal_purpose == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Insufficient memory for pCAL purpose.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length);
|
png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length);
|
||||||
|
|
||||||
png_debug(3, "storing X0, X1, type, and nparams in info\n");
|
png_debug(3, "storing X0, X1, type, and nparams in info\n");
|
||||||
@@ -367,11 +379,21 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
|||||||
|
|
||||||
length = png_strlen(units) + 1;
|
length = png_strlen(units) + 1;
|
||||||
png_debug1(3, "allocating units for info (%lu bytes)\n", length);
|
png_debug1(3, "allocating units for info (%lu bytes)\n", length);
|
||||||
info_ptr->pcal_units = (png_charp)png_malloc(png_ptr, length);
|
info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length);
|
||||||
|
if (info_ptr->pcal_units == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Insufficient memory for pCAL units.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
png_memcpy(info_ptr->pcal_units, units, (png_size_t)length);
|
png_memcpy(info_ptr->pcal_units, units, (png_size_t)length);
|
||||||
|
|
||||||
info_ptr->pcal_params = (png_charpp)png_malloc(png_ptr,
|
info_ptr->pcal_params = (png_charpp)png_malloc_warn(png_ptr,
|
||||||
(png_uint_32)((nparams + 1) * sizeof(png_charp)));
|
(png_uint_32)((nparams + 1) * sizeof(png_charp)));
|
||||||
|
if (info_ptr->pcal_params == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Insufficient memory for pCAL params.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
info_ptr->pcal_params[nparams] = NULL;
|
info_ptr->pcal_params[nparams] = NULL;
|
||||||
|
|
||||||
@@ -379,7 +401,12 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
|||||||
{
|
{
|
||||||
length = png_strlen(params[i]) + 1;
|
length = png_strlen(params[i]) + 1;
|
||||||
png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i, length);
|
png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i, length);
|
||||||
info_ptr->pcal_params[i] = (png_charp)png_malloc(png_ptr, length);
|
info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length);
|
||||||
|
if (info_ptr->pcal_params[i] == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Insufficient memory for pCAL parameter.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
png_memcpy(info_ptr->pcal_params[i], params[i], (png_size_t)length);
|
png_memcpy(info_ptr->pcal_params[i], params[i], (png_size_t)length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,6 +652,16 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
|
|||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||||
int num_text)
|
int num_text)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
ret=png_set_text_2(png_ptr, info_ptr, text_ptr, num_text);
|
||||||
|
if (ret)
|
||||||
|
png_error(png_ptr, "Insufficient memory to store text");
|
||||||
|
}
|
||||||
|
|
||||||
|
int /* PRIVATE */
|
||||||
|
png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||||
|
int num_text)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -632,7 +669,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
|||||||
"text" : (png_const_charp)png_ptr->chunk_name));
|
"text" : (png_const_charp)png_ptr->chunk_name));
|
||||||
|
|
||||||
if (png_ptr == NULL || info_ptr == NULL || num_text == 0)
|
if (png_ptr == NULL || info_ptr == NULL || num_text == 0)
|
||||||
return;
|
return(0);
|
||||||
|
|
||||||
/* Make sure we have enough space in the "text" array in info_struct
|
/* Make sure we have enough space in the "text" array in info_struct
|
||||||
* to hold all of the incoming text_ptr objects.
|
* to hold all of the incoming text_ptr objects.
|
||||||
@@ -647,8 +684,13 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
|||||||
old_max = info_ptr->max_text;
|
old_max = info_ptr->max_text;
|
||||||
info_ptr->max_text = info_ptr->num_text + num_text + 8;
|
info_ptr->max_text = info_ptr->num_text + num_text + 8;
|
||||||
old_text = info_ptr->text;
|
old_text = info_ptr->text;
|
||||||
info_ptr->text = (png_textp)png_malloc(png_ptr,
|
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
||||||
(png_uint_32)(info_ptr->max_text * sizeof (png_text)));
|
(png_uint_32)(info_ptr->max_text * sizeof (png_text)));
|
||||||
|
if (info_ptr->text == NULL)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, old_text);
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max *
|
png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max *
|
||||||
sizeof(png_text)));
|
sizeof(png_text)));
|
||||||
png_free(png_ptr, old_text);
|
png_free(png_ptr, old_text);
|
||||||
@@ -657,8 +699,10 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
|||||||
{
|
{
|
||||||
info_ptr->max_text = num_text + 8;
|
info_ptr->max_text = num_text + 8;
|
||||||
info_ptr->num_text = 0;
|
info_ptr->num_text = 0;
|
||||||
info_ptr->text = (png_textp)png_malloc(png_ptr,
|
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
||||||
(png_uint_32)(info_ptr->max_text * sizeof (png_text)));
|
(png_uint_32)(info_ptr->max_text * sizeof (png_text)));
|
||||||
|
if (info_ptr->text == NULL)
|
||||||
|
return(1);
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
#ifdef PNG_FREE_ME_SUPPORTED
|
||||||
info_ptr->free_me |= PNG_FREE_TEXT;
|
info_ptr->free_me |= PNG_FREE_TEXT;
|
||||||
#endif
|
#endif
|
||||||
@@ -718,8 +762,10 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
|||||||
textp->compression = text_ptr[i].compression;
|
textp->compression = text_ptr[i].compression;
|
||||||
}
|
}
|
||||||
|
|
||||||
textp->key = (png_charp)png_malloc(png_ptr,
|
textp->key = (png_charp)png_malloc_warn(png_ptr,
|
||||||
(png_uint_32)(key_len + text_length + lang_len + lang_key_len + 4));
|
(png_uint_32)(key_len + text_length + lang_len + lang_key_len + 4));
|
||||||
|
if (textp->key == NULL)
|
||||||
|
return(1);
|
||||||
png_debug2(2, "Allocated %lu bytes at %x in png_set_text\n",
|
png_debug2(2, "Allocated %lu bytes at %x in png_set_text\n",
|
||||||
(png_uint_32)(key_len + lang_len + lang_key_len + text_length + 4),
|
(png_uint_32)(key_len + lang_len + lang_key_len + text_length + 4),
|
||||||
(int)textp->key);
|
(int)textp->key);
|
||||||
@@ -770,6 +816,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
|||||||
info_ptr->num_text++;
|
info_ptr->num_text++;
|
||||||
png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text);
|
png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text);
|
||||||
}
|
}
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -799,10 +846,10 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
|
|||||||
if (trans != NULL)
|
if (trans != NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* It may not actually be necessary to set png_ptr->trans here;
|
* It may not actually be necessary to set png_ptr->trans here;
|
||||||
* we do it for backward compatibility with the way the png_handle_tRNS
|
* we do it for backward compatibility with the way the png_handle_tRNS
|
||||||
* function used to do the allocation.
|
* function used to do the allocation.
|
||||||
*/
|
*/
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
#ifdef PNG_FREE_ME_SUPPORTED
|
||||||
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
|
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
|
||||||
#endif
|
#endif
|
||||||
@@ -837,8 +884,13 @@ png_set_sPLT(png_structp png_ptr,
|
|||||||
png_sPLT_tp np;
|
png_sPLT_tp np;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
np = (png_sPLT_tp)png_malloc(png_ptr,
|
np = (png_sPLT_tp)png_malloc_warn(png_ptr,
|
||||||
(info_ptr->splt_palettes_num + nentries) * sizeof(png_sPLT_t));
|
(info_ptr->splt_palettes_num + nentries) * sizeof(png_sPLT_t));
|
||||||
|
if (np == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "No memory for splt palettes.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
png_memcpy(np, info_ptr->splt_palettes,
|
png_memcpy(np, info_ptr->splt_palettes,
|
||||||
info_ptr->splt_palettes_num * sizeof(png_sPLT_t));
|
info_ptr->splt_palettes_num * sizeof(png_sPLT_t));
|
||||||
@@ -881,9 +933,14 @@ png_set_unknown_chunks(png_structp png_ptr,
|
|||||||
if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0)
|
if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
np = (png_unknown_chunkp)png_malloc(png_ptr,
|
np = (png_unknown_chunkp)png_malloc_warn(png_ptr,
|
||||||
(info_ptr->unknown_chunks_num + num_unknowns) *
|
(info_ptr->unknown_chunks_num + num_unknowns) *
|
||||||
sizeof(png_unknown_chunk));
|
sizeof(png_unknown_chunk));
|
||||||
|
if (np == NULL)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Out of memory while processing unknown chunk.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
png_memcpy(np, info_ptr->unknown_chunks,
|
png_memcpy(np, info_ptr->unknown_chunks,
|
||||||
info_ptr->unknown_chunks_num * sizeof(png_unknown_chunk));
|
info_ptr->unknown_chunks_num * sizeof(png_unknown_chunk));
|
||||||
@@ -897,11 +954,16 @@ png_set_unknown_chunks(png_structp png_ptr,
|
|||||||
|
|
||||||
png_strcpy((png_charp)to->name, (png_charp)from->name);
|
png_strcpy((png_charp)to->name, (png_charp)from->name);
|
||||||
to->data = (png_bytep)png_malloc(png_ptr, from->size);
|
to->data = (png_bytep)png_malloc(png_ptr, from->size);
|
||||||
png_memcpy(to->data, from->data, from->size);
|
if (to->data == NULL)
|
||||||
to->size = from->size;
|
png_warning(png_ptr, "Out of memory while processing unknown chunk.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
png_memcpy(to->data, from->data, from->size);
|
||||||
|
to->size = from->size;
|
||||||
|
|
||||||
/* note our location in the read or write sequence */
|
/* note our location in the read or write sequence */
|
||||||
to->location = (png_byte)(png_ptr->mode & 0xff);
|
to->location = (png_byte)(png_ptr->mode & 0xff);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info_ptr->unknown_chunks = np;
|
info_ptr->unknown_chunks = np;
|
||||||
@@ -1079,8 +1141,8 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
|
|||||||
* so first zero them out of the master copy, then logical-OR in the
|
* so first zero them out of the master copy, then logical-OR in the
|
||||||
* allowed subset that was requested */
|
* allowed subset that was requested */
|
||||||
|
|
||||||
png_ptr->asm_flags &= ~settable_asm_flags; /* zero them */
|
png_ptr->asm_flags &= ~settable_asm_flags; /* zero them */
|
||||||
png_ptr->asm_flags |= (asm_flags & settable_asm_flags); /* set them */
|
png_ptr->asm_flags |= (asm_flags & settable_asm_flags); /* set them */
|
||||||
}
|
}
|
||||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngtest.c - a simple test program to test libpng
|
/* pngtest.c - a simple test program to test libpng
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !PNG_DEBUG
|
#if !PNG_DEBUG
|
||||||
# define SINGLE_ROWBUF_ALLOC /* makes buffer overruns easier to nail */
|
# define SINGLE_ROWBUF_ALLOC /* makes buffer overruns easier to nail */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Turn on CPU timing
|
/* Turn on CPU timing
|
||||||
@@ -1512,4 +1512,4 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef version_1_2_2 your_png_h_is_not_version_1_2_2;
|
typedef version_1_2_4beta2 your_png_h_is_not_version_1_2_4beta2;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
*
|
*
|
||||||
* For Intel x86 CPU and Microsoft Visual C++ compiler
|
* For Intel x86 CPU and Microsoft Visual C++ compiler
|
||||||
*
|
*
|
||||||
* libpng version 1.2.2 - April 15, 2002
|
* libpng version 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* Copyright (c) 1998, Intel Corporation
|
* Copyright (c) 1998, Intel Corporation
|
||||||
|
|||||||
12
pngwio.c
12
pngwio.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngwio.c - functions for data output
|
/* pngwio.c - functions for data output
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -40,7 +40,7 @@ png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
|||||||
write_data function and use it at run time with png_set_write_fn(), rather
|
write_data function and use it at run time with png_set_write_fn(), rather
|
||||||
than changing the library. */
|
than changing the library. */
|
||||||
#ifndef USE_FAR_KEYWORD
|
#ifndef USE_FAR_KEYWORD
|
||||||
static void /* PRIVATE */
|
void PNGAPI
|
||||||
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||||
{
|
{
|
||||||
png_uint_32 check;
|
png_uint_32 check;
|
||||||
@@ -63,7 +63,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
|||||||
#define NEAR_BUF_SIZE 1024
|
#define NEAR_BUF_SIZE 1024
|
||||||
#define MIN(a,b) (a <= b ? a : b)
|
#define MIN(a,b) (a <= b ? a : b)
|
||||||
|
|
||||||
static void /* PRIVATE */
|
void PNGAPI
|
||||||
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||||
{
|
{
|
||||||
png_uint_32 check;
|
png_uint_32 check;
|
||||||
@@ -126,7 +126,7 @@ png_flush(png_structp png_ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(PNG_NO_STDIO)
|
#if !defined(PNG_NO_STDIO)
|
||||||
static void /* PRIVATE */
|
void PNGAPI
|
||||||
png_default_flush(png_structp png_ptr)
|
png_default_flush(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
#if !defined(_WIN32_WCE)
|
#if !defined(_WIN32_WCE)
|
||||||
@@ -171,7 +171,7 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
|
|||||||
if (write_data_fn != NULL)
|
if (write_data_fn != NULL)
|
||||||
png_ptr->write_data_fn = write_data_fn;
|
png_ptr->write_data_fn = write_data_fn;
|
||||||
else
|
else
|
||||||
png_ptr->write_data_fn = (png_rw_ptr)png_default_write_data;
|
png_ptr->write_data_fn = png_default_write_data;
|
||||||
#else
|
#else
|
||||||
png_ptr->write_data_fn = write_data_fn;
|
png_ptr->write_data_fn = write_data_fn;
|
||||||
#endif
|
#endif
|
||||||
@@ -181,7 +181,7 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
|
|||||||
if (output_flush_fn != NULL)
|
if (output_flush_fn != NULL)
|
||||||
png_ptr->output_flush_fn = output_flush_fn;
|
png_ptr->output_flush_fn = output_flush_fn;
|
||||||
else
|
else
|
||||||
png_ptr->output_flush_fn = (png_flush_ptr)png_default_flush;
|
png_ptr->output_flush_fn = png_default_flush;
|
||||||
#else
|
#else
|
||||||
png_ptr->output_flush_fn = output_flush_fn;
|
png_ptr->output_flush_fn = output_flush_fn;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
18
pngwrite.c
18
pngwrite.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngwrite.c - general routines to write a PNG file
|
/* pngwrite.c - general routines to write a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -530,7 +530,20 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
1, png_doublep_NULL, png_doublep_NULL);
|
1, png_doublep_NULL, png_doublep_NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ((png_structp)png_ptr);
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
|
/* Applications that neglect to set up their own setjmp() and then encounter
|
||||||
|
a png_error() will longjmp here. Since the jmpbuf is then meaningless we
|
||||||
|
abort instead of returning. */
|
||||||
|
#ifdef USE_FAR_KEYWORD
|
||||||
|
if (setjmp(jmpbuf))
|
||||||
|
PNG_ABORT();
|
||||||
|
png_memcpy(png_ptr->jmpbuf,jmpbuf,sizeof(jmp_buf));
|
||||||
|
#else
|
||||||
|
if (setjmp(png_ptr->jmpbuf))
|
||||||
|
PNG_ABORT();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
return (png_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize png_ptr structure, and allocate any memory needed */
|
/* Initialize png_ptr structure, and allocate any memory needed */
|
||||||
@@ -542,7 +555,6 @@ png_write_init(png_structp png_ptr)
|
|||||||
png_write_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
|
png_write_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef png_write_init_2
|
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
||||||
png_size_t png_struct_size, png_size_t png_info_size)
|
png_size_t png_struct_size, png_size_t png_info_size)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngwutil.c - utilities to write a PNG file
|
/* pngwutil.c - utilities to write a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.2.2 - April 15, 2002
|
* libpng 1.2.4beta2 - June 20, 2002
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Microsoft Developer Studio Build File, Format Version 6.00 for
|
Microsoft Developer Studio Build File, Format Version 6.00 for
|
||||||
libpng 1.2.2 (April 15, 2002) and zlib
|
libpng 1.2.4beta2 (June 20, 2002) and zlib
|
||||||
|
|
||||||
Copyright (C) 2000 Simon-Pierre Cadieux
|
Copyright (C) 2000 Simon-Pierre Cadieux
|
||||||
For conditions of distribution and use, see copyright notice in png.h
|
For conditions of distribution and use, see copyright notice in png.h
|
||||||
@@ -9,14 +9,19 @@ Assumes that zlib sources have been copied to ..\..\..\zlib
|
|||||||
|
|
||||||
To build:
|
To build:
|
||||||
|
|
||||||
1) On the main menu Select "Build|Set Active configuration".
|
0) On the main menu, select "File | Open Workspace" and then
|
||||||
|
select "libpng.dsw".
|
||||||
|
|
||||||
|
1) On the main menu Select "Build | Set Active configuration".
|
||||||
Among the configurations beginning with "libpng" select the
|
Among the configurations beginning with "libpng" select the
|
||||||
one you wish to build (the corresponding "zlib" configuration
|
one you wish to build (the corresponding "zlib" configuration
|
||||||
will be built automatically).
|
will be built automatically).
|
||||||
|
|
||||||
2) Select "Build|Clean"
|
2) Select "Build | Clean"
|
||||||
|
|
||||||
3) Select "Build|Rebuild All"
|
3) Select "Build | Rebuild All". Ignore warning messages about
|
||||||
|
not being able to find certain include files (e.g., m68881.h,
|
||||||
|
alloc.h).
|
||||||
|
|
||||||
4) Look in the appropriate "win32" subdirectories for both "zlib"
|
4) Look in the appropriate "win32" subdirectories for both "zlib"
|
||||||
and "libpng" binaries.
|
and "libpng" binaries.
|
||||||
@@ -24,14 +29,16 @@ To build:
|
|||||||
This project will build the PNG Development Group's "official" versions of
|
This project will build the PNG Development Group's "official" versions of
|
||||||
libpng and zlib libraries:
|
libpng and zlib libraries:
|
||||||
|
|
||||||
libpng12.dll (default version, currently C code only)
|
libpng13.dll (default version, currently C code only)
|
||||||
libpng12.dll (C + Assembler version)
|
libpng13a.dll (C + Assembler version)
|
||||||
libpng12.dll (C + Assembler debug version)
|
libpng13b.dll (C + Assembler debug version)
|
||||||
libpng12.dll (C code debug version)
|
libpng13d.dll (C code debug version)
|
||||||
libpng12[c,e-m].dll (reserved for official versions)
|
libpng13vb.dll (version for VB, uses "stdcall" protocol)
|
||||||
libpng12[n-z].dll (available for private versions)
|
libpng13[c,e-m].dll (reserved for official versions)
|
||||||
|
libpng13[n-z].dll (available for private versions)
|
||||||
zlib.dll (default version, currently C code only)
|
zlib.dll (default version, currently C code only)
|
||||||
zlibd.dll (debug version)
|
zlibd.dll (debug version)
|
||||||
|
zlibvb.dll (version for Visual Basic, uses "stdcall" protocol)
|
||||||
|
|
||||||
If you change anything in libpng, or select different compiler settings,
|
If you change anything in libpng, or select different compiler settings,
|
||||||
please change the library name to an unreserved name, and define
|
please change the library name to an unreserved name, and define
|
||||||
@@ -45,3 +52,6 @@ above mentioned libraries you should also include this DLL in your package.
|
|||||||
For a list of files that are redistributable in Visual C++ 6.0, see
|
For a list of files that are redistributable in Visual C++ 6.0, see
|
||||||
Common\Redist\Redist.txt on Disc 1 of the Visual C++ 6.0 product CDs.
|
Common\Redist\Redist.txt on Disc 1 of the Visual C++ 6.0 product CDs.
|
||||||
|
|
||||||
|
5) For an example workspace that builds an application using the resulting
|
||||||
|
DLLs, go to Libpng's contrib\msvctest directory and use it to build
|
||||||
|
and run "pngtest".
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ CFG=libpng - Win32 DLL
|
|||||||
!MESSAGE "libpng - Win32 DLL Debug ASM" (based on "Win32 (x86) Dynamic-Link Library")
|
!MESSAGE "libpng - Win32 DLL Debug ASM" (based on "Win32 (x86) Dynamic-Link Library")
|
||||||
!MESSAGE "libpng - Win32 LIB" (based on "Win32 (x86) Static Library")
|
!MESSAGE "libpng - Win32 LIB" (based on "Win32 (x86) Static Library")
|
||||||
!MESSAGE "libpng - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
|
!MESSAGE "libpng - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
|
||||||
|
!MESSAGE "libpng - Win32 DLL VB" (based on "Win32 (x86) Dynamic-Link Library")
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
|
|
||||||
# Begin Project
|
# Begin Project
|
||||||
@@ -56,7 +57,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||||
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll\libpng12.dll"
|
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll\libpng13.dll"
|
||||||
# SUBTRACT LINK32 /pdb:none
|
# SUBTRACT LINK32 /pdb:none
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
|
||||||
@@ -84,7 +85,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbg\libpng12d.dll"
|
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbg\libpng13d.dll"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM"
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM"
|
||||||
|
|
||||||
@@ -111,7 +112,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||||
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll_asm\libpng12a.dll"
|
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll_asm\libpng13a.dll"
|
||||||
# SUBTRACT LINK32 /pdb:none
|
# SUBTRACT LINK32 /pdb:none
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug ASM"
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug ASM"
|
||||||
@@ -133,13 +134,13 @@ CPP=cl.exe
|
|||||||
MTL=midl.exe
|
MTL=midl.exe
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d PNG_DEBUG=1 /d "PNG_USE_PNGVCRD"
|
# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d PNG_DEBUG=1 /d "PNG_USE_PNGVCRD"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbga\libpng12b.dll"
|
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbga\libpng13b.dll"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "libpng - Win32 LIB"
|
!ELSEIF "$(CFG)" == "libpng - Win32 LIB"
|
||||||
|
|
||||||
@@ -193,6 +194,36 @@ LIB32=link.exe -lib
|
|||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo
|
# ADD LIB32 /nologo
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB"
|
||||||
|
|
||||||
|
# PROP BASE Use_MFC 0
|
||||||
|
# PROP BASE Use_Debug_Libraries 0
|
||||||
|
# PROP BASE Output_Dir "libpng___Win32_DLL_VB"
|
||||||
|
# PROP BASE Intermediate_Dir "libpng___Win32_DLL_VB"
|
||||||
|
# PROP BASE Ignore_Export_Lib 0
|
||||||
|
# PROP BASE Target_Dir ""
|
||||||
|
# PROP Use_MFC 0
|
||||||
|
# PROP Use_Debug_Libraries 0
|
||||||
|
# PROP Output_Dir ".\win32\libpng\dll_vb"
|
||||||
|
# PROP Intermediate_Dir ".\win32\libpng\dll_vb"
|
||||||
|
# PROP Ignore_Export_Lib 0
|
||||||
|
# PROP Target_Dir ""
|
||||||
|
CPP=cl.exe
|
||||||
|
# ADD BASE CPP /nologo /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /c
|
||||||
|
# ADD CPP /nologo /Gd /MD /W3 /O1 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D PNGAPI=__stdcall /Yu"png.h" /FD /c
|
||||||
|
MTL=midl.exe
|
||||||
|
RSC=rc.exe
|
||||||
|
# ADD BASE RSC /l 0x409 /i "..\.." /d "NDEBUG"
|
||||||
|
# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
# ADD BASE BSC32 /nologo
|
||||||
|
# ADD BSC32 /nologo
|
||||||
|
LINK32=link.exe
|
||||||
|
# ADD BASE LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll\libpng13.dll"
|
||||||
|
# SUBTRACT BASE LINK32 /pdb:none
|
||||||
|
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll_vb\libpngvb13.dll"
|
||||||
|
# SUBTRACT LINK32 /pdb:none
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# Begin Target
|
# Begin Target
|
||||||
@@ -203,6 +234,7 @@ LIB32=link.exe -lib
|
|||||||
# Name "libpng - Win32 DLL Debug ASM"
|
# Name "libpng - Win32 DLL Debug ASM"
|
||||||
# Name "libpng - Win32 LIB"
|
# Name "libpng - Win32 LIB"
|
||||||
# Name "libpng - Win32 LIB Debug"
|
# Name "libpng - Win32 LIB Debug"
|
||||||
|
# Name "libpng - Win32 DLL VB"
|
||||||
# Begin Group "Source Files"
|
# Begin Group "Source Files"
|
||||||
|
|
||||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
@@ -231,6 +263,8 @@ SOURCE=.\png.rc
|
|||||||
|
|
||||||
# PROP Exclude_From_Build 1
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB"
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
@@ -254,6 +288,8 @@ SOURCE=.\png32ms.def
|
|||||||
|
|
||||||
# PROP Exclude_From_Build 1
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB"
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
@@ -322,6 +358,11 @@ SOURCE=..\..\pngvcrd.c
|
|||||||
|
|
||||||
# PROP Exclude_From_Build 1
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB"
|
||||||
|
|
||||||
|
# PROP BASE Exclude_From_Build 1
|
||||||
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
@@ -361,7 +402,38 @@ SOURCE=..\..\pngconf.h
|
|||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\readme.txt
|
SOURCE=.\readme.txt
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "libpng - Win32 DLL"
|
||||||
|
|
||||||
# PROP Exclude_From_Build 1
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
|
||||||
|
|
||||||
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM"
|
||||||
|
|
||||||
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug ASM"
|
||||||
|
|
||||||
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 LIB"
|
||||||
|
|
||||||
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug"
|
||||||
|
|
||||||
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB"
|
||||||
|
|
||||||
|
# PROP BASE Exclude_From_Build 1
|
||||||
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Target
|
# End Target
|
||||||
# End Project
|
# End Project
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ LIBRARY
|
|||||||
DESCRIPTION "PNG image compression library for Windows"
|
DESCRIPTION "PNG image compression library for Windows"
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
;Version 1.2.2
|
;Version 1.2.4beta2
|
||||||
png_build_grayscale_palette @1
|
png_build_grayscale_palette @1
|
||||||
png_check_sig @2
|
png_check_sig @2
|
||||||
png_chunk_error @3
|
png_chunk_error @3
|
||||||
@@ -213,5 +213,8 @@ EXPORTS
|
|||||||
png_set_strip_error_numbers @193
|
png_set_strip_error_numbers @193
|
||||||
; Added at version 1.2.2
|
; Added at version 1.2.2
|
||||||
png_handle_as_unknown @194
|
png_handle_as_unknown @194
|
||||||
png_zalloc @195
|
; Added at version 1.2.2 and deleted from 1.2.3
|
||||||
png_zfree @196
|
; png_zalloc @195
|
||||||
|
; png_zfree @196
|
||||||
|
; Added at version 1.2.4
|
||||||
|
png_malloc_warn @195
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ CFG=zlib - Win32 DLL
|
|||||||
!MESSAGE "zlib - Win32 DLL Debug ASM" (based on "Win32 (x86) Dynamic-Link Library")
|
!MESSAGE "zlib - Win32 DLL Debug ASM" (based on "Win32 (x86) Dynamic-Link Library")
|
||||||
!MESSAGE "zlib - Win32 LIB" (based on "Win32 (x86) Static Library")
|
!MESSAGE "zlib - Win32 LIB" (based on "Win32 (x86) Static Library")
|
||||||
!MESSAGE "zlib - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
|
!MESSAGE "zlib - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
|
||||||
|
!MESSAGE "zlib - Win32 DLL VB" (based on "Win32 (x86) Dynamic-Link Library")
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
|
|
||||||
# Begin Project
|
# Begin Project
|
||||||
@@ -193,6 +194,36 @@ LIB32=link.exe -lib
|
|||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo
|
# ADD LIB32 /nologo
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "zlib - Win32 DLL VB"
|
||||||
|
|
||||||
|
# PROP BASE Use_MFC 0
|
||||||
|
# PROP BASE Use_Debug_Libraries 0
|
||||||
|
# PROP BASE Output_Dir "zlib___Win32_DLL_VB"
|
||||||
|
# PROP BASE Intermediate_Dir "zlib___Win32_DLL_VB"
|
||||||
|
# PROP BASE Ignore_Export_Lib 0
|
||||||
|
# PROP BASE Target_Dir ""
|
||||||
|
# PROP Use_MFC 0
|
||||||
|
# PROP Use_Debug_Libraries 0
|
||||||
|
# PROP Output_Dir ".\win32\zlib\dll_vb"
|
||||||
|
# PROP Intermediate_Dir ".\win32\zlib\dll_vb"
|
||||||
|
# PROP Ignore_Export_Lib 0
|
||||||
|
# PROP Target_Dir ""
|
||||||
|
CPP=cl.exe
|
||||||
|
# ADD BASE CPP /nologo /MD /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ZLIB_DLL" /FD /c
|
||||||
|
# ADD CPP /nologo /Gd /MD /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ZLIB_DLL" /FD /c
|
||||||
|
MTL=midl.exe
|
||||||
|
RSC=rc.exe
|
||||||
|
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||||
|
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
# ADD BASE BSC32 /nologo
|
||||||
|
# ADD BSC32 /nologo
|
||||||
|
LINK32=link.exe
|
||||||
|
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||||
|
# SUBTRACT BASE LINK32 /pdb:none
|
||||||
|
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\zlib\dll_vb/zlibvb.dll"
|
||||||
|
# SUBTRACT LINK32 /pdb:none
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# Begin Target
|
# Begin Target
|
||||||
@@ -203,6 +234,7 @@ LIB32=link.exe -lib
|
|||||||
# Name "zlib - Win32 DLL Debug ASM"
|
# Name "zlib - Win32 DLL Debug ASM"
|
||||||
# Name "zlib - Win32 LIB"
|
# Name "zlib - Win32 LIB"
|
||||||
# Name "zlib - Win32 LIB Debug"
|
# Name "zlib - Win32 LIB Debug"
|
||||||
|
# Name "zlib - Win32 DLL VB"
|
||||||
# Begin Group "Source Files"
|
# Begin Group "Source Files"
|
||||||
|
|
||||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
@@ -246,6 +278,11 @@ SOURCE=..\..\..\zlib\contrib\asm386\gvmat32c.c
|
|||||||
|
|
||||||
# PROP Exclude_From_Build 1
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "zlib - Win32 DLL VB"
|
||||||
|
|
||||||
|
# PROP BASE Exclude_From_Build 1
|
||||||
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
@@ -312,6 +349,8 @@ SOURCE=.\zlib.def
|
|||||||
|
|
||||||
# PROP Exclude_From_Build 1
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "zlib - Win32 DLL VB"
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
@@ -335,6 +374,8 @@ SOURCE=..\..\..\zlib\msdos\zlib.rc
|
|||||||
|
|
||||||
# PROP Exclude_From_Build 1
|
# PROP Exclude_From_Build 1
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "zlib - Win32 DLL VB"
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
A set of project files is available for Netware. Get
|
A set of project files is available for Netware. Get
|
||||||
libpng-1.2.2-project-netware.zip from a libpng distribution
|
libpng-1.2.4beta2-project-netware.zip from a libpng distribution
|
||||||
site such as http://libpng.sourceforge.net
|
site such as http://libpng.sourceforge.net
|
||||||
|
|
||||||
Put the zip file in this directory (projects) and then run
|
Put the zip file in this directory (projects) and then run
|
||||||
"unzip -a libpng-1.2.2-project-netware.zip"
|
"unzip -a libpng-1.2.4beta2-project-netware.zip"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
A set of project files is available for WinCE. Get
|
A set of project files is available for WinCE. Get
|
||||||
libpng-1.2.2-project-wince.zip from a libpng distribution
|
libpng-1.2.4beta2-project-wince.zip from a libpng distribution
|
||||||
site such as http://libpng.sourceforge.net
|
site such as http://libpng.sourceforge.net
|
||||||
|
|
||||||
Put the zip file in this directory (projects) and then run
|
Put the zip file in this directory (projects) and then run
|
||||||
"unzip -a libpng-1.2.2-project-wince.zip"
|
"unzip -a libpng-1.2.4beta2-project-wince.zip"
|
||||||
|
|||||||
65
scripts/libpng-config-body.in
Executable file
65
scripts/libpng-config-body.in
Executable file
@@ -0,0 +1,65 @@
|
|||||||
|
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
cat <<EOF
|
||||||
|
Usage: libpng-config [OPTION] ...
|
||||||
|
|
||||||
|
Known values for OPTION are:
|
||||||
|
|
||||||
|
--prefix print libpng prefix
|
||||||
|
--libs print library linking information
|
||||||
|
--cflags print compiler flags
|
||||||
|
--cppflags print pre-processor flags
|
||||||
|
--ldflags print loader flags
|
||||||
|
--help display this help and exit
|
||||||
|
--version output version information
|
||||||
|
EOF
|
||||||
|
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
usage 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
while test $# -gt 0; do
|
||||||
|
case "$1" in
|
||||||
|
|
||||||
|
--prefix)
|
||||||
|
echo ${prefix}
|
||||||
|
;;
|
||||||
|
|
||||||
|
--version)
|
||||||
|
echo ${version}
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
--help)
|
||||||
|
usage 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
--cflags)
|
||||||
|
echo ${cflags}
|
||||||
|
;;
|
||||||
|
|
||||||
|
--cppflags)
|
||||||
|
echo ${cppflags}
|
||||||
|
;;
|
||||||
|
|
||||||
|
--libs)
|
||||||
|
echo ${libs}
|
||||||
|
;;
|
||||||
|
|
||||||
|
--ldflags)
|
||||||
|
echo ${ldflags}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
exit 0
|
||||||
17
scripts/libpng-config-head.in
Executable file
17
scripts/libpng-config-head.in
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# libpng-config
|
||||||
|
# provides configuration info for libpng.
|
||||||
|
|
||||||
|
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||||
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
|
# Modeled after libxml-config.
|
||||||
|
|
||||||
|
version=1.2.4beta2
|
||||||
|
prefix=""
|
||||||
|
cppflags=""
|
||||||
|
cflags=""
|
||||||
|
ldflags=""
|
||||||
|
libs=""
|
||||||
|
|
||||||
@@ -6,6 +6,6 @@ includedir=${exec_prefix}/include
|
|||||||
|
|
||||||
Name: libpng12
|
Name: libpng12
|
||||||
Description: Loads and saves PNG files
|
Description: Loads and saves PNG files
|
||||||
Version: 1.2.2
|
Version: 1.2.4beta2
|
||||||
Libs: -L${libdir} -lpng12
|
Libs: -L${libdir} -lpng12 -lz -lm
|
||||||
Cflags: -I${includedir}/libpng12
|
Cflags: -I${includedir}/libpng12
|
||||||
|
|||||||
@@ -33,11 +33,28 @@ RANLIB=echo
|
|||||||
|
|
||||||
LIBNAME=libpng12
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -50,12 +67,25 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).so pngtest
|
all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"-xtarget=ultra\"; \
|
||||||
|
echo ldflags=\"-xtarget=ultra -L$(LIBPATH) -R$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
@@ -85,42 +115,66 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm $(INCPATH)/libpng
|
-@/bin/rm $(DI)/libpng
|
||||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -f -s $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng12.pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/libpng12.pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/libpng12.pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -f -s libpng12.pc libpng.pc)
|
||||||
|
|
||||||
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/libpng12-config
|
||||||
|
cp libpng-config $(DB)/libpng12-config
|
||||||
|
chmod 755 $(DB)/libpng12-config
|
||||||
|
(cd $(DB); ln -sf libpng12-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
|
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
||||||
|
pngtest pngout.png
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||||
writelock:
|
writelock:
|
||||||
|
|||||||
@@ -33,11 +33,28 @@ RANLIB=echo
|
|||||||
|
|
||||||
LIBNAME=libpng12
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -50,12 +67,25 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).so pngtest
|
all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"-xtarget=ultra -xarch=v9\"; \
|
||||||
|
echo ldflags=\"-xtarget=ultra -xarch=v9 -L$(LIBPATH) -R$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
@@ -85,42 +115,66 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm $(INCPATH)/libpng
|
-@/bin/rm $(DI)/libpng
|
||||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -f -s $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
|
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
||||||
|
pngtest pngout.png
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||||
writelock:
|
writelock:
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
# makefile for libpng using gcc (generic, static library)
|
# makefile for libpng using gcc (generic, static library)
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 2000 Cosmin Truta
|
# Copyright (C) 2000 Cosmin Truta
|
||||||
# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
|
# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
|
||||||
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
# Location of the zlib library and include files
|
# Location of the zlib library and include files
|
||||||
@@ -15,16 +16,27 @@ AR = ar rcs
|
|||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DI=$(DESTDIR)/$(INCPATH)
|
||||||
|
DL=$(DESTDIR)/$(LIBPATH)
|
||||||
|
|
||||||
CDEBUG = -g -DPNG_DEBUG=5
|
CDEBUG = -g -DPNG_DEBUG=5
|
||||||
LDDEBUG =
|
LDDEBUG =
|
||||||
CRELEASE = -O2
|
CRELEASE = -O2
|
||||||
@@ -56,14 +68,16 @@ pngtest$(E): pngtest$(O) libpng$(A)
|
|||||||
$(LD) -o $@ pngtest$(O) $(LDFLAGS)
|
$(LD) -o $@ pngtest$(O) $(LDFLAGS)
|
||||||
|
|
||||||
install: libpng.a
|
install: libpng.a
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/libpng ]; then mkdir $(INCPATH)/libpng; fi
|
-@if [ ! -d $(DI)/libpng ]; then mkdir $(DI)/libpng; fi
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@rm $(INCPATH)/png.h
|
-@rm $(DI)/png.h
|
||||||
-@rm $(INCPATH)/pngconf.h
|
-@rm $(DI)/pngconf.h
|
||||||
cp png.h pngconf.h $(INCPATH)/libpng
|
cp png.h pngconf.h $(DI)/libpng
|
||||||
chmod 644 $(INCPATH)/libpng/png.h $(INCPATH)/libpng/pngconf.h
|
chmod 644 $(DI)/libpng/png.h \
|
||||||
cp libpng.a $(LIBPATH)
|
$(DI)/libpng/pngconf.h
|
||||||
|
(cd $(DI); ln -f -s libpng/* .)
|
||||||
|
cp libpng.a $(DL)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a pngtest pngout.png
|
/bin/rm -f *.o libpng.a pngtest pngout.png
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# makefile for libpng
|
# makefile for libpng
|
||||||
|
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
# modified for LC56/ATARI assumes libz.lib is in same dir and uses default
|
# modified for LC56/ATARI assumes libz.lib is in same dir and uses default
|
||||||
@@ -10,6 +11,18 @@ LDFLAGS=-lpng -lz -lm
|
|||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
# where make install puts libpng.a and png.h
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
INCPATH=$(prefix)/include
|
||||||
|
LIBPATH=$(prefix)/lib
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\
|
OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\
|
||||||
$(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\
|
$(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\
|
||||||
@@ -25,12 +38,14 @@ pngtest.ttp: pngtest.o $(LBR)
|
|||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o
|
$(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o
|
||||||
|
|
||||||
install: libpng.a
|
install: libpng.a
|
||||||
-@mkdir $(prefix)/include
|
-@mkdir $(DESTDIR)$(INCPATH)
|
||||||
-@mkdir $(prefix)/include/libpng
|
-@mkdir $(DESTDIR)$(INCPATH)/libpng
|
||||||
-@mkdir $(prefix)/lib
|
-@mkdir $(DESTDIR)$(LIBPATH)
|
||||||
-@rm -f $(prefix)/include/png.h
|
-@rm -f $(DESTDIR)$(INCPATH)/png.h
|
||||||
-@rm -f $(prefix)/include/pngconf.h
|
-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
|
||||||
cp png.h $(prefix)/include/libpng
|
cp png.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
cp pngconf.h $(prefix)/include/libpng
|
cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
chmod 644 $(prefix)/include/libpng/png.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
|
||||||
chmod 644 $(prefix)/include/libpng/pngconf.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
|
||||||
|
(cd $(DESTDIR)$(INCPATH); ln -f -s $(LIBNAME) libpng; \
|
||||||
|
ln -f -s $(LIBNAME)/* .)
|
||||||
|
|||||||
@@ -11,10 +11,8 @@ CC=gcc
|
|||||||
ZLIBLIB=/usr/local/lib
|
ZLIBLIB=/usr/local/lib
|
||||||
ZLIBINC=/usr/local/include
|
ZLIBINC=/usr/local/include
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
ALIGN=
|
ALIGN=
|
||||||
@@ -39,6 +37,24 @@ RANLIB=ranlib
|
|||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
LIBNAME=libpng12
|
LIBNAME=libpng12
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
@@ -49,12 +65,25 @@ OBJSDLL = $(OBJS)
|
|||||||
|
|
||||||
.SUFFIXES: .c .o
|
.SUFFIXES: .c .o
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).so pngtest
|
all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"\"; \
|
||||||
|
echo ldflags=\"-Wl,-soname=$(LIBNAME).so.$(PNGMAJ)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
cp $(LIBNAME).so* /boot/home/config/lib
|
cp $(LIBNAME).so* /boot/home/config/lib
|
||||||
@@ -74,41 +103,62 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
||||||
|
|||||||
@@ -1,15 +1,39 @@
|
|||||||
# makefile for cygwin on x86
|
# makefile for cygwin on x86
|
||||||
# builds both dll (with import lib) and static lib versions
|
# Builds both dll (with import lib) and static lib versions
|
||||||
# of the library, and builds two copies of pngtest: one
|
# of the library, and builds two copies of pngtest: one
|
||||||
# statically linked and one dynamically linked.
|
# statically linked and one dynamically linked.
|
||||||
#
|
#
|
||||||
|
# Copyright (C) 2002 Soren Anderson, Charles Wilson, and Glenn Randers-Pehrson
|
||||||
# based on makefile for linux-elf w/mmx by:
|
# based on makefile for linux-elf w/mmx by:
|
||||||
# Copyright (C) 1998-2000 Greg Roelofs
|
# Copyright (C) 1998-2000 Greg Roelofs
|
||||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
|
# This makefile intends to support building outside the src directory
|
||||||
|
# if desired. When invoking it, specify an argument to SRCDIR on the
|
||||||
|
# command line that points to the top of the directory where your source
|
||||||
|
# is located.
|
||||||
|
|
||||||
|
ifdef SRCDIR
|
||||||
|
VPATH = $(SRCDIR)
|
||||||
|
else
|
||||||
|
SRCDIR = .
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
# To enable assembler optimizations, add '-DPNG_USE_PNGGCCRD' to
|
# To enable assembler optimizations, add '-DPNG_USE_PNGGCCRD' to
|
||||||
# $CFLAGS, and include pnggccrd.o in $OBJS, below.
|
# $CFLAGS, and include pnggccrd.o in $OBJS, below, and in the dependency
|
||||||
|
# list at the bottom of this makefile.
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
ifdef MINGW
|
ifdef MINGW
|
||||||
@@ -17,12 +41,15 @@ MINGW_CCFLAGS=-mno-cygwin -I/usr/include/mingw
|
|||||||
MINGW_LDFLAGS=-mno-cygwin -L/usr/lib/mingw
|
MINGW_LDFLAGS=-mno-cygwin -L/usr/lib/mingw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# where "make install" puts libpng.a, libpng.so*, png.h, and pngconf.h
|
# Where "make install" puts libpng*.a, *png*.dll, png.h, and pngconf.h
|
||||||
|
ifndef prefix
|
||||||
prefix=/usr
|
prefix=/usr
|
||||||
|
$(warning You haven't specified a 'prefix=' location. Defaulting to "/usr")
|
||||||
|
endif
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located
|
||||||
ZLIBLIB=${prefix}/lib
|
ZLIBLIB= /usr/lib
|
||||||
ZLIBINC=${prefix}/include
|
ZLIBINC=
|
||||||
#ZLIBLIB=../zlib
|
#ZLIBLIB=../zlib
|
||||||
#ZLIBINC=../zlib
|
#ZLIBINC=../zlib
|
||||||
|
|
||||||
@@ -34,15 +61,25 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
|||||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||||
|
|
||||||
#CFLAGS=-DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
|
### if you use the asm, add pnggccrd.o to the OBJS list
|
||||||
# -fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5
|
###
|
||||||
CFLAGS=$(MINGW_CCFLAGS) -I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
|
### if you don't need thread safety, but want the asm accel
|
||||||
-fomit-frame-pointer
|
#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD \
|
||||||
|
# $(addprefix -I,$(ZLIBINC)) -Wall -O3 $(ALIGN) -funroll-loops \
|
||||||
|
# -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
|
### if you need thread safety and want (minimal) asm accel
|
||||||
|
#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_USE_PNGGCCRD $(addprefix -I,$(ZLIBINC)) \
|
||||||
|
# -Wall -O3 $(ALIGN) -funroll-loops \
|
||||||
|
# -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
|
### Normal (non-asm) compilation
|
||||||
|
CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
||||||
|
-Wall -O3 $(ALIGN) -funroll-loops \
|
||||||
|
-fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
|
|
||||||
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
#PNGDLL = $12
|
PNGDLL = 13
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGMIN_BASE = 1.2.2
|
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
SHAREDLIB=cygpng$(PNGDLL).dll
|
SHAREDLIB=cygpng$(PNGDLL).dll
|
||||||
@@ -52,19 +89,28 @@ SHAREDDEF=libpng.def
|
|||||||
LIBS=$(SHAREDLIB) $(STATLIB)
|
LIBS=$(SHAREDLIB) $(STATLIB)
|
||||||
EXE=.exe
|
EXE=.exe
|
||||||
|
|
||||||
LDFLAGS=-L. $(MINGW_LDFLAGS) -L$(ZLIBLIB) -lpng -lz
|
LDFLAGS=$(strip -L. $(MINGW_LDFLAGS) -lpng $(addprefix -L,$(ZLIBLIB)) -lz)
|
||||||
LDSFLAGS=-shared -L. $(MINGW_LDFLAGS) -Wl,--enable-auto-image-base
|
LDSFLAGS=$(strip -shared -L. $(MINGW_LDFLAGS) -Wl,--export-all)
|
||||||
LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(SHAREDDEF)
|
LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(addprefix -L,$(ZLIBLIB)) -lz
|
||||||
|
|
||||||
|
MKDIR=/bin/mkdir -pv
|
||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
#RANLIB=echo
|
#RANLIB=echo
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
|
||||||
BINPATH=$(prefix)/bin
|
BINPATH=$(prefix)/bin
|
||||||
MANPATH=$(prefix)/man
|
MANPATH=$(prefix)/man
|
||||||
MAN3PATH=$(MANPATH)/man3
|
MAN3PATH=$(MANPATH)/man3
|
||||||
DOCPATH=$(prefix)/doc/libpng-$(PNGMIN_BASE)
|
MAN5PATH=$(MANPATH)/man5
|
||||||
|
|
||||||
|
# cosmetic: shortened strings:
|
||||||
|
S =$(SRCDIR)
|
||||||
|
D =$(DESTDIR)
|
||||||
|
DB =$(D)$(BINPATH)
|
||||||
|
DI =$(D)$(INCPATH)
|
||||||
|
DL =$(D)$(LIBPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -72,37 +118,60 @@ OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
|||||||
|
|
||||||
OBJSDLL = $(OBJS:.o=.pic.o)
|
OBJSDLL = $(OBJS:.o=.pic.o)
|
||||||
|
|
||||||
.SUFFIXES: .c .o .pic.o
|
.SUFFIXES: .c .o .pic.o
|
||||||
|
|
||||||
%.o : %.c
|
%.o : %.c
|
||||||
$(CC) -c $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -o $@ $<
|
$(CC) -c $(CFLAGS) -o $@ $<
|
||||||
|
%.pic.o : CFLAGS += -DPNG_BUILD_DLL
|
||||||
%.pic.o : %.c
|
%.pic.o : %.c
|
||||||
$(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $<
|
$(CC) -c $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
all: all-static all-shared
|
all: all-static all-shared libpng.pc libpng-config libpng.pc libpng-config
|
||||||
|
|
||||||
|
# Make this to verify that "make [...] install" will do what you want.
|
||||||
|
buildsetup-tell:
|
||||||
|
@echo VPATH is set to: \"$(VPATH)\"
|
||||||
|
@echo prefix is set to: \"$(prefix)\"
|
||||||
|
@echo -e INCPATH,LIBPATH, etc. are set to:'\n' \
|
||||||
|
$(addprefix $(D),$(INCPATH)'\n' $(LIBPATH)'\n' $(BINPATH)'\n' \
|
||||||
|
$(MANPATH)'\n' $(MAN3PATH)'\n' $(MAN5PATH)'\n')'\n'
|
||||||
|
|
||||||
|
libpng.pc: scripts/libpng.pc.in
|
||||||
|
@echo -e Making pkg-config file for this libpng installation..'\n' \
|
||||||
|
using PREFIX=\"$(prefix)\"'\n'
|
||||||
|
cat $(S)/scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \
|
||||||
|
sed -e s/-lm// > libpng.pc
|
||||||
|
|
||||||
|
libpng-config: scripts/libpng-config-head.in scripts/libpng-config-body.in
|
||||||
|
@echo -e Making $(LIBNAME) libpng-config file for this libpng \
|
||||||
|
installation..'\n' using PREFIX=\"$(prefix)\"'\n'
|
||||||
|
( cat $(S)/scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng$(PNGDLL) -lz\"; \
|
||||||
|
cat $(S)/scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
static: all-static
|
static: all-static
|
||||||
|
|
||||||
shared: all-shared
|
shared: all-shared
|
||||||
|
|
||||||
all-static: $(STATLIB) pngtest-stat$(EXE)
|
all-static: $(STATLIB) pngtest-stat$(EXE)
|
||||||
|
|
||||||
all-shared: $(SHAREDLIB) pngtest$(EXE)
|
all-shared: $(SHAREDLIB) pngtest$(EXE)
|
||||||
|
|
||||||
pnggccrd.o: png.h pngconf.h
|
pnggccrd.o: pnggccrd.c png.h pngconf.h
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo ' You can ignore the single "control reaches end of non-void function"'
|
@echo ' You can ignore the "control reaches end of non-void function"'
|
||||||
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
@echo ' warning and "<variable> defined but not used" warnings:'
|
||||||
@echo ""
|
@echo ""
|
||||||
$(CC) -c $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
pnggccrd.pic.o: png.h pngconf.h
|
pnggccrd.pic.o: pnggccrd.c png.h pngconf.h
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo ' You can ignore the single "control reaches end of non-void function"'
|
@echo ' You can ignore the "control reaches end of non-void function"'
|
||||||
@echo ' warning and multiple "<variable> defined but not used" warnings:'
|
@echo ' warning and "<variable> defined but not used" warnings:'
|
||||||
@echo ""
|
@echo ""
|
||||||
$(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ pnggccrd.c
|
$(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $<
|
||||||
|
|
||||||
$(STATLIB): $(OBJS)
|
$(STATLIB): $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
@@ -113,7 +182,7 @@ $(SHAREDDEF): projects/msvc/png32ms.def
|
|||||||
sed -e 's/\([^;]*\);/;/' > $@
|
sed -e 's/\([^;]*\);/;/' > $@
|
||||||
|
|
||||||
$(SHAREDLIB): $(OBJSDLL) $(SHAREDDEF)
|
$(SHAREDLIB): $(OBJSDLL) $(SHAREDDEF)
|
||||||
$(CC) $(LDSFLAGS) -o $@ $(LDEXTRA) $(OBJSDLL) -L. -L$(ZLIBLIB) -lz
|
$(CC) $(LDSFLAGS) -o $@ $(OBJSDLL) -L. $(LDEXTRA)
|
||||||
|
|
||||||
pngtest$(EXE): pngtest.pic.o $(SHAREDLIB)
|
pngtest$(EXE): pngtest.pic.o $(SHAREDLIB)
|
||||||
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
|
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
|
||||||
@@ -125,51 +194,84 @@ pngtest.pic.o: pngtest.c
|
|||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
pngtest.o: pngtest.c
|
pngtest.o: pngtest.c
|
||||||
$(CC) $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
test: test-static test-shared
|
test: test-static test-shared
|
||||||
|
|
||||||
test-static: pngtest-stat$(EXE)
|
test-static: pngtest-stat$(EXE)
|
||||||
./pngtest-stat
|
./pngtest-stat $(S)/pngtest.png
|
||||||
|
|
||||||
test-shared: pngtest$(EXE)
|
test-shared: pngtest$(EXE)
|
||||||
./pngtest
|
./pngtest $(S)/pngtest.png
|
||||||
|
|
||||||
install: install-static install-shared
|
install-static: $(STATLIB) install-headers install-man
|
||||||
|
-@if [ ! -d $(DL) ]; then $(MKDIR) $(DL); fi
|
||||||
|
install -m 644 $(STATLIB) $(DL)/$(LIBNAME).a
|
||||||
|
-@rm -f $(DL)/$(STATLIB)
|
||||||
|
(cd $(DL); ln -sf $(LIBNAME).a $(STATLIB))
|
||||||
|
|
||||||
install-static: $(STATLIB) install-headers install-docs install-man
|
install-shared: $(SHAREDLIB) libpng.pc libpng-config install-headers install-man
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir -p $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then $(MKDIR) $(DL); fi
|
||||||
install -m 755 $(STATLIB) $(LIBPATH)
|
-@if [ ! -d $(DB) ]; then $(MKDIR) $(DB); fi
|
||||||
|
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR) $(DL)/pkgconfig; fi
|
||||||
install-shared: $(SHAREDLIB) install-headers install-docs install-man
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir -p $(LIBPATH); fi
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
-@if [ ! -d $(BINPATH) ]; then mkdir -p $(BINPATH); fi
|
install -m 644 $(IMPLIB) $(DL)/$(LIBNAME).dll.a
|
||||||
install -m 755 $(IMPLIB) $(LIBPATH)
|
-@rm -f $(DL)/$(IMPLIB)
|
||||||
install -s -m 755 $(SHAREDLIB) $(BINPATH)
|
(cd $(DL); ln -sf $(LIBNAME).dll.a $(IMPLIB))
|
||||||
|
install -s -m 755 $(SHAREDLIB) $(DB)
|
||||||
|
install -m 644 libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install-headers:
|
install-headers:
|
||||||
-@if [ ! -d $(INCPATH)]; then mkdir -p $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then $(MKDIR) $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/libpng ]; then mkdir -p $(INCPATH)/libpng; fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR) $(DI)/$(LIBNAME); fi
|
||||||
-@rm -f ${INCPATH)/png.h
|
-@rm -f $(DI)/png.h
|
||||||
-@rm -f ${INCPATH)/pngconf.h
|
-@rm -f $(DI)/pngconf.h
|
||||||
install -m 644 png.h pngconf.h $(INCPATH)
|
install -m 644 $(S)/png.h $(S)/pngconf.h $(DI)/$(LIBNAME)
|
||||||
|
-@rm -f $(DI)/libpng
|
||||||
install-docs:
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
-@if [ ! -d $(DOCPATH) ]; then mkdir -p $(DOCPATH); fi
|
|
||||||
install -m 644 $(DOCS) $(DOCPATH)
|
|
||||||
|
|
||||||
install-man:
|
install-man:
|
||||||
-@if [ ! -d $(MAN3PATH) ]; then mkdir -p $(MAN3PATH); fi
|
-@if [ ! -d $(D)$(MAN3PATH) ]; then $(MKDIR) $(D)$(MAN3PATH); fi
|
||||||
install -m 644 libpngpf.3 libpng.3 $(MAN3PATH)
|
-@if [ ! -d $(D)$(MAN5PATH) ]; then $(MKDIR) $(D)$(MAN5PATH); fi
|
||||||
|
install -m 644 $(S)/libpngpf.3 $(S)/libpng.3 $(D)$(MAN3PATH)
|
||||||
|
install -m 644 $(S)/png.5 $(D)$(MAN5PATH)
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
# Run this to verify that a future `configure' run will pick up the settings
|
||||||
|
# you want.
|
||||||
|
test-config-install: SHELL=/bin/bash
|
||||||
|
test-config-install: $(DB)/libpng-config
|
||||||
|
@echo -e Testing libpng-config functions...'\n'
|
||||||
|
@ for TYRA in LDFLAGS CPPFLAGS CFLAGS LIBS VERSION; \
|
||||||
|
do \
|
||||||
|
printf "(%d)\t %10s =%s\n" $$(($$gytiu + 1)) $$TYRA \
|
||||||
|
"$$($(DB)/libpng-config `echo --$$TYRA |tr '[:upper:]' '[:lower:]'`)"; \
|
||||||
|
gytiu=$$(( $$gytiu + 1 )); \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.pic.o *.o $(STATLIB) $(IMPLIB) $(SHAREDLIB) \
|
/bin/rm -f *.pic.o *.o $(STATLIB) $(IMPLIB) $(SHAREDLIB) \
|
||||||
pngtest-stat$(EXE) pngtest$(EXE) pngout.png $(SHAREDDEF)
|
pngtest-stat$(EXE) pngtest$(EXE) pngout.png $(SHAREDDEF) \
|
||||||
|
libpng-config libpng.pc
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||||
writelock:
|
writelock:
|
||||||
chmod a-w *.[ch35] $(DOCS) scripts/*
|
chmod a-w *.[ch35] $(DOCS) scripts/*
|
||||||
|
|
||||||
|
.PHONY: buildsetup-tell libpng.pc libpng-config test-config-install clean
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||||
|
|
||||||
png.o png.pic.o: png.h pngconf.h png.c
|
png.o png.pic.o: png.h pngconf.h png.c
|
||||||
@@ -190,3 +292,6 @@ pngpread.o pngpread.pic.o: png.h pngconf.h pngpread.c
|
|||||||
|
|
||||||
pngtest.o: png.h pngconf.h pngtest.c
|
pngtest.o: png.h pngconf.h pngtest.c
|
||||||
pngtest-stat.o: png.h pngconf.h pngtest.c
|
pngtest-stat.o: png.h pngconf.h pngtest.c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,20 +17,35 @@ ZLIBINC=../zlib
|
|||||||
|
|
||||||
CC=cc
|
CC=cc
|
||||||
CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops
|
CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz
|
LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz
|
||||||
|
|
||||||
#RANLIB=echo
|
#RANLIB=echo
|
||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -43,12 +58,26 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) -fno-common -o $@ $*.c
|
$(CC) -c $(CFLAGS) -fno-common -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).dylib pngtest
|
all: libpng.a $(LIBNAME).dylib pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \
|
||||||
|
sed -e s/-lm// > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).dylib: $(LIBNAME).$(PNGMAJ).dylib
|
$(LIBNAME).dylib: $(LIBNAME).$(PNGMAJ).dylib
|
||||||
ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib
|
ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib
|
||||||
|
|
||||||
@@ -57,7 +86,7 @@ $(LIBNAME).$(PNGMAJ).dylib: $(LIBNAME).$(PNGVER).dylib
|
|||||||
|
|
||||||
$(LIBNAME).$(PNGVER).dylib: $(OBJSDLL)
|
$(LIBNAME).$(PNGVER).dylib: $(OBJSDLL)
|
||||||
$(CC) -dynamiclib \
|
$(CC) -dynamiclib \
|
||||||
-install_name $(LIBPATH)/$(LIBNAME).$(PNGMAJ).dylib \
|
-install_name $(DL)/$(LIBNAME).$(PNGMAJ).dylib \
|
||||||
-current_version $(PNGMIN) -compatibility_version $(PNGMIN) \
|
-current_version $(PNGMIN) -compatibility_version $(PNGMIN) \
|
||||||
-o $(LIBNAME).$(PNGVER).dylib \
|
-o $(LIBNAME).$(PNGVER).dylib \
|
||||||
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||||
@@ -69,42 +98,63 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).dylib
|
install-shared: install-headers $(LIBNAME).dylib libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).$(PNGMAJ)*.dylib
|
-@/bin/rm -f $(DL)/$(LIBNAME).$(PNGMAJ)*.dylib
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).dylib
|
-@/bin/rm -f $(DL)/$(LIBNAME).dylib
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.dylib
|
-@/bin/rm -f $(DL)/libpng.dylib
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.3.dylib
|
-@/bin/rm -f $(DL)/libpng.3.dylib
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.3.*.dylib
|
-@/bin/rm -f $(DL)/libpng.3.*.dylib
|
||||||
cp $(LIBNAME).$(PNGVER).dylib $(LIBPATH)
|
cp $(LIBNAME).$(PNGVER).dylib $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).$(PNGVER).dylib
|
chmod 755 $(DL)/$(LIBNAME).$(PNGVER).dylib
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -sf $(LIBNAME).$(PNGVER).dylib libpng.dylib; \
|
ln -sf $(LIBNAME).$(PNGVER).dylib libpng.dylib; \
|
||||||
ln -sf $(LIBNAME).$(PNGVER).dylib libpng.3.dylib; \
|
ln -sf $(LIBNAME).$(PNGVER).dylib libpng.3.dylib; \
|
||||||
ln -sf $(LIBNAME).$(PNGVER).dylib libpng.3.$(PNGMIN).dylib; \
|
ln -sf $(LIBNAME).$(PNGVER).dylib libpng.3.$(PNGMIN).dylib; \
|
||||||
ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib; \
|
ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib; \
|
||||||
ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib)
|
ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o libpng.a $(LIBNAME).*dylib pngtest pngout.png
|
rm -f *.o libpng.a $(LIBNAME).*dylib pngtest pngout.png
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# makefile for libpng on DEC Alpha Unix
|
# makefile for libpng on DEC Alpha Unix
|
||||||
# Copyright (C) 2000 Glenn Randers-Pehrson
|
# Copyright (C) 2000-2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
@@ -7,6 +7,23 @@
|
|||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located
|
||||||
#ZLIBLIB=/usr/local/lib
|
#ZLIBLIB=/usr/local/lib
|
||||||
@@ -14,10 +31,8 @@ LIBPATH=$(prefix)/lib
|
|||||||
ZLIBLIB=../zlib
|
ZLIBLIB=../zlib
|
||||||
ZLIBINC=../zlib
|
ZLIBINC=../zlib
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
@@ -32,12 +47,25 @@ OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
|||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
pngwtran.o pngmem.o pngerror.o pngpread.o
|
pngwtran.o pngmem.o pngerror.o pngpread.o
|
||||||
|
|
||||||
all: $(LIBNAME).so libpng.a pngtest
|
all: $(LIBNAME).so libpng.a pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"-std\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
@@ -45,7 +73,8 @@ $(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
|||||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||||
|
|
||||||
$(LIBNAME).so.$(PNGVER): $(OBJS)
|
$(LIBNAME).so.$(PNGVER): $(OBJS)
|
||||||
$(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) -lz -lm
|
$(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB)
|
||||||
|
-soname $(LIBNAME).so.$(PNGMAJ) -lz -lm
|
||||||
|
|
||||||
pngtest: pngtest.o libpng.a
|
pngtest: pngtest.o libpng.a
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||||
@@ -54,41 +83,62 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
|
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
# DJGPP (DOS gcc) makefile for libpng
|
# DJGPP (DOS gcc) makefile for libpng
|
||||||
|
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
# where make install will put libpng.a and png.h
|
||||||
#prefix=/usr/local
|
#prefix=/usr/local
|
||||||
prefix=.
|
prefix=.
|
||||||
|
INCPATH=$(prefix)/include
|
||||||
|
LIBPATH=$(prefix)/lib
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS=-I../zlib -O
|
CFLAGS=-I../zlib -O
|
||||||
|
|||||||
@@ -1,93 +1,48 @@
|
|||||||
# makefile for libpng under FreeBSD
|
# makefile for libpng under FreeBSD
|
||||||
# Copyright (C) 2002 Glenn Randers-Pehrson and Andrey A. Chernov
|
# Copyright (C) 2002 Glenn Randers-Pehrson and Andrey A. Chernov
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
PREFIX?= /usr/local
|
||||||
prefix=/usr/local
|
SHLIB_VER?= 5
|
||||||
|
|
||||||
PNGMAJ= 5
|
LIB= png
|
||||||
.if (${OBJFORMAT} == "elf")
|
SHLIB_MAJOR= ${SHLIB_VER}
|
||||||
PNGVER= $(PNGMAJ)
|
SHLIB_MINOR= 0
|
||||||
.else
|
NOPROFILE= YES
|
||||||
PNGMIN= 0
|
NOOBJ= YES
|
||||||
PNGVER= $(PNGMAJ).$(PNGMIN)
|
|
||||||
.endif
|
# where make install puts libpng.a and png.h
|
||||||
|
DESTDIR= ${PREFIX}
|
||||||
|
LIBDIR= /lib
|
||||||
|
INCS= png.h pngconf.h
|
||||||
|
INCSDIR= /include/libpng
|
||||||
|
INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
|
||||||
|
MAN= libpng.3 libpngpf.3 png.5
|
||||||
|
MANDIR= /man/man
|
||||||
|
SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
|
||||||
|
libpng/pngconf.h ${INCSDIR}/../pngconf.h
|
||||||
|
LDADD+= -lm -lz
|
||||||
|
DPADD+= ${LIBM} ${LIBZ}
|
||||||
|
|
||||||
CFLAGS+= -I. -DPNG_USE_PNGGCCRD
|
CFLAGS+= -I. -DPNG_USE_PNGGCCRD
|
||||||
.if (${MACHINE_ARCH} != "i386")
|
.if (${MACHINE_ARCH} != "i386")
|
||||||
CFLAGS+= -DPNG_NO_ASSEMBLER_CODE
|
CFLAGS+= -DPNG_NO_ASSEMBLER_CODE
|
||||||
.endif
|
.endif
|
||||||
LDFLAGS+=-L. -lpng -lz -lm -static
|
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||||
pngwtran.o pngmem.o pngerror.o pngpread.o pnggccrd.o
|
pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c
|
||||||
|
|
||||||
.SUFFIXES: .c .so .o
|
|
||||||
|
|
||||||
.c.so:
|
|
||||||
${CC} ${CFLAGS} -fPIC -DPIC -o $@ -c $<
|
|
||||||
|
|
||||||
all: libpng.a libpng.so.${PNGVER} pngtest
|
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
|
||||||
ar rc $@ $(OBJS)
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
libpng.so.${PNGVER}: $(OBJS:S/o$/so/g)
|
|
||||||
.if (${OBJFORMAT} == "elf")
|
|
||||||
${CC} -shared -Wl,-x,-soname,$@ -o $@ $(OBJS:S/o$/so/g) -lz -lm
|
|
||||||
.else
|
|
||||||
${CC} -shared -Wl,-x -o $@ $(OBJS:S/o$/so/g) -lz -lm
|
|
||||||
.endif
|
|
||||||
|
|
||||||
pngtest: pngtest.o libpng.a
|
pngtest: pngtest.o libpng.a
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm
|
||||||
|
|
||||||
|
CLEANFILES= pngtest pngtest.o pngout.png
|
||||||
|
|
||||||
test: pngtest
|
test: pngtest
|
||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install: libpng.a libpng.so.${PNGVER}
|
|
||||||
-@mkdir $(prefix)/include/libpng
|
|
||||||
${INSTALL} -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} \
|
|
||||||
png.h pngconf.h $(prefix)/include/libpng
|
|
||||||
ln -sf libpng/png.h $(prefix)/include/png.h
|
|
||||||
ln -sf libpng/pngconf.h $(prefix)/include/pngconf.h
|
|
||||||
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
|
||||||
libpng.a libpng.so.${PNGVER} $(prefix)/lib
|
|
||||||
$(RANLIB) $(prefix)/lib/libpng.a
|
|
||||||
ln -sf libpng.so.${PNGVER} $(prefix)/lib/libpng.so
|
|
||||||
/sbin/ldconfig -R
|
|
||||||
${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
|
||||||
libpng.3 libpngpf.3 $(prefix)/man/man3
|
|
||||||
${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
|
||||||
png.5 $(prefix)/man/man5
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o libpng.a libpng.so libpng.so.${PNGVER} pngtest pngout.png
|
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||||
writelock:
|
writelock:
|
||||||
chmod a-w *.[ch35] $(DOCS) scripts/*
|
chmod a-w *.[ch35] $(DOCS) scripts/*
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
.include <bsd.lib.mk>
|
||||||
|
|
||||||
png.o: png.h pngconf.h
|
|
||||||
pngerror.o: png.h pngconf.h
|
|
||||||
pngrio.o: png.h pngconf.h
|
|
||||||
pngwio.o: png.h pngconf.h
|
|
||||||
pngmem.o: png.h pngconf.h
|
|
||||||
pngset.o: png.h pngconf.h
|
|
||||||
pngget.o: png.h pngconf.h
|
|
||||||
pngread.o: png.h pngconf.h
|
|
||||||
pngrtran.o: png.h pngconf.h
|
|
||||||
pngrutil.o: png.h pngconf.h
|
|
||||||
pngtest.o: png.h pngconf.h
|
|
||||||
pngtrans.o: png.h pngconf.h
|
|
||||||
pngwrite.o: png.h pngconf.h
|
|
||||||
pngwtran.o: png.h pngconf.h
|
|
||||||
pngwutil.o: png.h pngconf.h
|
|
||||||
pngpread.o: png.h pngconf.h
|
|
||||||
pnggccrd.o: png.h pngconf.h
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,16 +15,17 @@
|
|||||||
|
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
# where "make install" puts libpng.a, libpng12/libpng12.so*,
|
# where "make install" puts libpng12.a, libpng12.so*,
|
||||||
# $(LIBNAME)/png.h and $(LIBNAME)/pngconf.h
|
# libpng12/png.h and libpng12/pngconf.h
|
||||||
|
# Prefix must be a full pathname.
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located.
|
||||||
#ZLIBLIB=/usr/local/lib
|
#ZLIBLIB=/usr/local/lib
|
||||||
#ZLIBINC=/usr/local/include
|
#ZLIBINC=/usr/local/include
|
||||||
ZLIBLIB=../zlib
|
ZLIBLIB=../zlib
|
||||||
@@ -62,6 +63,23 @@ RANLIB=ranlib
|
|||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -74,7 +92,25 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).so pngtest pngtest-static
|
all: libpng.a $(LIBNAME).so pngtest pngtest-static libpng.pc libpng-config
|
||||||
|
|
||||||
|
libpng.a: $(OBJS)
|
||||||
|
ar rc $@ $(OBJS)
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME) -DPNG_THREAD_UNSAFE_OK \
|
||||||
|
-DPNG_USE_PNGGCCRD\"; \
|
||||||
|
echo cflags=\"\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH) -Wl,-rpath,$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
pnggccrd.o: pnggccrd.c png.h pngconf.h
|
pnggccrd.o: pnggccrd.c png.h pngconf.h
|
||||||
$(CC) -c $(CFLAGS) -o $@ $*.c
|
$(CC) -c $(CFLAGS) -o $@ $*.c
|
||||||
@@ -82,10 +118,6 @@ pnggccrd.o: pnggccrd.c png.h pngconf.h
|
|||||||
pnggccrd.pic.o: pnggccrd.c png.h pngconf.h
|
pnggccrd.pic.o: pnggccrd.c png.h pngconf.h
|
||||||
$(CC) -c $(CFLAGS) -fPIC -o $@ pnggccrd.c
|
$(CC) -c $(CFLAGS) -fPIC -o $@ pnggccrd.c
|
||||||
|
|
||||||
$(LIBNAME).a: $(OBJS)
|
|
||||||
ar rc $@ $(OBJS)
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
@@ -93,18 +125,19 @@ $(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
|||||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||||
|
|
||||||
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
||||||
$(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) -o $(LIBNAME).so.$(PNGVER) \
|
$(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \
|
||||||
$(OBJSDLL) -L$(ZLIBLIB) -lz -lm -lc
|
-o $(LIBNAME).so.$(PNGVER) \
|
||||||
|
$(OBJSDLL) -L$(ZLIBLIB) -lz -lm -lc
|
||||||
|
|
||||||
pngtest: pngtest.o $(LIBNAME).so
|
pngtest: pngtest.o $(LIBNAME).so
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||||
|
|
||||||
pngtest-static: pngtest.o $(LIBNAME).a
|
pngtest-static: pngtest.o libpng.a
|
||||||
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
|
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
|
||||||
|
|
||||||
test: pngtest pngtest-static
|
test: pngtest pngtest-static
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " Running pngtest dynamically linked with libpng12.so:"
|
@echo " Running pngtest dynamically linked with $(LIBNAME).so:"
|
||||||
@echo ""
|
@echo ""
|
||||||
./pngtest
|
./pngtest
|
||||||
@echo ""
|
@echo ""
|
||||||
@@ -113,45 +146,73 @@ test: pngtest pngtest-static
|
|||||||
./pngtest-static
|
./pngtest-static
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
|
test-installed:
|
||||||
|
$(CC) -I$(ZLIBINC) \
|
||||||
|
`$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \
|
||||||
|
-o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs` \
|
||||||
|
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB)
|
||||||
|
pngtesti pngtest.png
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
/bin/rm -f *.o libpng.a pngtest pngout.png libpng.pc libpng-config \
|
||||||
pngtest pngout.png
|
$(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||||
writelock:
|
writelock:
|
||||||
|
|||||||
@@ -26,21 +26,36 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
|||||||
|
|
||||||
CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \
|
CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \
|
||||||
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz -lm
|
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
|
|
||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
#RANLIB=echo
|
#RANLIB=echo
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -53,12 +68,25 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).sl pngtest
|
all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"\"; \
|
||||||
|
echo ldflags=\"\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
|
$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
|
||||||
ln -f -s $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
|
ln -f -s $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
|
||||||
|
|
||||||
@@ -77,41 +105,63 @@ test: pngtest
|
|||||||
|
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).sl.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).sl.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).sl
|
-@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGMAJ)* $(DL)/$(LIBNAME).sl
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).sl.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).sl.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).sl.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3; \
|
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3; \
|
||||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3.$(PNGMIN); \
|
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3.$(PNGMIN); \
|
||||||
ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
|
ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
|
||||||
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
|
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir \
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
$(DL)/pkgconfig; fi
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(SHAREDLIB).sl $(SHAREDLIB).sl.$(PNGMAJ)* \
|
/bin/rm -f *.o libpng.a $(SHAREDLIB).sl $(SHAREDLIB).sl.$(PNGMAJ)* \
|
||||||
|
|||||||
@@ -16,17 +16,32 @@ LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
|||||||
|
|
||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng12.sl, and png.h
|
# where make install puts libpng.a, libpng12.sl, and png.h
|
||||||
prefix=/opt/libpng
|
prefix=/opt/libpng
|
||||||
LIBPATH=$prefix/lib
|
INCPATH=$(prefix)/include
|
||||||
INCPATH=$prefix/include
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -39,12 +54,25 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) +z -o $@ $*.c
|
$(CC) -c $(CFLAGS) +z -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).sl pngtest
|
all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"-Ae +DA1.1 +DS2.0"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
|
$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
|
||||||
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
|
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
|
||||||
|
|
||||||
@@ -63,41 +91,62 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).sl.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).sl.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).sl
|
-@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGMAJ)* $(DL)/$(LIBNAME).sl
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.sl
|
-@/bin/rm -f $(DL)/libpng.sl
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.sl.3
|
-@/bin/rm -f $(DL)/libpng.sl.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.sl.3.*
|
-@/bin/rm -f $(DL)/libpng.sl.3.*
|
||||||
cp $(LIBNAME).sl.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).sl.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).sl.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl; \
|
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl; \
|
||||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3; \
|
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3; \
|
||||||
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3.$(PNGMIN); \
|
ln -sf $(LIBNAME).sl.$(PNGVER) libpng.sl.3.$(PNGMIN); \
|
||||||
ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
|
ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
|
||||||
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
|
ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \
|
/bin/rm -f *.o libpng.a $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# makefile for libpng
|
# makefile for libpng
|
||||||
|
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
@@ -9,6 +10,18 @@
|
|||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
# where make install puts libpng.a and png.h
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
INCPATH=$(prefix)/include
|
||||||
|
LIBPATH=$(prefix)/lib
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
CC=cc
|
CC=cc
|
||||||
CFLAGS=-I../zlib -O
|
CFLAGS=-I../zlib -O
|
||||||
@@ -46,17 +59,18 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install: libpng.a
|
install: libpng.a
|
||||||
-@mkdir $(prefix)/include
|
-@mkdir $(DESTDIR)$(INCPATH)
|
||||||
-@mkdir $(prefix)/include/libpng
|
-@mkdir $(DESTDIR)$(INCPATH)/libpng
|
||||||
-@mkdir $(prefix)/lib
|
-@mkdir $(DESTDIR)$(LIBPATH)
|
||||||
-@rm -f $(prefix)/include/png.h
|
-@rm -f $(DESTDIR)$(INCPATH)/png.h
|
||||||
-@rm -f $(prefix)/include/pngconf.h
|
-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
|
||||||
cp png.h $(prefix)/include/libpng
|
cp png.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
cp pngconf.h $(prefix)/include/libpng
|
cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
chmod 644 $(prefix)/include/libpng/png.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
|
||||||
chmod 644 $(prefix)/include/libpng/pngconf.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
|
||||||
cp libpng.a $(prefix)/lib
|
(cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
|
||||||
chmod 644 $(prefix)/lib/libpng.a
|
cp libpng.a $(DESTDIR)$(LIBPATH)
|
||||||
|
chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o libpng.a pngtest pngout.png ansi2knr
|
rm -f *.o libpng.a pngtest pngout.png ansi2knr
|
||||||
|
|||||||
@@ -5,16 +5,17 @@
|
|||||||
|
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
# where "make install" puts libpng.a, libpng12/libpng12.so*,
|
# where "make install" puts libpng12.a, libpng12.so*,
|
||||||
# libpng12/png.h and libpng12/pngconf.h
|
# libpng12/png.h and libpng12/pngconf.h
|
||||||
|
# Prefix must be a full pathname.
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located.
|
||||||
#ZLIBLIB=/usr/local/lib
|
#ZLIBLIB=/usr/local/lib
|
||||||
#ZLIBINC=/usr/local/include
|
#ZLIBINC=/usr/local/include
|
||||||
ZLIBLIB=../zlib
|
ZLIBLIB=../zlib
|
||||||
@@ -41,6 +42,23 @@ RANLIB=ranlib
|
|||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -53,12 +71,25 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).so pngtest
|
all: libpng.a $(LIBNAME).so pngtest pngtest-static libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH) -Wl,-rpath,$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
@@ -73,12 +104,12 @@ $(LIBNAME).so.$(PNGVER): $(OBJSDLL)
|
|||||||
pngtest: pngtest.o $(LIBNAME).so
|
pngtest: pngtest.o $(LIBNAME).so
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||||
|
|
||||||
pngtest-static: pngtest.o $(LIBNAME).a
|
pngtest-static: pngtest.o libpng.a
|
||||||
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
|
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
|
||||||
|
|
||||||
test: pngtest pngtest-static
|
test: pngtest pngtest-static
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " Running pngtest dynamically linked with libpng12.so:"
|
@echo " Running pngtest dynamically linked with $(LIBNAME).so:"
|
||||||
@echo ""
|
@echo ""
|
||||||
./pngtest
|
./pngtest
|
||||||
@echo ""
|
@echo ""
|
||||||
@@ -87,46 +118,73 @@ test: pngtest pngtest-static
|
|||||||
./pngtest-static
|
./pngtest-static
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -sf $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
|
test-installed:
|
||||||
|
$(CC) -I$(ZLIBINC) \
|
||||||
|
`$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \
|
||||||
|
-o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs` \
|
||||||
|
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB)
|
||||||
|
pngtesti pngtest.png
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNMAJ)* \
|
/bin/rm -f *.o libpng.a pngtest pngout.png libpng.pc libpng-config \
|
||||||
pngtest pngout.png
|
$(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||||
writelock:
|
writelock:
|
||||||
|
|||||||
@@ -15,17 +15,37 @@ ZLIBLIB=../zlib
|
|||||||
ZLIBINC=../zlib
|
ZLIBINC=../zlib
|
||||||
|
|
||||||
CC=cc
|
CC=cc
|
||||||
CFLAGS=-fno-common -I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
|
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz
|
|
||||||
LDSHARED=cc -lz -dynamiclib -compatibility_version $(VER) -current_version $(VER)
|
|
||||||
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
VER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
|
CFLAGS=-fno-common -I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
|
||||||
|
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz
|
||||||
|
LDSHARED=cc -lz -dynamiclib -compatibility_version $(PNGVER) \
|
||||||
|
-current_version $(PNGVER)
|
||||||
|
|
||||||
LIBNAME=libpng12
|
LIBNAME=libpng12
|
||||||
SHAREDLIB_POSTFIX=dylib
|
SHAREDLIB_POSTFIX=dylib
|
||||||
LIBPATH=$(prefix)/lib
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
#RANLIB=echo
|
#RANLIB=echo
|
||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
@@ -34,15 +54,29 @@ OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
|||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
pngwtran.o pngmem.o pngerror.o pngpread.o
|
pngwtran.o pngmem.o pngerror.o pngpread.o
|
||||||
|
|
||||||
all: libpng.a pngtest shared
|
all: libpng.a pngtest shared libpng.pc libpng-config
|
||||||
|
|
||||||
shared: $(LIBNAME).$(VER).$(SHAREDLIB_POSTFIX)
|
shared: $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \
|
||||||
|
sed -e s/-lm// > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
$(LIBNAME).$(VER).$(SHAREDLIB_POSTFIX): $(OBJS)
|
$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX): $(OBJS)
|
||||||
$(LDSHARED) -o $@ $(OBJS)
|
$(LDSHARED) -o $@ $(OBJS)
|
||||||
|
|
||||||
pngtest: pngtest.o libpng.a
|
pngtest: pngtest.o libpng.a
|
||||||
@@ -51,53 +85,74 @@ pngtest: pngtest.o libpng.a
|
|||||||
test: pngtest
|
test: pngtest
|
||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -f -s $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
|
install-shared: install-headers $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).$(PNGMAJ)*.$(SHAREDLIB_POSTFIX)
|
-@/bin/rm -f \
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).$(SHAREDLIB_POSTFIX)
|
$(DL)/$(LIBNAME).$(PNGMAJ)*.$(SHAREDLIB_POSTFIX)
|
||||||
|
-@/bin/rm -f $(DL)/$(LIBNAME).$(SHAREDLIB_POSTFIX)
|
||||||
-@/bin/rm -f libpng.$(SHARED_POSTFIX)
|
-@/bin/rm -f libpng.$(SHARED_POSTFIX)
|
||||||
-@/bin/rm -f libpng.3.$(SHARED_POSTFIX)
|
-@/bin/rm -f libpng.3.$(SHARED_POSTFIX)
|
||||||
-@/bin/rm -f libpng.3.*.$(SHARED_POSTFIX)
|
-@/bin/rm -f libpng.3.*.$(SHARED_POSTFIX)
|
||||||
cp $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) $(LIBPATH)
|
cp $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
|
chmod 755 $(DL)/$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) ]
|
ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) \
|
||||||
libpng.$(SHARED_POSTFIX); \
|
libpng.$(SHARED_POSTFIX); \
|
||||||
ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) ]
|
ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) \
|
||||||
libpng.3.$(SHARED_POSTFIX); \
|
libpng.3.$(SHARED_POSTFIX); \
|
||||||
ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) ]
|
ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) \
|
||||||
libpng.3.$(PNGMIN).$(SHARED_POSTFIX); \
|
libpng.3.$(PNGMIN).$(SHARED_POSTFIX); \
|
||||||
ln -sf $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \
|
ln -f -s $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \
|
||||||
$(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX); \
|
$(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX); \
|
||||||
ln -sf $(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX) \
|
ln -f -s $(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX) \
|
||||||
$(LIBNAME).$(SHAREDLIB_POSTFIX))
|
$(LIBNAME).$(SHAREDLIB_POSTFIX))
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o libpng.a pngtest pngout.png \
|
rm -f *.o libpng.a pngtest pngout.png \
|
||||||
$(LIBNAME).$(VER).$(SHAREDLIB_POSTFIX) \
|
$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \
|
||||||
$(LIBNAME).$(SHAREDLIB_POSTFIX)
|
$(LIBNAME).$(SHAREDLIB_POSTFIX)
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||||
|
|||||||
@@ -1,9 +1,22 @@
|
|||||||
# makefile for libpng
|
# makefile for libpng
|
||||||
|
# Copyright (C) Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
# where make install puts libpng.a and png.h
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
INCPATH=$(prefix)/include
|
||||||
|
LIBPATH=$(prefix)/lib
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
CC=cc
|
CC=cc
|
||||||
CFLAGS=-I../zlib -O -systype sysv -DSYSV -w -Dmips
|
CFLAGS=-I../zlib -O -systype sysv -DSYSV -w -Dmips
|
||||||
@@ -30,17 +43,18 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install: libpng.a
|
install: libpng.a
|
||||||
-@mkdir $(prefix)/include
|
-@mkdir $(DESTDIR)$(INCPATH)
|
||||||
-@mkdir $(prefix)/include/libpng
|
-@mkdir $(DESTDIR)$(INCPATH)/libpng
|
||||||
-@mkdir $(prefix)/lib
|
-@mkdir $(DESTDIR)$(LIBPATH)
|
||||||
-@rm -f $(prefix)/include/png.h
|
-@rm -f $(DESTDIR)$(INCPATH)/png.h
|
||||||
-@rm -f $(prefix)/include/pngconf.h
|
-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
|
||||||
cp png.h $(prefix)/include/libpng
|
cp png.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
cp pngconf.h $(prefix)/include/libpng
|
cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
chmod 644 $(prefix)/include/libpng/png.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
|
||||||
chmod 644 $(prefix)/include/libpng/pngconf.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
|
||||||
cp libpng.a $(prefix)/lib
|
(cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
|
||||||
chmod 644 $(prefix)/lib/libpng.a
|
cp libpng.a $(DESTDIR)$(LIBPATH)
|
||||||
|
chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o libpng.a pngtest pngout.png
|
rm -f *.o libpng.a pngtest pngout.png
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ INCSDIR=${LOCALBASE}/include/libpng12
|
|||||||
|
|
||||||
LIB= png12
|
LIB= png12
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
SHLIB_MINOR= 1.2.2
|
SHLIB_MINOR= 1.2.4beta2
|
||||||
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ INCSDIR=${LOCALBASE}/include/libpng
|
|||||||
|
|
||||||
LIB= png
|
LIB= png
|
||||||
SHLIB_MAJOR= 3
|
SHLIB_MAJOR= 3
|
||||||
SHLIB_MINOR= 1.2.2
|
SHLIB_MINOR= 1.2.4beta2
|
||||||
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ LIBDIR= ${PREFIX}/lib
|
|||||||
MANDIR= ${PREFIX}/man/cat
|
MANDIR= ${PREFIX}/man/cat
|
||||||
|
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
SHLIB_MINOR= 1.2.2
|
SHLIB_MINOR= 1.2.4beta2
|
||||||
|
|
||||||
LIB= png
|
LIB= png
|
||||||
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
|
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
|
||||||
@@ -64,6 +64,8 @@ afterinstall:
|
|||||||
@rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
|
@rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
|
||||||
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
|
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
|
||||||
-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng
|
-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng
|
||||||
|
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
|
||||||
|
-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
|
||||||
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
|
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
|
||||||
-m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
|
-m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# makefile for SCO OSr5 ELF and Unixware 7 with Native cc
|
# makefile for SCO OSr5 ELF and Unixware 7 with Native cc
|
||||||
# Contributed by Mike Hopkirk (hops@sco.com) modified from Makefile.lnx
|
# Contributed by Mike Hopkirk (hops@sco.com) modified from Makefile.lnx
|
||||||
# force ELF build dynamic linking, SONAME setting in lib and RPATH in app
|
# force ELF build dynamic linking, SONAME setting in lib and RPATH in app
|
||||||
|
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1998 Greg Roelofs
|
# Copyright (C) 1998 Greg Roelofs
|
||||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
@@ -17,20 +18,35 @@ ZLIBLIB=../zlib
|
|||||||
ZLIBINC=../zlib
|
ZLIBINC=../zlib
|
||||||
|
|
||||||
CFLAGS= -dy -belf -I$(ZLIBINC) -O3
|
CFLAGS= -dy -belf -I$(ZLIBINC) -O3
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
|
|
||||||
#RANLIB=ranlib
|
#RANLIB=ranlib
|
||||||
RANLIB=echo
|
RANLIB=echo
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
INCPATH=$(prefix)/include/libpng
|
INCPATH=$(prefix)/include/libpng
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -43,12 +59,25 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).so pngtest
|
all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"-belf\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
@@ -67,43 +96,65 @@ test: pngtest
|
|||||||
|
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
-@/bin/rm -f $(INCPATH)/png.h
|
-@/bin/rm -f $(DI)/png.h
|
||||||
-@/bin/rm -f $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/pngconf.h
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -f -s $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
install: install-static install-shared
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
|
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
|
||||||
|
|||||||
@@ -1,101 +1,183 @@
|
|||||||
# makefile for libpng, SGI IRIX with gcc
|
# makefile for libpng.a and libpng12.so, SGI IRIX with 'cc'
|
||||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
# Copyright (C) 2001-2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
# Where make install puts libpng.a, libpng12.so, and libpng12/png.h
|
||||||
|
# Prefix must be a full pathname.
|
||||||
|
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located
|
||||||
ZLIBLIB=/usr/local/lib32
|
#ZLIBLIB=/usr/local/lib32
|
||||||
ZLIBINC=/usr/local/include
|
#ZLIBINC=/usr/local/include
|
||||||
#ZLIBLIB=../zlib
|
#ZLIBLIB=/usr/local/lib
|
||||||
#ZLIBINC=../zlib
|
#ZLIBINC=/usr/local/include
|
||||||
|
ZLIBLIB=../zlib
|
||||||
|
ZLIBINC=../zlib
|
||||||
|
|
||||||
|
LIBNAME=libpng12
|
||||||
|
PNGMAJ = 0
|
||||||
|
PNGMIN = 1.2.4beta2
|
||||||
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
CC=gcc
|
||||||
|
|
||||||
# ABI can be blank to use default for your system, -32, -o32, -n32, or -64
|
# ABI can be blank to use default for your system, -32, -o32, -n32, or -64
|
||||||
# See "man abi". zlib must be built with the same ABI.
|
# See "man abi". zlib must be built with the same ABI.
|
||||||
ABI=
|
ABI=
|
||||||
|
|
||||||
CC=gcc
|
|
||||||
|
|
||||||
WARNMORE= # -g -DPNG_DEBUG=5
|
WARNMORE= # -g -DPNG_DEBUG=5
|
||||||
CFLAGS=$(ABI) -I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32
|
CFLAGS=$(ABI) -I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32
|
||||||
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||||
LDSHARED=CC $(ABI) -shared
|
LDSHARED=cc $(ABI) -shared -soname $(LIBNAME).so.$(PNGMAJ)
|
||||||
|
|
||||||
PNGMAJ = 0
|
|
||||||
PNGMIN = 1.2.2
|
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
|
||||||
# See "man dso" for info about shared objects
|
# See "man dso" for info about shared objects
|
||||||
LIBS=libpng12.so.$(PNGMAJ).$(PNGVER)
|
|
||||||
LIBNAME=libpng12
|
|
||||||
LIBPATH=$(prefix)/lib32
|
|
||||||
|
|
||||||
RANLIB=echo
|
RANLIB=echo
|
||||||
#RANLIB=ranlib
|
#RANLIB=ranlib
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
INCPATH=$(prefix)/include
|
||||||
|
LIBPATH=$(prefix)/lib
|
||||||
|
#LIBPATH=$(prefix)/lib32
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
|
OBJS = pnggccrd.o png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
pngwtran.o pngmem.o pngerror.o pngpread.o
|
pngwtran.o pngmem.o pngerror.o pngpread.o
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).so.$(PNGVER) pngtest
|
all: libpng.a pngtest shared libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
shared: $(LIBNAME).so.$(PNGVER)
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > \
|
||||||
|
libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME) -DPNG_USE_PNGGCCRD \
|
||||||
|
-DPNG_NO_ASSEMBLER_CODE\"; \
|
||||||
|
echo cflags=\"$(ABI)\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH) -rpath $(LIBPATH) \"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
|
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||||
|
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||||
|
|
||||||
$(LIBNAME).so.$(PNGVER): $(OBJS)
|
$(LIBNAME).so.$(PNGVER): $(OBJS)
|
||||||
$(LDSHARED) -o $@ $(OBJS)
|
$(LDSHARED) -o $@ $(OBJS)
|
||||||
rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
|
rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -s $@ $(LIBNAME).so
|
|
||||||
ln -s $@ $(LIBNAME).so.$(PNGMAJ)
|
|
||||||
|
|
||||||
pngtest: pngtest.o libpng.a
|
pngtest: pngtest.o libpng.a
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||||
|
|
||||||
test: pngtest
|
test: pngtest
|
||||||
|
echo
|
||||||
|
echo Testing local static library.
|
||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
|
# If you installed in $(DESTDIR), test-installed won't work until you
|
||||||
|
# move the library to its final location.
|
||||||
|
|
||||||
|
test-installed:
|
||||||
|
$(CC) -I$(ZLIBINC) \
|
||||||
|
`$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \
|
||||||
|
-o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs` \
|
||||||
|
-L$(ZLIBLIB) -rpath $(ZLIBLIB)
|
||||||
|
echo
|
||||||
|
echo Testing installed dynamic shared library.
|
||||||
|
pngtesti pngtest.png
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o libpng.a pngtest pngout.png
|
rm -f *.o libpng.a pngtest pngout.png libpng.pc libpng-config \
|
||||||
|
$(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* so_locations
|
||||||
|
|
||||||
|
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||||
|
writelock:
|
||||||
|
chmod a-w *.[ch35] $(DOCS) scripts/*
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||||
|
|
||||||
@@ -115,4 +197,5 @@ pngwrite.o: png.h pngconf.h
|
|||||||
pngwtran.o: png.h pngconf.h
|
pngwtran.o: png.h pngconf.h
|
||||||
pngwutil.o: png.h pngconf.h
|
pngwutil.o: png.h pngconf.h
|
||||||
pngpread.o: png.h pngconf.h
|
pngpread.o: png.h pngconf.h
|
||||||
|
pnggccrd.o: png.h pngconf.h
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,14 @@
|
|||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng12.so and libpng12/png.h
|
LIBNAME=libpng12
|
||||||
|
PNGMAJ = 0
|
||||||
|
PNGMIN = 1.2.4beta2
|
||||||
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
|
# Where make install puts libpng.a, libpng12.so, and libpng12/png.h
|
||||||
|
# Prefix must be a full pathname.
|
||||||
|
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located
|
||||||
@@ -26,13 +33,8 @@ WARNMORE=-fullwarn
|
|||||||
CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE) -DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE
|
CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE) -DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE
|
||||||
LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng12 -lz -lm
|
LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||||
LDSHARED=cc $(ABI) -shared
|
LDSHARED=cc $(ABI) -shared -soname $(LIBNAME).so.$(PNGMAJ)
|
||||||
|
|
||||||
# See "man dso" for info about shared objects
|
# See "man dso" for info about shared objects
|
||||||
LIBNAME=libpng12
|
|
||||||
PNGMAJ = 0
|
|
||||||
PNGMIN = 1.2.2
|
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
|
||||||
|
|
||||||
RANLIB=echo
|
RANLIB=echo
|
||||||
#RANLIB=ranlib
|
#RANLIB=ranlib
|
||||||
@@ -40,71 +42,141 @@ RANLIB=echo
|
|||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
#LIBPATH=$(prefix)/lib32
|
#LIBPATH=$(prefix)/lib32
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = pnggccrd.o png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = pnggccrd.o png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
pngwtran.o pngmem.o pngerror.o pngpread.o
|
pngwtran.o pngmem.o pngerror.o pngpread.o
|
||||||
|
|
||||||
all: libpng.a pngtest shared
|
all: libpng.a pngtest shared libpng.pc libpng-config
|
||||||
|
|
||||||
shared: $(LIBNAME).so.$(PNGMAJ).$(PNGVER)
|
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
shared: $(LIBNAME).so.$(PNGVER)
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME) -DPNG_USE_PNGGCCRD \
|
||||||
|
-DPNG_NO_ASSEMBLER_CODE\"; \
|
||||||
|
echo cflags=\"$(ABI)\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH) -rpath $(LIBPATH) \"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
|
$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
|
||||||
|
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
|
||||||
|
|
||||||
$(LIBNAME).so.$(PNGVER): $(OBJS)
|
$(LIBNAME).so.$(PNGVER): $(OBJS)
|
||||||
$(LDSHARED) -o $@ $(OBJS)
|
$(LDSHARED) -o $@ $(OBJS)
|
||||||
rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
|
rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -s $@ $(LIBNAME).so
|
|
||||||
ln -s $@ $(LIBNAME).so.$(PNGMAJ)
|
|
||||||
|
|
||||||
pngtest: pngtest.o libpng.a
|
pngtest: pngtest.o libpng.a
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||||
|
|
||||||
test: pngtest
|
test: pngtest
|
||||||
|
echo
|
||||||
|
echo Testing local static library.
|
||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
|
# If you installed in $(DESTDIR), test-installed won't work until you
|
||||||
|
# move the library to its final location.
|
||||||
|
|
||||||
|
test-installed:
|
||||||
|
echo
|
||||||
|
echo Testing installed dynamic shared library.
|
||||||
|
$(CC) -I$(ZLIBINC) \
|
||||||
|
`$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \
|
||||||
|
-o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs` \
|
||||||
|
-L$(ZLIBLIB) -rpath $(ZLIBLIB)
|
||||||
|
pngtesti pngtest.png
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o libpng.a pngtest pngout.png $(LIBNAME).so \
|
rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \
|
||||||
$(LIBNAME).so.$(PNGMAJ)*
|
$(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* so_locations
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||||
writelock:
|
writelock:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# makefile for libpng on Solaris 9 (beta) with Forte cc
|
# makefile for libpng on Solaris 9 (beta) with Forte cc
|
||||||
# Updated by Chad Schrock for Solaris 9
|
# Updated by Chad Schrock for Solaris 9
|
||||||
# Contributed by William L. Sebok, based on makefile.linux
|
# Contributed by William L. Sebok, based on makefile.linux
|
||||||
|
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1998-2001 Greg Roelofs
|
# Copyright (C) 1998-2001 Greg Roelofs
|
||||||
# Copyright (C) 1996-1997 Andreas Dilger
|
# Copyright (C) 1996-1997 Andreas Dilger
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
@@ -27,20 +28,35 @@ ZLIBINC=/usr/include
|
|||||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||||
#CFLAGS=-I$(ZLIBINC) -Wall -O3 $(WARNMORE) -g -DPNG_DEBUG=5
|
#CFLAGS=-I$(ZLIBINC) -Wall -O3 $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
CFLAGS=-I$(ZLIBINC) -O3
|
CFLAGS=-I$(ZLIBINC) -O3
|
||||||
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
|
|
||||||
#RANLIB=ranlib
|
#RANLIB=ranlib
|
||||||
RANLIB=echo
|
RANLIB=echo
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -53,12 +69,25 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).so pngtest
|
all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
|
echo cflags=\"\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH) -R$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
@@ -88,41 +117,63 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -f -s $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
install: install-static install-shared
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
||||||
|
|||||||
@@ -24,20 +24,35 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
|||||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||||
CFLAGS=-I$(ZLIBINC) -Wall -O3 \
|
CFLAGS=-I$(ZLIBINC) -Wall -O3 \
|
||||||
# $(WARNMORE) -g -DPNG_DEBUG=5
|
# $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
|
|
||||||
#RANLIB=ranlib
|
#RANLIB=ranlib
|
||||||
RANLIB=echo
|
RANLIB=echo
|
||||||
|
|
||||||
# read libpng.txt or png.h to see why PNGMAJ is 0. You should not
|
|
||||||
# have to change it.
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.2
|
PNGMIN = 1.2.4beta2
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
MANPATH=$(prefix)/man
|
||||||
|
BINPATH=$(prefix)/bin
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
|
DB=$(DESTDIR)$(BINPATH)
|
||||||
|
DI=$(DESTDIR)$(INCPATH)
|
||||||
|
DL=$(DESTDIR)$(LIBPATH)
|
||||||
|
DM=$(DESTDIR)$(MANPATH)
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
@@ -50,12 +65,26 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
|||||||
.c.pic.o:
|
.c.pic.o:
|
||||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||||
|
|
||||||
all: libpng.a $(LIBNAME).so pngtest
|
all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
libpng.a: $(OBJS)
|
||||||
ar rc $@ $(OBJS)
|
ar rc $@ $(OBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
libpng.pc:
|
||||||
|
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
||||||
|
|
||||||
|
libpng-config:
|
||||||
|
( cat scripts/libpng-config-head.in; \
|
||||||
|
echo prefix=\"$(prefix)\"; \
|
||||||
|
echo cppflags=\"-I$(INCPATH)/$(LIBNAME) -DPNG_USE_PNGGCCRD \
|
||||||
|
-DPNG_NO_ASSEMBLER_CODE\"; \
|
||||||
|
echo cflags=\"$(ABI)\"; \
|
||||||
|
echo ldflags=\"-L$(LIBPATH) -R$(LIBPATH)\"; \
|
||||||
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
|
chmod +x libpng-config
|
||||||
|
|
||||||
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
|
||||||
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
|
||||||
|
|
||||||
@@ -85,41 +114,62 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
install-headers: png.h pngconf.h
|
||||||
-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
|
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
||||||
-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
|
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
||||||
cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
|
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||||
chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
|
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
|
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
||||||
-@/bin/rm -f $(INCPATH)/libpng
|
-@/bin/rm -f $(DI)/libpng
|
||||||
ln -f -s $(INCPATH)/$(LIBNAME) $(INCPATH)/libpng
|
(cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
install-static: install-headers libpng.a
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(LIBPATH)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(LIBPATH)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
|
(cd $(DL); ln -f -s $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).so.$(PNGVER)
|
install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
|
||||||
-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
|
-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so
|
-@/bin/rm -f $(DL)/libpng.so
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3
|
-@/bin/rm -f $(DL)/libpng.so.3
|
||||||
-@/bin/rm -f $(LIBPATH)/libpng.so.3.*
|
-@/bin/rm -f $(DL)/libpng.so.3.*
|
||||||
cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
|
cp $(LIBNAME).so.$(PNGVER) $(DL)
|
||||||
chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
|
chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
|
||||||
(cd $(LIBPATH); \
|
(cd $(DL); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
ln -f -s $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so; \
|
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so; \
|
||||||
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ))
|
ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ))
|
||||||
-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
|
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
|
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
|
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
||||||
chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
|
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||||
|
(cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc)
|
||||||
|
|
||||||
install: install-static install-shared
|
install-man: libpng.3 libpngpf.3 png.5
|
||||||
|
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
||||||
|
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpng.3
|
||||||
|
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
||||||
|
cp libpng.3 $(DM)/man3
|
||||||
|
cp libpngpf.3 $(DM)/man3
|
||||||
|
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
||||||
|
-@/bin/rm -f $(DM)/man5/png.5
|
||||||
|
cp png.5 $(DM)/man5
|
||||||
|
|
||||||
|
install-config: libpng-config
|
||||||
|
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
||||||
|
-@/bin/rm -f $(DB)/libpng-config
|
||||||
|
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
||||||
|
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||||
|
chmod 755 $(DB)/$(LIBNAME)-config
|
||||||
|
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
||||||
|
|
||||||
|
install: install-static install-shared install-man install-config
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
|
||||||
|
|||||||
@@ -1,9 +1,22 @@
|
|||||||
# makefile for libpng
|
# makefile for libpng
|
||||||
|
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
# where make install puts libpng.a and png.h
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
INCPATH=$(prefix)/include
|
||||||
|
LIBPATH=$(prefix)/lib
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located
|
||||||
#ZLIBLIB=/usr/local/lib
|
#ZLIBLIB=/usr/local/lib
|
||||||
@@ -35,17 +48,18 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install: libpng.a
|
install: libpng.a
|
||||||
-@mkdir $(prefix)/include
|
-@mkdir $(DESTDIR)$(INCPATH)
|
||||||
-@mkdir $(prefix)/include/libpng
|
-@mkdir $(DESTDIR)$(INCPATH)/libpng
|
||||||
-@mkdir $(prefix)/lib
|
-@mkdir $(DESTDIR)$(LIBPATH)
|
||||||
-@rm -f $(prefix)/include/png.h
|
-@rm -f $(DESTDIR)$(INCPATH)/png.h
|
||||||
-@rm -f $(prefix)/include/pngconf.h
|
-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
|
||||||
cp png.h $(prefix)/include/libpng
|
cp png.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
cp pngconf.h $(prefix)/include/libpng
|
cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
chmod 644 $(prefix)/include/libpng/png.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
|
||||||
chmod 644 $(prefix)/include/libpng/pngconf.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
|
||||||
cp libpng.a $(prefix)/lib
|
(cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
|
||||||
chmod 644 $(prefix)/lib/libpng.a
|
cp libpng.a $(DESTDIR)$(LIBPATH)
|
||||||
|
chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o libpng.a pngtest pngout.png
|
rm -f *.o libpng.a pngtest pngout.png
|
||||||
|
|||||||
@@ -1,9 +1,22 @@
|
|||||||
# makefile for libpng
|
# makefile for libpng
|
||||||
|
# Copyright (C) 2002 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
# where make install puts libpng.a and png.h
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
INCPATH=$(prefix)/include
|
||||||
|
LIBPATH=$(prefix)/lib
|
||||||
|
|
||||||
|
# override DESTDIR= on the make install command line to easily support
|
||||||
|
# installing into a temporary location. Example:
|
||||||
|
#
|
||||||
|
# make install DESTDIR=/tmp/build/libpng
|
||||||
|
#
|
||||||
|
# If you're going to install into a temporary location
|
||||||
|
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||||
|
# you execute make install.
|
||||||
|
DESTDIR=
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
# Where the zlib library and include files are located
|
||||||
#ZLIBLIB=/usr/local/lib
|
#ZLIBLIB=/usr/local/lib
|
||||||
@@ -39,17 +52,18 @@ test: pngtest
|
|||||||
./pngtest
|
./pngtest
|
||||||
|
|
||||||
install: libpng.a
|
install: libpng.a
|
||||||
-@mkdir $(prefix)/include
|
-@mkdir $(DESTDIR)$(INCPATH)
|
||||||
-@mkdir $(prefix)/include/libpng
|
-@mkdir $(DESTDIR)$(INCPATH)/libpng
|
||||||
-@mkdir $(prefix)/lib
|
-@mkdir $(DESTDIR)$(LIBPATH)
|
||||||
-@rm -f $(prefix)/include/png.h
|
-@rm -f $(DESTDIR)$(INCPATH)/png.h
|
||||||
-@rm -f $(prefix)/include/pngconf.h
|
-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
|
||||||
cp png.h $(prefix)/include/libpng
|
cp png.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
cp pngconf.h $(prefix)/include/libpng
|
cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
|
||||||
chmod 644 $(prefix)/include/libpng/png.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
|
||||||
chmod 644 $(prefix)/include/libpng/pngconf.h
|
chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
|
||||||
cp libpng.a $(prefix)/lib
|
(cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .)
|
||||||
chmod 644 $(prefix)/lib/libpng.a
|
cp libpng.a $(DESTDIR)$(LIBPATH)
|
||||||
|
chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o libpng.a pngtest pngout.png
|
rm -f *.o libpng.a pngtest pngout.png
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ unit pngdef;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
const
|
const
|
||||||
PNG_LIBPNG_VER_STRING = '1.2.2';
|
PNG_LIBPNG_VER_STRING = '1.2.4beta2';
|
||||||
PNG_LIBPNG_VER = 10202;
|
PNG_LIBPNG_VER = 10204;
|
||||||
|
|
||||||
type
|
type
|
||||||
png_uint_32 = Cardinal;
|
png_uint_32 = Cardinal;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
; PNG.LIB module definition file for OS/2
|
; PNG.LIB module definition file for OS/2
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
|
|
||||||
; Version 1.2.2
|
; Version 1.2.4beta2
|
||||||
|
|
||||||
LIBRARY PNG
|
LIBRARY PNG
|
||||||
DESCRIPTION "PNG image compression library for OS/2"
|
DESCRIPTION "PNG image compression library for OS/2"
|
||||||
@@ -197,10 +197,15 @@ EXPORTS
|
|||||||
png_init_mmx_flags
|
png_init_mmx_flags
|
||||||
|
|
||||||
; Added at version 1.2.2:
|
; Added at version 1.2.2:
|
||||||
png_zalloc
|
|
||||||
png_zfree
|
|
||||||
png_handle_as_unknown
|
png_handle_as_unknown
|
||||||
|
|
||||||
|
; Added at version 1.2.2 and deleted from 1.2.3:
|
||||||
|
; png_zalloc
|
||||||
|
; png_zfree
|
||||||
|
|
||||||
|
; Added at version 1.2.4
|
||||||
|
png_malloc_warn
|
||||||
|
|
||||||
; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS
|
; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS
|
||||||
png_libpng_ver
|
png_libpng_ver
|
||||||
png_pass_start
|
png_pass_start
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
# makefile for libpng under FreeBSD
|
|
||||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
|
||||||
prefix=/usr/local
|
|
||||||
|
|
||||||
# Building shared libraries is handled by the FreeBSD external Makefile,
|
|
||||||
# which uses this makefile.
|
|
||||||
|
|
||||||
.if ${MACHINE_ARCH} == "i386"
|
|
||||||
CFLAGS+= -I. -O -DPNG_USE_PNGGCCRD
|
|
||||||
.else
|
|
||||||
CFLAGS+= -I. -O -DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE
|
|
||||||
.endif
|
|
||||||
LDFLAGS+=-L. -lpng -lz -lm
|
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
|
||||||
pngwtran.o pngmem.o pngerror.o pngpread.o pnggccrd.o
|
|
||||||
|
|
||||||
all: libpng.a pngtest
|
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
|
||||||
ar rc $@ $(OBJS)
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
pngtest: pngtest.o libpng.a
|
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
|
||||||
|
|
||||||
test: pngtest
|
|
||||||
./pngtest
|
|
||||||
|
|
||||||
install: libpng.a
|
|
||||||
-@mkdir $(prefix)/include
|
|
||||||
-@mkdir $(prefix)/include/libpng
|
|
||||||
-@mkdir $(prefix)/lib
|
|
||||||
cp png.h $(prefix)/include
|
|
||||||
cp pngconf.h $(prefix)/include
|
|
||||||
chmod 644 $(prefix)/include/png.h
|
|
||||||
chmod 644 $(prefix)/include/pngconf.h
|
|
||||||
cp png.h $(prefix)/include/libpng
|
|
||||||
cp pngconf.h $(prefix)/include/libpng
|
|
||||||
chmod 644 $(prefix)/include/libpng/png.h
|
|
||||||
chmod 644 $(prefix)/include/libpng/pngconf.h
|
|
||||||
cp libpng.a $(prefix)/lib
|
|
||||||
chmod 644 $(prefix)/lib/libpng.a
|
|
||||||
$(RANLIB) $(prefix)/lib/libpng.a
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o libpng.a pngtest pngout.png
|
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
|
||||||
writelock:
|
|
||||||
chmod a-w *.[ch35] $(DOCS) scripts/*
|
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
||||||
|
|
||||||
png.o: png.h pngconf.h
|
|
||||||
pngerror.o: png.h pngconf.h
|
|
||||||
pngrio.o: png.h pngconf.h
|
|
||||||
pngwio.o: png.h pngconf.h
|
|
||||||
pngmem.o: png.h pngconf.h
|
|
||||||
pngset.o: png.h pngconf.h
|
|
||||||
pngget.o: png.h pngconf.h
|
|
||||||
pngread.o: png.h pngconf.h
|
|
||||||
pngrtran.o: png.h pngconf.h
|
|
||||||
pngrutil.o: png.h pngconf.h
|
|
||||||
pngtest.o: png.h pngconf.h
|
|
||||||
pngtrans.o: png.h pngconf.h
|
|
||||||
pngwrite.o: png.h pngconf.h
|
|
||||||
pngwtran.o: png.h pngconf.h
|
|
||||||
pngwutil.o: png.h pngconf.h
|
|
||||||
pngpread.o: png.h pngconf.h
|
|
||||||
pnggccrd.o: png.h pngconf.h
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user