texlive[70115] Build/source/libs: libpng 1.6.43
commits+kakuto at tug.org
commits+kakuto at tug.org
Sat Feb 24 02:06:57 CET 2024
Revision: 70115
https://tug.org/svn/texlive?view=revision&revision=70115
Author: kakuto
Date: 2024-02-24 02:06:57 +0100 (Sat, 24 Feb 2024)
Log Message:
-----------
libpng 1.6.43
Modified Paths:
--------------
trunk/Build/source/libs/README
trunk/Build/source/libs/libpng/ChangeLog
trunk/Build/source/libs/libpng/README
trunk/Build/source/libs/libpng/TLpatches/ChangeLog
trunk/Build/source/libs/libpng/TLpatches/TL-Changes
trunk/Build/source/libs/libpng/configure
trunk/Build/source/libs/libpng/configure.ac
trunk/Build/source/libs/libpng/libpng-src/ANNOUNCE
trunk/Build/source/libs/libpng/libpng-src/AUTHORS
trunk/Build/source/libs/libpng/libpng-src/CHANGES
trunk/Build/source/libs/libpng/libpng-src/CMakeLists.txt
trunk/Build/source/libs/libpng/libpng-src/README
trunk/Build/source/libs/libpng/libpng-src/ci/.shellcheckrc
trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_cmake.sh
trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_configure.sh
trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_makefiles.sh
trunk/Build/source/libs/libpng/libpng-src/ci/lib/ci.lib.sh
trunk/Build/source/libs/libpng/libpng-src/configure.ac
trunk/Build/source/libs/libpng/libpng-src/contrib/examples/iccfrompng.c
trunk/Build/source/libs/libpng/libpng-src/contrib/gregbook/rpng-x.c
trunk/Build/source/libs/libpng/libpng-src/contrib/gregbook/rpng2-x.c
trunk/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
trunk/Build/source/libs/libpng/libpng-src/contrib/pngminim/decoder/makefile
trunk/Build/source/libs/libpng/libpng-src/contrib/tools/pngfix.c
trunk/Build/source/libs/libpng/libpng-src/libpng-manual.txt
trunk/Build/source/libs/libpng/libpng-src/libpng.3
trunk/Build/source/libs/libpng/libpng-src/libpngpf.3
trunk/Build/source/libs/libpng/libpng-src/png.5
trunk/Build/source/libs/libpng/libpng-src/png.c
trunk/Build/source/libs/libpng/libpng-src/png.h
trunk/Build/source/libs/libpng/libpng-src/pngconf.h
trunk/Build/source/libs/libpng/libpng-src/pnglibconf.h
trunk/Build/source/libs/libpng/libpng-src/pngpread.c
trunk/Build/source/libs/libpng/libpng-src/pngread.c
trunk/Build/source/libs/libpng/libpng-src/pngrtran.c
trunk/Build/source/libs/libpng/libpng-src/pngtest.c
trunk/Build/source/libs/libpng/libpng-src/scripts/checksym.awk
trunk/Build/source/libs/libpng/libpng-src/scripts/cmake/AUTHORS.md
trunk/Build/source/libs/libpng/libpng-src/scripts/libpng-config-head.in
trunk/Build/source/libs/libpng/libpng-src/scripts/libpng.pc.in
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.32sunu
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.64sunu
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.aix
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.amiga
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.beos
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.clang
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.darwin
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.dec
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.dj2
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.emcc
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.gcc
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hp64
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hpgcc
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hpux
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.linux
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.mips
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.msys
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sco
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sggcc
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sgi
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.so9
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.solaris
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.std
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sunos
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.vcwin-arm64
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.vcwin32
trunk/Build/source/libs/libpng/libpng-src/scripts/options.awk
trunk/Build/source/libs/libpng/libpng-src/scripts/pnglibconf.dfa
trunk/Build/source/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt
trunk/Build/source/libs/libpng/libpng-src/scripts/pngwin.rc
trunk/Build/source/libs/libpng/libpng-src/scripts/smakefile.ppc
trunk/Build/source/libs/libpng/libpng-src/tests/pngtest-all
trunk/Build/source/libs/libpng/version.ac
Added Paths:
-----------
trunk/Build/source/libs/libpng/libpng-src/ci/ci_lint.sh
trunk/Build/source/libs/libpng/libpng-src/ci/ci_shellify.sh
trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_version.sh
trunk/Build/source/libs/libpng/libpng-src/contrib/.editorconfig
trunk/Build/source/libs/libpng/libpng-src/contrib/conftest/basic.dfa
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.editorconfig
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.gitignore
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.pylintrc
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/LICENSE_MIT.txt
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/README.md
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/bytepack.py
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/exifinfo.py
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo.bat
trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo.py
trunk/Build/source/libs/libpng/libpng-src/contrib/visupng/.editorconfig
trunk/Build/source/libs/libpng/libpng-src/loongarch/.editorconfig
trunk/Build/source/libs/libpng/libpng-src/mips/.editorconfig
trunk/Build/source/libs/libpng/libpng-src/powerpc/.editorconfig
trunk/Build/source/libs/libpng/libpng-src/projects/.editorconfig
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.riscos
Removed Paths:
-------------
trunk/Build/source/libs/libpng/libpng-src/ci/ci_lint_ci.sh
trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.acorn
Modified: trunk/Build/source/libs/README
===================================================================
--- trunk/Build/source/libs/README 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/README 2024-02-24 01:06:57 UTC (rev 70115)
@@ -37,7 +37,7 @@
libpaper 1.1.29 - checked 07jan24
https://ftp.debian.org/debian/pool/main/libp/libpaper/
-libpng 1.6.42 - checked 31jan24
+libpng 1.6.43 - checked 24feb24
https://sourceforge.net/projects/libpng/files/ - used by many
lua 5.2.4
Modified: trunk/Build/source/libs/libpng/ChangeLog
===================================================================
--- trunk/Build/source/libs/libpng/ChangeLog 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/ChangeLog 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,3 +1,8 @@
+2024-02-24 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ Import libpng-1.6.43.
+ * version.ac: Adjust.
+
2024-01-31 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
Import libpng-1.6.42.
Modified: trunk/Build/source/libs/libpng/README
===================================================================
--- trunk/Build/source/libs/libpng/README 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/README 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,4 +1,4 @@
- Building libpng-1.6.42 as part of the TL tree
+ Building libpng-1.6.43 as part of the TL tree
=============================================
This directory libs/libpng/ uses a proxy Makefile.am to build the libpng library
@@ -14,4 +14,4 @@
=============================
2009-07-23 Peter Breitenlohner <peb at mppmu.mpg.de>
-2024-01-31 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+2024-02-24 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
Modified: trunk/Build/source/libs/libpng/TLpatches/ChangeLog
===================================================================
--- trunk/Build/source/libs/libpng/TLpatches/ChangeLog 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/TLpatches/ChangeLog 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,3 +1,7 @@
+2024-02-24 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ Import libpng-1.6.43.
+
2024-01-31 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
Import libpng-1.6.42.
Modified: trunk/Build/source/libs/libpng/TLpatches/TL-Changes
===================================================================
--- trunk/Build/source/libs/libpng/TLpatches/TL-Changes 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/TLpatches/TL-Changes 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,11 +1,13 @@
-Changes applied to the libpng-1.6.42/ tree as obtained from:
- https://sourceforge.net/projects/libpng/files/libpng16/1.6.42/
+Changes applied to the libpng-1.6.43/ tree as obtained from:
+ https://sourceforge.net/projects/libpng/files/libpng16/1.6.43/
Copied:
scripts/pnglibconf.h.prebuilt -> pnglibconf.h
Removed:
+ .github (dir)
.appveyor.yml
+ .editorconfig
.gitignore
.travis.yml
.yamllint.yml
Modified: trunk/Build/source/libs/libpng/configure
===================================================================
--- trunk/Build/source/libs/libpng/configure 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/configure 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for libpng (TeX Live) 1.6.42.
+# Generated by GNU Autoconf 2.72 for libpng (TeX Live) 1.6.43.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -604,8 +604,8 @@
# Identity of this package.
PACKAGE_NAME='libpng (TeX Live)'
PACKAGE_TARNAME='libpng--tex-live-'
-PACKAGE_VERSION='1.6.42'
-PACKAGE_STRING='libpng (TeX Live) 1.6.42'
+PACKAGE_VERSION='1.6.43'
+PACKAGE_STRING='libpng (TeX Live) 1.6.43'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1338,7 +1338,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures libpng (TeX Live) 1.6.42 to adapt to many kinds of systems.
+'configure' configures libpng (TeX Live) 1.6.43 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1410,7 +1410,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libpng (TeX Live) 1.6.42:";;
+ short | recursive ) echo "Configuration of libpng (TeX Live) 1.6.43:";;
esac
cat <<\_ACEOF
@@ -1530,7 +1530,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libpng (TeX Live) configure 1.6.42
+libpng (TeX Live) configure 1.6.43
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -1857,7 +1857,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libpng (TeX Live) $as_me 1.6.42, which was
+It was created by libpng (TeX Live) $as_me 1.6.43, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -4456,7 +4456,7 @@
# Define the identity of the package.
PACKAGE='libpng--tex-live-'
- VERSION='1.6.42'
+ VERSION='1.6.43'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -6051,6 +6051,8 @@
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
# Checks for header files.
+# Autoupdate added the next two lines to ensure that your configure
+# script's behavior did not change. They are probably safe to remove.
ac_header= ac_cache=
for ac_item in $ac_header_c_list
do
@@ -6151,9 +6153,6 @@
GREP="$ac_cv_path_GREP"
-# Autoupdate added the next two lines to ensure that your configure
-# script's behavior did not change. They are probably safe to remove.
-
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
printf %s "checking for egrep... " >&6; }
if test ${ac_cv_path_EGREP+y}
@@ -7474,7 +7473,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libpng (TeX Live) $as_me 1.6.42, which was
+This file was extended by libpng (TeX Live) $as_me 1.6.43, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -7542,7 +7541,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-libpng (TeX Live) config.status 1.6.42
+libpng (TeX Live) config.status 1.6.43
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
Modified: trunk/Build/source/libs/libpng/configure.ac
===================================================================
--- trunk/Build/source/libs/libpng/configure.ac 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/configure.ac 2024-02-24 01:06:57 UTC (rev 70115)
@@ -9,8 +9,8 @@
dnl with or without modifications, as long as this notice is preserved.
dnl
m4_include([version.ac])[] dnl define libpng_version
-AC_INIT([libpng (TeX Live)], libpng_version, [tex-k at tug.org])
-AC_PREREQ([2.65])
+AC_INIT([libpng (TeX Live)],[libpng_version],[tex-k at tug.org])
+AC_PREREQ([2.72])
AC_CONFIG_SRCDIR([libpng-src/pngget.c])
AC_CONFIG_AUX_DIR([../../build-aux])
AC_CONFIG_MACRO_DIR([../../m4])
@@ -49,7 +49,15 @@
])
# Checks for header files.
-AC_HEADER_STDC
+m4_warn([obsolete],
+[The preprocessor macro 'STDC_HEADERS' is obsolete.
+ Except in unusual embedded environments, you can safely include all
+ C89 headers unconditionally.])dnl
+# Autoupdate added the next two lines to ensure that your configure
+# script's behavior did not change. They are probably safe to remove.
+AC_CHECK_INCLUDES_DEFAULT
+AC_PROG_EGREP
+
AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
# Checks for typedefs, structures, and compiler characteristics.
@@ -60,8 +68,8 @@
# Checks for library functions.
AC_FUNC_STRTOD
-AC_CHECK_FUNCS([memset], , [AC_ERROR([memset not found in libc])])
-AC_SEARCH_LIBS([pow], [m], , [AC_ERROR([cannot find pow])])
+AC_CHECK_FUNCS([memset], , [AC_MSG_ERROR(memset not found in libc)])
+AC_SEARCH_LIBS([pow], [m], , [AC_MSG_ERROR(cannot find pow)])
KPSE_ZLIB_FLAGS
@@ -70,7 +78,7 @@
if test "x$enable_build" != xno || test -f config.force; then
KPSE_ADD_FLAGS([zlib])
-AC_CHECK_FUNC([zlibVersion], , [AC_ERROR([zlib not found])])
+AC_CHECK_FUNC([zlibVersion], , [AC_MSG_ERROR(zlib not found)])
KPSE_RESTORE_FLAGS
echo timestamp >config.force
Modified: trunk/Build/source/libs/libpng/libpng-src/ANNOUNCE
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ANNOUNCE 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/ANNOUNCE 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
-libpng 1.6.42 - January 29, 2024
-================================
+libpng 1.6.43 - February 23, 2024
+=================================
This is a public release of libpng, intended for use in production code.
@@ -9,13 +9,13 @@
Source files with LF line endings (for Unix/Linux):
- * libpng-1.6.42.tar.xz (LZMA-compressed, recommended)
- * libpng-1.6.42.tar.gz (deflate-compressed)
+ * libpng-1.6.43.tar.xz (LZMA-compressed, recommended)
+ * libpng-1.6.43.tar.gz (deflate-compressed)
Source files with CRLF line endings (for Windows):
- * lpng1642.7z (LZMA-compressed, recommended)
- * lpng1642.zip (deflate-compressed)
+ * lpng1643.7z (LZMA-compressed, recommended)
+ * lpng1643.zip (deflate-compressed)
Other information:
@@ -25,47 +25,36 @@
* TRADEMARK.md
-Changes from version 1.6.41 to version 1.6.42
+Changes from version 1.6.42 to version 1.6.43
---------------------------------------------
- * Fixed the implementation of the macro function `png_check_sig`.
- This was an API regression, introduced in libpng-1.6.41.
- (Reported by Matthieu Darbois)
-
-
-Changes from version 1.6.40 to version 1.6.41
----------------------------------------------
-
- * Added SIMD-optimized code for the Loongarch LSX hardware.
- (Contributed by GuXiWei, JinBo and ZhangLixia)
- * Fixed the run-time discovery of MIPS MSA hardware.
- (Contributed by Sui Jingfeng)
- * Fixed an off-by-one error in the function `png_do_check_palette_indexes`,
- which failed to recognize errors that might have existed in the first
- column of a broken palette-encoded image. This was a benign regression
- accidentally introduced in libpng-1.6.33. No pixel was harmed.
- (Contributed by Adam Richter; reviewed by John Bowler)
- * Fixed, improved and modernized the contrib/pngminus programs, i.e.,
- png2pnm.c and pnm2png.c
- * Removed old and peculiar portability hacks that were meant to silence
- warnings issued by gcc version 7.1 alone.
+ * Fixed the row width check in png_check_IHDR().
+ This corrected a bug that was specific to the 16-bit platforms,
+ and removed a spurious compiler warning from the 64-bit builds.
+ (Reported by Jacek Caban; fixed by John Bowler)
+ * Added eXIf chunk support to the push-mode reader in pngpread.c.
+ (Contributed by Chris Blume)
+ * Added contrib/pngexif for the benefit of the users who would like
+ to inspect the content of eXIf chunks.
+ * Added contrib/conftest/basic.dfa, a basic build-time configuration.
(Contributed by John Bowler)
- * Fixed and modernized the CMake file, and raised the minimum required
- CMake version from 3.1 to 3.6.
- (Contributed by Clinton Ingram, Timothy Lyanguzov, Tyler Kropp, et al.)
- * Allowed the configure script to disable the building of auxiliary tools
- and tests, thus catching up with the CMake file.
- (Contributed by Carlo Bramini)
- * Fixed a build issue on Mac.
- (Contributed by Zixu Wang)
- * Moved the Autoconf macro files to scripts/autoconf.
- * Moved the CMake files (except for the main CMakeLists.txt) to
- scripts/cmake and moved the list of their contributing authors to
- scripts/cmake/AUTHORS.md
- * Updated the CI configurations and scripts.
- * Relicensed the CI scripts to the MIT License.
- * Improved the test coverage.
+ * Fixed a preprocessor condition in pngread.c that broke build-time
+ configurations like contrib/conftest/pngcp.dfa.
(Contributed by John Bowler)
+ * Added CMake build support for LoongArch LSX.
+ (Contributed by GuXiWei)
+ * Fixed a CMake build error that occurred under a peculiar state of the
+ dependency tree. This was a regression introduced in libpng-1.6.41.
+ (Contributed by Dan Rosser)
+ * Marked the installed libpng headers as system headers in CMake.
+ (Contributed by Benjamin Buch)
+ * Updated the build support for RISCOS.
+ (Contributed by Cameron Cawley)
+ * Updated the makefiles to allow cross-platform builds to initialize
+ conventional make variables like AR and ARFLAGS.
+ * Added various improvements to the CI scripts in areas like version
+ consistency verification and text linting.
+ * Added version consistency verification to pngtest.c also.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Modified: trunk/Build/source/libs/libpng/libpng-src/AUTHORS
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/AUTHORS 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/AUTHORS 2024-02-24 01:06:57 UTC (rev 70115)
@@ -6,6 +6,7 @@
* Adam Richter
* Andreas Dilger
+ * Chris Blume
* Cosmin Truta
* Dave Martindale
* Eric S. Raymond
Modified: trunk/Build/source/libs/libpng/libpng-src/CHANGES
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/CHANGES 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/CHANGES 2024-02-24 01:06:57 UTC (rev 70115)
@@ -6130,7 +6130,7 @@
Cleaned up the code, the build scripts, and the documentation.
Version 1.6.41 [January 24, 2024]
- Added SIMD-optimized code for the Loongarch LSX hardware.
+ Added SIMD-optimized code for the LoongArch LSX hardware.
(Contributed by GuXiWei, JinBo and ZhangLixia)
Fixed the run-time discovery of MIPS MSA hardware.
(Contributed by Sui Jingfeng)
@@ -6165,7 +6165,37 @@
Fixed the implementation of the macro function png_check_sig().
This was an API regression, introduced in libpng-1.6.41.
(Reported by Matthieu Darbois)
+ Fixed and updated the libpng manual.
+Version 1.6.43 [February 23, 2024]
+ Fixed the row width check in png_check_IHDR().
+ This corrected a bug that was specific to the 16-bit platforms,
+ and removed a spurious compiler warning from the 64-bit builds.
+ (Reported by Jacek Caban; fixed by John Bowler)
+ Added eXIf chunk support to the push-mode reader in pngpread.c.
+ (Contributed by Chris Blume)
+ Added contrib/pngexif for the benefit of the users who would like
+ to inspect the content of eXIf chunks.
+ Added contrib/conftest/basic.dfa, a basic build-time configuration.
+ (Contributed by John Bowler)
+ Fixed a preprocessor condition in pngread.c that broke build-time
+ configurations like contrib/conftest/pngcp.dfa.
+ (Contributed by John Bowler)
+ Added CMake build support for LoongArch LSX.
+ (Contributed by GuXiWei)
+ Fixed a CMake build error that occurred under a peculiar state of the
+ dependency tree. This was a regression introduced in libpng-1.6.41.
+ (Contributed by Dan Rosser)
+ Marked the installed libpng headers as system headers in CMake.
+ (Contributed by Benjamin Buch)
+ Updated the build support for RISCOS.
+ (Contributed by Cameron Cawley)
+ Updated the makefiles to allow cross-platform builds to initialize
+ conventional make variables like AR and ARFLAGS.
+ Added various improvements to the CI scripts in areas like version
+ consistency verification and text linting.
+ Added version consistency verification to pngtest.c also.
+
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
Modified: trunk/Build/source/libs/libpng/libpng-src/CMakeLists.txt
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/CMakeLists.txt 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/CMakeLists.txt 2024-02-24 01:06:57 UTC (rev 70115)
@@ -19,7 +19,7 @@
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 6)
-set(PNGLIB_REVISION 41)
+set(PNGLIB_REVISION 43)
set(PNGLIB_SUBREVISION 0)
#set(PNGLIB_SUBREVISION "git")
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_REVISION})
@@ -62,10 +62,19 @@
endif()
# Allow the users to switch on/off the auxiliary build and test artifacts.
-# NOTE: These artifacts are NOT part of libpng proper, and are subject to change at any time.
+# These artifacts are NOT part of libpng proper, and are subject to change
+# at any time.
option(PNG_TESTS "Build the libpng tests" ON)
-option(PNG_TOOLS "Build the libpng tools" ON)
+# Same as above, but for the third-party tools.
+# Although these tools are targetted at development environments only,
+# the users are allowed to override the option to build by default.
+if (ANDROID OR IOS)
+ option(PNG_TOOLS "Build the libpng tools" OFF)
+else()
+ option(PNG_TOOLS "Build the libpng tools" ON)
+endif()
+
# Maintain backwards compatibility with the deprecated option PNG_EXECUTABLES.
option(PNG_EXECUTABLES "[Deprecated; please use PNG_TOOLS]" ON)
if(NOT PNG_EXECUTABLES)
@@ -89,7 +98,6 @@
if(NOT PNG_BUILD_ZLIB)
find_package(ZLIB REQUIRED)
elseif(POLICY CMP0074)
- # TODO: Remove the policy check if CMake version 3.12 or greater becomes the minimum required.
if("x${ZLIB_ROOT}" STREQUAL "x")
message(DEPRECATION
"The option PNG_BUILD_ZLIB has been deprecated; please use ZLIB_ROOT instead")
@@ -249,6 +257,35 @@
endif()
endif()
+# Set definitions and sources for LoongArch.
+if(TARGET_ARCH MATCHES "^(loongarch)")
+ include(CheckCCompilerFlag)
+ set(PNG_LOONGARCH_LSX_POSSIBLE_VALUES on off)
+ set(PNG_LOONGARCH_LSX "on"
+ CACHE STRING "Enable LOONGARCH_LSX optimizations: on|off; on is default")
+ set_property(CACHE PNG_LOONGARCH_LSX
+ PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES})
+ list(FIND PNG_LOONGARCH_LSX_POSSIBLE_VALUES ${PNG_LOONGARCH_LSX} index)
+ if(index EQUAL -1)
+ message(FATAL_ERROR "PNG_LOONGARCH_LSX must be one of [${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}]")
+ elseif(NOT PNG_LOONGARCH_LSX STREQUAL "off")
+ CHECK_C_COMPILER_FLAG("-mlsx" COMPILER_SUPPORTS_LSX)
+ if(COMPILER_SUPPORTS_LSX)
+ set(libpng_loongarch_sources
+ loongarch/loongarch_lsx_init.c
+ loongarch/filter_lsx_intrinsics.c)
+ set_source_files_properties(${libpng_loongarch_sources}
+ PROPERTIES
+ COMPILE_FLAGS "-mlsx")
+ add_definitions(-DPNG_LOONGARCH_LSX_OPT=1)
+ else()
+ message(FATAL_ERROR "Compiler does not support -mlsx option")
+ endif()
+ else()
+ add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
+ endif()
+endif()
+
else(PNG_HARDWARE_OPTIMIZATIONS)
# Set definitions and sources for ARM.
@@ -271,6 +308,11 @@
add_definitions(-DPNG_MIPS_MSA_OPT=0)
endif()
+# Set definitions and sources for LoongArch.
+if(TARGET_ARCH MATCHES "^(loongarch)")
+ add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
+endif()
+
endif(PNG_HARDWARE_OPTIMIZATIONS)
option(ld-version-script "Enable linker version script" ON)
@@ -310,7 +352,15 @@
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
endif()
-find_program(AWK NAMES gawk awk)
+# Find an AWK language processor.
+# Start with specific AWK implementations like gawk and nawk, which are
+# known to work with our scripts, then fall back to the system awk.
+find_program(AWK NAMES gawk nawk awk)
+if(AWK)
+ message(STATUS "Found AWK program: ${AWK}")
+else()
+ message(STATUS "Could not find an AWK-compatible program")
+endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
@@ -352,7 +402,7 @@
COMMAND "${CMAKE_COMMAND}"
"-DINPUT=${_GC_INPUT}"
"-DOUTPUT=${_GC_OUTPUT}"
- -P "${CMAKE_CURRENT_BINARY_DIR}/genchk.cmake"
+ -P "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genchk.cmake"
DEPENDS "${_GC_INPUT}" ${_GC_DEPENDS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
@@ -375,7 +425,7 @@
COMMAND "${CMAKE_COMMAND}"
"-DINPUT=${_GO_INPUT}"
"-DOUTPUT=${_GO_OUTPUT}"
- -P "${CMAKE_CURRENT_BINARY_DIR}/genout.cmake"
+ -P "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genout.cmake"
DEPENDS "${_GO_INPUT}" ${_GO_DEPENDS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
@@ -394,7 +444,7 @@
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_GSO_OUTPUT}"
COMMAND "${CMAKE_COMMAND}"
"-DOUTPUT=${_GSO_OUTPUT}"
- -P "${CMAKE_CURRENT_BINARY_DIR}/gensrc.cmake"
+ -P "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake"
DEPENDS ${_GSO_DEPENDS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
@@ -524,7 +574,7 @@
add_custom_target(png_genprebuilt
COMMAND "${CMAKE_COMMAND}"
"-DOUTPUT=scripts/pnglibconf.h.prebuilt"
- -P "${CMAKE_CURRENT_BINARY_DIR}/gensrc.cmake"
+ -P "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
# A single target handles generation of all generated files.
@@ -581,6 +631,7 @@
${libpng_intel_sources}
${libpng_mips_sources}
${libpng_powerpc_sources}
+ ${libpng_loongarch_sources}
)
set(pngtest_sources
pngtest.c
@@ -662,10 +713,9 @@
set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
endif()
target_include_directories(png_shared
- PUBLIC
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+ PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
+ target_include_directories(png_shared SYSTEM
+ INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
target_link_libraries(png_shared PUBLIC ZLIB::ZLIB ${M_LIBRARY})
endif()
@@ -677,14 +727,19 @@
OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
target_include_directories(png_static
- PUBLIC
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+ PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
+ target_include_directories(png_static SYSTEM
+ INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
target_link_libraries(png_static PUBLIC ZLIB::ZLIB ${M_LIBRARY})
endif()
-if(PNG_FRAMEWORK AND APPLE)
+if(PNG_FRAMEWORK AND NOT APPLE)
+ message(AUTHOR_WARNING
+ "Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems")
+ set(PNG_FRAMEWORK OFF)
+endif()
+
+if(PNG_FRAMEWORK)
add_library(png_framework SHARED ${libpng_sources})
add_dependencies(png_framework png_genfiles)
list(APPEND PNG_LIBRARY_TARGETS png_framework)
@@ -701,10 +756,9 @@
# Avoid CMake's implicit compile definition "-Dpng_framework_EXPORTS".
set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "")
target_include_directories(png_framework
- PUBLIC
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+ PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
+ target_include_directories(png_framework SYSTEM
+ INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
target_link_libraries(png_framework PUBLIC ZLIB::ZLIB ${M_LIBRARY})
endif()
@@ -967,13 +1021,13 @@
# Create source generation scripts.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genchk.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/genchk.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genchk.cmake
@ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genout.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/genout.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genout.cmake
@ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/gensrc.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/gensrc.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake
@ONLY)
# libpng is a library so default to 'lib'
Modified: trunk/Build/source/libs/libpng/libpng-src/README
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/README 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/README 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,4 +1,4 @@
-README for libpng version 1.6.42
+README for libpng version 1.6.43
================================
See the note about version numbers near the top of `png.h`.
@@ -142,10 +142,11 @@
pngwrite.c => High-level write functions
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
- arm/ => Optimized code for the ARM platform
- intel/ => Optimized code for the INTEL-SSE2 platform
- mips/ => Optimized code for the MIPS platform
- powerpc/ => Optimized code for the PowerPC platform
+ arm/ => Optimized code for ARM Neon
+ intel/ => Optimized code for INTEL SSE2
+ loongarch/ => Optimized code for LoongArch LSX
+ mips/ => Optimized code for MIPS MSA and MIPS MMI
+ powerpc/ => Optimized code for PowerPC VSX
ci/ => Scripts for continuous integration
contrib/ => External contributions
arm-neon/ => Optimized code for the ARM-NEON platform
@@ -158,6 +159,7 @@
libtests/ => Test programs
oss-fuzz/ => Files used by the OSS-Fuzz project for fuzz-testing
libpng
+ pngexif/ => Program to inspect the EXIF information in PNG files
pngminim/ => Minimal decoder, encoder, and progressive decoder
programs demonstrating the use of pngusr.dfa
pngminus/ => Simple pnm2png and png2pnm programs
Modified: trunk/Build/source/libs/libpng/libpng-src/ci/.shellcheckrc
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ci/.shellcheckrc 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/ci/.shellcheckrc 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,3 +1,7 @@
+# Disable the "expressions don't expand in single quotes, use double quotes"
+# advice. We need the regular expressions to remain uninterpolated.
+disable=SC2016
+
# Disable the "variable appears unused" warning caused by the use of getopts
# with an obligatory (but unused) variable name in the main function.
disable=SC2034
@@ -5,7 +9,3 @@
# Disable all the "quote to prevent globbing or word splitting" advice.
# We need word splitting for well-known variables like MAKEFLAGS and CFLAGS.
disable=SC2086,SC2206
-
-# Disable the "possible misspelling" warnings that might be flagged, e.g.,
-# inside function ci_trace_build.
-disable=SC2153
Added: trunk/Build/source/libs/libpng/libpng-src/ci/ci_lint.sh
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ci/ci_lint.sh (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/ci/ci_lint.sh 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,140 @@
+#!/usr/bin/env bash
+set -o errexit -o pipefail -o posix
+
+# Copyright (c) 2019-2024 Cosmin Truta.
+#
+# Use, modification and distribution are subject to the MIT License.
+# Please see the accompanying file LICENSE_MIT.txt
+#
+# SPDX-License-Identifier: MIT
+
+# shellcheck source=ci/lib/ci.lib.sh
+source "$(dirname "$0")/lib/ci.lib.sh"
+cd "$CI_TOPLEVEL_DIR"
+
+# Initialize the global constants CI_{...}{CHECK,CHECKER,LINT}.
+CI_SHELLCHECK="${CI_SHELLCHECK:-shellcheck}"
+CI_EDITORCONFIG_CHECKER="${CI_EDITORCONFIG_CHECKER:-editorconfig-checker}"
+CI_YAMLLINT="${CI_YAMLLINT:-yamllint}"
+
+# Initialize the global lint status.
+CI_LINT_STATUS=0
+
+function ci_init_lint {
+ ci_info "## START OF LINTING ##"
+ local my_program
+ # Complete the initialization of CI_SHELLCHECK.
+ # Set it to the empty string if the shellcheck program is unavailable.
+ my_program="$(command -v "$CI_SHELLCHECK")" || {
+ ci_warn "program not found: '$CI_SHELLCHECK'"
+ }
+ CI_SHELLCHECK="$my_program"
+ # Complete the initialization of CI_EDITORCONFIG_CHECKER.
+ # Set it to the empty string if the editorconfig-checker program is unavailable.
+ my_program="$(command -v "$CI_EDITORCONFIG_CHECKER")" || {
+ ci_warn "program not found: '$CI_EDITORCONFIG_CHECKER'"
+ }
+ CI_EDITORCONFIG_CHECKER="$my_program"
+ # Complete the initialization of CI_YAMLLINT.
+ # Set it to the empty string if the yamllint program is unavailable.
+ my_program="$(command -v "$CI_YAMLLINT")" || {
+ ci_warn "program not found: '$CI_YAMLLINT'"
+ }
+ CI_YAMLLINT="$my_program"
+}
+
+function ci_finish_lint {
+ ci_info "## END OF LINTING ##"
+ if [[ $CI_LINT_STATUS -eq 0 ]]
+ then
+ ci_info "## SUCCESS ##"
+ else
+ ci_info "linting failed"
+ fi
+ return "$CI_LINT_STATUS"
+}
+
+function ci_lint_ci_scripts {
+ [[ -x $CI_SHELLCHECK ]] || {
+ ci_warn "## NOT LINTING: CI scripts ##"
+ return 0
+ }
+ ci_info "## LINTING: CI scripts ##"
+ ci_spawn "$CI_SHELLCHECK" --version
+ find ./ci -maxdepth 1 -name "*.sh" | {
+ local my_file
+ while IFS="" read -r my_file
+ do
+ ci_spawn "$CI_SHELLCHECK" -x "$my_file" || {
+ # Linting failed.
+ return 1
+ }
+ done
+ }
+}
+
+function ci_lint_text_files {
+ [[ -x $CI_EDITORCONFIG_CHECKER ]] || {
+ ci_warn "## NOT LINTING: text files ##"
+ return 0
+ }
+ ci_info "## LINTING: text files ##"
+ ci_spawn "$CI_EDITORCONFIG_CHECKER" --version
+ ci_spawn "$CI_EDITORCONFIG_CHECKER" || {
+ # Linting failed.
+ return 1
+ }
+}
+
+function ci_lint_yaml_files {
+ [[ -x $CI_YAMLLINT ]] || {
+ ci_warn "## NOT LINTING: YAML files ##"
+ return 0
+ }
+ ci_info "## LINTING: YAML files ##"
+ ci_spawn "$CI_YAMLLINT" --version
+ find . \( -iname "*.yml" -o -iname "*.yaml" \) -not -path "./out/*" | {
+ local my_file
+ while IFS="" read -r my_file
+ do
+ ci_spawn "$CI_YAMLLINT" --strict "$my_file" || {
+ # Linting failed.
+ return 1
+ }
+ done
+ }
+}
+
+function ci_lint {
+ ci_init_lint
+ ci_lint_ci_scripts || CI_LINT_STATUS=1
+ ci_lint_text_files || CI_LINT_STATUS=1
+ ci_lint_yaml_files || CI_LINT_STATUS=1
+ # TODO: ci_lint_png_files, etc.
+ ci_finish_lint
+}
+
+function usage {
+ echo "usage: $CI_SCRIPT_NAME [<options>]"
+ echo "options: -?|-h|--help"
+ exit "${@:-0}"
+}
+
+function main {
+ local opt
+ while getopts ":" opt
+ do
+ # This ain't a while-loop. It only pretends to be.
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
+ ci_err "unknown option: '$1'"
+ done
+ shift $((OPTIND - 1))
+ [[ $# -eq 0 ]] || {
+ echo >&2 "error: unexpected argument: '$1'"
+ usage 2
+ }
+ # And... go!
+ ci_lint
+}
+
+main "$@"
Deleted: trunk/Build/source/libs/libpng/libpng-src/ci/ci_lint_ci.sh
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ci/ci_lint_ci.sh 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/ci/ci_lint_ci.sh 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,88 +0,0 @@
-#!/usr/bin/env bash
-set -e
-
-# Copyright (c) 2019-2024 Cosmin Truta.
-#
-# Use, modification and distribution are subject to the MIT License.
-# Please see the accompanying file LICENSE_MIT.txt
-#
-# SPDX-License-Identifier: MIT
-
-# shellcheck source="ci/lib/ci.lib.sh"
-source "$(dirname "$0")/lib/ci.lib.sh"
-cd "$CI_TOPLEVEL_DIR"
-
-CI_SHELLCHECK="$(command -v shellcheck || true)"
-CI_YAMLLINT="$(command -v yamllint || true)"
-CI_LINT_COUNTER=0
-
-function ci_lint_ci_config_files {
- ci_info "linting: CI config files"
- local MY_FILE
- if [[ -x $CI_YAMLLINT ]]
- then
- ci_spawn "$CI_YAMLLINT" --version
- for MY_FILE in "$CI_TOPLEVEL_DIR"/.*.yml
- do
- ci_spawn "$CI_YAMLLINT" --strict "$MY_FILE" ||
- CI_LINT_COUNTER=$((CI_LINT_COUNTER + 1))
- done
- else
- ci_warn "program not found: 'yamllint'; skipping checks"
- fi
-}
-
-function ci_lint_ci_scripts {
- ci_info "linting: CI scripts"
- local MY_FILE
- if [[ -x $CI_SHELLCHECK ]]
- then
- ci_spawn "$CI_SHELLCHECK" --version
- for MY_FILE in "$CI_SCRIPT_DIR"/*.sh
- do
- ci_spawn "$CI_SHELLCHECK" -x "$MY_FILE" ||
- CI_LINT_COUNTER=$((CI_LINT_COUNTER + 1))
- done
- else
- ci_warn "program not found: 'shellcheck'; skipping checks"
- fi
-}
-
-function ci_lint_ci_scripts_license {
- ci_info "linting: CI scripts license"
- ci_spawn grep -F "MIT License" ci/LICENSE_MIT.txt || {
- ci_warn "bad or missing CI license file: '$CI_SCRIPT_DIR/LICENSE_MIT.txt'"
- CI_LINT_COUNTER=$((CI_LINT_COUNTER + 1))
- }
-}
-
-function usage {
- echo "usage: $CI_SCRIPT_NAME"
- exit 0
-}
-
-function main {
- local opt
- while getopts ":" opt
- do
- # This ain't a while-loop. It only pretends to be.
- [[ $1 == -[?h]* || $1 == --help ]] && usage
- ci_err "unknown option: '$1'"
- done
- shift $((OPTIND - 1))
- # And... go!
- [[ $# -eq 0 ]] || ci_err "unexpected argument: '$1'"
- ci_lint_ci_config_files
- ci_lint_ci_scripts
- ci_lint_ci_scripts_license
- if [[ $CI_LINT_COUNTER -eq 0 ]]
- then
- ci_info "success!"
- exit 0
- else
- ci_info "failed on $CI_LINT_COUNTER file(s)"
- exit 1
- fi
-}
-
-main "$@"
Added: trunk/Build/source/libs/libpng/libpng-src/ci/ci_shellify.sh
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ci/ci_shellify.sh (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/ci/ci_shellify.sh 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,92 @@
+#!/usr/bin/env bash
+set -o errexit -o pipefail -o posix
+
+# Copyright (c) 2019-2024 Cosmin Truta.
+#
+# Use, modification and distribution are subject to the MIT License.
+# Please see the accompanying file LICENSE_MIT.txt
+#
+# SPDX-License-Identifier: MIT
+
+# shellcheck source=ci/lib/ci.lib.sh
+source "$(dirname "$0")/lib/ci.lib.sh"
+cd "$CI_TOPLEVEL_DIR"
+
+function ci_shellify_c {
+ # Convert C preprocessor text, specifically originating
+ # from png.h, to shell scripting text.
+ # Select only the easy-to-parse definitions of PNG_LIBPNG_*.
+ sed -n -e '/^\# *define * PNG_LIBPNG_[^ ]* * ["0-9A-Za-z_]/ p' |
+ sed -e 's/^\# *define * PNG\([^ ]*\) * \([^ ]*\)/PNG\1=\2/' \
+ -e 's/=PNG\([0-9A-Za-z_]*\)/=\${PNG\1}/' \
+ -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
+}
+
+function ci_shellify_autoconf {
+ # Convert autoconf (M4) text, specifically originating
+ # from configure.ac, to shell scripting text.
+ # Select only the easy-to-parse definitions of PNGLIB_*.
+ sed -n -e '/^ *PNGLIB_[^ ]*=[$"0-9A-Za-z_]/ p' |
+ sed -e 's/^ *PNG\([0-9A-Za-z_]*\)=\([^# ]*\).*$/PNG\1=\2/' \
+ -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
+}
+
+function ci_shellify_cmake {
+ # Convert CMake lists text, specifically originating
+ # from CMakeLists.txt, to shell scripting text.
+ # Select only the easy-to-parse definitions of PNGLIB_*.
+ sed -n -e '/^ *set *(PNGLIB_[^ ]* * [$"0-9A-Za-z_].*)/ p' |
+ sed -e 's/^ *set *(PNG\([^ ]*\) * \([^() ]*\)).*$/PNG\1=\2/' \
+ -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
+}
+
+function ci_shellify {
+ local arg filename
+ for arg in "$@"
+ do
+ test -f "$arg" || ci_err "no such file: '$arg'"
+ filename="$(basename -- "$arg")"
+ case "$filename" in
+ ( *.[ch] )
+ [[ $filename == png.h ]] || {
+ ci_err "unable to shellify: '$filename' (expecting: 'png.h')"
+ }
+ ci_shellify_c <"$arg" ;;
+ ( config* | *.ac )
+ [[ $filename == configure.ac ]] || {
+ ci_err "unable to shellify: '$filename' (expecting: 'configure.ac')"
+ }
+ ci_shellify_autoconf <"$arg" ;;
+ ( *CMake* | *cmake* | *.txt )
+ [[ $filename == [Cc][Mm]ake[Ll]ists.txt ]] || {
+ ci_err "unable to shellify: '$filename' (expecting: 'CMakeLists.txt')"
+ }
+ ci_shellify_cmake <"$arg" ;;
+ ( * )
+ ci_err "unable to shellify: '$arg'" ;;
+ esac
+ done
+}
+
+function usage {
+ echo "usage: $CI_SCRIPT_NAME [<options>] <files>..."
+ echo "options: -?|-h|--help"
+ echo "files: png.h|configure.ac|CMakeLists.txt"
+ exit "${@:-0}"
+}
+
+function main {
+ local opt
+ while getopts ":" opt
+ do
+ # This ain't a while-loop. It only pretends to be.
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
+ ci_err "unknown option: '$1'"
+ done
+ shift $((OPTIND - 1))
+ [[ $# -eq 0 ]] && usage 2
+ # And... go!
+ ci_shellify "$@"
+}
+
+main "$@"
Modified: trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_cmake.sh
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_cmake.sh 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_cmake.sh 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-set -e
+set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2024 Cosmin Truta.
#
@@ -8,7 +8,7 @@
#
# SPDX-License-Identifier: MIT
-# shellcheck source="ci/lib/ci.lib.sh"
+# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/lib/ci.lib.sh"
cd "$CI_TOPLEVEL_DIR"
@@ -28,8 +28,6 @@
CI_CMAKE="${CI_CMAKE:-cmake}"
CI_CTEST="${CI_CTEST:-ctest}"
CI_CMAKE_BUILD_TYPE="${CI_CMAKE_BUILD_TYPE:-Release}"
- [[ -x $(command -v ninja) ]] &&
- CI_CMAKE_GENERATOR="${CI_CMAKE_GENERATOR:-Ninja}"
if [[ $CI_CMAKE_GENERATOR == "Visual Studio"* ]]
then
# Clean up incidental mixtures of Windows and Bash-on-Windows
@@ -37,8 +35,12 @@
[[ $TEMP && ( $Temp || $temp ) ]] && unset TEMP
[[ $TMP && ( $Tmp || $tmp ) ]] && unset TMP
# Ensure that CI_CMAKE_GENERATOR_PLATFORM is initialized for this generator.
- [[ $CI_CMAKE_GENERATOR_PLATFORM ]] ||
+ [[ $CI_CMAKE_GENERATOR_PLATFORM ]] || {
ci_err_internal "missing \$CI_CMAKE_GENERATOR_PLATFORM"
+ }
+ elif [[ -x $(command -v ninja) ]]
+ then
+ CI_CMAKE_GENERATOR="${CI_CMAKE_GENERATOR:-Ninja}"
fi
}
@@ -67,88 +69,108 @@
ci_info "environment option: \$CI_AR: '$CI_AR'"
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
+ ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
ci_info "executable: \$CI_CMAKE: $(command -V "$CI_CMAKE")"
ci_info "executable: \$CI_CTEST: $(command -V "$CI_CTEST")"
- [[ $CI_CC ]] &&
+ [[ $CI_CC ]] && {
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
- [[ $CI_AR ]] &&
+ }
+ [[ $CI_AR ]] && {
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
- [[ $CI_RANLIB ]] &&
+ }
+ [[ $CI_RANLIB ]] && {
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
+ }
ci_info "## END OF CONFIGURATION ##"
}
function ci_cleanup_old_build {
- if [[ -e $CI_BUILD_DIR || -e $CI_INSTALL_DIR ]]
- then
- ci_info "## START OF PRE-BUILD CLEANUP ##"
+ ci_info "## START OF PRE-BUILD CLEANUP ##"
+ [[ ! -e $CI_BUILD_DIR && ! -e $CI_INSTALL_DIR ]] || {
ci_spawn rm -fr "$CI_BUILD_DIR"
ci_spawn rm -fr "$CI_INSTALL_DIR"
- ci_info "## END OF PRE-BUILD CLEANUP ##"
- fi
+ }
+ ci_info "## END OF PRE-BUILD CLEANUP ##"
}
function ci_build {
ci_info "## START OF BUILD ##"
- ci_spawn "$(command -v "$CI_CMAKE")" --version
- ci_spawn "$(command -v "$CI_CTEST")" --version
- [[ $CI_CMAKE_GENERATOR == *"Ninja"* ]] &&
- ci_spawn "$(command -v ninja)" --version
- # Initialize ALL_CC_FLAGS as a string.
- local ALL_CC_FLAGS="$CI_CC_FLAGS"
- [[ $CI_SANITIZERS ]] &&
- ALL_CC_FLAGS="-fsanitize=$CI_SANITIZERS $ALL_CC_FLAGS"
- # Initialize ALL_CMAKE_VARS, ALL_CMAKE_BUILD_FLAGS and ALL_CTEST_FLAGS as arrays.
- local ALL_CMAKE_VARS=()
- [[ $CI_CMAKE_TOOLCHAIN_FILE ]] &&
- ALL_CMAKE_VARS+=(-DCMAKE_TOOLCHAIN_FILE="$CI_CMAKE_TOOLCHAIN_FILE")
- [[ $CI_CC ]] &&
- ALL_CMAKE_VARS+=(-DCMAKE_C_COMPILER="$CI_CC")
- [[ $ALL_CC_FLAGS ]] &&
- ALL_CMAKE_VARS+=(-DCMAKE_C_FLAGS="$ALL_CC_FLAGS")
+ # Adjust the CI environment variables, as needed.
+ CI_CMAKE="$(command -v "$CI_CMAKE")" || ci_err "bad or missing \$CI_CMAKE"
+ ci_spawn "$CI_CMAKE" --version
+ CI_CTEST="$(command -v "$CI_CTEST")" || ci_err "bad or missing \$CI_CTEST"
+ ci_spawn "$CI_CTEST" --version
+ [[ $CI_CMAKE_GENERATOR == *"Ninja"* ]] && {
+ CI_NINJA="$(command -v ninja)" || ci_err "bad or missing ninja, no pun intended"
+ ci_spawn "$CI_NINJA" --version
+ }
[[ $CI_AR ]] && {
- # Use the full path of CI_AR to work around a CMake error.
- ALL_CMAKE_VARS+=(-DCMAKE_AR="$(command -v "$CI_AR")")
+ # Use the full path of CI_AR to work around a mysterious CMake error.
+ CI_AR="$(command -v "$CI_AR")" || ci_err "bad or missing \$CI_AR"
}
[[ $CI_RANLIB ]] && {
- # Use the full path of CI_RANLIB to work around a CMake error.
- ALL_CMAKE_VARS+=(-DCMAKE_RANLIB="$(command -v "$CI_RANLIB")")
+ # Use the full path of CI_RANLIB to work around a mysterious CMake error.
+ CI_RANLIB="$(command -v "$CI_RANLIB")" || ci_err "bad or missing \$CI_RANLIB"
}
- ALL_CMAKE_VARS+=(-DCMAKE_BUILD_TYPE="$CI_CMAKE_BUILD_TYPE")
- ALL_CMAKE_VARS+=(-DCMAKE_VERBOSE_MAKEFILE=ON)
- ALL_CMAKE_VARS+=($CI_CMAKE_VARS)
- local ALL_CMAKE_BUILD_FLAGS=($CI_CMAKE_BUILD_FLAGS)
- local ALL_CTEST_FLAGS=($CI_CTEST_FLAGS)
# Export the CMake environment variables.
- [[ $CI_CMAKE_GENERATOR ]] &&
+ [[ $CI_CMAKE_GENERATOR ]] && {
ci_spawn export CMAKE_GENERATOR="$CI_CMAKE_GENERATOR"
- [[ $CI_CMAKE_GENERATOR_PLATFORM ]] &&
+ }
+ [[ $CI_CMAKE_GENERATOR_PLATFORM ]] && {
ci_spawn export CMAKE_GENERATOR_PLATFORM="$CI_CMAKE_GENERATOR_PLATFORM"
- # Build!
+ }
+ # Initialize and populate the local arrays.
+ local all_cmake_vars=()
+ local all_cmake_build_flags=()
+ local all_ctest_flags=()
+ [[ $CI_CMAKE_TOOLCHAIN_FILE ]] && {
+ all_cmake_vars+=("-DCMAKE_TOOLCHAIN_FILE=$CI_CMAKE_TOOLCHAIN_FILE")
+ }
+ [[ $CI_CC ]] && {
+ all_cmake_vars+=("-DCMAKE_C_COMPILER=$CI_CC")
+ }
+ [[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && {
+ [[ $CI_SANITIZERS ]] && CI_CC_FLAGS+="${CI_CC_FLAGS:+" "}-fsanitize=$CI_SANITIZERS"
+ all_cmake_vars+=("-DCMAKE_C_FLAGS=$CI_CC_FLAGS")
+ }
+ [[ $CI_AR ]] && {
+ all_cmake_vars+=("-DCMAKE_AR=$CI_AR")
+ }
+ [[ $CI_RANLIB ]] && {
+ all_cmake_vars+=("-DCMAKE_RANLIB=$CI_RANLIB")
+ }
+ all_cmake_vars+=("-DCMAKE_BUILD_TYPE=$CI_CMAKE_BUILD_TYPE")
+ all_cmake_vars+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
+ all_cmake_vars+=($CI_CMAKE_VARS)
+ all_cmake_build_flags+=($CI_CMAKE_BUILD_FLAGS)
+ all_ctest_flags+=($CI_CTEST_FLAGS)
+ # And... build!
# Use $CI_BUILD_TO_SRC_RELDIR and $CI_BUILD_TO_INSTALL_RELDIR
# instead of $CI_SRC_DIR and $CI_INSTALL_DIR from this point onwards.
ci_spawn mkdir -p "$CI_BUILD_DIR"
ci_spawn cd "$CI_BUILD_DIR"
- [[ $CI_BUILD_TO_SRC_RELDIR -ef $CI_SRC_DIR ]] ||
+ [[ $CI_BUILD_TO_SRC_RELDIR -ef $CI_SRC_DIR ]] || {
ci_err_internal "bad or missing \$CI_BUILD_TO_SRC_RELDIR"
+ }
ci_spawn mkdir -p "$CI_INSTALL_DIR"
- [[ $CI_BUILD_TO_INSTALL_RELDIR -ef $CI_INSTALL_DIR ]] ||
+ [[ $CI_BUILD_TO_INSTALL_RELDIR -ef $CI_INSTALL_DIR ]] || {
ci_err_internal "bad or missing \$CI_BUILD_TO_INSTALL_RELDIR"
+ }
# Spawn "cmake ...".
ci_spawn "$CI_CMAKE" -DCMAKE_INSTALL_PREFIX="$CI_BUILD_TO_INSTALL_RELDIR" \
- "${ALL_CMAKE_VARS[@]}" \
+ "${all_cmake_vars[@]}" \
"$CI_BUILD_TO_SRC_RELDIR"
# Spawn "cmake --build ...".
ci_spawn "$CI_CMAKE" --build . \
--config "$CI_CMAKE_BUILD_TYPE" \
- "${ALL_CMAKE_BUILD_FLAGS[@]}"
+ "${all_cmake_build_flags[@]}"
ci_expr $((CI_NO_TEST)) || {
# Spawn "ctest" if testing is not disabled.
ci_spawn "$CI_CTEST" --build-config "$CI_CMAKE_BUILD_TYPE" \
- "${ALL_CTEST_FLAGS[@]}"
+ "${all_ctest_flags[@]}"
}
ci_expr $((CI_NO_INSTALL)) || {
# Spawn "cmake --build ... --target install" if installation is not disabled.
@@ -155,7 +177,7 @@
ci_spawn "$CI_CMAKE" --build . \
--config "$CI_CMAKE_BUILD_TYPE" \
--target install \
- "${ALL_CMAKE_BUILD_FLAGS[@]}"
+ "${all_cmake_build_flags[@]}"
}
ci_expr $((CI_NO_CLEAN)) || {
# Spawn "make --build ... --target clean" if cleaning is not disabled.
@@ -162,14 +184,15 @@
ci_spawn "$CI_CMAKE" --build . \
--config "$CI_CMAKE_BUILD_TYPE" \
--target clean \
- "${ALL_CMAKE_BUILD_FLAGS[@]}"
+ "${all_cmake_build_flags[@]}"
}
ci_info "## END OF BUILD ##"
}
function usage {
- echo "usage: $CI_SCRIPT_NAME"
- exit 0
+ echo "usage: $CI_SCRIPT_NAME [<options>]"
+ echo "options: -?|-h|--help"
+ exit "${@:-0}"
}
function main {
@@ -177,15 +200,17 @@
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
- [[ $1 == -[?h]* || $1 == --help ]] && usage
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
+ # And... go!
ci_init_build
ci_trace_build
[[ $# -eq 0 ]] || {
- ci_info "note: this program accepts environment options only"
- ci_err "unexpected argument: '$1'"
+ echo >&2 "error: unexpected argument: '$1'"
+ echo >&2 "note: this program accepts environment options only"
+ usage 2
}
ci_cleanup_old_build
ci_build
Modified: trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_configure.sh
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_configure.sh 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_configure.sh 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-set -e
+set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2024 Cosmin Truta.
#
@@ -8,7 +8,7 @@
#
# SPDX-License-Identifier: MIT
-# shellcheck source="ci/lib/ci.lib.sh"
+# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/lib/ci.lib.sh"
cd "$CI_TOPLEVEL_DIR"
@@ -26,10 +26,12 @@
[[ -x $(command -v cc) ]] && CI_CC="${CI_CC:-cc}"
}
# Ensure that the CI_ variables that cannot be customized reliably are not initialized.
- [[ ! $CI_CONFIGURE_VARS ]] ||
+ [[ ! $CI_CONFIGURE_VARS ]] || {
ci_err "unsupported: \$CI_CONFIGURE_VARS='$CI_CONFIGURE_VARS'"
- [[ ! $CI_MAKE_VARS ]] ||
+ }
+ [[ ! $CI_MAKE_VARS ]] || {
ci_err "unsupported: \$CI_MAKE_VARS='$CI_MAKE_VARS'"
+ }
}
function ci_trace_build {
@@ -55,31 +57,54 @@
ci_info "environment option: \$CI_LD: '$CI_LD'"
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
+ ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
- [[ $CI_CC ]] &&
+ [[ $CI_CC ]] && {
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
- [[ $CI_CPP ]] &&
+ }
+ [[ $CI_CPP ]] && {
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
- [[ $CI_AR ]] &&
+ }
+ [[ $CI_AR ]] && {
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
- [[ $CI_RANLIB ]] &&
+ }
+ [[ $CI_RANLIB ]] && {
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
- [[ $CI_LD ]] &&
+ }
+ [[ $CI_LD ]] && {
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
+ }
ci_info "## END OF CONFIGURATION ##"
}
function ci_cleanup_old_build {
- if [[ -e $CI_BUILD_DIR || -e $CI_INSTALL_DIR ]]
- then
- ci_info "## START OF PRE-BUILD CLEANUP ##"
+ ci_info "## START OF PRE-BUILD CLEANUP ##"
+ [[ ! -e $CI_BUILD_DIR && ! -e $CI_INSTALL_DIR ]] || {
ci_spawn rm -fr "$CI_BUILD_DIR"
ci_spawn rm -fr "$CI_INSTALL_DIR"
- ci_info "## END OF PRE-BUILD CLEANUP ##"
- fi
+ }
+ [[ ! -e "$CI_SRC_DIR/config.status" ]] || {
+ ci_warn "unexpected build configuration file: '$CI_SRC_DIR/config.status'"
+ if ci_expr $((CI_FORCE))
+ then
+ # Delete the old config and (possibly) the old build.
+ ci_info "note: forcing an in-tree build cleanup"
+ if [[ -f $CI_SRC_DIR/Makefile ]]
+ then
+ ci_spawn make -C "$CI_SRC_DIR" distclean
+ else
+ ci_spawn rm -fr "$CI_SRC_DIR"/config.{log,status}
+ fi
+ else
+ # Alert the user, but do not delete their files.
+ ci_warn "the configure script might fail"
+ ci_info "hint: consider using the option \$CI_FORCE=1"
+ fi
+ }
+ ci_info "## END OF PRE-BUILD CLEANUP ##"
}
function ci_build {
@@ -94,10 +119,10 @@
[[ $CI_LD ]] && ci_spawn export LD="$CI_LD"
[[ $CI_LD_FLAGS ]] && ci_spawn export LDFLAGS="$CI_LD_FLAGS"
[[ $CI_SANITIZERS ]] && {
- ci_spawn export CFLAGS="-fsanitize=$CI_SANITIZERS ${CFLAGS:-"-O2"}"
- ci_spawn export LDFLAGS="-fsanitize=$CI_SANITIZERS $LDFLAGS"
+ ci_spawn export CFLAGS="${CFLAGS:-"-O2"} -fsanitize=$CI_SANITIZERS"
+ ci_spawn export LDFLAGS="${LDFLAGS}${LDFLAGS:+" "}-fsanitize=$CI_SANITIZERS"
}
- # Build!
+ # And... build!
ci_spawn mkdir -p "$CI_BUILD_DIR"
ci_spawn cd "$CI_BUILD_DIR"
# Spawn "configure".
@@ -121,8 +146,9 @@
}
function usage {
- echo "usage: $CI_SCRIPT_NAME"
- exit 0
+ echo "usage: $CI_SCRIPT_NAME [<options>]"
+ echo "options: -?|-h|--help"
+ exit "${@:-0}"
}
function main {
@@ -130,7 +156,7 @@
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
- [[ $1 == -[?h]* || $1 == --help ]] && usage
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
@@ -138,8 +164,9 @@
ci_init_build
ci_trace_build
[[ $# -eq 0 ]] || {
- ci_info "note: this program accepts environment options only"
- ci_err "unexpected argument: '$1'"
+ echo >&2 "error: unexpected argument: '$1'"
+ echo >&2 "note: this program accepts environment options only"
+ usage 2
}
ci_cleanup_old_build
ci_build
Modified: trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_makefiles.sh
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_makefiles.sh 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_makefiles.sh 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-set -e
+set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2024 Cosmin Truta.
#
@@ -8,7 +8,7 @@
#
# SPDX-License-Identifier: MIT
-# shellcheck source="ci/lib/ci.lib.sh"
+# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/lib/ci.lib.sh"
cd "$CI_TOPLEVEL_DIR"
@@ -50,19 +50,25 @@
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
ci_info "environment option: \$CI_LIBS: '$CI_LIBS'"
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
+ ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
- [[ $CI_CC ]] &&
+ [[ $CI_CC ]] && {
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
- [[ $CI_CPP ]] &&
+ }
+ [[ $CI_CPP ]] && {
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
- [[ $CI_AR ]] &&
+ }
+ [[ $CI_AR ]] && {
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
- [[ $CI_RANLIB ]] &&
+ }
+ [[ $CI_RANLIB ]] && {
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
- [[ $CI_LD ]] &&
+ }
+ [[ $CI_LD ]] && {
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
+ }
ci_info "## END OF CONFIGURATION ##"
}
@@ -74,61 +80,87 @@
# Fortunately, for a clean makefiles-based build, it should be
# sufficient to remove the old object files only.
ci_info "## START OF PRE-BUILD CLEANUP ##"
- local MY_FILE
- find "$CI_SRC_DIR" -maxdepth 1 \( -iname "*.o" -o -iname "*.obj" \) |
- while IFS="" read -r MY_FILE
- do
- ci_spawn rm -fr "$MY_FILE"
- done
- ci_info "## END OF PRE-BUILD CLEANUP ##"
+ local find_args=(-maxdepth 1 \( -iname "*.o" -o -iname "*.obj" \))
+ [[ ! $(find "$CI_SRC_DIR" "${find_args[@]}" | head -n1) ]] || {
+ ci_warn "unexpected build found in '$CI_SRC_DIR'"
+ if ci_expr $((CI_FORCE))
+ then
+ # Delete the old build.
+ local my_file
+ find "$CI_SRC_DIR" "${find_args[@]}" |
+ while IFS="" read -r my_file
+ do
+ ci_spawn rm -fr "$my_file"
+ done
+ ci_info "## END OF PRE-BUILD CLEANUP ##"
+ else
+ # Alert the user, but do not delete their existing files,
+ # and do not mess up their existing build.
+ ci_info "hint: consider using the option \$CI_FORCE=1"
+ ci_err "unable to continue"
+ fi
+ }
}
function ci_build {
ci_info "## START OF BUILD ##"
- # Initialize ALL_CC_FLAGS and ALL_LD_FLAGS as strings.
- local ALL_CC_FLAGS="$CI_CC_FLAGS"
- local ALL_LD_FLAGS="$CI_LD_FLAGS"
- [[ $CI_SANITIZERS ]] && {
- ALL_CC_FLAGS="-fsanitize=$CI_SANITIZERS ${ALL_CC_FLAGS:-"-O2"}"
- ALL_LD_FLAGS="-fsanitize=$CI_SANITIZERS $ALL_LD_FLAGS"
+ # Initialize and populate the local arrays.
+ local all_make_flags=()
+ local all_make_vars=()
+ [[ $CI_MAKE_FLAGS ]] && {
+ all_make_flags+=($CI_MAKE_FLAGS)
}
- # Initialize ALL_MAKE_FLAGS and ALL_MAKE_VARS as arrays.
- local ALL_MAKE_FLAGS=($CI_MAKE_FLAGS)
- local ALL_MAKE_VARS=()
- [[ $CI_CC ]] && ALL_MAKE_VARS+=(CC="$CI_CC")
- [[ $ALL_CC_FLAGS ]] && ALL_MAKE_VARS+=(CFLAGS="$ALL_CC_FLAGS")
- [[ $CI_CPP ]] && ALL_MAKE_VARS+=(CPP="$CI_CPP")
- [[ $CI_CPP_FLAGS ]] && ALL_MAKE_VARS+=(CPPFLAGS="$CI_CPP_FLAGS")
- [[ $CI_AR ]] && ALL_MAKE_VARS+=(
- AR="${CI_AR:-ar}"
- AR_RC="${CI_AR:-ar} rc"
- )
- [[ $CI_RANLIB ]] && ALL_MAKE_VARS+=(RANLIB="$CI_RANLIB")
- [[ $CI_LD ]] && ALL_MAKE_VARS+=(LD="$CI_LD")
- [[ $ALL_LD_FLAGS ]] && ALL_MAKE_VARS+=(LDFLAGS="$ALL_LD_FLAGS")
- [[ $CI_LIBS ]] && ALL_MAKE_VARS+=(LIBS="$CI_LIBS")
- ALL_MAKE_VARS+=($CI_MAKE_VARS)
- # Build!
- local MY_MAKEFILE
- for MY_MAKEFILE in $CI_MAKEFILES
+ [[ $CI_CC ]] && {
+ all_make_vars+=("CC=$CI_CC")
+ }
+ [[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && {
+ [[ $CI_SANITIZERS ]] && CI_CC_FLAGS="${CI_CC_FLAGS:-"-O2"} -fsanitize=$CI_SANITIZERS"
+ all_make_vars+=("CFLAGS=$CI_CC_FLAGS")
+ }
+ [[ $CI_CPP ]] && {
+ all_make_vars+=("CPP=$CI_CPP")
+ }
+ [[ $CI_CPP_FLAGS ]] && {
+ all_make_vars+=("CPPFLAGS=$CI_CPP_FLAGS")
+ }
+ [[ $CI_AR ]] && {
+ all_make_vars+=("AR=$CI_AR")
+ }
+ [[ $CI_RANLIB ]] && {
+ all_make_vars+=("RANLIB=$CI_RANLIB")
+ }
+ [[ $CI_LD ]] && {
+ all_make_vars+=("LD=$CI_LD")
+ }
+ [[ $CI_LD_FLAGS || $CI_SANITIZERS ]] && {
+ [[ $CI_SANITIZERS ]] && CI_LD_FLAGS+="${CI_LD_FLAGS:+" "}-fsanitize=$CI_SANITIZERS"
+ all_make_vars+=("LDFLAGS=$CI_LD_FLAGS")
+ }
+ [[ $CI_LIBS ]] && {
+ all_make_vars+=("LIBS=$CI_LIBS")
+ }
+ all_make_vars+=($CI_MAKE_VARS)
+ # And... build!
+ local my_makefile
+ for my_makefile in $CI_MAKEFILES
do
- ci_info "using makefile: $MY_MAKEFILE"
+ ci_info "using makefile: $my_makefile"
# Spawn "make".
- ci_spawn "$CI_MAKE" -f "$MY_MAKEFILE" \
- "${ALL_MAKE_FLAGS[@]}" \
- "${ALL_MAKE_VARS[@]}"
+ ci_spawn "$CI_MAKE" -f "$my_makefile" \
+ "${all_make_flags[@]}" \
+ "${all_make_vars[@]}"
ci_expr $((CI_NO_TEST)) || {
# Spawn "make test" if testing is not disabled.
- ci_spawn "$CI_MAKE" -f "$MY_MAKEFILE" \
- "${ALL_MAKE_FLAGS[@]}" \
- "${ALL_MAKE_VARS[@]}" \
+ ci_spawn "$CI_MAKE" -f "$my_makefile" \
+ "${all_make_flags[@]}" \
+ "${all_make_vars[@]}" \
test
}
ci_expr $((CI_NO_CLEAN)) || {
# Spawn "make clean" if cleaning is not disabled.
- ci_spawn "$CI_MAKE" -f "$MY_MAKEFILE" \
- "${ALL_MAKE_FLAGS[@]}" \
- "${ALL_MAKE_VARS[@]}" \
+ ci_spawn "$CI_MAKE" -f "$my_makefile" \
+ "${all_make_flags[@]}" \
+ "${all_make_vars[@]}" \
clean
}
done
@@ -136,8 +168,9 @@
}
function usage {
- echo "usage: $CI_SCRIPT_NAME"
- exit 0
+ echo "usage: $CI_SCRIPT_NAME [<options>]"
+ echo "options: -?|-h|--help"
+ exit "${@:-0}"
}
function main {
@@ -145,7 +178,7 @@
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
- [[ $1 == -[?h]* || $1 == --help ]] && usage
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
@@ -153,8 +186,9 @@
ci_init_build
ci_trace_build
[[ $# -eq 0 ]] || {
- ci_info "note: this program accepts environment options only"
- ci_err "unexpected argument: '$1'"
+ echo >&2 "error: unexpected argument: '$1'"
+ echo >&2 "note: this program accepts environment options only"
+ usage 2
}
ci_cleanup_old_build
ci_build
Added: trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_version.sh
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_version.sh (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/ci/ci_verify_version.sh 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,163 @@
+#!/usr/bin/env bash
+set -o errexit -o pipefail -o posix
+
+# Copyright (c) 2019-2024 Cosmin Truta.
+#
+# Use, modification and distribution are subject to the MIT License.
+# Please see the accompanying file LICENSE_MIT.txt
+#
+# SPDX-License-Identifier: MIT
+
+# shellcheck source=ci/lib/ci.lib.sh
+source "$(dirname "$0")/lib/ci.lib.sh"
+cd "$CI_TOPLEVEL_DIR"
+
+function ci_init_shellify {
+ [[ -f $CI_SCRIPT_DIR/ci_shellify.sh ]] || {
+ ci_err_internal "missing script: '$CI_SCRIPT_DIR/ci_shellify.sh'"
+ }
+}
+
+function ci_run_shellify {
+ ci_info "shellifying:" "$@"
+ local my_result
+ "$BASH" "$CI_SCRIPT_DIR/ci_shellify.sh" "$@"
+ echo "$my_result" | "$BASH" --posix || ci_err "bad shellify output"
+ echo "$my_result"
+}
+
+function ci_verify_version {
+ ci_info "## START OF VERIFICATION ##"
+ local my_env_libpng_ver my_env_autoconf_ver my_env_cmake_ver my_expect
+ ci_init_shellify
+ my_env_libpng_ver="$(ci_run_shellify png.h)"
+ echo "$my_env_libpng_ver"
+ my_env_autoconf_ver="$(ci_run_shellify configure.ac)"
+ echo "$my_env_autoconf_ver"
+ my_env_cmake_ver="$(ci_run_shellify CMakeLists.txt)"
+ echo "$my_env_cmake_ver"
+ ci_info "## VERIFYING: png.h version definitions ##"
+ eval "$my_env_libpng_ver"
+ local my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}"
+ if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect"* ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_VER_STRING == $my_expect*"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_VER_STRING != $my_expect*"
+ fi
+ my_expect=$((PNG_LIBPNG_VER_MAJOR*10000 + PNG_LIBPNG_VER_MINOR*100 + PNG_LIBPNG_VER_RELEASE))
+ if [[ "$PNG_LIBPNG_VER" == "$my_expect" ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_VER == $my_expect"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_VER != $my_expect"
+ fi
+ my_expect=$((PNG_LIBPNG_VER_MAJOR*10 + PNG_LIBPNG_VER_MINOR))
+ if [[ "$PNG_LIBPNG_VER_SHAREDLIB" == "$my_expect" ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_VER_SHAREDLIB == $my_expect"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_VER_SHAREDLIB != $my_expect"
+ fi
+ if [[ "$PNG_LIBPNG_VER_SONUM" == "$my_expect" ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_VER_SONUM == $my_expect"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_VER_SONUM != $my_expect"
+ fi
+ if [[ "$PNG_LIBPNG_VER_DLLNUM" == "$my_expect" ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_VER_DLLNUM == $my_expect"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_VER_DLLNUM != $my_expect"
+ fi
+ if [[ "$PNG_LIBPNG_VER_BUILD" == [01] ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_VER_BUILD == [01]"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD != [01]"
+ fi
+ ci_info "## VERIFYING: png.h build definitions ##"
+ my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}"
+ if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect" ]]
+ then
+ if [[ $PNG_LIBPNG_VER_BUILD -eq 0 ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_VER_BUILD -eq 0"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD -ne 0"
+ fi
+ if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -eq $PNG_LIBPNG_BUILD_STABLE ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_BETA"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_BETA"
+ fi
+ elif [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect".git ]]
+ then
+ if [[ $PNG_LIBPNG_VER_BUILD -ne 0 ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_VER_BUILD -ne 0"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD -eq 0"
+ fi
+ if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -eq $PNG_LIBPNG_BUILD_BETA ]]
+ then
+ ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_BETA"
+ else
+ ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_BETA"
+ fi
+ else
+ ci_err "unexpected: \$PNG_LIBPNG_VER_STRING == '$PNG_LIBPNG_VER_STRING'"
+ fi
+ ci_info "## VERIFYING: png.h type definitions ##"
+ my_expect="$(echo "png_libpng_version_${PNG_LIBPNG_VER_STRING}" | tr . _)"
+ ci_spawn grep -w -e "$my_expect" png.h
+ ci_info "## VERIFYING: configure.ac version definitions ##"
+ eval "$my_env_autoconf_ver"
+ if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" ]]
+ then
+ ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING"
+ else
+ ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING"
+ fi
+ ci_info "## VERIFYING: CMakeLists.txt version definitions ##"
+ eval "$my_env_cmake_ver"
+ if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" && "$PNGLIB_SUBREVISION" == 0 ]]
+ then
+ ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING"
+ ci_info "matched: \$PNGLIB_SUBREVISION == 0"
+ elif [[ "$PNGLIB_VERSION.$PNGLIB_SUBREVISION" == "$PNG_LIBPNG_VER_STRING" ]]
+ then
+ ci_info "matched: \$PNGLIB_VERSION.\$PNGLIB_SUBREVISION == \$PNG_LIBPNG_VER_STRING"
+ else
+ ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING"
+ fi
+ ci_info "## END OF VERIFICATION ##"
+ ci_info "success!"
+}
+
+function usage {
+ echo "usage: $CI_SCRIPT_NAME [<options>]"
+ echo "options: -?|-h|--help"
+ exit "${@:-0}"
+}
+
+function main {
+ local opt
+ while getopts ":" opt
+ do
+ # This ain't a while-loop. It only pretends to be.
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
+ ci_err "unknown option: '$1'"
+ done
+ shift $((OPTIND - 1))
+ [[ $# -eq 0 ]] || {
+ echo >&2 "error: unexpected argument: '$1'"
+ usage 2
+ }
+ # And... go!
+ ci_verify_version
+}
+
+main "$@"
Modified: trunk/Build/source/libs/libpng/libpng-src/ci/lib/ci.lib.sh
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/ci/lib/ci.lib.sh 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/ci/lib/ci.lib.sh 2024-02-24 01:06:57 UTC (rev 70115)
@@ -5,10 +5,12 @@
#
# SPDX-License-Identifier: MIT
-test -f "$BASH_SOURCE" ||
+test -f "$BASH_SOURCE" || {
echo >&2 "warning: this module requires Bash version 3 or newer"
-test "${#BASH_SOURCE[@]}" -gt 1 ||
+}
+test "${#BASH_SOURCE[@]}" -gt 1 || {
echo >&2 "warning: this module should be sourced from a Bash script"
+}
# Reset the locale to avoid surprises from locale-dependent commands.
export LC_ALL=C
@@ -72,19 +74,29 @@
}
# Ensure that the internal initialization is correct.
-[[ $CI_TOPLEVEL_DIR/ci/lib/ci.lib.sh -ef ${BASH_SOURCE[0]} ]] ||
+[[ $CI_TOPLEVEL_DIR/ci/lib/ci.lib.sh -ef ${BASH_SOURCE[0]} ]] || {
ci_err_internal "bad or missing \$CI_TOPLEVEL_DIR"
-[[ $CI_SCRIPT_DIR/$CI_SCRIPT_NAME -ef $0 ]] ||
+}
+[[ $CI_SCRIPT_DIR/$CI_SCRIPT_NAME -ef $0 ]] || {
ci_err_internal "bad or missing \$CI_SCRIPT_DIR/\$CI_SCRIPT_NAME"
-[[ $CI_BUILD_ARCH && $CI_BUILD_SYSTEM ]] ||
+}
+[[ $CI_BUILD_ARCH && $CI_BUILD_SYSTEM ]] || {
ci_err_internal "missing \$CI_BUILD_ARCH or \$CI_BUILD_SYSTEM"
-[[ $CI_TARGET_ARCH && $CI_TARGET_SYSTEM ]] ||
+}
+[[ $CI_TARGET_ARCH && $CI_TARGET_SYSTEM ]] || {
ci_err_internal "missing \$CI_TARGET_ARCH or \$CI_TARGET_SYSTEM"
+}
# Ensure that the user initialization is correct.
-[[ ${CI_NO_TEST:-0} == [01] ]] ||
+[[ ${CI_FORCE:-0} == [01] ]] || {
+ ci_err "bad boolean option: \$CI_FORCE: '$CI_FORCE'"
+}
+[[ ${CI_NO_TEST:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_NO_TEST: '$CI_NO_TEST'"
-[[ ${CI_NO_INSTALL:-0} == [01] ]] ||
+}
+[[ ${CI_NO_INSTALL:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
-[[ ${CI_NO_CLEAN:-0} == [01] ]] ||
+}
+[[ ${CI_NO_CLEAN:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
+}
Modified: trunk/Build/source/libs/libpng/libpng-src/configure.ac
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/configure.ac 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/configure.ac 2024-02-24 01:06:57 UTC (rev 70115)
@@ -25,7 +25,7 @@
dnl Version number stuff here:
-AC_INIT([libpng],[1.6.42],[png-mng-implement at lists.sourceforge.net])
+AC_INIT([libpng],[1.6.43],[png-mng-implement at lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts/autoconf])
# libpng does not follow GNU file name conventions (hence 'foreign')
@@ -46,10 +46,10 @@
dnl AM_PREREQ([1.11.2])
dnl stop configure from automagically running automake
-PNGLIB_VERSION=1.6.42
+PNGLIB_VERSION=1.6.43
PNGLIB_MAJOR=1
PNGLIB_MINOR=6
-PNGLIB_RELEASE=41
+PNGLIB_RELEASE=43
dnl End of version number stuff
@@ -56,7 +56,7 @@
AC_CONFIG_SRCDIR([pngget.c])
AC_CONFIG_HEADERS([config.h])
-# Checks for programs.
+# Check for basic programs.
AC_LANG([C])
AC_PROG_CC
AM_PROG_AS
@@ -72,16 +72,19 @@
LT_INIT([win32-dll])
LT_PREREQ([2.4.2])
-# Some awks crash when confronted with pnglibconf.dfa, do a test run now
-# to make sure this doesn't happen
-AC_MSG_CHECKING([that AWK works])
+dnl Declare the AWK variable.
+AC_ARG_VAR(AWK, [AWK language processor])
+
+# Some awk implementations crash when confronted with pnglibconf.dfa.
+# Run a test now, to make sure this doesn't happen.
+AC_MSG_CHECKING([if awk ($AWK) works])
if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
${srcdir}/pngusr.dfa 1>&2
then
- AC_MSG_RESULT([ok])
+ AC_MSG_RESULT([yes])
else
- AC_MSG_FAILURE([failed], 1)
+ AC_MSG_FAILURE([no], 1)
fi
# This is a remnant of the old cc -E validation, where it may have been
@@ -111,7 +114,7 @@
# (it checks the compiler with a program that generates a warning).
# Add the following option to deal with this:
AC_ARG_VAR(PNG_COPTS,
- [additional flags for the C compiler, use this for options that would]
+ [additional flags for the C compiler, to be used for options that would]
[cause configure itself to fail])
AC_ARG_ENABLE(werror,
AS_HELP_STRING([[[--enable-werror[=OPT]]]],
@@ -223,9 +226,9 @@
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} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
+ | ${CPP:-${CC:-gcc} -E} - 2>&1 \
+ | ${EGREP:-grep} "^PREFIX=" \
+ | ${SED:-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
AC_SUBST(SYMBOL_PREFIX)
AC_MSG_RESULT($SYMBOL_PREFIX)
fi
@@ -318,7 +321,7 @@
#
AC_ARG_ENABLE([hardware-optimizations],
AS_HELP_STRING([[[--enable-hardware-optimizations]]],
- [Enable hardware optimizations: =no/off, yes/on:]),
+ [Enable hardware optimizations: =no/off, yes/on.]),
[case "$enableval" in
no|off)
# disable hardware optimization on all systems:
@@ -376,17 +379,16 @@
;;
esac])
-# ARM
-# ===
-#
-# ARM NEON (SIMD) support.
+# ARM NEON
+# ========
AC_ARG_ENABLE([arm-neon],
AS_HELP_STRING([[[--enable-arm-neon]]],
- [Enable ARM NEON optimizations: =no/off, check, api, yes/on:]
- [no/off: disable the optimizations; check: use internal checking code]
- [(deprecated and poorly supported); api: disable by default, enable by]
- [a call to png_set_option; yes/on: turn on unconditionally.]
+ [Enable ARM NEON optimizations: =no/off, check, api, yes/on.]
+ [no/off: disable the optimizations;]
+ [check: use internal checking code (deprecated and poorly supported);]
+ [api: disable by default, enable by a call to png_set_option;]
+ [yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
@@ -404,16 +406,17 @@
yes|on)
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
[Enable ARM Neon optimizations])
- AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api', if]
- [you want the optimizations unconditionally pass -mfpu=neon]
- [to the compiler.]);;
+ AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api';]
+ [if you want the optimizations unconditionally,]
+ [pass '-mfpu=neon' to the compiler.]);;
*)
- AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}: invalid value])
+ AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}:]
+ [invalid argument])
esac])
# Add ARM-specific files to all builds where $host_cpu is arm ('arm*') or
-# where ARM optimizations were explicitly requested (this allows a fallback
-# if a future host CPU does not match 'arm*')
+# where ARM optimizations were explicitly requested. (This allows a fallback
+# if a future host CPU does not match 'arm*'.)
AM_CONDITIONAL([PNG_ARM_NEON],
[test "$enable_arm_neon" != 'no' &&
@@ -422,17 +425,16 @@
*) test "$enable_arm_neon" != '' ;;
esac])
-# MIPS
-# ====
-#
-# MIPS MSA (SIMD) support.
+# MIPS MSA
+# ========
AC_ARG_ENABLE([mips-msa],
AS_HELP_STRING([[[--enable-mips-msa]]],
- [Enable MIPS MSA optimizations: =no/off, check, api, yes/on:]
- [no/off: disable the optimizations; check: use internal checking code]
- [(deprecated and poorly supported); api: disable by default, enable by]
- [a call to png_set_option; yes/on: turn on unconditionally.]
+ [Enable MIPS MSA optimizations: =no/off, check, api, yes/on.]
+ [no/off: disable the optimizations;]
+ [check: use internal checking code (deprecated and poorly supported);]
+ [api: disable by default, enable by a call to png_set_option;]
+ [yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
@@ -450,16 +452,17 @@
yes|on)
AC_DEFINE([PNG_MIPS_MSA_OPT], [2],
[Enable MIPS MSA optimizations])
- AC_MSG_WARN([--enable-mips-msa: please specify 'check' or 'api', if]
- [you want the optimizations unconditionally pass '-mmsa -mfp64']
- [to the compiler.]);;
+ AC_MSG_WARN([--enable-mips-msa: please specify 'check' or 'api';]
+ [if you want the optimizations unconditionally,]
+ [pass '-mmsa -mfp64' to the compiler.]);;
*)
- AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}: invalid value])
+ AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}:]
+ [invalid argument])
esac])
# Add MIPS-specific files to all builds where $host_cpu is mips ('mips*') or
-# where MIPS optimizations were explicitly requested (this allows a fallback
-# if a future host CPU does not match 'mips*')
+# where MIPS optimizations were explicitly requested. (This allows a fallback
+# if a future host CPU does not match 'mips*'.)
AM_CONDITIONAL([PNG_MIPS_MSA],
[test "$enable_mips_msa" != 'no' &&
@@ -467,17 +470,16 @@
mipsel*|mips64el*) : ;;
esac])
-# MIPS
-# ===
-#
-# MIPS MMI (SIMD) support.
+# MIPS MMI
+# ========
AC_ARG_ENABLE([mips-mmi],
AS_HELP_STRING([[[--enable-mips-mmi]]],
- [Enable MIPS MMI optimizations: =no/off, check, api, yes/on:]
- [no/off: disable the optimizations; check: use internal checking code]
- [(deprecated and poorly supported); api: disable by default, enable by]
- [a call to png_set_option; yes/on: turn on unconditionally.]
+ [Enable MIPS MMI optimizations: =no/off, check, api, yes/on.]
+ [no/off: disable the optimizations;]
+ [check: use internal checking code (deprecated and poorly supported);]
+ [api: disable by default, enable by a call to png_set_option;]
+ [yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
@@ -495,31 +497,30 @@
yes|on)
AC_DEFINE([PNG_MIPS_MMI_OPT], [1],
[Enable MIPS MMI optimizations])
- AC_MSG_WARN([--enable-mips-mmi: please specify 'check' or 'api', if]
- [you want the optimizations unconditionally pass '-mloongson-mmi -march=loongson3a']
- [to the compiler.]);;
+ AC_MSG_WARN([--enable-mips-mmi: please specify 'check' or 'api';]
+ [if you want the optimizations unconditionally]
+ [pass '-mloongson-mmi -march=loongson3a' to the compiler.]);;
*)
- AC_MSG_ERROR([--enable-mips-mmi=${enable_mips_mmi}: invalid value])
+ AC_MSG_ERROR([--enable-mips-mmi=${enable_mips_mmi}:]
+ [invalid argument])
esac])
# Add MIPS specific files to all builds where the host_cpu is mips ('mips*') or
-# where MIPS optimizations were explicitly requested (this allows a fallback if a
-# future host CPU does not match 'mips*')
+# where MIPS optimizations were explicitly requested. (This allows a fallback
+# if a future host CPU does not match 'mips*'.)
AM_CONDITIONAL([PNG_MIPS_MMI],
[test "$enable_mips_mmi" != 'no' &&
case "$host_cpu" in
- mipsel*|mips64el*) :;;
+ mipsel*|mips64el*) : ;;
esac])
-# INTEL
-# =====
-#
-# INTEL SSE (SIMD) support.
+# INTEL SSE
+# =========
AC_ARG_ENABLE([intel-sse],
AS_HELP_STRING([[[--enable-intel-sse]]],
- [Enable Intel SSE optimizations: =no/off, yes/on:]
+ [Enable Intel SSE optimizations: =no/off, yes/on.]
[no/off: disable the optimizations;]
[yes/on: enable the optimizations.]
[If not specified: determined by the compiler.]),
@@ -534,12 +535,13 @@
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
[Enable Intel SSE optimizations]);;
*)
- AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
+ AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}:]
+ [invalid argument])
esac])
# Add Intel-specific files to all builds where $host_cpu is Intel ('x86*') or
-# where Intel optimizations were explicitly requested (this allows a fallback
-# if a future host CPU does not match 'x86*')
+# where Intel optimizations were explicitly requested. (This allows a fallback
+# if a future host CPU does not match 'x86*'.)
AM_CONDITIONAL([PNG_INTEL_SSE],
[test "$enable_intel_sse" != 'no' &&
case "$host_cpu" in
@@ -547,16 +549,15 @@
*) test "$enable_intel_sse" != '' ;;
esac])
-# PowerPC
-# =======
-#
-# PowerPC VSX (SIMD) support.
+# POWERPC VSX
+# ===========
AC_ARG_ENABLE([powerpc-vsx],
AS_HELP_STRING([[[--enable-powerpc-vsx]]],
- [Enable POWERPC VSX optimizations: =no/off, check, api, yes/on:]
- [no/off: disable the optimizations; check: use internal checking code]
- [api: disable by default, enable by a call to png_set_option]
+ [Enable POWERPC VSX optimizations: =no/off, check, api, yes/on.]
+ [no/off: disable the optimizations;]
+ [check: use internal checking code;]
+ [api: disable by default, enable by a call to png_set_option;]
[yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
@@ -569,8 +570,8 @@
check)
AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [],
[Check for POWERPC VSX support at run-time])
- AC_MSG_WARN([--enable-powerpc-vsx Please check contrib/powerpc/README file]
- [for the list of supported OSes.]);;
+ AC_MSG_WARN([--enable-powerpc-vsx: please see contrib/powerpc/README]
+ [for the list of supported systems.]);;
api)
AC_DEFINE([PNG_POWERPC_VSX_API_SUPPORTED], [],
[Turn on POWERPC VSX optimizations at run-time]);;
@@ -577,16 +578,17 @@
yes|on)
AC_DEFINE([PNG_POWERPC_VSX_OPT], [2],
[Enable POWERPC VSX optimizations])
- AC_MSG_WARN([--enable-powerpc-vsx: please specify 'check' or 'api', if]
- [you want the optimizations unconditionally pass '-maltivec -mvsx']
- [or '-mcpu=power8' to the compiler.]);;
+ AC_MSG_WARN([--enable-powerpc-vsx: please specify 'check' or 'api';]
+ [if you want the optimizations unconditionally,]
+ [pass '-maltivec -mvsx' or '-mcpu=power8' to the compiler.]);;
*)
- AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}: invalid value])
+ AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}:]
+ [invalid argument])
esac])
-# Add PowerPC-specific files to all builds where $host_cpu is powerpc('powerpc*')
-# or where PowerPC optimizations were explicitly requested (this allows a fallback
-# if a future host CPU does not match 'powerpc*')
+# Add PowerPC-specific files to all builds where $host_cpu is powerpc
+# ('powerpc*') or where PowerPC optimizations were explicitly requested.
+# (This allows a fallback if a future host CPU does not match 'powerpc*'.)
AM_CONDITIONAL([PNG_POWERPC_VSX],
[test "$enable_powerpc_vsx" != 'no' &&
@@ -594,29 +596,9 @@
powerpc*|ppc64*) : ;;
esac])
-# LOONGARCH
-# ===
-#
-# LOONGARCH LSX (SIMD) support
+# LOONGARCH LSX
+# =============
-if test "$LSX_CFLAGS" = ''; then
- LSX_CFLAGS="-mlsx"
-fi
-
-compiler_support_loongarch_lsx=no
-AC_MSG_CHECKING(whether to use loongarch LSX intrinsics)
-save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS $LSX_CFLAGS"
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-#include<lsxintrin.h>
-int main(){
- __m128i a, b, c;
- a = __lsx_vadd_w(b, c);
- return 0;
-}]])],compiler_support_loongarch_lsx=yes)
-CFLAGS=$save_CFLAGS
-AC_MSG_RESULT($compiler_support_loongarch_lsx)
-
AC_ARG_ENABLE([loongarch-lsx],
AS_HELP_STRING([[[--enable-loongarch-lsx]]],
[Enable LOONGARCH LSX optimizations: =no/off, yes/on:]
@@ -635,26 +617,48 @@
[Enable LOONGARCH LSX optimizations])
;;
*)
- AC_MSG_ERROR([--enable-loongarch-lsx=${enable_loongarch_lsx}: invalid value])
+ AC_MSG_ERROR([--enable-loongarch-lsx=${enable_loongarch_lsx}:]
+ [invalid argument])
esac])
-if test "$enable_loongarch_lsx" != 'no'; then
- if test $compiler_support_loongarch_lsx = yes; then
- AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1], [Enable LOONGARCH LSX optimizations])
+if test "$enable_loongarch_lsx" != "no" &&
+ case "$host_cpu" in
+ loongarch*) : ;;
+ *) test "$enable_loongarch_lsx" != '' ;;
+ esac
+then
+ compiler_support_loongarch_lsx=no
+ AC_MSG_CHECKING(whether to use LoongArch LSX intrinsics)
+ save_CFLAGS="$CFLAGS"
+ LSX_CFLAGS="${LSX_CFLAGS:-"-mlsx"}"
+ CFLAGS="$CFLAGS $LSX_CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <lsxintrin.h>
+int main(){
+ __m128i a, b, c;
+ a = __lsx_vadd_w(b, c);
+ return 0;
+}]])],compiler_support_loongarch_lsx=yes)
+ CFLAGS="$save_CFLAGS"
+ AC_MSG_RESULT($compiler_support_loongarch_lsx)
+ if test "$compiler_support_loongarch_lsx" = "yes"; then
+ AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
+ [Enable LOONGARCH LSX optimizations])
else
AC_MSG_WARN([Compiler does not support loongarch LSX.])
fi
fi
-# Add LOONGARCH specific files to all builds where the host_cpu is loongarch ('loongarch*') or
-# where LOONGARCH optimizations were explicitly requested (this allows a fallback if a
-# future host CPU does not match 'loongarch*')
+# Add LoongArch specific files to all builds where the host_cpu is loongarch
+# ('loongarch*') or where LoongArch optimizations were explicitly requested.
+# (This allows a fallback if a future host CPU does not match 'loongarch*'.)
AM_CONDITIONAL([PNG_LOONGARCH_LSX],
- [test "$enable_loongarch_lsx" != 'no' && test $compiler_support_loongarch_lsx = yes &&
+ [test "$enable_loongarch_lsx" != "no" &&
+ test "$compiler_support_loongarch_lsx" = "yes" &&
case "$host_cpu" in
- loongarch*) :;;
- *) test "$enable_loongarch_lsx" != '';;
+ loongarch*) : ;;
+ *) test "$enable_loongarch_lsx" != '' ;;
esac])
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/.editorconfig
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/.editorconfig (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/.editorconfig 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,7 @@
+# https://editorconfig.org
+
+root = false
+
+[*.[ch]]
+max_doc_length = unset
+max_line_length = unset
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/conftest/basic.dfa
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/conftest/basic.dfa (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/conftest/basic.dfa 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,133 @@
+# basic.dfa
+# Build time configuration of libpng
+#
+# Author: John Bowler
+# Copyright: (c) John Bowler, 2024
+# Usage rights:
+# To the extent possible under law, the author has waived all copyright and
+# related or neighboring rights to this work. This work is published from:
+# United States.
+#
+# Build libpng with basic read and write support. This enables the lowest
+# level libpng read and write APIs - the "row-by-row" ones.
+#
+# Support is enabled only for those transformations that are observed to be
+# required by widely used apps or are in the v3 specification.
+#
+
+everything = off
+
+# The sequential read code is enabled here; the progressive code can be used
+# instead but there is no point enabling both.
+
+option READ on
+option SEQUENTIAL_READ on
+option EASY_ACCESS on
+option SET_USER_LIMITS on
+option INFO_IMAGE on
+option READ_16BIT on
+
+# Errors: these can be disabled but then there won't be any error messages
+# just failures and the error messages are really needed for apps:
+option WARNINGS on
+option ERROR_TEXT on
+option BENIGN_READ_ERRORS on
+
+# Required for many display programs such as web browsers:
+option PROGRESSIVE_READ on
+
+# Switch on the write code - this makes a minimalist encoder but with
+# interlace support turned on; otherwise png_read_png..png_write_png will
+# fail on an interlaced image.
+option WRITE on
+option WRITE_INTERLACING on
+option WRITE_16BIT on
+
+# Usages of the 'fixed' APIs are relatively rare but they do occur
+# one or the other for both the API and the internal math.
+
+#Fixed point:
+option FIXED_POINT on
+
+#Floating point:
+option FLOATING_POINT on
+option FLOATING_ARITHMETIC on
+
+# Basic error handling, IO and user memory support. The latter allows the
+# application program to provide its own implementations of 'malloc' and 'free'.
+option SETJMP on
+option STDIO on
+option USER_MEM on
+
+# Gamma handling: this needs to be on for the gamma handling
+option READ_GAMMA on
+
+# The supported chunks
+chunk bKGD on
+chunk cHRM on
+chunk eXIf on
+chunk gAMA on
+chunk iCCP on
+chunk iTXt on
+chunk pHYs on
+chunk sBIT on
+chunk sRGB on
+chunk tEXt on
+chunk tIME on
+chunk tRNS on
+chunk zTXt on
+
+# These don't seem to be used anywhere:
+# chunk pCAL
+# chunk sCAL
+# chunk sPLT
+
+# The rest of this is app dependent: none of these options are required for
+# read/write of the full range of PNG files and the normal chunk handling on
+# read.
+option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
+option WRITE_CUSTOMIZE_COMPRESSION on
+
+option READ_EXPAND on
+option READ_FILLER on
+option READ_GRAY_TO_RGB on
+option READ_INVERT on
+option READ_PACK on
+option READ_RGB_TO_GRAY on
+option READ_SCALE_16_TO_8 on
+option READ_SHIFT on
+option READ_STRIP_16_TO_8 on
+option READ_STRIP_ALPHA on
+option READ_SWAP on
+
+option CONVERT_tIME on
+
+# optipng
+option IO_STATE on
+option STORE_UNKNOWN_CHUNKS on
+option HANDLE_AS_UNKNOWN on
+
+# pngcrush
+option READ_USER_TRANSFORM on
+option WRITE_FLUSH on
+
+# pnmtopng
+chunk hIST on
+
+# cairo
+option WRITE_PACKSWAP on
+option WRITE_USER_TRANSFORM on
+
+# graphicsmagick
+option READ_USER_CHUNKS on
+
+# Qt5.15 qtgui (gentoo package split) Qt6.6 qtbase
+option READ_BGR on
+option WRITE_BGR on
+option READ_SWAP_ALPHA on
+option WRITE_SWAP_ALPHA on
+chunk oFFs on
+
+# ghostscript-gpl
+option WRITE_INVERT_ALPHA on
+option WRITE_INVERT on
Modified: trunk/Build/source/libs/libpng/libpng-src/contrib/examples/iccfrompng.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/examples/iccfrompng.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/examples/iccfrompng.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -80,7 +80,7 @@
}
else
- result = no_profile;
+ result = no_profile;
}
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
@@ -155,7 +155,7 @@
}
else if (verbose && profile == no_profile)
- printf("%s has no profile\n", filename);
+ printf("%s has no profile\n", filename);
}
else
Modified: trunk/Build/source/libs/libpng/libpng-src/contrib/gregbook/rpng-x.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/gregbook/rpng-x.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/gregbook/rpng-x.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -21,7 +21,7 @@
- 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 some small X memory leaks (thanks to Fran\xE7ois Petitjean)
+ - 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)
Modified: trunk/Build/source/libs/libpng/libpng-src/contrib/gregbook/rpng2-x.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/gregbook/rpng2-x.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/gregbook/rpng2-x.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -27,7 +27,7 @@
- 1.11: added -usleep option for demos; fixed command-line parsing bug
- 1.12: added -pause option for demos and testing
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
- - 1.21: fixed some small X memory leaks (thanks to Fran\xE7ois Petitjean)
+ - 1.21: fixed some small X memory leaks (thanks to François Petitjean)
- 1.22: fixed XFreeGC() crash bug (thanks to Patrick Welche)
- 1.23: added -bgpat 0 mode (std white/gray checkerboard, 8x8 squares)
- 1.30: added -loop option for -bgpat (ifdef FEATURE_LOOP); fixed bpp =
Modified: trunk/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/libtests/pngvalid.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -70,9 +70,12 @@
#endif
/* pngvalid requires write support and one of the fixed or floating point APIs.
+ * progressive read is also required currently as the progressive read pointer
+ * is used to record the 'display' structure.
*/
-#if defined(PNG_WRITE_SUPPORTED) &&\
- (defined(PNG_FIXED_POINT_SUPPORTED) || defined(PNG_FLOATING_POINT_SUPPORTED))
+#if defined PNG_WRITE_SUPPORTED &&\
+ (defined PNG_PROGRESSIVE_READ_SUPPORTED) &&\
+ (defined PNG_FIXED_POINT_SUPPORTED || defined PNG_FLOATING_POINT_SUPPORTED)
#if PNG_LIBPNG_VER < 10500
/* This deliberately lacks the const. */
@@ -10009,9 +10012,12 @@
case ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN:
case ALPHA_MODE_OFFSET + PNG_ALPHA_OPTIMIZED:
# endif /* ALPHA_MODE_SUPPORTED */
+# if (defined PNG_READ_BACKGROUND_SUPPORTED) ||\
+ (defined PNG_READ_ALPHA_MODE_SUPPORTED)
do_compose = (alpha > 0 && alpha < 1);
use_input = (alpha != 0);
break;
+# endif
default:
break;
@@ -11924,7 +11930,14 @@
pm.test_gamma_alpha_mode = 0;
else if (strcmp(*argv, "--expand16") == 0)
- pm.test_gamma_expand16 = 1;
+ {
+# ifdef PNG_READ_EXPAND_16_SUPPORTED
+ pm.test_gamma_expand16 = 1;
+# else
+ fprintf(stderr, "pngvalid: --expand16: no read support\n");
+ return SKIP;
+# endif
+ }
else if (strcmp(*argv, "--noexpand16") == 0)
pm.test_gamma_expand16 = 0;
@@ -11939,10 +11952,15 @@
pm.test_lbg_gamma_transform = pm.test_lbg_gamma_sbit =
pm.test_lbg_gamma_composition = 0;
-# ifdef PNG_WRITE_tRNS_SUPPORTED
- else if (strcmp(*argv, "--tRNS") == 0)
+ else if (strcmp(*argv, "--tRNS") == 0)
+ {
+# ifdef PNG_WRITE_tRNS_SUPPORTED
pm.test_tRNS = 1;
-# endif
+# else
+ fprintf(stderr, "pngvalid: --tRNS: no write support\n");
+ return SKIP;
+# endif
+ }
else if (strcmp(*argv, "--notRNS") == 0)
pm.test_tRNS = 0;
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.editorconfig
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.editorconfig (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.editorconfig 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,11 @@
+# https://editorconfig.org
+
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+insert_final_newline = true
+max_doc_length = 79
+max_line_length = 79
+trim_trailing_whitespace = true
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.gitignore
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.gitignore (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.gitignore 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,3 @@
+__pycache__
+*.py[co]
+*$py.class
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.pylintrc
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.pylintrc (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/.pylintrc 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,8 @@
+[COMPATIBILITY]
+disable=consider-using-f-string
+
+[COMPLEXITY]
+disable=too-many-branches,too-many-instance-attributes
+
+[STYLE]
+disable=consider-using-in
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/LICENSE_MIT.txt
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/LICENSE_MIT.txt (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/LICENSE_MIT.txt 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,19 @@
+MIT License
+
+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
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/README.md
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/README.md (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/README.md 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,20 @@
+pngexifinfo
+===========
+
+Show the EXIF information embedded in a PNG file.
+
+
+Sample usage
+------------
+
+Show the EXIF info inside a PNG file:
+
+ pngexifinfo /path/to/file.png
+
+Show the EXIF info inside a raw `.exif` file, using base 16 for the EXIF tags:
+
+ pngexifinfo --hex /path/to/file.exif
+
+Show the help text:
+
+ pngexifinfo --help
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/bytepack.py
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/bytepack.py (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/bytepack.py 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+
+"""
+Byte packing and unpacking utilities.
+
+Copyright (C) 2017-2020 Cosmin Truta.
+
+Use, modification and distribution are subject to the MIT License.
+Please see the accompanying file LICENSE_MIT.txt
+"""
+
+from __future__ import absolute_import, division, print_function
+
+import struct
+
+
+def unpack_uint32be(buffer, offset=0):
+ """Unpack an unsigned int from its 32-bit big-endian representation."""
+ return struct.unpack(">I", buffer[offset:offset + 4])[0]
+
+
+def unpack_uint32le(buffer, offset=0):
+ """Unpack an unsigned int from its 32-bit little-endian representation."""
+ return struct.unpack("<I", buffer[offset:offset + 4])[0]
+
+
+def unpack_uint16be(buffer, offset=0):
+ """Unpack an unsigned int from its 16-bit big-endian representation."""
+ return struct.unpack(">H", buffer[offset:offset + 2])[0]
+
+
+def unpack_uint16le(buffer, offset=0):
+ """Unpack an unsigned int from its 16-bit little-endian representation."""
+ return struct.unpack("<H", buffer[offset:offset + 2])[0]
+
+
+def unpack_uint8(buffer, offset=0):
+ """Unpack an unsigned int from its 8-bit representation."""
+ return struct.unpack("B", buffer[offset:offset + 1])[0]
+
+
+if __name__ == "__main__":
+ # For testing only.
+ assert unpack_uint32be(b"ABCDEF", 1) == 0x42434445
+ assert unpack_uint32le(b"ABCDEF", 1) == 0x45444342
+ assert unpack_uint16be(b"ABCDEF", 1) == 0x4243
+ assert unpack_uint16le(b"ABCDEF", 1) == 0x4342
+ assert unpack_uint8(b"ABCDEF", 1) == 0x42
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/exifinfo.py
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/exifinfo.py (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/exifinfo.py 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,306 @@
+#!/usr/bin/env python
+
+"""
+Show the EXIF information.
+
+Copyright (C) 2017-2020 Cosmin Truta.
+
+Use, modification and distribution are subject to the MIT License.
+Please see the accompanying file LICENSE_MIT.txt
+"""
+
+from __future__ import absolute_import, division, print_function
+
+import sys
+
+from bytepack import (unpack_uint32be,
+ unpack_uint32le,
+ unpack_uint16be,
+ unpack_uint16le,
+ unpack_uint8)
+
+
+# Generously allow the TIFF file to occupy up to a quarter-gigabyte.
+# TODO: Reduce this limit to 64K and use file seeking for anything larger.
+_READ_DATA_SIZE_MAX = 256 * 1024 * 1024
+
+_TIFF_TAG_TYPES = {
+ 1: "byte",
+ 2: "ascii",
+ 3: "short",
+ 4: "long",
+ 5: "rational",
+ 6: "sbyte",
+ 7: "undefined",
+ 8: "sshort",
+ 9: "slong",
+ 10: "srational",
+ 11: "float",
+ 12: "double",
+}
+
+# See http://www.digitalpreservation.gov/formats/content/tiff_tags.shtml
+_TIFF_TAGS = {
+ 0x00fe: "Subfile Type",
+ 0x0100: "Width",
+ 0x0101: "Height",
+ 0x0102: "Bits per Sample",
+ 0x0103: "Compression",
+ 0x0106: "Photometric",
+ 0x010d: "Document Name",
+ 0x010e: "Image Description",
+ 0x010f: "Make",
+ 0x0110: "Model",
+ 0x0111: "Strip Offsets",
+ 0x0112: "Orientation",
+ 0x0115: "Samples per Pixel",
+ 0x0116: "Rows per Strip",
+ 0x0117: "Strip Byte Counts",
+ 0x0118: "Min Sample Value",
+ 0x0119: "Max Sample Value",
+ 0x011a: "X Resolution",
+ 0x011b: "Y Resolution",
+ 0x011c: "Planar Configuration",
+ 0x011d: "Page Name",
+ 0x011e: "X Position",
+ 0x011f: "Y Position",
+ 0x0128: "Resolution Unit",
+ 0x0129: "Page Number",
+ 0x0131: "Software",
+ 0x0132: "Date Time",
+ 0x013b: "Artist",
+ 0x013c: "Host Computer",
+ 0x013d: "Predictor",
+ 0x013e: "White Point",
+ 0x013f: "Primary Chromaticities",
+ 0x0140: "Color Map",
+ 0x0141: "Half-Tone Hints",
+ 0x0142: "Tile Width",
+ 0x0143: "Tile Length",
+ 0x0144: "Tile Offsets",
+ 0x0145: "Tile Byte Counts",
+ 0x0211: "YCbCr Coefficients",
+ 0x0212: "YCbCr Subsampling",
+ 0x0213: "YCbCr Positioning",
+ 0x0214: "Reference Black White",
+ 0x022f: "Strip Row Counts",
+ 0x02bc: "XMP",
+ 0x8298: "Copyright",
+ 0x83bb: "IPTC",
+ 0x8769: "EXIF IFD",
+ 0x8773: "ICC Profile",
+ 0x8825: "GPS IFD",
+ 0xa005: "Interoperability IFD",
+ 0xc4a5: "Print IM",
+
+ # EXIF IFD tags
+ 0x829a: "Exposure Time",
+ 0x829d: "F-Number",
+ 0x8822: "Exposure Program",
+ 0x8824: "Spectral Sensitivity",
+ 0x8827: "ISO Speed Ratings",
+ 0x8828: "OECF",
+ 0x9000: "EXIF Version",
+ 0x9003: "DateTime Original",
+ 0x9004: "DateTime Digitized",
+ 0x9101: "Components Configuration",
+ 0x9102: "Compressed Bits Per Pixel",
+ 0x9201: "Shutter Speed Value",
+ 0x9202: "Aperture Value",
+ 0x9203: "Brightness Value",
+ 0x9204: "Exposure Bias Value",
+ 0x9205: "Max Aperture Value",
+ 0x9206: "Subject Distance",
+ 0x9207: "Metering Mode",
+ 0x9208: "Light Source",
+ 0x9209: "Flash",
+ 0x920a: "Focal Length",
+ 0x9214: "Subject Area",
+ 0x927c: "Maker Note",
+ 0x9286: "User Comment",
+ # ... TODO
+ 0xa000: "Flashpix Version",
+ 0xa001: "Color Space",
+ 0xa002: "Pixel X Dimension",
+ 0xa003: "Pixel Y Dimension",
+ 0xa004: "Related Sound File",
+ # ... TODO
+
+ # GPS IFD tags
+ # ... TODO
+}
+
+_TIFF_EXIF_IFD = 0x8769
+_GPS_IFD = 0x8825
+_INTEROPERABILITY_IFD = 0xa005
+
+
+class ExifInfo:
+ """EXIF reader and information lister."""
+
+ _endian = None
+ _buffer = None
+ _offset = 0
+ _global_ifd_offset = 0
+ _exif_ifd_offset = 0
+ _gps_ifd_offset = 0
+ _interoperability_ifd_offset = 0
+ _hex = False
+
+ def __init__(self, buffer, **kwargs):
+ """Initialize the EXIF data reader."""
+ self._hex = kwargs.get("hex", False)
+ self._verbose = kwargs.get("verbose", False)
+ if not isinstance(buffer, bytes):
+ raise RuntimeError("invalid EXIF data type")
+ if buffer.startswith(b"MM\x00\x2a"):
+ self._endian = "MM"
+ elif buffer.startswith(b"II\x2a\x00"):
+ self._endian = "II"
+ else:
+ raise RuntimeError("invalid EXIF header")
+ self._buffer = buffer
+ self._offset = 4
+ self._global_ifd_offset = self._ui32()
+
+ def endian(self):
+ """Return the endianness of the EXIF data."""
+ return self._endian
+
+ def _tags_for_ifd(self, ifd_offset):
+ """Yield the tags found at the given TIFF IFD offset."""
+ if ifd_offset < 8:
+ raise RuntimeError("invalid TIFF IFD offset")
+ self._offset = ifd_offset
+ ifd_size = self._ui16()
+ for _ in range(0, ifd_size):
+ tag_id = self._ui16()
+ tag_type = self._ui16()
+ count = self._ui32()
+ value_or_offset = self._ui32()
+ if self._endian == "MM":
+ # FIXME:
+ # value_or_offset requires a fixup under big-endian encoding.
+ if tag_type == 2:
+ # 2 --> "ascii"
+ value_or_offset >>= 24
+ elif tag_type == 3:
+ # 3 --> "short"
+ value_or_offset >>= 16
+ else:
+ # ... FIXME
+ pass
+ if count == 0:
+ raise RuntimeError("unsupported count=0 in tag 0x%x" % tag_id)
+ if tag_id == _TIFF_EXIF_IFD:
+ if tag_type != 4:
+ raise RuntimeError("incorrect tag type for EXIF IFD")
+ self._exif_ifd_offset = value_or_offset
+ elif tag_id == _GPS_IFD:
+ if tag_type != 4:
+ raise RuntimeError("incorrect tag type for GPS IFD")
+ self._gps_ifd_offset = value_or_offset
+ elif tag_id == _INTEROPERABILITY_IFD:
+ if tag_type != 4:
+ raise RuntimeError("incorrect tag type for Interop IFD")
+ self._interoperability_ifd_offset = value_or_offset
+ yield (tag_id, tag_type, count, value_or_offset)
+
+ def tags(self):
+ """Yield all TIFF/EXIF tags."""
+ if self._verbose:
+ print("TIFF IFD : 0x%08x" % self._global_ifd_offset)
+ for tag in self._tags_for_ifd(self._global_ifd_offset):
+ yield tag
+ if self._exif_ifd_offset > 0:
+ if self._verbose:
+ print("EXIF IFD : 0x%08x" % self._exif_ifd_offset)
+ for tag in self._tags_for_ifd(self._exif_ifd_offset):
+ yield tag
+ if self._gps_ifd_offset > 0:
+ if self._verbose:
+ print("GPS IFD : 0x%08x" % self._gps_ifd_offset)
+ for tag in self._tags_for_ifd(self._gps_ifd_offset):
+ yield tag
+ if self._interoperability_ifd_offset > 0:
+ if self._verbose:
+ print("Interoperability IFD : 0x%08x" %
+ self._interoperability_ifd_offset)
+ for tag in self._tags_for_ifd(self._interoperability_ifd_offset):
+ yield tag
+
+ def tagid2str(self, tag_id):
+ """Return an informative string representation of a TIFF tag id."""
+ idstr = _TIFF_TAGS.get(tag_id, "[Unknown]")
+ if self._hex:
+ idnum = "0x%04x" % tag_id
+ else:
+ idnum = "%d" % tag_id
+ return "%s (%s)" % (idstr, idnum)
+
+ @staticmethod
+ def tagtype2str(tag_type):
+ """Return an informative string representation of a TIFF tag type."""
+ typestr = _TIFF_TAG_TYPES.get(tag_type, "[unknown]")
+ return "%d:%s" % (tag_type, typestr)
+
+ def tag2str(self, tag_id, tag_type, count, value_or_offset):
+ """Return an informative string representation of a TIFF tag tuple."""
+ return "%s (type=%s) (count=%d) : 0x%08x" \
+ % (self.tagid2str(tag_id), self.tagtype2str(tag_type), count,
+ value_or_offset)
+
+ def _ui32(self):
+ """Decode a 32-bit unsigned int found at the current offset;
+ advance the offset by 4.
+ """
+ if self._offset + 4 > len(self._buffer):
+ raise RuntimeError("out-of-bounds uint32 access in EXIF")
+ if self._endian == "MM":
+ result = unpack_uint32be(self._buffer, self._offset)
+ else:
+ result = unpack_uint32le(self._buffer, self._offset)
+ self._offset += 4
+ return result
+
+ def _ui16(self):
+ """Decode a 16-bit unsigned int found at the current offset;
+ advance the offset by 2.
+ """
+ if self._offset + 2 > len(self._buffer):
+ raise RuntimeError("out-of-bounds uint16 access in EXIF")
+ if self._endian == "MM":
+ result = unpack_uint16be(self._buffer, self._offset)
+ else:
+ result = unpack_uint16le(self._buffer, self._offset)
+ self._offset += 2
+ return result
+
+ def _ui8(self):
+ """Decode an 8-bit unsigned int found at the current offset;
+ advance the offset by 1.
+ """
+ if self._offset + 1 > len(self._buffer):
+ raise RuntimeError("out-of-bounds uint8 access in EXIF")
+ result = unpack_uint8(self._buffer, self._offset)
+ self._offset += 1
+ return result
+
+
+def print_raw_exif_info(buffer, **kwargs):
+ """Print the EXIF information found in a raw byte stream."""
+ lister = ExifInfo(buffer, **kwargs)
+ print("EXIF (endian=%s)" % lister.endian())
+ for (tag_id, tag_type, count, value_or_offset) in lister.tags():
+ print(lister.tag2str(tag_id=tag_id,
+ tag_type=tag_type,
+ count=count,
+ value_or_offset=value_or_offset))
+
+
+if __name__ == "__main__":
+ # For testing only.
+ for arg in sys.argv[1:]:
+ with open(arg, "rb") as test_stream:
+ test_buffer = test_stream.read(_READ_DATA_SIZE_MAX)
+ print_raw_exif_info(test_buffer, hex=True, verbose=True)
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -eu
+
+my_python="$(command -v python3 || command -v python)" || {
+ echo >&2 "error: program not found: Python interpreter"
+ exit 127
+}
+my_python_flags="-BES"
+
+exec "$my_python" "$my_python_flags" "$(dirname "$0")/pngexifinfo.py" "$@"
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo.bat
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo.bat (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo.bat 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,4 @@
+ at echo off
+ at setlocal enableextensions
+
+python.exe -BES %~dp0.\pngexifinfo.py %*
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo.py
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo.py (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngexif/pngexifinfo.py 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,178 @@
+#!/usr/bin/env python
+
+"""
+Show the PNG EXIF information.
+
+Copyright (C) 2017-2020 Cosmin Truta.
+
+Use, modification and distribution are subject to the MIT License.
+Please see the accompanying file LICENSE_MIT.txt
+"""
+
+from __future__ import absolute_import, division, print_function
+
+import argparse
+import io
+import re
+import sys
+import zlib
+
+from bytepack import unpack_uint32be, unpack_uint8
+from exifinfo import print_raw_exif_info
+
+_PNG_SIGNATURE = b"\x89PNG\x0d\x0a\x1a\x0a"
+_PNG_CHUNK_SIZE_MAX = 0x7fffffff
+_READ_DATA_SIZE_MAX = 0x3ffff
+
+
+def print_error(msg):
+ """Print an error message to stderr."""
+ sys.stderr.write("%s: error: %s\n" % (sys.argv[0], msg))
+
+
+def print_debug(msg):
+ """Print a debug message to stderr."""
+ sys.stderr.write("%s: debug: %s\n" % (sys.argv[0], msg))
+
+
+def _check_png(condition, chunk_sig=None):
+ """Check a PNG-specific assertion."""
+ if condition:
+ return
+ if chunk_sig is None:
+ raise RuntimeError("bad PNG data")
+ raise RuntimeError("bad PNG data in '%s'" % chunk_sig)
+
+
+def _check_png_crc(data, checksum, chunk_sig):
+ """Check a CRC32 value inside a PNG stream."""
+ if unpack_uint32be(data) == (checksum & 0xffffffff):
+ return
+ raise RuntimeError("bad PNG checksum in '%s'" % chunk_sig)
+
+
+def _extract_png_exif(data, **kwargs):
+ """Extract the EXIF header and data from a PNG chunk."""
+ debug = kwargs.get("debug", False)
+ if unpack_uint8(data, 0) == 0:
+ if debug:
+ print_debug("found compressed EXIF, compression method 0")
+ if (unpack_uint8(data, 1) & 0x0f) == 0x08:
+ data = zlib.decompress(data[1:])
+ elif unpack_uint8(data, 1) == 0 \
+ and (unpack_uint8(data, 5) & 0x0f) == 0x08:
+ if debug:
+ print_debug("found uncompressed-length EXIF field")
+ data_len = unpack_uint32be(data, 1)
+ data = zlib.decompress(data[5:])
+ if data_len != len(data):
+ raise RuntimeError(
+ "incorrect uncompressed-length field in PNG EXIF")
+ else:
+ raise RuntimeError("invalid compression method in PNG EXIF")
+ if data.startswith(b"MM\x00\x2a") or data.startswith(b"II\x2a\x00"):
+ return data
+ raise RuntimeError("invalid TIFF/EXIF header in PNG EXIF")
+
+
+def print_png_exif_info(instream, **kwargs):
+ """Print the EXIF information found in the given PNG datastream."""
+ debug = kwargs.get("debug", False)
+ has_exif = False
+ while True:
+ chunk_hdr = instream.read(8)
+ _check_png(len(chunk_hdr) == 8)
+ chunk_len = unpack_uint32be(chunk_hdr, offset=0)
+ chunk_sig = chunk_hdr[4:8].decode("latin_1", errors="ignore")
+ _check_png(re.search(r"^[A-Za-z]{4}$", chunk_sig), chunk_sig=chunk_sig)
+ _check_png(chunk_len < _PNG_CHUNK_SIZE_MAX, chunk_sig=chunk_sig)
+ if debug:
+ print_debug("processing chunk: %s" % chunk_sig)
+ if chunk_len <= _READ_DATA_SIZE_MAX:
+ # The chunk size does not exceed an arbitrary, reasonable limit.
+ chunk_data = instream.read(chunk_len)
+ chunk_crc = instream.read(4)
+ _check_png(len(chunk_data) == chunk_len and len(chunk_crc) == 4,
+ chunk_sig=chunk_sig)
+ checksum = zlib.crc32(chunk_hdr[4:8])
+ checksum = zlib.crc32(chunk_data, checksum)
+ _check_png_crc(chunk_crc, checksum, chunk_sig=chunk_sig)
+ else:
+ # The chunk is too big. Skip it.
+ instream.seek(chunk_len + 4, io.SEEK_CUR)
+ continue
+ if chunk_sig == "IEND":
+ _check_png(chunk_len == 0, chunk_sig=chunk_sig)
+ break
+ if chunk_sig.lower() in ["exif", "zxif"] and chunk_len > 8:
+ has_exif = True
+ exif_data = _extract_png_exif(chunk_data, **kwargs)
+ print_raw_exif_info(exif_data, **kwargs)
+ if not has_exif:
+ raise RuntimeError("no EXIF data in PNG stream")
+
+
+def print_exif_info(file, **kwargs):
+ """Print the EXIF information found in the given file."""
+ with open(file, "rb") as stream:
+ header = stream.read(4)
+ if header == _PNG_SIGNATURE[0:4]:
+ if stream.read(4) != _PNG_SIGNATURE[4:8]:
+ raise RuntimeError("corrupted PNG file")
+ print_png_exif_info(instream=stream, **kwargs)
+ elif header == b"II\x2a\x00" or header == b"MM\x00\x2a":
+ data = header + stream.read(_READ_DATA_SIZE_MAX)
+ print_raw_exif_info(data, **kwargs)
+ else:
+ raise RuntimeError("not a PNG file")
+
+
+def main():
+ """The main function."""
+ parser = argparse.ArgumentParser(
+ prog="pngexifinfo",
+ usage="%(prog)s [options] [--] files...",
+ description="Show the PNG EXIF information.")
+ parser.add_argument("files",
+ metavar="file",
+ nargs="*",
+ help="a PNG file or a raw EXIF blob")
+ parser.add_argument("-x",
+ "--hex",
+ dest="hex",
+ action="store_true",
+ help="show EXIF tags in base 16")
+ parser.add_argument("-v",
+ "--verbose",
+ dest="verbose",
+ action="store_true",
+ help="run in verbose mode")
+ parser.add_argument("--debug",
+ dest="debug",
+ action="store_true",
+ help="run in debug mode")
+ args = parser.parse_args()
+ if not args.files:
+ parser.error("missing file operand")
+ result = 0
+ for file in args.files:
+ try:
+ print_exif_info(file,
+ hex=args.hex,
+ debug=args.debug,
+ verbose=args.verbose)
+ except (IOError, OSError) as err:
+ print_error(str(err))
+ result = 66 # os.EX_NOINPUT
+ except RuntimeError as err:
+ print_error("%s: %s" % (file, str(err)))
+ result = 69 # os.EX_UNAVAILABLE
+ parser.exit(result)
+
+
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ sys.stderr.write("INTERRUPTED\n")
+ sys.exit(130) # SIGINT
Modified: trunk/Build/source/libs/libpng/libpng-src/contrib/pngminim/decoder/makefile
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/pngminim/decoder/makefile 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/pngminim/decoder/makefile 2024-02-24 01:06:57 UTC (rev 70115)
@@ -54,7 +54,7 @@
PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
pngset$(C) pngtrans$(C)
-
+
# Standard headers
PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
Modified: trunk/Build/source/libs/libpng/libpng-src/contrib/tools/pngfix.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/tools/pngfix.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/tools/pngfix.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -133,11 +133,6 @@
/* Is it safe to copy? */
#define SAFE_TO_COPY(chunk) (((chunk) & PNG_U32(0,0,0,32)) != 0)
-/* Fix ups for builds with limited read support */
-#ifndef PNG_ERROR_TEXT_SUPPORTED
-# define png_error(a,b) png_err(a)
-#endif
-
/********************************* UTILITIES **********************************/
/* UNREACHED is a value to cause an assert to fail. Because of the way the
* assert macro is written the string "UNREACHED" is produced in the error
Added: trunk/Build/source/libs/libpng/libpng-src/contrib/visupng/.editorconfig
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/contrib/visupng/.editorconfig (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/contrib/visupng/.editorconfig 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,22 @@
+# https://editorconfig.org
+
+root = true
+
+[*]
+charset = utf-8
+end_of_line = unset
+indent_style = unset
+insert_final_newline = true
+max_doc_length = 80
+max_line_length = 100
+trim_trailing_whitespace = true
+
+[*.rc]
+end_of_line = crlf
+trim_trailing_whitespace = unset
+
+[*.ds[pw]]
+end_of_line = crlf
+max_doc_length = unset
+max_line_length = unset
+trim_trailing_whitespace = unset
Modified: trunk/Build/source/libs/libpng/libpng-src/libpng-manual.txt
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/libpng-manual.txt 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/libpng-manual.txt 2024-02-24 01:06:57 UTC (rev 70115)
@@ -9,7 +9,7 @@
Based on:
- libpng version 1.6.36, December 2018, through 1.6.42 - January 2024
+ libpng version 1.6.36, December 2018, through 1.6.43 - February 2024
Updated and distributed by Cosmin Truta
Copyright (c) 2018-2024 Cosmin Truta
@@ -1178,11 +1178,11 @@
If you know your image size and pixel size ahead of time, you can allocate
row_pointers prior to calling png_read_png() with
- if (height > PNG_UINT_32_MAX/(sizeof (png_byte)))
+ if (height > PNG_UINT_32_MAX / (sizeof (png_bytep)))
png_error(png_ptr,
"Image is too tall to process in memory");
- if (width > PNG_UINT_32_MAX/pixel_size)
+ if (width > PNG_UINT_32_MAX / pixel_size)
png_error(png_ptr,
"Image is too wide to process in memory");
Modified: trunk/Build/source/libs/libpng/libpng-src/libpng.3
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/libpng.3 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/libpng.3 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,6 +1,6 @@
-.TH LIBPNG 3 "January 29, 2024"
+.TH LIBPNG 3 "February 23, 2024"
.SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.42
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.43
.SH SYNOPSIS
\fB#include <png.h>\fP
@@ -528,7 +528,7 @@
Based on:
- libpng version 1.6.36, December 2018, through 1.6.42 - January 2024
+ libpng version 1.6.36, December 2018, through 1.6.43 - February 2024
Updated and distributed by Cosmin Truta
Copyright (c) 2018-2024 Cosmin Truta
@@ -1697,11 +1697,11 @@
If you know your image size and pixel size ahead of time, you can allocate
row_pointers prior to calling png_read_png() with
- if (height > PNG_UINT_32_MAX/(sizeof (png_byte)))
+ if (height > PNG_UINT_32_MAX / (sizeof (png_bytep)))
png_error(png_ptr,
"Image is too tall to process in memory");
- if (width > PNG_UINT_32_MAX/pixel_size)
+ if (width > PNG_UINT_32_MAX / pixel_size)
png_error(png_ptr,
"Image is too wide to process in memory");
Modified: trunk/Build/source/libs/libpng/libpng-src/libpngpf.3
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/libpngpf.3 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/libpngpf.3 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,6 +1,6 @@
-.TH LIBPNGPF 3 "January 29, 2024"
+.TH LIBPNGPF 3 "February 23, 2024"
.SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.42
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.43
(private functions)
.SH SYNOPSIS
Added: trunk/Build/source/libs/libpng/libpng-src/loongarch/.editorconfig
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/loongarch/.editorconfig (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/loongarch/.editorconfig 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,8 @@
+# https://editorconfig.org
+
+root = false
+
+# FIXME
+[*.[ch]]
+max_doc_length = unset
+max_line_length = unset
Added: trunk/Build/source/libs/libpng/libpng-src/mips/.editorconfig
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/mips/.editorconfig (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/mips/.editorconfig 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,8 @@
+# https://editorconfig.org
+
+root = false
+
+# FIXME
+[*.[ch]]
+max_doc_length = unset
+max_line_length = unset
Modified: trunk/Build/source/libs/libpng/libpng-src/png.5
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/png.5 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/png.5 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,4 +1,4 @@
-.TH PNG 5 "January 29, 2024"
+.TH PNG 5 "February 23, 2024"
.SH NAME
png \- Portable Network Graphics (PNG) format
Modified: trunk/Build/source/libs/libpng/libpng-src/png.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/png.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/png.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -14,7 +14,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_42 Your_png_h_is_not_version_1_6_42;
+typedef png_libpng_version_1_6_43 Your_png_h_is_not_version_1_6_43;
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -794,7 +794,7 @@
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
- "libpng version 1.6.42" PNG_STRING_NEWLINE \
+ "libpng version 1.6.43" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2024 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
@@ -1821,14 +1821,14 @@
}
# ifdef PNG_WARNINGS_SUPPORTED
else
- {
- char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114 */
+ {
+ char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114 */
- pos = png_safecat(message, (sizeof message), pos,
- png_format_number(number, number+(sizeof number),
- PNG_NUMBER_FORMAT_x, value));
- pos = png_safecat(message, (sizeof message), pos, "h: "); /* +2 = 116 */
- }
+ pos = png_safecat(message, (sizeof message), pos,
+ png_format_number(number, number+(sizeof number),
+ PNG_NUMBER_FORMAT_x, value));
+ pos = png_safecat(message, (sizeof message), pos, "h: "); /* +2 = 116 */
+ }
# endif
/* The 'reason' is an arbitrary message, allow +79 maximum 195 */
pos = png_safecat(message, (sizeof message), pos, reason);
@@ -2511,17 +2511,6 @@
#endif /* COLORSPACE */
-#ifdef __GNUC__
-/* This exists solely to work round a warning from GNU C. */
-static int /* PRIVATE */
-png_gt(size_t a, size_t b)
-{
- return a > b;
-}
-#else
-# define png_gt(a,b) ((a) > (b))
-#endif
-
void /* PRIVATE */
png_check_IHDR(png_const_structrp png_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth,
@@ -2543,8 +2532,16 @@
error = 1;
}
- if (png_gt(((width + 7) & (~7U)),
- ((PNG_SIZE_MAX
+ /* The bit mask on the first line below must be at least as big as a
+ * png_uint_32. "~7U" is not adequate on 16-bit systems because it will
+ * be an unsigned 16-bit value. Casting to (png_alloc_size_t) makes the
+ * type of the result at least as bit (in bits) as the RHS of the > operator
+ * which also avoids a common warning on 64-bit systems that the comparison
+ * of (png_uint_32) against the constant value on the RHS will always be
+ * false.
+ */
+ if (((width + 7) & ~(png_alloc_size_t)7) >
+ (((PNG_SIZE_MAX
- 48 /* big_row_buf hack */
- 1) /* filter byte */
/ 8) /* 8-byte RGBA pixels */
Modified: trunk/Build/source/libs/libpng/libpng-src/png.h
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/png.h 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/png.h 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.6.42
+ * libpng version 1.6.43
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@@ -15,7 +15,7 @@
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
* Glenn Randers-Pehrson
- * libpng versions 1.6.36, December 2018, through 1.6.42, January 2024:
+ * libpng versions 1.6.36, December 2018, through 1.6.43, February 2024:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
@@ -239,7 +239,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
- * 1.6.42 16 10641 16.so.16.41[.0]
+ * 1.6.43 16 10643 16.so.16.43[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
@@ -255,9 +255,6 @@
* to the info_ptr or png_ptr members through png.h, and the compiled
* application is loaded with a different version of the library.
*
- * DLLNUM will change each time there are forward or backward changes
- * in binary compatibility (e.g., when a new feature is added).
- *
* See libpng.txt or libpng.3 for more information. The PNG specification
* is available as a W3C Recommendation and as an ISO/IEC Standard; see
* <https://www.w3.org/TR/2003/REC-PNG-20031110/>
@@ -278,19 +275,21 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.42"
+#define PNG_LIBPNG_VER_STRING "1.6.43"
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
-#define PNG_LIBPNG_VER_SONUM 16
-#define PNG_LIBPNG_VER_DLLNUM 16
+/* The versions of shared library builds should stay in sync, going forward */
+#define PNG_LIBPNG_VER_SHAREDLIB 16
+#define PNG_LIBPNG_VER_SONUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
+#define PNG_LIBPNG_VER_DLLNUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
-#define PNG_LIBPNG_VER_RELEASE 41
+#define PNG_LIBPNG_VER_RELEASE 43
/* This should be zero for a public release, or non-zero for a
- * development version. [Deprecated]
+ * development version.
*/
#define PNG_LIBPNG_VER_BUILD 0
@@ -318,7 +317,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
-#define PNG_LIBPNG_VER 10641 /* 1.6.42 */
+#define PNG_LIBPNG_VER 10643 /* 1.6.43 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -428,7 +427,7 @@
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef char* png_libpng_version_1_6_42;
+typedef char* png_libpng_version_1_6_43;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
Modified: trunk/Build/source/libs/libpng/libpng-src/pngconf.h
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/pngconf.h 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/pngconf.h 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,7 +1,7 @@
/* pngconf.h - machine-configurable file for libpng
*
- * libpng version 1.6.42
+ * libpng version 1.6.43
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
Modified: trunk/Build/source/libs/libpng/libpng-src/pnglibconf.h
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/pnglibconf.h 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/pnglibconf.h 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,6 +1,6 @@
/* pnglibconf.h - library build configuration */
-/* libpng version 1.6.42 */
+/* libpng version 1.6.43 */
/* Copyright (c) 2018-2024 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
Modified: trunk/Build/source/libs/libpng/libpng-src/pngpread.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/pngpread.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/pngpread.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -295,6 +295,14 @@
}
#endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+ else if (png_ptr->chunk_name == png_eXIf)
+ {
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
+ png_handle_eXIf(png_ptr, info_ptr, png_ptr->push_length);
+ }
+
+#endif
#ifdef PNG_READ_sRGB_SUPPORTED
else if (chunk_name == png_sRGB)
{
Modified: trunk/Build/source/libs/libpng/libpng-src/pngread.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/pngread.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/pngread.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -568,7 +568,11 @@
#endif
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
- if (png_ptr->transformations || png_ptr->num_palette_max >= 0)
+ if (png_ptr->transformations
+# ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
+ || png_ptr->num_palette_max >= 0
+# endif
+ )
png_do_read_transformations(png_ptr, &row_info);
#endif
Modified: trunk/Build/source/libs/libpng/libpng-src/pngrtran.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/pngrtran.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/pngrtran.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -297,14 +297,13 @@
output_gamma = translate_gamma_flags(png_ptr, output_gamma, 1/*screen*/);
- /* Validate the value to ensure it is in a reasonable range. The value
+ /* Validate the value to ensure it is in a reasonable range. The value
* is expected to be 1 or greater, but this range test allows for some
- * viewing correction values. The intent is to weed out users of this API
- * who use the inverse of the gamma value accidentally! Since some of these
- * values are reasonable this may have to be changed:
+ * viewing correction values. The intent is to weed out the API users
+ * who might use the inverse of the gamma value accidentally!
*
- * 1.6.x: changed from 0.07..3 to 0.01..100 (to accommodate the optimal 16-bit
- * gamma of 36, and its reciprocal.)
+ * In libpng 1.6.0, we changed from 0.07..3 to 0.01..100, to accommodate
+ * the optimal 16-bit gamma of 36 and its reciprocal.
*/
if (output_gamma < 1000 || output_gamma > 10000000)
png_error(png_ptr, "output gamma out of expected range");
@@ -441,7 +440,7 @@
int i;
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
- (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
+ (png_alloc_size_t)num_palette);
for (i = 0; i < num_palette; i++)
png_ptr->quantize_index[i] = (png_byte)i;
}
@@ -458,7 +457,7 @@
/* Initialize an array to sort colors */
png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
- (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
+ (png_alloc_size_t)num_palette);
/* Initialize the quantize_sort array */
for (i = 0; i < num_palette; i++)
@@ -592,11 +591,9 @@
/* Initialize palette index arrays */
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
- (png_alloc_size_t)((png_uint_32)num_palette *
- (sizeof (png_byte))));
+ (png_alloc_size_t)num_palette);
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
- (png_alloc_size_t)((png_uint_32)num_palette *
- (sizeof (png_byte))));
+ (png_alloc_size_t)num_palette);
/* Initialize the sort array */
for (i = 0; i < num_palette; i++)
@@ -761,12 +758,11 @@
size_t num_entries = ((size_t)1 << total_bits);
png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
- (png_alloc_size_t)(num_entries * (sizeof (png_byte))));
+ (png_alloc_size_t)(num_entries));
- distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)(num_entries *
- (sizeof (png_byte))));
+ distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)num_entries);
- memset(distance, 0xff, num_entries * (sizeof (png_byte)));
+ memset(distance, 0xff, num_entries);
for (i = 0; i < num_palette; i++)
{
Modified: trunk/Build/source/libs/libpng/libpng-src/pngtest.c
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/pngtest.c 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/pngtest.c 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
-/* pngtest.c - a simple test program to test libpng
+/* pngtest.c - a test program for libpng
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@@ -37,14 +37,41 @@
#include <stdlib.h>
#include <string.h>
-/* Defined so I can write to a file on gui/windowing platforms */
-/* #define STDERR stderr */
-#define STDERR stdout /* For DOS */
+#ifdef PNG_ZLIB_HEADER
+# include PNG_ZLIB_HEADER /* defined by pnglibconf.h from 1.7 */
+#else
+# include <zlib.h>
+#endif
#include "png.h"
-/* Known chunks that exist in pngtest.png must be supported or pngtest will fail
- * simply as a result of re-ordering them. This may be fixed in 1.7
+/* Generate a compiler error if there is an old png.h in the search path. */
+typedef png_libpng_version_1_6_43 Your_png_h_is_not_version_1_6_43;
+
+/* Ensure that all version numbers in png.h are consistent with one another. */
+#if (PNG_LIBPNG_VER != PNG_LIBPNG_VER_MAJOR * 10000 + \
+ PNG_LIBPNG_VER_MINOR * 100 + \
+ PNG_LIBPNG_VER_RELEASE) || \
+ (PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_MAJOR * 10 + \
+ PNG_LIBPNG_VER_MINOR) || \
+ (PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_SONUM) || \
+ (PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_DLLNUM)
+# error "Inconsistent version numbers in png.h"
+#endif
+
+/* In version 1.6.1, we added support for the configure test harness, which
+ * uses 77 to indicate a skipped test. On the other hand, in cmake build tests,
+ * we still need to succeed on a skipped test, so:
+ */
+#if defined(HAVE_CONFIG_H)
+# define SKIP 77
+#else
+# define SKIP 0
+#endif
+
+/* Known chunks that exist in pngtest.png must be supported, or pngtest will
+ * fail simply as a result of re-ordering them. This may be fixed in the next
+ * generation of libpng.
*
* pngtest allocates a single row buffer for each row and overwrites it,
* therefore if the write side doesn't support the writing of interlaced images
@@ -51,61 +78,52 @@
* nothing can be done for an interlaced image (and the code below will fail
* horribly trying to write extra data after writing garbage).
*/
-#if defined PNG_READ_SUPPORTED && /* else nothing can be done */\
- defined PNG_READ_bKGD_SUPPORTED &&\
- defined PNG_READ_cHRM_SUPPORTED &&\
- defined PNG_READ_gAMA_SUPPORTED &&\
- defined PNG_READ_oFFs_SUPPORTED &&\
- defined PNG_READ_pCAL_SUPPORTED &&\
- defined PNG_READ_pHYs_SUPPORTED &&\
- defined PNG_READ_sBIT_SUPPORTED &&\
- defined PNG_READ_sCAL_SUPPORTED &&\
- defined PNG_READ_sRGB_SUPPORTED &&\
- defined PNG_READ_sPLT_SUPPORTED &&\
- defined PNG_READ_tEXt_SUPPORTED &&\
- defined PNG_READ_tIME_SUPPORTED &&\
- defined PNG_READ_zTXt_SUPPORTED &&\
- (defined PNG_WRITE_INTERLACING_SUPPORTED || PNG_LIBPNG_VER >= 10700)
+#if defined PNG_READ_SUPPORTED && /* else nothing can be done */ \
+ defined PNG_READ_bKGD_SUPPORTED && \
+ defined PNG_READ_cHRM_SUPPORTED && \
+ defined PNG_READ_gAMA_SUPPORTED && \
+ defined PNG_READ_oFFs_SUPPORTED && \
+ defined PNG_READ_pCAL_SUPPORTED && \
+ defined PNG_READ_pHYs_SUPPORTED && \
+ defined PNG_READ_sBIT_SUPPORTED && \
+ defined PNG_READ_sCAL_SUPPORTED && \
+ defined PNG_READ_sRGB_SUPPORTED && \
+ defined PNG_READ_sPLT_SUPPORTED && \
+ defined PNG_READ_tEXt_SUPPORTED && \
+ defined PNG_READ_tIME_SUPPORTED && \
+ defined PNG_READ_zTXt_SUPPORTED && \
+ (defined PNG_WRITE_INTERLACING_SUPPORTED || PNG_LIBPNG_VER >= 10700)
-#ifdef PNG_ZLIB_HEADER
-# include PNG_ZLIB_HEADER /* defined by pnglibconf.h from 1.7 */
-#else
-# include "zlib.h"
-#endif
-
/* Copied from pngpriv.h but only used in error messages below. */
#ifndef PNG_ZBUF_SIZE
# define PNG_ZBUF_SIZE 8192
#endif
-#define FCLOSE(file) fclose(file)
#ifndef PNG_STDIO_SUPPORTED
-typedef FILE * png_FILE_p;
+typedef FILE * png_FILE_p;
#endif
-/* Makes pngtest verbose so we can find problems. */
+/* This hack was introduced for historical reasons, and we are
+ * still keeping it in libpng-1.6.x for compatibility reasons.
+ */
+#define STDERR stdout
+
#ifndef PNG_DEBUG
# define PNG_DEBUG 0
#endif
#if PNG_DEBUG > 1
-# define pngtest_debug(m) ((void)fprintf(stderr, m "\n"))
-# define pngtest_debug1(m,p1) ((void)fprintf(stderr, m "\n", p1))
-# define pngtest_debug2(m,p1,p2) ((void)fprintf(stderr, m "\n", p1, p2))
-#else
-# define pngtest_debug(m) ((void)0)
-# define pngtest_debug1(m,p1) ((void)0)
-# define pngtest_debug2(m,p1,p2) ((void)0)
+# define pngtest_debug(m) ((void)fprintf(stderr, m "\n"))
+# define pngtest_debug1(m, p1) ((void)fprintf(stderr, m "\n", p1))
+# define pngtest_debug2(m, p1, p2) ((void)fprintf(stderr, m "\n", p1, p2))
+#elif PNG_DEBUG == 0 || PNG_DEBUG == 1
+# define pngtest_debug(m) ((void)0)
+# define pngtest_debug1(m, p1) ((void)0)
+# define pngtest_debug2(m, p1, p2) ((void)0)
+#else /* PNG_DEBUG < 0 */
+# error "Bad PNG_DEBUG value"
#endif
-#if !PNG_DEBUG
-# define SINGLE_ROWBUF_ALLOC /* Makes buffer overruns easier to nail */
-#endif
-
-#ifndef PNG_UNUSED
-# define PNG_UNUSED(param) (void)param;
-#endif
-
/* Turn on CPU timing
#define PNGTEST_TIMING
*/
@@ -120,25 +138,11 @@
#endif
#ifdef PNG_TIME_RFC1123_SUPPORTED
-#define PNG_tIME_STRING_LENGTH 29
static int tIME_chunk_present = 0;
-static char tIME_string[PNG_tIME_STRING_LENGTH] = "tIME chunk is not present";
-
-#if PNG_LIBPNG_VER < 10619
-#define png_convert_to_rfc1123_buffer(ts, t) tIME_to_str(read_ptr, ts, t)
-
-static int
-tIME_to_str(png_structp png_ptr, png_charp ts, png_const_timep t)
-{
- png_const_charp str = png_convert_to_rfc1123(png_ptr, t);
-
- if (str == NULL)
- return 0;
-
- strcpy(ts, str);
- return 1;
-}
-#endif /* older libpng */
+static char tIME_string[29] = "tIME chunk is not present";
+/* This use case is deprecated.
+ * See the declaration of png_convert_to_rfc1123_buffer for more details.
+ */
#endif
static int verbose = 0;
@@ -149,22 +153,6 @@
static int error_count = 0; /* count calls to png_error */
static int warning_count = 0; /* count calls to png_warning */
-/* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */
-#ifndef png_jmpbuf
-# define png_jmpbuf(png_ptr) png_ptr->jmpbuf
-#endif
-
-/* Defines for unknown chunk handling if required. */
-#ifndef PNG_HANDLE_CHUNK_ALWAYS
-# define PNG_HANDLE_CHUNK_ALWAYS 3
-#endif
-#ifndef PNG_HANDLE_CHUNK_IF_SAFE
-# define PNG_HANDLE_CHUNK_IF_SAFE 2
-#endif
-
-/* Utility to save typing/errors, the argument must be a name */
-#define MEMZERO(var) ((void)memset(&var, 0, sizeof var))
-
/* Example of using row callbacks to make a simple progress meter */
static int status_pass = 1;
static int status_dots_requested = 0;
@@ -173,8 +161,13 @@
static void PNGCBAPI
read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
{
- if (png_ptr == NULL || row_number > PNG_UINT_31_MAX)
- return;
+ /* The callback should always receive correct parameters. */
+ if (png_ptr == NULL)
+ png_error(png_ptr, "read_row_callback: bad png_ptr");
+ if (row_number > PNG_UINT_31_MAX)
+ png_error(png_ptr, "read_row_callback: bad row number");
+ if (pass < 0 || pass > 7)
+ png_error(png_ptr, "read_row_callback: bad pass");
if (status_pass != pass)
{
@@ -188,7 +181,7 @@
if (status_dots == 0)
{
fprintf(stdout, "\n ");
- status_dots=30;
+ status_dots = 30;
}
fprintf(stdout, "r");
@@ -198,8 +191,13 @@
static void PNGCBAPI
write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
{
- if (png_ptr == NULL || row_number > PNG_UINT_31_MAX || pass > 7)
- return;
+ /* The callback should always receive correct parameters. */
+ if (png_ptr == NULL)
+ png_error(png_ptr, "write_row_callback: bad png_ptr");
+ if (row_number > PNG_UINT_31_MAX)
+ png_error(png_ptr, "write_row_callback: bad row number");
+ if (pass < 0 || pass > 7)
+ png_error(png_ptr, "write_row_callback: bad pass");
fprintf(stdout, "w");
}
@@ -212,9 +210,13 @@
static void PNGCBAPI
read_user_callback(png_structp png_ptr, png_row_infop row_info, png_bytep data)
{
- PNG_UNUSED(png_ptr)
- PNG_UNUSED(row_info)
- PNG_UNUSED(data)
+ /* The callback should always receive correct parameters. */
+ if (png_ptr == NULL)
+ png_error(png_ptr, "read_user_callback: bad png_ptr");
+ if (row_info == NULL)
+ png_error(png_ptr, "read_user_callback: bad row info");
+ if (data == NULL)
+ png_error(png_ptr, "read_user_callback: bad data");
}
#endif
@@ -229,8 +231,14 @@
count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
{
png_bytep dp = data;
+
+ /* The callback should always receive correct parameters. */
if (png_ptr == NULL)
- return;
+ png_error(png_ptr, "count_zero_samples: bad png_ptr");
+ if (row_info == NULL)
+ png_error(png_ptr, "count_zero_samples: bad row info");
+ if (data == NULL)
+ png_error(png_ptr, "count_zero_samples: bad data");
/* Contents of row_info:
* png_uint_32 width width of row
@@ -248,7 +256,7 @@
int pos = 0;
png_uint_32 n, nstop;
- for (n = 0, nstop=row_info->width; n<nstop; n++)
+ for (n = 0, nstop = row_info->width; n < nstop; n++)
{
if (row_info->bit_depth == 1)
{
@@ -294,7 +302,7 @@
{
if ((*dp | *(dp+1)) == 0)
zero_samples++;
- dp+=2;
+ dp += 2;
}
}
}
@@ -306,7 +314,7 @@
if (row_info->color_type > 3)
color_channels--;
- for (n = 0, nstop=row_info->width; n<nstop; n++)
+ for (n = 0, nstop = row_info->width; n < nstop; n++)
{
for (channel = 0; channel < color_channels; channel++)
{
@@ -319,7 +327,7 @@
if ((*dp | *(dp+1)) == 0)
zero_samples++;
- dp+=2;
+ dp += 2;
}
}
if (row_info->color_type > 3)
@@ -346,9 +354,6 @@
#ifdef PNG_IO_STATE_SUPPORTED
void
pngtest_check_io_state(png_structp png_ptr, size_t data_length,
- png_uint_32 io_op);
-void
-pngtest_check_io_state(png_structp png_ptr, size_t data_length,
png_uint_32 io_op)
{
png_uint_32 io_state = png_get_io_state(png_ptr);
@@ -361,7 +366,7 @@
/* Check if the buffer size specific to the current location
* (file signature / header / data / crc) is as expected.
*/
- switch (io_state & PNG_IO_MASK_LOC)
+ switch ((io_state & PNG_IO_MASK_LOC) != 0)
{
case PNG_IO_SIGNATURE:
if (data_length > 8)
@@ -391,19 +396,18 @@
size_t check = 0;
png_voidp io_ptr;
+ if (png_ptr == NULL)
+ png_error(png_ptr, "pngtest_read_data: bad png_ptr");
+
/* fread() returns 0 on error, so it is OK to store this in a size_t
* instead of an int, which is what fread() actually returns.
*/
io_ptr = png_get_io_ptr(png_ptr);
if (io_ptr != NULL)
- {
check = fread(data, 1, length, (png_FILE_p)io_ptr);
- }
if (check != length)
- {
png_error(png_ptr, "Read Error");
- }
#ifdef PNG_IO_STATE_SUPPORTED
pngtest_check_io_state(png_ptr, length, PNG_IO_READING);
@@ -414,8 +418,10 @@
static void PNGCBAPI
pngtest_flush(png_structp png_ptr)
{
+ if (png_ptr == NULL)
+ png_error(png_ptr, "pngtest_flush: bad png_ptr");
+
/* Do nothing; fflush() is said to be just a waste of energy. */
- PNG_UNUSED(png_ptr) /* Stifle compiler warning */
}
#endif
@@ -429,12 +435,13 @@
{
size_t check;
+ if (png_ptr == NULL)
+ png_error(png_ptr, "pngtest_write_data: bad png_ptr");
+
check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr));
if (check != length)
- {
png_error(png_ptr, "Write Error");
- }
#ifdef PNG_IO_STATE_SUPPORTED
pngtest_check_io_state(png_ptr, length, PNG_IO_WRITING);
@@ -537,7 +544,7 @@
pinfo->size = size;
current_allocation += size;
total_allocation += size;
- num_allocations ++;
+ ++num_allocations;
if (current_allocation > maximum_allocation)
maximum_allocation = current_allocation;
@@ -635,7 +642,7 @@
/* (sTER is a public chunk not yet known by libpng. vpAg is a private
chunk used in ImageMagick to store "virtual page" size). */
-static struct user_chunk_data
+typedef struct user_chunk_info_def
{
png_const_infop info_ptr;
png_uint_32 vpAg_width, vpAg_height;
@@ -642,8 +649,7 @@
png_byte vpAg_units;
png_byte sTER_mode;
int location[2];
-}
-user_chunk_data;
+} user_chunk_info;
/* Used for location and order; zero means nothing. */
#define have_sTER 0x01
@@ -653,37 +659,38 @@
#define after_IDAT 0x40
static void
-init_callback_info(png_const_infop info_ptr)
+init_user_chunk_info(png_const_infop info_ptr, user_chunk_info *chunk_data)
{
- MEMZERO(user_chunk_data);
- user_chunk_data.info_ptr = info_ptr;
+ memset(chunk_data, 0, sizeof(*chunk_data));
+ chunk_data->info_ptr = info_ptr;
}
static int
-set_location(png_structp png_ptr, struct user_chunk_data *data, int what)
+set_chunk_location(png_structp png_ptr, user_chunk_info *chunk_data, int what)
{
int location;
- if ((data->location[0] & what) != 0 || (data->location[1] & what) != 0)
- return 0; /* already have one of these */
+ if ((chunk_data->location[0] & what) != 0 ||
+ (chunk_data->location[1] & what) != 0)
+ return 0; /* we already have one of these */
/* Find where we are (the code below zeroes info_ptr to indicate that the
* chunks before the first IDAT have been read.)
*/
- if (data->info_ptr == NULL) /* after IDAT */
+ if (chunk_data->info_ptr == NULL) /* after IDAT */
location = what | after_IDAT;
- else if (png_get_valid(png_ptr, data->info_ptr, PNG_INFO_PLTE) != 0)
+ else if (png_get_valid(png_ptr, chunk_data->info_ptr, PNG_INFO_PLTE) != 0)
location = what | before_IDAT;
else
location = what | before_PLTE;
- if (data->location[0] == 0)
- data->location[0] = location;
+ if (chunk_data->location[0] == 0)
+ chunk_data->location[0] = location;
else
- data->location[1] = location;
+ chunk_data->location[1] = location;
return 1; /* handled */
}
@@ -691,11 +698,11 @@
static int PNGCBAPI
read_user_chunk_callback(png_struct *png_ptr, png_unknown_chunkp chunk)
{
- struct user_chunk_data *my_user_chunk_data =
- (struct user_chunk_data*)png_get_user_chunk_ptr(png_ptr);
+ user_chunk_info *my_user_chunk_data =
+ (user_chunk_info*)png_get_user_chunk_ptr(png_ptr);
if (my_user_chunk_data == NULL)
- png_error(png_ptr, "lost user chunk pointer");
+ png_error(png_ptr, "lost pointer to user chunk data");
/* Return one of the following:
* return -n; chunk had an error
@@ -720,9 +727,9 @@
if (chunk->data[0] != 0 && chunk->data[0] != 1)
return -1; /* Invalid mode */
- if (set_location(png_ptr, my_user_chunk_data, have_sTER) != 0)
+ if (set_chunk_location(png_ptr, my_user_chunk_data, have_sTER) != 0)
{
- my_user_chunk_data->sTER_mode=chunk->data[0];
+ my_user_chunk_data->sTER_mode = chunk->data[0];
return 1;
}
@@ -739,7 +746,7 @@
if (chunk->size != 9)
return -1; /* Error return */
- if (set_location(png_ptr, my_user_chunk_data, have_vpAg) == 0)
+ if (set_chunk_location(png_ptr, my_user_chunk_data, have_vpAg) == 0)
return 0; /* duplicate vpAg */
my_user_chunk_data->vpAg_width = png_get_uint_31(png_ptr, chunk->data);
@@ -751,18 +758,18 @@
#ifdef PNG_WRITE_SUPPORTED
static void
-write_sTER_chunk(png_structp write_ptr)
+write_sTER_chunk(png_structp write_ptr, user_chunk_info *data)
{
png_byte sTER[5] = {115, 84, 69, 82, '\0'};
if (verbose != 0)
- fprintf(STDERR, "\n stereo mode = %d\n", user_chunk_data.sTER_mode);
+ fprintf(STDERR, "\n stereo mode = %d\n", data->sTER_mode);
- png_write_chunk(write_ptr, sTER, &user_chunk_data.sTER_mode, 1);
+ png_write_chunk(write_ptr, sTER, &data->sTER_mode, 1);
}
static void
-write_vpAg_chunk(png_structp write_ptr)
+write_vpAg_chunk(png_structp write_ptr, user_chunk_info *data)
{
png_byte vpAg[5] = {118, 112, 65, 103, '\0'};
@@ -770,18 +777,18 @@
if (verbose != 0)
fprintf(STDERR, " vpAg = %lu x %lu, units = %d\n",
- (unsigned long)user_chunk_data.vpAg_width,
- (unsigned long)user_chunk_data.vpAg_height,
- user_chunk_data.vpAg_units);
+ (unsigned long)data->vpAg_width,
+ (unsigned long)data->vpAg_height,
+ data->vpAg_units);
- png_save_uint_32(vpag_chunk_data, user_chunk_data.vpAg_width);
- png_save_uint_32(vpag_chunk_data + 4, user_chunk_data.vpAg_height);
- vpag_chunk_data[8] = user_chunk_data.vpAg_units;
+ png_save_uint_32(vpag_chunk_data, data->vpAg_width);
+ png_save_uint_32(vpag_chunk_data + 4, data->vpAg_height);
+ vpag_chunk_data[8] = data->vpAg_units;
png_write_chunk(write_ptr, vpAg, vpag_chunk_data, 9);
}
static void
-write_chunks(png_structp write_ptr, int location)
+write_chunks(png_structp write_ptr, user_chunk_info *data, int location)
{
int i;
@@ -791,13 +798,13 @@
* vpAg chunks, resulting in an error later. This is not worth worrying
* about - the chunks should not be duplicated!
*/
- for (i=0; i<2; ++i)
+ for (i = 0; i < 2; ++i)
{
- if (user_chunk_data.location[i] == (location | have_sTER))
- write_sTER_chunk(write_ptr);
+ if (data->location[i] == (location | have_sTER))
+ write_sTER_chunk(write_ptr, data);
- else if (user_chunk_data.location[i] == (location | have_vpAg))
- write_vpAg_chunk(write_ptr);
+ else if (data->location[i] == (location | have_vpAg))
+ write_vpAg_chunk(write_ptr, data);
}
}
#endif /* WRITE */
@@ -872,9 +879,9 @@
png_bytep row_buf;
png_uint_32 y;
png_uint_32 width, height;
- volatile int num_passes;
- int pass;
int bit_depth, color_type;
+ user_chunk_info my_user_chunk_data;
+ int pass, num_passes;
row_buf = NULL;
error_parameters.file_name = inname;
@@ -888,7 +895,7 @@
if ((fpout = fopen(outname, "wb")) == NULL)
{
fprintf(STDERR, "Could not open output file %s\n", outname);
- FCLOSE(fpin);
+ fclose(fpin);
return 1;
}
@@ -925,8 +932,8 @@
#endif
#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
- init_callback_info(read_info_ptr);
- png_set_read_user_chunk_fn(read_ptr, &user_chunk_data,
+ init_user_chunk_info(read_info_ptr, &my_user_chunk_data);
+ png_set_read_user_chunk_fn(read_ptr, &my_user_chunk_data,
read_user_chunk_callback);
#endif
@@ -946,8 +953,8 @@
png_destroy_info_struct(write_ptr, &write_end_info_ptr);
png_destroy_write_struct(&write_ptr, &write_info_ptr);
#endif
- FCLOSE(fpin);
- FCLOSE(fpout);
+ fclose(fpin);
+ fclose(fpout);
return 1;
}
@@ -966,8 +973,8 @@
fprintf(STDERR, " destroying write structs\n");
png_destroy_info_struct(write_ptr, &write_end_info_ptr);
png_destroy_write_struct(&write_ptr, &write_info_ptr);
- FCLOSE(fpin);
- FCLOSE(fpout);
+ fclose(fpin);
+ fclose(fpout);
return 1;
}
#endif
@@ -1053,13 +1060,13 @@
#endif
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
- /* Preserve all the unknown chunks, if possible. If this is disabled then,
+ /* Preserve all the unknown chunks, if possible. If this is disabled, then
* even if the png_{get,set}_unknown_chunks stuff is enabled, we can't use
* libpng to *save* the unknown chunks on read (because we can't switch the
* save option on!)
*
- * Notice that if SET_UNKNOWN_CHUNKS is *not* supported read will discard all
- * unknown chunks and write will write them all.
+ * Notice that if SET_UNKNOWN_CHUNKS is *not* supported, the reader will
+ * discard all unknown chunks, and the writer will write them all.
*/
#ifdef PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
png_set_keep_unknown_chunks(read_ptr, PNG_HANDLE_CHUNK_ALWAYS,
@@ -1080,7 +1087,7 @@
* remove the info_ptr (which is only used to determine position relative to
* PLTE) here to indicate that we are after the IDAT.
*/
- user_chunk_data.info_ptr = NULL;
+ my_user_chunk_data.info_ptr = NULL;
#endif
pngtest_debug("Transferring info struct");
@@ -1196,14 +1203,12 @@
png_color_16p background;
if (png_get_bKGD(read_ptr, read_info_ptr, &background) != 0)
- {
png_set_bKGD(write_ptr, write_info_ptr, background);
- }
}
#endif
#ifdef PNG_READ_eXIf_SUPPORTED
{
- png_bytep exif=NULL;
+ png_bytep exif = NULL;
png_uint_32 exif_length;
if (png_get_eXIf_1(read_ptr, read_info_ptr, &exif_length, &exif) != 0)
@@ -1232,9 +1237,7 @@
if (png_get_oFFs(read_ptr, read_info_ptr, &offset_x, &offset_y,
&unit_type) != 0)
- {
png_set_oFFs(write_ptr, write_info_ptr, offset_x, offset_y, unit_type);
- }
}
#endif
#ifdef PNG_pCAL_SUPPORTED
@@ -1246,10 +1249,8 @@
if (png_get_pCAL(read_ptr, read_info_ptr, &purpose, &X0, &X1, &type,
&nparams, &units, ¶ms) != 0)
- {
png_set_pCAL(write_ptr, write_info_ptr, purpose, X0, X1, type,
nparams, units, params);
- }
}
#endif
#ifdef PNG_pHYs_SUPPORTED
@@ -1279,9 +1280,7 @@
if (png_get_sCAL(read_ptr, read_info_ptr, &unit, &scal_width,
&scal_height) != 0)
- {
png_set_sCAL(write_ptr, write_info_ptr, unit, scal_width, scal_height);
- }
}
#else
#ifdef PNG_FIXED_POINT_SUPPORTED
@@ -1304,11 +1303,9 @@
{
png_sPLT_tp entries;
- int num_entries = (int) png_get_sPLT(read_ptr, read_info_ptr, &entries);
- if (num_entries)
- {
+ int num_entries = png_get_sPLT(read_ptr, read_info_ptr, &entries);
+ if (num_entries != 0)
png_set_sPLT(write_ptr, write_info_ptr, entries, num_entries);
- }
}
#endif
@@ -1328,7 +1325,7 @@
int i;
fprintf(STDERR,"\n");
- for (i=0; i<num_text; i++)
+ for (i = 0; i < num_text; i++)
{
fprintf(STDERR," Text compression[%d]=%d\n",
i, text_ptr[i].compression);
@@ -1390,22 +1387,8 @@
&unknowns);
if (num_unknowns != 0)
- {
png_set_unknown_chunks(write_ptr, write_info_ptr, unknowns,
num_unknowns);
-#if PNG_LIBPNG_VER < 10600
- /* Copy the locations from the read_info_ptr. The automatically
- * generated locations in write_end_info_ptr are wrong prior to 1.6.0
- * because they are reset from the write pointer (removed in 1.6.0).
- */
- {
- int i;
- for (i = 0; i < num_unknowns; i++)
- png_set_unknown_chunk_location(write_ptr, write_info_ptr, i,
- unknowns[i].location);
- }
-#endif
- }
}
#endif
@@ -1417,15 +1400,15 @@
*/
png_write_info_before_PLTE(write_ptr, write_info_ptr);
- write_chunks(write_ptr, before_PLTE); /* before PLTE */
+ write_chunks(write_ptr, &my_user_chunk_data, before_PLTE); /* before PLTE */
png_write_info(write_ptr, write_info_ptr);
- write_chunks(write_ptr, before_IDAT); /* after PLTE */
+ write_chunks(write_ptr, &my_user_chunk_data, before_IDAT); /* after PLTE */
png_write_info(write_ptr, write_end_info_ptr);
- write_chunks(write_ptr, after_IDAT); /* after IDAT */
+ write_chunks(write_ptr, &my_user_chunk_data, after_IDAT); /* after IDAT */
#ifdef PNG_COMPRESSION_COMPAT
/* Test the 'compatibility' setting here, if it is available. */
@@ -1433,13 +1416,6 @@
#endif
#endif
-#ifdef SINGLE_ROWBUF_ALLOC
- pngtest_debug("Allocating row buffer...");
- row_buf = (png_bytep)png_malloc(read_ptr,
- png_get_rowbytes(read_ptr, read_info_ptr));
-
- pngtest_debug1("\t%p", row_buf);
-#endif /* SINGLE_ROWBUF_ALLOC */
pngtest_debug("Writing row data");
#if defined(PNG_READ_INTERLACING_SUPPORTED) &&\
@@ -1486,7 +1462,6 @@
pngtest_debug1("Writing row data for pass %d", pass);
for (y = 0; y < pass_height; y++)
{
-#ifndef SINGLE_ROWBUF_ALLOC
pngtest_debug2("Allocating row buffer (pass %d, y = %u)...", pass, y);
row_buf = (png_bytep)png_malloc(read_ptr,
@@ -1495,7 +1470,6 @@
pngtest_debug2("\t%p (%lu bytes)", row_buf,
(unsigned long)png_get_rowbytes(read_ptr, read_info_ptr));
-#endif /* !SINGLE_ROWBUF_ALLOC */
png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1);
#ifdef PNG_WRITE_SUPPORTED
@@ -1512,11 +1486,9 @@
#endif
#endif /* WRITE */
-#ifndef SINGLE_ROWBUF_ALLOC
pngtest_debug2("Freeing row buffer (pass %d, y = %u)", pass, y);
png_free(read_ptr, row_buf);
row_buf = NULL;
-#endif /* !SINGLE_ROWBUF_ALLOC */
}
}
@@ -1548,7 +1520,7 @@
int i;
fprintf(STDERR,"\n");
- for (i=0; i<num_text; i++)
+ for (i = 0; i < num_text; i++)
{
fprintf(STDERR," Text compression[%d]=%d\n",
i, text_ptr[i].compression);
@@ -1561,7 +1533,7 @@
#endif
#ifdef PNG_READ_eXIf_SUPPORTED
{
- png_bytep exif=NULL;
+ png_bytep exif = NULL;
png_uint_32 exif_length;
if (png_get_eXIf_1(read_ptr, end_info_ptr, &exif_length, &exif) != 0)
@@ -1604,22 +1576,8 @@
&unknowns);
if (num_unknowns != 0)
- {
png_set_unknown_chunks(write_ptr, write_end_info_ptr, unknowns,
num_unknowns);
-#if PNG_LIBPNG_VER < 10600
- /* Copy the locations from the read_info_ptr. The automatically
- * generated locations in write_end_info_ptr are wrong prior to 1.6.0
- * because they are reset from the write pointer (removed in 1.6.0).
- */
- {
- int i;
- for (i = 0; i < num_unknowns; i++)
- png_set_unknown_chunk_location(write_ptr, write_end_info_ptr, i,
- unknowns[i].location);
- }
-#endif
- }
}
#endif
@@ -1638,7 +1596,7 @@
* There seems to be no way round this, however vpAg/sTER are not expected
* after IDAT.
*/
- write_chunks(write_ptr, after_IDAT);
+ write_chunks(write_ptr, &my_user_chunk_data, after_IDAT);
png_write_end(write_ptr, write_end_info_ptr);
#endif
@@ -1655,11 +1613,6 @@
#endif
pngtest_debug("Destroying data structs");
-#ifdef SINGLE_ROWBUF_ALLOC
- pngtest_debug("Destroying row_buf for read_ptr");
- png_free(read_ptr, row_buf);
- row_buf = NULL;
-#endif /* SINGLE_ROWBUF_ALLOC */
pngtest_debug("Destroying read_ptr, read_info_ptr, end_info_ptr");
png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr);
#ifdef PNG_WRITE_SUPPORTED
@@ -1670,8 +1623,8 @@
#endif
pngtest_debug("Destruction complete.");
- FCLOSE(fpin);
- FCLOSE(fpout);
+ fclose(fpin);
+ fclose(fpout);
/* Summarize any warnings or errors and in 'strict' mode fail the test.
* Unsupported chunks can result in warnings, in that case ignore the strict
@@ -1717,7 +1670,7 @@
if ((fpout = fopen(outname, "rb")) == NULL)
{
fprintf(STDERR, "Could not find file %s\n", outname);
- FCLOSE(fpin);
+ fclose(fpin);
return 1;
}
@@ -1753,8 +1706,8 @@
wrote_question = 1;
}
- FCLOSE(fpin);
- FCLOSE(fpout);
+ fclose(fpin);
+ fclose(fpout);
if (strict != 0 && unsupported_chunks == 0)
return 1;
@@ -1785,8 +1738,8 @@
wrote_question = 1;
}
- FCLOSE(fpin);
- FCLOSE(fpout);
+ fclose(fpin);
+ fclose(fpout);
/* NOTE: the unsupported_chunks escape is permitted here because
* unsupported text chunk compression will result in the compression
@@ -1803,8 +1756,8 @@
}
#endif /* WRITE && WRITE_FILTER */
- FCLOSE(fpin);
- FCLOSE(fpout);
+ fclose(fpin);
+ fclose(fpout);
return 0;
}
@@ -1851,12 +1804,11 @@
fprintf(STDERR, " NOTE: libpng compiled for max 64k, zlib not\n");
#endif
- if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING))
+ if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0)
{
- fprintf(STDERR,
- "Warning: versions are different between png.h and png.c\n");
- fprintf(STDERR, " png.h version: %s\n", PNG_LIBPNG_VER_STRING);
- fprintf(STDERR, " png.c version: %s\n\n", png_libpng_ver);
+ fprintf(STDERR, "Warning: mismatching versions of png.h and png.c\n");
+ fprintf(STDERR, " png.h version string: %s\n", PNG_LIBPNG_VER_STRING);
+ fprintf(STDERR, " png.c version string: %s\n\n", png_libpng_ver);
++ierror;
}
@@ -1890,7 +1842,7 @@
inname = argv[2];
strict++;
relaxed = 0;
- multiple=1;
+ multiple = 1;
}
else if (strcmp(argv[1], "--relaxed") == 0)
@@ -1900,7 +1852,7 @@
inname = argv[2];
strict = 0;
relaxed++;
- multiple=1;
+ multiple = 1;
}
else if (strcmp(argv[1], "--xfail") == 0)
{
@@ -1910,7 +1862,7 @@
strict = 0;
xfail++;
relaxed++;
- multiple=1;
+ multiple = 1;
}
else
@@ -1942,7 +1894,7 @@
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
int allocation_now = current_allocation;
#endif
- for (i=2; i<argc; ++i)
+ for (i = 2; i < argc; ++i)
{
int kerror;
fprintf(STDERR, "\n Testing %s:", argv[i]);
@@ -2013,7 +1965,7 @@
else
{
int i;
- for (i = 0; i<3; ++i)
+ for (i = 0; i < 3; ++i)
{
int kerror;
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
@@ -2141,7 +2093,7 @@
(unsigned long) png_get_chunk_malloc_max(dummy_ptr));
png_destroy_read_struct(&dummy_ptr, NULL, NULL);
- return (int)(ierror != 0);
+ return (ierror != 0);
}
#else
int
@@ -2150,9 +2102,6 @@
fprintf(STDERR,
" test ignored because libpng was not built with read support\n");
/* And skip this test */
- return PNG_LIBPNG_VER < 10600 ? 0 : 77;
+ return SKIP;
}
#endif
-
-/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_42 Your_png_h_is_not_version_1_6_42;
Added: trunk/Build/source/libs/libpng/libpng-src/powerpc/.editorconfig
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/powerpc/.editorconfig (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/powerpc/.editorconfig 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,8 @@
+# https://editorconfig.org
+
+root = false
+
+# FIXME
+[*.[ch]]
+max_doc_length = unset
+max_line_length = unset
Added: trunk/Build/source/libs/libpng/libpng-src/projects/.editorconfig
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/projects/.editorconfig (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/projects/.editorconfig 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,3 @@
+# https://editorconfig.org
+
+root = true
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/checksym.awk
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/checksym.awk 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/checksym.awk 2024-02-24 01:06:57 UTC (rev 70115)
@@ -106,11 +106,13 @@
# At the end check for symbols marked as both duplicated and removed
END{
if (symbolo > lasto) {
- print "highest symbol ordinal in png.h,", symbolo ", exceeds last ordinal from png.h", lasto
+ print "highest symbol ordinal in png.h,",
+ symbolo ", exceeds last ordinal from png.h", lasto
err = 1
}
if (mastero > lasto) {
- print "highest symbol ordinal in", master ",", mastero ", exceeds last ordinal from png.h", lasto
+ print "highest symbol ordinal in", master ",",
+ mastero ", exceeds last ordinal from png.h", lasto
err = 1
}
unexported=0
@@ -149,17 +151,21 @@
unexported = 0
}
if (symbol[o] != "" && removed[o] != "") {
- print "png.h: symbol", o, "both exported as '" symbol[o] "' and removed as '" removed[o] "'"
+ print "png.h: symbol", o,
+ "both exported as '" symbol[o] "' and removed as '" removed[o] "'"
err = 1
} else if (symbol[o] != official[o]) {
# either the symbol is missing somewhere or it changed
err = 1
if (symbol[o] == "")
- print "png.h: symbol", o, "is exported as '" official[o] "' in", master
+ print "png.h: symbol", o,
+ "is exported as '" official[o] "' in", master
else if (official[o] == "")
- print "png.h: exported symbol", o, "'" symbol[o] "' not present in", master
+ print "png.h: exported symbol", o,
+ "'" symbol[o] "' not present in", master
else
- print "png.h: exported symbol", o, "'" symbol[o] "' exists as '" official[o] "' in", master
+ print "png.h: exported symbol", o,
+ "'" symbol[o] "' exists as '" official[o] "' in", master
}
# Finally generate symbols.new
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/cmake/AUTHORS.md
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/cmake/AUTHORS.md 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/cmake/AUTHORS.md 2024-02-24 01:06:57 UTC (rev 70115)
@@ -5,8 +5,12 @@
-----------
* Alex Gaynor
+ * Alexey Petruchik
* Andreas Franek
+ * Andrew Hundt
* B. Scott Michel
+ * Benjamin Buch
+ * Bernd Kuhls
* Cameron Cawley
* Christian Ehrlicher
* Christopher Sean Morrison
@@ -14,7 +18,9 @@
* Clifford Yapp
* Clinton Ingram
* Cosmin Truta
+ * Dan Rosser
* David Callu
+ * Gianfranco Costamagna
* Gleb Mazovetskiy
* Glenn Randers-Pehrson
* Gunther Nikl
@@ -24,6 +30,7 @@
* Kyle Bentley
* Martin Storsjö
* Owen Rudge
+ * Philip Lowman
* Roger Leigh
* Roger Lowman
* Sam Serrels
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/libpng-config-head.in
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/libpng-config-head.in 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/libpng-config-head.in 2024-02-24 01:06:57 UTC (rev 70115)
@@ -11,7 +11,7 @@
# Modeled after libxml-config.
-version=1.6.42
+version=1.6.43
prefix=""
libdir=""
libs=""
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/libpng.pc.in
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/libpng.pc.in 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/libpng.pc.in 2024-02-24 01:06:57 UTC (rev 70115)
@@ -5,6 +5,6 @@
Name: libpng
Description: Loads and saves PNG files
-Version: 1.6.42
+Version: 1.6.43
Libs: -L${libdir} -lpng16
Cflags: -I${includedir}
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.32sunu
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.32sunu 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.32sunu 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,6 +1,6 @@
# makefile for libpng on Solaris 2.x with cc
# Contributed by William L. Sebok, based on makefile.linux
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@@ -19,9 +19,8 @@
# Utilities:
CC=cc
-AR_RC=ar rc
+AR=ar
RANLIB=echo
-MKDIR_P=mkdir -p
LN_SF=ln -f -s
RM_F=/bin/rm -f
@@ -42,6 +41,7 @@
-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g
+ARFLAGS=rc
LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
@@ -65,7 +65,7 @@
DFNFLAGS = $(DEFS) $(CPPFLAGS)
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.64sunu
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.64sunu 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.64sunu 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,6 +1,6 @@
# makefile for libpng on Solaris 2.x with cc
# Contributed by William L. Sebok, based on makefile.linux
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@@ -19,9 +19,8 @@
# Utilities:
CC=cc
-AR_RC=ar rc
+AR=ar
RANLIB=echo
-MKDIR_P=mkdir -p
LN_SF=ln -f -s
RM_F=/bin/rm -f
@@ -41,7 +40,8 @@
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
-CFLAGS= $(SUN_CC_FLAGS) # $(WARNMORE) -g
+CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g
+ARFLAGS=rc
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
@@ -65,7 +65,7 @@
DFNFLAGS = $(DEFS) $(CPPFLAGS)
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Deleted: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.acorn
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.acorn 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.acorn 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,57 +0,0 @@
-# Project: libpng
-
-
-# Toolflags:
-CCflags = -c -depend !Depend -IC:,Zlib: -g -throwback -DRISCOS -fnah
-C++flags = -c -depend !Depend -IC: -throwback
-Linkflags = -aif -c++ -o $@
-ObjAsmflags = -throwback -NoCache -depend !Depend
-CMHGflags =
-LibFileflags = -c -l -o $@
-Squeezeflags = -o $@
-
-# Final targets:
- at .libpng-lib: @.o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \
- @.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngrtran \
- @.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil
- LibFile $(LibFileflags) @.o.png @.o.pngerror @.o.pngrio @.o.pngrtran \
- @.o.pngmem @.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngwio \
- @.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil
- at .mm-libpng-lib: @.mm.png @.mm.pngerror @.mm.pngrio @.mm.pngwio @.mm.pngmem \
- @.mm.pngpread @.mm.pngset @.mm.pngget @.mm.pngread @.mm.pngrtran \
- @.mm.pngrutil @.mm.pngtrans @.mm.pngwrite @.mm.pngwtran @.mm.pngwutil
- LibFile $(LibFileflags) @.mm.png @.mm.pngerror @.mm.pngrio \
- @.mm.pngwio @.mm.pngmem @.mm.pngpread @.mm.pngset @.mm.pngget \
- @.mm.pngread @.mm.pngrtran @.mm.pngrutil @.mm.pngtrans @.mm.pngwrite \
- @.mm.pngwtran @.mm.pngwutil
-
-
-# User-editable dependencies:
-# (C) Copyright 1997 Tom Tanner
-Test: @.pngtest
- <Prefix$Dir>.pngtest
- @remove <Prefix$Dir>.pngtest
-
-#It would be nice if you could stop "make" listing from here on!
- at .pngtest: @.o.pngtest @.libpng-lib C:o.Stubs Zlib:zlib_lib
- Link $(Linkflags) @.o.pngtest @.libpng-lib C:o.Stubs Zlib:zlib_lib
-
-.SUFFIXES: .o .mm .c
-
-.c.mm:
- MemCheck.CC cc $(ccflags) -o $@ LibPng:$<
-.c.o:
- cc $(ccflags) -o $@ $<
-
-# See scripts.mak.libpngconf for how to generate this:
- at .h.libpngconf: @.scripts.h.libpngconf
- copy @.scripts.h.libpngconf $@
-
-# Static dependencies:
- at .o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \
- at .o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngrtran \
- at .o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil \
- at .o.pngtest: @.h.libpngconf
-
-
-# Dynamic dependencies:
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.aix
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.aix 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.aix 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng using gcc (generic, static library)
-# Copyright (C) 2000, 2022 Cosmin Truta
+# Copyright (C) 2000, 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006-2009, 2014 Glenn Randers-Pehrson
# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
@@ -15,9 +15,8 @@
# Compiler, linker, lib and other tools
CC = gcc
LD = $(CC)
-AR_RC = ar rcs
+AR = ar
RANLIB = ranlib
-MKDIR_P = mkdir -p
RM_F = rm -f
LIBNAME = libpng16
@@ -26,6 +25,7 @@
WARNMORE =
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
+ARFLAGS = rc
LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
# File lists
@@ -44,7 +44,7 @@
DFNFLAGS = $(DEFS) $(CPPFLAGS)
$(LIBNAME).a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
test: pngtest
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.amiga
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.amiga 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.amiga 2024-02-24 01:06:57 UTC (rev 70115)
@@ -26,8 +26,6 @@
RM= delete quiet
# library (.lib) file creation command
AR= oml
-# make directory command
-MKDIR= makedir
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.beos
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.beos 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.beos 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,6 +1,6 @@
# makefile for libpng on BeOS x86 ELF with gcc
# modified from makefile.linux by Sander Stoks
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1999 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@@ -19,9 +19,8 @@
# Utilities:
CC=gcc
-AR_RC=ar rc
+AR=ar
RANLIB=ranlib
-MKDIR_P=mkdir -p
LN_SF=ln -sf
CP=cp
RM_F=/bin/rm -f
@@ -42,6 +41,7 @@
# still here in R4.5
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-O1 -funroll-loops $(ALIGN) -Wall -Wextra -Wundef # $(WARNMORE) -g
+ARFLAGS=rc
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz # -g
@@ -66,7 +66,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.clang
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.clang 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.clang 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng using clang (generic, static library)
-# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
+# Copyright (C) 2000, 2014, 2019-2024 Cosmin Truta
# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -14,7 +14,7 @@
# Compiler, linker, lib and other tools
CC = clang
LD = $(CC)
-AR_RC = ar rcs
+AR = ar
RANLIB = ranlib
CP = cp
RM_F = rm -f
@@ -28,6 +28,7 @@
DEFS = $(NOHWOPT)
CPPFLAGS = -I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5
CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
+ARFLAGS = rc
LDFLAGS = -L$(ZLIBLIB) # -g
LIBS = -lz -lm
@@ -60,7 +61,7 @@
@false
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
test: pngtest$(EXEEXT)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.darwin
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.darwin 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.darwin 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng on Darwin / macOS
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2004, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 2001 Christoph Pfisterer
# derived from makefile.linux:
@@ -24,9 +24,8 @@
# Utilities:
CC=cc
-AR_RC=ar rc
+AR=ar
RANLIB=ranlib
-MKDIR_P=mkdir -p
LN_SF=ln -sf
CP=cp
RM_F=rm -f
@@ -36,6 +35,7 @@
DEFS=$(NOHWOPT)
CPPFLAGS=-I$(ZLIBINC) $(DEFS)
CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef
+ARFLAGS=rc
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz
# Pre-built configuration
@@ -63,7 +63,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.dec
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.dec 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.dec 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng on DEC Alpha Unix
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2000-2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -17,9 +17,8 @@
# Utilities:
CC=cc
-AR_RC=ar rc
+AR=ar
RANLIB=ranlib
-MKDIR_P=mkdir
LN_SF=ln -f -s
CP=cp
RM_F=/bin/rm -f
@@ -32,6 +31,7 @@
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-std -w1 -O # -g
+ARFLAGS=rc
LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm
# Pre-built configuration
@@ -51,7 +51,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.dj2
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.dj2 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.dj2 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# DJGPP (DOS gcc) makefile for libpng
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006, 2009-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -8,8 +8,11 @@
# and license in png.h
CC=gcc
+AR=ar
+RANLIB=ranlib
CPPFLAGS=-I../zlib -DPNG_NO_SNPRINTF
CFLAGS=-O
+ARFLAGS=rc
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
CP=cp
@@ -32,8 +35,8 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- ar rc $@ $(OBJS)
- ranlib $@
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+ $(RANLIB) $@
pngtest: pngtest.o libpng.a
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.emcc
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.emcc 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.emcc 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng using emscripten
-# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
+# Copyright (C) 2000, 2014, 2019-2024 Cosmin Truta
# Copyright (C) 2021 Kirk Roerig
# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
@@ -15,7 +15,7 @@
# Compiler, linker, lib and other tools
CC = emcc
LD = $(CC)
-AR_RC = emar rcs
+AR = emar
RANLIB = emranlib
CP = cp
RM_F = rm -f
@@ -22,6 +22,7 @@
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS = -O2 -Wall -Wextra -Wundef
+ARFLAGS = rc
LDFLAGS = -L$(ZLIBLIB)
PNGTEST_LDFLAGS = --preload-file=pngtest.png
LIBS = -lz -lm
@@ -51,7 +52,7 @@
@false
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
test: pngtest
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.gcc
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.gcc 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.gcc 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng using gcc (generic, static library)
-# Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
+# Copyright (C) 2000, 2014, 2019-2024 Cosmin Truta
# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -14,7 +14,7 @@
# Compiler, linker, lib and other tools
CC = gcc
LD = $(CC)
-AR_RC = ar rcs
+AR = ar
RANLIB = ranlib
CP = cp
RM_F = rm -f
@@ -28,6 +28,7 @@
DEFS = $(NOHWOPT)
CPPFLAGS = -I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5
CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
+ARFLAGS = rc
LDFLAGS = -L$(ZLIBLIB) # -g
LIBS = -lz -lm
@@ -60,7 +61,7 @@
@false
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
test: pngtest$(EXEEXT)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hp64
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hp64 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hp64 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 1999-2002, 2006, 2009, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42
# Contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
@@ -29,9 +29,8 @@
# Utilities:
CC=cc
-AR_RC=ar rc
+AR=ar
RANLIB=ranlib
-MKDIR_P=mkdir -p
LN_SF=ln -sf
CP=cp
RM_F=/bin/rm -f
@@ -41,7 +40,7 @@
CFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
# Caution: be sure you have built zlib with the same CFLAGS.
CCFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
-
+ARFLAGS=rc
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
# Pre-built configuration
@@ -68,7 +67,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hpgcc
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hpgcc 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hpgcc 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng on HP-UX using GCC with the HP ANSI/C linker.
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006-2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 2001, Laurent faillie
# Copyright (C) 1998, 1999 Greg Roelofs
@@ -19,10 +19,9 @@
# Utilities:
CC=gcc
+AR=ar
+RANLIB=ranlib
LD=ld
-AR_RC=ar rc
-RANLIB=ranlib
-MKDIR_P=mkdir -p
LN_SF=ln -sf
CP=cp
RM_F=/bin/rm -f
@@ -44,6 +43,7 @@
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
+ARFLAGS=rc
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
@@ -64,7 +64,7 @@
all: libpng.a $(LIBSO) pngtest
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hpux
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hpux 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.hpux 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 1999-2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42
# Contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
@@ -30,9 +30,8 @@
# Utilities:
CC=cc
-AR_RC=ar rc
+AR=ar
RANLIB=ranlib
-MKDIR_P=mkdir -p
LN_SF=ln -sf
RM_F=/bin/rm -f
@@ -40,6 +39,7 @@
CFLAGS=-O -Ae +DA1.1 +DS2.0
# Caution: be sure you have built zlib with the same CFLAGS.
CCFLAGS=-O -Ae +DA1.1 +DS2.0
+ARFLAGS=rc
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
# Pre-built configuration
@@ -66,7 +66,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.linux
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.linux 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.linux 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng.a and libpng16.so on Linux ELF with gcc
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 1998, 1999, 2002, 2006, 2008, 2010-2014 Greg Roelofs and
# Glenn Randers-Pehrson
# Copyright (C) 1996, 1997 Andreas Dilger
@@ -18,9 +18,8 @@
# Utilities:
CC=gcc
-AR_RC=ar rc
+AR=ar
RANLIB=ranlib
-MKDIR_P=mkdir -p
LN_SF=ln -sf
CP=cp
RM_F=rm -f
@@ -40,6 +39,7 @@
DEFS=$(NOHWOPT)
CPPFLAGS=-I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5
CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
+ARFLAGS=rc
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm # -g
@@ -68,7 +68,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.mips
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.mips 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.mips 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 1998-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -8,15 +8,15 @@
# and license in png.h
CC=cc
+AR=ar
+#RANLIB=ranlib
+RANLIB=echo
CPPFLAGS=-I../zlib -DSYSV -Dmips
CFLAGS=-O -systype sysv -w
#CFLAGS=-O
+ARFLAGS=rc
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
-AR_RC=ar rc
-#RANLIB=ranlib
-RANLIB=echo
-
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
@@ -34,7 +34,7 @@
cp $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
pngtest: pngtest.o libpng.a
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.msys
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.msys 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.msys 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng using MSYS/gcc (shared, static library)
-# Copyright (C) 2019-2022 Cosmin Truta
+# Copyright (C) 2000, 2019-2024 Cosmin Truta
# Copyright (C) 2012 Glenn Randers-Pehrson and Christopher M. Wheeler
#
# Portions taken from makefile.linux and makefile.gcc:
@@ -30,20 +30,20 @@
# Compiler, linker, lib and other tools
CC = gcc
LD = $(CC)
-AR_RC = ar rcs
+AR = ar
RANLIB = ranlib
CP = cp
RM_F = rm -rf
-MKDIR_P=mkdir -p
-LN_SF=ln -sf
+LN_SF = ln -sf
CPPFLAGS = # -DPNG_DEBUG=5
CFLAGS = -O2 -Wall -Wextra -Wundef # -g
+ARFLAGS = rc
LDFLAGS = # -g
LIBS = -lz -lm
# File extensions
-EXEEXT=.exe
+EXEEXT = .exe
# Pre-built configuration
# See scripts/pnglibconf.mak for more options
@@ -75,7 +75,7 @@
$(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOMAJ)
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
install:
Added: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.riscos
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.riscos (rev 0)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.riscos 2024-02-24 01:06:57 UTC (rev 70115)
@@ -0,0 +1,54 @@
+# Project: libpng
+
+# Copyright (C) 2020 Cameron Cawley
+# Copyright (C) 1997 Tom Tanner
+
+# Toolflags:
+CCflags = -c -depend !Depend -IC:,C:zlib -g -throwback -DRISCOS -fnah -wz
+Linkflags = -aif -o $@
+LibFileflags = -c -l -o $@
+
+# Final targets:
+ at .libpng-lib: @.o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \
+ @.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngrtran \
+ @.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil
+ LibFile $(LibFileflags) @.o.png @.o.pngerror @.o.pngrio @.o.pngrtran \
+ @.o.pngmem @.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngwio \
+ @.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil
+ at .mm-libpng-lib: @.mm.png @.mm.pngerror @.mm.pngrio @.mm.pngwio @.mm.pngmem \
+ @.mm.pngpread @.mm.pngset @.mm.pngget @.mm.pngread @.mm.pngrtran \
+ @.mm.pngrutil @.mm.pngtrans @.mm.pngwrite @.mm.pngwtran @.mm.pngwutil
+ LibFile $(LibFileflags) @.mm.png @.mm.pngerror @.mm.pngrio \
+ @.mm.pngwio @.mm.pngmem @.mm.pngpread @.mm.pngset @.mm.pngget \
+ @.mm.pngread @.mm.pngrtran @.mm.pngrutil @.mm.pngtrans @.mm.pngwrite \
+ @.mm.pngwtran @.mm.pngwutil
+
+
+# User-editable dependencies:
+Test: @.pngtest
+ Run @.pngtest
+ @Remove @.pngtest
+
+#It would be nice if you could stop "make" listing from here on!
+ at .pngtest: @.o.pngtest @.libpng-lib C:o.Stubs C:zlib.o.zlib
+ Link $(Linkflags) @.o.pngtest @.libpng-lib C:o.Stubs C:zlib.o.zlib
+
+.SUFFIXES: .o .mm .c
+
+.c.mm:
+ MemCheck.CC cc $(ccflags) -o $@ LibPng:$<
+.c.o:
+ cc $(ccflags) -o $@ $<
+
+# See scripts.pnglibconf/mak for how to generate this:
+ at .h.pnglibconf: @.scripts.pnglibconf/h/prebuilt
+ Copy @.scripts.pnglibconf/h/prebuilt $@ ~CF~V
+
+# Static dependencies:
+ at .o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \
+ at .o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngrtran \
+ at .o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil \
+ at .o.pngtest: @.h.pnglibconf
+
+
+# Dynamic dependencies:
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sco
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sco 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sco 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,7 +1,7 @@
# makefile for SCO OSr5 ELF and Unixware 7 with Native cc
# Contributed by Mike Hopkirk (hops at sco.com) modified from Makefile.lnx
# force ELF build dynamic linking, SONAME setting in lib and RPATH in app
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
@@ -20,9 +20,8 @@
# Utilities:
CC=cc
-AR_RC=ar rc
+AR=ar
RANLIB=echo
-MKDIR_P=mkdir
LN_SF=ln -f -s
CP=cp
RM_F=/bin/rm -f
@@ -34,7 +33,8 @@
ZLIBINC=../zlib
CPPFLAGS=-I$(ZLIBINC)
-CFLAGS= -dy -belf -O3
+CFLAGS=-dy -belf -O3
+ARFLAGS=rc
LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
# Pre-built configuration
@@ -61,7 +61,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sggcc
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sggcc 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sggcc 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2001-2002, 2006, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -17,9 +17,8 @@
# Utilities:
CC=gcc
-AR_RC=ar rc
+AR=ar
RANLIB=echo
-MKDIR_P=mkdir -p
LN_SF=ln -sf
CP=cp
RM_F=/bin/rm -f
@@ -39,6 +38,7 @@
WARNMORE=
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=$(ABI) -O $(WARNMORE) -fPIC -mabi=n32 # -g
+ARFLAGS=rc
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g
LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
-set_version sgi$(PNGMAJ).0
@@ -61,7 +61,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
shared: $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sgi
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sgi 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sgi 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2001-2002, 2006, 2007, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -17,9 +17,8 @@
# Utilities:
CC=cc
-AR_RC=ar rc
+AR=ar
RANLIB=echo
-MKDIR_P=mkdir -p
LN_SF=ln -sf
CP=cp
RM_F=/bin/rm -f
@@ -41,6 +40,7 @@
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
#CFLAGS= $(ABI) -O $(WARNMORE) -KPIC # -g
CFLAGS=$(ABI) -O $(WARNMORE) # -g
+ARFLAGS=rc
LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g
LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
@@ -64,7 +64,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.so9
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.so9 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.so9 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,7 +1,7 @@
# makefile for libpng on Solaris 9 (beta) with Forte cc
# Updated by Chad Schrock for Solaris 9
# Contributed by William L. Sebok, based on makefile.linux
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
# Copyright (C) 1998-2001 Greg Roelofs
# Copyright (C) 1996-1997 Andreas Dilger
@@ -21,9 +21,8 @@
# Utilities:
# gcc 2.95 doesn't work.
CC=cc
-AR_RC=ar rc
+AR=ar
RANLIB=echo
-MKDIR_P=mkdir -p
LN_SF=ln -f -s
CP=cp
RM_F=/bin/rm -f
@@ -41,6 +40,7 @@
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-O3
+ARFLAGS=rc
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
# Pre-built configuration
@@ -67,7 +67,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.solaris
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.solaris 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.solaris 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng on Solaris 2.x with gcc
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2004, 2006-2008, 2010-2014 Glenn Randers-Pehrson
# Contributed by William L. Sebok, based on makefile.linux
# Copyright (C) 1998 Greg Roelofs
@@ -19,9 +19,8 @@
# Utilities:
CC=gcc
-AR_RC=ar rc
+AR=ar
RANLIB=echo
-MKDIR_P=mkdir -p
LN_SF=ln -f -s
CP=cp
RM_F=/bin/rm -f
@@ -40,6 +39,7 @@
-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-O -Wall -Wextra -Wundef # $(WARNMORE) -g
+ARFLAGS=rc
LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm # -g
# Pre-built configuration
@@ -66,7 +66,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(LIBSO): $(LIBSOMAJ)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.std
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.std 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.std 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -16,9 +16,8 @@
CC = cc
CPP = $(CC) -E
LD = $(CC)
-AR_RC = ar rc
+AR = ar
RANLIB = ranlib
-MKDIR_P = mkdir
MV_F = mv -f
RM_F = rm -f
AWK = awk
@@ -29,6 +28,7 @@
DFA_EXTRA = # extra files that can be used to control configuration
CPPFLAGS = -I$(ZLIBINC) $(NOHWOPT) # -DPNG_DEBUG=5
CFLAGS = -O # -g
+ARFLAGS = rc
LDFLAGS = -L$(ZLIBLIB) # -g
LIBS = -lz -lm
@@ -66,7 +66,7 @@
$(MV_F) pnglibconf.tmp $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
pngtest: pngtest.o libpng.a
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sunos
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sunos 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.sunos 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,5 +1,5 @@
# makefile for libpng
-# Copyright (C) 2020-2022 Cosmin Truta
+# Copyright (C) 2020-2024 Cosmin Truta
# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
@@ -14,14 +14,14 @@
ZLIBINC=../zlib
CC=gcc
-AR_RC=ar rc
+AR=ar
RANLIB=ranlib
-MKDIR_P=mkdir -p
CP=cp
RM_F=/bin/rm -f
CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
CFLAGS=-O
+ARFLAGS=rc
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
# Pre-built configuration
@@ -41,7 +41,7 @@
$(CP) $(PNGLIBCONF_H_PREBUILT) $@
libpng.a: $(OBJS)
- $(AR_RC) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
pngtest: pngtest.o libpng.a
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.vcwin-arm64
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.vcwin-arm64 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.vcwin-arm64 2024-02-24 01:06:57 UTC (rev 70115)
@@ -31,7 +31,7 @@
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
# File extensions
-O=.obj
+O = .obj
# File lists
OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.vcwin32
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.vcwin32 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/makefile.vcwin32 2024-02-24 01:06:57 UTC (rev 70115)
@@ -30,7 +30,7 @@
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
# File extensions
-O=.obj
+O = .obj
# File lists
OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O)
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/options.awk
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/options.awk 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/options.awk 2024-02-24 01:06:57 UTC (rev 70115)
@@ -401,8 +401,10 @@
if (i > NF) {
# Output new 'option' lines to the intermediate file (out)
- print "option READ_" opt, "requires READ_ANCILLARY_CHUNKS" reqread, "enables", opt enables , onoff >out
- print "option WRITE_" opt, "requires WRITE_ANCILLARY_CHUNKS" reqwrite, "enables", opt enables, onoff >out
+ print "option READ_" opt, "requires READ_ANCILLARY_CHUNKS" reqread,
+ "enables", opt enables , onoff >out
+ print "option WRITE_" opt, "requires WRITE_ANCILLARY_CHUNKS" reqwrite,
+ "enables", opt enables, onoff >out
next
}
# Else hit the error handler below - bad line format!
@@ -731,7 +733,9 @@
# 'have_ifs' here means that everything = "off" still allows an 'if' on
# an otherwise enabled option to turn it on; otherwise the 'if'
# handling is effectively disabled by 'everything = off'
- if (option[i] == "off" || option[i] == "disabled" && everything != "on" || option[i] == "enabled" && everything == "off" && !have_ifs) {
+ if ((option[i] == "off") ||
+ (option[i] == "disabled" && everything != "on") ||
+ (option[i] == "enabled" && everything == "off" && !have_ifs)) {
print "# undef PNG_on /*default off*/" >out
} else {
print "# ifdef PNG_NO_" i >out
@@ -752,7 +756,8 @@
# pnglibconf.h
print "# ifdef PNG_on" >out
if (i ~ /^fail_/) {
- print error, i, "is on: enabled by:" iffs[i] enabledby[i] ", requires" requires[i] end >out
+ print error, i, "is on:",
+ "enabled by:" iffs[i] enabledby[i] ", requires" requires[i] end >out
} else if (i !~ /^ok_/) {
print def i sup >out
# Supported option, set required settings
@@ -779,7 +784,8 @@
print und i une >out
}
if (i ~ /^ok_/) {
- print error, i, "not enabled: requires:" requires[i] ", enabled by:" iffs[i] enabledby[i] end >out
+ print error, i, "not enabled: ",
+ "requires:" requires[i] ", enabled by:" iffs[i] enabledby[i] end >out
}
print "#endif" >out
}
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/pnglibconf.dfa
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/pnglibconf.dfa 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/pnglibconf.dfa 2024-02-24 01:06:57 UTC (rev 70115)
@@ -204,26 +204,33 @@
# These options are specific to the ARM NEON hardware optimizations. At present
# these optimizations depend on GCC specific pre-processing of an assembler (.S)
-# file so they probably won't work with other compilers.
+# file, so they probably won't work with other compilers.
#
-# ARM_NEON_OPT: unset: check at compile time (__ARM_NEON__ must be defined by
-# the compiler, typically as a result of specifying
-# CC="gcc -mfpu=neon".)
-# 0: disable (even if the CPU has a NEON FPU.)
-# 1: check at run time (via ARM_NEON_{API,CHECK})
-# 2: switch on unconditionally (inadvisable - instead pass
-# -mfpu=neon to GCC in CC)
-# When building libpng avoid using any setting other than '0'; '1' is
-# set automatically when either 'API' or 'CHECK' are configured in,
-# '2' should not be necessary as -mfpu=neon will achieve the same
-# effect as well as applying NEON optimizations to the rest of the
-# libpng code.
-# NOTE: any setting other than '0' requires ALIGNED_MEMORY
-# ARM_NEON_API: (PNG_ARM_NEON == 1) allow the optimization to be switched on
-# with png_set_option
-# ARM_NEON_CHECK: (PNG_ARM_NEON == 1) compile a run-time check to see if Neon
-# extensions are supported. This is poorly supported and
-# deprecated - use the png_set_option API.
+# ARM_NEON_OPT:
+# unset: check at compile time
+# (__ARM_NEON__ must be predefined by the compiler, as a result of
+# passing "-mfpu=neon" to the compiler options)
+# 0: disable (even if the CPU has a NEON FPU)
+# 1: check at run time (via ARM_NEON_{API,CHECK})
+# 2: switch on unconditionally
+# (inadvisable - instead, pass "-mfpu=neon" to the compiler)
+# NOTE:
+# When building libpng, avoid using any setting other than '0';
+# '1' is set automatically when either 'API' or 'CHECK' are configured in;
+# '2' should not be necessary, as "-mfpu=neon" will achieve the same effect
+# as well as applying the NEON optimizations to the rest of libpng.
+# NOTE:
+# Any setting other than '0' requires ALIGNED_MEMORY.
+#
+# ARM_NEON_API:
+# (PNG_ARM_NEON == 1)
+# Allow the optimization to be switched on with png_set_option.
+#
+# ARM_NEON_CHECK:
+# (PNG_ARM_NEON == 1)
+# Compile a run-time check to see if Neon extensions are supported.
+# This is poorly supported and deprecated - use the png_set_option API.
+#
setting ARM_NEON_OPT
option ARM_NEON_API disabled requires ALIGNED_MEMORY enables SET_OPTION,
sets ARM_NEON_OPT 1
@@ -232,24 +239,29 @@
# These options are specific to the PowerPC VSX hardware optimizations.
#
-# POWERPC_VSX_OPT: unset: check at compile time (__PPC64__,__ALTIVEC__,__VSX__
-# must be defined by the compiler, typically as a result
-# of specifying
-# "-mvsx -maltivec" compiler flags)
-# 0: disable (even if the CPU supports VSX.)
-# 1: check at run time (via POWERPC_VSX_{API,CHECK})
-# 2: switch on unconditionally (inadvisable - instead pass
-# -mvsx -maltivec to compiler options)
-# When building libpng avoid using any setting other than '0'; '1' is
-# set automatically when either 'API' or 'CHECK' are configured in,
-# '2' should not be necessary as "-mvsx -maltivec" will achieve the same
-# effect as well as applying VSX optimizations to the rest of the
-# libpng code.
-# POWERPC_VSX_API: (PNG_POWERPC_VSX == 1) allow the optimization to be switched on
-# with png_set_option
-# POWERPC_VSX_CHECK: (PNG_POWERPC_VSX == 1) compile a run-time check to see if VSX
-# extensions are supported. This is supported not for all OSes
-# (see contrib/powerpc/README)
+# POWERPC_VSX_OPT:
+# unset: check at compile time
+# (__PPC64__,__ALTIVEC__,__VSX__ must be predefined by the compiler,
+# as a result of passing "-mvsx -maltivec" to the compiler options)
+# 0: disable (even if the CPU supports VSX)
+# 1: check at run time (via POWERPC_VSX_{API,CHECK})
+# 2: switch on unconditionally
+# (inadvisable - instead, pass "-mvsx -maltivec" to the compiler)
+# NOTE:
+# When building libpng, avoid using any setting other than '0';
+# '1' is set automatically when either 'API' or 'CHECK' are configured in;
+# '2' should not be necessary, as "-mvsx -maltivec" will achieve the same
+# effect as well as applying the VSX optimizations to the rest of libpng.
+#
+# POWERPC_VSX_API:
+# (PNG_POWERPC_VSX == 1)
+# Allow the optimization to be switched on with png_set_option.
+#
+# POWERPC_VSX_CHECK:
+# (PNG_POWERPC_VSX == 1)
+# Compile a run-time check to see if VSX extensions are supported.
+# This is not supported on all systems. See contrib/powerpc-vsx/README.
+#
setting POWERPC_VSX_OPT
option POWERPC_VSX_API disabled enables SET_OPTION,
sets POWERPC_VSX_OPT 1
@@ -258,23 +270,30 @@
# These options are specific to the MIPS MSA hardware optimizations.
#
-# MIPS_MSA_OPT: unset: check at compile time (__mips_msa must be defined by
-# the compiler, typically as a result of specifying
-# "-mmsa -mfp64" compiler flags)
-# 0: disable (even if the CPU supports MSA.)
-# 1: check at run time (via MIPS_MSA_{API,CHECK})
-# 2: switch on unconditionally (inadvisable - instead pass
-# -mmsa -mfp64 to compiler options)
-# When building libpng avoid using any setting other than '0'; '1' is
-# set automatically when either 'API' or 'CHECK' are configured in,
-# '2' should not be necessary as "-mmsa -mfp64" will achieve the same
-# effect as well as applying MSA optimizations to the rest of the
-# libpng code.
-# NOTE: any setting other than '0' requires ALIGNED_MEMORY
-# MIPS_MSA_API: (PNG_MIPS_MSA == 1) allow the optimization to be switched on
-# with png_set_option.
-# MIPS_MSA_CHECK: (PNG_MIPS_MSA == 1) compile a run-time check to see if MSA
-# extensions are supported.
+# MIPS_MSA_OPT:
+# unset: check at compile time
+# (__mips_msa must be predefined by the compiler, as a result of
+# passing "-mmsa -mfp64" to the compiler options)
+# 0: disable (even if the CPU supports MSA)
+# 1: check at run time (via MIPS_MSA_{API,CHECK})
+# 2: switch on unconditionally
+# (inadvisable - instead, pass "-mmsa -mfp64" to the compiler)
+# NOTE:
+# When building libpng, avoid using any setting other than '0';
+# '1' is set automatically when either 'API' or 'CHECK' are configured in;
+# '2' should not be necessary, as "-mmsa -mfp64" will achieve the same
+# effect as well as applying the MSA optimizations to the rest of libpng.
+# NOTE:
+# Any setting other than '0' requires ALIGNED_MEMORY.
+#
+# MIPS_MSA_API:
+# (PNG_MIPS_MSA == 1)
+# Allow the optimization to be switched on with png_set_option.
+#
+# MIPS_MSA_CHECK:
+# (PNG_MIPS_MSA == 1)
+# Compile a run-time check to see if MSA extensions are supported.
+#
setting MIPS_MSA_OPT
option MIPS_MSA_API disabled requires ALIGNED_MEMORY enables SET_OPTION,
sets MIPS_MSA_OPT 1
@@ -283,22 +302,30 @@
# These options are specific to the MIPS MMI hardware optimizations.
#
-# MIPS_MMI_OPT: unset: check at compile time (__mips_loongson_mmi must be defined by
-# the compiler, typically as a result of specifying
-# "-mloongson-mmi -march=loongson3a" compiler flags)
-# 0: disable (even if the CPU supports MMI.)
-# 1: check at run time (via MIPS_MMI_{API,CHECK})
-# 2: switch on unconditionally (inadvisable - instead pass
-# -mloongson-mmi -march=loongson3a to compiler options)
-# When building libpng avoid using any setting other than '0'; '1' is
-# set automatically when either 'API' or 'CHECK' are configured in,
-# '2' should not be necessary as "-mloongson-mmi -march=loongson3a" will achieve the same
-# effect as well as applying MMI optimizations to the rest of the
-# libpng code.
-# MIPS_MMI_API: (PNG_MIPS_MMI == 1) allow the optimization to be switched on
-# with png_set_option
-# MIPS_MMI_CHECK: (PNG_MIPS_MMI == 1) compile a run-time check to see if MMI
-# extensions are supported.
+# MIPS_MMI_OPT:
+# unset: check at compile time
+# (__mips_loongson_mmi must be defined by the compiler, as a result of
+# passing "-mloongson-mmi -march=loongson3a" to the compiler options)
+# 0: disable (even if the CPU supports MMI)
+# 1: check at run time (via MIPS_MMI_{API,CHECK})
+# 2: switch on unconditionally
+# (inadvisable - instead, pass "-mloongson-mmi -march=loongson3a" to the
+# compiler)
+# NOTE:
+# When building libpng, avoid using any setting other than '0';
+# '1' is set automatically when either 'API' or 'CHECK' are configured in;
+# '2' should not be necessary, as "-mloongson-mmi -march=loongson3a" will
+# achieve the same effect as well as applying the MMI optimizations to the
+# rest of libpng.
+#
+# MIPS_MMI_API:
+# (PNG_MIPS_MMI == 1)
+# Allow the optimization to be switched on with png_set_option.
+#
+# MIPS_MMI_CHECK:
+# (PNG_MIPS_MMI == 1)
+# Compile a run-time check to see if MMI extensions are supported.
+#
setting MIPS_MMI_OPT
option MIPS_MMI_API disabled requires ALIGNED_MEMORY enables SET_OPTION,
sets MIPS_MMI_OPT 1
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,6 +1,6 @@
/* pnglibconf.h - library build configuration */
-/* libpng version 1.6.42 */
+/* libpng version 1.6.43 */
/* Copyright (c) 2018-2024 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/pngwin.rc
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/pngwin.rc 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/pngwin.rc 2024-02-24 01:06:57 UTC (rev 70115)
@@ -89,12 +89,12 @@
#endif /* PNG_USER_VERSIONINFO_COMPANYNAME */
VALUE "FileDescription", "PNG image compression library\000"
VALUE "FileVersion", PNG_LIBPNG_VER_STRING "\000"
- VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_DLLNUM) PNG_LIBPNG_DLLFNAME_POSTFIX " (Windows 32 bit)\000"
- VALUE "LegalCopyright", "\251 1998-2009 Glenn Randers-Pehrson et al.\000"
+ VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_SHAREDLIB) PNG_LIBPNG_DLLFNAME_POSTFIX " (Windows)\000"
+ VALUE "LegalCopyright", "\251 1998-2024 PNG Reference Library Authors\000"
#ifdef PNG_USER_VERSIONINFO_LEGALTRADEMARKS
VALUE "LegalTrademarks", PNG_USER_VERSIONINFO_LEGALTRADEMARKS "\000"
#endif /* PNG_USER_VERSIONINFO_LEGALTRADEMARKS */
- VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_DLLNUM) PNG_LIBPNG_DLLFNAME_POSTFIX ".DLL\000"
+ VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_SHAREDLIB) PNG_LIBPNG_DLLFNAME_POSTFIX ".DLL\000"
#ifdef PNG_USER_PRIVATEBUILD
VALUE "PrivateBuild", PNG_USER_PRIVATEBUILD "\000"
#endif /* PNG_USER_PRIVATEBUILD */
Modified: trunk/Build/source/libs/libpng/libpng-src/scripts/smakefile.ppc
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/scripts/smakefile.ppc 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/scripts/smakefile.ppc 2024-02-24 01:06:57 UTC (rev 70115)
@@ -11,13 +11,12 @@
OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8
LIBNAME = libpng.a
AR = ppc-amigaos-ar
-AR_FLAGS = cr
+ARFLAGS = cr
RANLIB = ppc-amigaos-ranlib
LDFLAGS = -r -o
LDLIBS = ../zlib/libzip.a LIB:scppc.a
LN = ppc-amigaos-ld
RM = delete quiet
-MKDIR = makedir
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
@@ -26,7 +25,7 @@
all: $(LIBNAME) pngtest
$(LIBNAME): $(OBJS)
- $(AR) $(AR_FLAGS) $@ $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
pngtest: pngtest.o $(LIBNAME)
Modified: trunk/Build/source/libs/libpng/libpng-src/tests/pngtest-all
===================================================================
--- trunk/Build/source/libs/libpng/libpng-src/tests/pngtest-all 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/libpng-src/tests/pngtest-all 2024-02-24 01:06:57 UTC (rev 70115)
@@ -1,17 +1,24 @@
#!/bin/sh
-st=0 # exit status (set to 1 if a test fails)
+st=0 # exit status (set to 1 if a test fails)
+skipped=
fail="**FAIL**"
+skip="**SKIP**"
success=" SUCCESS"
TEST(){
# Try to make the log file easier to read:
- test_status="$success"
- echo "=============== PNGTEST $* ===================="
- ./pngtest "$@" || {
- st=$?
- test_status="$fail"
- }
+ echo "=============== pngtest $* ===================="
+ ./pngtest "$@"
+ status=$?
+ case "$status" in
+ 0) test_status="$success";;
+ 77) test_status="$skip"
+ skipped=1;;
+ *) test_status="$fail"
+ st="$status";;
+ esac
echo "===============$test_status $* ===================="
+ return "$status"
}
# The "standard" test
@@ -48,15 +55,17 @@
# variable 'line' below. The pattern matching ignores this because of the
# '*' at the end of the pattern match.
found=
+ skipped=
while read line
do
case "$line" in
*"$2"*) found=1;;
+ *"TEST SKIPPED"*) skipped=1;;
esac
echo "$line" # preserve the original output verbatim
done
# output the missing warning on descriptor 3:
- test -z "$found" && echo "$1: $2" >&3
+ test -z "$found" -a -z "$skipped" && echo "$1: $2" >&3
}
# NOTE: traditionally the Bourne shell executed the last element in a pipe
# sequence in the original shell so it could set variables in the original
@@ -74,7 +83,10 @@
# The exit code is ignored here, the test is that the particular errors
# (warnings) are produced. The original output still ends up in the log
# file.
- TEST "$file" |
+ {
+ TEST "$file"
+ test "$?" -eq 77 && echo "TEST SKIPPED"
+ } |
check_stdout "$file" 'IDAT: Read palette index exceeding num_palette' |
check_stdout "$file" 'Wrote palette index exceeding num_palette' >&4
done
@@ -90,4 +102,6 @@
exit $st
} || st=$?
-exit $st
+test "$st" -gt 0 && exit "$st"
+test -n "$skipped" && exit 77
+exit 0
Modified: trunk/Build/source/libs/libpng/version.ac
===================================================================
--- trunk/Build/source/libs/libpng/version.ac 2024-02-24 00:44:20 UTC (rev 70114)
+++ trunk/Build/source/libs/libpng/version.ac 2024-02-24 01:06:57 UTC (rev 70115)
@@ -8,4 +8,4 @@
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current libpng version
-m4_define([libpng_version], [1.6.42])
+m4_define([libpng_version], [1.6.43])
More information about the tex-live-commits
mailing list.