Imported from libpng-1.4.0beta25.tar
This commit is contained in:
parent
895a9c97e2
commit
eb58091392
33
ANNOUNCE
33
ANNOUNCE
@ -1,5 +1,5 @@
|
||||
|
||||
Libpng 1.4.0beta24 - July 25, 2008
|
||||
Libpng 1.4.0beta25 - July 30, 2008
|
||||
|
||||
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.
|
||||
@ -9,27 +9,27 @@ Files available for download:
|
||||
Source files with LF line endings (for Unix/Linux) and with a
|
||||
"configure" script
|
||||
|
||||
1.4.0beta24.tar.gz
|
||||
1.4.0beta24.tar.bz2
|
||||
1.4.0beta25.tar.gz
|
||||
1.4.0beta25.tar.bz2
|
||||
|
||||
Source files with LF line endings (for Unix/Linux) without the
|
||||
"configure" script
|
||||
|
||||
1.4.0beta24-no-config.tar.gz
|
||||
1.4.0beta24-no-config.tar.bz2
|
||||
1.4.0beta25-no-config.tar.gz
|
||||
1.4.0beta25-no-config.tar.bz2
|
||||
|
||||
Source files with CRLF line endings (for Windows), without the
|
||||
"configure" script
|
||||
|
||||
lp140b24.zip
|
||||
lp140b24.tar.bz2
|
||||
lp140b25.zip
|
||||
lp140b25.tar.bz2
|
||||
|
||||
Other information:
|
||||
|
||||
1.4.0beta24-README.txt
|
||||
1.4.0beta24-KNOWNBUGS.txt
|
||||
1.4.0beta24-LICENSE.txt
|
||||
1.4.0beta24-Y2K-compliance.txt
|
||||
1.4.0beta25-README.txt
|
||||
1.4.0beta25-KNOWNBUGS.txt
|
||||
1.4.0beta25-LICENSE.txt
|
||||
1.4.0beta25-Y2K-compliance.txt
|
||||
|
||||
Changes since the last public release (1.2.10):
|
||||
|
||||
@ -272,6 +272,17 @@ version 1.4.0beta24 [July 25, 2008]
|
||||
Removed two calls to png_check_chunk_name() occuring later in the process.
|
||||
Define PNG_NO_ERROR_NUMBERS by default in pngconf.h
|
||||
|
||||
version 1.4.0beta25 [July 30, 2008]
|
||||
Added a call to png_check_chunk_name() in pngpread.c
|
||||
Reverted png_check_chunk_name() to accept a name with a lowercase 3rd byte.
|
||||
Added png_push_have_buffer() function to pngpread.c
|
||||
Eliminated PNG_BIG_ENDIAN_SUPPORTED and associated png_get_* macros.
|
||||
Made inline expansion of png_get_*() optional with PNG_USE_READ_MACROS.
|
||||
Eliminated all PNG_USELESS_TESTS and PNG_CORRECT_PALETTE_SUPPORTED code.
|
||||
Synced contrib directory and configure files with libpng-1.2.30beta06.
|
||||
Eliminated no-longer-used pngdefs.h (but it's still built in the makefiles)
|
||||
Relocated a misplaced #endif /* PNG_NO_WRITE_FILTER */ in pngwutil.c
|
||||
|
||||
version 1.4.0betaN [future]
|
||||
Build shared libraries with -lz and sometimes -lm.
|
||||
Revised pngvcrd.c for improved efficiency.
|
||||
|
13
CHANGES
13
CHANGES
@ -1480,7 +1480,7 @@ version 1.2.9beta5 [March 4, 2006]
|
||||
Restored scripts/makefile.elf which was inadvertently deleted.
|
||||
|
||||
version 1.2.9beta6 [March 6, 2006]
|
||||
Fixed typo (0) in configuration files.
|
||||
Fixed typo (RELEASE) in configuration files.
|
||||
|
||||
version 1.2.9beta7 [March 7, 2006]
|
||||
Removed libpng.vers and libpng.sym from libpng12_la_SOURCES in Makefile.am
|
||||
@ -1945,6 +1945,17 @@ version 1.4.0beta24 [July 25, 2008]
|
||||
Removed two calls to png_check_chunk_name() occuring later in the process.
|
||||
Define PNG_NO_ERROR_NUMBERS by default in pngconf.h
|
||||
|
||||
version 1.4.0beta25 [July 30, 2008]
|
||||
Added a call to png_check_chunk_name() in pngpread.c
|
||||
Reverted png_check_chunk_name() to accept a name with a lowercase 3rd byte.
|
||||
Added png_push_have_buffer() function to pngpread.c
|
||||
Eliminated PNG_BIG_ENDIAN_SUPPORTED and associated png_get_* macros.
|
||||
Made inline expansion of png_get_*() optional with PNG_USE_READ_MACROS.
|
||||
Eliminated all PNG_USELESS_TESTS and PNG_CORRECT_PALETTE_SUPPORTED code.
|
||||
Synced contrib directory and configure files with libpng-1.2.30beta06.
|
||||
Eliminated no-longer-used pngdefs.h (but it's still built in the makefiles)
|
||||
Relocated a misplaced #endif /* PNG_NO_WRITE_FILTER */ in pngwutil.c
|
||||
|
||||
version 1.4.0betaN [future]
|
||||
Build shared libraries with -lz and sometimes -lm.
|
||||
|
||||
|
22
INSTALL
22
INSTALL
@ -1,5 +1,5 @@
|
||||
|
||||
Installing libpng version 1.4.0beta24 - July 25, 2008
|
||||
Installing libpng version 1.4.0beta25 - July 30, 2008
|
||||
|
||||
On Unix/Linux and similar systems, you can simply type
|
||||
|
||||
@ -44,7 +44,7 @@ to have access to the zlib.h and zconf.h include files that
|
||||
correspond to the version of zlib that's installed.
|
||||
|
||||
You can rename the directories that you downloaded (they
|
||||
might be called "libpng-1.4.0beta24" or "lpng109" and "zlib-1.2.1"
|
||||
might be called "libpng-1.4.0beta25" or "lpng109" and "zlib-1.2.1"
|
||||
or "zlib121") so that you have directories called "zlib" and "libpng".
|
||||
|
||||
Your directory structure should look like this:
|
||||
@ -95,14 +95,14 @@ include
|
||||
CMakeLists.txt => "cmake" script
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
gcc, creates libpng14.so.1.1.4.0beta24)
|
||||
gcc, creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng14.so.1.1.4.0beta24)
|
||||
(gcc, creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.gcmmx => Linux/ELF makefile
|
||||
(gcc, creates libpng14.so.1.1.4.0beta24,
|
||||
(gcc, creates libpng14.so.0.1.4.0beta25,
|
||||
uses assembler code tuned for Intel MMX platform)
|
||||
makefile.nommx => Linux/ELF makefile
|
||||
(gcc, creates libpng14.so.1.1.4.0beta24
|
||||
(gcc, creates libpng14.so.0.1.4.0beta25
|
||||
does not use Intel MMX assembler code)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
@ -125,12 +125,12 @@ include
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics (gcc,
|
||||
creates libpng14.so.1.1.4.0beta24)
|
||||
creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||
creates libpng14.so.1.1.4.0beta24)
|
||||
creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.so9 => Solaris 9 makefile (gcc,
|
||||
creates libpng14.so.1.1.4.0beta24)
|
||||
creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
@ -210,11 +210,11 @@ which previously was done semi-automatically (if you didn't edit
|
||||
scripts/makefile.* yourself, that is)
|
||||
|
||||
|
||||
CFLAGS="-Wall -O3 -funroll-loops \
|
||||
CFLAGS="-Wall -O -funroll-loops \
|
||||
-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \
|
||||
--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include
|
||||
|
||||
You can alternatively specify --includedir=/usr/include, /usr/local/include,
|
||||
/usr/include/png14, or whatever.
|
||||
/usr/include/png12, or whatever.
|
||||
|
||||
|
||||
|
2
KNOWNBUG
2
KNOWNBUG
@ -1,5 +1,5 @@
|
||||
|
||||
Known bugs in libpng version 1.4.0beta24
|
||||
Known bugs in libpng version 1.4.0beta25
|
||||
|
||||
1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
|
||||
reading interlaced PNG files, when assembler code is enabled but running
|
||||
|
4
LICENSE
4
LICENSE
@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
||||
If you modify libpng you may insert additional notices immediately following
|
||||
this sentence.
|
||||
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.0beta24, July 25, 2008, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.0beta25, July 30, 2008, are
|
||||
Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
|
||||
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
with the following individual added to the list of Contributing Authors
|
||||
@ -106,4 +106,4 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
July 25, 2008
|
||||
July 30, 2008
|
||||
|
86
Makefile.am
86
Makefile.am
@ -2,9 +2,9 @@
|
||||
# Source file for Makefile.in (and hence Makefile)
|
||||
#
|
||||
# Makefile.am need only be changed on a major version number
|
||||
# change (e.g. libpng14 --> libpng15). In that case seach
|
||||
# this file for every instance of the old base name (libpng14)
|
||||
# and change to the new one (libpng15), then change the
|
||||
# change (e.g. libpng12 --> libpng13). In that case seach
|
||||
# this file for every instance of the old base name (libpng12)
|
||||
# and change to the new one (libpng13), then change the
|
||||
# -version-number settings below so that the new values have
|
||||
# the correct major part (first field).
|
||||
|
||||
@ -16,7 +16,7 @@ AUTOMAKE_OPTIONS = foreign
|
||||
# test programs - run on make check, make distcheck
|
||||
check_PROGRAMS= pngtest
|
||||
pngtest_SOURCES = pngtest.c
|
||||
pngtest_LDADD = $(PNGLIB_BASENAME).la
|
||||
pngtest_LDADD = libpng14.la
|
||||
TESTS = test-pngtest.sh
|
||||
TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
||||
|
||||
@ -24,48 +24,51 @@ TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
||||
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
||||
|
||||
# generate the -config scripts if required
|
||||
binconfigs= $(PNGLIB_BASENAME)-config
|
||||
EXTRA_SCRIPTS= libpng-config $(PNGLIB_BASENAME)-config
|
||||
binconfigs= libpng14-config
|
||||
EXTRA_SCRIPTS= libpng-config libpng14-config
|
||||
bin_SCRIPTS= @binconfigs@
|
||||
|
||||
# rules to build libpng, only build the old library on request
|
||||
lib_LTLIBRARIES=libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la @compatlib@
|
||||
lib_LTLIBRARIES=libpng14.la @compatlib@
|
||||
EXTRA_LTLIBRARIES= libpng.la
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
libpng14_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c \
|
||||
png.h pngconf.h pngdefs.h pngpriv.h
|
||||
libpng_la_SOURCES = $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES)
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c \
|
||||
png.h pngconf.h
|
||||
libpng_la_SOURCES = $(libpng14_la_SOURCES)
|
||||
|
||||
libpng_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||
libpng14_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||
|
||||
# MAJOR UPGRADE: the version-number settings below must be changed.
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
|
||||
-version-number 1:@PNGLIB_MINOR@:0
|
||||
libpng14_la_LDFLAGS = -no-undefined -export-dynamic \
|
||||
-version-number 0:@PNGLIB_RELEASE@:0
|
||||
# -rpath is needed as automake doesn't know the directory
|
||||
libpng_la_LDFLAGS = -rpath '$(libdir)' -no-undefined -export-dynamic \
|
||||
-version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_MINOR@:0
|
||||
-version-number 14:@PNGLIB_RELEASE@:0
|
||||
|
||||
if HAVE_LD_VERSION_SCRIPT
|
||||
# Versioned symbols and restricted exports
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers pngdefs.h
|
||||
libpng14_la_LDFLAGS += -Wl,--version-script=libpng.vers
|
||||
libpng14_la_DEPENDENCIES = libpng.vers
|
||||
else
|
||||
# Only restricted exports when possible
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym pngdefs.h
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym
|
||||
libpng14_la_LDFLAGS += -export-symbols libpng.sym
|
||||
libpng14_la_DEPENDENCIES = libpng.sym
|
||||
endif
|
||||
libpng_la_DEPENDENCIES = $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES)
|
||||
libpng_la_DEPENDENCIES = $(libpng14_la_DEPENDENCIES)
|
||||
|
||||
# Avoid depending upon Character Ranges.
|
||||
AN = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
|
||||
|
||||
#distribute headers in /usr/include/libpng/*
|
||||
pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
|
||||
pkginclude_HEADERS= png.h pngconf.h pngdefs.h
|
||||
pkginclude_HEADERS= png.h pngconf.h
|
||||
|
||||
# pkg-config stuff, note that libpng.pc is always required in order
|
||||
# to get the correct library
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
|
||||
pkgconfig_DATA = libpng14.pc
|
||||
|
||||
#extra source distribution files.
|
||||
EXTRA_DIST= \
|
||||
@ -83,19 +86,13 @@ EXTRA_DIST= \
|
||||
${srcdir}/contrib/pngsuite/* \
|
||||
${srcdir}/contrib/visupng/* \
|
||||
$(TESTS) \
|
||||
example.c libpng.txt pngvcrd.c
|
||||
example.c libpng-1.4.0beta25.txt pngvcrd.c
|
||||
|
||||
CLEANFILES= pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym
|
||||
CLEANFILES= pngout.png libpng14.pc libpng14-config libpng.vers \
|
||||
libpng.sym
|
||||
|
||||
all: pngdefs.h
|
||||
|
||||
install: all
|
||||
|
||||
pngdefs.h:
|
||||
echo "/* pngdefs.h created by \"configure\". */" > pngdefs.h
|
||||
@if test -n "@LIBPNG_NO_MMX@"; then \
|
||||
echo "#define PNG_NO_MMX_CODE" >> pngdefs.h; \
|
||||
fi
|
||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
||||
config.sub configure depcomp install-sh ltmain.sh missing
|
||||
|
||||
$(PNGLIB_BASENAME).pc: libpng.pc
|
||||
cp libpng.pc $@
|
||||
@ -103,38 +100,39 @@ $(PNGLIB_BASENAME).pc: libpng.pc
|
||||
$(PNGLIB_BASENAME)-config: libpng-config
|
||||
cp libpng-config $@
|
||||
|
||||
libpng.sym: png.h pngconf.h pngdefs.h
|
||||
libpng.sym: png.h pngconf.h
|
||||
rm -f $@ $@.new
|
||||
$(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS $(srcdir)/png.h | \
|
||||
$(SED) -n -e \
|
||||
's|^.*PNG_FUNCTION_EXPORT[ ]*\([a-zA-Z0-9_]*\).*$$|\1|p' \
|
||||
-e 's|^.*PNG_DATA_EXPORT[ ]*\([a-zA-Z0-9_]*\).*$$|\1|p' \
|
||||
's|^.*PNG_FUNCTION_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
|
||||
-e 's|^.*PNG_DATA_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \
|
||||
>$@.new
|
||||
mv $@.new $@
|
||||
|
||||
libpng.vers: libpng.sym
|
||||
rm -f $@ $@.new
|
||||
$(ECHO) PNG@PNGLIB_MAJOR@_0 '{global:' > $@.new
|
||||
echo PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0 '{global:' > $@.new
|
||||
$(SED) s/$$/\;/ libpng.sym >> $@.new
|
||||
$(ECHO) 'local: *; };' >> $@.new
|
||||
echo 'local: *; };' >> $@.new
|
||||
mv $@.new $@
|
||||
|
||||
test: check
|
||||
|
||||
# install the .../include headers as links to the new ones
|
||||
install-data-hook:
|
||||
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h pngdefs.h
|
||||
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
|
||||
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
|
||||
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h pngconf.h
|
||||
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngdefs.h pngdefs.h
|
||||
cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
|
||||
cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
|
||||
|
||||
# do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used
|
||||
# do evil things to libpng to cause libpng14 to be used
|
||||
install-exec-hook:
|
||||
cd $(DESTDIR)$(bindir); rm -f libpng-config
|
||||
cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
|
||||
@set -x;\
|
||||
cd $(DESTDIR)$(libdir);\
|
||||
for ext in a la so; do\
|
||||
for ext in a la so sl dylib; do\
|
||||
rm -f libpng.$$ext;\
|
||||
if test -f $(PNGLIB_BASENAME).$$ext; then\
|
||||
$(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
|
||||
@ -142,13 +140,13 @@ install-exec-hook:
|
||||
done
|
||||
|
||||
uninstall-hook:
|
||||
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h pngdefs.h
|
||||
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
|
||||
rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc
|
||||
rm -f $(DESTDIR)$(bindir)/libpng-config
|
||||
@if test -n "@compatlib@"; then\
|
||||
set -x;\
|
||||
cd $(DESTDIR)$(libdir);\
|
||||
for ext in a la so; do\
|
||||
for ext in a la so sl dylib; do\
|
||||
rm -f libpng.$$ext;\
|
||||
done;\
|
||||
fi
|
||||
|
485
Makefile.in
485
Makefile.in
File diff suppressed because it is too large
Load Diff
14
README
14
README
@ -1,4 +1,4 @@
|
||||
README for libpng version 1.4.0beta24 - July 25, 2008 (shared library 14.0)
|
||||
README for libpng version 1.4.0beta25 - July 30, 2008 (shared library 14.0)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
@ -184,11 +184,11 @@ Files in this distribution:
|
||||
descrip.mms => VMS makefile for MMS or MMK
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
gcc, creates libpng14.so.1.1.4.0beta24)
|
||||
gcc, creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng14.so.1.1.4.0beta24)
|
||||
(gcc, creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.gcmmx => Linux/ELF makefile
|
||||
(gcc, creates libpng14.so.1.1.4.0beta24,
|
||||
(gcc, creates libpng14.so.0.1.4.0beta25,
|
||||
uses assembler code tuned for Intel MMX platform)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
@ -210,12 +210,12 @@ Files in this distribution:
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics
|
||||
(gcc, creates libpng14.so.1.1.4.0beta24)
|
||||
(gcc, creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile
|
||||
(gcc, creates libpng14.so.1.1.4.0beta24)
|
||||
(gcc, creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.so9 => Solaris 9 makefile
|
||||
(gcc, creates libpng14.so.1.1.4.0beta24)
|
||||
(gcc, creates libpng14.so.0.1.4.0beta25)
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
|
8725
aclocal.m4
vendored
8725
aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@
|
||||
touch Makefile.am configure.ac
|
||||
{
|
||||
echo "running libtoolize" >&2
|
||||
libtoolize --copy --automake
|
||||
libtoolize --force --copy --automake
|
||||
} && {
|
||||
echo "running aclocal" >&2
|
||||
aclocal
|
||||
@ -16,7 +16,7 @@
|
||||
autoheader
|
||||
} && {
|
||||
echo "running automake" >&2
|
||||
automake --foreign -a -c
|
||||
automake --force-missing --foreign -a -c
|
||||
} && {
|
||||
echo "running autoconf" >&2
|
||||
autoconf
|
||||
|
153
config.guess
vendored
153
config.guess
vendored
@ -1,9 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2005-12-23'
|
||||
timestamp='2008-01-08'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@ -55,8 +56,8 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@ -106,7 +107,7 @@ set_cc_for_build='
|
||||
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
|
||||
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
|
||||
: ${TMPDIR=/tmp} ;
|
||||
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
|
||||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
|
||||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
|
||||
@ -138,23 +139,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
|
||||
eval $set_cc_for_build
|
||||
cat << EOF > $dummy.c
|
||||
#include <features.h>
|
||||
#ifdef __UCLIBC__
|
||||
# ifdef __UCLIBC_CONFIG_VERSION__
|
||||
LIBC=uclibc __UCLIBC_CONFIG_VERSION__
|
||||
# else
|
||||
LIBC=uclibc
|
||||
# endif
|
||||
#else
|
||||
LIBC=gnu
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
|
||||
fi
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
@ -177,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
arm*) machine=arm-unknown ;;
|
||||
sh3el) machine=shl-unknown ;;
|
||||
sh3eb) machine=sh-unknown ;;
|
||||
sh5el) machine=sh5le-unknown ;;
|
||||
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
|
||||
esac
|
||||
# The Operating System including object format, if it has switched
|
||||
@ -223,8 +208,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:ekkoBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:SolidBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
macppc:MirBSD:*:*)
|
||||
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
|
||||
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:MirBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
|
||||
@ -342,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
@ -544,7 +532,7 @@ EOF
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit ;;
|
||||
*:AIX:*:[45])
|
||||
*:AIX:*:[456])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
@ -784,6 +772,8 @@ EOF
|
||||
case ${UNAME_MACHINE} in
|
||||
pc98)
|
||||
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
amd64)
|
||||
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
esac
|
||||
@ -791,7 +781,7 @@ EOF
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
i*:MINGW*:*)
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
@ -801,9 +791,18 @@ EOF
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
x86:Interix*:[345]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
|
||||
*:Interix*:[3456]*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
echo ia64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
esac ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
@ -837,25 +836,35 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
echo cris-axis-linux-${LIBC}
|
||||
echo cris-axis-linux-gnu
|
||||
exit ;;
|
||||
crisv32:Linux:*:*)
|
||||
echo crisv32-axis-linux-${LIBC}
|
||||
echo crisv32-axis-linux-gnu
|
||||
exit ;;
|
||||
frv:Linux:*:*)
|
||||
echo frv-unknown-linux-${LIBC}
|
||||
echo frv-unknown-linux-gnu
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
mips:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
@ -873,8 +882,12 @@ EOF
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
@ -892,17 +905,21 @@ EOF
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
echo or32-unknown-linux-${LIBC}
|
||||
echo or32-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-${LIBC}
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-${LIBC}
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
@ -915,37 +932,40 @@ EOF
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
|
||||
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
|
||||
*) echo hppa-unknown-linux-${LIBC} ;;
|
||||
PA7*) echo hppa1.1-unknown-linux-gnu ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-gnu ;;
|
||||
*) echo hppa-unknown-linux-gnu ;;
|
||||
esac
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-${LIBC}
|
||||
echo hppa64-unknown-linux-gnu
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
exit ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
vax:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
|
||||
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||
exit ;;
|
||||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-${LIBC}
|
||||
echo x86_64-unknown-linux-gnu
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
@ -960,22 +980,20 @@ EOF
|
||||
p'`
|
||||
case "$ld_supported_targets" in
|
||||
elf32-i386)
|
||||
TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
|
||||
;;
|
||||
a.out-i386-linux)
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||
exit ;;
|
||||
coff-i386)
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
|
||||
exit ;;
|
||||
"")
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld) or
|
||||
# one that does not give us useful --help.
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
|
||||
exit ;;
|
||||
esac
|
||||
# This should get integrated into the C code below, but now we hack
|
||||
if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
@ -991,7 +1009,7 @@ EOF
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI)
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
@ -1001,7 +1019,11 @@ EOF
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`"
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^LIBC/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${LIBC}" != x && {
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit
|
||||
@ -1203,6 +1225,15 @@ EOF
|
||||
SX-6:SUPER-UX:*:*)
|
||||
echo sx6-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-7:SUPER-UX:*:*)
|
||||
echo sx7-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8:SUPER-UX:*:*)
|
||||
echo sx8-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8R:SUPER-UX:*:*)
|
||||
echo sx8r-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit ;;
|
||||
|
13
config.h.in
13
config.h.in
@ -12,10 +12,6 @@
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
||||
to 0 otherwise. */
|
||||
#undef HAVE_MALLOC
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
@ -49,6 +45,10 @@
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
@ -79,8 +79,5 @@
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to rpl_malloc if the replacement function should be used. */
|
||||
#undef malloc
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
135
config.sub
vendored
135
config.sub
vendored
@ -1,9 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2005-12-23'
|
||||
timestamp='2008-01-16'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@ -71,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@ -240,15 +241,16 @@ case $basic_machine in
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx | dvp \
|
||||
| fr30 | frv \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fido | fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@ -268,26 +270,25 @@ case $basic_machine in
|
||||
| mn10200 | mn10300 \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nios | nios2 \
|
||||
| ns16k | ns32k \
|
||||
| or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| z8k)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m32c)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
# Motorola 68HC11/12.
|
||||
basic_machine=$basic_machine-unknown
|
||||
@ -298,10 +299,6 @@ case $basic_machine in
|
||||
ms1)
|
||||
basic_machine=mt-unknown
|
||||
;;
|
||||
nios2 | nios2-* | nios2 | nios2-*)
|
||||
basic_machine=nios2-altera
|
||||
os=-none
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
@ -321,18 +318,18 @@ case $basic_machine in
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| avr-* | avr32-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32r-* | m32rle-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
@ -354,28 +351,31 @@ case $basic_machine in
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nios-* | nios2-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
;;
|
||||
m32c-*)
|
||||
# Recognize the basic CPU types without company name, with glob match.
|
||||
xtensa*)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
@ -447,6 +447,14 @@ case $basic_machine in
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
blackfin)
|
||||
basic_machine=bfin-unknown
|
||||
os=-linux
|
||||
;;
|
||||
blackfin-*)
|
||||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
@ -479,8 +487,8 @@ case $basic_machine in
|
||||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
cr16)
|
||||
basic_machine=cr16-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
@ -672,6 +680,14 @@ case $basic_machine in
|
||||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m68knommu)
|
||||
basic_machine=m68k-unknown
|
||||
os=-linux
|
||||
;;
|
||||
m68knommu-*)
|
||||
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
@ -687,6 +703,10 @@ case $basic_machine in
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
basic_machine=arm-unknown
|
||||
os=-mingw32ce
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
@ -694,24 +714,6 @@ case $basic_machine in
|
||||
basic_machine=m68k-atari
|
||||
os=-mint
|
||||
;;
|
||||
mipsEE* | ee | ps2)
|
||||
basic_machine=mips64r5900el-scei
|
||||
case $os in
|
||||
-linux*)
|
||||
;;
|
||||
*)
|
||||
os=-elf
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
iop)
|
||||
basic_machine=mipsel-scei
|
||||
os=-irx
|
||||
;;
|
||||
dvp)
|
||||
basic_machine=dvp-scei
|
||||
os=-elf
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
@ -831,6 +833,14 @@ case $basic_machine in
|
||||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
parisc)
|
||||
basic_machine=hppa-unknown
|
||||
os=-linux
|
||||
;;
|
||||
parisc-*)
|
||||
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
@ -932,6 +942,10 @@ case $basic_machine in
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sde)
|
||||
basic_machine=mipsisa32-sde
|
||||
os=-elf
|
||||
;;
|
||||
sei)
|
||||
basic_machine=mips-sei
|
||||
os=-seiux
|
||||
@ -943,6 +957,9 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sh5el)
|
||||
basic_machine=sh5le-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
@ -1032,6 +1049,10 @@ case $basic_machine in
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tile*)
|
||||
basic_machine=tile-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
@ -1148,7 +1169,7 @@ case $basic_machine in
|
||||
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b)
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
@ -1221,7 +1242,8 @@ case $os in
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
@ -1236,7 +1258,7 @@ case $os in
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -irx*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@ -1388,6 +1410,12 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
score-*)
|
||||
os=-elf
|
||||
;;
|
||||
spu-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
@ -1425,6 +1453,9 @@ case $basic_machine in
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mep-*)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=-elf
|
||||
;;
|
||||
|
53
configure.ac
53
configure.ac
@ -3,7 +3,7 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
dnl Minor upgrades (compatible ABI): increment the package version
|
||||
dnl (third field in two places below) and set the PNGLIB_MINOR
|
||||
dnl (third field in two places below) and set the PNGLIB_RELEASE
|
||||
dnl variable.
|
||||
dnl
|
||||
dnl Major upgrades (incompatible ABI): increment the package major
|
||||
@ -18,14 +18,15 @@ AC_PREREQ(2.59)
|
||||
|
||||
dnl Version number stuff here:
|
||||
|
||||
AC_INIT([libpng], [1.4.0beta24], [png-mng-implement@lists.sourceforge.net])
|
||||
AC_INIT([libpng], [1.4.0beta25], [png-mng-implement@lists.sourceforge.net])
|
||||
AM_INIT_AUTOMAKE
|
||||
dnl stop configure from automagically running automake
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
PNGLIB_VERSION=1.4.0beta24
|
||||
PNGLIB_MAJOR=14
|
||||
PNGLIB_MINOR=0
|
||||
PNGLIB_VERSION=1.4.0beta25
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=4
|
||||
PNGLIB_RELEASE=0
|
||||
|
||||
dnl End of version number stuff
|
||||
|
||||
@ -37,6 +38,7 @@ AC_PROG_CC
|
||||
AC_PROG_LD
|
||||
AC_PROG_CPP
|
||||
AC_CHECK_TOOL(SED, sed, :)
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
@ -57,21 +59,19 @@ AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
|
||||
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
|
||||
AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
|
||||
|
||||
AC_MSG_CHECKING([if pnggccrd.c can be compiled without -DPNG_NO_MMX_CODE])
|
||||
AC_TRY_COMPILE(
|
||||
[#include "pnggccrd.c"],
|
||||
[return 0;],
|
||||
LIBPNG_NO_MMX=,
|
||||
LIBPNG_NO_MMX=true)
|
||||
if test "$LIBPNG_NO_MMX"; then
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
AC_SUBST(LIBPNG_NO_MMX)
|
||||
|
||||
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
|
||||
AC_MSG_CHECKING(
|
||||
[if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
|
||||
AC_TRY_COMPILE(
|
||||
[#include "$srcdir/pnggccrd.c"],
|
||||
[return 0;],
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBPNG_NO_MMX="",
|
||||
AC_MSG_RESULT(no)
|
||||
LIBPNG_NO_MMX=-DPNG_NO_MMX_CODE)
|
||||
LIBPNG_DEFINES=$LIBPNG_DEFINES\ $LIBPNG_NO_MMX
|
||||
AC_SUBST(LIBPNG_DEFINES)
|
||||
AC_SUBST(LIBPNG_NO_MMX)
|
||||
|
||||
AC_MSG_CHECKING([if libraries can be versioned])
|
||||
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
|
||||
@ -85,10 +85,21 @@ else
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
||||
|
||||
if test "$have_ld_version_script" = "yes"; then
|
||||
AC_MSG_CHECKING([for symbol prefix])
|
||||
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
|
||||
| ${CPP-${CC-gcc} -E} - 2>&1 \
|
||||
| ${EGREP-grep} "^PREFIX=" \
|
||||
| ${SED-sed} "s:^PREFIX=::"`
|
||||
AC_SUBST(SYMBOL_PREFIX)
|
||||
AC_MSG_RESULT($SYMBOL_PREFIX)
|
||||
fi
|
||||
|
||||
# Substitutions for .in files
|
||||
AC_SUBST(PNGLIB_VERSION)
|
||||
AC_SUBST(PNGLIB_MAJOR)
|
||||
AC_SUBST(PNGLIB_MINOR)
|
||||
AC_SUBST(PNGLIB_RELEASE)
|
||||
|
||||
# Additional arguments (and substitutions)
|
||||
# Allow the pkg-config directory to be set
|
||||
@ -122,15 +133,15 @@ AC_ARG_WITH(libpng-compat,
|
||||
[Generate the obsolete libpng.so library @<:@default=yes@:>@]),
|
||||
[if test "${withval}" = no; then
|
||||
compatlib=
|
||||
AC_MSG_NOTICE([libpng.so will not be built])
|
||||
else
|
||||
compatlib=libpng.la
|
||||
AC_MSG_NOTICE([libpng.so will be built])
|
||||
fi],
|
||||
[compatlib=])
|
||||
[compatlib=libpng.la])
|
||||
AC_SUBST([compatlib])
|
||||
|
||||
# Config files, substituting as above
|
||||
AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc.in])
|
||||
AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc-configure.in])
|
||||
AC_CONFIG_FILES([libpng-config:scripts/libpng-config.in],
|
||||
[chmod +x libpng-config])
|
||||
|
||||
|
340
contrib/gregbook/COPYING
Normal file
340
contrib/gregbook/COPYING
Normal file
@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
@ -1,12 +1,19 @@
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -23,4 +30,21 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
130
contrib/gregbook/Makefile.mingw32
Normal file
130
contrib/gregbook/Makefile.mingw32
Normal file
@ -0,0 +1,130 @@
|
||||
# Sample makefile for rpng-win / rpng2-win / wpng using mingw32-gcc and make.
|
||||
# Greg Roelofs
|
||||
# Last modified: 2 June 2007
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
# Associates, 1999). Go buy a copy, eh? Well, OK, it's not
|
||||
# generally for sale anymore, but it's the thought that counts,
|
||||
# right? (Hint: http://www.libpng.org/pub/png/book/ )
|
||||
#
|
||||
# Invoke this makefile from a DOS-prompt window via:
|
||||
#
|
||||
# make -f Makefile.mingw32
|
||||
#
|
||||
# This makefile assumes libpng and zlib have already been built or downloaded
|
||||
# and are in subdirectories at the same level as the current subdirectory
|
||||
# (as indicated by the PNGDIR and ZDIR macros below). It makes no assumptions
|
||||
# at all about the mingw32 installation tree (W32DIR). Edit as appropriate.
|
||||
#
|
||||
# Note that the names of the dynamic and static libpng and zlib libraries
|
||||
# used below may change in later releases of the libraries. This makefile
|
||||
# builds both statically and dynamically linked executables by default.
|
||||
# (You need only one set, but for testing it can be handy to have both.)
|
||||
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
#PNGDIR = ../..# for libpng-x.y.z/contrib/gregbook builds
|
||||
PNGDIR = ../libpng-win32
|
||||
PNGINC = -I$(PNGDIR)
|
||||
PNGLIBd = $(PNGDIR)/libpng.dll.a # dynamically linked
|
||||
PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng
|
||||
|
||||
#ZDIR = ../../../zlib-win32# for libpng-x.y.z/contrib/gregbook builds
|
||||
ZDIR = ../zlib-win32
|
||||
ZINC = -I$(ZDIR)
|
||||
ZLIBd = $(ZDIR)/libzdll.a
|
||||
ZLIBs = $(ZDIR)/libz.a
|
||||
|
||||
# change this to be the path where mingw32 installs its stuff:
|
||||
W32DIR =
|
||||
#W32DIR = /usr/local/cross-tools/i386-mingw32msvc
|
||||
W32INC = -I$(W32DIR)/include
|
||||
W32LIB = $(W32DIR)/lib/libuser32.a $(W32DIR)/lib/libgdi32.a
|
||||
|
||||
CC = gcc
|
||||
#CC = i386-mingw32msvc-gcc # e.g., Linux -> Win32 cross-compilation
|
||||
LD = $(CC)
|
||||
RM = rm -f
|
||||
CFLAGS = -O -Wall $(INCS) $(MINGW_CCFLAGS)
|
||||
# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
|
||||
# [-ansi, -pedantic and -W can also be used]
|
||||
LDFLAGS = $(MINGW_LDFLAGS)
|
||||
O = .o
|
||||
E = .exe
|
||||
|
||||
INCS = $(PNGINC) $(ZINC) $(W32INC)
|
||||
RLIBSd = $(PNGLIBd) $(ZLIBd) $(W32LIB) -lm
|
||||
RLIBSs = $(PNGLIBs) $(ZLIBs) $(W32LIB) -lm
|
||||
WLIBSd = $(PNGLIBd) $(ZLIBd)
|
||||
WLIBSs = $(PNGLIBs) $(ZLIBs)
|
||||
|
||||
RPNG = rpng-win
|
||||
RPNG2 = rpng2-win
|
||||
WPNG = wpng
|
||||
|
||||
ROBJSd = $(RPNG)$(O) readpng.pic$(O)
|
||||
ROBJS2d = $(RPNG2)$(O) readpng2.pic$(O)
|
||||
WOBJSd = $(WPNG)$(O) writepng.pic$(O)
|
||||
|
||||
RPNGs = $(RPNG)-static
|
||||
RPNG2s = $(RPNG2)-static
|
||||
WPNGs = $(WPNG)-static
|
||||
|
||||
ROBJSs = $(RPNG)$(O) readpng$(O)
|
||||
ROBJS2s = $(RPNG2)$(O) readpng2$(O)
|
||||
WOBJSs = $(WPNG)$(O) writepng$(O)
|
||||
|
||||
STATIC_EXES = $(RPNGs)$(E) $(RPNG2s)$(E) $(WPNGs)$(E)
|
||||
DYNAMIC_EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
|
||||
EXES = $(STATIC_EXES) $(DYNAMIC_EXES)
|
||||
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O):
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
%.pic$(O): %.c
|
||||
$(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $<
|
||||
|
||||
|
||||
# dependencies --------------------------------------------------------------
|
||||
|
||||
all: $(EXES)
|
||||
|
||||
$(RPNGs)$(E): $(ROBJSs)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJSs) $(RLIBSs)
|
||||
|
||||
$(RPNG)$(E): $(ROBJSd)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJSd) $(RLIBSd)
|
||||
|
||||
$(RPNG2s)$(E): $(ROBJS2s)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2s) $(RLIBSs)
|
||||
|
||||
$(RPNG2)$(E): $(ROBJS2d)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2d) $(RLIBSd)
|
||||
|
||||
$(WPNGs)$(E): $(WOBJSs)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJSs) $(WLIBSs)
|
||||
|
||||
$(WPNG)$(E): $(WOBJSd)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJSd) $(WLIBSd)
|
||||
|
||||
$(RPNG)$(O): $(RPNG).c readpng.h
|
||||
$(RPNG2)$(O): $(RPNG2).c readpng2.h
|
||||
$(WPNG)$(O): $(WPNG).c writepng.h
|
||||
|
||||
readpng$(O) readpng.pic$(O): readpng.c readpng.h
|
||||
readpng2$(O) readpng2.pic$(O): readpng2.c readpng2.h
|
||||
writepng$(O) writepng.pic$(O): writepng.c writepng.h
|
||||
|
||||
|
||||
# maintenance ---------------------------------------------------------------
|
||||
|
||||
clean:
|
||||
$(RM) $(EXES)
|
||||
$(RM) $(ROBJSs) $(ROBJS2s) $(WOBJSs)
|
||||
$(RM) $(ROBJSd) $(ROBJS2d) $(WOBJSd)
|
@ -23,9 +23,9 @@
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
PNGINC = -I/usr/local/include/libpng14
|
||||
PNGLIB = -L/usr/local/lib -lpng14 # dynamically linked against libpng
|
||||
#PNGLIB = /usr/local/lib/libpng14.a # statically linked against libpng
|
||||
PNGINC = -I/usr/local/include/libpng12
|
||||
PNGLIB = -L/usr/local/lib -lpng12 # dynamically linked against libpng
|
||||
#PNGLIB = /usr/local/lib/libpng12.a # statically linked against libpng
|
||||
# or:
|
||||
#PNGINC = -I../..
|
||||
#PNGLIB = -L../.. -lpng
|
||||
|
@ -1,58 +1,70 @@
|
||||
# Sample makefile for rpng-x / rpng2-x / wpng using gcc and make.
|
||||
# Greg Roelofs
|
||||
# Last modified: 7 March 2002
|
||||
# Last modified: 2 June 2007
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
# Associates, 1999). Go buy a copy, eh? Buy some for friends
|
||||
# and family, too. (Not that this is a blatant plug or anything.)
|
||||
# Associates, 1999). Go buy a copy, eh? Well, OK, it's not
|
||||
# generally for sale anymore, but it's the thought that counts,
|
||||
# right? (Hint: http://www.libpng.org/pub/png/book/ )
|
||||
#
|
||||
# Invoke this makefile from a shell prompt in the usual way; for example:
|
||||
#
|
||||
# make -f Makefile.unx
|
||||
#
|
||||
# This makefile assumes libpng and zlib have already been built or downloaded
|
||||
# and are both installed in /usr/local/{include,lib} (as indicated by the
|
||||
# PNG* and Z* macros below). Edit as appropriate--choose only ONE each of
|
||||
# the PNGINC, PNGLIB, ZINC and ZLIB lines.
|
||||
# and are installed in /usr/local/{include,lib} or as otherwise indicated by
|
||||
# the PNG* and Z* macros below. Edit as appropriate--choose only ONE each of
|
||||
# the PNGINC, PNGLIBd, PNGLIBs, ZINC, ZLIBd and ZLIBs lines.
|
||||
#
|
||||
# This makefile builds statically linked executables (against libpng and zlib,
|
||||
# that is), but that can be changed by uncommenting the appropriate PNGLIB and
|
||||
# ZLIB lines.
|
||||
# This makefile builds both dynamically and statically linked executables
|
||||
# (against libpng and zlib, that is), but that can be changed by modifying
|
||||
# the "EXES =" line. (You need only one set, but for testing it can be handy
|
||||
# to have both.)
|
||||
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
PNGINC = -I/usr/local/include/libpng14
|
||||
#PNGLIB = -L/usr/local/lib -lpng14 # dynamically linked against libpng
|
||||
PNGLIB = /usr/local/lib/libpng14.a # statically linked against libpng
|
||||
#PNGDIR = /usr/local/lib
|
||||
#PNGINC = -I/usr/local/include/libpng12
|
||||
#PNGLIBd = -L$(PNGDIR) -lpng12 # dynamically linked, installed libpng
|
||||
#PNGLIBs = $(PNGDIR)/libpng12.a # statically linked, installed libpng
|
||||
# or:
|
||||
#PNGINC = -I../libpng
|
||||
#PNGLIB = -L../libpng -lpng
|
||||
#PNGLIB = ../libpng/libpng.a
|
||||
PNGDIR = ../..# this one is for libpng-x.y.z/contrib/gregbook builds
|
||||
#PNGDIR = ../libpng
|
||||
PNGINC = -I$(PNGDIR)
|
||||
PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng12 # dynamically linked
|
||||
PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng
|
||||
|
||||
ZDIR = /usr/local/lib
|
||||
#ZDIR = /usr/lib64
|
||||
ZINC = -I/usr/local/include
|
||||
#ZLIB = -L/usr/local/lib -lz # dynamically linked against zlib
|
||||
ZLIB = /usr/local/lib/libz.a # statically linked against zlib
|
||||
#ZINC = -I../zlib
|
||||
#ZLIB = -L../zlib -lz
|
||||
#ZLIB = ../zlib/libz.a
|
||||
ZLIBd = -L$(ZDIR) -lz # dynamically linked against zlib
|
||||
ZLIBs = $(ZDIR)/libz.a # statically linked against zlib
|
||||
# or:
|
||||
#ZDIR = ../zlib
|
||||
#ZINC = -I$(ZDIR)
|
||||
#ZLIBd = -Wl,-rpath,$(ZDIR) -L$(ZDIR) -lz # -rpath allows in-place testing
|
||||
#ZLIBs = $(ZDIR)/libz.a
|
||||
|
||||
#XINC = -I/usr/include # old-style, stock X distributions
|
||||
#XLIB = -L/usr/lib/X11 -lX11
|
||||
#XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
|
||||
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
|
||||
#XLIB = -L/usr/openwin/lib -lX11
|
||||
XINC = -I/usr/X11R6/include # new X distributions (XFree86, etc.)
|
||||
XINC = -I/usr/X11R6/include # new X distributions (X.org, etc.)
|
||||
XLIB = -L/usr/X11R6/lib -lX11
|
||||
#XLIB = -L/usr/X11R6/lib64 -lX11 # e.g., Red Hat on AMD64
|
||||
|
||||
INCS = $(PNGINC) $(ZINC) $(XINC)
|
||||
RLIBS = $(PNGLIB) $(ZLIB) $(XLIB) -lm
|
||||
WLIBS = $(PNGLIB) $(ZLIB)
|
||||
RLIBSd = $(PNGLIBd) $(ZLIBd) $(XLIB) -lm
|
||||
RLIBSs = $(PNGLIBs) $(ZLIBs) $(XLIB) -lm
|
||||
WLIBSd = $(PNGLIBd) $(ZLIBd) -lm
|
||||
WLIBSs = $(PNGLIBs) $(ZLIBs)
|
||||
|
||||
CC = gcc
|
||||
LD = gcc
|
||||
RM = rm -f
|
||||
CFLAGS = -O -Wall $(INCS)
|
||||
CFLAGS = -O -Wall $(INCS) -DFEATURE_LOOP
|
||||
# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
|
||||
# [-ansi, -pedantic and -W can also be used]
|
||||
LDFLAGS =
|
||||
@ -63,11 +75,18 @@ RPNG = rpng-x
|
||||
RPNG2 = rpng2-x
|
||||
WPNG = wpng
|
||||
|
||||
RPNGs = $(RPNG)-static
|
||||
RPNG2s = $(RPNG2)-static
|
||||
WPNGs = $(WPNG)-static
|
||||
|
||||
ROBJS = $(RPNG)$(O) readpng$(O)
|
||||
ROBJS2 = $(RPNG2)$(O) readpng2$(O)
|
||||
WOBJS = $(WPNG)$(O) writepng$(O)
|
||||
|
||||
EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
STATIC_EXES = $(RPNGs)$(E) $(RPNG2s)$(E) $(WPNGs)$(E)
|
||||
DYNAMIC_EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
|
||||
EXES = $(STATIC_EXES) $(DYNAMIC_EXES)
|
||||
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
@ -80,14 +99,23 @@ EXES = $(RPNG)$(E) $(RPNG2)$(E) $(WPNG)$(E)
|
||||
|
||||
all: $(EXES)
|
||||
|
||||
$(RPNGs)$(E): $(ROBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBSs)
|
||||
|
||||
$(RPNG)$(E): $(ROBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS) $(RLIBSd)
|
||||
|
||||
$(RPNG2s)$(E): $(ROBJS2)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBSs)
|
||||
|
||||
$(RPNG2)$(E): $(ROBJS2)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(ROBJS2) $(RLIBSd)
|
||||
|
||||
$(WPNGs)$(E): $(WOBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBSs)
|
||||
|
||||
$(WPNG)$(E): $(WOBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(WOBJS) $(WLIBSd)
|
||||
|
||||
$(RPNG)$(O): $(RPNG).c readpng.h
|
||||
$(RPNG2)$(O): $(RPNG2).c readpng2.h
|
||||
|
@ -1,11 +1,12 @@
|
||||
# Sample makefile for rpng-win / rpng2-win / wpng using MSVC and NMAKE.
|
||||
# Greg Roelofs
|
||||
# Last modified: 16 February 1999
|
||||
# Last modified: 2 June 2007
|
||||
#
|
||||
# The programs built by this makefile are described in the book,
|
||||
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
|
||||
# Associates, 1999). Go buy a copy, eh? Buy some for friends
|
||||
# and family, too. (Not that this is a blatant plug or anything.)
|
||||
# Associates, 1999). Go buy a copy, eh? Well, OK, it's not
|
||||
# generally for sale anymore, but it's the thought that counts,
|
||||
# right? (Hint: http://www.libpng.org/pub/png/book/ )
|
||||
#
|
||||
# Invoke this makefile from a DOS prompt window via:
|
||||
#
|
||||
@ -53,7 +54,7 @@ CC = cl
|
||||
LD = link
|
||||
RM = del
|
||||
CFLAGS = -nologo -O -W3 $(INCS) $(cvars)
|
||||
# [note that -Wall is an MSVC-specific compilation flag ("all warnings on")]
|
||||
# [note that -W3 is an MSVC-specific compilation flag ("all warnings on")]
|
||||
# [see %devstudio%\vc\include\win32.mak for cvars macro definition]
|
||||
O = .obj
|
||||
E = .exe
|
||||
|
@ -22,7 +22,8 @@ below.
|
||||
Files:
|
||||
|
||||
README this file
|
||||
LICENSE terms of distribution and reuse (BSD-like)
|
||||
LICENSE terms of distribution and reuse (BSD-like or GNU GPL)
|
||||
COPYING GNU General Public License (GPL)
|
||||
|
||||
Makefile.unx Unix makefile
|
||||
Makefile.w32 Windows (MSVC) makefile
|
||||
@ -54,15 +55,15 @@ mation and links to the latest version of the source code, and Chapters
|
||||
13-15 of the book for detailed discussion of the three programs.
|
||||
|
||||
Greg Roelofs
|
||||
newt@pobox.com
|
||||
30 June 2001
|
||||
http://pobox.com/~newt/greg_contact.html
|
||||
16 March 2008
|
||||
|
||||
|
||||
BUILD INSTRUCTIONS
|
||||
|
||||
- Prerequisites (in order of compilation):
|
||||
|
||||
- zlib http://www.gzip.org/zlib/
|
||||
- zlib http://zlib.net/
|
||||
- libpng http://www.libpng.org/pub/png/libpng.html
|
||||
- pngbook http://www.libpng.org/pub/png/book/sources.html
|
||||
|
||||
@ -176,7 +177,7 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO
|
||||
wpng is a purely command-line image converter from binary PBMPLUS/NetPBM
|
||||
format (.pgm or .ppm) to PNG; for example,
|
||||
|
||||
wpng -time < toucan.ppm > toucan.png
|
||||
wpng -time < toucan-notrans.ppm > toucan-notrans.png
|
||||
|
||||
would convert the specified PPM file (using redirection) to PNG, auto-
|
||||
matically setting the PNG modification-time chunk.
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TRUE
|
||||
|
@ -4,19 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Changelog:
|
||||
- 1.01: initial public release
|
||||
- 1.02: added code to skip unused chunks (GR-P)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2002 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -33,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -56,7 +74,7 @@ static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg);
|
||||
void readpng2_version_info(void)
|
||||
{
|
||||
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && \
|
||||
(defined(__i386__) || defined(_M_IX86)) && \
|
||||
(defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \
|
||||
defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||
/*
|
||||
* WARNING: This preprocessor approach means that the following code
|
||||
@ -79,7 +97,12 @@ void readpng2_version_info(void)
|
||||
"with MMX support\n (%s version).", PNG_LIBPNG_VER_STRING,
|
||||
png_libpng_ver, compilerID == 1? "MSVC++" :
|
||||
(compilerID == 2? "GNU C" : "unknown"));
|
||||
fprintf(stderr, " Processor %s MMX instructions.\n",
|
||||
fprintf(stderr, " Processor (x86%s) %s MMX instructions.\n",
|
||||
#if defined(__x86_64__)
|
||||
"_64",
|
||||
#else
|
||||
"",
|
||||
#endif
|
||||
mmxsupport? "supports" : "does not support");
|
||||
if (mmxsupport > 0) {
|
||||
int num_optims = 0;
|
||||
@ -179,40 +202,38 @@ int readpng2_init(mainprog_info *mainprog_ptr)
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* prepare the reader to ignore all recognized chunks whose data isn't
|
||||
* going to be used, i.e., all chunks recognized by libpng except for
|
||||
* IHDR, PLTE, IDAT, IEND, tRNS, bKGD, gAMA, and sRGB : */
|
||||
|
||||
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
|
||||
/* prepare the reader to ignore all recognized chunks whose data won't be
|
||||
* used, i.e., all chunks recognized by libpng except for IHDR, PLTE, IDAT,
|
||||
* IEND, tRNS, bKGD, gAMA, and sRGB (small performance improvement) */
|
||||
{
|
||||
#ifndef HANDLE_CHUNK_NEVER
|
||||
/* prior to libpng-1.2.5, this macro was internal, so we define it here. */
|
||||
# define HANDLE_CHUNK_NEVER 1
|
||||
#endif
|
||||
/* these byte strings were copied from png.h.
|
||||
* If a future libpng version recognizes more chunks, add them
|
||||
* to this list. If a future version of readpng2.c recognizes
|
||||
* more chunks, delete them from this list. */
|
||||
png_byte png_chunk_types_to_ignore[]=
|
||||
{ 99, 72, 82, 77, '\0', /* cHRM */
|
||||
/* These byte strings were copied from png.h. If a future libpng
|
||||
* version recognizes more chunks, add them to this list. If a
|
||||
* future version of readpng2.c recognizes more chunks, delete them
|
||||
* from this list. */
|
||||
static const png_byte chunks_to_ignore[] = {
|
||||
99, 72, 82, 77, '\0', /* cHRM */
|
||||
104, 73, 83, 84, '\0', /* hIST */
|
||||
105, 67, 67, 80, '\0', /* iCCP */
|
||||
105, 84, 88, 116, '\0', /* iTXt */
|
||||
111, 70, 70, 115, '\0', /* oFFs */
|
||||
112, 67, 65, 76, '\0', /* pCAL */
|
||||
115, 67, 65, 76, '\0', /* sCAL */
|
||||
112, 72, 89, 115, '\0', /* pHYs */
|
||||
115, 66, 73, 84, '\0', /* sBIT */
|
||||
115, 67, 65, 76, '\0', /* sCAL */
|
||||
115, 80, 76, 84, '\0', /* sPLT */
|
||||
115, 84, 69, 82, '\0', /* sTER */
|
||||
116, 69, 88, 116, '\0', /* tEXt */
|
||||
116, 73, 77, 69, '\0', /* tIME */
|
||||
122, 84, 88, 116, '\0'}; /* zTXt */
|
||||
#define NUM_PNG_CHUNK_TYPES_TO_IGNORE 13
|
||||
122, 84, 88, 116, '\0' /* zTXt */
|
||||
};
|
||||
|
||||
png_set_keep_unknown_chunks(png_ptr, HANDLE_CHUNK_NEVER,
|
||||
png_chunk_types_to_ignore, NUM_PNG_CHUNK_TYPES_TO_IGNORE);
|
||||
png_set_keep_unknown_chunks(png_ptr, 1 /* PNG_HANDLE_CHUNK_NEVER */,
|
||||
chunks_to_ignore, sizeof(chunks_to_ignore)/5);
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_UNKNOWN_CHUNKS_SUPPORTED */
|
||||
|
||||
|
||||
/* instead of doing png_init_io() here, now we set up our callback
|
||||
* functions for progressive decoding */
|
||||
@ -237,7 +258,7 @@ int readpng2_init(mainprog_info *mainprog_ptr)
|
||||
* png_set_asm_flags (png_ptr, flags);
|
||||
*/
|
||||
|
||||
#if (defined(__i386__) || defined(_M_IX86)) && \
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \
|
||||
defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||
/*
|
||||
* WARNING: This preprocessor approach means that the following code
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TRUE
|
||||
@ -45,6 +69,12 @@
|
||||
# define Trace(x) ;
|
||||
#endif
|
||||
|
||||
enum rpng2_states {
|
||||
kPreInit = 0,
|
||||
kWindowInit,
|
||||
kDone
|
||||
};
|
||||
|
||||
typedef unsigned char uch;
|
||||
typedef unsigned short ush;
|
||||
typedef unsigned long ulg;
|
||||
@ -66,12 +96,12 @@ typedef struct _mainprog_info {
|
||||
int rowbytes;
|
||||
int channels;
|
||||
int need_bgcolor;
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
int nommxfilters;
|
||||
int nommxcombine;
|
||||
int nommxinterlace;
|
||||
#endif
|
||||
int done;
|
||||
int state;
|
||||
uch bg_red;
|
||||
uch bg_green;
|
||||
uch bg_blue;
|
||||
|
179
contrib/gregbook/readppm.c
Normal file
179
contrib/gregbook/readppm.c
Normal file
@ -0,0 +1,179 @@
|
||||
/*---------------------------------------------------------------------------
|
||||
|
||||
rpng - simple PNG display program readppm.c
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
This is a special-purpose replacement for readpng.c that allows binary
|
||||
PPM files to be used in place of PNG images.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, disclaimer, and this list of conditions.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, disclaimer, and this list of conditions in the documenta-
|
||||
tion and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this
|
||||
software must display the following acknowledgment:
|
||||
|
||||
This product includes software developed by Greg Roelofs
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "readpng.h" /* typedefs, common macros, public prototypes */
|
||||
|
||||
|
||||
ulg width, height;
|
||||
int bit_depth, color_type, channels;
|
||||
uch *image_data = NULL;
|
||||
FILE *saved_infile;
|
||||
|
||||
|
||||
void readpng_version_info()
|
||||
{
|
||||
fprintf(stderr, " Compiled without libpng, zlib or PBMPLUS/NetPBM.\n");
|
||||
}
|
||||
|
||||
|
||||
/* return value = 0 for success, 1 for bad sig, 2 for bad IHDR, 4 for no mem */
|
||||
|
||||
int readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight)
|
||||
{
|
||||
static uch ppmline[256];
|
||||
int maxval;
|
||||
|
||||
|
||||
saved_infile = infile;
|
||||
|
||||
fgets(ppmline, 256, infile);
|
||||
if (ppmline[0] != 'P' || ppmline[1] != '6') {
|
||||
fprintf(stderr, "ERROR: not a PPM file\n");
|
||||
return 1;
|
||||
}
|
||||
/* possible color types: P5 = grayscale (0), P6 = RGB (2), P8 = RGBA (6) */
|
||||
if (ppmline[1] == '6') {
|
||||
color_type = 2;
|
||||
channels = 3;
|
||||
} else if (ppmline[1] == '8') {
|
||||
color_type = 6;
|
||||
channels = 4;
|
||||
} else /* if (ppmline[1] == '5') */ {
|
||||
color_type = 0;
|
||||
channels = 1;
|
||||
}
|
||||
|
||||
do {
|
||||
fgets(ppmline, 256, infile);
|
||||
} while (ppmline[0] == '#');
|
||||
sscanf(ppmline, "%lu %lu", &width, &height);
|
||||
|
||||
do {
|
||||
fgets(ppmline, 256, infile);
|
||||
} while (ppmline[0] == '#');
|
||||
sscanf(ppmline, "%d", &maxval);
|
||||
if (maxval != 255) {
|
||||
fprintf(stderr, "ERROR: maxval = %d\n", maxval);
|
||||
return 2;
|
||||
}
|
||||
bit_depth = 8;
|
||||
|
||||
*pWidth = width;
|
||||
*pHeight = height;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* returns 0 if succeeds, 1 if fails due to no bKGD chunk, 2 if libpng error;
|
||||
* scales values to 8-bit if necessary */
|
||||
|
||||
int readpng_get_bgcolor(uch *red, uch *green, uch *blue)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* display_exponent == LUT_exponent * CRT_exponent */
|
||||
|
||||
uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
{
|
||||
ulg rowbytes;
|
||||
|
||||
|
||||
/* expand palette images to RGB, low-bit-depth grayscale images to 8 bits,
|
||||
* transparency chunks to full alpha channel; strip 16-bit-per-sample
|
||||
* images to 8 bits per sample; and convert grayscale to RGB[A] */
|
||||
|
||||
/* GRR WARNING: grayscale needs to be expanded and channels reset! */
|
||||
|
||||
*pRowbytes = rowbytes = channels*width;
|
||||
*pChannels = channels;
|
||||
|
||||
if ((image_data = (uch *)malloc(rowbytes*height)) == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Trace((stderr, "readpng_get_image: rowbytes = %ld, height = %ld\n", rowbytes, height));
|
||||
|
||||
|
||||
/* now we can go ahead and just read the whole image */
|
||||
|
||||
fread(image_data, 1L, rowbytes*height, saved_infile);
|
||||
|
||||
|
||||
return image_data;
|
||||
}
|
||||
|
||||
|
||||
void readpng_cleanup(int free_image_data)
|
||||
{
|
||||
if (free_image_data && image_data) {
|
||||
free(image_data);
|
||||
image_data = NULL;
|
||||
}
|
||||
}
|
@ -22,16 +22,25 @@
|
||||
- 1.02: added extra set of parentheses to png_jmpbuf() macro; fixed
|
||||
command-line parsing bug
|
||||
- 1.10: enabled "message window"/console (thanks to David Geldreich)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
- 2.01: fixed improper display of usage screen on PNG error(s)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -48,11 +57,28 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng-win"
|
||||
#define LONGNAME "Simple PNG Viewer for Windows"
|
||||
#define VERSION "1.20 of 28 May 2001"
|
||||
#define VERSION "2.01 of 16 March 2008"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -85,10 +111,9 @@ static void rpng_win_cleanup(void);
|
||||
LRESULT CALLBACK rpng_win_wndproc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char titlebar[1024];
|
||||
static char *progname = PROGNAME;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME; /* GRR: not (yet) used */
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@ -247,40 +272,11 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
}
|
||||
|
||||
if (!filename) {
|
||||
if (!filename)
|
||||
++error;
|
||||
} else if (!(infile = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
||||
++error;
|
||||
} else {
|
||||
if ((rc = readpng_init(infile, &image_width, &image_height)) != 0) {
|
||||
switch (rc) {
|
||||
case 1:
|
||||
fprintf(stderr, PROGNAME
|
||||
": [%s] is not a PNG file: incorrect signature\n",
|
||||
filename);
|
||||
break;
|
||||
case 2:
|
||||
fprintf(stderr, PROGNAME
|
||||
": [%s] has bad IHDR (libpng longjmp)\n",
|
||||
filename);
|
||||
break;
|
||||
case 4:
|
||||
fprintf(stderr, PROGNAME ": insufficient memory\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, PROGNAME
|
||||
": unknown readpng_init() error\n");
|
||||
break;
|
||||
}
|
||||
++error;
|
||||
}
|
||||
if (error)
|
||||
fclose(infile);
|
||||
}
|
||||
|
||||
|
||||
/* usage screen */
|
||||
/* print usage screen if any errors up to this point */
|
||||
|
||||
if (error) {
|
||||
int ch;
|
||||
@ -303,6 +299,47 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (!(infile = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
||||
++error;
|
||||
} else {
|
||||
if ((rc = readpng_init(infile, &image_width, &image_height)) != 0) {
|
||||
switch (rc) {
|
||||
case 1:
|
||||
fprintf(stderr, PROGNAME
|
||||
": [%s] is not a PNG file: incorrect signature\n",
|
||||
filename);
|
||||
break;
|
||||
case 2:
|
||||
fprintf(stderr, PROGNAME
|
||||
": [%s] has bad IHDR (libpng longjmp)\n", filename);
|
||||
break;
|
||||
case 4:
|
||||
fprintf(stderr, PROGNAME ": insufficient memory\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, PROGNAME
|
||||
": unknown readpng_init() error\n");
|
||||
break;
|
||||
}
|
||||
++error;
|
||||
}
|
||||
if (error)
|
||||
fclose(infile);
|
||||
}
|
||||
|
||||
|
||||
if (error) {
|
||||
int ch;
|
||||
|
||||
fprintf(stderr, PROGNAME ": aborting.\n");
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
exit(2);
|
||||
} else {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
fprintf(stderr,
|
||||
@ -325,9 +362,14 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
* check for one in the PNG file--if not, the initialized values of 0
|
||||
* (black) will be used */
|
||||
|
||||
if (have_bg)
|
||||
sscanf(bgstr+1, "%2x%2x%2x", &bg_red, &bg_green, &bg_blue);
|
||||
else if (readpng_get_bgcolor(&bg_red, &bg_green, &bg_blue) > 1) {
|
||||
if (have_bg) {
|
||||
unsigned r, g, b; /* this approach quiets compiler warnings */
|
||||
|
||||
sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b);
|
||||
bg_red = (uch)r;
|
||||
bg_green = (uch)g;
|
||||
bg_blue = (uch)b;
|
||||
} else if (readpng_get_bgcolor(&bg_red, &bg_green, &bg_blue) > 1) {
|
||||
readpng_cleanup(TRUE);
|
||||
fprintf(stderr, PROGNAME
|
||||
": libpng error while checking for background color\n");
|
||||
|
@ -9,7 +9,7 @@
|
||||
by Martin Zinser under OpenVMS; may work under OS/2 with some tweaking).
|
||||
|
||||
to do:
|
||||
- 8-bit support
|
||||
- 8-bit (colormapped) X support
|
||||
- use %.1023s to simplify truncation of title-bar string?
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
@ -21,18 +21,28 @@
|
||||
- 1.10: added support for non-default visuals; fixed X pixel-conversion
|
||||
- 1.11: added extra set of parentheses to png_jmpbuf() macro; fixed
|
||||
command-line parsing bug
|
||||
- 1.12: fixed small X memory leak (thanks to Francois Petitjean)
|
||||
- 1.13: fixed XFreeGC() crash bug
|
||||
- 1.12: fixed some small X memory leaks (thanks to François Petitjean)
|
||||
- 1.13: fixed XFreeGC() crash bug (thanks to Patrick Welche)
|
||||
- 1.14: added support for X resources (thanks to Gerhard Niklasch)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
- 2.01: fixed improper display of usage screen on PNG error(s)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -49,11 +59,30 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng-x"
|
||||
#define LONGNAME "Simple PNG Viewer for X"
|
||||
#define VERSION "1.13 of 16 August 2001"
|
||||
#define VERSION "2.01 of 16 March 2008"
|
||||
#define RESNAME "rpng" /* our X resource application name */
|
||||
#define RESCLASS "Rpng" /* our X resource class name */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -91,6 +120,8 @@ static int rpng_x_msb(ulg u32val);
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME;
|
||||
static char *res_name = RESNAME;
|
||||
static char *res_class = RESCLASS;
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@ -235,9 +266,33 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!filename) {
|
||||
if (!filename)
|
||||
++error;
|
||||
} else if (!(infile = fopen(filename, "rb"))) {
|
||||
|
||||
|
||||
/* print usage screen if any errors up to this point */
|
||||
|
||||
if (error) {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
readpng_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg] file.png\n"
|
||||
" xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images\n"
|
||||
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
|
||||
"is displayed) to quit.\n"
|
||||
"\n", PROGNAME, default_display_exponent);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (!(infile = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
||||
++error;
|
||||
} else {
|
||||
@ -250,8 +305,7 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 2:
|
||||
fprintf(stderr, PROGNAME
|
||||
": [%s] has bad IHDR (libpng longjmp)\n",
|
||||
filename);
|
||||
": [%s] has bad IHDR (libpng longjmp)\n", filename);
|
||||
break;
|
||||
case 4:
|
||||
fprintf(stderr, PROGNAME ": insufficient memory\n");
|
||||
@ -276,25 +330,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
/* usage screen */
|
||||
|
||||
if (error) {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
readpng_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg] file.png\n"
|
||||
" xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images\n"
|
||||
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
|
||||
"is displayed) to quit.\n"
|
||||
"\n", PROGNAME, default_display_exponent);
|
||||
exit(1);
|
||||
fprintf(stderr, PROGNAME ": aborting.\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
|
||||
@ -399,11 +437,12 @@ static int rpng_x_create_window(void)
|
||||
XEvent e;
|
||||
XGCValues gcvalues;
|
||||
XSetWindowAttributes attr;
|
||||
XSizeHints *size_hints;
|
||||
XTextProperty windowName, *pWindowName = &windowName;
|
||||
XTextProperty iconName, *pIconName = &iconName;
|
||||
XVisualInfo visual_info;
|
||||
XSizeHints *size_hints;
|
||||
XWMHints *wm_hints;
|
||||
XClassHint *class_hints;
|
||||
|
||||
|
||||
screen = DefaultScreen(display);
|
||||
@ -526,7 +565,7 @@ static int rpng_x_create_window(void)
|
||||
if (!XStringListToTextProperty(&icon_name, 1, pIconName))
|
||||
pIconName = NULL;
|
||||
|
||||
/* OK if either hints allocation fails; XSetWMProperties() allows NULLs */
|
||||
/* OK if any hints allocation fails; XSetWMProperties() allows NULLs */
|
||||
|
||||
if ((size_hints = XAllocSizeHints()) != NULL) {
|
||||
/* window will not be resizable */
|
||||
@ -542,8 +581,13 @@ static int rpng_x_create_window(void)
|
||||
wm_hints->flags = StateHint | InputHint /* | IconPixmapHint */ ;
|
||||
}
|
||||
|
||||
if ((class_hints = XAllocClassHint()) != NULL) {
|
||||
class_hints->res_name = res_name;
|
||||
class_hints->res_class = res_class;
|
||||
}
|
||||
|
||||
XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0,
|
||||
size_hints, wm_hints, NULL);
|
||||
size_hints, wm_hints, class_hints);
|
||||
|
||||
/* various properties and hints no longer needed; free memory */
|
||||
if (pWindowName)
|
||||
@ -554,6 +598,8 @@ static int rpng_x_create_window(void)
|
||||
XFree(size_hints);
|
||||
if (wm_hints)
|
||||
XFree(wm_hints);
|
||||
if (class_hints)
|
||||
XFree(class_hints);
|
||||
|
||||
XMapWindow(display, window);
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
tweaking (or maybe not). Thanks to Adam Costello and Pieter S. van der
|
||||
Meulen for the "diamond" and "radial waves" patterns, respectively.
|
||||
|
||||
to do:
|
||||
to do (someday, maybe):
|
||||
- handle quoted command-line args (especially filenames with spaces)
|
||||
- finish resizable checkerboard-gradient (sizes 4-128?)
|
||||
- use %.1023s to simplify truncation of title-bar string?
|
||||
@ -27,16 +27,28 @@
|
||||
- 1.10: enabled "message window"/console (thanks to David Geldreich)
|
||||
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
|
||||
- 1.21: made minor tweak to usage screen to fit within 25-line console
|
||||
- 1.22: added AMD64/EM64T support (__x86_64__)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
- 2.01: fixed 64-bit typo in readpng2.c
|
||||
- 2.02: fixed improper display of usage screen on PNG error(s); fixed
|
||||
unexpected-EOF and file-read-error cases
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -53,11 +65,28 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "rpng2-win"
|
||||
#define LONGNAME "Progressive PNG Viewer for Windows"
|
||||
#define VERSION "1.21 of 29 June 2001"
|
||||
#define VERSION "2.02 of 16 March 2008"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -119,10 +148,9 @@ static void rpng2_win_cleanup(void);
|
||||
LRESULT CALLBACK rpng2_win_wndproc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
||||
static char titlebar[1024], *window_name = titlebar;
|
||||
static char titlebar[1024];
|
||||
static char *progname = PROGNAME;
|
||||
static char *appname = LONGNAME;
|
||||
static char *icon_name = PROGNAME; /* GRR: not (yet) used */
|
||||
static char *filename;
|
||||
static FILE *infile;
|
||||
|
||||
@ -367,7 +395,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
} else if (!strncmp(*argv, "-timing", 2)) {
|
||||
timing = TRUE;
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
} else if (!strncmp(*argv, "-nommxfilters", 7)) {
|
||||
rpng2_info.nommxfilters = TRUE;
|
||||
} else if (!strncmp(*argv, "-nommxcombine", 7)) {
|
||||
@ -389,9 +417,54 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
}
|
||||
|
||||
if (!filename) {
|
||||
if (!filename)
|
||||
++error;
|
||||
} else if (!(infile = fopen(filename, "rb"))) {
|
||||
|
||||
|
||||
/* print usage screen if any errors up to this point */
|
||||
|
||||
if (error) {
|
||||
int ch;
|
||||
|
||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
||||
readpng2_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing]\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
" %*s [[-nommxfilters] [-nommxcombine] [-nommxinterlace] | -nommx]\n"
|
||||
#endif
|
||||
" %*s file.png\n\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images; overrides -bgpat option\n"
|
||||
" pat \tdesired background pattern number (1-%d); used with\n"
|
||||
"\t\t transparent images; overrides -bgcolor option\n"
|
||||
" -timing\tenables delay for every block read, to simulate modem\n"
|
||||
"\t\t download of image (~36 Kbps)\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
" -nommx*\tdisable optimized MMX routines for decoding row filters,\n"
|
||||
"\t\t combining rows, and expanding interlacing, respectively\n"
|
||||
#endif
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
"Press Q or Esc to quit this usage screen. ",
|
||||
PROGNAME,
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
(int)strlen(PROGNAME), " ",
|
||||
#endif
|
||||
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
||||
fflush(stderr);
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (!(infile = fopen(filename, "rb"))) {
|
||||
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
||||
++error;
|
||||
} else {
|
||||
@ -405,8 +478,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
switch (rc) {
|
||||
case 2:
|
||||
fprintf(stderr, PROGNAME
|
||||
": [%s] has bad IHDR (libpng longjmp)\n",
|
||||
filename);
|
||||
": [%s] has bad IHDR (libpng longjmp)\n", filename);
|
||||
break;
|
||||
case 4:
|
||||
fprintf(stderr, PROGNAME ": insufficient memory\n");
|
||||
@ -423,46 +495,14 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
}
|
||||
|
||||
|
||||
/* usage screen */
|
||||
|
||||
if (error) {
|
||||
int ch;
|
||||
|
||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
||||
readpng2_version_info();
|
||||
fprintf(stderr, "\n"
|
||||
"Usage: %s [-gamma exp] [-bgcolor bg | -bgpat pat] [-timing]\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
" %*s [[-nommxfilters] [-nommxcombine] [-nommxinterlace] | -nommx]\n"
|
||||
#endif
|
||||
" %*s file.png\n\n"
|
||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images; overrides -bgpat option\n"
|
||||
" pat \tdesired background pattern number (1-%d); used with\n"
|
||||
"\t\t transparent images; overrides -bgcolor option\n"
|
||||
" -timing\tenables delay for every block read, to simulate modem\n"
|
||||
"\t\t download of image (~36 Kbps)\n"
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
" -nommx*\tdisable optimized MMX routines for decoding row filters,\n"
|
||||
"\t\t combining rows, and expanding interlacing, respectively\n"
|
||||
#endif
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
"Press Q or Esc to quit this usage screen. ",
|
||||
PROGNAME,
|
||||
#if (defined(__i386__) || defined(_M_IX86))
|
||||
strlen(PROGNAME), " ",
|
||||
#endif
|
||||
strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
||||
fflush(stderr);
|
||||
fprintf(stderr, PROGNAME ": aborting.\n");
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
exit(1);
|
||||
exit(2);
|
||||
} else {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
fprintf(stderr,
|
||||
@ -494,7 +534,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
} else
|
||||
rpng2_info.need_bgcolor = TRUE;
|
||||
|
||||
rpng2_info.done = FALSE;
|
||||
rpng2_info.state = kPreInit;
|
||||
rpng2_info.mainprog_init = rpng2_win_init;
|
||||
rpng2_info.mainprog_display_row = rpng2_win_display_row;
|
||||
rpng2_info.mainprog_finish_display = rpng2_win_finish_display;
|
||||
@ -514,10 +554,27 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
if (readpng2_decode_data(&rpng2_info, inbuf, incount))
|
||||
++error;
|
||||
Trace((stderr, "done with readpng2_decode_data()\n"))
|
||||
if (error || feof(infile) || rpng2_info.done)
|
||||
|
||||
if (error || incount != INBUFSIZE || rpng2_info.state == kDone) {
|
||||
if (rpng2_info.state == kDone) {
|
||||
Trace((stderr, "done decoding PNG image\n"))
|
||||
} else if (ferror(infile)) {
|
||||
fprintf(stderr, PROGNAME
|
||||
": error while reading PNG image file\n");
|
||||
exit(3);
|
||||
} else if (feof(infile)) {
|
||||
fprintf(stderr, PROGNAME ": end of file reached "
|
||||
"(unexpectedly) while reading PNG image file\n");
|
||||
exit(3);
|
||||
} else /* if (error) */ {
|
||||
// will print error message below
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (timing)
|
||||
Sleep(1000L);
|
||||
|
||||
incount = fread(inbuf, 1, INBUFSIZE, infile);
|
||||
}
|
||||
|
||||
@ -564,7 +621,7 @@ static void rpng2_win_init()
|
||||
ulg rowbytes = rpng2_info.rowbytes;
|
||||
|
||||
Trace((stderr, "beginning rpng2_win_init()\n"))
|
||||
Trace((stderr, " rowbytes = %ld\n", rpng2_info.rowbytes))
|
||||
Trace((stderr, " rowbytes = %d\n", rpng2_info.rowbytes))
|
||||
Trace((stderr, " width = %ld\n", rpng2_info.width))
|
||||
Trace((stderr, " height = %ld\n", rpng2_info.height))
|
||||
|
||||
@ -594,6 +651,8 @@ static void rpng2_win_init()
|
||||
readpng2_cleanup(&rpng2_info);
|
||||
return;
|
||||
}
|
||||
|
||||
rpng2_info.state = kWindowInit;
|
||||
}
|
||||
|
||||
|
||||
@ -1089,7 +1148,7 @@ static void rpng2_win_finish_display()
|
||||
* we have nothing to do here except set a flag and let the user know
|
||||
* that the image is done */
|
||||
|
||||
rpng2_info.done = TRUE;
|
||||
rpng2_info.state = kDone;
|
||||
printf(
|
||||
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n");
|
||||
fflush(stdout);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,8 +5,10 @@
|
||||
This program converts certain NetPBM binary files (grayscale and RGB,
|
||||
maxval = 255) to PNG. Non-interlaced PNGs are written progressively;
|
||||
interlaced PNGs are read and written in one memory-intensive blast.
|
||||
|
||||
Thanks to Jean-loup Gailly for providing the necessary trick to read
|
||||
interactive text from the keyboard while stdin is redirected.
|
||||
interactive text from the keyboard while stdin is redirected. Thanks
|
||||
to Cosmin Truta for Cygwin fixes.
|
||||
|
||||
NOTE: includes provisional support for PNM type "8" (portable alphamap)
|
||||
images, presumed to be a 32-bit interleaved RGBA format; no pro-
|
||||
@ -24,16 +26,32 @@
|
||||
- 1.02: modified to allow abbreviated options
|
||||
- 1.03: removed extraneous character from usage screen; fixed bug in
|
||||
command-line parsing
|
||||
- 1.04: fixed DOS/OS2/Win32 detection, including partial Cygwin fix
|
||||
(see http://home.att.net/~perlspinr/diffs/GregBook_cygwin.diff)
|
||||
- 2.00: dual-licensed (added GNU GPL)
|
||||
|
||||
[REPORTED BUG (win32 only): "contrib/gregbook/wpng.c - cmd line
|
||||
dose not work! In order to do something useful I needed to redirect
|
||||
both input and output, with cygwin and with bcc32 as well. Under
|
||||
Linux, the same wpng appears to work fine. I don't know what is
|
||||
the problem."]
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -50,17 +68,36 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#define PROGNAME "wpng"
|
||||
#define VERSION "1.03 of 19 March 2000"
|
||||
#define VERSION "2.00 of 2 June 2007"
|
||||
#define APPNAME "Simple PGM/PPM/PAM to PNG Converter"
|
||||
|
||||
#if defined(__MSDOS__) || defined(__OS2__)
|
||||
# define DOS_OS2_W32
|
||||
#elif defined(_WIN32) || defined(__WIN32__)
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
|
||||
# ifndef __GNUC__ /* treat Win32 native ports of gcc as Unix environments */
|
||||
# define DOS_OS2_W32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
@ -4,13 +4,20 @@
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
|
||||
Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
|
||||
|
||||
This software is provided "as is," without warranty of any kind,
|
||||
express or implied. In no event shall the author or contributors
|
||||
be held liable for any damages arising in any way from the use of
|
||||
this software.
|
||||
|
||||
The contents of this file are DUAL-LICENSED. You may modify and/or
|
||||
redistribute this software according to the terms of one of the
|
||||
following two licenses (at your option):
|
||||
|
||||
|
||||
LICENSE 1 ("BSD-like with advertising clause"):
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
@ -27,6 +34,23 @@
|
||||
and contributors for the book, "PNG: The Definitive Guide,"
|
||||
published by O'Reilly and Associates.
|
||||
|
||||
|
||||
LICENSE 2 (GNU GPL v2 or later):
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TRUE
|
||||
|
6
contrib/pngminim/decoder/README
Normal file
6
contrib/pngminim/decoder/README
Normal file
@ -0,0 +1,6 @@
|
||||
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
|
||||
|
||||
To build a minimal read-only decoder, run
|
||||
gather.sh # to collect needed files from pngminus, libpng, and zlib
|
||||
make -f makefile.std
|
||||
|
8
contrib/pngminim/decoder/gather.sh
Executable file
8
contrib/pngminim/decoder/gather.sh
Executable file
@ -0,0 +1,8 @@
|
||||
cp ../../pngminus/png2pnm.c pngm2pnm.c
|
||||
cp ../../../*.h .
|
||||
cp ../../../*.c .
|
||||
rm example.c pnggccrd.c pngvcrd.c pngtest.c pngpread.c
|
||||
# change the following 2 lines if zlib is somewhere else
|
||||
cp ../../../../zlib/*.h .
|
||||
cp ../../../../zlib/*.c .
|
||||
rm minigzip.c example.c compress.c deflate.c
|
44
contrib/pngminim/decoder/makefile.std
Normal file
44
contrib/pngminim/decoder/makefile.std
Normal file
@ -0,0 +1,44 @@
|
||||
# Makefile for PngMinus (pngm2pnm)
|
||||
# Linux / Unix
|
||||
|
||||
#CC=cc
|
||||
CC=gcc
|
||||
LD=$(CC)
|
||||
|
||||
RM=rm -f
|
||||
|
||||
CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \
|
||||
-DdeflateParams\(a,b,c\)=Z_OK -I. -O1
|
||||
|
||||
C=.c
|
||||
O=.o
|
||||
L=.a
|
||||
E=
|
||||
|
||||
ZOBJS = adler32$(O) crc32$(O) gzio$(O) \
|
||||
infback$(O) inffast$(O) inflate$(O) inftrees$(O) \
|
||||
trees$(O) uncompr$(O) zutil$(O)
|
||||
|
||||
OBJS = pngm2pnm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
|
||||
pngset$(O) pngtrans$(O) $(ZOBJS)
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O): png.h pngconf.h pngusr.h zlib.h
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
# dependencies
|
||||
|
||||
all: pngm2pnm$(E)
|
||||
|
||||
pngm2pnm$(E): $(OBJS)
|
||||
$(LD) -o pngm2pnm$(E) $(OBJS)
|
||||
strip pngm2pnm$(E)
|
||||
|
||||
clean:
|
||||
$(RM) pngm2pnm$(O)
|
||||
$(RM) pngm2pnm$(E)
|
||||
$(RM) $(OBJS)
|
||||
|
||||
# End of makefile for pngm2pnm
|
67
contrib/pngminim/decoder/pngusr.h
Normal file
67
contrib/pngminim/decoder/pngusr.h
Normal file
@ -0,0 +1,67 @@
|
||||
/* minrdpngconf.h: headers to make a minimal png-read-only library
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 2007 Glenn Randers-Pehrson
|
||||
* Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson
|
||||
*/
|
||||
|
||||
#ifndef MINRDPNGCONF_H
|
||||
#define MINRDPNGCONF_H
|
||||
|
||||
#define PNG_NO_GLOBAL_ARRAYS
|
||||
|
||||
#define PNG_NO_WARNINGS
|
||||
#define png_warning(s1,s2) ""
|
||||
#define png_chunk_warning(s1,s2) ""
|
||||
#define PNG_NO_ERROR_TEXT
|
||||
#define png_error(s1,s2) png_err(s1)
|
||||
#define png_chunk_error(s1,s2) png_err(s1)
|
||||
|
||||
#define PNG_NO_ASSEMBLER_CODE
|
||||
#define PNG_NO_OPTIMIZED_CODE
|
||||
#define PNG_NO_READ_GAMMA
|
||||
#define PNG_NO_READ_BACKGROUND
|
||||
#define PNG_NO_READ_DITHER
|
||||
#define PNG_NO_READ_INVERT
|
||||
#define PNG_NO_READ_SHIFT
|
||||
#define PNG_NO_READ_PACK
|
||||
#define PNG_NO_READ_PACKSWAP
|
||||
#define PNG_NO_READ_FILLER
|
||||
#define PNG_NO_READ_SWAP_ALPHA
|
||||
#define PNG_NO_READ_INVERT_ALPHA
|
||||
#define PNG_NO_READ_RGB_TO_GRAY
|
||||
#define PNG_NO_READ_USER_TRANSFORM
|
||||
#define PNG_NO_READ_bKGD
|
||||
#define PNG_NO_READ_cHRM
|
||||
#define PNG_NO_READ_gAMA
|
||||
#define PNG_NO_READ_hIST
|
||||
#define PNG_NO_READ_iCCP
|
||||
#define PNG_NO_READ_pCAL
|
||||
#define PNG_NO_READ_pHYs
|
||||
#define PNG_NO_READ_sBIT
|
||||
#define PNG_NO_READ_sCAL
|
||||
#define PNG_NO_READ_sPLT
|
||||
#define PNG_NO_READ_TEXT
|
||||
#define PNG_NO_READ_tIME
|
||||
#define PNG_NO_READ_UNKNOWN_CHUNKS
|
||||
#define PNG_NO_READ_USER_CHUNKS
|
||||
#define PNG_NO_READ_EMPTY_PLTE
|
||||
#define PNG_NO_READ_OPT_PLTE
|
||||
#define PNG_NO_READ_STRIP_ALPHA
|
||||
#define PNG_NO_READ_oFFs
|
||||
#define PNG_NO_WARN_UNINITIALIZED_ROW
|
||||
|
||||
#define PNG_NO_WRITE_SUPPORTED
|
||||
|
||||
#define PNG_NO_INFO_IMAGE
|
||||
#define PNG_NO_USER_MEM
|
||||
#define PNG_NO_FIXED_POINT_SUPPORTED
|
||||
#define PNG_NO_MNG_FEATURES
|
||||
#define PNG_NO_USER_TRANSFORM_PTR
|
||||
#define PNG_NO_HANDLE_AS_UNKNOWN
|
||||
#define PNG_NO_CONSOLE_IO
|
||||
#define PNG_NO_ZALLOC_ZERO
|
||||
#define PNG_NO_ERROR_NUMBERS
|
||||
#define PNG_NO_EASY_ACCESS
|
||||
#define PNG_NO_PROGRESSIVE_READ
|
||||
|
||||
#endif /* MINRDPNGCONF_H */
|
6
contrib/pngminim/encoder/README
Normal file
6
contrib/pngminim/encoder/README
Normal file
@ -0,0 +1,6 @@
|
||||
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
|
||||
|
||||
To build a minimal write-only encoder, run
|
||||
gather.sh # to collect needed files from pngminus, libpng, and zlib
|
||||
make -f makefile.std
|
||||
|
27
contrib/pngminim/encoder/dummy_inflate.c
Normal file
27
contrib/pngminim/encoder/dummy_inflate.c
Normal file
@ -0,0 +1,27 @@
|
||||
#include "zlib.h"
|
||||
|
||||
int ZEXPORT inflate(strm, flush)
|
||||
z_streamp strm;
|
||||
int flush;
|
||||
{ return Z_OK ; }
|
||||
|
||||
int ZEXPORT inflateReset(strm)
|
||||
z_streamp strm;
|
||||
{ return Z_OK ; }
|
||||
|
||||
int ZEXPORT inflateEnd(strm)
|
||||
z_streamp strm;
|
||||
{ return Z_STREAM_ERROR ; }
|
||||
|
||||
int ZEXPORT inflateInit_(strm, version, stream_size)
|
||||
z_streamp strm;
|
||||
const char *version;
|
||||
int stream_size;
|
||||
{ return Z_OK ; }
|
||||
|
||||
int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
|
||||
z_streamp strm;
|
||||
int windowBits;
|
||||
const char *version;
|
||||
int stream_size;
|
||||
{ return Z_STREAM_ERROR ; }
|
9
contrib/pngminim/encoder/gather.sh
Executable file
9
contrib/pngminim/encoder/gather.sh
Executable file
@ -0,0 +1,9 @@
|
||||
cp ../../pngminus/pnm2png.c pnm2pngm.c
|
||||
cp ../../../*.h .
|
||||
cp ../../../*.c .
|
||||
rm example.c pnggccrd.c pngvcrd.c pngtest.c pngr*.c
|
||||
# Change the next 2 lines if zlib is somewhere else.
|
||||
cp ../../../../zlib/*.h .
|
||||
cp ../../../../zlib/*.c .
|
||||
rm inf*.[ch]
|
||||
rm minigzip.c example.c
|
43
contrib/pngminim/encoder/makefile.std
Normal file
43
contrib/pngminim/encoder/makefile.std
Normal file
@ -0,0 +1,43 @@
|
||||
# Makefile for PngMinus (pnm2pngm)
|
||||
# Linux / Unix
|
||||
|
||||
#CC=cc
|
||||
CC=gcc
|
||||
LD=$(CC)
|
||||
|
||||
RM=rm -f
|
||||
|
||||
CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1
|
||||
|
||||
C=.c
|
||||
O=.o
|
||||
L=.a
|
||||
E=
|
||||
|
||||
ZOBJS = adler32$(O) compress$(O) crc32$(O) deflate$(O) gzio$(O) \
|
||||
dummy_inflate$(O) \
|
||||
trees$(O) uncompr$(O) zutil$(O)
|
||||
|
||||
OBJS = pnm2pngm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||
pngset$(O) pngtrans$(O) pngwio$(O) pngwrite$(O) \
|
||||
pngwtran$(O) pngwutil$(O) $(ZOBJS)
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O): png.h pngconf.h pngusr.h zlib.h
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
# dependencies
|
||||
|
||||
all: pnm2pngm$(E)
|
||||
|
||||
pnm2pngm$(E): $(OBJS)
|
||||
$(LD) -o pnm2pngm$(E) $(OBJS)
|
||||
strip pnm2pngm$(E)
|
||||
|
||||
clean:
|
||||
$(RM) pnm2pngm$(O)
|
||||
$(RM) pnm2pngm$(E)
|
||||
$(RM) $(OBJS)
|
||||
|
||||
# End of makefile for pnm2pngm
|
66
contrib/pngminim/encoder/pngusr.h
Normal file
66
contrib/pngminim/encoder/pngusr.h
Normal file
@ -0,0 +1,66 @@
|
||||
/* minwrpngconf.h: headers to make a minimal png-write-only library
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 2007 Glenn Randers-Pehrson
|
||||
* Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson
|
||||
*/
|
||||
|
||||
#ifndef MINWRPNGCONF_H
|
||||
#define MINWRPNGCONF_H
|
||||
|
||||
#define PNG_NO_GLOBAL_ARRAYS
|
||||
|
||||
#define PNG_NO_READ_SUPPORTED
|
||||
|
||||
#define PNG_NO_WARNINGS
|
||||
#define png_warning(s1,s2) ""
|
||||
#define png_chunk_warning(s1,s2) ""
|
||||
#define PNG_NO_ERROR_TEXT
|
||||
#define png_error(s1,s2) png_err(s1)
|
||||
#define png_chunk_error(s1,s2) png_err(s1)
|
||||
|
||||
#define PNG_NO_WRITE_BACKGROUND
|
||||
#define PNG_NO_WRITE_GAMMA
|
||||
#define PNG_NO_WRITE_DITHER
|
||||
#define PNG_NO_WRITE_INVERT
|
||||
#define PNG_NO_WRITE_SHIFT
|
||||
#define PNG_NO_WRITE_PACK
|
||||
#define PNG_NO_WRITE_PACKSWAP
|
||||
#define PNG_NO_WRITE_FILLER
|
||||
#define PNG_NO_WRITE_SWAP_ALPHA
|
||||
#define PNG_NO_WRITE_INVERT_ALPHA
|
||||
#define PNG_NO_WRITE_RGB_TO_GRAY
|
||||
#define PNG_NO_WRITE_USER_TRANSFORM
|
||||
#define PNG_NO_WRITE_bKGD
|
||||
#define PNG_NO_WRITE_cHRM
|
||||
#define PNG_NO_WRITE_gAMA
|
||||
#define PNG_NO_WRITE_sRGB
|
||||
#define PNG_NO_WRITE_hIST
|
||||
#define PNG_NO_WRITE_iCCP
|
||||
#define PNG_NO_WRITE_oFFs
|
||||
#define PNG_NO_WRITE_pCAL
|
||||
#define PNG_NO_WRITE_pHYs
|
||||
#define PNG_NO_WRITE_sBIT
|
||||
#define PNG_NO_WRITE_sCAL
|
||||
#define PNG_NO_WRITE_sPLT
|
||||
#define PNG_NO_WRITE_TEXT
|
||||
#define PNG_NO_WRITE_tIME
|
||||
#define PNG_NO_WRITE_UNKNOWN_CHUNKS
|
||||
#define PNG_NO_WRITE_USER_CHUNKS
|
||||
#define PNG_NO_WRITE_EMPTY_PLTE
|
||||
#define PNG_NO_WRITE_OPT_PLTE
|
||||
#define PNG_NO_WRITE_FILTER
|
||||
#define PNG_NO_WRITE_WEIGHTED_FILTER
|
||||
#define PNG_NO_WRITE_INTERLACING_SUPPORTED
|
||||
|
||||
#define PNG_NO_INFO_IMAGE
|
||||
#define PNG_NO_USER_MEM
|
||||
#define PNG_NO_FIXED_POINT_SUPPORTED
|
||||
#define PNG_NO_MNG_FEATURES
|
||||
#define PNG_NO_USER_TRANSFORM_PTR
|
||||
#define PNG_NO_HANDLE_AS_UNKNOWN
|
||||
#define PNG_NO_CONSOLE_IO
|
||||
#define PNG_NO_ZALLOC_ZERO
|
||||
#define PNG_NO_ERROR_NUMBERS
|
||||
#define PNG_NO_EASY_ACCESS
|
||||
|
||||
#endif /* MINWRPNGCONF_H */
|
@ -8,9 +8,9 @@ LD=$(CC)
|
||||
RM=rm -f
|
||||
|
||||
#PNGPATH = /usr/local
|
||||
#PNGINC = -I$(PNGPATH)/include/libpng14
|
||||
#PNGLIB = -L$(PNGPATH)/lib -lpng14
|
||||
#PNGLIBS = $(PNGPATH)/lib/libpng14.a
|
||||
#PNGINC = -I$(PNGPATH)/include/libpng12
|
||||
#PNGLIB = -L$(PNGPATH)/lib -lpng12
|
||||
#PNGLIBS = $(PNGPATH)/lib/libpng12.a
|
||||
PNGINC = -I../..
|
||||
PNGLIB = -L../.. -lpng
|
||||
PNGLIBS = ../../libpng.a
|
||||
|
390
depcomp
390
depcomp
@ -1,7 +1,10 @@
|
||||
#! /bin/sh
|
||||
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
# Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
scriptversion=2007-03-29.01
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -15,8 +18,8 @@
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
@ -25,13 +28,45 @@
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
# `libtool' can also be set to `yes' or `no'.
|
||||
|
||||
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
@ -57,7 +92,20 @@ gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
@ -163,31 +211,43 @@ sgi)
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. This file always lives in the current directory.
|
||||
# Also, the AIX compiler puts `$object:' at the start of each line;
|
||||
# $object doesn't have directory information.
|
||||
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
outname="$stripped.o"
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
@ -197,21 +257,63 @@ aix)
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 AIX compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
tmpdepfile1="$object.d"
|
||||
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-MD
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
"$@" -MD
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
@ -219,14 +321,71 @@ tru64)
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile1"; then
|
||||
tmpdepfile="$tmpdepfile1"
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add `dependent.h:' lines.
|
||||
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
tmpdepfile="$tmpdepfile2"
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mechanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a space and a tab in the [].
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
@ -240,34 +399,42 @@ tru64)
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*) # this is libtool, let us make it quiet
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case "$arg" in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
@ -285,19 +452,29 @@ dashXmstdout)
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
(
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in no)
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
-*)
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
@ -305,16 +482,10 @@ makedepend)
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tail +3 "$tmpdepfile" | tr ' ' '
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
@ -324,35 +495,40 @@ makedepend)
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*)
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
do
|
||||
case $arg in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
@ -362,34 +538,27 @@ cpp)
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*)
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case $arg in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
@ -409,3 +578,12 @@ none)
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
|
@ -2,7 +2,7 @@
|
||||
#if 0 /* in case someone actually tries to compile this */
|
||||
|
||||
/* example.c - an example of using libpng
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* This file has been placed in the public domain by the authors.
|
||||
* Maintained 1998-2008 Glenn Randers-Pehrson
|
||||
* Maintained 1996, 1997 Andreas Dilger)
|
||||
|
624
install-sh
624
install-sh
@ -1,251 +1,519 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
|
||||
scriptversion=2006-12-25.00
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
doit=${DOITPROG-}
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
posix_glob='?'
|
||||
initialize_posix_glob='
|
||||
test "$posix_glob" != "?" || {
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=
|
||||
else
|
||||
posix_glob=:
|
||||
fi
|
||||
}
|
||||
'
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
stripcmd=
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
-c) ;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
shift;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
if test -z "$dir_arg"; then
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
dst=$dst_arg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst;;
|
||||
esac
|
||||
|
||||
if [ -d $dst ]
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
true
|
||||
fi
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
-*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
IFS=$oIFS
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
true
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
|
||||
eval "$initialize_posix_glob" &&
|
||||
$posix_glob set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
|
@ -1,6 +1,6 @@
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.4.0beta24 - July 25, 2008
|
||||
libpng version 1.4.0beta25 - July 30, 2008
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2005 Glenn Randers-Pehrson
|
||||
@ -799,6 +799,8 @@ things.
|
||||
|
||||
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
|
||||
added. It expands the sample depth without changing tRNS to alpha.
|
||||
%12%At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it
|
||||
%12%will be removed from a future version.
|
||||
|
||||
PNG can have files with 16 bits per channel. If you only can handle
|
||||
8 bits per channel, this will strip the pixels down to 8 bit.
|
||||
@ -2917,13 +2919,13 @@ application:
|
||||
|
||||
IX. Y2K Compliance in libpng
|
||||
|
||||
July 25, 2008
|
||||
July 30, 2008
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.4.0beta24 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.4.0beta25 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
24
libpng.3
24
libpng.3
@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "July 25, 2008"
|
||||
.TH LIBPNG 3 "July 30, 2008"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta24
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta25
|
||||
.SH SYNOPSIS
|
||||
\fI\fB
|
||||
|
||||
@ -274,7 +274,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta24
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fB#if \fI!defined(PNG_1_0_X)
|
||||
\fB/* This function is really an inline macro. \fI*/
|
||||
|
||||
\fBpng_uint_16 png_get_uint_16 (png_bytep \fIbuf\fP\fB);\fP
|
||||
|
||||
@ -284,9 +284,9 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta24
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_uint_32 (png_bytep \fIbuf\fP\fB);\fP
|
||||
\fB/* This function is really an inline macro. \fI*/
|
||||
|
||||
\fI\fB#endif
|
||||
\fBpng_uint_32 png_get_uint_32 (png_bytep \fIbuf\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@ -797,7 +797,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
||||
.SH LIBPNG.TXT
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.4.0beta24 - July 25, 2008
|
||||
libpng version 1.4.0beta25 - July 30, 2008
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2005 Glenn Randers-Pehrson
|
||||
@ -1596,6 +1596,8 @@ things.
|
||||
|
||||
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
|
||||
added. It expands the sample depth without changing tRNS to alpha.
|
||||
%12%At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it
|
||||
%12%will be removed from a future version.
|
||||
|
||||
PNG can have files with 16 bits per channel. If you only can handle
|
||||
8 bits per channel, this will strip the pixels down to 8 bit.
|
||||
@ -3714,13 +3716,13 @@ application:
|
||||
|
||||
.SH IX. Y2K Compliance in libpng
|
||||
|
||||
July 25, 2008
|
||||
July 30, 2008
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.4.0beta24 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.4.0beta25 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||
@ -3943,7 +3945,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.4.0beta24 - July 25, 2008:
|
||||
Libpng version 1.4.0beta25 - July 30, 2008:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
||||
|
||||
@ -3964,7 +3966,7 @@ included in the libpng distribution, the latter shall prevail.)
|
||||
If you modify libpng you may insert additional notices immediately following
|
||||
this sentence.
|
||||
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.0beta24, July 25, 2008, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.0beta25, July 30, 2008, are
|
||||
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
|
||||
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
with the following individual added to the list of Contributing Authors
|
||||
@ -4063,7 +4065,7 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
July 25, 2008
|
||||
July 30, 2008
|
||||
|
||||
.\" end of man page
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
.TH LIBPNGPF 3 "July 25, 2008"
|
||||
.TH LIBPNGPF 3 "July 30, 2008"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta24
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta25
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include <png.h>\fP
|
||||
|
200
missing
200
missing
@ -1,6 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
scriptversion=2006-05-10.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@ -15,8 +19,8 @@
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
@ -29,6 +33,8 @@ if test $# -eq 0; then
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
@ -38,18 +44,24 @@ else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
@ -67,6 +79,7 @@ Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
@ -74,11 +87,15 @@ Supported PROGRAM values:
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing 0.3 - GNU automake"
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
@ -87,9 +104,44 @@ Supported PROGRAM values:
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal)
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case $1 in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $1 in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
@ -98,7 +150,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
@ -107,7 +159,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
@ -115,7 +167,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
@ -124,9 +176,9 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake)
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
@ -135,71 +187,92 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
@ -209,54 +282,58 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
||||
# We have makeinfo, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar ${1+"$@"} && exit 0
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar ${1+"$@"} && exit 0
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
case $firstarg in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
case $firstarg in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@ -270,10 +347,10 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
@ -281,3 +358,10 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
|
141
mkinstalldirs
141
mkinstalldirs
@ -1,23 +1,127 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
|
||||
scriptversion=2006-05-11.19
|
||||
|
||||
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
|
||||
# Public domain.
|
||||
#
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
errstatus=0
|
||||
dirmode=
|
||||
|
||||
usage="\
|
||||
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
|
||||
|
||||
Create each directory DIR (with mode MODE, if specified), including all
|
||||
leading file name components.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>."
|
||||
|
||||
# process command line arguments
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
-h | --help | --h*) # -h for help
|
||||
echo "$usage"
|
||||
exit $?
|
||||
;;
|
||||
-m) # -m PERM arg
|
||||
shift
|
||||
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
|
||||
dirmode=$1
|
||||
shift
|
||||
;;
|
||||
--version)
|
||||
echo "$0 $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
--) # stop option processing
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*) # unknown option
|
||||
echo "$usage" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*) # first non-opt arg
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
if test -d "$file"; then
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
|
||||
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
|
||||
# mkdir -p a/c at the same time, both will detect that a is missing,
|
||||
# one will create a, then the other will try to create a and die with
|
||||
# a "File exists" error. This is a problem when calling mkinstalldirs
|
||||
# from a parallel make. We use --version in the probe to restrict
|
||||
# ourselves to GNU mkdir, which is thread-safe.
|
||||
case $dirmode in
|
||||
'')
|
||||
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
echo "mkdir -p -- $*"
|
||||
exec mkdir -p -- "$@"
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
test -d ./-p && rmdir ./-p
|
||||
test -d ./--version && rmdir ./--version
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
|
||||
test ! -d ./--version; then
|
||||
echo "mkdir -m $dirmode -p -- $*"
|
||||
exec mkdir -m "$dirmode" -p -- "$@"
|
||||
else
|
||||
# Clean up after NextStep and OpenStep mkdir.
|
||||
for d in ./-m ./-p ./--version "./$dirmode";
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
for file
|
||||
do
|
||||
case $file in
|
||||
/*) pathcomp=/ ;;
|
||||
*) pathcomp= ;;
|
||||
esac
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set fnord $file
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
test "x$d" = x && continue
|
||||
|
||||
pathcomp=$pathcomp$d
|
||||
case $pathcomp in
|
||||
-*) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
@ -28,13 +132,30 @@ do
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
else
|
||||
if test ! -z "$dirmode"; then
|
||||
echo "chmod $dirmode $pathcomp"
|
||||
lasterr=
|
||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -z "$lasterr"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
|
2
png.5
2
png.5
@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "July 25, 2008"
|
||||
.TH PNG 5 "July 30, 2008"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
|
6
png.c
6
png.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Last changed in libpng 1.2.30 [July 25, 2008]
|
||||
* Last changed in libpng 1.2.30 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -13,7 +13,7 @@
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_4_0beta24 Your_png_h_is_not_version_1_4_0beta24;
|
||||
typedef version_1_4_0beta25 Your_png_h_is_not_version_1_4_0beta25;
|
||||
|
||||
/* Version information for C files. This had better match the version
|
||||
* string defined in png.h. */
|
||||
@ -636,7 +636,7 @@ png_charp PNGAPI
|
||||
png_get_copyright(png_structp png_ptr)
|
||||
{
|
||||
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
|
||||
return ((png_charp) "\n libpng version 1.4.0beta24 - July 25, 2008\n\
|
||||
return ((png_charp) "\n libpng version 1.4.0beta25 - July 30, 2008\n\
|
||||
Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\n\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
||||
|
58
png.h
58
png.h
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.4.0beta24 - July 25, 2008
|
||||
* libpng version 1.4.0beta25 - July 30, 2008
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
@ -9,7 +9,7 @@
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.4.0beta24 - July 25, 2008: Glenn
|
||||
* libpng versions 0.97, January 1998, through 1.4.0beta25 - July 30, 2008: Glenn
|
||||
* See also "Contributing Authors", below.
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
@ -156,7 +156,7 @@
|
||||
* If you modify libpng you may insert additional notices immediately following
|
||||
* this sentence.
|
||||
*
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.4.0beta24, July 25, 2008, are
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.4.0beta25, July 30, 2008, are
|
||||
* Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
|
||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
* with the following individual added to the list of Contributing Authors:
|
||||
@ -274,7 +274,7 @@
|
||||
* an official declaration.
|
||||
*
|
||||
* This is your unofficial assurance that libpng from version 0.71 and
|
||||
* upward through 1.4.0beta24 are Y2K compliant. It is my belief that earlier
|
||||
* upward through 1.4.0beta25 are Y2K compliant. It is my belief that earlier
|
||||
* versions were also Y2K compliant.
|
||||
*
|
||||
* Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||
@ -330,11 +330,11 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.4.0beta24"
|
||||
#define PNG_LIBPNG_VER_STRING "1.4.0beta25"
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.4.0beta24 - July 25, 2008\n"
|
||||
" libpng version 1.4.0beta25 - July 30, 2008\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 1
|
||||
#define PNG_LIBPNG_VER_SONUM 0
|
||||
#define PNG_LIBPNG_VER_DLLNUM 14
|
||||
|
||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
@ -344,7 +344,7 @@
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
||||
|
||||
#define PNG_LIBPNG_VER_BUILD 24
|
||||
#define PNG_LIBPNG_VER_BUILD 25
|
||||
|
||||
/* Release Status */
|
||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||
@ -1347,7 +1347,7 @@ struct png_struct_def
|
||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef png_structp version_1_4_0beta24;
|
||||
typedef png_structp version_1_4_0beta25;
|
||||
|
||||
typedef png_struct FAR * FAR * png_structpp;
|
||||
|
||||
@ -1374,6 +1374,11 @@ extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr,
|
||||
extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start,
|
||||
png_size_t num_to_check));
|
||||
|
||||
/* Simple signature checking function. This is the same as calling
|
||||
* png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
|
||||
*/
|
||||
#define png_check_sig(sig,n) !png_sig_cmp((sig), 0, (n))
|
||||
|
||||
/* Allocate and initialize png_ptr struct for reading, and any other memory. */
|
||||
extern PNG_EXPORT(png_structp,png_create_read_struct)
|
||||
PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
@ -2520,23 +2525,34 @@ extern PNG_EXPORT(png_bytep,png_get_io_chunk_name)
|
||||
|
||||
#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */
|
||||
|
||||
/* Inline macros to do direct reads of bytes from the input buffer. These
|
||||
* require that you are using an architecture that uses PNG byte ordering
|
||||
* (MSB first) and supports unaligned data storage. I think that PowerPC
|
||||
* in big-endian mode and 680x0 are the only ones that will support this.
|
||||
* The x86 line of processors definitely do not. The png_get_int_32()
|
||||
* routine also assumes we are using two's complement format for negative
|
||||
* values, which is almost certainly true.
|
||||
#ifdef PNG_USE_READ_MACROS
|
||||
/* Inline macros to do direct reads of bytes from the input buffer.
|
||||
* The png_get_int_32() routine assumes we are using two's complement
|
||||
* format for negative values, which is almost certainly true.
|
||||
*/
|
||||
#if defined(PNG_READ_BIG_ENDIAN_SUPPORTED)
|
||||
# define png_get_uint_32(buf) ( *((png_uint_32p) (buf)))
|
||||
# define png_get_uint_16(buf) ( *((png_uint_16p) (buf)))
|
||||
# define png_get_int_32(buf) ( *((png_int_32p) (buf)))
|
||||
/* We could make special-case BIG_ENDIAN macros that do direct reads here */
|
||||
# define png_get_uint_32(buf) \
|
||||
(((png_uint_32)(*(buf)) << 24) + \
|
||||
((png_uint_32)(*((buf) + 1)) << 16) + \
|
||||
((png_uint_32)(*((buf) + 2)) << 8) + \
|
||||
((png_uint_32)(*((buf) + 3))))
|
||||
# define png_get_uint_16(buf) \
|
||||
(((png_uint_32)(*(buf)) << 8) + \
|
||||
((png_uint_32)(*((buf) + 1))))
|
||||
#if defined(PNG_GET_INT_32_SUPPORTED)
|
||||
# define png_get_int_32(buf) \
|
||||
(((png_int_32)(*(buf)) << 24) + \
|
||||
((png_int_32)(*((buf) + 1)) << 16) + \
|
||||
((png_int_32)(*((buf) + 2)) << 8) + \
|
||||
((png_int_32)(*((buf) + 3))))
|
||||
#endif
|
||||
#else
|
||||
extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf));
|
||||
extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf));
|
||||
#if defined(PNG_GET_INT_32_SUPPORTED)
|
||||
extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf));
|
||||
#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */
|
||||
#endif
|
||||
#endif
|
||||
extern PNG_EXPORT(png_uint_32,png_get_uint_31)
|
||||
PNGARG((png_structp png_ptr, png_bytep buf));
|
||||
/* No png_get_int_16 -- may be added if there's a real need for it. */
|
||||
|
17
pngconf.h
17
pngconf.h
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.4.0beta20 - May 15, 2007
|
||||
* libpng version 1.4.0beta25 - July 30, 2008
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -17,10 +17,6 @@
|
||||
#ifndef PNGCONF_H
|
||||
#define PNGCONF_H
|
||||
|
||||
/* Added at libpng-1.4.0 */
|
||||
/* pngdefs.h is created by the makefile or the "configure" script. */
|
||||
#include "pngdefs.h"
|
||||
|
||||
#ifndef PNG_NO_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
@ -683,7 +679,7 @@
|
||||
#endif
|
||||
|
||||
/* Added at libpng-1.4.0 */
|
||||
#ifndef PNG_NO_IO_STATE
|
||||
#if !defined(PNG_NO_IO_STATE) && !defined(PNG_IO_STATE_SUPPORTED)
|
||||
# define PNG_IO_STATE_SUPPORTED
|
||||
#endif
|
||||
|
||||
@ -706,16 +702,15 @@
|
||||
#endif
|
||||
*/
|
||||
|
||||
#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
|
||||
# define PNG_USE_READ_MACROS
|
||||
#endif
|
||||
|
||||
/* Buggy compilers (e.g., gcc 2.7.2.2) need this */
|
||||
/*
|
||||
#define PNG_NO_POINTER_INDEXING
|
||||
*/
|
||||
|
||||
/* These functions are turned off by default, as they will be phased out. */
|
||||
/*
|
||||
#define PNG_USELESS_TESTS_SUPPORTED
|
||||
#define PNG_CORRECT_PALETTE_SUPPORTED
|
||||
*/
|
||||
|
||||
/* Any chunks you are not interested in, you can undef here. The
|
||||
* ones that allocate memory may be expecially important (hIST,
|
||||
|
35
pngerror.c
35
pngerror.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -44,10 +44,12 @@ png_error(png_structp png_ptr, png_const_charp error_message)
|
||||
{
|
||||
if (*error_message == '#')
|
||||
{
|
||||
/* Strip "#nnnn " from beginning of error message. */
|
||||
/*
|
||||
* 012345678901234567890
|
||||
* error_message: #nnnn text\0
|
||||
* error_number: nnnn\0
|
||||
* msg: : nnnn \0
|
||||
* offset points to the first blank after nnnn
|
||||
* In this example, offset is 5.
|
||||
*/
|
||||
@ -55,14 +57,27 @@ png_error(png_structp png_ptr, png_const_charp error_message)
|
||||
for (offset = 1; offset<15; offset++)
|
||||
if (error_message[offset] == ' ')
|
||||
break;
|
||||
/* it is 5 because the loop iterations saw
|
||||
* offset==1, error_message[1]=="n"; offset++.
|
||||
* offset==2, error_message[2]=="n"; offset++.
|
||||
* offset==3, error_message[3]=="n"; offset++.
|
||||
* offset==4, error_message[4]=="n"; offset++.
|
||||
* offset==5, error_message[5]==" "; break.
|
||||
*/
|
||||
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
|
||||
{
|
||||
int i;
|
||||
/* Copy the "nnnn" or however many there are, plus the
|
||||
* blank to the beginning of "msg" string.
|
||||
*/
|
||||
for (i = 0; i < offset - 1; i++)
|
||||
msg[i] = error_message[i + 1];
|
||||
msg[i] = '\0';
|
||||
/* In the example, "i" ends up being 5.
|
||||
*/
|
||||
msg[i -1] = '\0';
|
||||
error_message = msg;
|
||||
}
|
||||
/* msg, and error_message, now contain "nnnn \0". */
|
||||
else
|
||||
error_message += offset;
|
||||
}
|
||||
@ -245,6 +260,7 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
if (*error_message == '#')
|
||||
{
|
||||
/* Strip "#nnnn " from beginning of warning message. */
|
||||
/*
|
||||
* 012345678901234567890
|
||||
* error_message: #nnnn text\0
|
||||
@ -261,12 +277,23 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
|
||||
if (error_message[offset] == ' ')
|
||||
break;
|
||||
}
|
||||
/* This is unnecessarily slightly different from above, but
|
||||
* offset is still 5 because the loop iterations saw
|
||||
* offset==0, error_message[0]=="#"; error_number[0]="n";offset++.
|
||||
* offset==1, error_message[1]=="n"; error_number[1]="n";offset++
|
||||
* offset==2, error_message[2]=="n"; error_number[2]="n";offset++
|
||||
* offset==3, error_message[3]=="n"; error_number[3]="n";offset++
|
||||
* offset==4, error_message[4]=="n"; error_number[4]=" ";offset++.
|
||||
* offset==5, error_message[5]==" "; break.
|
||||
*/
|
||||
if ((offset > 1) && (offset < 15))
|
||||
{
|
||||
error_number[offset - 1] = '\0'; /* should this be [offset + 1]? */
|
||||
/* Replace the " " with a string-terminating NULL */
|
||||
error_number[offset - 1] = '\0';
|
||||
/* GRR: this should be [offset + 1] */
|
||||
/* should we update "offset" to point to the beginning of the text? */
|
||||
fprintf(stderr, "libpng error no. %s: %s\n", error_number,
|
||||
error_message + offset);
|
||||
error_message + offset + 1);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "libpng error: %s, offset=%d\n", error_message, offset);
|
||||
|
2
pngget.c
2
pngget.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* Last changed in libpng 1.40. [July 25, 2008]
|
||||
* Last changed in libpng 1.40. [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
2
pngmem.c
2
pngmem.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
123
pngpread.c
123
pngpread.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -212,6 +212,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
|
||||
png_reset_crc(png_ptr);
|
||||
png_crc_read(png_ptr, png_ptr->chunk_name, 4);
|
||||
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
|
||||
png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
|
||||
}
|
||||
|
||||
@ -220,23 +221,17 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
|
||||
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
if (png_ptr->push_length != 13)
|
||||
png_error(png_ptr, "Invalid IHDR length");
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length);
|
||||
|
||||
png_ptr->process_mode = PNG_READ_DONE_MODE;
|
||||
@ -245,11 +240,8 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||
else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
png_ptr->mode |= PNG_HAVE_IDAT;
|
||||
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
|
||||
@ -267,11 +259,8 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
#endif
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
@ -307,99 +296,72 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
#if defined(PNG_READ_gAMA_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_sBIT_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_cHRM_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_sRGB_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_iCCP_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_sPLT_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_tRNS_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_bKGD_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_hIST_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
@ -417,87 +379,63 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
#if defined(PNG_READ_oFFs_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_pCAL_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_sCAL_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_tIME_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4))
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_tEXt_SUPPORTED)
|
||||
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);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_push_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_zTXt_SUPPORTED)
|
||||
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);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_push_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_READ_iTXt_SUPPORTED)
|
||||
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);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
if (!png_push_have_buffer(png_ptr))
|
||||
return;
|
||||
}
|
||||
png_push_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
|
||||
}
|
||||
|
||||
@ -598,6 +536,17 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length)
|
||||
}
|
||||
}
|
||||
|
||||
int /* PRIVATE */
|
||||
png_push_have_buffer(png_structp png_ptr)
|
||||
{
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
return (0);
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
void /* PRIVATE */
|
||||
png_push_save_buffer(png_structp png_ptr)
|
||||
{
|
||||
@ -1461,10 +1410,6 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
length)
|
||||
{
|
||||
png_uint_32 skip = 0;
|
||||
#if 0
|
||||
/* Redundant? */
|
||||
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
|
||||
#endif
|
||||
|
||||
if (!(png_ptr->chunk_name[0] & 0x20))
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpriv.h - private declarations for use inside libpng
|
||||
*
|
||||
* libpng version 1.4.0beta24 - July 25, 2008
|
||||
* libpng version 1.4.0beta25 - July 30, 2008
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -795,6 +795,7 @@ 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_uint_32 length));
|
||||
PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
|
||||
PNG_EXTERN int png_push_have_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_bytep buffer, png_size_t buffer_length));
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
2
pngrio.c
2
pngrio.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
230
pngrtran.c
230
pngrtran.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -705,9 +705,6 @@ void /* PRIVATE */
|
||||
png_init_read_transformations(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_init_read_transformations\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (png_ptr != NULL)
|
||||
#endif
|
||||
{
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) || defined(PNG_READ_SHIFT_SUPPORTED) \
|
||||
|| defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
@ -1500,11 +1497,7 @@ void /* PRIVATE */
|
||||
png_do_unpack(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_unpack\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL && row_info->bit_depth < 8)
|
||||
#else
|
||||
if (row_info->bit_depth < 8)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 i;
|
||||
png_uint_32 row_width=row_info->width;
|
||||
@ -1591,9 +1584,6 @@ png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits)
|
||||
{
|
||||
png_debug(1, "in png_do_unshift\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL && sig_bits != NULL &&
|
||||
#endif
|
||||
row_info->color_type != PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
int shift[4];
|
||||
@ -1696,11 +1686,7 @@ void /* PRIVATE */
|
||||
png_do_chop(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_chop\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL && row_info->bit_depth == 16)
|
||||
#else
|
||||
if (row_info->bit_depth == 16)
|
||||
#endif
|
||||
{
|
||||
png_bytep sp = row;
|
||||
png_bytep dp = row;
|
||||
@ -1750,9 +1736,6 @@ void /* PRIVATE */
|
||||
png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_read_swap_alpha\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
@ -1842,9 +1825,6 @@ void /* PRIVATE */
|
||||
png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_read_invert_alpha\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
@ -1949,9 +1929,6 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
|
||||
|
||||
png_debug(1, "in png_do_read_filler\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
if (row_info->bit_depth == 8)
|
||||
@ -2121,9 +2098,6 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
|
||||
|
||||
png_debug(1, "in png_do_gray_to_rgb\n");
|
||||
if (row_info->bit_depth >= 8 &&
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
!(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
@ -2227,9 +2201,6 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
|
||||
png_debug(1, "in png_do_rgb_to_gray\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
|
||||
@ -2499,187 +2470,6 @@ png_build_grayscale_palette(int bit_depth, png_colorp palette)
|
||||
}
|
||||
}
|
||||
|
||||
/* This function is currently unused. Do we really need it? */
|
||||
#if defined(PNG_READ_DITHER_SUPPORTED) && defined(PNG_CORRECT_PALETTE_SUPPORTED)
|
||||
void /* PRIVATE */
|
||||
png_correct_palette(png_structp png_ptr, png_colorp palette,
|
||||
int num_palette)
|
||||
{
|
||||
png_debug(1, "in png_correct_palette\n");
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \
|
||||
defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND))
|
||||
{
|
||||
png_color back, back_1;
|
||||
|
||||
if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE)
|
||||
{
|
||||
back.red = png_ptr->gamma_table[png_ptr->background.red];
|
||||
back.green = png_ptr->gamma_table[png_ptr->background.green];
|
||||
back.blue = png_ptr->gamma_table[png_ptr->background.blue];
|
||||
|
||||
back_1.red = png_ptr->gamma_to_1[png_ptr->background.red];
|
||||
back_1.green = png_ptr->gamma_to_1[png_ptr->background.green];
|
||||
back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue];
|
||||
}
|
||||
else
|
||||
{
|
||||
double g;
|
||||
|
||||
g = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma);
|
||||
|
||||
if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_SCREEN ||
|
||||
fabs(g - 1.0) < PNG_GAMMA_THRESHOLD)
|
||||
{
|
||||
back.red = png_ptr->background.red;
|
||||
back.green = png_ptr->background.green;
|
||||
back.blue = png_ptr->background.blue;
|
||||
}
|
||||
else
|
||||
{
|
||||
back.red =
|
||||
(png_byte)(pow((double)png_ptr->background.red/255, g) *
|
||||
255.0 + 0.5);
|
||||
back.green =
|
||||
(png_byte)(pow((double)png_ptr->background.green/255, g) *
|
||||
255.0 + 0.5);
|
||||
back.blue =
|
||||
(png_byte)(pow((double)png_ptr->background.blue/255, g) *
|
||||
255.0 + 0.5);
|
||||
}
|
||||
|
||||
g = 1.0 / png_ptr->background_gamma;
|
||||
|
||||
back_1.red =
|
||||
(png_byte)(pow((double)png_ptr->background.red/255, g) *
|
||||
255.0 + 0.5);
|
||||
back_1.green =
|
||||
(png_byte)(pow((double)png_ptr->background.green/255, g) *
|
||||
255.0 + 0.5);
|
||||
back_1.blue =
|
||||
(png_byte)(pow((double)png_ptr->background.blue/255, g) *
|
||||
255.0 + 0.5);
|
||||
}
|
||||
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
png_uint_32 i;
|
||||
|
||||
for (i = 0; i < (png_uint_32)num_palette; i++)
|
||||
{
|
||||
if (i < png_ptr->num_trans && png_ptr->trans[i] == 0)
|
||||
{
|
||||
palette[i] = back;
|
||||
}
|
||||
else if (i < png_ptr->num_trans && png_ptr->trans[i] != 0xff)
|
||||
{
|
||||
png_byte v, w;
|
||||
|
||||
v = png_ptr->gamma_to_1[png_ptr->palette[i].red];
|
||||
png_composite(w, v, png_ptr->trans[i], back_1.red);
|
||||
palette[i].red = png_ptr->gamma_from_1[w];
|
||||
|
||||
v = png_ptr->gamma_to_1[png_ptr->palette[i].green];
|
||||
png_composite(w, v, png_ptr->trans[i], back_1.green);
|
||||
palette[i].green = png_ptr->gamma_from_1[w];
|
||||
|
||||
v = png_ptr->gamma_to_1[png_ptr->palette[i].blue];
|
||||
png_composite(w, v, png_ptr->trans[i], back_1.blue);
|
||||
palette[i].blue = png_ptr->gamma_from_1[w];
|
||||
}
|
||||
else
|
||||
{
|
||||
palette[i].red = png_ptr->gamma_table[palette[i].red];
|
||||
palette[i].green = png_ptr->gamma_table[palette[i].green];
|
||||
palette[i].blue = png_ptr->gamma_table[palette[i].blue];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_palette; i++)
|
||||
{
|
||||
if (palette[i].red == (png_byte)png_ptr->trans_values.gray)
|
||||
{
|
||||
palette[i] = back;
|
||||
}
|
||||
else
|
||||
{
|
||||
palette[i].red = png_ptr->gamma_table[palette[i].red];
|
||||
palette[i].green = png_ptr->gamma_table[palette[i].green];
|
||||
palette[i].blue = png_ptr->gamma_table[palette[i].blue];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_GAMMA)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_palette; i++)
|
||||
{
|
||||
palette[i].red = png_ptr->gamma_table[palette[i].red];
|
||||
palette[i].green = png_ptr->gamma_table[palette[i].green];
|
||||
palette[i].blue = png_ptr->gamma_table[palette[i].blue];
|
||||
}
|
||||
}
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_BACKGROUND)
|
||||
{
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
png_color back;
|
||||
|
||||
back.red = (png_byte)png_ptr->background.red;
|
||||
back.green = (png_byte)png_ptr->background.green;
|
||||
back.blue = (png_byte)png_ptr->background.blue;
|
||||
|
||||
for (i = 0; i < (int)png_ptr->num_trans; i++)
|
||||
{
|
||||
if (png_ptr->trans[i] == 0)
|
||||
{
|
||||
palette[i].red = back.red;
|
||||
palette[i].green = back.green;
|
||||
palette[i].blue = back.blue;
|
||||
}
|
||||
else if (png_ptr->trans[i] != 0xff)
|
||||
{
|
||||
png_composite(palette[i].red, png_ptr->palette[i].red,
|
||||
png_ptr->trans[i], back.red);
|
||||
png_composite(palette[i].green, png_ptr->palette[i].green,
|
||||
png_ptr->trans[i], back.green);
|
||||
png_composite(palette[i].blue, png_ptr->palette[i].blue,
|
||||
png_ptr->trans[i], back.blue);
|
||||
}
|
||||
}
|
||||
}
|
||||
else /* assume grayscale palette (what else could it be?) */
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_palette; i++)
|
||||
{
|
||||
if (i == (png_byte)png_ptr->trans_values.gray)
|
||||
{
|
||||
palette[i].red = (png_byte)png_ptr->background.red;
|
||||
palette[i].green = (png_byte)png_ptr->background.green;
|
||||
palette[i].blue = (png_byte)png_ptr->background.blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
/* Replace any alpha or transparency with the supplied background color.
|
||||
@ -2704,9 +2494,6 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
|
||||
png_debug(1, "in png_do_background\n");
|
||||
if (background != NULL &&
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(!(row_info->color_type & PNG_COLOR_MASK_ALPHA) ||
|
||||
(row_info->color_type != PNG_COLOR_TYPE_PALETTE && trans_values)))
|
||||
{
|
||||
@ -3386,9 +3173,6 @@ png_do_gamma(png_row_infop row_info, png_bytep row,
|
||||
|
||||
png_debug(1, "in png_do_gamma\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
((row_info->bit_depth <= 8 && gamma_table != NULL) ||
|
||||
(row_info->bit_depth == 16 && gamma_16_table != NULL)))
|
||||
{
|
||||
@ -3568,9 +3352,6 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
||||
|
||||
png_debug(1, "in png_do_expand_palette\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
if (row_info->bit_depth < 8)
|
||||
@ -3710,9 +3491,6 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
||||
png_uint_32 row_width=row_info->width;
|
||||
|
||||
png_debug(1, "in png_do_expand\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
@ -3916,9 +3694,6 @@ png_do_dither(png_row_infop row_info, png_bytep row,
|
||||
png_uint_32 row_width=row_info->width;
|
||||
|
||||
png_debug(1, "in png_do_dither\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB &&
|
||||
palette_lookup && row_info->bit_depth == 8)
|
||||
@ -4225,9 +4000,6 @@ png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_read_intrapixel\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
int bytes_per_pixel;
|
||||
|
24
pngrutil.c
24
pngrutil.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -19,20 +19,12 @@
|
||||
png_uint_32 PNGAPI
|
||||
png_get_uint_31(png_structp png_ptr, png_bytep buf)
|
||||
{
|
||||
#ifdef PNG_READ_BIG_ENDIAN_SUPPORTED
|
||||
png_uint_32 i = png_get_uint_32(buf);
|
||||
#else
|
||||
/* Avoid an extra function call by inlining the result. */
|
||||
png_uint_32 i = ((png_uint_32)(*buf) << 24) +
|
||||
((png_uint_32)(*(buf + 1)) << 16) +
|
||||
((png_uint_32)(*(buf + 2)) << 8) +
|
||||
(png_uint_32)(*(buf + 3));
|
||||
#endif
|
||||
if (i > PNG_UINT_31_MAX)
|
||||
png_error(png_ptr, "PNG unsigned integer out of range");
|
||||
return (i);
|
||||
}
|
||||
#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
|
||||
#ifndef PNG_USE_READ_MACROS
|
||||
/* Grab an unsigned 32-bit integer from a buffer in big-endian format. */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_uint_32(png_bytep buf)
|
||||
@ -45,7 +37,6 @@ png_get_uint_32(png_bytep buf)
|
||||
return (i);
|
||||
}
|
||||
|
||||
#if defined(PNG_GET_INT_32_SUPPORTED)
|
||||
/* Grab a signed 32-bit integer from a buffer in big-endian format. The
|
||||
* data is stored in the PNG file in two's complement format, and it is
|
||||
* assumed that the machine format for signed integers is the same. */
|
||||
@ -59,7 +50,6 @@ png_get_int_32(png_bytep buf)
|
||||
|
||||
return (i);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */
|
||||
png_uint_16 PNGAPI
|
||||
@ -70,7 +60,7 @@ png_get_uint_16(png_bytep buf)
|
||||
|
||||
return (i);
|
||||
}
|
||||
#endif /* PNG_READ_BIG_ENDIAN_SUPPORTED */
|
||||
#endif /* PNG_USE_READ_MACROS */
|
||||
|
||||
/* Read the chunk header (length + type name).
|
||||
* Put the type name into png_ptr->chunk_name, and return the length.
|
||||
@ -2237,11 +2227,6 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_ptr->mode |= PNG_AFTER_IDAT;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Redundant? */
|
||||
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
|
||||
#endif
|
||||
|
||||
if (!(png_ptr->chunk_name[0] & 0x20))
|
||||
{
|
||||
#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
@ -2322,14 +2307,13 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
the chunk name itself is valid. */
|
||||
|
||||
#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
|
||||
#define isnonupper(c) ((c) < 65 || (c) > 90)
|
||||
|
||||
void /* PRIVATE */
|
||||
png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name)
|
||||
{
|
||||
png_debug(1, "in png_check_chunk_name\n");
|
||||
if (isnonalpha(chunk_name[0]) || isnonalpha(chunk_name[1]) ||
|
||||
isnonupper(chunk_name[2]) || isnonalpha(chunk_name[3]))
|
||||
isnonalpha(chunk_name[2]) || isnonalpha(chunk_name[3]))
|
||||
{
|
||||
png_chunk_error(png_ptr, "invalid chunk type");
|
||||
}
|
||||
|
2
pngset.c
2
pngset.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngtest.c - a simple test program to test libpng
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -1613,4 +1613,4 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_4_0beta24 your_png_h_is_not_version_1_4_0beta24;
|
||||
typedef version_1_4_0beta25 your_png_h_is_not_version_1_4_0beta25;
|
||||
|
18
pngtrans.c
18
pngtrans.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -179,10 +179,6 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
/* This test removed from libpng version 1.0.13 and 1.2.0:
|
||||
* if (row_info->bit_depth == 1 &&
|
||||
*/
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row == NULL || row_info == NULL)
|
||||
return;
|
||||
#endif
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
@ -232,9 +228,6 @@ png_do_swap(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_swap\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->bit_depth == 16)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
@ -363,9 +356,6 @@ png_do_packswap(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_packswap\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->bit_depth < 8)
|
||||
{
|
||||
png_bytep rp, end, table;
|
||||
@ -394,9 +384,6 @@ void /* PRIVATE */
|
||||
png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags)
|
||||
{
|
||||
png_debug(1, "in png_do_strip_filler\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
png_bytep sp=row;
|
||||
png_bytep dp=row;
|
||||
@ -553,9 +540,6 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_bgr\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
|
2
pngwio.c
2
pngwio.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwio.c - functions for data output
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
18
pngwtran.c
18
pngwtran.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -88,9 +88,6 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
||||
{
|
||||
png_debug(1, "in png_do_pack\n");
|
||||
if (row_info->bit_depth == 8 &&
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->channels == 1)
|
||||
{
|
||||
switch ((int)bit_depth)
|
||||
@ -213,11 +210,7 @@ void /* PRIVATE */
|
||||
png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth)
|
||||
{
|
||||
png_debug(1, "in png_do_shift\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL &&
|
||||
#else
|
||||
if (
|
||||
#endif
|
||||
row_info->color_type != PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
int shift_start[4], shift_dec[4];
|
||||
@ -337,9 +330,6 @@ void /* PRIVATE */
|
||||
png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_write_swap_alpha\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
{
|
||||
@ -425,9 +415,6 @@ void /* PRIVATE */
|
||||
png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_write_invert_alpha\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
{
|
||||
@ -516,9 +503,6 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_write_intrapixel\n");
|
||||
if (
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
int bytes_per_pixel;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [July 25, 2008]
|
||||
* Last changed in libpng 1.4.0 [July 30, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -1833,8 +1833,8 @@ png_write_start_row(png_structp png_ptr)
|
||||
(png_size_t)(png_ptr->rowbytes + 1));
|
||||
png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH;
|
||||
}
|
||||
#endif /* PNG_NO_WRITE_FILTER */
|
||||
}
|
||||
#endif /* PNG_NO_WRITE_FILTER */
|
||||
|
||||
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
|
||||
/* if interlaced, we need to set up width and height of pass */
|
||||
@ -1998,11 +1998,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
||||
|
||||
png_debug(1, "in png_do_write_interlace\n");
|
||||
/* we don't have to do anything on the last pass (6) */
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if (row != NULL && row_info != NULL && pass < 6)
|
||||
#else
|
||||
if (pass < 6)
|
||||
#endif
|
||||
{
|
||||
/* each pixel depth is handled separately */
|
||||
switch (row_info->pixel_depth)
|
||||
|
6
projects/netware.txt
Normal file
6
projects/netware.txt
Normal file
@ -0,0 +1,6 @@
|
||||
A set of project files is available for Netware. Get
|
||||
libpng-1.2.5-project-netware.zip from a libpng distribution
|
||||
site such as http://libpng.sourceforge.net
|
||||
|
||||
Put the zip file in this directory (projects) and then run
|
||||
"unzip -a libpng-1.2.5-project-netware.zip"
|
@ -178,7 +178,7 @@ configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in
|
||||
|
||||
# SET UP LINKS
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||
# VERSION 0.${PNGLIB_RELEASE}.1.4.0beta24
|
||||
# VERSION 0.${PNGLIB_RELEASE}.1.4.0beta25
|
||||
VERSION 0.${PNGLIB_RELEASE}.0
|
||||
SOVERSION 0
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
# Modeled after libxml-config.
|
||||
|
||||
version=1.4.0beta24
|
||||
version=1.4.0beta25
|
||||
prefix=""
|
||||
libdir=""
|
||||
libs=""
|
||||
|
@ -3,7 +3,7 @@
|
||||
# libpng-config
|
||||
# provides configuration info for libpng.
|
||||
|
||||
# Copyright (C) 2002, 2004, 2006 Glenn Randers-Pehrson
|
||||
# Copyright (C) 2002, 2004, 2006, 2007 Glenn Randers-Pehrson
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
# Modeled after libxml-config.
|
||||
@ -14,12 +14,12 @@ exec_prefix="@exec_prefix@"
|
||||
libdir="@libdir@"
|
||||
includedir="@includedir@/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@"
|
||||
libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@"
|
||||
all_libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ -lz -lm"
|
||||
all_libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ @LIBS@"
|
||||
I_opts="-I${includedir}"
|
||||
L_opts="-L${libdir}"
|
||||
R_opts=""
|
||||
cppflags=""
|
||||
ccopts=""
|
||||
ccopts="@LIBPNG_NO_MMX@"
|
||||
ldopts=""
|
||||
|
||||
usage()
|
||||
|
11
scripts/libpng.pc-configure.in
Normal file
11
scripts/libpng.pc-configure.in
Normal file
@ -0,0 +1,11 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: @PNGLIB_VERSION@
|
||||
Libs: -L${libdir} -lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
||||
Libs.private: @LIBS@
|
||||
Cflags: -I${includedir} @LIBPNG_NO_MMX@
|
@ -5,6 +5,6 @@ includedir=@includedir@/libpng14
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.4.0beta24
|
||||
Version: 1.4.0beta25
|
||||
Libs: -L${libdir} -lpng14
|
||||
Cflags: -I${includedir}
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -19,8 +19,8 @@ RM_F = rm -f
|
||||
LN_SF = ln -f -s
|
||||
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
prefix=/usr/local
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -63,9 +63,9 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
||||
-fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMAJ = 0
|
||||
CYGDLL = 14
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
SHAREDLIB=cygpng$(CYGDLL).dll
|
||||
|
@ -18,8 +18,8 @@ ZLIBINC=../zlib
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 12
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@ -27,6 +27,8 @@ LIBSO=$(LIBNAME).dylib
|
||||
LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
|
||||
LIBSOVER=$(LIBNAME).$(PNGVER).dylib
|
||||
OLDSO=libpng.dylib
|
||||
OLDSOMAJ=libpng.14.dylib
|
||||
OLDSOVER=libpng.14.$(PNGMIN).dylib
|
||||
|
||||
# Utilities:
|
||||
CC=cc
|
||||
@ -36,7 +38,8 @@ LN_SF=ln -sf
|
||||
RANLIB=ranlib
|
||||
RM_F=/bin/rm -f
|
||||
|
||||
CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops
|
||||
# CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE
|
||||
CFLAGS=-I$(ZLIBINC) -Wall -O -funroll-loops
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng14 -lz
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
@ -70,18 +73,18 @@ OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fno-common -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config pngdefs.h
|
||||
|
||||
pngdefs.h:
|
||||
echo "/* pngdefs.h was built by makefile.darwin */" > pngdefs.h
|
||||
all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
$(AR_RC) $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.pc:
|
||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \
|
||||
sed -e s/-lm// > libpng.pc
|
||||
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng14!-lpng14\ -lz! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
@ -105,19 +108,25 @@ $(LIBSOVER): $(OBJSDLL)
|
||||
-o $(LIBSOVER) \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||
|
||||
$(OLDSOVER): $(OBJSDLL)
|
||||
$(CC) -dynamiclib \
|
||||
-install_name $(LIBPATH)/$(OLDSOMAJ) \
|
||||
-current_version 3 -compatibility_version 3 \
|
||||
-o $(OLDSOVER) \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||
|
||||
pngtest: pngtest.o $(LIBSO)
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
|
||||
install-headers: png.h pngconf.h pngdefs.h
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
|
||||
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h pngdefs.h $(DI)/$(LIBNAME)
|
||||
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||
chmod 644 $(DI)/$(LIBNAME)/pngdefs.h
|
||||
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pngdefs.h
|
||||
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
|
||||
-@$(RM_F) $(DI)/libpng
|
||||
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
|
||||
|
||||
@ -129,19 +138,24 @@ install-static: install-headers libpng.a
|
||||
-@$(RM_F) $(DL)/libpng.a
|
||||
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
|
||||
|
||||
install-shared: install-headers $(LIBSO) libpng.pc
|
||||
install-shared: install-headers $(LIBSO) libpng.pc \
|
||||
$(OLDSOVER)
|
||||
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
|
||||
-@$(RM_F) $(DL)/$(LIBNAME).$(PNGVER)*.dylib
|
||||
-@$(RM_F) $(DL)/$(LIBNAME).$(PNGMAJ)*.dylib
|
||||
-@$(RM_F) $(DL)/$(LIBSO)
|
||||
-@$(RM_F) $(DL)/$(OLDSO)
|
||||
-@$(RM_F) $(DL)/$(OLDSOMAJ)
|
||||
-@$(RM_F) $(DL)/libpng.3.$(PNGMIN)*.dylib
|
||||
cp $(LIBSOVER) $(DL)
|
||||
cp $(OLDSOVER) $(DL)
|
||||
chmod 755 $(DL)/$(LIBSOVER)
|
||||
chmod 755 $(DL)/$(OLDSOVER)
|
||||
(cd $(DL); \
|
||||
$(LN_SF) $(OLDSOVER) $(OLDSOMAJ); \
|
||||
$(LN_SF) $(OLDSOMAJ) $(OLDSO); \
|
||||
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ); \
|
||||
$(LN_SF) $(LIBSOMAJ) $(LIBSO); \
|
||||
$(LN_SF) $(OLDSO) $(LIBSO))
|
||||
$(LN_SF) $(LIBSOMAJ) $(LIBSO))
|
||||
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
|
||||
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
|
||||
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
|
||||
@ -192,7 +206,8 @@ test-installed:
|
||||
|
||||
clean:
|
||||
$(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
|
||||
libpng.pc $(LIBNAME).*dylib pngtesti pngdefs.h
|
||||
$(OLDSOVER) \
|
||||
libpng.pc $(LIBNAME).*dylib pngtesti
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
@ -200,20 +215,20 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngdefs.h pngpriv.h
|
||||
png.o png.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
|
||||
pngtest.o: png.h pngconf.h pngdefs.h
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
@ -4,8 +4,8 @@
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
# Library name:
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng14
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -3,7 +3,7 @@
|
||||
# For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
PREFIX?= /usr/local
|
||||
SHLIB_VER?= 1
|
||||
SHLIB_VER?= %SONUM%
|
||||
|
||||
LIB= png
|
||||
SHLIB_MAJOR= ${SHLIB_VER}
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -17,8 +17,8 @@ ZLIBINC=/opt/zlib/include
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -17,8 +17,8 @@ ZLIBINC=/opt/zlib/include
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -79,9 +79,9 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
||||
-fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMAJ = 0
|
||||
MINGDLL = 14
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
SHAREDLIB=libpng$(MINGDLL).dll
|
||||
|
@ -14,7 +14,7 @@ INCSDIR=${LOCALBASE}/include/libpng14
|
||||
|
||||
LIB= png14
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.4.0beta24
|
||||
SHLIB_MINOR= 1.4.0beta25
|
||||
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 \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
|
@ -13,7 +13,7 @@ INCSDIR=${LOCALBASE}/include/libpng
|
||||
|
||||
LIB= png
|
||||
SHLIB_MAJOR= 3
|
||||
SHLIB_MINOR= 1.4.0beta24
|
||||
SHLIB_MINOR= 1.4.0beta25
|
||||
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 \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -8,7 +8,7 @@ LIBDIR= ${PREFIX}/lib
|
||||
MANDIR= ${PREFIX}/man/cat
|
||||
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.4.0beta24
|
||||
SHLIB_MINOR= 1.4.0beta25
|
||||
|
||||
LIB= png
|
||||
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
# Library name:
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 1
|
||||
PNGMIN = 1.4.0beta24
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.4.0beta25
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user