Imported from libpng-1.2.2beta3.tar
diff --git a/ANNOUNCE b/ANNOUNCE
index 8a5c41b..d8c91c2 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
 
-Libpng 1.2.2beta2 - February 24, 2002
+Libpng 1.2.2beta3 - March 7, 2002
 
 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.
@@ -16,12 +16,20 @@
   Revised calls to png_create_read_struct() and png_create_write_struct()
     for simpler debugging.
   Revised png_zalloc() so zlib handles errors (uses PNG_FLAG_MALLOC_NULL_MEM_OK)
-version 1.2.2beta2 [February 24, 2002]
+version 1.2.2beta2 [February 23, 2002]
   Check chunk_length and idat_size for invalid (over PNG_MAX_UINT) lengths.
   Check for invalid image dimensions in png_get_IHDR.
   Added missing "fi;" in the install target of the SGI makefiles.
   Added install-static to all makefiles that make shared libraries.
   Always do gamma compensation when image is partially transparent.
+version 1.2.2beta3 [March 7, 2002]
+  Modified shared-library makefiles to install pkgconfig/libpngNN.pc.
+  Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown
+  Removed unused png_write_destroy_info prototype from png.h
+  Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case
+  Added install-shared target to all makefiles that make shared libraries.
+  Stopped a double free of palette, hist, and trans when not using free_me.
+  Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64.
 
 Send comments/corrections/commendations to
 png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
diff --git a/CHANGES b/CHANGES
index 052a74c..a5fa9d1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1024,12 +1024,20 @@
   Revised calls to png_create_read_struct() and png_create_write_struct()
     for simpler debugging.
   Revised png_zalloc() so zlib handles errors (uses PNG_FLAG_MALLOC_NULL_MEM_OK)
-version 1.2.2beta2 [February 24, 2002]
+version 1.2.2beta2 [February 23, 2002]
   Check chunk_length and idat_size for invalid (over PNG_MAX_UINT) lengths.
   Check for invalid image dimensions in png_get_IHDR.
   Added missing "fi;" in the install target of the SGI makefiles.
   Added install-static to all makefiles that make shared libraries.
   Always do gamma compensation when image is partially transparent.
+version 1.2.2beta3 [March 7, 2002]
+  Modified shared-library makefiles to install pkgconfig/libpngNN.pc.
+  Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown
+  Removed unused png_write_destroy_info prototype from png.h
+  Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case
+  Added install-shared target to all makefiles that make shared libraries.
+  Stopped a double free of palette, hist, and trans when not using free_me.
+  Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64.
 
 Send comments/corrections/commendations to
 png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
diff --git a/INSTALL b/INSTALL
index 5377590..efd61ea 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,5 @@
 
-Installing libpng version 1.2.2beta2 - February 24, 2002
+Installing libpng version 1.2.2beta3 - March 7, 2002
 
 Before installing libpng, you must first install zlib.  zlib
 can usually be found wherever you got libpng.  zlib can be
@@ -10,7 +10,7 @@
 version of zlib that's installed.
 
 You can rename the directories that you downloaded (they
-might be called "libpng-1.2.2beta2" or "lpng109" and "zlib-1.1.3"
+might be called "libpng-1.2.2beta3" or "lpng109" and "zlib-1.1.3"
 or "zlib113") so that you have directories called "zlib" and "libpng".
 
 Your directory structure should look like this:
@@ -64,8 +64,8 @@
 include
 
  makefile.std      =>  Generic UNIX makefile (cc, creates static libpng.a)
- makefile.linux    =>  Linux/ELF makefile (gcc, creates libpng.so.0.1.2.2beta2)
- makefile.gcmmx    =>  Linux/ELF makefile (gcc, creates libpng.so.0.1.2.2beta2,
+ makefile.linux    =>  Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.2beta3)
+ makefile.gcmmx    =>  Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.2beta3,
                        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
@@ -82,11 +82,14 @@
  libpng.icc        =>  Project file for IBM VisualAge/C++ version 4.0 or later
  makefile.macosx   =>  MACOS X Makefile
  makefile.netbsd   =>  NetBSD/cc makefile, uses PNGGCCRD
+ makefile.openbsd  =>  OpenBSD makefile
  makefile.sgi      =>  Silicon Graphics IRIX makefile (cc, creates static lib)
- makefile.sggcc    =>  Silicon Graphics (gcc, creates libpng.so.0.1.2.2beta2)
+ makefile.sggcc    =>  Silicon Graphics (gcc, creates libpng12.so.0.1.2.2beta3)
  makefile.sunos    =>  Sun makefile
- makefile.solaris  =>  Solaris 2.X makefile (gcc, creates libpng.so.0.1.2.2beta2)
- makefile.so9      =>  Solaris 9 makefile (gcc, creates libpng.so.0.1.2.2beta2)
+ makefile.solaris  =>  Solaris 2.X makefile (gcc, creates libpng12.so.0.1.2.2beta3)
+ makefile.so9      =>  Solaris 9 makefile (gcc, creates libpng12.so.0.1.2.2beta3)
+ 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
  makefile.mips     =>  MIPS makefile
  makefile.acorn    =>  Acorn makefile
diff --git a/KNOWNBUG b/KNOWNBUG
index 4d782e7..4d9a630 100644
--- a/KNOWNBUG
+++ b/KNOWNBUG
@@ -1,5 +1,5 @@
 
-Known bugs in libpng version 1.2.2beta2
+Known bugs in libpng version 1.2.2beta3
 
 1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
    reading interlaced PNG files, when assembler code is enabled.
diff --git a/LICENSE b/LICENSE
index 36d844b..19a1e6e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -8,7 +8,7 @@
 If you modify libpng you may insert additional notices immediately following
 this sentence.
 
-libpng versions 1.0.7, July 1, 2000, through 1.2.2beta2, February 24, 2002, are
+libpng versions 1.0.7, July 1, 2000, through 1.2.2beta3, March 7, 2002, are
 Copyright (c) 2000 Glenn Randers-Pehrson
 and are distributed according to the same disclaimer and license as libpng-1.0.6
 with the following individuals added to the list of Contributing Authors
@@ -99,4 +99,4 @@
 
 Glenn Randers-Pehrson
 randeg@alum.rpi.edu
-February 24, 2002
+March 7, 2002
diff --git a/README b/README
index 26af024..43cb45f 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-README for libpng 1.2.2beta2 - February 24, 2002 (shared library 2.1)
+README for libpng 1.2.2beta3 - March 7, 2002 (shared library 2.1)
 See the note about version numbers near the top of png.h
 
 See INSTALL for instructions on how to install libpng.
@@ -187,9 +187,9 @@
        descrip.mms      =>  VMS makefile for MMS or MMK
        makefile.std     =>  Generic UNIX makefile (cc, creates static libpng.a)
        makefile.linux   =>  Linux/ELF makefile
-                            (gcc, creates libpng.so.0.1.2.2beta2)
+                            (gcc, creates libpng12.so.0.1.2.2beta3)
        makefile.gcmmx   =>  Linux/ELF makefile (gcc, creates
-                            libpng.so.0.1.2.2beta2, uses assembler code
+                            libpng12.so.0.1.2.2beta3, 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
@@ -206,13 +206,16 @@
        libpng.icc       =>  Project file, IBM VisualAge/C++ 4.0 or later
        makefile.macosx  =>  MACOS X Makefile
        makefile.netbsd  =>  NetBSD/cc makefile, uses PNGGCCRD
+       makefile.openbsd =>  OpenBSD makefile
        makefile.sgi     =>  Silicon Graphics IRIX (cc, creates static lib)
-       makefile.sggcc   =>  Silicon Graphics (gcc, creates libpng.so.0.1.2.2beta2)
+       makefile.sggcc   =>  Silicon Graphics (gcc, creates libpng12.so.0.1.2.2beta3)
        makefile.sunos   =>  Sun makefile
        makefile.solaris =>  Solaris 2.X makefile
-                            (gcc, creates libpng.so.0.1.2.2beta2)
+                            (gcc, creates libpng12.so.0.1.2.2beta3)
        makefile.so9     =>  Solaris 9 makefile
-                            (gcc, creates libpng.so.0.1.2.2beta2)
+                            (gcc, creates libpng12.so.0.1.2.2beta3)
+       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
        makefile.mips    =>  MIPS makefile
        makefile.acorn   =>  Acorn makefile
diff --git a/Y2KINFO b/Y2KINFO
index ae1e727..cc29a3e 100644
--- a/Y2KINFO
+++ b/Y2KINFO
@@ -1,13 +1,13 @@
    Y2K compliance in libpng:
    =========================
 
-      February 24, 2002
+      March 7, 2002
 
       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.2.2beta2 are Y2K compliant.  It is my belief that earlier
+      upward through 1.2.2beta3 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
diff --git a/configure b/configure
index 55685df..b75faef 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 echo "
-  There is no \"configure\" script for Libpng-1.2.2beta2.  Instead, please
+  There is no \"configure\" script for Libpng-1.2.2beta3.  Instead, please
   copy the appropriate makefile for your system from the \"scripts\"
   directory.  Read the INSTALL file for more details.
 "
diff --git a/libpng.3 b/libpng.3
index b00523e..5a9d589 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1,6 +1,6 @@
-.TH LIBPNG 3 "February 24, 2002"
+.TH LIBPNG 3 "March 7, 2002"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2beta2
+libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2beta3
 .SH SYNOPSIS
 \fI\fB
 
@@ -318,6 +318,10 @@
 
 \fI\fB
 
+\fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
+
+\fI\fB
+
 \fBvoid png_init_io (png_structp \fP\fIpng_ptr\fP\fB, FILE \fI*fp\fP\fB);\fP
 
 \fI\fB
@@ -732,10 +736,6 @@
 
 \fI\fB
 
-\fBvoid png_write_destroy_info (png_infop \fIinfo_ptr\fP\fB);\fP
-
-\fI\fB
-
 \fBvoid png_write_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
 
 \fI\fB
@@ -776,6 +776,14 @@
 
 \fI\fB
 
+\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
+
+\fI\fB
+
+\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
+
+\fI\fB
+
 .SH DESCRIPTION
 The
 .I libpng
@@ -787,7 +795,7 @@
 .SH LIBPNG.TXT
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.2.2beta2 - February 24, 2002
+ libpng version 1.2.2beta3 - March 7, 2002
  Updated and distributed by Glenn Randers-Pehrson
  <randeg@alum.rpi.edu>
  Copyright (c) 1998-2002 Glenn Randers-Pehrson
@@ -3635,13 +3643,13 @@
 
 .SH IX. Y2K Compliance in libpng
 
-February 24, 2002
+March 7, 2002
 
 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.2.2beta2 are Y2K compliant.  It is my belief that earlier
+upward through 1.2.2beta3 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
@@ -3764,7 +3772,7 @@
  1.2.1beta-4          3    10201  3.1.2.1beta1-4
  1.2.1rc1-2           3    10201  3.1.2.1rc1-2
  1.2.1                3    10201  3.1.2.1
- 1.2.2beta1-2        12    10202  12.so.0.1.2.2beta1-2
+ 1.2.2beta1-3        12    10202  12.so.0.1.2.2beta1-3
 
 Henceforth the source version will match the shared-library minor
 and patch numbers; the shared-library major version number will be
@@ -3822,7 +3830,7 @@
 
 Thanks to Frank J. T. Wojcik for helping with the documentation.
 
-Libpng version 1.2.2beta2 - February 24, 2002:
+Libpng version 1.2.2beta3 - March 7, 2002:
 Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
 Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
 
@@ -3839,7 +3847,7 @@
 If you modify libpng you may insert additional notices immediately following
 this sentence.
 
-libpng versions 1.0.7, July 1, 2000, through  1.2.2beta2, February 24, 2002, are
+libpng versions 1.0.7, July 1, 2000, through  1.2.2beta3, March 7, 2002, are
 Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
 distributed according to the same disclaimer and license as libpng-1.0.6
 with the following individuals added to the list of Contributing Authors
@@ -3931,7 +3939,7 @@
 
 Glenn Randers-Pehrson
 randeg@alum.rpi.edu
-February 24, 2002
+March 7, 2002
 
 .\" end of man page
 
diff --git a/libpng.txt b/libpng.txt
index 356db0c..0dc0b09 100644
--- a/libpng.txt
+++ b/libpng.txt
@@ -1,6 +1,6 @@
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.2.2beta2 - February 24, 2002
+ libpng version 1.2.2beta3 - March 7, 2002
  Updated and distributed by Glenn Randers-Pehrson
  <randeg@alum.rpi.edu>
  Copyright (c) 1998-2002 Glenn Randers-Pehrson
@@ -2848,13 +2848,13 @@
 
 IX. Y2K Compliance in libpng
 
-February 24, 2002
+March 7, 2002
 
 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.2.2beta2 are Y2K compliant.  It is my belief that earlier
+upward through 1.2.2beta3 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
diff --git a/libpngpf.3 b/libpngpf.3
index d373e1b..52363d2 100644
--- a/libpngpf.3
+++ b/libpngpf.3
@@ -1,6 +1,6 @@
-.TH LIBPNGPF 3 "February 24, 2002"
+.TH LIBPNGPF 3 "March 7, 2002"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2beta2
+libpng \- Portable Network Graphics (PNG) Reference Library 1.2.2beta3
 (private functions)
 .SH SYNOPSIS
 \fB#include <png.h>\fP
@@ -191,10 +191,6 @@
 
 \fI\fB
 
-\fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
-
-\fI\fB
-
 \fBvoid png_handle_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
 
 \fI\fB
@@ -535,14 +531,6 @@
 
 \fI\fB
 
-\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
-
-\fI\fB
-
-\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
-
-\fI\fB
-
 .SH DESCRIPTION
 The functions listed above are used privately by libpng
 and are not recommended for use by applications.  They are
diff --git a/png.5 b/png.5
index 7e85ca3..6ca152f 100644
--- a/png.5
+++ b/png.5
@@ -1,4 +1,4 @@
-.TH PNG 5 "February 24, 2002"
+.TH PNG 5 "March 7, 2002"
 .SH NAME
 png \- Portable Network Graphics (PNG) format
 .SH DESCRIPTION
diff --git a/png.c b/png.c
index ee86986..3cf55b2 100644
--- a/png.c
+++ b/png.c
@@ -1,7 +1,7 @@
 
 /* png.c - location for general purpose libpng functions
  *
- * libpng version 1.2.2beta2 - February 24, 2002
+ * libpng version 1.2.2beta3 - March 7, 2002
  * Copyright (c) 1998-2002 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.)
@@ -13,14 +13,14 @@
 #include "png.h"
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_2_2beta2 Your_png_h_is_not_version_1_2_2beta2;
+typedef version_1_2_2beta3 Your_png_h_is_not_version_1_2_2beta3;
 
 /* Version information for C files.  This had better match the version
  * string defined in png.h.  */
 
 #ifdef PNG_USE_GLOBAL_ARRAYS
 /* png_libpng_ver was changed to a function in version 1.0.5c */
-const char png_libpng_ver[18] = "1.2.2beta2";
+const char png_libpng_ver[18] = "1.2.2beta3";
 
 /* png_sig was changed to a function in version 1.0.5c */
 /* Place to hold the signature string for a PNG file. */
@@ -135,7 +135,7 @@
 }
 
 /* Function to allocate memory for zlib and clear it to 0. */
-voidpf /* PRIVATE */
+voidpf PNGAPI
 png_zalloc(voidpf png_ptr, uInt items, uInt size)
 {
    png_uint_32 num_bytes = (png_uint_32)items * size;
@@ -163,7 +163,7 @@
 }
 
 /* function to free memory for zlib */
-void /* PRIVATE */
+void PNGAPI
 png_zfree(voidpf png_ptr, voidpf ptr)
 {
    png_free((png_structp)png_ptr, (png_voidp)ptr);
@@ -351,6 +351,9 @@
 {
     png_free(png_ptr, info_ptr->trans);
     info_ptr->valid &= ~PNG_INFO_tRNS;
+#ifndef PNG_FREE_ME_SUPPORTED
+    png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;
+#endif
     info_ptr->trans = NULL;
 }
 #endif
@@ -494,6 +497,9 @@
     png_free(png_ptr, info_ptr->hist);
     info_ptr->hist = NULL;
     info_ptr->valid &= ~PNG_INFO_hIST;
+#ifndef PNG_FREE_ME_SUPPORTED
+    png_ptr->flags &= ~PNG_FLAG_FREE_HIST;
+#endif
 }
 #endif
 
@@ -507,6 +513,9 @@
     png_zfree(png_ptr, info_ptr->palette);
     info_ptr->palette = NULL;
     info_ptr->valid &= ~PNG_INFO_PLTE;
+#ifndef PNG_FREE_ME_SUPPORTED
+    png_ptr->flags &= ~PNG_FLAG_FREE_PLTE;
+#endif
     info_ptr->num_palette = 0;
 }
 
@@ -651,7 +660,7 @@
 png_get_copyright(png_structp png_ptr)
 {
    if (png_ptr != NULL || png_ptr == NULL)  /* silence compiler warning */
-   return ((png_charp) "\n libpng version 1.2.2beta2 - February 24, 2002\n\
+   return ((png_charp) "\n libpng version 1.2.2beta3 - March 7, 2002\n\
    Copyright (c) 1998-2002 Glenn Randers-Pehrson\n\
    Copyright (c) 1996, 1997 Andreas Dilger\n\
    Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n");
@@ -669,8 +678,8 @@
 {
    /* Version of *.c files used when building libpng */
    if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
-      return((png_charp) "1.2.2beta2");
-   return((png_charp) "1.2.2beta2");
+      return((png_charp) "1.2.2beta3");
+   return((png_charp) "1.2.2beta3");
 }
 
 png_charp PNGAPI
@@ -692,7 +701,7 @@
 }
 
 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-int /* PRIVATE */
+int PNGAPI
 png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name)
 {
    /* check chunk_name and return "keep" value if it's on the list, else 0 */
diff --git a/png.h b/png.h
index 5a86233..4dc3f91 100644
--- a/png.h
+++ b/png.h
@@ -1,7 +1,7 @@
 
 /* png.h - header file for PNG reference library
  *
- * libpng version 1.2.2beta2 - February 24, 2002
+ * libpng version 1.2.2beta3 - March 7, 2002
  * Copyright (c) 1998-2002 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.2.2beta2 - February 24, 2002: Glenn
+ *  libpng versions 0.97, January 1998, through 1.2.2beta3 - March 7, 2002: Glenn
  *  See also "Contributing Authors", below.
  *
  * Note about libpng version numbers:
@@ -81,7 +81,7 @@
  *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4
  *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2
  *    1.2.1                    3    10201  3.1.2.1
- *    1.2.2beta1-2            12    10202  12.so.0.1.2.2beta1-2
+ *    1.2.2beta1-3            12    10202  12.so.0.1.2.2beta1-3
  *
  *    Henceforth the source version will match the shared-library major
  *    and minor numbers; the shared-library major version number will be
@@ -111,7 +111,7 @@
  * If you modify libpng you may insert additional notices immediately following
  * this sentence.
  *
- * libpng versions 1.0.7, July 1, 2000, through  1.2.2beta2, February 24, 2002, are
+ * libpng versions 1.0.7, July 1, 2000, through  1.2.2beta3, March 7, 2002, are
  * Copyright (c) 2000, 2002 Glenn Randers-Pehrson, and are
  * distributed according to the same disclaimer and license as libpng-1.0.6
  * with the following individuals added to the list of Contributing Authors
@@ -216,13 +216,13 @@
  * Y2K compliance in libpng:
  * =========================
  *
- *    February 24, 2002
+ *    March 7, 2002
  *
  *    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.2.2beta2 are Y2K compliant.  It is my belief that earlier
+ *    upward through 1.2.2beta3 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
@@ -278,7 +278,7 @@
  */
 
 /* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.2.2beta2"
+#define PNG_LIBPNG_VER_STRING "1.2.2beta3"
 
 #define PNG_LIBPNG_VER_SONUM   0
 #define PNG_LIBPNG_VER_DLLNUM  %DLLNUM%
@@ -290,7 +290,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  2
+#define PNG_LIBPNG_VER_BUILD  3
 
 #define PNG_LIBPNG_BUILD_ALPHA    1
 #define PNG_LIBPNG_BUILD_BETA     2
@@ -1254,9 +1254,9 @@
 
 
 /* This prevents a compiler error in png_get_copyright() in png.c if png.c
-   and png.h are both at version 1.2.2beta2
+   and png.h are both at version 1.2.2beta3
  */
-typedef png_structp version_1_2_2beta2;
+typedef png_structp version_1_2_2beta3;
 
 typedef png_struct FAR * FAR * png_structpp;
 
@@ -1564,9 +1564,6 @@
 extern PNG_EXPORT(void,png_destroy_write_struct)
    PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
 
-/* free any memory used in info_ptr struct (old method - NOT DLL EXPORTED) */
-extern void png_write_destroy_info PNGARG((png_infop info_ptr));
-
 /* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
 extern void png_write_destroy PNGARG((png_structp png_ptr));
 
@@ -1811,6 +1808,13 @@
 /* frees a pointer allocated by png_malloc() */
 extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
 
+/* Function to allocate memory for zlib. */
+extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items,
+   uInt size));
+
+/* Function to free memory for zlib */
+extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr));
+
 /* Free data that was allocated internally */
 extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
    png_infop info_ptr, png_uint_32 free_me, int num));
@@ -2218,6 +2222,10 @@
 extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
    png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
 #endif
+#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
+   chunk_name));
+#endif
 
 /* Png_free_data() will turn off the "valid" flag for anything it frees.
    If you need to turn it off for a chunk that your application has freed,
@@ -2373,7 +2381,7 @@
 /* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
 
 #define PNG_HEADER_VERSION_STRING \
-   " libpng version 1.2.2beta2 - February 24, 2002 (header)\n"
+   " libpng version 1.2.2beta3 - March 7, 2002 (header)\n"
 
 #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
 /* With these routines we avoid an integer divide, which will be slower on
@@ -2642,12 +2650,6 @@
 PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
    png_infop info_ptr));
 
-/* Function to allocate memory for zlib. */
-PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size));
-
-/* Function to free memory for zlib */
-PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
-
 /* Reset the CRC variable */
 PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
 
@@ -3110,11 +3112,6 @@
    png_uint_32 length));
 #endif
 
-#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-PNG_EXTERN int png_handle_as_unknown PNGARG((png_structp png_ptr, png_bytep
-   chunk_name));
-#endif
-
 PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
    png_infop info_ptr, png_uint_32 length));
 
diff --git a/pngasmrd.h b/pngasmrd.h
index 1a19bee..62ec1fb 100644
--- a/pngasmrd.h
+++ b/pngasmrd.h
@@ -1,6 +1,6 @@
 /* pngasmrd.h - assembler version of utilities to read a PNG file
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 2002 Glenn Randers-Pehrson
  *
diff --git a/pngconf.h b/pngconf.h
index e84fd84..c78388d 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1,6 +1,6 @@
 /* pngconf.h - machine configurable file for libpng
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngerror.c b/pngerror.c
index fcb19bb..cf2d1d3 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -1,7 +1,7 @@
 
 /* pngerror.c - stub functions for i/o and memory allocation
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pnggccrd.c b/pnggccrd.c
index 6ea8df1..cd109d2 100644
--- a/pnggccrd.c
+++ b/pnggccrd.c
@@ -6,7 +6,7 @@
  *     and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
  *     for Intel's performance analysis of the MMX vs. non-MMX code.
  *
- * libpng version 1.2.2beta2 - February 24, 2002
+ * libpng version 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * Copyright (c) 1998, Intel Corporation
@@ -220,6 +220,9 @@
  * 20010310:
  *  - fixed buffer-overrun bug in png_combine_row() C code (non-MMX)
  *
+ * 20020304:
+ *  - eliminated incorrect use of width_mmx in pixel_bytes == 8 case
+ *
  * STILL TO DO:
  *     - test png_do_read_interlace() 64-bit case (pixel_bytes == 8)
  *     - write MMX code for 48-bit case (pixel_bytes == 6)
@@ -2464,9 +2467,8 @@
                   {
                      // source is 8-byte RRGGBBAA
                      // dest is 32-byte RRGGBBAA RRGGBBAA RRGGBBAA RRGGBBAA
-                     int width_mmx = ((width >> 1) << 1) ;
-                     width -= width_mmx;
-                     if (width_mmx)
+                     // (recall that expansion is _in place_:  sptr and dp
+                     //  both point at locations within same row buffer)
                      {
                         int dummy_value_c;  // fix 'forbidden register spilled'
                         int dummy_value_S;
@@ -2505,9 +2507,6 @@
                   {
                      // source is 8-byte RRGGBBAA
                      // dest is 16-byte RRGGBBAA RRGGBBAA
-                     int width_mmx = ((width >> 1) << 1) ;
-                     width -= width_mmx;
-                     if (width_mmx)
                      {
                         int dummy_value_c;  // fix 'forbidden register spilled'
                         int dummy_value_S;
diff --git a/pngget.c b/pngget.c
index c573a49..ad1c558 100644
--- a/pngget.c
+++ b/pngget.c
@@ -1,7 +1,7 @@
 
 /* pngget.c - retrieval of values from info struct
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngmem.c b/pngmem.c
index 1467c60..588058a 100644
--- a/pngmem.c
+++ b/pngmem.c
@@ -1,7 +1,7 @@
 
 /* pngmem.c - stub functions for memory allocation
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngpread.c b/pngpread.c
index 049a77d..2c6e030 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -1,7 +1,7 @@
 
 /* pngpread.c - read a png file in push mode
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngread.c b/pngread.c
index d639b84..b38b6bb 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1,7 +1,7 @@
 
 /* pngread.c - read a PNG file
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -774,7 +774,7 @@
  * not called png_set_interlace_handling(), the display_row buffer will
  * be ignored, so pass NULL to it.
  *
- * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.2beta2
+ * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.2beta3
  */
 
 void PNGAPI
@@ -823,7 +823,7 @@
  * only call this function once.  If you desire to have an image for
  * each pass of a interlaced image, use png_read_rows() instead.
  *
- * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.2beta2
+ * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.2beta3
  */
 void PNGAPI
 png_read_image(png_structp png_ptr, png_bytepp image)
diff --git a/pngrio.c b/pngrio.c
index 3498411..2e4d3af 100644
--- a/pngrio.c
+++ b/pngrio.c
@@ -1,7 +1,7 @@
 
 /* pngrio.c - functions for data input
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngrtran.c b/pngrtran.c
index 94216b2..4b76c18 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1,7 +1,7 @@
 
 /* pngrtran.c - transforms the data in a row for PNG readers
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngrutil.c b/pngrutil.c
index d85c301..01d489b 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -1,7 +1,7 @@
 
 /* pngrutil.c - utilities to read a PNG file
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngset.c b/pngset.c
index 1d640c4..025c93d 100644
--- a/pngset.c
+++ b/pngset.c
@@ -1,7 +1,7 @@
 
 /* pngset.c - storage of image information into info struct
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngtest.c b/pngtest.c
index 528ab93..2c26962 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1,7 +1,7 @@
 
 /* pngtest.c - a simple test program to test libpng
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -1512,4 +1512,4 @@
 }
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_2_2beta2 your_png_h_is_not_version_1_2_2beta2;
+typedef version_1_2_2beta3 your_png_h_is_not_version_1_2_2beta3;
diff --git a/pngtrans.c b/pngtrans.c
index dbbc130..7afc998 100644
--- a/pngtrans.c
+++ b/pngtrans.c
@@ -1,7 +1,7 @@
 
 /* pngtrans.c - transforms the data in a row (used by both readers and writers)
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngvcrd.c b/pngvcrd.c
index ccfe9c4..6bd544b 100644
--- a/pngvcrd.c
+++ b/pngvcrd.c
@@ -2,7 +2,7 @@
  *
  * For Intel x86 CPU and Microsoft Visual C++ compiler
  *
- * libpng version 1.2.2beta2 - February 24, 2002
+ * libpng version 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * Copyright (c) 1998, Intel Corporation
diff --git a/pngwio.c b/pngwio.c
index 8861e6b..d591cb9 100644
--- a/pngwio.c
+++ b/pngwio.c
@@ -1,7 +1,7 @@
 
 /* pngwio.c - functions for data output
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngwrite.c b/pngwrite.c
index ba68cd9..bb92110 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -1,7 +1,7 @@
 
 /* pngwrite.c - general routines to write a PNG file
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngwtran.c b/pngwtran.c
index 33692e2..c285b94 100644
--- a/pngwtran.c
+++ b/pngwtran.c
@@ -1,7 +1,7 @@
 
 /* pngwtran.c - transforms the data in a row for PNG writers
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngwutil.c b/pngwutil.c
index c63eeb4..66b34ee 100644
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -1,7 +1,7 @@
 
 /* pngwutil.c - utilities to write a PNG file
  *
- * libpng 1.2.2beta2 - February 24, 2002
+ * libpng 1.2.2beta3 - March 7, 2002
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2002 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/projects/msvc/README.txt b/projects/msvc/README.txt
index 8f3ad2d..1d1199e 100644
--- a/projects/msvc/README.txt
+++ b/projects/msvc/README.txt
@@ -1,5 +1,5 @@
 Microsoft Developer Studio Build File, Format Version 6.00 for
-libpng 1.2.2beta2 (February 24, 2002) and zlib
+libpng 1.2.2beta3 (March 7, 2002) and zlib
 
 Copyright (C) 2000 Simon-Pierre Cadieux
 For conditions of distribution and use, see copyright notice in png.h
diff --git a/projects/msvc/png32ms.def b/projects/msvc/png32ms.def
index 11917a0..a1c9d25 100644
--- a/projects/msvc/png32ms.def
+++ b/projects/msvc/png32ms.def
@@ -6,7 +6,7 @@
 DESCRIPTION "PNG image compression library for Windows"
 
 EXPORTS
-;Version 1.2.2beta2
+;Version 1.2.2beta3
   png_build_grayscale_palette  @1
   png_check_sig        @2
   png_chunk_error      @3
@@ -211,3 +211,7 @@
   png_init_mmx_flags  @192
 ; Strip error numbers
   png_set_strip_error_numbers @193
+; Added at version 1.2.2
+  png_handle_as_unknown @194
+  png_zalloc @195
+  png_zfree @196
diff --git a/projects/netware.txt b/projects/netware.txt
index ef7a925..db93398 100644
--- a/projects/netware.txt
+++ b/projects/netware.txt
@@ -1,6 +1,6 @@
 A set of project files is available for Netware.  Get
-libpng-1.2.2beta2-project-netware.zip from a libpng distribution
+libpng-1.2.2beta3-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.2beta2-project-netware.zip"
+"unzip -a libpng-1.2.2beta3-project-netware.zip"
diff --git a/projects/wince.txt b/projects/wince.txt
index eb070b7..23e2cf6 100644
--- a/projects/wince.txt
+++ b/projects/wince.txt
@@ -1,6 +1,6 @@
 A set of project files is available for WinCE.  Get
-libpng-1.2.2beta2-project-wince.zip from a libpng distribution
+libpng-1.2.2beta3-project-wince.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.2beta2-project-wince.zip"
+"unzip -a libpng-1.2.2beta3-project-wince.zip"
diff --git a/scripts/libpng.pc.in b/scripts/libpng.pc.in
new file mode 100644
index 0000000..82c4f66
--- /dev/null
+++ b/scripts/libpng.pc.in
@@ -0,0 +1,11 @@
+
+prefix=@PREFIX@
+exec_prefix=$(prefix)
+libdir=$(exec_prefix)/lib
+includedir=$(exec_prefix)/include
+
+Name: libpng12
+Description: Loads and saves PNG files
+Version: 1.2.2beta3
+Libs: -L$(libdir) -lpng12
+Cflags: -I$(includedir)/libpng12
diff --git a/scripts/makefile.32sunu b/scripts/makefile.32sunu
new file mode 100644
index 0000000..cf6bcdd
--- /dev/null
+++ b/scripts/makefile.32sunu
@@ -0,0 +1,142 @@
+# makefile for libpng on Solaris 2.x with gcc
+# Contributed by William L. Sebok, based on makefile.linux
+# Copyright (C) 2002 Glenn Randers-Pehrson
+# Copyright (C) 1998 Greg Roelofs
+# Copyright (C) 1996, 1997 Andreas Dilger
+# For conditions of distribution and use, see copyright notice in png.h
+
+CC=cc
+SUN_CC_FLAGS=-fast -xtarget=ultra
+SUN_LD_FLAGS=-fast -xtarget=ultra
+
+# where make install puts libpng.a, libpng12.so and libpng12/png.h
+prefix=/a
+
+# Where the zlib library and include files are located
+# Changing these to ../zlib poses a security risk.  If you want
+# to have zlib in an adjacent directory, specify the full path instead of "..".
+#ZLIBLIB=../zlib
+#ZLIBINC=../zlib
+
+ZLIBLIB=/usr/lib
+ZLIBINC=/usr/include
+
+WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
+	-Wmissing-declarations -Wtraditional -Wcast-align \
+	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \
+	# $(WARNMORE) -g -DPNG_DEBUG=5
+LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
+
+#RANLIB=ranlib
+RANLIB=echo
+
+LIBNAME=libpng12
+PNGMAJ = 0
+PNGMIN = 1.2.2beta3
+PNGVER = $(PNGMAJ).$(PNGMIN)
+
+INCPATH=$(prefix)/include
+LIBPATH=$(prefix)/lib
+
+OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
+	pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
+	pngwtran.o pngmem.o pngerror.o pngpread.o
+
+OBJSDLL = $(OBJS:.o=.pic.o)
+
+.SUFFIXES:      .c .o .pic.o
+
+.c.pic.o:
+	$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
+
+all: libpng.a $(LIBNAME).so pngtest
+
+libpng.a: $(OBJS)
+	ar rc $@ $(OBJS)
+	$(RANLIB) $@
+
+$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
+	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
+
+$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
+	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
+
+$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
+	@case "`type ld`" in *ucb*) \
+	echo; \
+	echo '## WARNING:'; \
+	echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
+	echo '## and /usr/ucb/ld.  If they do, you need to adjust your PATH'; \
+	echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
+	echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
+	echo '## at all.  If it is, things are likely to break because of'; \
+	echo '## the libucb dependency that is created.'; \
+	echo; \
+	;; \
+	esac
+	$(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \
+	 -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -lz
+
+pngtest: pngtest.o $(LIBNAME).so
+	$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
+
+test: pngtest
+	./pngtest
+
+install-headers: png.h pngconf.h
+	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
+	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
+	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
+	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
+	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
+	ln -f -s $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
+	ln -f -s $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	cp libpng.a $(LIBPATH)/$(LIBNAME).a
+	chmod 644 $(LIBPATH)/$(LIBNAME).a
+	-@/bin/rm -f $(LIBPATH)/libpng.a
+	ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
+	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
+	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
+	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
+	(cd $(LIBPATH);
+	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
+	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+clean:
+	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
+
+DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
+writelock:
+	chmod a-w *.[ch35] $(DOCS) scripts/*
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+png.o png.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
diff --git a/scripts/makefile.64sunu b/scripts/makefile.64sunu
new file mode 100644
index 0000000..a89cbaf
--- /dev/null
+++ b/scripts/makefile.64sunu
@@ -0,0 +1,142 @@
+# makefile for libpng on Solaris 2.x with gcc
+# Contributed by William L. Sebok, based on makefile.linux
+# Copyright (C) 2002 Glenn Randers-Pehrson
+# Copyright (C) 1998 Greg Roelofs
+# Copyright (C) 1996, 1997 Andreas Dilger
+# For conditions of distribution and use, see copyright notice in png.h
+
+CC=cc
+SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
+SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
+
+# where make install puts libpng.a, libpng12.so and libpng12/png.h
+prefix=/a
+
+# Where the zlib library and include files are located
+# Changing these to ../zlib poses a security risk.  If you want
+# to have zlib in an adjacent directory, specify the full path instead of "..".
+#ZLIBLIB=../zlib
+#ZLIBINC=../zlib
+
+ZLIBLIB=/usr/lib
+ZLIBINC=/usr/include
+
+WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
+	-Wmissing-declarations -Wtraditional -Wcast-align \
+	-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
+CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \
+	# $(WARNMORE) -g -DPNG_DEBUG=5
+LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
+
+#RANLIB=ranlib
+RANLIB=echo
+
+LIBNAME=libpng12
+PNGMAJ = 0
+PNGMIN = 1.2.2beta3
+PNGVER = $(PNGMAJ).$(PNGMIN)
+
+INCPATH=$(prefix)/include
+LIBPATH=$(prefix)/lib
+
+OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
+	pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
+	pngwtran.o pngmem.o pngerror.o pngpread.o
+
+OBJSDLL = $(OBJS:.o=.pic.o)
+
+.SUFFIXES:      .c .o .pic.o
+
+.c.pic.o:
+	$(CC) -c $(CFLAGS) -KPIC -o $@ $*.c
+
+all: libpng.a $(LIBNAME).so pngtest
+
+libpng.a: $(OBJS)
+	ar rc $@ $(OBJS)
+	$(RANLIB) $@
+
+$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
+	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
+
+$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
+	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
+
+$(LIBNAME).so.$(PNGVER): $(OBJSDLL)
+	@case "`type ld`" in *ucb*) \
+	echo; \
+	echo '## WARNING:'; \
+	echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
+	echo '## and /usr/ucb/ld.  If they do, you need to adjust your PATH'; \
+	echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
+	echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
+	echo '## at all.  If it is, things are likely to break because of'; \
+	echo '## the libucb dependency that is created.'; \
+	echo; \
+	;; \
+	esac
+	$(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \
+	 -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) -lz
+
+pngtest: pngtest.o $(LIBNAME).so
+	$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
+
+test: pngtest
+	./pngtest
+
+install-headers: png.h pngconf.h
+	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
+	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
+	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
+	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
+	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
+	ln -f -s $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
+	ln -f -s $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	cp libpng.a $(LIBPATH)/$(LIBNAME).a
+	chmod 644 $(LIBPATH)/$(LIBNAME).a
+	-@/bin/rm -f $(LIBPATH)/libpng.a
+	ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
+	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
+	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
+	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
+	(cd $(LIBPATH);
+	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
+	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+clean:
+	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
+
+DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
+writelock:
+	chmod a-w *.[ch35] $(DOCS) scripts/*
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+png.o png.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
diff --git a/scripts/makefile.aix b/scripts/makefile.aix
index 94ed707..6f6835d 100644
--- a/scripts/makefile.aix
+++ b/scripts/makefile.aix
@@ -18,7 +18,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 0.  You should not
 # have to change it.
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 prefix=/usr/local
diff --git a/scripts/makefile.beos b/scripts/makefile.beos
index b26584d..46cba9f 100644
--- a/scripts/makefile.beos
+++ b/scripts/makefile.beos
@@ -14,7 +14,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 0.  You should not
 # have to change it.
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 ALIGN=
@@ -73,32 +73,37 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
-
-install: libpng.a $(LIBNAME).so.$(PNGVER)
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
 	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
 	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
 	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
 	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
-	(cd $(LIBPATH); ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
-	 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	(cd $(LIBPATH);
+	ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
+	ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
diff --git a/scripts/makefile.cygwin b/scripts/makefile.cygwin
index 977259a..46c326f 100644
--- a/scripts/makefile.cygwin
+++ b/scripts/makefile.cygwin
@@ -39,7 +39,7 @@
 # have to change it.
 PNGMAJ = 0
 #PNGDLL = $12
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGMIN_BASE = 1.2.2
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
diff --git a/scripts/makefile.darwin b/scripts/makefile.darwin
index 23ed83f..d109349 100644
--- a/scripts/makefile.darwin
+++ b/scripts/makefile.darwin
@@ -25,7 +25,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 0.  You should not
 # have to change it.
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -68,27 +68,25 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
-
-install: libpng.a $(LIBNAME).dylib
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
 	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
 	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
 	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).dylib
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*.dylib
 	cp $(LIBNAME).$(PNGVER).dylib $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).$(PNGVER).dylib
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).$(PNGMAJ)*.dylib
@@ -96,6 +94,12 @@
 	(cd $(LIBPATH);
 	ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib; \
 	ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	rm -f *.o libpng.a $(LIBNAME).*dylib pngtest pngout.png
diff --git a/scripts/makefile.dec b/scripts/makefile.dec
index 576386a..fe7bc20 100644
--- a/scripts/makefile.dec
+++ b/scripts/makefile.dec
@@ -17,7 +17,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 0.  You should not
 # have to change it.
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -53,34 +53,37 @@
 test: pngtest
 	./pngtest
 
-
-install-static: libpng.a
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
-
-install: libpng.a $(LIBNAME).so.$(PNGVER)
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	ln -f -s $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
-	ln -f -s $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
+	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
-	ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
 	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
-	(cd $(LIBPATH); \
-	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
-	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	(cd $(LIBPATH);
+	ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
+	ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
diff --git a/scripts/makefile.gcmmx b/scripts/makefile.gcmmx
index f9261f3..3a947ae 100644
--- a/scripts/makefile.gcmmx
+++ b/scripts/makefile.gcmmx
@@ -15,7 +15,7 @@
 
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 CC=gcc
@@ -112,34 +112,41 @@
 	@echo ""
 	./pngtest-static
 
-install-static: libpng.a
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
-
-install: libpng.a $(LIBNAME).so.$(PNGVER)
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
 	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
 	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
 	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
 	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
-	(cd $(LIBPATH); ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
-	 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	(cd $(LIBPATH);
+	ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
+	ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
+
 clean:
-	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
+	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
+	pngtest pngout.png
 
 DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
 writelock:
diff --git a/scripts/makefile.hpgcc b/scripts/makefile.hpgcc
index 7bf3427..504a14f 100644
--- a/scripts/makefile.hpgcc
+++ b/scripts/makefile.hpgcc
@@ -35,7 +35,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 0.  You should not
 # have to change it.
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -75,32 +75,38 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
 
-install: libpng.a $(LIBNAME).sl.$(PNGVER)
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
 	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
 	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
 	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).sl.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.sl.3*
 	cp $(LIBNAME).sl.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).sl.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).sl.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).sl
-	(cd $(LIBPATH); ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
-	 ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
+	(cd $(LIBPATH);
+	ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
+	ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	/bin/rm -f *.o libpng.a $(SHAREDLIB).sl $(SHAREDLIB).sl.$(PNGMAJ)* \
diff --git a/scripts/makefile.hpux b/scripts/makefile.hpux
index a835f25..de0e4da 100644
--- a/scripts/makefile.hpux
+++ b/scripts/makefile.hpux
@@ -19,7 +19,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 0.  You should not
 # have to change it.
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -46,10 +46,10 @@
 	$(RANLIB) $@
 
 $(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ)
-	ln -f -s $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
+	ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl
 
 $(LIBNAME).sl.$(PNGMAJ): $(LIBNAME).sl.$(PNGVER)
-	ln -f -s $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ)
+	ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ)
 
 $(LIBNAME).sl.$(PNGVER): $(OBJSDLL)
 	$(LD) -b -L$(ZLIBLIB) +s +b $(ZLIBLIB) \
@@ -62,33 +62,37 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
-
-install: libpng.a $(LIBNAME).sl.$(PNGVER)
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	ln -f -s $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
-	ln -f -s $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
+	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
-	ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).sl.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.sl.3*
 	cp $(LIBNAME).sl.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).sl.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).sl.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).sl
-	(cd $(LIBPATH); \
-	ln -f -s $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
-	ln -f -s $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
+	(cd $(LIBPATH);
+	ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \
+	ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	/bin/rm -f *.o libpng.a $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \
diff --git a/scripts/makefile.linux b/scripts/makefile.linux
index b3fc68e..f7f582d 100644
--- a/scripts/makefile.linux
+++ b/scripts/makefile.linux
@@ -5,7 +5,7 @@
 
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 CC=gcc
@@ -86,32 +86,38 @@
 	@echo ""
 	./pngtest-static
 
-install-static: libpng.a
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
-
-install: libpng.a $(LIBNAME).so.$(PNGVER)
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
 	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
 	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
 	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
 	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
-	(cd $(LIBPATH); ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
-	 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	(cd $(LIBPATH);
+	ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
+	ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
+
 
 clean:
 	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNMAJ)* \
diff --git a/scripts/makefile.macosx b/scripts/makefile.macosx
index 5dfaf56..892da2c 100644
--- a/scripts/makefile.macosx
+++ b/scripts/makefile.macosx
@@ -20,7 +20,7 @@
 LDSHARED=cc -lz -dynamiclib -compatibility_version $(VER) -current_version $(VER)
 
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 VER = $(PNGMAJ).$(PNGMIN)
 LIBNAME=libpng12
 SHAREDLIB_POSTFIX=dylib
@@ -51,27 +51,26 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
 
-install: libpng.a $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
 	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
 	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
 	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.3*$(SHAREDLIB_POSTFIX)
 	cp $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).$(PNGMAJ)*.$(SHAREDLIB_POSTFIX)
@@ -80,6 +79,12 @@
 	$(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX); \
 	ln -sf $(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX) \
 	$(LIBNAME).$(SHAREDLIB_POSTFIX))
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-shared
 
 clean:
 	rm -f *.o libpng.a pngtest pngout.png \
diff --git a/scripts/makefile.netbsd b/scripts/makefile.netbsd
index 45e8c3c..7e711ea 100644
--- a/scripts/makefile.netbsd
+++ b/scripts/makefile.netbsd
@@ -13,7 +13,7 @@
 LIB=png
 # Shared lib name should be png12.
 SHLIB_MAJOR= 0
-SHLIB_MINOR= 1.2.2beta2
+SHLIB_MINOR= 1.2.2beta3
 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
diff --git a/scripts/makefile.openbsd b/scripts/makefile.openbsd
new file mode 100644
index 0000000..e9f6cc7
--- /dev/null
+++ b/scripts/makefile.openbsd
@@ -0,0 +1,68 @@
+# makefile for libpng
+# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
+# For conditions of distribution and use, see copyright notice in png.h
+
+PREFIX?= /usr/local
+LIBDIR=	${PREFIX}/lib
+MANDIR= ${PREFIX}/man/cat
+
+SHLIB_MAJOR=	3
+SHLIB_MINOR=	0
+
+LIB=	png
+SRCS=	png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
+	pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \
+	pngwio.c pngwrite.c pngwtran.c pngwutil.c
+
+HDRS=	png.h pngconf.h
+
+CFLAGS+= -Wall
+CPPFLAGS+= -I${.CURDIR} -DPNG_NO_ASSEMBLER_CODE -DPNG_USE_PNGGCCRD
+
+NOPROFILE= Yes
+
+CLEANFILES+= pngtest.o pngtest
+
+MAN=	libpng.3 libpngpf.3 png.5
+DOCS=	ANNOUNCE CHANGES LICENSE README libpng.txt
+
+pngtest.o:	pngtest.c
+	${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
+
+pngtest:	pngtest.o
+	${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm
+
+test:	pngtest
+	cd ${.OBJDIR} && env \
+		LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest
+
+beforeinstall:
+	if [ ! -d ${DESTDIR}${PREFIX}/include ]; then \
+	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \
+	fi
+	if [ ! -d ${DESTDIR}${LIBDIR} ]; then \
+	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \
+	fi
+	if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \
+	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \
+	fi
+	if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \
+	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \
+	fi
+	if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \
+	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \
+	fi
+	if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \
+	  ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \
+	fi
+
+afterinstall:
+	@rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a
+	@rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a
+	@rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true
+	${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
+		-m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include
+	${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \
+		-m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png
+
+.include <bsd.lib.mk>
diff --git a/scripts/makefile.sco b/scripts/makefile.sco
index ff7fb37..757f32a 100644
--- a/scripts/makefile.sco
+++ b/scripts/makefile.sco
@@ -25,7 +25,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 0.  You should not
 # have to change it.
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -65,33 +65,38 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
 
-install: libpng.a $(LIBNAME).so.$(PNGVER)
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
 	ln -f -s $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
 	ln -f -s $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
 	ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
 	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
-	(cd $(LIBPATH); \
+	(cd $(LIBPATH);
 	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
 	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest pngout.png
diff --git a/scripts/makefile.sggcc b/scripts/makefile.sggcc
index 50912e2..3127b3a 100644
--- a/scripts/makefile.sggcc
+++ b/scripts/makefile.sggcc
@@ -24,7 +24,7 @@
 LDSHARED=CC $(ABI) -shared
 
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 # See "man dso" for info about shared objects
 LIBS=libpng12.so.$(PNGMAJ).$(PNGVER)
@@ -56,34 +56,38 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
 
-install: libpng.a $(LIBNAME).so.$(PNGVER)
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
-	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+	ln -f -s $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
+	ln -f -s $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
-	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+	ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
 	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
-	(cd $(LIBPATH); ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
-	 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
-	(ldconfig || true)  >/dev/null 2>&1; \
-	fi)
+	(cd $(LIBPATH);
+	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
+	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	rm -f *.o libpng.a pngtest pngout.png
diff --git a/scripts/makefile.sgi b/scripts/makefile.sgi
index 1618ae7..c49a659 100644
--- a/scripts/makefile.sgi
+++ b/scripts/makefile.sgi
@@ -31,7 +31,7 @@
 # See "man dso" for info about shared objects
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 RANLIB=echo
@@ -65,32 +65,37 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
-
-install: libpng.a $(LIBNAME).so.$(PNGVER)
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	ln -sf $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
-	ln -sf $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+	ln -f -s $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
+	ln -f -s $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
-	ln -sf $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+	ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
 	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
-	(cd $(LIBPATH); ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
-	 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	(cd $(LIBPATH);
+	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
+	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	rm -f *.o libpng.a pngtest pngout.png $(LIBNAME).so \
diff --git a/scripts/makefile.so9 b/scripts/makefile.so9
index af421f5..a134bfe 100644
--- a/scripts/makefile.so9
+++ b/scripts/makefile.so9
@@ -35,7 +35,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 0.  You should not
 # have to change it.
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -87,33 +87,37 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
-
-install: libpng.a $(LIBNAME).so.$(PNGVER)
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
 	ln -f -s $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
 	ln -f -s $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
 	ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
 	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
-	(cd $(LIBPATH); \
+	(cd $(LIBPATH);
 	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
 	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
diff --git a/scripts/makefile.solaris b/scripts/makefile.solaris
index 4a9cafc..28a148b 100644
--- a/scripts/makefile.solaris
+++ b/scripts/makefile.solaris
@@ -32,7 +32,7 @@
 # read libpng.txt or png.h to see why PNGMAJ is 0.  You should not
 # have to change it.
 PNGMAJ = 0
-PNGMIN = 1.2.2beta2
+PNGMIN = 1.2.2beta3
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
@@ -84,33 +84,37 @@
 test: pngtest
 	./pngtest
 
-install-static: libpng.a
+install-headers: png.h pngconf.h
 	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
-	cp png.h pngconf.h $(INCPATH)
-	chmod 644 $(INCPATH)/png.h $(INCPATH)/pngconf.h
-	cp libpng.a $(LIBPATH)
-	chmod 644 $(LIBPATH)/libpng.a
-
-install: libpng.a $(LIBNAME).so.$(PNGVER)
-	-@if [ ! -d $(INCPATH) ]; then mkdir $(INCPATH); fi
-	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	-@if [ ! -d $(INCPATH)/$(LIBNAME) ]; then mkdir $(INCPATH)/$(LIBNAME); fi
 	cp png.h pngconf.h $(INCPATH)/$(LIBNAME)
 	chmod 644 $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)/$(LIBNAME)/pngconf.h
 	-@/bin/rm -f $(INCPATH)/png.h $(INCPATH)/pngconf.h
 	ln -f -s $(INCPATH)/$(LIBNAME)/png.h $(INCPATH)
 	ln -f -s $(INCPATH)/$(LIBNAME)/pngconf.h $(INCPATH)
+
+install-static: install-headers libpng.a
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
 	cp libpng.a $(LIBPATH)/$(LIBNAME).a
 	chmod 644 $(LIBPATH)/$(LIBNAME).a
 	-@/bin/rm -f $(LIBPATH)/libpng.a
 	ln -f -s $(LIBPATH)/$(LIBNAME).a $(LIBPATH)/libpng.a
+
+install-shared: install-headers $(LIBNAME).so.$(PNGVER)
+	-@if [ ! -d $(LIBPATH) ]; then mkdir $(LIBPATH); fi
+	-@/bin/rm -f $(LIBPATH)/libpng.so.3*
 	cp $(LIBNAME).so.$(PNGVER) $(LIBPATH)
 	chmod 755 $(LIBPATH)/$(LIBNAME).so.$(PNGVER)
 	-@/bin/rm -f $(LIBPATH)/$(LIBNAME).so.$(PNGMAJ)* $(LIBPATH)/$(LIBNAME).so
 	(cd $(LIBPATH);
 	ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
 	ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
+	-@if [ ! -d $(LIBPATH)/pkgconfig ]; then mkdir $(LIBPATH)/pkgconfig; fi
+	cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
+	cp libpng.pc $(LIBPATH)/pkgconfig/libpng12.pc
+	chmod 644 $(LIBPATH)/pkgconfig/libpng12.pc
+
+install: install-static install-shared
 
 clean:
 	/bin/rm -f *.o libpng.a $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \
diff --git a/scripts/pngdef.pas b/scripts/pngdef.pas
index db50439..fa54072 100644
--- a/scripts/pngdef.pas
+++ b/scripts/pngdef.pas
@@ -1,13 +1,13 @@
 unit pngdef;
 
 // Caution: this file has fallen out of date since version 1.0.5.  Write to
-// png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu about bringing
-// it up to date.
+// png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu about volunteering
+// to it up to date.
 
 interface
 
 const
-  PNG_LIBPNG_VER_STRING = '1.2.2beta2';
+  PNG_LIBPNG_VER_STRING = '1.2.2beta3';
   PNG_LIBPNG_VER        =  10202;
 
 type
diff --git a/scripts/pngos2.def b/scripts/pngos2.def
index 27c807f..ac035d2 100644
--- a/scripts/pngos2.def
+++ b/scripts/pngos2.def
@@ -2,7 +2,7 @@
 ; PNG.LIB module definition file for OS/2
 ;----------------------------------------
 
-; Version 1.2.2beta2
+; Version 1.2.2beta3
 
 LIBRARY		PNG
 DESCRIPTION	"PNG image compression library for OS/2"
@@ -184,9 +184,6 @@
   png_convert_to_rfc1123
   png_set_invalid
 
-;To be added at version 1.2.0
-; png_permit_mng_features
-
 ; Added at version 1.2.0:
   png_mmx_support
   png_permit_empty_plte
@@ -199,6 +196,11 @@
   png_set_asm_flags
   png_init_mmx_flags
 
+; Added at version 1.2.2:
+  png_zalloc
+  png_zfree
+  png_handle_as_unknown
+
 ; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS
   png_libpng_ver
   png_pass_start